OSDN Git Service

2004-09-20 Matt Austern <austern@apple.com>
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2004-09-20  Matt Austern <austern@apple.com>
2             Zack Weinberg  <zack@codesourcery.com>
3
4         * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
5         Apply lbasename to input_filename before passing to get_fileinfo.
6         * semantics.c (begin_class_definition): Likewise.
7         * lex.c (handle_pragma_interface): Apply get_fileinfo to the
8         correct filename.  Rename variables to be less confusing.
9         (handle_pragma_implementation): Likewise.  Disable "appears
10         after file is included" diagnostic.
11
12         * parser.c (struct cp_token): Add in_system_header fiag.
13         (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
14         (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
15         (CPP_NONE, cp_lexer_read_token): Delete.
16         (struct cp_lexer): Remove first_token, string_tokens,
17         main_lexer_p fields.  Clarify comments.
18         (struct cp_token_cache): Now just a pair of pointers.
19         (CP_LEXER_BUFFER_SIZE): New #define.
20         (CPP_PURGED): New fake token type.
21         (cp_lexer_new_from_token_array, cp_lexer_destroy)
22         (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
23         (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
24         New functions.
25         (cp_lexer_new_from_tokens): Now a simple wrapper around
26         cp_lexer_new_from_token_array.
27         (cp_lexer_set_source_position_from_token): Also update
28         in_system_header.
29         (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
30         Don't wrap round.
31         (cp_lexer_token_difference): Dont handle wrapping round.
32         (cp_lexer_new_main): Enable pragma deferral and raw strings,
33         read the entire translation unit through c_lex_with_flags into
34         this lexer's buffer, then turn raw strings back off again.
35         (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
36         (cp_lexer_get_preprocessor_token): No need to handle not being
37         the main lexer.  Set token->in_system_header too.
38         (cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
39         to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
40         (cp_lexer_peek_nth_token): Likewise.
41         (cp_lexer_purge_token): Mark the token PURGED, don't shift all
42         the other tokens down.
43         (cp_lexer_purge_tokens_after): Likewise.
44         (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
45         about there being no tokens.
46         (cp_lexer_print_token): Revise to give useful information on
47         all tokens.
48         (struct cp_parser): Add field translate_strings_p.
49         (cp_parser_new): Initialize it.
50         (cp_parser_translation_unit): Destroy the lexer when done.
51         (cp_parser_parameter_declaration): Restructure saving of
52         default arguments.
53         (cp_parser_save_member_function_body): Likewise.
54         (cp_parser_check_for_invalid_template_id)
55         (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
56         Adjust calls to cp_lexer_advance_token.
57         (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
58         No need to fiddle c_lex_string_translate.
59         (cp_parser_primary_expression, cp_parser_linkage_specification)
60         (cp_parser_asm_definition, cp_parser_asm_specification_opt)
61         (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
62         Use cp_parser_string_literal.
63         (cp_parser_attribute_list): Save and restore
64         parser->translate_strings_p, not c_lex_string_translate.
65         (cp_parser_cache_group): Delete.
66         (cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
67         not take a cache argument.
68
69 2004-09-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
70
71         PR c++/14179
72         * decl.c (reshape_init): Extract array handling into...
73         (reshape_init_array): New function. Use integers instead of trees
74         for indices. Handle out-of-range designated initializers.
75
76 2004-09-20  Steven Bosscher  <stevenb@suse.de>
77
78         * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
79         to null_node.
80
81 2004-09-19  Mark Mitchell  <mark@codesourcery.com>
82
83         * decl2.c (determine_visibility): Allow class visibility
84         directives to override targetm.cxx.export_class_data.
85
86 2004-09-18  Kazu Hirata  <kazu@cs.umass.edu>
87
88         * call.c, semantics.c: Follow spelling conventions.
89         * class.c: Fix a comment typo.
90
91 2004-09-16  Geoffrey Keating  <geoffk@apple.com>
92
93         PR pch/13361
94         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
95         (handle_pragma_implementation): Likewise.
96
97 2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
98             Zack Weinberg  <zack@codesourcery.com>
99
100         * cp-tree.def: Use tree_code_class enumeration constants
101         instead of code letters.
102         * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
103         * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
104         Update for new tree-class enumeration constants.
105
106 2004-09-16  Mark Mitchell  <mark@codesourcery.com>
107
108         PR c++/16002
109         * parser.c (cp_parser_simple_declaration): Commit to tentative
110         parses after seeing a decl-specifier.
111         (cp_parser_simple_declaration): Eliminate spurious message.
112         (cp_parser_init_declarator): Adjust error message.
113
114         PR c++/16029
115         * lex.c (unqualified_name_lookup_error): Mark the dummy
116         declaration as used.
117
118         PR c++/17501
119         * parser.c (cp_parser_nested_name_specifier): Do not resolve
120         typename types if the user explicitly said "typename".
121
122 2004-09-16  Andrew MacLeod  <amacleod@redhat.com>
123
124         * error.c (dump_decl): Make sure there is lang_specific info before
125         checking for DTOR and CTOR decls.
126
127 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
128
129         * class.c (copy_virtuals): Remove.
130         (build_primary_vtable): Use copy_list directly.
131         (build_secondary_vtable): Likewise.
132         (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
133         (create_vtable_ptr): Likewise.
134
135 2004-09-16  Kazu Hirata  <kazu@cs.umass.edu>
136
137         * search.c: Follow spelling conventions.
138
139 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
140
141         * cp-tree.h (struct lang_type_class): Make pure_virtuals a
142         VEC(tree).
143         (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
144         comments.
145         * call.c (build_new_method_call): Don't confirm a pure virtual is
146         in CLASSTYPE_PURE_VIRTUALS.  Reorder checks. Make it a warning.
147         * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
148         (fixup_inline_methods, finish_struct): Likewise.
149         * decl.c (finish_method): Likewise.
150         * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
151         CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
152         * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
153         vector to avoid repeating the list in error messages.
154
155 2004-09-15  Mark Mitchell  <mark@codesourcery.com>
156
157         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
158         * cp-tree.h (cxx_comdat_group): Declare.
159         * decl.c (cxx_comdat_group): New function.
160
161 2004-09-15  Nathan Sidwell  <nathan@codesourcery.com>
162
163         * search.c (get_pure_virtuals): Remove unused variables.
164
165         * cp-tree.h (struct lang_decl_flags): Remove
166         needs_final_overrider.
167         (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
168         * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
169         * class.c (finish_struct_bits): Correct comment about
170         CLASSTYPE_PURE_VIRTUALS.
171         * search.c (get_pure_virtuals): Remove useless loop.
172
173 2004-09-14  Mark Mitchell  <mark@codesourcery.com>
174
175         PR c++/17324
176         * mangle.c (partially_mangled_name): New variable.
177         (partially_mangled_name_len): Likewise.
178         (save_partially_mangled_name): New function.
179         (restore_partially_mangled_name): Likewise.
180         (write_encoding): Save and restore partially mangled names around
181         calls to get_mostly_instantiated_function_type.
182         (write_unqualified_name): Likewise.
183
184 2004-09-14  Nathan Sidwell  <nathan@codesourcery.com>
185
186         * pt.c (unify): Replace gcc_unreachable with gcc_assert.
187
188 2004-09-13  Mark Mitchell  <mark@codesourcery.com>
189
190         PR c++/16162
191         * parser.c (cp_parser_id_expression): Correct value for
192         is_declarator.
193         (cp_parser_nested_name_specifier_opt): Look through typenames as
194         necessary.
195         (cp_parser_template_name): Honor check_dependency_p.
196
197         PR c++/16716
198         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
199         Robustify.
200
201         PR c++/17327
202         * pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
203         gcc_unreacable.
204
205 2004-09-12  Richard Henderson  <rth@redhat.com>
206
207         PR c++/16254
208         * semantics.c (maybe_cleanup_point_expr): Don't call fold.
209         * typeck.c (condition_conversion): Likewise.
210
211 2004-09-11  Richard Henderson  <rth@redhat.com>
212
213         PR c++/17404
214         * pt.c (cur_stmt_expr): Move from tsubst_expr.
215         (tsubst_expr) <case STMT_EXPR>: Move ...
216         (tsubst_copy_and_build): ... here.
217
218 2004-09-10  Zack Weinberg  <zack@codesourcery.com>
219
220         * cp-tree.h (interface_only, interface_unknown): Delete declarations;
221         comment explaining them moved to c-common.h.
222         * lex.c (interface_only, interface_unknown, extract_interface_info):
223         Delete definitions.
224         (cxx_finish): Don't reset interface_unknown.
225         (handle_pragma_interface): Don't set interface_only and
226         interface_unknown; just the like-named fields in finfo.
227         (handle_pragma_implementation): Adjust comment.
228         * decl2.c (cp_finish_file): Don't reset interface_only and
229         interface_unknown.
230         * method.c (synthesize_method): Don't reset interface_unknown or
231         call extract_interface_info.
232         * pt.c (pop_tinst_level): Don't call extract_interface_info.
233         * decl.c (start_cleanup_fn): Don't save or restore interface_only
234         and interface_unknown.
235         (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
236         and use the result instead of the interface_only/interface_unknown
237         globals.
238         (start_preparsed_function): Likewise.
239         * lex.c (cxx_make_type): Likewise.
240         * semantics.c (begin_class_definition): Likewise.
241         (expand_body): Don't call extract_interface_info.
242
243 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
244
245         * decl.c (objc_mark_locals_volatile): Make description of
246         routine more descriptive; only mark VAR_DECLs at each
247         binding level.
248
249 2004-09-10  Richard Henderson  <rth@redhat.com>
250
251         PR c++/17386
252         * call.c (build_vfield_ref): Move...
253         * class.c (build_vfield_ref): ... here.  Convert datum to the
254         primary base containing the vptr.
255         (make_new_vtable): Simplify build_primary_vtable arguments.
256         (finish_struct_1): Do not duplicate TYPE_VFIELD.
257         * typeck.c (build_class_member_access_expr): Don't warn for
258         null object access to base fields.
259
260 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
261
262         * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
263         New functions, to be called from ObjC++.
264
265 2004-09-10  Kazu Hirata  <kazu@cs.umass.edu>
266
267         * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
268         name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
269         comment typos.
270
271 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
272
273         * typeck.c (build_c_cast): Preserve the cast if casting
274         to and from an Objective-C type.
275
276 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
277
278         * Make-lang.in (cp/typeck.o): Depend on c-common.h.
279         * typeck.c: Include c-common.h.
280         (comptypes): For RECORD_TYPEs, call objc_comptypes() and
281         return the result if nonnegative.
282
283 2004-09-09  Zack Weinberg  <zack@codesourcery.com>
284
285         * decl2.c (import_export_class)
286         * lex.c (handle_pragma_interface):
287         Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
288
289 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
290
291         * Make-lang.in (cp/semantics.o): Depend on c-common.h.
292         * semantics.c: Include c-common.h.
293         (finish_compound_stmt): Call objc_clear_super_receiver().
294
295 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
296
297         * cp-tree.h (do_poplevel): New prototype.
298         * semantics.c (do_poplevel): Make externally visible.
299
300 2004-09-08  Nathan Sidwell  <nathan@codesourcery.com>
301
302         * cp-tree.h (tree_pair_s): Define a GC'd vector.
303         * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
304         * semantics.c (deferred_access): Likewise.
305
306 2004-09-06  Daniel Jacobowitz  <dan@debian.org>
307
308         * semantics.c (expand_body): Assert that we are not nested.
309
310 2004-09-06  Zack Weinberg  <zack@codesourcery.com>
311
312         * decl.c (build_enumerator): Use add_double and int_fits_type_p
313         instead of cp_build_binary_op, to avoid creating short-lived trees.
314         * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
315         lookahead instead of backtracking.  Move some code to avoid a
316         conditional branch.
317         (cp_parser_enum_specifier): Avoid duplication of effort with caller.
318         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
319         (cp_parser_enumerator_list, cp_parser_enumerator_definition):
320         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
321
322 2004-09-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
323
324         * decl.c (grok_declarator): Remove a redundant semicolon.
325
326         * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
327         Correct comments describing function parameters.
328
329 2004-09-03  Matt Austern  <austern@apple.com>
330         Compile speed improvement.
331         * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
332         Otherwise define a stub macro that expands to nothing.
333         (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set.  Otherwise
334         define a stub macro that expands to 0.
335         (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
336         (cp_lexer_stop_debugging): Likewise.
337         (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set.  Otherwise
338         define a stub macro that expands to NULL.
339         (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
340         (cp_lexer_new_from_tokens): Likewise.
341
342 2004-09-03  Jan Hubicka  <jh@suse.cz>
343
344         * decl.c (finish_function): Clean out pointers we no longer need.
345
346 2004-09-03  Jan Beulich  <jbeulich@novell.com>
347
348         * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
349         than "-lm".
350
351 2004-09-02  Paul Brook  <paul@codesourcery.com>
352
353         * decl2.c (determine_visibility): Only check data visibility
354         for VAR_DECLS.
355
356 2004-08-31  Mark Mitchell  <mark@codesourcery.com>
357
358         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
359         * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
360         * decl2.c (determine_visibility): Honor
361         TARGET_CXX_EXPORT_CLASS_DATA.
362
363         * class.c (key_method): Rename to ...
364         (determine_key_method): ... this.
365         (finish_struct_1): Adjust accordingly.
366         * cp-tree.h (key_method): Declare.
367         * decl2.c (maybe_emit_vtables): Determine the key method here if
368         it has not already been done.
369
370 2004-08-31  Ziemowit Laski  <zlaski@apple.com>
371
372         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
373         (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
374         (cp/cp-decl.c): Do not depend on gtype-cp.h.
375         (cp/cp-objcp-common.o): New target.
376         * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
377         (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
378         cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
379         prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
380         respectively.
381         (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
382         LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
383         LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
384         LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
385         LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
386         LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
387         LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
388         LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
389         LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
390         LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
391         LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
392         LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
393         LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
394         LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
395         LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
396         LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
397         LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
398         LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
399         LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
400         LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
401         LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
402         LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
403         LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
404         LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
405         LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
406         LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
407         LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
408         LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
409         LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
410         LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
411         LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
412         hooks to cp-objcp-common.h.
413         (finish_file): New function.
414         * cp-objcp-common.c: New file.
415         * cp-objcp-common.h: New file.
416         * cp-tree.h (cp_finish_file): New prototype.
417         * decl.c: Do not include gtype-cp.h.
418         * decl2.c (finish_file): Rename to cp_finish_file.
419
420 2004-08-31  Richard Henderson  <rth@redhat.com>
421
422         PR c++/17221
423         * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
424         (tsubst_copy_and_build): ... here.
425
426 2004-08-30  Mark Mitchell  <mark@codesourcery.com>
427
428         * cp-tree.h (initialize_artificial_var): Declare.
429         * decl.c (initialize_artifical_var): New function.
430         * class.c (initialize_array): Remove.
431         (initialize_vtable): Use initialize_artificial_var.
432         (build_vtt): Likewise.
433         (build_ctor_vtbl_group): Likewise.
434
435 2004-08-30  Richard Henderson  <rth@redhat.com>
436
437         * class.c (build_base_path): Use build_address directly.
438         * typeck.c (build_unary_op): Don't lower &a.b to pointer
439         arithmetic directly.
440         * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
441         means !initializer_constant_valid_p.
442
443 2004-08-30  Richard Henderson  <rth@redhat.com>
444
445         * class.c (fixed_type_or_null): Use get_base_address before
446         assuming an ADDR_EXPR is non-null.
447
448 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
449
450         * name-lookup.c (pop_binding, pushdecl,
451         set_identifier_type_value_with_scope, push_overloaded_decl,
452         arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
453         * parser.c (cp_parser_diagnose_invalid_type_name,
454         cp_parser_postfix_expression, cp_parser_unary_expression,
455         cp_parser_check_declarator_template_para): Likewise.
456         * pt.c (push_inline_template_parms_recursive,
457         check_explicit_specialization, convert_nontype_argument,
458         coerce_template_template_parms, uses_template_parms,
459         instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
460         tsubst_expr, instantiate_template,
461         maybe_adjust_types_for_deduction, type_unification_real,
462         resolve_overloaded_unification, template_decl_level,
463         type_dependent_expression_p): Likewise.
464         * search.c (lookup_base_r): Likewise.
465         * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
466         * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
467         verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
468         * typeck.c (common_type, get_member_function_from_ptrfunc,
469         build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
470         * typeck2.c (cxx_incomplete_type_diagnostic,
471         split_nonconstant_init_1, store_init_value,
472         process_init_constructor): Likewise.
473
474 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
475
476         * call.c (check_dtor_name): Replace abort with gcc_assert or
477         gcc_unreachable.
478         (build_call, add_builtin_candidate, build_new_op,
479         convert_like_real, build_over_call, in_charge_arg_for_name,
480         source_type, joust): Likewise.
481         * class.c (build_simple_base_path, get_vcall_index,
482         finish_struct_1, instantiate_type, get_enclosing_class,
483         add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
484         * cp-gimplify.c (cp_genericize): Likewise.
485         * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
486         * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
487         * decl.c (poplevel, make_unbound_class_template, reshape_init,
488         check_special_function_return_type, grokdeclarator,
489         grok_op_properties, tag_name, xref_tag, start_preparsed_function,
490         finish_function): Likewise.
491         * decl2.c (grokfield, maybe_emit_vtables):Likewise.
492         * error.c (dump_global_iord, dump_decl, dump_template_decl,
493         language_to_string): Likewise.
494         * except.c (choose_personality_routine): Likewise.
495         * friend.c (do_friend): Likewise.
496         * g++spec.c (lang_specific_driver): Likewise.
497         * init.c (build_zero_init, expand_default_init, build_new_1,
498         build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
499         * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
500         * mangle.c (add_substitution, write_unscoped_name,
501         write_template_prefix, write_identifier,
502         write_special_name_destructor, write_type, write_builtin_type,
503         write_expression, write_template_param,
504         write_java_integer_type_codes): Likewise.
505         * method.c (implicitly_declare_fn): Likewise.
506
507 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
508
509         * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
510         (BINFO_INDIRECT_PRIMARY_P): Remove.
511         * class.c (determine_primary_base): Rename to ...
512         (determine_primary_bases): ... here.  Set all primary bases.
513         (set_primary_base): Remove.
514         (mark_primary_bases): Remove.
515         (build_simple_base_path, walk_subobject_offsets,
516         propagate_binfo_offsets, end_of_class): Adjust.
517         (layout_class_type): Rename determine_primary_base call.
518         (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
519         to type_as_string.
520         (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
521         build_rtti_vtbl_entries): Adjust.
522         * init.c (build_vtbl_address): Adjust.
523
524         * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
525
526 2004-08-28  Ziemowit Laski  <zlaski@apple.com>
527
528         * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
529         CXX_AND_OBJCXX_OBJS.
530         (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
531         separately on the link line.
532
533 2004-08-28  Jason Merrill  <jason@redhat.com>
534
535         * decl.c (expand_static_init): Avoid bogus warnings.
536
537 2004-08-27  Jason Merrill  <jason@redhat.com>
538
539         PR c++/16851
540         * tree.c (stabilize_init): See through a COMPOUND_EXPR.
541
542         PR c++/13684
543         * decl.c (expand_static_init): Use thread-safety API.
544         (register_dtor_fn): Return the call, don't expand it.
545         * tree.c (add_stmt_to_compound): New fn.
546         (stabilize_call): Use it.
547
548 2004-08-27  Richard Henderson  <rth@redhat.com>
549
550         * cp-tree.def (OFFSETOF_EXPR): New.
551         * parser.c (cp_parser_builtin_offsetof): Either built an
552         OFFSETOF_EXPR, or call fold_offsetof immediately.
553         * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
554
555 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
556
557         * call.c (validate_conversion_obstack): Replace
558         my_friendly_assert with gcc_assert or gcc_unreachable.
559         (direct_reference_binding, merge_conversion_sequences,
560         build_user_type_conversion_1, perform_overload_resolution,
561         build_op_delete_call, enforce_access, call_builtin_trap,
562         build_over_call, build_special_member_call, build_new_method_call,
563         initialize_reference): Likewise.
564         * class.c (build_base_path, build_primary_vtable, alter_access,
565         check_bases, update_vtable_entry_for_fn, layout_empty_base,
566         clone_function_decl, adjust_clone_args,
567         type_requires_array_cookie, include_empty_classes,
568         finish_struct_1, resolve_address_of_overloaded_function,
569         instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
570         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
571         accumulate_vtbl_inits, build_vtbl_initializer,
572         build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
573         * cvt.c (build_up_reference, convert_to_reference): Likewise.
574         * decl.c (poplevel, duplicate_decls, make_typename_type,
575         cxx_init_decl_processing, reshape_init, check_initializer,
576         make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
577         expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
578         grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
579         xref_basetypes, start_preparsed_function, save_function_data,
580         finish_function, finish_method, maybe_register_incomplete_var,
581         complete_vars): Likewise.
582         * decl2.c (grok_array_decl, check_member_template,
583         check_classfn, finish_static_data_member_decl, coerce_new_type,
584         coerce_delete_type, import_export_class, decl_needed_p,
585         determine_visibility, import_export_decl, build_cleanup,
586         start_static_initialization_or_destructi, do_static_destruction,
587         prune_vars_needing_no_initialization,
588         build_offset_ref_call_from_tree): Likewise.
589         * error.c (dump_decl, dump_expr): Likewise.
590         * init.c (finish_init_stmts, build_zero_init,
591         expand_virtual_init, expand_default_init, expand_aggr_init_1,
592         build_offset_ref, build_new_1, build_delete, build_vbase_delete):
593         Likewise.
594         * mangle.c (write_method_parms, write_template_args,
595         write_expression, write_template_arg): Likewise.
596         * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
597         * name-lookup.c (pop_binding, begin_scope, leave_scope,
598         resume_scope, push_using_decl, validate_nonmember_using_decl,
599         is_ancestor, poplevel_class, set_inherited_value_binding_p,
600         push_class_level_binding, do_class_using_decl, push_namespace,
601         pop_namespace, add_using_namespace, ambiguous_decl,
602         lookup_namespace_name, lookup_type_current_level,
603         maybe_process_template_type_declaration): Likewise.
604         * parser.c (cp_lexer_peek_nth_token,
605         cp_parser_parse_and_diagnose_invalid_typ,
606         cp_parser_translation_unit, cp_parser_template_id,
607         cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
608         * pt.c (push_access_scope, finish_member_template_decl,
609         push_inline_template_parms_recursive, add_outermost_template_args,
610         get_innermost_template_args, begin_explicit_instantiation,
611         end_explicit_instantiation, retrieve_specialization,
612         is_specialization_of, is_specialization_of_friend,
613         register_specialization, check_explicit_specialization,
614         comp_template_parms, process_template_parm,
615         process_partial_specialization, convert_nontype_argument,
616         coerce_template_template_parms, coerce_template_parms,
617         mangle_class_name_for_template, lookup_template_function,
618         lookup_template_class, instantiate_class_template, tsubst_decl,
619         tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
620         instantiate_template, fn_type_unification, type_unification_real,
621         get_template_base, regenerate_decl_from_template,
622         template_for_substitution, instantiate_decl,
623         get_mostly_instantiated_function_type, dependent_scope_ref_p,
624         value_dependent_expression_p, resolve_typename_type): Likewise.
625         * repo.c (repo_emit_p): Likewise.
626         * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
627         create_tinfo_types, emit_tinfo_decl): Likewise.
628         * search.c (lookup_base_r, lookup_base, lookup_field_1,
629         dfs_access_in_type, build_baselink, lookup_member,
630         adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
631         * semantics.c (perform_or_defer_access_check,
632         finish_non_static_data_member, finish_stmt_expr_expr,
633         finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
634         finish_template_template_parm, finish_member_declaration,
635         emit_associated_thunks): Likewise.
636         * tree.c (build_target_expr_with_type, force_target_expr,
637         copy_binfo, get_first_fn, cp_tree_equal): Likewise.
638         * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
639         cxx_sizeof_or_alignof_type, perform_integral_promotions,
640         build_class_member_access_expr, finish_class_member_access_expr,
641         build_ptrmemfunc_access_expr, build_unary_op,
642         unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
643         build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
644         * typeck2.c (complete_type_check_abstract,
645         abstract_virtuals_error, process_init_constructor,
646         add_exception_specifier): Likewise.
647
648 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
649
650         * class.c (build_vtbl_initializer): Use ssize_int.
651         * decl.c (complete_array_type): Likewise.
652         * method.c (finish_thunk): Likewise.
653         * search.c (get_dynamic_base_type): Likewise.
654
655 2004-08-26  Richard Henderson  <rth@redhat.com>
656
657         * cp-tree.h (DECL_FIELD_IS_BASE): New.
658         * class.c (build_base_field): Set it.
659         (build_simple_base_path): Use it.
660         (fixed_type_or_null): Don't consider base fields definitive.
661
662 2004-08-25  Roger Sayle  <roger@eyesopen.com>
663
664         PR middle-end/16693
665         PR tree-optimization/16372
666         * decl.c (finish_enum): Make the precision of the enumerated type
667         the same width as the underlying integer type.
668
669 2004-08-25  Mark Mitchell  <mark@codesourcery.com>
670
671         PR c++/17155
672         * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
673         functions.
674
675         * mangle.c (get_identifier_nocopy): Add cast.
676
677         * cp-tree.h (mangle_type): Remove.
678         * mangle.c (globals): GTY it.
679         (mangle_obstack): New variable.
680         (name_obstack): Likewise.
681         (name_base): Likewise.
682         (write_char): Adjust accordingly.
683         (write_chars): Likewise.
684         (write_string): Likewise.
685         (start_mangling): Initialize G.substitutions only one.  Add
686         ident_p parameter.
687         (finish_mangling): Use VARRAY_CLEAR to reclaim
688         storage in G.substitutions.  Use obstack_finish.
689         (init_mangle): Adjust for changes to variable names above.
690         Initialize G.substitutions.
691         (mangle_decl_string): Adjust call to start_mangling.
692         (get_identifier_nocopy): New function.
693         (mangle_decl): Use it.
694         (mangle_type_string): Adjust call to start_mangling.
695         (mangle_special_for_type): Likewise.
696         (mangle_vtt_for_type): Likewise.
697         (mangle_ctor_vtbl_for_type): Likewise.
698         (mangle_thunk): Likewise.
699         (mangle_guard_variable): Likewise.
700         (mangle_ref_init_variable): Likewise.
701
702 2004-08-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
703
704         PR c++/14428
705         * pt.c (redeclare_class_template): Check the type of non-type and
706         template template parameter.
707
708 2004-08-25  Nathan Sidwell  <nathan@codesourcery.com>
709
710         * call.c (convert_class_to_reference): Adjust build_int_cst calls.
711         (build_user_type_conversion_1, convert_like_real,
712         build_java_interface_fn_ref, build_special_member_call): Likewise.
713         * class.c (finish_struct_1, build_vtbl_initializer): Likewise.
714         * cp-gimplify.c (cp_gimplify_expr): Likewise.
715         * cvt.c (cp_convert_to_pointer): Likewise.
716         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
717         * decl2.c (start_static_initialization_or_destruction,
718         generate_ctor_or_dtor_function): Likewise.
719         * except.c (build_throw): Likewise.
720         * mangle.c (write_integer_cst): Likewise.
721         * method.c (finish_thunk): Likewise.
722         * rtti.c (build_headof, get_tinfo_decl_dynamic,
723         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
724         get_pseudo_ti_init): Likewise.
725         * search.c (get_dynamic_cast_base_type): Likewise.
726
727 2004-08-25  Zack Weinberg  <zack@codesourcery.com>
728
729         * class.c, search.c: Remove references to DWARF_DEBUG.
730
731 2004-08-25  Adam Nemet  <anemet@lnxw.com>
732
733         * repo.c (extract_string): Reset backquote after one character.
734         (get_base_filename): Fix indentation.
735
736 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
737
738         * decl.c (cxx_init_decl_processing): Adjust
739         build_common_tree_nodes call.
740
741 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
742
743         PR c++/16889
744         * (is_subobject_of_p): Resurrect & optimize.
745         (lookup_field_r): Use it.
746
747 2004-08-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
748
749         PR c++/16706
750         * search.c (friend_accessible_p): Increment processing_template_decl
751         when deal with TEMPLATE_DECL of SCOPE.
752
753 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
754
755         PR c++/17149
756         * semantics.c (check_accessibility_of_qualified_id): Defer check
757         if qualifying_type is a template parameter.
758
759 2004-08-23  Mark Mitchell  <mark@codesourcery.com>
760
761         PR c++/17163
762         * pt.c (instantiate_decl): Do not try to apply
763         DECL_DECLARED_INLINED_P to a VAR_DECL.
764
765         * search.c (build_baselink): Fix typo in comment.
766
767 2004-08-22 Andrew Pinski  <apinski@apple.com>
768
769         Revert:
770         2004-08-22  Andrew Pinski  <apinski@apple.com>
771         PR c++/14029
772         * typeck.c (build_unary_op): Use &a.b if the folded lowered
773         expression is not constant.
774
775 2004-08-23  Nathan Sidwell  <nathan@codesourcery.com>
776
777         * name-lookup.c (pushdecl): Rename build_type_copy call.
778         * tree.c (cp_build_qualified_type_real,
779         build_exception_variant, handle_java_interface_attribute): Likewise.
780
781 2004-08-22  Andrew Pinski  <apinski@apple.com>
782
783         PR c++/14029
784         * typeck.c (build_unary_op): Use &a.b if the folded lowered
785         expression is not constant.
786
787 2004-08-20  Mark Mitchell  <mark@codesourcery.com>
788
789         PR c++/17121
790         * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P.
791
792 2004-08-21  Joseph S. Myers  <jsm@polyomino.org.uk>
793
794         PR c++/17120
795         * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for
796         MODOP_EXPR.
797
798 2004-08-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
799
800         * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION
801         before calling comp_template_args.
802
803 2004-08-20  Nathan Sidwell  <nathan@codesourcery.com>
804
805         * class.c (build_vtbl_initializer): Use build_int_cst for
806         negative size types.
807         * decl.c (complete_array_type): Likewise.
808         * method.c (finish_thunk): Likewise.
809
810 2004-08-20  Andreas Tobler  <a.tobler@schweiz.ch>
811
812         * tree.c: Remove unused mark_local_for_remap_r.
813
814 2004-08-19  Eric Christopher  <echristo@redhat.com>
815
816         * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
817         * tree.c (cxx_unsave_expr_now): Delete.
818         (cp_unsave_r): Ditto.
819
820 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
821
822         PR c++/15890
823         * pt.c (push_template_decl_real): Disallow template allocation
824         functions with fewer than two parameters.
825
826 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
827
828         * cp-tree.h (build_shared_int_cst): Remove.
829         * tree.c (shared_int_cache): Remove.
830         (build_shared_int_cst): Remove.
831         * class.c (finish_struct_1): Use build_int_cst.
832
833 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
834
835         * decl.c (finish_enum): Do not copy value node early, copy
836         later.
837         * lex.c (cxx_init): Force null_node to be unique.
838
839 2004-08-19  Joseph S. Myers  <jsm@polyomino.org.uk>
840
841         PR c++/17041
842         * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
843         from input for MODOP_EXPR.
844
845 2004-08-18  Mark Mitchell  <mark@codesourcery.com>
846
847         * pt.c (dependent_template_p): Fix typo in commment.
848
849         PR c++/17068
850         * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
851         dependent.
852
853 2004-08-17  Mark Mitchell  <mark@codesourcery.com>
854
855         PR c++/16246
856         * pt.c (unify): Tidy ARRAY_TYPE handling.  Make sure that non-type
857         arguments have the same type as the corresponding parameter.
858
859         PR c++/16215
860         * parser.c (cp_parser_name_lookup_error): If parser->object_scope
861         is set use it for diagnostic purposes.
862         (cp_parser_pseudo_destructor_name): Remove special-case error
863         message.
864
865         PR c++/15871
866         * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions.
867
868         PR c++/16965
869         * cp-tree.h (qualified_name_lookup_error): Add parameter.
870         * name-lookup.c (do_class_using_decl): Restrict set of entities
871         passed to cp_emit_debug_info_for_using more carefully.
872         (lookup_qualified_name): Allow lookup_member to return sets of
873         ambiguous entries.
874         * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter.
875         (cp_parser_primary_expression): Handle ambiguous lookups.
876         (cp_parser_template_name): Adjust use of cp_parser_lookup_name.
877         (cp_parser_template_argument): Likewise.
878         (cp_parser_elaborate_type_specifier): Likewise.
879         (cp_parser_namespace_name): Likewise.
880         (cp_parser_class_name): Likewise.
881         (cp_parser_lookup_name_simple): Likewise.
882         * pt.c (tsubst_qualified_id): Handle ambiguous results.
883         (tsubst_expr): Likewise.
884         * semantics.c (qualified_name_lookup_error): Add decl paramter.
885         For ambiguous lookups, print candidates.
886
887 2004-08-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
888
889         PR c++/6749
890         * pt.c (instantiate_pending_templates): Add int parameter.  Don't
891         return anything.
892         * cp-tree.h (instantiate_pending_templates): Adjust prototype.
893         * decl2.c (finish_file): Adjust call to
894         instantiate_pending_templates.
895
896 2004-08-15  Roger Sayle  <roger@eyesopen.com>
897
898         * call.c (build_vfield_ref, build_call, build_conditional_expr,
899         convert_arg_to_ellipsis, build_x_va_arg, build_over_call,
900         build_java_interface_fn_ref, build_special_member_call,
901         build_new_method_call, initialize_reference): Replace calls to
902         build with calls to buildN.
903         * class.c (build_base_path, convert_to_base_statically,
904         build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits,
905         build_vtbl_initializer): Likewise.
906         * cp-gimplify.c (genericize_try_block, genericize_catch_block,
907         gimplify_if_stmt, cp_genericize_r): Likewise.
908         * cvt.c (convert_to_void): Likewise.
909         * decl.c (check_initializer, finish_constructor_body,
910         finish_destructor_body): Likewise.
911         * error.c (dump_expr): Likewise.
912         * except.c (build_exc_ptr, expand_start_catch_block, build_throw):
913         Likewise.
914         * init.c (perform_member_init, expand_virtual_init,
915         expand_cleanup_for_base, build_init, expand_default_init,
916         build_offset_ref, decl_constant_value, build_new, build_new_1,
917         build_vec_delete_1, build_vec_init, build_delete,
918         push_base_cleanups, build_vec_delete): Likewise.
919         * mangle.c (write_integer_cst): Likewise.
920         * method.c (thunk_adjust, do_build_copy_constructor,
921         do_build_assign_ref): Likewise.
922         * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build,
923         unify, build_non_dependent_expr): Likewise.
924         * rtti.c (build_headof, build_typeid, ifnonnull,
925         build_dyanmic_cast_1, tinfo_base_init): Likewise.
926         * semantics.c (begin_compound_stmt, finish_call_expr,
927         finish_pseudo_destructor_expr, finish_id_expression,
928         simplify_aggr_init_expr, finalize_nrv_r): Likewise.
929         * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top,
930         array_type_nelts_total, stabilize_call): Likewise.
931         * typeck.c (decay_conversion, build_class_member_access_expr,
932         lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref,
933         get_member_function_from_ptrfunc, build_binary_op, pointer_diff,
934         build_x_unary_op, build_unary_op, unary_complex_lvalue,
935         build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst,
936         check_return_expr): Likewise.
937         * typeck2.c (split_nonconstant_1, split_nonconstant_init_1,
938         split_nonconstant_init, store_init_value, build_m_component_ref):
939         Likewise.
940
941 2004-08-15  Nathan Sidwell  <nathan@codesourcery.com>
942
943         * call.c (convert_class_to_reference,
944         build_user_type_conversion_1, convert_like_real,
945         build_java_interface_fn_ref, build_special_member_call): Use
946         build_int_cst.
947         * class.c (build_vtbl_initializer): Likewise.
948         * cp-gimplify.c (cp_gimplify_expr): Likewise.
949         * cvt.c (cp_convert_to_pointer): Likewise.
950         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
951         * decl2.c (start_static_initialization_or_destruction,
952         generate_ctor_or_dtor_function): Likewise.
953         * except.c (build_throw): Likewise.
954         * lex.c (cxx_init): Likewise.
955         * mangle.c (write_integer_cst): Likewise.
956         * rtti.c (build_headof, get_tinfo_decl_dynamic,
957         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
958         get_pseudo_ti_init): Likewise.
959         * search.c (get_dynamic_cast_base_type): Likewise.
960         * tree.c (build_shared_int_cst): Likewise.
961
962 2004-08-12  Mark Mitchell  <mark@codesourcery.com>
963
964         PR c++/16273
965         * class.c (count_depth_data): New type.
966         (dfs_depth_post): New function.
967         (dfs_depth_q): Likewise.
968         (find_final_overrider_data_s): Change type of vpath.
969         Add vpath_list.
970         (dfs_find_final_overrider_1): New function.
971         (dfs_find_final_overrider): Use it.
972         (dfs_find_final_overrider_q): Adjust use of vpath.
973         (dfs_find_final_overrider_post): Likewise.
974         (find_final_overrider): Use dfs_depth.  Allocate and deallocate
975         vpath_list.
976
977 2004-08-12 Jan Beulich <jbeulich@novell.com>
978
979         * parser.c (cp_parser_asm_definition): Properly consume scope operator
980         tokens preceding the clobbers. Don't check for scope operator
981         following inputs. Simplify inputs handling to match that now used for
982         clobbers.
983
984 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
985
986         PR c++/16698
987         * except.c (build_throw): Allocate cleanup_type and the function
988         for __cxa_throw separately.
989
990         PR c++/16853
991         * call.c (standard_conversion): Do not accept conversions between
992         pointers to members if the class types are unrelated.
993
994         PR c++/16618
995         * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile
996         char &" instead of just "char &".
997
998         PR c++/16870
999         * pt.c (tsubst): Just return the unknown_type_node.
1000
1001 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
1002
1003         PR c++/16964
1004         * parser.c (cp_parser_class_specifier): Robustify.
1005
1006         PR c++/16904
1007         * pt.c (tsubst_copy_and_build): Complain about invalid
1008         qualification.
1009
1010         PR c++/16929
1011         * pt.c (tsubst_default_argument): Clear out current_class_ptr and
1012         current_class_ref while tsubsting.
1013
1014 2004-08-10  Mark Mitchell  <mark@codesourcery.com>
1015
1016         PR c++/16971
1017         * parser.c (cp_parser_init_declarator): Robustify.
1018
1019 2004-08-06  Richard Sandiford  <rsandifo@redhat.com>
1020
1021         * typeck2.c (process_init_constructor): Guard the missing field warning
1022         with warn_missing_field_initializers rather than extra_warnings.
1023
1024 2004-08-06  Paolo Bonzini  <bonzini@gnu.org>
1025
1026         * class.c (instantiate_type) <ENTRY_VALUE_EXPR>: Do not handle.
1027
1028 2004-08-05  Mark Mitchell  <mark@codesourcery.com>
1029
1030         * decl.c (start_preparsed_function): Move determine_visibility
1031         call.
1032         * decl2.c (determine_visibility): Incorporate dllexport testing.
1033
1034 2004-08-05  Geoffrey Keating  <geoffk@apple.com>
1035
1036         * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option
1037         means that libstdc++ is needed.
1038
1039 2004-08-05  Nathan Sidwell  <nathan@codesourcery.com>
1040
1041         * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call.
1042
1043 2004-08-04  Geoffrey Keating  <geoffk@apple.com>
1044
1045         * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
1046         than passing it as a parameter to rest_of_decl_compilation.
1047         * decl2.c (grokfield): Use set_user_assembler_name.
1048
1049 2004-08-04  Nathan Sidwell  <nathan@codesourcery.com>
1050
1051         * decl.c (complete_array_type): Don't gratuitously copy
1052         maxindex. Its type is always set.
1053
1054 2004-08-04  Paul Brook  <paul@codesourcery.com>
1055
1056         * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H.
1057         * cp-tree.h (struct language_function): Rename x_dtor_label to
1058         x_cdtor_label.
1059         (dtor_label): Rename ...
1060         (cdtor_label): ... to this.
1061         * decl.c (begin_constructor_body): Remove.
1062         (check_special_function_return_type): Maybe change the return type.
1063         (grokdeclarator): Pass the class type.
1064         (start_preparsed_function): Constructors may need a return label.
1065         (finish_constructor_body, finish_destructor_body): Set the return
1066         value.
1067         (begin_function_body): Don't call begin_constructor_body.
1068         (finish_function): Don't warn for constructors or destructors.
1069         (implicitly_declare_fn): Maybe change the return type.
1070         * optimize.c: Include target.h.
1071         (maybe_clone_body): Remap the function result.
1072         * semantics.c: Include target.h.
1073         (finish_return_stmt): Maybe jump to return label for constructors.
1074
1075 2004-08-03  Mark Mitchell  <mark@codesourcery.com>
1076
1077         * class.c (build_vtable): Do not set DECL_VISIBILITY here.
1078         (check_field_decls): Or here.
1079         (check_methods): Or here.
1080         (initialize_array): Don't mess with DECL_CONTEXT.
1081         * cp-tree.h (start_decl): Adjust prototype.
1082         (determine_visibility): New function.
1083         * decl.c (duplicate_decls): Remove checks for hidden "operator
1084         new".
1085         (build_library_fn_1): Give all library functions default
1086         visibility.
1087         (start_decl): Add pop_scope_p parameter.  Tidy.
1088         (cp_finish_decl): Do not pop scopes here.  Call
1089         determine_visibility for variable definitions.
1090         (start_preparsed_function): Call determine_visibility.
1091         * decl2.c (determine_visibility): New function.
1092         * method.c (use_thunk): Fix formatting.
1093         * parser.c (cp_parser_condition): Adjust calls to start_decl.
1094         (cp_parser_init_declarator): Likewise.
1095         * pt.c (instantiate_decl): Always call pop_nested_class.
1096         * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY.
1097         (tinfo_base_init): Likewise.
1098
1099 2004-08-02  Mark Mitchell  <mark@codesourcery.com>
1100
1101         PR c++/16707
1102         * name-lookup.c (validate_nonmember_using_decl): Robustify.
1103
1104 2004-08-01  Mark Mitchell  <mark@codesourcery.com>
1105
1106         PR c++/16224
1107         * name-lookup.c (decl_namespace): Remove.
1108         (current_decl_namespace): Use decl_namespace_context instead of
1109         decl_namespace.
1110         (push_decl_namespace): Likewise.
1111         (arg_assoc_class): Likewise.
1112         (arg_assoc_type): Likewise.
1113         * pt.c (check_specialization_namespace): New function.
1114         (maybe_process_partial_specialization): Use it.
1115         (register_specialization): Likewise.
1116
1117         PR c++/16489
1118         * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro.
1119         * call.c (null_ptr_cst_p): Handle variables with constant
1120         initializers.
1121         * pt.c (convert_nontype_argument): Use
1122         DECL_INTEGRAL_CONSTANT_VAR_P.
1123         * semantics.c (finish_id_expression): Likewise.
1124
1125         PR c++/16529
1126         * decl.c (duplicate_decls): Reject duplicate namespace
1127         declarations.
1128
1129         PR c++/16810
1130         * typeck.c (build_ptrmemfunc): Loosen assertion.
1131
1132 2004-08-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1133
1134         * call.c (z_candidate::template_decl): Rename from template.
1135         (add_template_candidate_real): Adjust member reference.
1136         (joust): Likewise.
1137
1138 2004-07-29  Mark Mitchell  <mark@codesourcery.com>
1139
1140         * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
1141         (lang_decl_flags): Narrow the width of "languages".  Add
1142         repo_available_p.
1143         (DECL_NEEDED_P): Remove.
1144         (FOR_EACH_CLONE): New macro.
1145         (DECL_REPO_AVAILABLE_P): Likewise.
1146         (DECL_TINFO_P): Likewise.
1147         (set_linkage_according_to_type): Declare.
1148         (import_export_vtable): Remove.
1149         (import_export_tinfo): Likewise.
1150         (mark_needed): New function.
1151         (decl_needed_p): Likewise.
1152         (note_vauge_linkage_fn): Likewise.
1153         (init_repo): Change prototype.
1154         (repo_template_used): Remove.
1155         (repo_template_instantiated): Likewise.
1156         (repo_emit_p): New function.
1157         (repo_export_class_p): Likewise.
1158         (no_linkage_check): Change prototype.
1159         * class.c (set_linkage_according_to_type): New function.
1160         (build_vtable): Use it.  Do not call import_export_vtable.  Set
1161         DECL_IGNORED_P if appropriate.
1162         * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
1163         (make_rtL_for_nonlocal_decls): Check for template instantiations
1164         explicitly.
1165         (grokfndecl): Adjust call to no_linkage_check.
1166         (set_linkage_for_static_data_member): New function.
1167         (grokvardecl): Use it.  Adjust call to no_linkage_check.
1168         (grokdeclarator): Use set_linkage_for_static_data_member.
1169         * decl2.c (note_vague_linkage_fn): New function.
1170         (note_vague_linkage_var): Likewise.
1171         (finish_static_data_member_decl): Use it.
1172         (import_export_vtable): Remove.
1173         (import_export_class): Use repo_export_class_p.
1174         (var_finalized_p): Simplify.
1175         (maybe_emit_vtables): Simplify.
1176         (mark_needed): New function.
1177         (decl_needed_p): Likewise.
1178         (import_export_decl): Add documentation and consistency checks.
1179         Use repo_emit_p.  Handle virtual tables and RTTI information
1180         here.
1181         (import_export_tinfo): Remove.
1182         (write_out_vars): Call import_export_decl.
1183         (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
1184         whenever one is.
1185         (finish_file): Use decl_needed_p.  Do not call import_export_decl
1186         for undefined static data members.  Do not warn about undefined
1187         inlines when using a repository.
1188         (mark_used): Use note_vague_linkage_fn.  Always defer template
1189         instantiations.
1190         * lex.c (cxx_init): Adjust call to init_repo.  Always set
1191         flag_unit_at_a-time.
1192         * method.c (synthesize_method): Remove unncessary
1193         import_export_decl call.
1194         (implicitly_declare_fn): Use set_linkage_according_to_type.
1195         * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
1196         * pt.c (instantiate_class_template): Don't redundantly add classes
1197         to keyed_classes.  Don't call repo_template_used.
1198         (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
1199         templates with internal linkage.
1200         (check_instantiated_args): Adjust call to no_linkage_check.
1201         (instantiate_template): Use FOR_EACH_CLONE.
1202         (mark_definable): New function.
1203         (mark_decl_instantiated): Use it.
1204         (do_decl_instantiation): Adjust tests for explicit instantiation
1205         after "extern template".
1206         (instantiate_class_member): Do not use repo_template_instantiated.
1207         (do_type_instantiation): Simplify.
1208         (instantiate_decl): Use mark_definable.  Check repo_emit_p.
1209         Simplify.
1210         * repo.c (repo_get_id): Remove.
1211         (original_repo): Remove.
1212         (IDENTIFIER_REPO_USED): Remove.
1213         (IDENTIFIER_REPO_CHOSEN): Remove.
1214         Remove all #if 0'd code.
1215         (repo_template_used): Remove.
1216         (repo_template_instantiated): Remove.
1217         (temporary_obstack_initialized_p): New variable.
1218         (init_repo): Register with lang_post_pch_load.  Avoid creating
1219         identifiers unnecessarily.  Don't use original_repo.  Close the
1220         file here.
1221         (reopen_repo_file_for_write): Not here.
1222         (finish_repo): Always write out a new repository file.
1223         (repo_emit_p): New function.
1224         (repo_export_class_p): Likewise.
1225         * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
1226         (involves_incomplete_p): New function.
1227         (tinfo_base_init): Use it.
1228         (ptr_initializer): Remove non_public_ptr parameter.
1229         (ptm_initializer): Likewise.
1230         (get_pseudo_ti_init): Likewise.
1231         (unemitted_tinfo_decl_p): Remove.
1232         (emit_tinfo_decl): Use import_export_decl.
1233         * semantics.c (expand_body): Move updates of static_ctors and
1234         static_dtors to ...
1235         (expand_or_defer_fn): ... here.
1236         * tree.c (no_linkage_check): Add relaxed_p parameter.
1237
1238 2004-07-28  Eric Christopher  <echristo@redhat.com>
1239
1240         * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
1241
1242 2004-07-28  Nathan Sidwell  <nathan@codesourcery.com>
1243
1244         * cp-tree.h (struct tree_pair_s): New.
1245         (typedef tree_pair_p): New.
1246         (DEF_VEC_O(tree_pair_s)): New.
1247         (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s).
1248         (CLASSTYPE_VCALL_INDICES): Update documentation.
1249         * class.c (get_vcall_index): Adjust.
1250         (add_vcall_offset): Adjust.
1251
1252 2004-07-27  Kelley Cook  <kcook@gcc.gnu.org>
1253
1254         * pt.c, typeck.c: Remove spurious carriage returns.
1255
1256 2004-07-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1257
1258         PR c++/14429
1259         * pt.c (coerce_template_template_parms) <PARM_DECL case>: Only check
1260         when the type of ARG is not dependent.
1261
1262 2004-07-26  Geoffrey Keating  <geoffk@apple.com>
1263
1264         * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
1265         (lang_specific_driver): If the C++ or math library options don't
1266         start with '-l', don't count them as added libraries.
1267
1268 2004-07-26  Nathan Sidwell  <nathan@codesourcery.com>
1269
1270         * decl.c (xref_basetypes): Adjust base access vector creation.
1271         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
1272         access accesses.
1273         * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.
1274
1275 2004-07-26  Niall Douglas  <s_fsfeurope2@nedprod.com>
1276             Brian Ryner  <bryner@brianryner.com>
1277
1278         PR c++/15000
1279         PR c++/9283
1280         * class.c (check_field_decls): Apply hidden visibility if
1281         -fvisibility-inlines-hidden and inlined unless otherwise specified
1282         (build_vtable): Set vtable visibility to class visibility.
1283         (check_field_decls): Default static member visibility to class
1284         visibility.
1285         (check_methods): Default method visibility to class visibility.
1286         * cp-tree.h: Added CLASSTYPE_VISIBILITY and
1287         CLASSTYPE_VISIBILITY_SPECIFIED macro.
1288         * decl.c (duplicate_decls): New logic for merging definition decls
1289         with declaration decls. Added ignore & warning when non default
1290         applied to global operator new or delete.
1291         * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
1292         wherever VISIBILITY was changed
1293         * rtti.c (get_tinfo_decl): Set typeinfo visibility to class
1294         visibility.
1295         (tinfo_base_init): Set typeinfo name visibility to class visibility.
1296
1297 2004-07-25  Bernardo Innocenti  <bernie@develer.com>
1298
1299         * decl.c: Rename all identifiers named `class' to `cl'.
1300         * cp-tree.h: Likewise.
1301
1302 2004-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1303
1304         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
1305         * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
1306         * name-lookup.c (binding_entry_make): Use GGC_NEW.
1307         (binding_table_construct): Use GGC_CNEWVEC.
1308         (binding_table_new): Use GGC_NEW.
1309         (cxx_binding_make): Likewise.
1310         (begin_scope): Likewise.
1311         (push_to_top_level): Use GCC_CNEW.
1312         * parser.c (cp_token_cache_new): Likewise.
1313         (cp_token_cache_push_token): Likewise.
1314         (cp_lexer_new_main): Likewise.
1315         (cp_lexer_new_from_tokens): Likewise.
1316         (cp_parser_context_new): Likewise.
1317         (cp_parser_new): Likewise.
1318         (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
1319         * lex.c (cxx_make_type): Use GGC_CNEW.
1320         (retrofit_lang_decl): Use GGC_NEWVAR.
1321         (cxx_dup_lang_specific_decl): Likewise.
1322         (copy_lang_type): Likewise.
1323         * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
1324         (save_function_data): Likewise.
1325         (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
1326         (cxx_push_function_context): Likewise.
1327
1328 2004-07-25  Richard Henderson  <rth@redhat.com>
1329
1330         * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
1331         DECL_IGNORED_P on RESULT_DECL.
1332         * semantics.c (finalize_nrv): Copy them too.
1333
1334 2004-07-23  Nathan Sidwell  <nathan@codesourcery.com>
1335
1336         * search.c (lookup_conversion_operator): Avoid two loops.
1337         (add_conversions): Remove.
1338         (check_hidden_convs, split_conversions,
1339         lookup_conversions_r):  New.
1340         (lookup_conversions): Use lookup_conversions_r.
1341
1342 2004-07-22  Nathan Sidwell  <nathan@codesourcery.com>
1343
1344         * pt.c (get_template_base): Check type is completable.
1345
1346 2004-07-21  Eric Christopher  <echristo@redhat.com>
1347
1348         * decl.c (poplevel): Inline unused variable checking.
1349         Change formatting.
1350
1351 2004-07-21  Paolo Bonzini  <bonzini@gnu.org>
1352
1353         * typeck.c (build_binary_op): Do not use RDIV_EXPR for
1354         integer vectors.
1355
1356 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1357
1358         PR c++/14497
1359         * pt.c (check_explicit_specialization): Remove extension to accept
1360         specializations without template headers. Fall-through to normal
1361         processing.
1362
1363 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1364
1365         PR c++/509
1366         * pt.c (determine_specialization): New parameter template_count.
1367         Disambiguate between member templates and member functions counting
1368         the template headers.
1369         (check_explicit_specialization): Update caller.
1370         (tsubst_friend_function): Likewise.
1371
1372 2004-07-20  Steven Bosscher  <stevenb@suse.de>
1373
1374         * cp-tree.def (TINST_LEVEL): Make it an 'x' node.
1375         * cp-tree.h (tinst_level_t): New tree type.
1376         (union lang_tree_node): Handle it.
1377         (TINST_LOCATION): New accessor macro.
1378         (make_tinst_level): New prototype.
1379         * cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
1380         * decl.c (cp_tree_node_structure): Likewise.
1381         * error.c (print_instantiation_full_context): Use TINST_LOCATION.
1382         (print_instantiation_partial_context): Likewise.
1383         * pt.c (pop_tinst_level): Likewise.
1384          (push_tinst_level): Use make_tinst_level.
1385         * tree.c (make_tinst_level): New function.
1386         (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.
1387
1388 2004-07-20  Mark Mitchell  <mark@codesourcery.com>
1389
1390         * parser.c (cp_parser_simple_type_specifier): Fix typo.
1391
1392         PR c++/16637
1393         * parser.c (cp_parser_simple_type_specifier): Do not record usage
1394         of globally-qualified names.
1395
1396 2004-07-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1397
1398         PR c++/16175
1399         * error.c (dump_type) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Output
1400         cv qualifier.
1401
1402 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
1403
1404         PR c++/16623
1405         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
1406         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
1407         * class.c (add_implicitly_declared_members): Use
1408         CLASSTYPE_LAZY_ASSIGNMENT_OP.
1409         * method.c (lazily_declare_fn): Clear
1410         CLASSTYPE_LAZY_ASSIGNMENT_OP.
1411         * search.c (lookup_fnfields_1): Check it.
1412
1413 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
1414
1415         * cp-tree.h (vec_binfo_member): Remove.
1416         * tree.c (vec_binfo_member): Remove.
1417
1418         * cp-tree.h (struct lang_type_class): Remove vfields field.
1419         (CLASSTYPE_VFIELDS): Remove.
1420         (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
1421         * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
1422         handling.
1423         (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
1424         (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
1425         * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
1426
1427 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
1428
1429         * cp-tree.h (DEF_VEC_P(tree)): Remove here.
1430         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
1431         Moved to common.
1432         (BINFO_LANG_SLOTS): Remove.
1433         * tree.c (copy_binfo): Adjust BINFO creation and accessors.
1434         * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
1435         * class.c (check_bases): Adjust BINFO accessors.
1436         (determine_primary_base, finish_struct_bits,
1437         maybe_warn_about_overly_private_class, warn_hidden,
1438         walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
1439         warn_about_ambiguous_bases, get_vfield_name,
1440         dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
1441         add_vcall_offset_vtbl_entries_r): Likewise.
1442         * dump.c (cp_dump_tree): Likewise.
1443         * init.c (sort_mem_initializers, expand_member_init, build_delete,
1444         push_base_cleanups): Likewise.
1445         * method.c (do_build_copy_constructor, do_build_assign_ref,
1446         synthesize_exception_spec): Likewise.
1447         name-lookup.c (arg_assoc_class): Likewise.
1448         * pt.c (instantiate_class_template,
1449         get_template_base_recursive): Likewise.
1450         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
1451         * typeck2.c (process_init_constructor): Likewise.
1452         * search.c (lookup_base_r, dynamic_cast_base_recurse,
1453         dfs_access_in_type, dfs_walk_real, look_for_overrides,
1454         types_overlap_p, copied_binfo, original_binfo): Likewise.
1455         (binfo_for_vtable): Remove
1456
1457 2004-07-20  Steven Bosscher  <stevenb@suse.de>
1458
1459         * cp-tree.h (struct lang_decl_flags): Unify the template_info and
1460         thunk_alias, and the access and virtual_offset fields.
1461         (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
1462         * decl.c (finish_case_label): Update c_add_case_node call.
1463
1464 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
1465
1466         Revert patch for PR c++/16623.
1467
1468 2004-07-19  Kelley Cook  <kcook@gcc.gnu.org>
1469
1470         * except.c: Remove two spurious carriage returns.
1471
1472 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
1473
1474         PR c++/16623
1475         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
1476         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
1477         * class.c (add_implicitly_declared_members): Use
1478         CLASSTYPE_LAZY_ASSIGNMENT_OP.
1479         * method.c (lazily_declare_fn): Clear
1480         CLASSTYPE_LAZY_ASSIGNMENT_OP.
1481         * search.c (lookup_fnfields_1): Check it.
1482
1483 2004-07-19  Nathan Sidwell  <nathan@codesourcery.com>
1484
1485         * class.c (add_method): Delay adding the slot until the end.
1486         (determine_primary_base): Adjust VEC_iterate invokation.
1487         (resort_type_method_vec, finish_struct_methods, warn_hidden,
1488         walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
1489         build_vtbl_initializer): Likewise.
1490         * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
1491         build_vbase_delete): Likewise.
1492         * method.c (do_build_copy_constructor): Likewise.
1493         * name-lookup.c (new_class_binding, print_binding_level,
1494         poplevel_class, store_class_bindings, push_to_top_level,
1495         pop_from_top_level): Likewise.
1496         * pt.c (check_explicit_specialization): Likewise.
1497         * search.c (lookup_conversion_operator, lookup_fnfields_1,
1498         get_pure_virtuals, add_conversions, dfs_check_overlap,
1499         binfo_for_vbase): Likewise.
1500
1501 2004-07-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1502
1503         PR c++/12170
1504         * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
1505         innermost set of template arguments during deduction.  Simplify.
1506
1507 2004-07-19  Joseph S. Myers  <jsm@polyomino.org.uk>
1508
1509         * typeck.c (build_modify_expr, build_x_modify_expr): Set
1510         TREE_NO_WARNING on assignments with an operator other than '='.
1511
1512 2004-07-10  Steven Bosscher  <stevenb@suse.de>
1513             Joseph S. Myers  <jsm@polyomino.org.uk>
1514
1515         * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
1516         * decl2.c (grokfield): Don't check current_class_depth via
1517         unused TREE_COMPLEXITY.
1518         * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
1519         to avoid the missing parentheses warning.
1520         Don't set C_SET_EXP_ORIGINAL_CODE.
1521
1522 2004-07-18  Mark Mitchell  <mark@codesourcery.com>
1523
1524         * tree.c (no_linkage_helper): Remove.
1525         (no_linkage_check): Don't use walk_tree_without_duplicates.
1526
1527         * mangle.c (write_expression): Issue a sorry for zero-operand
1528         functional casts.
1529
1530 2004-07-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1531
1532         PR c++/13092
1533         * init.c (build_offset_ref): Build SCOPE_REF with non-null
1534         TREE_TYPE for non-dependent names.
1535         * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
1536         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
1537         unknown_type_node as its TREE_TYPE.
1538         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
1539         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
1540         (dump_expr) <SCOPE_REF case>: Likewise.
1541
1542 2004-07-17  Jason Merrill  <jason@redhat.com>
1543
1544         PR c++/16115
1545         * call.c (type_passed_as): Make the invisible reference type
1546         __restrict.
1547         * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
1548         cp_genericize_r.  Handle invisible reference lowering.
1549         (is_invisiref_parm): New fn.
1550         (cp_genericize): Adjust the types of invisible reference parms.
1551         Don't repeat the walk for clones.
1552         * decl.c (store_parm_decls): Don't generate any code for clones.
1553
1554 2004-07-17  Joseph S. Myers  <jsm@polyomino.org.uk>
1555
1556         * cp-tree.h (builtin_function): Declare.
1557
1558 2004-07-16  Mark Mitchell  <mark@codesourcery.com>
1559
1560         * class.c (finish_struct_methods): Remove unncessary code.
1561         (add_implicitly_declared_members): Create declarations for default
1562         constructors and copy constructors lazily.
1563         * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
1564         lazy_copy_ctor.
1565         (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
1566         (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
1567         * decl2.c (check_classfn): Robustify.
1568         (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
1569         (locate_ctor): Handle lazy default constructors.
1570         (locate_copy): Handle lazy copy constructors.
1571         (implicitly_declare_fn): Make sure we're looking at the
1572         TYPE_MAIN_VARIANT for a class before creating functions.  Don't
1573         set TYPE_HAS_CONSTRUCTOR.
1574         (lazily_declare_fn): New function.
1575         * name-lookup.c (constructor_name_full): Simplify.
1576         * search.c (lookup_fnfields_1): Lazily create methods, as
1577         necessary.
1578         (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
1579
1580 2004-07-16  Steven Bosscher  <stevenb@suse.de>
1581
1582         * cp-tree.h (struct lang_type): Don't have three GTY options on a
1583         single bit GTY desc.
1584
1585 2004-07-16  Richard Henderson  <rth@redhat.com>
1586
1587         * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
1588         * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
1589         * tree.c (cp_copy_res_decl_for_inlining): Remove.
1590
1591 2004-07-16  Nathan Sidwell  <nathan@codesourcery.com>
1592
1593         * class.c (finish_struct_bits): Use for loop.
1594         (propagate_binfo_offsets): Do primary binfo outside of loop.
1595
1596         PR c++/16583
1597         * dump.c (cp_dump_tree): Don't dump the bases if there's no
1598         binfo.
1599
1600         * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
1601
1602 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
1603
1604         * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
1605         has_abstract_assign_ref.  Make methods a VEC(tree) *.
1606         (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
1607         (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
1608         (CLASSTYPE_DESTRUCTORS): Likewise.
1609         (TYPE_HAS_REAL_ASSIGN_REF): Remove.
1610         (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
1611         (add_method): Change prototoype.
1612         * class.c (add_method): Remove error_p parameter.  Adjust for
1613         changes to CLASSTYPE_METHOD_VEC.
1614         (handle_using_decl): Adjust call to add_method.
1615         (maybe_warn_about_overly_private_class): Adjust for
1616         changes to CLASSTYPE_METHOD_VEC.
1617         (resort_type_method_vec): Likewise.
1618         (finish_struct_methods): Likewise.
1619         (check_for_override): Likewise.
1620         (warn_hidden): Likewise.
1621         (add_implicitly_declared_members): Defer creation of assignment
1622         operators.  Adjust call to add_method.
1623         (clone_function_decl): Adjust call to add_method.
1624         (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
1625         (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
1626         * decl.c (grok_special_member_properties): Don't set
1627         TYPE_HAS_ABSTRACT_ASSIGN_REF.
1628         * decl2.c (check_classfn): Adjust for
1629         changes to CLASSTYPE_METHOD_VEC.
1630         * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
1631         (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
1632         (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
1633         (implicitly_declare_fn): Set DECL_SOURCE_LOCATION.  Do not call
1634         cp_finish_decl.
1635         * pt.c (check_explicit_specialization): Adjust for
1636         changes to CLASSTYPE_METHOD_VEC.
1637         (instantiate_class_template): Do not set
1638         TYPE_HAS_ABSTRACT_ASSIGN_REF.
1639         * ptree.c (cxx_print_type): Don't try to print
1640         CLASSTYPE_METHOD_VEC.
1641         * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
1642         * search.c (lookup_field_r): Adjust for
1643         changes to CLASSTYPE_METHOD_VEC.
1644         (lookup_fnfields): Likewise.
1645         (lookup_conversion_operator): Likewise.
1646         (lookup_fnfields_1): Likewise.  Create assignment operators
1647         lazily.
1648         (look_for_overrides_here): Adjust for
1649         changes to CLASSTYPE_METHOD_VEC.
1650         (add_conversions): Likewise.
1651         * semantics.c (finish_member_declaration): Adjust call to add_method.
1652
1653 2004-07-15  Jason Merrill  <jason@redhat.com>
1654
1655         * cp-lang.c (cxx_types_compatible_p): To the middle-end,
1656         references and pointers are compatible.
1657
1658 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
1659
1660         * decl.c (xref_basetypes): Refactor.
1661         * tree.c (copy_base_binfos): Replace with ...
1662         (copy_binfo): ... this. Deep copy the given binfo, (not the just
1663         bases of the given base).
1664         * cp-tree.h (copy_base_binfo): Remove.
1665         (copy_binfo): Declare.
1666
1667 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
1668
1669         * name-lookup.c (set_inherited_value_binding_p): Add class_type
1670         parameter.
1671         (get_class_binding): Adjust.
1672         (push_class_level_binding): Don't use set_inherited_value_binding_p.
1673
1674 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
1675
1676         * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
1677         * decl.c (xref_basetypes): Set it here.
1678
1679         * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here.
1680         Don't check for incomplete base.
1681         (get_vfield_name): Simplify while loop.
1682         * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here.
1683
1684 2004-07-14  Mark Mitchell  <mark@codesourcery.com>
1685
1686         * lex.c (cxx_make_type): Remove call to get_pointer_type.
1687
1688         * cp-tree.h (IDENTIFIER_VALUE): Remove.
1689         (BINFO_PUSHDECLS_MARKED): Likewise.
1690         (maybe_inject_for_scope_var): Likewise.
1691         (push_class_decls): Likewise.
1692         * name-lookup.h (push_class_binding): Remove.
1693         (innermost_non_namespace_value): New function.
1694         (outer_binding): Likewise.
1695         * class.c (add_method): Push bindings before adding to
1696         TYPE_METHODS.
1697         (restore_class_cache): Do not restore class_shadowed.
1698         (pushclass): Do not add USING_DECLs.  Do not call
1699         push_class_decls.
1700         * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c.
1701         * decl.c (pushdecl): Use outer_binding.
1702         (poplevel): Set the scope for an out-of-scope for-loop declaration
1703         appropriately.
1704         (cp_finish_decl): Don't call maybe_inject_for_scope_var.
1705         * name-lookup.c (new_class_binding): New function.
1706         (push_binding): Use it.
1707         (pushdecl): Use innermost_non_namespace_value.
1708         (maybe_inject_for_scope_var): Remove.
1709         (push_class_binding): Remove.
1710         (set_inherited_value_binding_p): New function.
1711         (get_class_binding): New function.
1712         (push_class_level_binding): Assert that the current_class_type is
1713         being defined.
1714         (outer_binding): New function.
1715         (innermost_non_namespace_value): Likewise.
1716         (lookup_name_real): Use outer_binding.
1717         (lookup_name_current_level): Ignore out-of-scope variables.
1718         * pt.c (check_template_shadow): Use innermost_non_namespace_value.
1719         (lookup_template_class): Likewise.
1720         * search.c (dfs_push_type_decls): Remove.
1721         (dfs_push_decls): Likewise.
1722         (setup_class_bindings): Likewise.
1723         (lookup_field_1): Handle USING_DECLs from dependent scopes.
1724         (marked_pushdecls_p): Remove.
1725         (unmarked_pushdecls_p): Remove.
1726         (marked_identifiers): Remove.
1727         (setup_class_bindings): Remove.
1728         (dfs_push_type_decls): Remove.
1729         (dfs_push_decls): Remove.
1730         (push_class_decls): Remove.
1731
1732 2004-07-13  Mark Mitchell  <mark@codesourcery.com>
1733
1734         PR c++/16518
1735         PR c++/16337
1736         * decl.c (grokvardecl): Make declspecs parameter const.
1737         (grokdeclarator): Likewise.  Adjust accordingly.
1738         * decl.h (grokdeclarator): Adjust declaration.
1739         * parser.c (cp_parser_init_declarator): Do not clear
1740         decl_specifiers->attributes.
1741
1742         * cp-tree.h (lang_identifier): Remove class_value.
1743         (IDENTIFIER_CLASS_VALUE): Remove.
1744         (pop_class_decls): Likewise.
1745         (init_search_processing): Likewise.
1746         * class.c (handle_using_decl): Use lookup_member, not
1747         IDENTIFIER_CLASS_VALUE.
1748         (restore_class_cache): New function, split out from ...
1749         (pushclass): ... here.  Do not call clear_identifier_class_values.
1750         (invalidate_class_lookup_cache): Do not clear
1751         IDENTIFIER_CLASS_VALUE.
1752         (popclass): Do not call pop_class_decls.
1753         (maybe_note_name_used_in_class): Do not save names looked up after
1754         the class is complete.  Use lookup_member, not
1755         IDENTIFIER_CLASS_VALUE.
1756         * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c.
1757         * decl.c (cxx_init_decl_processing): Do not call
1758         init_search_processing.
1759         * method.c (do_build_copy_constructor): Remove unnecessary code.
1760         (do_build_assign_ref): Likewise.
1761         * name-lookup.c (pushdecl): Use lookup_member, not
1762         IDENTIFIER_CLASS_VALUE.
1763         (set_identifier_type_value_with_scope): Set TREE_TYPE on the
1764         type_shadowed list.
1765         (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE.
1766         (push_class_binding): Do not set it.
1767         (clear_identifier_class_values): Remove.
1768         (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE.
1769         (store_binding): Do not save it.
1770         (pop_from_top_level): Do not restore it.
1771         * name-lookup.h (cxx_saved_binding): Remove class_value.
1772         (clear_identifier_class_values): Remove.
1773         * ptree.c (cxx_print_identifier): Do not print
1774         IDENTIFIER_CLASS_VALUE.
1775         * search.c (search_obstack): Remove.
1776         (push_stack_level): Remove.
1777         (pop_stack_level): Remove.
1778         (search_level): Remove.
1779         (search_stack): Remove.
1780         (lookup_member): Don't check IDENTIFIER_CLASS_VALUE.
1781         (setup_class_bindings): Use IDENTIFIER_MARKED, not
1782         IDENTIFIER_CLASS_VALUE.
1783         (marked_identifiers): New variable.
1784         (push_class_decls): Clear IDENTIFIER_MARKED.
1785         (pop_class_decls): Don't call pop_search_level.
1786         (init_search_processing): Remove.
1787
1788 2004-07-12  Mark Mitchell  <mark@codesourcery.com>
1789
1790         * cp-tree.h (get_aggr_typedef): Remove.
1791         * init.c (get_aggr_typedef): Likewise.
1792
1793         * name-lookup.c (push_class_level_binding): Simplify.
1794
1795 2004-07-12  Andrew Pinski  <apinski@apple.com>
1796
1797         PR c++/16475
1798         Revert:
1799         2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
1800                 PR c++/16276
1801                 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
1802                 is not public.
1803
1804 2004-07-12  Eric Christopher  <echristo@redhat.com>
1805
1806         * parser.c (cp_parser_class_head): Remove unused variable.
1807
1808 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1809
1810         * decl.c (grok_op_properties): Reject [de-]allocation functions
1811         declared in a namespace, or declared as static.
1812
1813 2004-07-12  Nathan Sidwell  <nathan@codesourcery.com>
1814
1815         * cp-tree.h (make_binfo): Remove.
1816         * decl.c (xref_basetypes): Use make_tree_binfo directly.
1817         * tree.h (copy_base_binfos): Likewise.
1818         (make_binfo): Remove.
1819
1820         * call.c (build_user_type_conversion_1, build_new_op,
1821         check_constructor_callable, build_temp,
1822         perform_direct_initialization_of_possible): Pass type directly to
1823         lookup_fnfields & build_special_member_call.
1824         (build_special_member_call): Accept a type, and complete it.
1825         * class.c (finish_stuct_bits): Copy the BINFOs here.
1826         * cvt.c (ocp_convert): Pass type directly to
1827         build_special_member_call.
1828         * decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
1829         (xref_basetypes): Allocate the binfo here. Adjust.
1830         * init.c (build_init, build_new_1): Pass type directly to
1831         build_special_member_call.
1832         * lex.c (cxx_make_type): Do not allocate binfo here.
1833         * name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
1834         * parser.c (cp_parser_class_head): Always call xref_basetypes.
1835         * pt.c (instantiate_class_template): Likewise. Inhibit access
1836         checking for template friends.
1837         * ptree.c (cxx_print_type): Adjust record printing.
1838         * search.c (lookup_base): When taking a type, complete it before
1839         looking for a binfo.
1840         (lookup_member): Delay completing a type.
1841         (push_class_decls): Don't walk an incomplete type.
1842         (lookup_conversions): Likewise.
1843         * semantics.c (finish_stmt_expr_expr): Pass type directly to
1844         build_special_member_call.
1845         * tree.c (copy_base_binfos): Adjust.
1846         (make_binfo): Likewise.
1847         * typeck.c (build_modify_expr): Pass type directly to
1848         build_special_member_call.
1849         * typeck2.c (process_init_constructor): Check a binfo exists.
1850         (build_m_component_ref): Allow accessing an incomplete type.
1851         (build_functional_cast): Pass type directly to
1852         build_special_member_call.
1853
1854 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1855
1856         PR c++/2204
1857         * config-lang.in (gtfiles): Add typeck2.c.
1858         * Make-lang.in: Tweak typeck2.c dependencies, and add rule for
1859         gt-cp-typeck2.h.
1860         * cp-tree.h: Declare complete_type_check_abstract.
1861         * typeck2.c (pat_calc_hash, pat_compare,
1862         complete_type_check_abstract): New functions.
1863         (abstract_virtuals_error): If the type is abstract, register the
1864         declaration within abstract_pending_vars for further checks.
1865         Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
1866         * decl.c (cp_finish_decl): Do not strip array types.
1867         (create_array_type_for_decl): Check for abstractness of the element
1868         type.
1869         (complete_vars): Call complete_type_check_abstract.
1870         * class.c (finish_struct): Prepare a list of virtual functions for
1871         template types, and call complete_vars on it to check for abstractness.
1872
1873 2004-07-12  Paolo Bonzini  <bonzini@gnu.org>
1874
1875         PR tree-optimization/14107
1876         * decl.c (finish_function): Remove temporary band-aid.
1877
1878 2004-07-11  Mark Mitchell  <mark@codesourcery.com>
1879
1880         * call.c (build_operator_new_call): Avoid using push_to_top_level.
1881         (build_new_op): Adjust call to lookup_function_nonclass.
1882         * name-lookup.c (identifier_type_value): Adjust call to
1883         lookup_name_real.
1884         (lookup_name_real): Add block_p parameter.
1885         (lookup_name_nonclass): Adjust call to lookup_name_real.
1886         (lookup_function_nonclass): Likewise.
1887         (lookup_name): Likewise.
1888         * name-lookup.h (lookup_name_real): Change prototype.
1889         (lookup_name_nonclass): Likewise.
1890         * parser.c (cp_parser_lookup_name): Likewise.
1891
1892         * cp-tree.h (saved_scope): Make old_bindings a vector.
1893         (unuse_fields): Remove.
1894         * name-lookup.h (cxx_saved_binding): Define it.
1895         * class.c (pushclass): Don't use unuse_fields.
1896         * name-lookup.c (cxx_saved_binding_make): Remove.
1897         (store_binding): Add new bindings to a vector, using an
1898         accumulator style, rather than adding them to a list.
1899         (store_bindings): Adjust accordingly.
1900         (store_class_bindings): Likewise.
1901         (push_to_top_level): Likewise.
1902         (pop_from_top_level): Likewise.
1903         * optimize.c (maybe_clone_body): Must push_to_top_level and
1904         pop_from_top_level calls outside of loop.
1905         * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope
1906         calls here from cp_parser_late_parsing_default_args.
1907         (cp_parser_save_default_args): Record the class type in which the
1908         function is declared.
1909         (cp_parser_late_parsing_default_args): Do not call
1910         push_nested_class/pop_nested_class.
1911         * search.c (dfs_unuse_fields): Remove.
1912         (unuse_fields): Remove.
1913
1914 2004-07-11  Joseph S. Myers  <jsm@polyomino.org.uk>
1915
1916         * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
1917         LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
1918         * cp-tree.h (poplevel): Declare.
1919         (set_block): Remove.
1920         * decl.c (set_block): Remove.
1921
1922 2004-07-10  Mike Stump  <mrs@apple.com>
1923
1924         * decl2.c (import_export_class): Never export/import vtables
1925         with inline key functions.
1926
1927 2004-07-09  Steven Bosscher  <stevenb@suse.de>
1928
1929         * typeck.c (c_expand_asm_operands): Remove.
1930
1931 2004-07-09  Mike Stump  <mrs@apple.com>
1932
1933         * typeck.c (build_class_member_access_expr): Skip null deref
1934         warning when we don't dereference it.
1935
1936 2004-07-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1937
1938         PR c++/8211
1939         PR c++/16165
1940         * class.c (check_field_decls): Improve -Weffc++ warning: do not
1941         warn for pointers to functions/members, or for classes without
1942         destructors.
1943
1944 2004-07-08  Mark Mitchell  <mark@codesourcery.com>
1945
1946         * name-lookup.h (struct cp_binding_level): Update documentation
1947         for class_shadowed.
1948
1949 2004-07-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1950
1951         PR c++/16169
1952         * typeck.c (check_return_expr): Improve -Weffc++ warning: handle
1953         returning CALL_EXPR, and non-reference return type.
1954
1955 2004-07-08  Nathan Sidwell  <nathan@codesourcery.com>
1956
1957         * name-lookup.c (push_binding): Use VEC_reserve.
1958
1959 2004-07-08  Richard Henderson  <rth@redhat.com>
1960
1961         * cp-tree.h (expand_eh_spec_block): Remove.
1962
1963 2004-07-07  Mark Mitchell  <mark@codesourcery.com>
1964
1965         * cp-tree.h (saved_scope): Remove x_previous_class_type and
1966         x_previous_class_values; add x_previous_class_level.
1967         (previous_class_type): Remove.
1968         (previous_class_values): Remove.
1969         (previous_class_level): New macro.
1970         * class.c (pushclass): Restore the identifier cache more
1971         expeditiously.
1972         (invalidate_class_lookup_cache): Use vector for class_shadowed and
1973         previous_class_values.
1974         * decl.c (poplevel): Likewise.
1975         * name-lookup.c (cxx_binding_init): New function.
1976         (cxx_binding_make): Use it.
1977         (push_binding): For a binding in a class level, use a vector of
1978         cp_class_binding nodes.
1979         (push_binding_level): New function.
1980         (begin_scope): Use it.
1981         (leave_scope): Do not put class binding levels on the free list.
1982         (print_binding_level): Adjust for the fact that class_shadowed is
1983         a vector.
1984         (poplevel_class): Likewise.
1985         (clear_identifier_class_values): Likewise.
1986         (push_class_level_binding): Likewise.
1987         (set_class_shadows): Remove.
1988         (store_binding): New function.
1989         (store_class_bindings): New function.
1990         (push_to_top_level): Use store_class_bindings as appropriate.
1991         (pop_from_top_level): Use previous_class_level, not
1992         previous_class_type.
1993         * name-lookup.h (cp_class_binding): New type.
1994         (cp_binding_level): Use a vector object for class_shadowed.
1995         (push_binding_level): Declare.
1996         (set_class_shadows): Remove.
1997
1998 2004-07-07  Andrew Pinski  <apinski@apple.com>
1999
2000         * class.c (instantiate_type): BUFFER_REF is dead.
2001         * lex.c (init_operators): IN_EXPR is dead.
2002
2003 2004-07-07  Jason Merrill  <jason@redhat.com>
2004
2005         PR c++/16334
2006         * call.c (build_new_op): Give overload warnings for built-in
2007         candidates.
2008
2009 2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
2010
2011         PR c++/16276
2012         * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
2013         is not public.
2014
2015 2004-07-07  Nathan Sidwell  <nathan@codesourcery.com>
2016
2017         * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
2018         * class.c (build_primary_vtable, check_bases,
2019         determine_primary_base, finish_struct_bits,
2020         maybe_warn_about_overly_private_class, dfs_find_final_overrider_q,
2021         get_basefndecls, warn_hidden, walk_subobject_offsets,
2022         build_base_fields, create_vtable_ptr, propagate_binfo_offsets,
2023         layout_virtual_bases, end_of_class, warn_about_ambiguous_bases,
2024         finish_struct_1, get_vfield_name, contains_empty_class_p,
2025         dump_class_hierarchy_r, finish_vtbls, build_vtt_inits,
2026         dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits,
2027         add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust
2028         BINFO macros.
2029         * decl.c (xref_basetypes): Likewise.
2030         * dump.c (cp_dump_tree): Likewise.
2031         * error.c (dump_expr): Likewise.
2032         * init.c (sort_mem_initializers, expand_member_init,
2033         push_base_cleanups): Likewise.
2034         * method.c (do_build_copy_constructor, do_build_assign_reg,
2035         synthesize_exception_spec): Likewise.
2036         * name-lookup.c (arg_assoc_class): Likewise.
2037         * pt.c (instantiate_class_template, tsubst,
2038         get_template_base_recursive): Likewise.
2039         * ptree.c (cxx_print_type): Likewise.
2040         * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
2041         * search.c (lookup_base_r, dynamic_cast_base_recurse,
2042         dfs_access_in_type, access_in_type, lookup_field_queue_p,
2043         bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp,
2044         marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp,
2045         dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet,
2046         binfo_for_vtable, copied_binfo, original_binfo): Likewise
2047         * tree.c (copy_base_binfos, make_binfo): Likewise.
2048         * typeck.c (commmon_base_type): Likewise
2049         * typeck2.c (process_init_constructor): Likewise
2050
2051 2004-07-06  Joseph S. Myers  <jsm@polyomino.org.uk>
2052
2053         * decl.c (check_tag_decl): Name redeclared type in diagnostic.
2054
2055 2004-07-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2056
2057         PR c++/3671
2058         * pt.c (convert_nontype_argument): Disallow conversions between
2059         different enumeration types.
2060
2061 2004-07-06  Nathan Sidwell  <nathan@codesourcery.com>
2062
2063         * cp-tree.h (BINFO_MARKED): Remove.
2064         (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED,
2065         BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P,
2066         BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n.
2067         (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P.
2068         * class.c (build_base_path): Use BINFO_VIRTUAL_P.
2069         (mark_primary_bases, determine_primary_base, base_derived_from,
2070         dfs_find_final_overrider, dfs_find_final_overrider_q,
2071         dfs_find_inal_overrider_post, update_vtable_entry_for_fn,
2072         dfs_modify_vtables, walk_subobject_offsets,
2073         layout_nonempty_base_or_field, build_base_field,
2074         build_base_fields, propagate_binfo_offsets, layout_virtual_bases,
2075         end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable,
2076         finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits,
2077         build_ctor_vtbl_group, accumulate_vtble_inits,
2078         dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries,
2079         build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r,
2080         add_vcall_offset_vtbl_entries_1): Likewise.
2081         * decl.c (xref_basetypes): Incomming virtual base indicated by
2082         TREE_TYPE. Adjust.
2083         * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P.
2084         * init.c (finish_init_stmts, sort_mem_initializers,
2085         emit_mem_initializers, build_vtble_address, expand_member_init,
2086         push_base_cleanups): Likewise.
2087         * method.c (do_build_copy_constructor): Likewise.
2088         * pt.c (instantiate_class_template,
2089         get_template_base_recursive): Likewise.
2090         * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init,
2091         get_pseudo_ti_desc): Likewise.
2092         * search.c (lookup_base_r, dynamic_cast_base_recurse,
2093         binfo_from_vbase, binfo_via_virtual, copied_binfo,
2094         original_binfo): Likewise.
2095         * semantics.c (finish_base_specifier): Virtualness is indicated
2096         by TREE_TYPE.
2097         * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P.
2098
2099 2004-07-06  Mark Mitchell  <mark@codesourcery.com>
2100
2101         Revert:
2102         2004-06-24  Jason Merrill  <jason@redhat.com>
2103         PR c++/16115
2104         * decl.c (grokparms): Give the PARM_DECL reference type if the
2105         parameter is passed by invisible reference.
2106
2107 2004-07-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2108
2109         * cp-lang.c (cp_var_mod_type_p): Add extra arg.
2110         * decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
2111         * pt.c (check_instantiated_args, unify): Likewise.
2112
2113 2004-07-05  Phil Edwards  <phil@codesourcery.com>
2114
2115         * Make-lang.in (check-c++, lang_checks):  Add some comments.
2116
2117 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
2118
2119         * cp-mudflap.c: Delete file.
2120         * Makefile.in: Remove all references to cp-mudflap.o.
2121
2122 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
2123
2124         * decl.c (cxx_init_decl_processing): Call
2125         build_common_tree_nodes before creating the global NAMESPACE_DECL.
2126
2127 2004-07-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2128
2129         PR c++/2518
2130         * call.c (build_operator_new_call): Look only at global scope.
2131
2132 2004-07-05  Nathan Sidwell  <nathan@codesourcery.com>
2133
2134         * call.c (enforce_access): Expect TREE_BINFO.
2135         * class.c (binfo_ctor_vtable): Check TREE_BINFO.
2136         * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
2137         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
2138         Adjust.
2139         (BINFO_LANG_ELTS): Remove.
2140         (BINFO_LANG_SLOTS): New.
2141         (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
2142         (CLASSTYPE_TEMPLATE_INFO): Adjust.
2143         * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
2144         * search.c (lookup_member): Check TREE_BINFO.
2145         * semantics.c (perform_or_defer_access_check): Likewise.
2146         (check_accessibility_of_qualified_id): Check
2147         deferred_access_no_check.
2148         * tree.c (make_binfo): Use make_tree_binfo.
2149
2150 2004-07-04  Mark Mitchell  <mark@codesourcery.com>
2151
2152         * method.c (implicitly_declare_fn): Set linkage of generated
2153         functions.
2154
2155 2004-07-04  Richard Henderson  <rth@redhat.com>
2156
2157         * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
2158
2159 2004-07-03  Scott Brumbaugh  <scottb.lists@verizon.net>
2160
2161         PR c++/3761
2162         * name-lookup.c (push_class_level_binding): Don't pass a
2163         TREE_LIST of ambiguous names to check_template_shadow as it
2164         only handles declarations. Instead, pull the declaration
2165         out and pass that.
2166
2167 2004-07-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2168
2169         PR c++/14971
2170         * pt.c (check_explicit_specialization): Clarify error message.
2171
2172 2004-07-02  Richard Henderson  <rth@redhat.com>
2173
2174         * tree.c (cp_unsave_r): Update remap_save_expr call.
2175
2176 2004-07-02  Mark Mitchell  <mark@codesourcery.com>
2177
2178         PR c++/16240
2179         * mangle.c (write_template_arg): Correct mangling.
2180
2181         PR c++/16297
2182         * decl.c (grokdeclarator): Robustify.
2183
2184 2004-07-01  Richard Henderson  <rth@redhat.com>
2185
2186         * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
2187         * method.c (synthesize_method): Don't clear_last_expr.
2188         * name-lookup.c (maybe_push_cleanup_level): Likewise.
2189
2190 2004-07-01  Nick Clifton  <nickc@redhat.com>
2191
2192         * decl2.c (import_export_class): Invoke the
2193         import_export_class field in the gcc_target structure if it is not
2194         empty.
2195
2196 2004-06-30  Richard Henderson  (rth@redhat.com>
2197
2198         * decl.c (start_preparsed_function): Don't set immediate_size_expand.
2199         * method.c (use_thunk): Likewise.
2200
2201 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
2202
2203         * call.c (build_over_call), typeck.c (build_function_call): Call
2204         check_function_arguments instead of check_function_format.
2205
2206 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
2207
2208         * call.c (build_over_call), typeck.c (build_function_call): Update
2209         calls to check_function_format.
2210
2211 2004-06-30  Richard Henderson  <rth@redhat.com>
2212
2213         * call.c (build_over_call): Use __builtin_memcpy for copying
2214         CLASS_AS_BASE rather than funny casting.
2215
2216 2004-06-30  Richard Henderson  <rth@redhat.com>
2217
2218         * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and
2219         TYPE_SIZE_UNIT of full_type.
2220
2221 2004-06-30  Per Bothner  <per@bothner.com>
2222
2223         Conditionally compile support for --enable-mapped_location.
2224         * decl.c (pop_label):  Handle (imperfectly) USE_MAPPED_LOCATION case.
2225         * decl2.c:  If USE_MAPPED_LOCATION, don't do some line number
2226         adjustments - which I don't understand.
2227         * error.c (dump_decl):  Rename "<interrnal>" to "<built-in>".
2228         * error.c:  Use LOCATION_FILE and EXPR_LOCATION macros.
2229         (print_instantiation_partial_context):  Use expand_location.
2230         * decl.c (duplicate_decl):  Use new DECL_IS_BUILTIN macro.
2231         * name-lookup.c:  Likewise.
2232         * lex.c (cxx_init):  Likewise.  Also use BUILTINS_LOCATION.
2233         * name-lookup.c:  Use input_line macro.
2234         * parser.c (cp_lexer_get_preprocessor_token):  Use UNKNOWN_LOCATION.
2235         (cp_parser_statement):  Rename locaal variable statement_locus to
2236         statement_location and use SET_EXPR_LOCATION macro.
2237         * pt.c:  Handle USE_MAPPED_LOCATION case.  Use new macros.
2238         * tree.c (cp_walk_subtrees):  Likewise.
2239
2240 2004-06-29  Per Bothner  <per@bothner.com>
2241
2242         * tree.c (build_min_nt, build_min, build_min_non_dep):
2243         Don't set TREE_COMPLEXITY from input_line.
2244
2245 2004-06-29  Paul Brook  <paul@codesourcery.com>
2246
2247         * init.c: Include target.h.
2248         (get_cookie_size): Remove and replace with target hook.
2249         Update callers.
2250         (build_new_1): Store the element size in the cookie.
2251
2252 2004-06-29  Nathan Sidwell  <nathan@codesourcery.com>
2253
2254         PR c++/16260
2255         * parser.c (cp_parser_template_declaration_after_export): Disable
2256         access checks here ...
2257         (cp_parser_class_specifier): ... not here.
2258
2259 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2260
2261         * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
2262         VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
2263         BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate
2264         TREE_CHECK macro.
2265
2266 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2267
2268         * cp-tree.h (struct deferred_access): Move to ...
2269         * semantics.c (struct deferred_access): ... here. Adjust.
2270         (deferred_access_stack): Make a VEC(deferred_access),
2271         (deferred_access_free_list): Remove.
2272         (deferred_access_no_check): New.
2273         (push_deferring_access_checks, resume_deferring_access_checks,
2274         stop_deferring_access_checks, pop_deferring_access_checks,
2275         get_deferred_access_checks, pop_to_parent_deferring_access_checks,
2276         perform_deferred_access_checks, perform_or_defer_access_check): Adjust.
2277
2278 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2279
2280         PR c++/16174
2281         * call.c (build_temp): Declare.
2282         (check_constructor_callable): New.
2283         (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
2284         CONSTRUCTOR_CALLABLE.
2285         (convert_like_real, initialize_reference): Use
2286         check_constructor_callable.
2287         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
2288         (LOOKUP_*): Renumber.
2289
2290 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2291
2292         * friend.c (add_friend): Only perform access checks when context
2293         is a class.
2294         * lex.c (cxx_make_type): Only create a binfo for aggregate types.
2295         * parser.c (cp_parser_class_specifier): Disable access checks here
2296         when parsing the body of a templated class.
2297         * semantics.c (perform_or_defer_access_checks): Reorder to allow
2298         NULL binfos when not checking access.
2299
2300 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2301
2302         Use vector API for vbase list.
2303         * cp-tree.h: Include vec.h
2304         (DEF_VEC_P (tree)): New type.
2305         (struct lang_type_class): Change vbase's member type.
2306         (binfo_for_vbase): Declare.
2307         * class.c (determine_primary_base, base_derived_from,
2308         update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
2309         warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
2310         build_vtbl_initializer): Adjust.
2311         * decl.c (xref_basetypes): Adjust, accumulate upper bound of
2312         vbases.
2313         * init.c (sort_mem_initializers, expand_member_init,
2314         push_base_cleanups): Adjust.
2315         * method.c (do_build_copy_constructor): Adjust.
2316         * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
2317         (binfo_for_vbase): New.
2318         * tree.c (copy_base_binfos): Adjust.
2319
2320 2004-06-28  Mark Mitchell  <mark@codesourcery.com>
2321
2322         * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
2323
2324 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2325
2326         PR c++/14123
2327         * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
2328         paranthesis in case of pointers to array members.
2329         * error.c (dump_type_prefix): Likewise.
2330         (dump_type_suffix): Maybe issue a whitespace when printing
2331         ARRAY_TYPE.
2332
2333 2004-06-27  Mark Mitchell  <mark@codesourcery.com>
2334
2335         PR c++/16193
2336         * parser.c (cp_parser_set_decl_spec_type): Refine test for
2337         redefinition of built-in types.
2338
2339 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2340
2341         * error.c (pp_template_argument_list_start): Remove.
2342         (pp_template_argument_list_end): Likewise.
2343         (pp_separate_with_comma): Use pp_cxx_separate_with.
2344         (reinit_global_formatting_buffer): Remove.
2345         (pp_non_consecutive_character): Likewise.
2346         (dump_scope): Use pp_cxx_colon_colon.
2347         (dump_template_parameter): Use pp_cxx_identifier,
2348         pp_cxx_tree_identifier and pp_cxx_whitespace.
2349         (dump_templat_bindings): Replace use of pp_string with sequence
2350         of pp_cxx_whitespace and pp_equal.
2351         (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
2352         pp_cxx_colon_colon, pp_cxx_whitespace throughout.  Don't set
2353         padding here.
2354         (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
2355         (dump_type_prefix): Don't set padding.  Use pp_cxx_whitespace,
2356         pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
2357         (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
2358         pp_cxx_right_bracket, pp_cxx_identifier throughout,
2359         (dump_decl): Likewise.
2360         (dump_template_decl): Likewise.
2361         (dump_function_decl): Likewise.  Set padding as appropriate.
2362         (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
2363         pp_cxx_right_paren.
2364         (dump_exception_spec): Likewise.
2365         (dump_function_name): Use pp_cxx_tree_identifier and
2366         pp_cxx_identifier.
2367         (dump_template_parms): Use pp_cxx_begin_template_argument_list and
2368         pp_cxx_end_template_argument_list.
2369         (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
2370         pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
2371         pp_cxx_whitespace throughout.
2372         (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
2373         pp_cxx_right_paren.
2374         (dump_unary_op): Likewise.
2375         (reinit_cxx_pp): New function.
2376         (type_as_string); Use it.
2377         (expr_as_string): Likewise.
2378         (decl_as_string); Likewise.
2379         (context_as_string): Likewise.
2380         (lang_decl_name): Likewise.
2381         (decl_to_string): Likewise.
2382         (expr_to_string): Likewise.
2383         (parm_to_string): Likewise.
2384         (type_to_string): Likewise.
2385         (args_to_string): Likewise.
2386         (cv_to_string): Likewise.
2387
2388 2004-06-26  Mark Mitchell  <mark@codesourcery.com>
2389
2390         * cp-tree.h (cp_cv_quals): New type.
2391         (cp_declarator): Use it instead of "tree" as appropriate.
2392         (grok_method_quals): Adjust prototype.
2393         (grokclassfn): Likewise.
2394         (do_friend): Likewise.
2395         * decl.c (grokfndecl): Use cp_cv_quals, not tree.
2396         (grokdeclarator): Likewise.
2397         * decl2.c (grok_method_quals): Likewise.
2398         (grokclassfn): Likewise.
2399         * friend.c (do_friend): Likewise.
2400         * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
2401         * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
2402         (make_pointer_declarator): Likewise.
2403         (make_reference_declarator): Likewise.
2404         (make_ptrmem_declarator): Likewise.
2405         (cp_parser_ptr_operator): Likewise.
2406         (cp_parser_cv_qualifier_seq_opt): Likewise.
2407         (cp_parser_cv_qualifier_opt): Remove.
2408         (cp_parser_new_declarator_opt): Adjust call to
2409         cp_parser_ptr_operator.
2410         (cp_parser_conversion_declaration_opt): Likewise.
2411         (cp_parser_declarator): Use cp_cv_quals, not tree.
2412         (cp_parser_direct_declarator): Likewise.
2413
2414 2004-06-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2415
2416         * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
2417         Rename DECL_STMT to DECL_EXPR.
2418         * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
2419         * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
2420         * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
2421
2422 2004-06-26  Jan Hubicka  <jh@suse.cz>
2423
2424         PR C++/14865
2425         * decl2.c (maybe_emit_vtables):  Always import_export_vtable for the
2426         reachability analysis.
2427
2428 2004-06-25  Mark Mitchell  <mark@codesourcery.com>
2429
2430         * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
2431         2004-06-23 change.
2432
2433 2004-06-25  Paul Brook  <paul@codesourcery.com>
2434
2435         * decl2.c (get_guard): Call targetm.cxx.guard_type.
2436         (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
2437
2438 2004-06-24  Mark Mitchell  <mark@codesourcery.com>
2439
2440         * decl.c (grokdeclarator): Restore error messages about __thread.
2441         * parser.c (cp_parser_decl_specifier_seq): Likewise.
2442
2443 2004-06-24  Jason Merrill  <jason@redhat.com>
2444
2445         PR c++/16115
2446         * decl.c (grokparms): Give the PARM_DECL reference type if the
2447         parameter is passed by invisible reference.
2448
2449 2004-06-24  Andreas Schwab  <schwab@suse.de>
2450
2451         * cp-tree.h (enum cp_storage_class): Remove trailing comma.
2452
2453 2004-06-23  Mark Mitchell  <mark@codesourcery.com>
2454
2455         * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
2456         (cp/decl.o): Likewise.
2457         (cp/decl2.o): Likewise.
2458         (cp/pt.o): Likewise.
2459         (cp/semantics.o): Likewise.
2460         * config-lang.in (gtfiles): Do not reference cp/lex.h.
2461         * class.c: Do not include lex.h.
2462         (add_implicitly_declared_members): Do not use
2463         adding_implicit_members.
2464         (check_bases_and_members): Do not talk about grok_x_components.
2465         * cp/cp-tree.h (adding_implicit_members): Remove.
2466         (cp_storage_class): New type.
2467         (cp_decl_spec): Likewise.
2468         (cp_decl_specifier_seq): Likewise.
2469         (cp_parameter_declarator): Use it for the decl_specifiers field.
2470         (check_tag_decl): Adjust prototype.
2471         (shadow_tag): Likewise.
2472         (groktypename): Likewise.
2473         (start_decl): Likewise.
2474         (start_function): Likewise.
2475         (start_method): Likewise.
2476         (grok_x_components): Remove.
2477         (grokfield): Adjust prototype.
2478         (grokbitfield): Likewise.
2479         (finish_member_class_template): Remove.
2480         * decl.c: Do not include lex.h.
2481         (adding_implicit_members): Do not define.
2482         (check_tag_decl): Do not use trees to represent decl-specifiers.
2483         (shadow_tag): Likewise.
2484         (groktypename): Likewise.
2485         (start_decl): Likewise.
2486         (grokvardecl): Likewise.
2487         (grokdeclarator): Likewise.
2488         (grokparms): Likewise.
2489         (start_function): Likewise.
2490         (start_method): Likewise.
2491         * decl.h (grokdeclarator): Adjust prototype.
2492         * decl2.c: Do not include lex.h.
2493         (grok_x_components): Remove.
2494         (grokfield): Do not use trees to represent decl-specifiers.
2495         (grokbitfield): Likewise.
2496         * lex.c: Do not include lex.h.
2497         * lex.h: Remove.
2498         * parser.c: Include target.h.
2499         (clear_decl_specs): New function.
2500         (cp_parser_translation_unit): Do not use trees to represent
2501         decl-specifiers.
2502         (cp_parser_postfix_expression): Likewise.
2503         (cp_parser_new_type_id): Likewise.
2504         (cp_parser_condition): Likewise.
2505         (cp_parser_simple_declaration): Likewise.
2506         (cp_parser_decl_specifier_seq): Likewise.
2507         (cp_parser_function_specifier_opt): Likewise.
2508         (cp_parser_conversion_type_id): Likewise.
2509         (cp_parser_template_parameter): Likewise.
2510         (cp_parser_explicit_instantiation): Likewise.
2511         (cp_parser_type_specifier): Likewise.
2512         (cp_parser_simple_type_specifier): Likewise.
2513         (cp_parser_init_declarator): Likewise.
2514         (cp_parser_type_id): Likewise.
2515         (cp_parser_type_specifier_seq): Likewise.
2516         (cp_parser_parameter_declaration): Likewise.
2517         (cp_parser_member_declaration): Likewise.
2518         (cp_parser_exception_declaration): Likewise.
2519         (cp_parser_function_definition_from_specifiers_and_declarator):
2520         Likewise.
2521         (cp_parser_single_declaration): Likewise.
2522         (cp_parser_save_member_function_body): Likewise.
2523         (cp_parser_friend_p): Likewise.
2524         (cp_parser_set_storage_class): New function.
2525         (cp_parser_set_decl_spec_type): Likewise.
2526         * pt.c: Do not include lex.h.
2527         * semantics.c: Likewise.
2528         (finish_member_class_template): Remove.
2529
2530 2004-06-23  Roger Sayle  <roger@eyesopen.com>
2531
2532         * call.c (build_cxx_call): Don't call expand_tree_builtin.  No
2533         longer take both "args" and "convert_args" as arguments.
2534         (build_op_delete_call): Update call to build_cxx_call.
2535         (build_over_call): Likewise, update call to build_cxx_call.
2536         * cp-tree.h (build_cxx_call): Update funtion prototype.
2537         * typeck.c (build_function_call): Don't call expand_tree_builtin.
2538         * rtti.c (throw_bad_cast): Update call to build_cxx_call.
2539         (throw_bad_typeid): Likewise.
2540         (build_dynamic_cast_1): Likewise.
2541
2542 2004-06-22  Richard Henderson  <rth@redhat.com>
2543
2544         * class.c (build_vfn_ref): Take a pointer not object.  Build
2545         an OBJ_TYPE_REF.
2546         (cp_fold_obj_type_ref): New.
2547         * call.c (build_over_call): Update build_vfn_ref call.
2548         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
2549         * cp-tree.h (cp_fold_obj_type_ref): Declare.
2550
2551 2004-06-21  Jason Merrill  <jason@redhat.com>
2552
2553         PR c++/16112
2554         * cp-gimplify.c (cp_gimplify_init_expr): Look through
2555         CLEANUP_POINT_EXPR.
2556
2557 2004-06-21  Mark Mitchell  <mark@codesourcery.com>
2558
2559         * cp-tree.def (NEW_EXPR): Add a fourth slot.
2560         * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
2561         (TREE_PARMLIST): Likewise.
2562         (CALL_DECLARATOR_PARMS): Likewise.
2563         (CALL_DECLARATOR_QUALS): Likewise.
2564         (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
2565         (cp_declarator_kind): New type.
2566         (cp_parameter_declarator): Likewise.
2567         (cp_declarator): Likewise.
2568         (cp_error_declarator): Likewise.
2569         (no_parameters): Likewise.
2570         (groktypename): Change prototype.
2571         (start_decl): Likewise.
2572         (start_handler_parms): Likewise.
2573         (get_scope_of_declarator): Likewise.
2574         (start_function): Likewise.
2575         (start_preparsed_function): New function.
2576         (start_function): Change prototype.
2577         (start_method): Likewise.
2578         (grokfield): Likewise.
2579         (grokbitfield): Likewise.
2580         (build_new): Likewise.
2581         (make_pointer_declarator): Remove.
2582         (make_reference_declarator): Likewise.
2583         (make_call_declarator): Likewise.
2584         (set_quals_and_spec): Likewise.
2585         (process_template_parm): Change prototype.
2586         (begin_function_definition): Remove.
2587         (finish_parmlist): Remove.
2588         * decl.c (groktypename): Do not use trees to represent
2589         declarators.
2590         (start_decl): Likewise.
2591         (start_handler_parms): Remove.
2592         (get_scope_of_declarator): Reimplement.
2593         (grokdeclarator): Do not use trees to represent declarators.
2594         (grokparms): Likewise.
2595         (start_function): Likewise.
2596         (start_method): Likewise.
2597         (build_void_list_mode): Do not use TREE_PARMLIST.
2598         * decl.h (grokdeclarator): Change prototype.
2599         * decl2.c (grok_method_quals): Robustify.
2600         (grok_x_components): Do not use trees to represent declarators.
2601         (grokfield): Likewise.
2602         (grokbitfield): Likewise.
2603         (start_objects): Build FUNCTION_DECLs, not declarators.
2604         (start_static_storage_duration_function): Likewise.
2605         * init.c (build_new): Simplify.
2606         * lex.c (make_pointer_declarator): Remove.
2607         (make_reference_declarator): Likewise.
2608         (make_call_declarator): Likewise.
2609         (set_quals_and_spec): Likewise.
2610         * method.c (use_thunk): Use start_preparsed_function.
2611         (synthesize_method): Likewise.
2612         (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
2613         * optimize.c (maybe_clone_body): Use start_preparsed_function.
2614         * parser.c (cp_error_declarator): New variable.
2615         (declarator_obstack): Likewise.
2616         (alloc_declarator): New function.
2617         (make_declarator): Likewise.
2618         (make_id_declarator): Likewise.
2619         (make_pointer_declarator): Likewise.
2620         (make_reference_declarator): Likewise.
2621         (make_ptrmem_declarator): Likewise.
2622         (make_call_declarator): Likewise.
2623         (make_array_declarator): Likewise.
2624         (no_parameters): New variable.
2625         (make_parameter_declarator): Likewise.
2626         (cp_parser_check_for_definition_in_return_type): Do not use trees
2627         to represent declarators.
2628         (cp_parser_translation_unit): Likewise.
2629         (cp_parser_new_expression): Likewise.
2630         (cp_parser_new_type_id): Likewise.
2631         (cp_parser_new_declarator_opt): Likewise.
2632         (cp_parser_direct_new_declarator): Likewise.
2633         (cp_parser_condition): Likewise.
2634         (cp_parser_declaration_statement): Likewise.
2635         (cp_parser_declaration): Likewise.
2636         (cp_parser_conversion_type_id): Likewise.
2637         (cp_parser_conversion_declarator_opt): Likewise.
2638         (cp_parser_template_parameter_list): Likewise.
2639         (cp_parser_template_parameter): Likewise.
2640         (cp_parser_explicit_instantiation): Likewise.
2641         (cp_parser_init_declarator): Likewise.
2642         (cp_parser_declarator): Likewise.
2643         (cp_parser_direct_declarator): Likewise.
2644         (cp_parser_type_id): Likewise.
2645         (cp_parser_parameter_declaration_clause): Likewise.
2646         (cp_parser_parameter_declaration_list): Likewise.
2647         (cp_parser_parameter_declaration): Likewise.
2648         (cp_parser_member_declaration): Likewise.
2649         (cp_parser_exception_declaration): Likewise.
2650         (cp_parser_check_declarator_template_parameters): Likewise.
2651         (cp_parser_function_definition_from_specifiers_and_declarator):
2652         Likewise.
2653         (cp_parser_save_member_function_body): Likewise.
2654         * pt.c (process_template_parm): Add is_non_type parameter.
2655         (convert_template_argument): Adjust call to groktypename.
2656         (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
2657         (tsubst): Do not expect declarators.
2658         (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
2659         argument.
2660         (instantiate_decl): Use start_preparsed_function.
2661         * semantics.c (begin_function_definition): Remove.
2662         (finish_parmlist): Remove.
2663         * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
2664         declarators.
2665
2666 2004-06-21  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2667
2668         * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
2669         (build_new_method_call): Likewise.
2670         * decl.c (local_variable_p_walkfn): Don't walk into types.
2671         * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
2672         (build_anon_union_vars): Add new operand for COMPONENT_REF.
2673         * init.c (buld_new): Add new operand for ARRAY_REF.
2674         * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
2675         (do_build_assign_ref): Likewise.
2676         * parser.c (cp_parser_direct_new_declarator): Add new operands
2677         for ARRAY_REF.
2678         (cp_parser_direct_declarator): Likewise.
2679         * pt.c (tsubst): Likewise.
2680         (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
2681         for COMPONENT_REF.
2682         * semantics.c (finish_non_static_data_member): Add new operand
2683         for COMPONENT_REF.
2684         * typeck.c (build_class_member_access_expr): Likewise.
2685         (build_class_member_access_expr, finish_class_member_access_expr):
2686         Likewise.
2687         (build_ptrmemfunc_access_expr): Likewise.
2688         (build_array_ref): Add new operands for ARRAY_REF.
2689         * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
2690         * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
2691
2692 2004-06-21  Richard Henderson  <rth@redhat.com>
2693
2694         * dump.c (cp_dump_tree): Don't use dump_next_stmt.
2695         * parser.c (cp_parser_jump_statement): Update commentary.
2696         * pt.c (tsubst_expr): Use RETURN_EXPR.
2697         * semantics.c (finish_return_stmt): Likewise.
2698         (finalize_nrv_r): Likewise.
2699         * typeck.c, typeck2.c: Update file start commentary.
2700
2701 2004-06-21  Richard Henderson  <rth@redhat.com>
2702
2703         * semantics.c (finish_expr_stmt): Call verify_sequence_points.
2704
2705 2004-06-20  Richard Henderson  <rth@redhat.com>
2706
2707         * cp-tree.h (add_decl_stmt): Declare.
2708         * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
2709         * semantics.c (maybe_cleanup_point_expr): New.
2710         (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
2711         finish_for_expr, finish_switch_cond): Use it.
2712         (finalize_nrv_r): Don't build an EXPR_STMT.  Don't frob TREE_CHAIN.
2713
2714 2004-06-20  Richard Henderson  <rth@redhat.com>
2715
2716         * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
2717         * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
2718         (cp_gimplify_expr): Call it.
2719         (gimplify_cleanup_stmt): Move from c-gimplify.c.
2720         (cp_genericize): New.
2721         * decl.c (finish_function): Call it.
2722         * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
2723         (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
2724         (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
2725         (cp_genericize): Declare.
2726         * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
2727         * dump.c (cp_dump_tree): Likewise.
2728         * semantics.c (push_cleanup): Move from c-semantics.c.
2729
2730 2004-06-20  Zack Weinberg  <zack@codesourcery.com>
2731
2732         * cp-lang.c (has_c_linkage): Implement.
2733
2734         * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
2735         * decl.c (duplicate_decls): Use COPY_DECL_RTL.
2736         (builtin_function_1): Don't call make_decl_rtl.
2737         (build_cp_library_fn): Don't call set_mangled_name_for_decl.
2738         (grokvardecl): Don't call mangle_decl.
2739         * except.c (nothrow_libfn_p): Look at DECL_NAME, not
2740         DECL_ASSEMBLER_NAME.
2741         * method.c (set_mangled_name_for_decl): Delete.
2742         * name-lookup.c (pushdecl): When a local extern shadows a
2743         file-scope declaration of the same object, give both DECLs the
2744         same DECL_UID.
2745         * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
2746         on DECL_ASSEMBLER_NAME.
2747
2748 2004-06-19  Richard Henderson  <rth@redhat.com>
2749
2750         * cp-gimplify.c: Remove unnecessary prototypes.
2751         (cp_gimplify_stmt): Merge into ...
2752         (cp_gimplify_expr): ... here.  Move to end of file.  Handle
2753         stmts_are_full_exprs_p frobbing.
2754         * cp-tree.h (cp_gimplify_stmt): Remove.
2755         * pt.c (tsubst_expr): Merge prep_stmt and unify.
2756         * tree.c (init_tree): Don't set lang_gimplify_stmt.
2757
2758 2004-06-18  Richard Henderson  <rth@redhat.com>
2759
2760         PR c++/16034
2761         * semantics.c (begin_cond): New.
2762         (finish_cond): Rewrite to handle template DECL_STMTs specially.
2763         Assume that non-template decls go land before the conditional.
2764         (simplify_loop_decl_cond): Likewise.
2765         (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
2766         finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
2767         begin_switch_stmt, finish_switch_cond): Update to match.
2768
2769 2004-06-17  Jason Merrill  <jason@redhat.com>
2770
2771         PR c++/16015
2772         * semantics.c (simplify_aggr_init_expr): Don't return the slot.
2773         (finish_stmt_expr_expr): Update type after conversions.
2774         (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
2775         Handle void initializer.
2776         * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
2777
2778 2004-06-17  Geoffrey Keating  <geoffk@apple.com>
2779
2780         * class.c (build_clone): Don't call defer_fn, let mark_used do it.
2781         * cp-tree.h (defer_fn): Delete.
2782         * decl2.c (defer_fn): Delete.
2783         (finish_file): Simplify deferred_fns loops; check that
2784         only used inline functions get into deferred_fns.
2785         (mark_used): Inline previous contents of defer_fn.
2786
2787 2004-06-16  Richard Henderson  <rth@redhat.com>
2788
2789         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
2790         (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
2791         * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
2792         of CTOR_INITIALIZER ...
2793         (pp_cxx_statement): ... here.
2794         * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
2795         (finish_function): Use alloc_stmt_list to zap entire function.
2796         * parser.c (cp_parser_compound_statement): Update commentary.
2797         * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
2798         * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
2799         (finish_stmt_expr): Don't look through COMPOUND_STMT.
2800
2801 2004-06-16  Geoffrey Keating  <geoffk@apple.com>
2802
2803         * pt.c (mark_decl_instantiated): Don't call defer_fn.
2804
2805 2004-06-16  Richard Henderson  <rth@redhat.com>
2806
2807         * parser.c (cp_parser_labeled_statement): Update commentary.
2808         * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
2809         * tree.c (mark_local_for_remap_r): Likewise.
2810
2811 2004-06-16  Richard Henderson  <rth@redhat.com>
2812
2813         * parser.c (cp_parser_asm_definition): Update commentary.
2814         * pt.c (tsubst_expr): Use ASM_EXPR.
2815         * semantics.c (finish_asm_stmt): Likewise.
2816
2817 2004-06-16  Richard Henderson  <rth@redhat.com>
2818
2819         * decl.c (finish_destructor_body): Use LABEL_EXPR.
2820         * parser.c (cp_parser_statement): Update commentary.
2821         * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
2822         * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
2823         * tree.c (mark_local_for_remap_r): Likewise.
2824
2825 2004-06-16  Richard Henderson  <rth@redhat.com>
2826
2827         PR c++/16012
2828         * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
2829         statement in FOR_INIT_STMT for templates.
2830
2831 2004-06-15  Richard Henderson  <rth@redhat.com>
2832
2833         * call.c (initialize_reference): Don't build CLEANUP_STMT here.
2834         * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
2835         (genericize_try_block): Use gimplify_stmt.
2836         (genericize_catch_block, genericize_eh_spec_block): Likewise.
2837         (cp_gimplify_init_expr): Remove STMT_EXPR special case.
2838         (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
2839         * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
2840         (cp_tree_chain_matters_p): Remove.
2841         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
2842         (COMPOUND_STMT_BODY_BLOCK): New.
2843         (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
2844         (EXPR_STMT_STMT_EXPR_RESULT): New.
2845         (building_stmt_tree): Check cur_stmt_list.
2846         (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
2847         (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
2848         * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
2849         (cp_finish_decl): Use push_cleanup.
2850         (start_function, finish_function): Use statement lists.
2851         (finish_stmt): Do nothing.
2852         * except.c (begin_eh_spec_block): Use statement lists.
2853         (check_handlers_1, check_handlers): Likewise.
2854         * init.c (construct_virtual_base): Don't add extra compound stmts.
2855         (build_vec_init): Likewise.
2856         * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
2857         * name-lookup.h (struct cp_binding_level): Add statement_list.
2858         * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
2859         (cp_parser_labeled_statement, cp_parser_expression_statement,
2860         cp_parser_statement_seq_opt): Likewise.
2861         (cp_parser_compound_statement): Likewise.  Take bool for try block.
2862         (cp_parser_selection_statement): Tidy if processing.
2863         (cp_parser_already_scoped_statement): Rewrite to do what it says.
2864         * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
2865         (tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
2866         Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
2867         * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
2868         (finish_cond): New, rewritten from FINISH_COND.
2869         (simplify_loop_decl_cond): New.
2870         (finish_expr_stmt): Avoid nested EXPR_STMTs.
2871         (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
2872         begin_else_clause, finish_else_clause, finish_if_stmt,
2873         begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
2874         begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
2875         finish_for_cond, finish_for_stmt, begin_switch_stmt,
2876         finish_switch_cond, finish_switch_stmt, begin_try_block,
2877         finish_try_block, finish_cleanup_try_block, finish_function_try_block,
2878         finish_handler_sequence, finish_function_handler_sequence,
2879         begin_handler, finish_handler_parms, finish_handler,
2880         begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
2881         using statement lists.
2882         (begin_compound_stmt): Replace has_no_scope argument with flags.
2883         Update all callers.  Use statement lists.
2884         (finish_compound_stmt): Likewise.
2885         (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
2886         (current_scope_stmt_stack): Remove.
2887         (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
2888         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
2889         Rewrite with statement lists.
2890
2891 2004-06-15  Alexandre Oliva  <aoliva@redhat.com>
2892
2893         * parser.c: Change all assignments of c_lex_string_translate
2894         to true and false to 1 and 0.
2895         (cp_lexer_read_token): Convert type of the translated string.
2896         (cp_parser_skip_to_closing_parentheses): Preserve original
2897         value of c_lex_string_translate, and set it to -1 while
2898         running.
2899         (cp_parser_cache_group): Likewise.
2900         (cp_parser_cache_group_1): Renamed.
2901         (cp_parser_asm_operand_list): Remove redundant setting of
2902         c_lex_string_translate.
2903         (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
2904         Handle chained strings.
2905
2906 2004-06-12  Andrew Pinski  <apinski@apple.com>
2907
2908         PR c++/14639
2909         Revert:
2910         2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
2911
2912                 * cp-tree.h: Fix typo.
2913
2914                 * cp-tree.h: Include cgraph.h
2915                 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
2916                 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
2917
2918 2004-06-12  Jason Merrill  <jason@redhat.com>
2919
2920         PR tree-optimization/14107
2921         * decl.c (finish_function): Warn about no return in all functions.
2922
2923 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
2924
2925         * cp-tree.h (struct language_function): Remove cannot_inline.
2926         * decl.c (save_function_data): cannot_inline is no more.
2927         (cxx_push_function_context): Likewise.
2928         * decl2.c (start_objects, start_static_storage_duration_function):
2929         Reset DECL_INLINE, set DECL_UNINLINABLE.
2930
2931 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2932
2933         PR c++/15967
2934         * search.c (lookup_field): Propagate the ambiguity list.
2935         (lookup_fnfields): Likewise.
2936
2937 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2938
2939         PR c++/15947
2940         * parser.c (cp_parser_template_name): Ctors/dtors never need a
2941         template keyword to disambiguate.
2942
2943 2004-06-14  Mark Mitchell  <mark@codesourcery.com>
2944
2945         PR c++/15096
2946         * decl.c (grokdeclarator): Ignore pointer-to-members when
2947         computing template depth.
2948
2949         PR c++/14930
2950         * name-lookup.c (pushtag): Do not try to put class declarations in
2951         explicit specialization scopes.
2952
2953 2004-06-11  Andrew Pinski  <pinskia@physics.uc.edu>
2954
2955         * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
2956
2957 2004-06-11  Mark Mitchell  <mark@codesourcery.com>
2958
2959         PR c++/15862
2960         * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
2961         bindings for undeclared built-ins.
2962
2963 2004-06-11  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2964
2965         * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
2966         appear at the correct location.
2967
2968 2004-06-10  Jason Merrill  <jason@redhat.com>
2969
2970         PR c++/15875
2971         Revert:
2972         2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2973         * init.c (build_offset_ref): Build SCOPE_REF with non-null
2974         TREE_TYPE for non-dependent names.
2975         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
2976         unknown_type_node as its TREE_TYPE.
2977         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
2978         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
2979         (dump_expr) <SCOPE_REF case>: Likewise.
2980
2981 2004-06-10  Mark Mitchell  <mark@codesourcery.com>
2982
2983         PR c++/15227
2984         * parser.c (cp_parser_direct_declarator): Robustify.
2985
2986         PR c++/15877
2987         * pt.c (tsubst_copy): Use decl_constant_value on enumeration
2988         constants in non-dependent contexts.
2989
2990         PR c++/14211
2991         PR c++/15076
2992         * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
2993         necessary.
2994
2995 2004-06-10  Jakub Jelinek  <jakub@redhat.com>
2996
2997         PR c++/14791
2998         * decl.c (duplicate_decls): Handle fileptr_type_node arguments
2999         specially.
3000
3001 2004-06-09  Mark Mitchell  <mark@codesourcery.com>
3002
3003         Revert:
3004         PR c++/15815
3005         2004-06-07  Mark Mitchell  <mark@codesourcery.com>
3006         * lex.c (handle_pragma_interface): Deprecate.
3007         (handle_pragma_implementation): Likewise.
3008
3009 2004-06-09  Andrew Pinski  <pinskia@physics.uc.edu>
3010
3011         * g++spec.c (lang_specific_driver): Remove check for -lm
3012         and -lmath when check it see if it was the math library.
3013
3014 2004-06-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3015
3016         PR c++/7841
3017         * parser.c (cp_parser_direct_declarator): Reject constructor named
3018         as qualified template-id.
3019
3020 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
3021
3022         PR c++/15815
3023         * lex.c (handle_pragma_interface): Deprecate.
3024         (handle_pragma_implementation): Likewise.
3025
3026 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
3027
3028         PR c++/15766
3029         * parser.c (cp_parser_iteration_statement): Fix typo in error
3030         message.
3031
3032         PR c++/14777
3033         * pt.c (tsubst_default_argument): Do not defer access checks
3034         while substituting into the default argument.
3035
3036         PR c++/15554
3037         * pt.c (tsubst_copy): Do not try to substitute for an enumeration
3038         constant in a non-dependent context.
3039
3040         PR c++/15057
3041         * except.c (build_throw): Ensure that temp_expr has been
3042         initialized.
3043
3044 2004-06-06  Roger Sayle  <roger@eyesopen.com>
3045
3046         * cp/cp-tree.h (lvalue_or_else): Add function prototype.
3047
3048 2004-06-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3049
3050         PR c++/15503
3051         * parser.c (cp_parser_mem_initializer_id): Gracefully reject
3052         'typename', and accept 'template'.
3053
3054 2004-06-03  Andrew Pinski  <pinskia@physics.uc.edu>
3055             Jan Hubicka  <jh@suse.cz>
3056
3057         PR c++/14639
3058         * method.c (use_think): Do not mark thunk as referenced.
3059
3060 2004-06-03  Matt Austern  <austern@apple.com>
3061
3062         PR c++/15428
3063         * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
3064         is nonzero, and if we see a noninline definition of a key method,
3065         make the vtables nonweak.
3066
3067 2004-06-02  Matt Austern  <austern@apple.com>
3068
3069         * cp-tree.h (instantiate_decl): new boolean parameter,
3070         undefined_ok. Current behavior is equivalent to its being 0.
3071         * decl2.c (mark_used): Add new argument when calling instantiate_decl
3072         * pt.c (mark_decl_instantiated): Unconditionally make
3073         instantiations explicit unconditionally
3074         (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
3075         since mark_decl_instantiated now does it.
3076         (instantiate_class_member): New.  Instantiate a member of an
3077         explicitly instantiated class template.
3078         (do_type_instantiation): Explicitly instantiate members of an
3079         explicitly instantiated class template.
3080         (instantiate_decl): if undefined_ok is nonzero, and if we're
3081         trying to explicitly instantiated a template with no definition,
3082         change it to an implicit instantiation.
3083         (instantiate_pending_templates): Add new argument to instantiate_decl.
3084         * tree.c (cp_cannot_inline_tree_fn): Likewise.
3085
3086 2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
3087
3088         * cp-tree.h: Fix typo.
3089
3090         * cp-tree.h: Include cgraph.h
3091         (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
3092         TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
3093
3094 2004-06-01  Jason Merrill  <jason@redhat.com>
3095
3096         PR c++/15142
3097         * call.c (call_builtin_trap): Remove type parm.
3098         (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
3099         (build_x_va_arg): Dereference a null pointer for a non-POD argument.
3100
3101 2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3102
3103         PR c++/13092
3104         * init.c (build_offset_ref): Build SCOPE_REF with non-null
3105         TREE_TYPE for non-dependent names.
3106         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
3107         unknown_type_node as its TREE_TYPE.
3108         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
3109         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
3110         (dump_expr) <SCOPE_REF case>: Likewise.
3111
3112 2004-06-01  Richard Henderson  <rth@redhat.com>
3113             Andrew Pinski  <pinskia@physics.uc.edu>
3114
3115         * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
3116         * parser.c (struct cp_parser): Remove in_offsetof.
3117         (cp_parser_new): Don't set it.
3118         (cp_parser_unary_expression): Don't check it.
3119         (cp_parser_postfix_open_square_expression): Split out from ...
3120         (cp_parser_postfix_expression): ... here.
3121         (cp_parser_postfix_dot_deref_expression): Likewise.
3122         (cp_parser_builtin_offsetof): New.
3123         (cp_parser_primary_expression): Use it.
3124
3125 2004-06-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3126
3127         PR c++/14932
3128         * parser.c (cp_parser_postfix_expression): Allow subscript
3129         operator in offsetof.
3130
3131 2004-05-31  Mark Mitchell  <mark@codesourcery.com>
3132
3133         PR c++/15701
3134         * friend.c (add_friend): Do not try to perform access checks for
3135         functions from dependent classes.
3136
3137 2004-05-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3138
3139         * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
3140         (pp_cxx_begin_template_argument_list): Turn into a function.
3141         (pp_cxx_end_template_argument_list): Likewise.
3142         (pp_cxx_separate_with): Define.
3143         (pp_cxx_unqualified_id): Tidy.
3144         (pp_cxx_primary_expression): Likewise.
3145         (pp_cxx_postfix_expression): Likewise.
3146         (pp_cxx_expression): Likewise.
3147         (pp_cxx_simple_type_specifier): Likewise.
3148         (pp_cxx_type_specifier_seq): Likewise.
3149         (pp_cxx_parameter_declaration_clause): Likewise.
3150         (pp_cxx_exception_specification): Likewise.
3151         (pp_cxx_direct_declarator): Likewise.
3152         (pp_cxx_type_id): Likewise.
3153         * cxx-pretty-print.h (pp_cxx_whitespace): Export from
3154         cxx-pretty-print.c.
3155         (pp_cxx_left_paren): Likewise.
3156         (pp_cxx_right_paren): Likewise.
3157         (pp_cxx_left_brace): Likewise.
3158         (pp_cxx_right_brace): Likewise.
3159         (pp_cxx_left_bracket): Likewise.
3160         (pp_cxx_right_bracket): Likewise.
3161         (pp_cxx_dot): Likewise.
3162         (pp_cxx_identifier): Likewise.
3163         (pp_cxx_tree_identifier): Likewise.
3164         (pp_cxx_ampersand): New macro.
3165         (pp_cxx_star): Likewise.
3166         (pp_cxx_arrow): Likewise.
3167         (pp_cxx_semicolon): Likewise.
3168         (pp_cxx_complement): Likewise.
3169         (pp_cxx_begin_template_argument_list): Declaree.
3170         (pp_cxx_end_template_argument_list): Likewise.
3171         (pp_cxx_colon_colon): likewise.
3172
3173 2004-05-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
3174
3175         * parser.c (cp_parser_simple_type_specifier): Explicitly test
3176         against NULL_TREE.
3177
3178 2004-05-31  Kazu Hirata  <kazu@cs.umass.edu>
3179
3180         * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
3181         typeck.c: Fix comment formatting.
3182
3183 2004-05-30  Andrew Pinski  <pinskia@physics.uc.edu>
3184
3185         * cp-lang.c (cp_expand_decl): Remove.
3186         (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
3187
3188 2004-05-30  Andreas Jaeger  <aj@suse.de>
3189
3190         * lang-specs.h: Add missing initializers for .ii.
3191
3192 2004-05-28  Aldy Hernandez  <aldyh@redhat.com>
3193
3194         * decl.c (cp_make_fname_decl): Free return value from
3195         fname_as_string.
3196
3197 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
3198
3199         PR c++/15083
3200         * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
3201         even in a templat.e
3202         * init.c (build_new): Likewise.
3203
3204         PR c++/15640
3205         * name-lookup.c (arg_assoc): Robustify.
3206
3207         PR c++/15471
3208         * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
3209         when determining the scope to use for a pointer to member.
3210         (lookup_anon_field): Give it external linkage.
3211         * cp-tree.h (lookup_anon_field): Declare it.
3212         * expr.c (cplus_expand_constant): Use it.
3213
3214 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
3215
3216         PR c++/14668
3217         * parser.c (cp_parser_simple_type_specifier): Call
3218         maybe_note_name_used_in_class.
3219
3220 2004-05-28  Tom Marshall  <tmarshall@real.com>
3221
3222         PR c++/15214
3223         * class.c (finish_struct_1): Warn only if the dtor is non-private or
3224         the class has friends.
3225
3226 2004-05-27  Adam Nemet  <anemet@lnxw.com>
3227
3228         PR c++/12883
3229         * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
3230         TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
3231
3232 2004-05-24  Geoffrey Keating  <geoffk@apple.com>
3233
3234         * method.c (implicitly_declare_fn): Don't call defer_fn; abort
3235         if it might be needed.
3236         * pt.c (mark_decl_instantiated): Only call defer_fn if
3237         the function actually needs processing in finish_file.
3238         * decl2.c (finish_file): Add check that elements in
3239         deferred_fns_used are really needed there.  Remove unnecessary
3240         test of DECL_SAVED_TREE.
3241
3242 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
3243
3244         * Make-lang.in: No need to specify $(LIBCPP).
3245
3246 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
3247
3248         PR c++/15044
3249         * parser.c (cp_parser_class_head): Robustify.
3250
3251         PR c++/15317
3252         * parser.c (cp_parser_decl_specifier_seq): Correct error in
3253         comment.
3254         (cp_parser_constructor_declarator_p): Treat attributes
3255         as decl-specifiers.
3256
3257         PR c++/15329
3258         * typeck.c (build_unary_op): Do not attempt to resolve casts to
3259         base classes in templates.
3260
3261 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
3262
3263         PR c++/15165
3264         * pt.c (instantiate_template): Robustify.
3265
3266 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
3267
3268         PR c++/15025
3269         * decl.c (xref_tag): Issue errors about redeclaring template
3270         classes as non-template classes.
3271
3272 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
3273
3274         PR c++/14821
3275         * name-lookup.c (supplement_binding): Allow redefinitions of
3276         namespace aliases.
3277
3278         PR c++/14883
3279         * parser.c (cp_parser_template_argument): Robustify.
3280
3281 2004-05-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3282
3283         * class.c (alter_access): Use %E format specifier to print an
3284         identifier node.  Avoid looking at the IDENTIFIER_POINTER.
3285         (push_lang_context): Likewise.
3286         * decl.c (lookup_label): Likewise.
3287         (grokdeclarator): Likewise.
3288         * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
3289         * pt.c (do_type_instantiation): Likewise.
3290         * tree.c (handle_java_interface_attribute): Likewise.
3291         (handle_com_interface_attribute): Likewise.
3292         (handle_init_priority_attribute): Likewise.
3293
3294 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
3295
3296         PR c++/15285
3297         PR c++/15299
3298         * pt.c (build_non_dependent_expr): Expand the set of tree nodes
3299         recognized as overloaded functions.
3300
3301 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
3302
3303         PR c++/15507
3304         * class.c (layout_nonempty_base_or_field): Do not try to avoid
3305         layout conflicts for unions.
3306
3307         PR c++/15542
3308         * typeck.c (build_x_unary_op): Instantiate template class
3309         specializations before looking for "operator &".
3310
3311         PR c++/15427
3312         * typeck.c (complete_type): Layout non-dependent array types, even
3313         in templates.
3314
3315         PR c++/15287
3316         * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
3317         template.
3318
3319 2004-05-22  Roger Sayle  <roger@eyesopen.com>
3320
3321         * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
3322         returning when TREE_TYPE is error_mark_node.
3323         * typeck.c (require_complete_type): Return error_mark_node if
3324         value's type is an error_mark_node.
3325
3326 2004-05-20  Andrew Pinski  <pinskia@physics.uc.edu>
3327
3328         * optimize.c (calls_setjmp_r): Remove.
3329         (calls_setjmp_p): Remove.
3330         * cp-tree.c (calls_setjmp_p): Remove.
3331         * decl.c (finish_function): Do not call calls_setjmp_p.
3332
3333 2004-05-18  Zack Weinberg  <zack@codesourcery.com>
3334
3335         * decl.c (cp_finish_decl): Use mark_decl_referenced.
3336         * decl2.c (maybe_make_one_only): Likewise.
3337         * method.c (use_thunk): Likewise.
3338
3339 2004-05-18  Jason Merrill  <jason@redhat.com>
3340
3341         * class.c (build_base_path): Tidy a bit.
3342
3343 2004-05-14  Geoffrey Keating  <geoffk@apple.com>
3344
3345         * name-lookup.c (struct scope_binding): New.
3346         (EMPTY_SCOPE_BINDING): New.
3347         (lookup_using_namespace): Take a scope_binding instead of a
3348         cxx_binding.
3349         (qualified_lookup_using_namespace): Likewise.
3350         (cxx_binding_clear): Delete.
3351         (do_nonmember_using_decl): Use a scope_binding instead of a
3352         cxx_binding.
3353         (lookup_tag): Don't call select_decl.
3354         (ambiguous_decl): Don't return anything (and change callers to match).
3355         Take a scope_binding as the second parameter.
3356         (lookup_namespace_name): Use a scope_binding instead of a
3357         cxx_binding.
3358         (unqualified_namespace_lookup): Likewise.
3359         (lookup_qualified_name): Likewise.
3360         (select_decl): Take a scope_binding instead of a cxx_binding.
3361         Use macros rather than hand-coding tests for type-ness.
3362
3363 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
3364
3365         * cp-gimplify.c: Rename from cp-simplify.c.
3366         * Make-lang.in, optimize.c: Update.
3367
3368 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
3369
3370         Merge from tree-ssa-20020619-branch.  See
3371         ChangeLog.tree-ssa for details.
3372
3373         * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
3374         cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
3375         expr.c, init.c, name-lookup.h, optimize.c, parser.c,
3376         pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
3377         Merged.
3378         * cp-mudflap.c: New file.
3379         * cp-simplify.c:: New file.
3380
3381 2004-05-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3382
3383         PR c++/14389
3384         * decl2.c (check_classfn): For member templates, compare also the
3385         template parameters to match the declaration.
3386         * cp-tree.h: Adjust declaration of check_classfn.
3387         * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
3388         * friend.c (do_friend): Likewise.
3389         * pt.c (tsubst_friend_function): Likewise.
3390
3391 2004-05-01  Zack Weinberg  <zack@codesourcery.com>
3392
3393         * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
3394         Instead, dig into the representation type to find the array bound.
3395
3396 2004-04-30  Jason Merrill  <jason@redhat.com>
3397
3398         Refer to base members using COMPONENT_REFs where possible.
3399         * class.c (build_simple_base_path): New fn.
3400         (build_base_path): Use it for non-virtual base references.
3401         (layout_class_type): Change base fields to their real type
3402         after layout is done.
3403         * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
3404         * cp-lang.c (cxx_get_alias_set): Use it.
3405
3406 2004-04-30  Kazu Hirata  <kazu@cs.umass.edu>
3407
3408         * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
3409         comment typos.
3410
3411 2004-04-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3412
3413         PR c++/15064
3414         * parser.c (cp_parser_postfix_expression): typeid operator cannot be
3415         used in integral constant expressions.
3416
3417 2004-04-22  Mark Mitchell  <mark@codesourcery.com>
3418
3419         * init.c (build_aggr_init): Fix accidental use of C99 construct in
3420         previous change.
3421
3422         * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
3423         braced initializer.
3424         * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
3425         * decl.c (reshape_init): Use it.
3426         * init.c (perform_member_init): Remove redundant condition.
3427         (build_aggr_init): Adjust to handle brace-enclosed initializers
3428         correctly.
3429         (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
3430
3431         * parser.c (cp_parser_initializer_clause): Do not set
3432         TREE_HAS_CONSTRUCTOR on the initializer.
3433         * rtti.c (tinfo_base_init): Likewise.
3434         (generic_initializer): Likewise.
3435         (ptr_initializer): Likewise.
3436         (ptm_initializer): Likewise.
3437         (class_initializer): Likewise.
3438         (get_pseudo_ti_init): Likewise.
3439         * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
3440
3441 2004-04-22  Alan Modra  <amodra@bigpond.net.au>
3442
3443         * name-lookup.c (anonymous_namespace_name): Make static.
3444
3445 2004-04-19  Roger Sayle  <roger@eyesopen.com>
3446
3447         PR middle-end/14531
3448         * class.c (build_base_path): Call fold whilst building the NULL
3449         pointer check expression trees.
3450
3451 2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>
3452
3453         * init.c (build_new_1): Don't use type size argument for Java
3454         _Jv_AllocObject call.
3455
3456 2004-04-09  Danny Smith  <dannysmith@users.sourceforge.net>
3457
3458         * method.c (make_alias_for_thunk): Remove preprocessor guard on
3459         declaration and definition.
3460
3461 2004-04-08  Danny Smith  <dannysmith@users.sourceforge.net>
3462
3463         PR c++/14808
3464         * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
3465         than ASM_OUTPUT_DEF.
3466
3467 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
3468
3469         * decl2.c (mark_used): Don't segfault if cfun != NULL but
3470         current_function_decl == NULL.
3471
3472 2004-04-05  Nathan Sidwell  <nathan@codesourcery.com>
3473
3474         PR c++/3518
3475         * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
3476         level.
3477
3478 2004-04-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3479
3480         * init.c (decl_constant_value): Don't look at DECL_INITIAL
3481         of PARM_DECL.
3482         * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
3483         or TREE_SIDE_EFFECTS of a type.
3484
3485 2004-04-02  Nathan Sidwell  <nathan@codesourcery.com>
3486
3487         PR c++/14007
3488         * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
3489         cv-qualifier unification.
3490         * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
3491
3492 2004-04-02  Jan Hubicka  <jh@suse.cz>
3493
3494         * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
3495         * cp-tree.h (cp_update_decl_after_saving): Declare.
3496         * tree.c (cp_update_decl_after_saving): Define.
3497
3498 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
3499
3500         PR c++/14803
3501         * typeck.c (get_delta_difference): Call fold before returning the
3502         value.
3503
3504 2004-04-01  Richard Henderson  <rth@redhat.com>
3505
3506         PR c++/14804
3507         * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
3508         * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
3509
3510 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
3511
3512         PR c++/14810
3513         * name-lookup.c (maybe_push_cleanup_level): Robustify.
3514
3515 2004-04-01  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3516
3517         * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
3518
3519 2004-03-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3520
3521         * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
3522         * class.c (check_bitfield_decl): Likewise.
3523         * cvt.c (type_promotes_to): Likewise.
3524         * decl.c (finish_enum): Likewise.
3525         * mangle.c (write_builtin_type): Likewise.
3526         * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
3527         * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
3528         (build_binary_op): Likewise.
3529
3530 2004-03-31  Jan Hubicka  <jh@suse.cz>
3531
3532         * tree.h (optimize_function): Kill prototype.
3533         * optimize.c (dump_function, optimize_function, dump_finction): Kill.
3534         * semantics.c (expand_body): Kill.
3535
3536 2004-03-30  Mark Mitchell  <mark@codesourcery.com>
3537
3538         PR c++/14724
3539         * decl.c (start_decl_1): Do not decide whether or not to create a
3540         new cleanup level until after the type has been completed.
3541
3542         PR c++/14763
3543         * pt.c (tsubst_default_argument): Clear current_function_decl.
3544
3545 2004-03-30  Zack Weinberg  <zack@codesourcery.com>
3546
3547         * name-lookup.c, parser.c: Use new shorter form of GTY markers.
3548
3549 2004-03-29  Zack Weinberg  <zack@codesourcery.com>
3550
3551         * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
3552         is null, just print the literal name and return.
3553
3554 2004-03-25  Kazu Hirata  <kazu@cs.umass.edu>
3555
3556         * cxx-pretty-print.c: Fix comment typos.
3557
3558 2004-03-24  Kazu Hirata  <kazu@cs.umass.edu>
3559
3560         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
3561         Update copyright.
3562
3563 2004-03-23  Ziemowit Laski  <zlaski@apple.com>
3564
3565         * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
3566         * mangle.c (write_type): Add call to 'mangle_fundamental_type'
3567         target hook.
3568
3569 2004-03-23  Zack Weinberg  <zack@codesourcery.com>
3570
3571         PR 12267, 12391, 12560, 13129, 14114, 14133
3572         * cp-lang.c (c_reset_state): Delete.
3573         (push_file_scope, pop_file_scope): New stubs.
3574         * parser.c (c_parse_file): Call sorry() here if called more than once.
3575
3576 2004-03-23  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3577
3578         * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
3579         for INTEGER_CST.
3580
3581 2004-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3582
3583         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
3584
3585 2004-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3586
3587         * error.c (enum pad): Remove.
3588         (dump_qualifiers): Likewise.
3589         (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
3590         (dump_aggr_type): Likewise.
3591         (dump_type_suffix): Likewise.
3592         (dump_simple_decl): Likewise.
3593         (dump_function_decl): Likewise.
3594         (cv_to_string): Likewise.
3595         (dump_type_prefix): Likewise.  Adjust return void.
3596         * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
3597         cxx_pretty_print.h.
3598         (pp_cxx_template_keyword_if_needed): Document.
3599         (pp_cxx_qualified_id): Document case FUNCTION_DECL.  Tidy.
3600         (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
3601         MUST_NOT_THROW_EXPR.
3602
3603 2004-03-21  Mark Mitchell  <mark@codesourcery.com>
3604
3605         PR c++/14616
3606         * decl.c (cp_finish_decl): Compute the size of arrays declared in
3607         templates, if their type is non-dependent.
3608
3609 2004-03-19  Mark Mitchell  <mark@codesourcery.com>
3610
3611         * call.c (build_op_delete_call): Do not forget the placement
3612         arguments when iterating through mutiple delete operators.
3613
3614         * cp-tree.h (svaed_scope): Remove last_parms.
3615         (NEW_DELETE_OPNAME_P): New macro.
3616         (last_function_parms): Remove.
3617         (do_friend): Adjust prototype.
3618         * decl.c (grokparms): Return the PARM_DECLs directly, rather than
3619         using last_function_parms.
3620         (grokfndecl): Take the PARM_DECLs as an argument, rather than
3621         using last_function_parms.
3622         (grokdeclarator): Adjust accordingly.  Do not form METHOD_TYPEs
3623         for class-specific operator new and operator delete.
3624         (grok_op_properties): Do not look for allocation functions with
3625         METHOD_TYPEs.
3626         (start_function): Use DECL_ARGUMENTS instead of
3627         last_function_parms.
3628         * decl.h (last_function_parms): Do not declare.
3629         * decl2.c (grokclassfn): Do not use last_function_parms.
3630         * friend.c (do_friend): Remove parmdecls parameter.
3631         * name-lookup.c (push_to_top_level): Do not save last_function_parms.
3632         (pop_from_top_level): Do not restore it.
3633         * pt.c (check_explicit_specialization): Do not adjust
3634         last_function_parms.
3635
3636         * name-lookup.c (do_local_using_decl): Create a local binding for
3637         types brought in via using declarations.
3638
3639         * name-lookup.c (lookup_arg_dependent): Handle block-scope
3640         function declarations correctly.
3641
3642         * semantics.c (finish_id_expression): Correct handling of
3643         conversion operators to dependent types.
3644
3645         * typeck.c (lookup_destructor): Allow the use of destructors from
3646         base classes.
3647
3648 2004-03-19  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3649
3650         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
3651         TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
3652         * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
3653         the field is named TEMPLATE_TYPE_PARM_INDEX.
3654
3655 2004-03-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3656
3657         PR c++/14545
3658         * parser.c (cp_parser_functional_cast): A cast to anything
3659         but integral or enumaration type is not an integral constant
3660         expression.
3661         * pt.c (value_dependent_expression_p): Handle cast expressions
3662         without operands (such as "int()").
3663
3664 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
3665
3666         * semantics.c (finish_pseudo_destructor_expr): Allow differing
3667         cv-qualification between the type named by the
3668         pseudo-destructor-name and the object-type.
3669
3670         * search.c (accessible_base_p): Handle non-proper bases.
3671
3672         * name-lookup.c (do_nonmember_using_decl): If a using declaration
3673         refers to a single overloaded function, set the type of the
3674         function.
3675         * tree.c (lvalue_type): Simplify.
3676         * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
3677         unknown type.
3678         (build_unary_op): Handle OVERLOADs with known types.
3679
3680         * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
3681         function templates.
3682
3683         * parser.c (cp_parser_postfix_expression): Handle the use of
3684         "typename" in non-dependent contexts.  Convert appropriately when
3685         when using a qualified name after "->" or ".".
3686
3687         * call.c (conditional_conversion): Honor the requirement that some
3688         conversions refer to the original object.
3689
3690 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
3691
3692         * call.c (build_conditional_expr): Do not call force_rvalue for
3693         operands of void_type when the conditional expression itself has
3694         void type.
3695         * name-lookup.c (pushdecl): Don't consider a declaration of a
3696         function named "main" to be an overload of a type named "main".
3697         * parser.c (cp_parser_template_name): Perform name lookup when the
3698         template name is proceeded by "template" if the qualifying scope
3699         is non-dependent.
3700         * typeck.c (composite_pointer_type_r): Correctly handle
3701         pointer-to-member types.
3702         (build_const_cast): Likewise.
3703
3704 2004-03-18  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3705
3706         * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
3707         * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
3708         (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
3709         (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
3710         (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
3711         (TYPEOF_TYPE_EXPR): New macro.
3712         * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
3713         * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
3714         * pt.c (tsubst): Likewise.
3715         * semantics.c (finish_typeof): Likewise.
3716         * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
3717         and TEMPLATE_TYPE_PARM.
3718         * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
3719         (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
3720
3721 2004-03-16  Mark Mitchell  <mark@codesourcery.com>
3722
3723         PR c++/14586
3724         * cp-tree.h (build_new_op): Change prototype.
3725         (build_x_binary_op): Likewise.
3726         * call.c (build_new_op): Add overloaded_p parameter.
3727         * decl2.c (grok_array_decl): Adjust call to build_new_op.
3728         * parser.c (cp_parser_binary_expression): Note that uses of
3729         overloaded operators prevents an expression from being considered
3730         an integral constant.
3731         * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
3732         build_x_binary_op.
3733         * semantics.c (finish_call_expr): Likewise.
3734         * typeck.c (rationalize_conditional_expr): Likewise.
3735         (build_x_indirect_ref): Likewise.
3736         (build_x_binary_op): Likewise.
3737         (build_x_unary_op): Likewise.
3738         (build_x_compound_expr): Likewise.
3739         (build_modify_expr): Likewise.
3740         * typeck2.c (build_x_arrow): Likewise.
3741
3742 2004-03-15  Kazu Hirata  <kazu@cs.umass.edu>
3743
3744         * cp-lang.c, ptree.c: Update copyright.
3745
3746 2004-03-13  Mark Mitchell  <mark@codesourcery.com>
3747
3748         PR c++/14550
3749         * parser.c (cp_parser_non_integral_constant_expression): Encode
3750         more of the idiom that surrounded calls to this function within
3751         the function itself
3752         (cp_parser_primary_expression): Adjust accordingly.
3753         (cp_parser_postfix_expression): Likewise.
3754         (cp_parser_unary_expression): Likewise.
3755         (cp_parser_cast_expression): Likewise.
3756         (cp_parser_assignment_expression): Likewise.
3757         (cp_parser_expression): Likewise.
3758         (cp_parser_new_expression): Note that new-expressions are not
3759         allowed in integral constant expressions.
3760         (cp_parser_delete_expression): Likewise.
3761
3762 2004-03-12  Matt Austern  <austern@apple.com>
3763
3764         * decl2.c (maybe_make_one_only): Look at
3765         TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
3766         to make an explicit instantiation weak.
3767         * method.c (use_thunk): Make sure we call comdat_linkage
3768         when appropriate.
3769         * pt.c (do_type_instantiation): On systems where weak symbols
3770         don't go in a static archive's TOC, explicit instantiation of a
3771         class must imply *explicit* instantiation of its memeber.
3772
3773 2004-03-11  Kazu Hirata  <kazu@cs.umass.edu>
3774
3775         * call.c, cp-tree.h, pt.c: Fix comment typos.
3776
3777 2004-03-10  Mark Mitchell  <mark@codesourcery.com>
3778
3779         PR c++/14510
3780         * decl.c (xref_tag): Disregard non-type declarations when
3781         looking up a tagged type.
3782
3783 2004-03-09  Nathan Sidwell  <nathan@codesourcery.com>
3784
3785         PR c++/14397
3786         * call.c (convert_like_real): Build a const qualified temporary,
3787         when testing ctor access.
3788
3789 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
3790
3791         * call.c (initialize_reference): Fix typo.
3792
3793 2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3794
3795         PR c++/14409
3796         * pt.c (determine_specialization): For member templates, match also
3797         constness.
3798
3799         PR c++/14448
3800         * parser.c (cp_parser_initializer_clause): Fold initializer if it is
3801         non-dependent.
3802         * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
3803
3804 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
3805
3806         PR c++/14230
3807         * call.c (initialize_reference): Handle initializers that are
3808         class-member access expressions applies to rvalues.
3809
3810 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
3811
3812         PR c++/14432
3813         * name-lookup.c (supplement_binding): Ignore functions that are
3814         marked DECL_ANTICIPATED.
3815
3816 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
3817
3818         PR c++/14401
3819         * class.c (check_field_decls): Complain about non-static data
3820         members of reference type in unions.  Propagate
3821         CLASSTYPE_REF_FIELDS_NEED_INIT and
3822         CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
3823         data members.
3824         * init.c (perform_member_init): Complain about mbmers with const
3825         type that are not explicitly initialized.
3826
3827 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
3828
3829         * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
3830         * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
3831         (lang_identifier): Remove implicit_decl and error_locus.
3832         (IDENTIFIER_IMPLICIT_DECL): Remove.
3833         (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
3834         (IDENTIFIER_ERROR_LOCUS): Likewise.
3835         (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
3836         (TYPE_ASSEMBLER_NAME_STRING): Likewise.
3837         (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
3838         (implicitly_declare): Remove.
3839         * decl.c (warn_extern_redeclared_static): Remove check of
3840         IDENTIFIER_IMPLICIT_DECL.
3841         (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
3842         (implicitly_declare): Remove.
3843         (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
3844         (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
3845         (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
3846         * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
3847         in the innermost scope, rather than at namespace scope.
3848         * name-lookup.c (push_local_binding): Give it external linkage.
3849         (pushdecl): Remove dead code.
3850         * name-lookup.h (push_local_binding): Declare it.
3851         * ptree.c (cxx_print_identifier): Don't print
3852         IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
3853         * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
3854         not IDENTIFIER_ERROR_LOCUS.
3855         * typeck.c (build_function_call): Remove dead code.
3856
3857 2004-03-08  Jason Merrill  <jason@redhat.com>
3858
3859         PR c++/13170
3860         * decl.c (xref_tag): Remove attribute handling.
3861         * cp-tree.h: Adjust prototype.
3862         * decl.c, parser.c, rtti.c: Adjust callers.
3863         * parser.c (cp_parser_class_head): Pass back attributes in the
3864         class head.
3865         (cp_parser_class_specifier): Adjust.
3866
3867 2004-03-08  Matt Austern  <austern@apple.com>
3868
3869         PR debug/14079
3870         * name-lookup.c (add_decl_to_level): Add extern variables, as well
3871         as static, to static_decls array.
3872
3873 2004-03-05  Jason Merrill  <jason@redhat.com>
3874
3875         * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
3876
3877 2004-03-04  Geoffrey Keating  <geoffk@apple.com>
3878
3879         * decl.c (grokfndecl): Update old incorrect comment.
3880         (grokvardecl): Diagnose C++ variables of type with no linkage.
3881
3882 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
3883
3884         PR c++/14369
3885         * pt.c (build_non_dependent_expr): Do not create a
3886         NON_DEPENDENT_EXPR for a THROW_EXPR.
3887
3888 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3889
3890         PR c++/14369
3891         * error.c (dump_expr): Handle THROW_EXPR.
3892
3893 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
3894
3895         PR c++/14360
3896         * parser.c (cp_parser_postfix_expression): Do not perform Koenig
3897         lookup if ordinary name-lookup finds a non-function.
3898         * pt.c (tsubst_copy_and_build): Likewise.
3899
3900         PR c++/14361
3901         * parser.c (cp_parser_late_parsing_default_args): Check that there
3902         are no extra tokens after the end of the default-argument
3903         expression.
3904
3905 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
3906
3907         PR c++/14324
3908         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
3909         having C++ linkage for name-mangling purposes.
3910
3911         PR c++/14260
3912         * parser.c (cp_parser_direct_declarator): Recognize constructor
3913         declarators that use a template-id to name the class being
3914         constructed.
3915
3916         PR c++/14337
3917         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
3918         (tsubst_expr): Do not call tsubst_copy, even when
3919         processing_template_decl.
3920
3921 2004-03-01  Jeff Law  <law@redhat.com>
3922
3923         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
3924         the proper type.
3925
3926 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
3927
3928         PR c++/14138
3929         * name-lookup.h (push_scope): Change prototype.
3930         * name-lookup.c (push_scope): Do not reenter the current class
3931         scope.
3932         * decl.c (grokfndecl): Check return code from push_scope before
3933         calling pop_scope.
3934         * decl2.c (check_classfn): Likewise.
3935         * parser.c (cp_parser_conversion_function_id): Likewise.
3936         (cp_parser_init_declarator): Likewise.
3937         (cp_parser_direct_declarator): Likewise.
3938         (cp_parser_class_specifier): Likewise.
3939         (cp_parser_class_head): Likewise.
3940         (cp_parser_lookup_name): Likewise.
3941         (cp_parser_constructor_declarator_p): Likewise.
3942         * pt.c (instantiate_class_template): Likewise.
3943         (resolve_typename_type): Likewise.
3944
3945 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
3946
3947         PR c++/14267
3948         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
3949         extension.
3950
3951         PR debug/12103
3952         * class.c (update_vtable_entry_for_fn): Do not go through
3953         covariance machinery if the type returned by an overrider is the
3954         same as the original.
3955
3956 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
3957
3958         * call.c: Fix a comment typo.
3959
3960 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
3961
3962         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
3963
3964 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
3965
3966         PR c++/14278
3967         * parser.c (cp_parser_parameter_declaration_list): Commit
3968         to fewer tentative parses.
3969
3970 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3971
3972         PR c++/14284
3973         * pt.c (dependent_type_p_r): A template template parameter is a
3974         dependent type.
3975
3976 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3977
3978         PR c++/14246
3979         * mangle.c (write_template_arg_literal): Don't rely on identity for
3980         boolean constants.
3981
3982 2004-02-24  Jason Merrill  <jason@redhat.com>
3983
3984         * tree.c (build_exception_variant): Use check_qualified_type.
3985
3986 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
3987             Kazu Hirata  <kazu@cs.umass.edu>
3988
3989         * decl.c (cxx_init_decl_processing): Don't check
3990         flag_writable_strings.
3991
3992 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
3993
3994         PR c++/14156
3995         * typeck.c (maybe_warn_about_returning_address_of_location):
3996         Change check for VAR_DECL to use DECL_P instead.
3997
3998 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3999
4000         PR c++/14250
4001         * cvt.c (build_expr_type_conversion): Type must be complete before
4002         looking up for conversions.
4003
4004 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4005
4006         PR c++/14143
4007         * name-lookup.c (arg_assoc_class): Don't look into template
4008         arguments if it is not a primary template.
4009
4010 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4011
4012         PR c++/12007
4013         * method.c (use_thunk): Always clone function argument tree.
4014
4015 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
4016
4017         PR c++/14199
4018         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
4019
4020         PR c++/14173
4021         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
4022         for all type variants.
4023
4024 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
4025
4026         PR c++/13927
4027         * decl.c (duplicate_decls): Return error_mark_node for invalid
4028         redeclarations.
4029         * name-lookup.c (push_namespace): Ignore the return value from
4030         pushdecl.
4031         * pt.c (push_template_decl_real): Robustify.
4032
4033         PR c++/14186
4034         * name-lookup.c (push_class_level_binding): Do not complain about
4035         adding a binding for a member whose name is the same as the
4036         enclosing class if the member is located in a base class of the
4037         current class.
4038
4039 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4040
4041         PR c++/14181
4042         * parser.c (cp_parser_new_expression): Parse an ill-formed
4043         direct-new-declarator after a parenthesized type-id to emit good
4044         diagnostic.
4045
4046 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
4047
4048         * cp-tree.def, cvt.c: Update copyright.
4049
4050 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
4051
4052         PR c++/11326
4053         * cp-tree.h (abi_version_at_least): Remove.
4054         * mangle.c: Include flags.h.
4055
4056 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
4057
4058         PR c++/13971
4059         * call.c (build_conditional_expr): Handle conversions between
4060         class types which result in differently cv-qualified type
4061         variants.
4062
4063         PR c++/14086
4064         * class.c (delete_duplicate_fields_1): Remove.
4065         (delete_duplicate_fields): Likewise.
4066         (finish_struct_anon): Remove check for members with the same name
4067         as their enclosing class.
4068         (check_field_decls): Do not call duplicate_fields.
4069         * decl.c (grokdeclarator): Remove check for static data members
4070         with the same name as their enclosing class.
4071         * name-lookup.c (push_class_level_binding): Check for members with
4072         the same name as their enclosing class.
4073
4074 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4075
4076         PR c++/14085
4077         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
4078
4079 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4080
4081         PR c++/13635
4082         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
4083         has full set of arguments.
4084
4085 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4086
4087         PR c++/13927
4088         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
4089
4090 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
4091
4092         PR c++/14122
4093         * cp-tree.h (delete_sanity): Change prototype.
4094         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
4095         Remove dead code.  Adjust code to warn about deleting an array.
4096         * typekc.c (decay_conversion): Use build_address and build_nop.
4097
4098         PR c++/14108
4099         * search.c (accessible_p): Do not check access in thunks.
4100
4101         PR c++/14083
4102         * call.c (build_conditional_expr): Call force_rvalue on the
4103         non-void operand in the case that one result is a throw-expression
4104         and the other is not.
4105
4106 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
4107
4108         PR c++/9851
4109         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
4110         the type name and look ahead for ::~, and bail out early with a
4111         better error message if the parse is going to fail.
4112
4113 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
4114
4115         * call.c (conversion_kind): New type.
4116         (conversion_rank): Likewise.
4117         (conversion): Likewise.
4118         (CONVERSION_RANK): New macro.
4119         (conversion_obstack): New variable.
4120         (obstack_initialized): Likewise.
4121         (z_candidate): Change type of convs and second_conv.
4122         (candidate_warning): New type.
4123         (IDENTITY_RANK): Remove.
4124         (EXACT_RANK): Likewise.
4125         (PROMO_RANK): Likewise.
4126         (STD_RANK): Likewise.
4127         (PBOOL_RANK): Likewise.
4128         (USER_RANK): Likewise.
4129         (ELLIPSIS_RANK): Likewise.
4130         (BAD_RANK): Likewise.
4131         (ICS_RANK): Likewise.
4132         (ICS_STD_RANK): Likewise.
4133         (ICS_USER_FLAG): Likewise.
4134         (ICS_ELLIPSIS_FLAG): Likewise.
4135         (ICS_THIS_FLAG): Likewise.
4136         (ICS_BAD_FLAG): Likewise.
4137         (NEED_TEMPORARY_P): Likewise.
4138         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
4139         (USER_CONV_CAND): Likewise.
4140         (USER_CONV_FN): Likewise.
4141         (conversion_obstack_alloc): New function.
4142         (alloc_conversion): Likewise.
4143         (validate_conversion_obstack): Likewise.
4144         (alloc_conversions): Likewise.
4145         (build_conv): Adjust to deal with new conversion data structures.
4146         (build_identity_conv): New function.
4147         (build_ambiguous_conv): Likewise.
4148         (standard_conversion): Adjust to deal with new conversion data
4149         structures.
4150         (convert_class_to_reference): Likewise.
4151         (direct_reference_binding): Likewise.
4152         (reference_binding): Likewise.
4153         (implicit_conversion): Likewise.
4154         (add_candidate): Likewise.
4155         (add_function_candidate): Likewise.
4156         (add_conv_candidate): Likewise.
4157         (build_builtin_candidate): Likewise.
4158         (print_z_candidate): Likewise.
4159         (merge_conversion_sequences): Likewise.
4160         (build_user_type_conversion_1): Likewise.
4161         (build_user_type_conversion): Likewise.
4162         (build_new_function_call): Likewise.
4163         (build_object_call): Likewise.
4164         (conditional_conversion): Likewise.
4165         (build_conditional_expr): Likewise.
4166         (build_new_op): Likewise.
4167         (build_op_delete_call): Likewise.
4168         (convert_like_real): Likewise.
4169         (build_over_call): Likewise.
4170         (build_new_method_call): Likewise.
4171         (is_subseq): Likewise.
4172         (maybe_handle_implicit_object): Likewise.
4173         (maybe_handle_ref_bind): Likewise.
4174         (compare_ics): Likewise.
4175         (source_type): Likewise.
4176         (add_warning): Likewise.
4177         (joust): Likewise.
4178         (can_convert_arg): Likewise.
4179         (can_convert_arg_bad): Likewise.
4180         (perform_implicit_conversion): Likewise.
4181         (perform_direct_initialization_if_possible): Likewise.
4182         (initialize_reference): Likewise.
4183         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
4184         * cp-tree.def (WRAPPER): Likewise.
4185         (IDENTITY_CONV): Remove.
4186         (LVALUE_CONV): Likewise.
4187         (QUAL_CONV): Likewise.
4188         (STD_CONV): Likewise.
4189         (PTR_CONV): Likewise.
4190         (PMEM_CONV): Likewise.
4191         (BASE_CONV): Likewise.
4192         (REF_BIND): Likewise.
4193         (USER_CONV): Likewise.
4194         (AMBIG_CONV): Likewise.
4195         (RVALUE_CONV): Likewise.
4196         * cp-tree.h (tree_wrapper): Remove.
4197         (WRAPPER_ZC): Remove.
4198         (lang_tree_node): Remove wrapper.
4199         (LOOKUP_SPECULATIVELY): Remove.
4200         (build_op_delete_call): Adjust prototype.
4201         (validate_conversion_obstack): Declare.
4202         (build_zc_wrapper): Remove.
4203         * cvt.c (convert_to_reference): Remove dead code.
4204         (ocp_convert): Likewise.
4205         * decl.c (redeclaration_error_message): Correct handling of
4206         templates.
4207         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
4208         (cp_tree_node_structure): Remove WRAPPER case.
4209         * decl2.c (finish_file): Call validate_conversion_obstack.
4210         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
4211         (build_op_delete_call): Likewise.
4212         (build_x_delete): Likewise.
4213         (build_delete): Adjust call to build_op_delete_call.
4214         * pt.c (tsubst_friend_declaration): Adjust code to determine
4215         whether or not a friend template is a definition.
4216         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
4217         * tree.c (build_zc_wrapper): Remove.
4218
4219 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
4220
4221         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
4222         * cp-tree.h: Don't declare cxx_builtin_type_decls.
4223         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
4224         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
4225
4226 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
4227
4228         * typeck.c (lookup_destructor): Fix typo in error message.
4229
4230 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
4231
4232         * call.c, parser.c, tree.c: Fix comment typos.
4233
4234 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
4235
4236         Bug 13856
4237         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
4238         * decl.c (duplicate_decls, start_function): Likewise.
4239
4240 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
4241
4242         * name-lookup.c (pushdecl): Issue shadow warnings directly.
4243         * parser.c (free_parser_stacks): Delete.
4244
4245 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
4246
4247         * rtti.c: Update copyright.
4248
4249 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4250
4251         PR c++/14033
4252         * decl.c (require_complete_types_for_parms): Do not insert
4253         error_mark_node in the parameter list.
4254
4255 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4256
4257         PR c++/14028
4258         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
4259         error when terminator can not be found.
4260
4261 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
4262
4263         Make-lang.in (po-generated):  Delete.
4264
4265 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
4266
4267         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
4268         targetm.calls.promote_prototypes.
4269
4270 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
4271
4272         PR middle-end/13750
4273         Revert:
4274         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
4275         PR pch/13361
4276         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
4277         (handle_pragma_implementation): Likewise.
4278
4279 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
4280
4281         PR c++/13714
4282         * typeck.c (lookup_destructor): Tweak error message.
4283
4284 2004-02-05  Jan Hubicka  <jh@suse.cz>
4285
4286         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
4287         functions.
4288
4289 2004-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4290
4291         PR c++/14008
4292         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
4293         code, only emits the diagnostic now. Added lookup of the identifier
4294         and support for qualified ids.
4295         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
4296         Parse an (invalid) type name as id-expression within a declarator.
4297         (cp_parser_simple_declaration): Use it.
4298         (cp_parser_member_declaration): Likewise.
4299         (cp_parser_make_typename_type): New function. Handle errors through
4300         cp_parser_diagnose_invalid_typename.
4301         (cp_parser_elaborated_type_specifier): Use it.
4302
4303 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
4304
4305         PR c++/13932
4306         * call.c (convert_like_real): Use "converting" rather than
4307         "argument" as the descriptive keyword to
4308         dubious_conversion_warnings.
4309         * typeck.c (convert_for_assignment): Do not call
4310         dubious_conversion_warnings.
4311
4312 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4313
4314         PR c++/13086
4315         * init.c (build_delete): Emit a more informative error message in
4316         case of an incomplete type, and on the correct source line.
4317
4318 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
4319
4320         * error.c, search.c: Update copyright.
4321
4322 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
4323
4324         PR c++/9941
4325         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
4326         linkage for the typeinfo name string.
4327
4328 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
4329
4330         PR c++/13969
4331         * cp-tree.h (fold_non_dependent_expr): New function.
4332         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
4333         (cp_parser_template_argument): Use fold_non_dependent_expr.
4334         (cp_parser_direct_declarator): Likewise.
4335         * pt.c (fold_non_dependent_expr): New function.
4336         (convert_nontype_argument): Use it.
4337         (tsubst_qualified_id): Simplify.
4338         (tsubst_copy_and_build): Likewise.
4339
4340 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
4341
4342         * decl.c (cxx_push_function_context): Do not set
4343         current_function_is_thunk.
4344         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
4345         actual function.
4346
4347 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4348
4349         PR c++/13997
4350         * pt.c (more_specialized_class): Increase processing_template_decl
4351         while partial ordering.
4352
4353 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
4354
4355         PR c++/13925
4356         * decl.c (start_function): Do not call pushdecl for any
4357         instantiation or specialization of a primary template.
4358
4359 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
4360
4361         PR c++/13950
4362         * parser.c (cp_parser_class_name): Robustify.
4363
4364         PR c++/13970
4365         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
4366
4367         PR c++/14002
4368         * semantics.c (finish_id_expression): Do not return an
4369         IDENTIFIER_NODE when lookup finds a PARM_DECL.
4370
4371 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
4372
4373         PR c++/13978
4374         * pt.c (build_non_dependent_expr): Do not build
4375         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
4376
4377         PR c++/13968
4378         * semantics.c (finish_id_expression): Do not return an
4379         IDENTIFIER_NODE when lookup finds a VAR_DECL.
4380
4381         PR c++/13975
4382         * parser.c (cp_parser_simple_declaration): When skipping to the
4383         end of the statement swallow the terminating semicolon.
4384
4385 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
4386
4387         PR c++/13113
4388         * init.c (build_offset_ref): Improve error recovery for invalid
4389         uses of non-static member functions.
4390
4391         PR c++/13854
4392         * cp-tree.h (cp_build_type_attribute_variant): New function.
4393         * class.c (build_clone): Use cp_build_type_attribute_variant.
4394         * decl.c (duplicate_decls): Likewise.
4395         * pt.c (copy_default_args_to_explicit_spec): Likewise.
4396         (tsubst_function_type): Likewise.
4397         * tree.c (build_exception_variant): Check attributes before
4398         concluding that two types are the same.
4399         (cp_build_type-attribute_variant): New method.
4400         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
4401
4402         PR c++/13907
4403         * call.c (convert_class_to_reference): Keep better track of
4404         pedantically invalid user-defined conversions.
4405
4406 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4407
4408         PR c++/13957
4409         * pt.c (tsubst_qualified_id): Improved error message when a type
4410         is expected but not found.
4411
4412 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
4413
4414         * class.c: Fix comment typos.
4415         * decl.c: Likewise.
4416         * error.c: Likewise.
4417         * parser.c: Likewise.
4418         * pt.c: Likewise.
4419         * search.c: Likewise.
4420         * typeck.c: Likewise.
4421
4422 2004-01-30  Richard Henderson  <rth@redhat.com>
4423
4424         PR c++/13693
4425         * method.c (use_thunk): Don't force_target_expr for void thunks.
4426         * tree.c (build_target_expr_with_type): Assert non-void type.
4427         (force_target_expr): Likewise.
4428
4429 2004-01-30  Michael Matz  <matz@suse.de>
4430
4431         * parser.c (cp_parser_labeled_statement): Accept case ranges.
4432
4433 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4434
4435         DR206
4436         PR c++/13813
4437         * decl.c (grokdeclarator): Check immediatly type completeness for
4438         non-dependent types.
4439
4440 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4441
4442         PR c++/13683
4443         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
4444         a sizeof expression.block
4445
4446 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
4447
4448         PR c++/13883
4449         * mangle.c (write_encoding): Correct encoding of member template
4450         constructors.
4451
4452 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4453
4454         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
4455         template name as it was `<::' (digraph typo).
4456         (cp_parser_nth_token_starts_template_argument_list_p): New function.
4457         (cp_parser_id_expression): Use it.
4458         (cp_parser_nested_name_specifier_opt): Likewise.
4459         (cp_parser_template_name): Likewise.
4460         (cp_parser_class_name): Likewise.
4461         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
4462
4463 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
4464
4465         PR c++/13791
4466         * typeck.c (merge_types): Do not merge attributes into
4467         TYPENAME_TYPEs.
4468
4469         PR c++/13736
4470         * parser.c (cp_parser_direct_declarator): Do not prevent
4471         backtracking inside a parenthesized declarator.
4472         (cp_parser_parameter_declaration): Fix typo in comment.
4473
4474 2004-01-28  Jan Hubicka  <jh@suse.cz>
4475
4476         * semantics.c (expand_body)  Do emit_associated_thunks before
4477         expansion.
4478
4479 2004-01-27  Devang Patel  <dpatel@apple.com>
4480
4481         * name-lookup.c: Include "debug.h"
4482         (do_namespace_alias): Invoke debug_hooks to emit debug info
4483         for namespace alias.
4484         (do_local_using_decl): Invoke debug_hooks to emit debug info
4485         for using decl.
4486         (do_class_using_decl): Same.
4487         (do_toplevel_using_decl): Same.
4488         (do_using_directive): Same.
4489         (cp_emit_debug_info_for_using): New function.
4490         * Make-lang.in (cp/parser.o): Depend on debug.h
4491         (cp/name-lookup.o): Same.
4492
4493 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4494
4495         * cp-tree.h (language_function, lang_type_header): Use
4496         BOOL_BITFIELD.
4497         * name-lookup.h (cp_binding_level): Likewise.
4498
4499 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
4500
4501         PR c++/13663
4502         * semantics.c (finish_for_expr): Check for unresolved overloaded
4503         functions.
4504
4505         * class.c (add_method): Just check processing_template_decl to
4506         determine whether or not we are within a template.
4507         * decl2.c (maybe_retrofit_in_chrg): Likewise.
4508         * init.c (decl_constant_value): Check the type of the declaration,
4509         not TREE_READONLY.
4510         * name-lookup.c (maybe_push_to_top_level): Rename to ...
4511         (push_to_top_level): ... this.
4512         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
4513         * pt.c (push_template_decl_real): Reorder condition for speed.
4514         (convert_template_argument): Use dependency-checking functions in
4515         place of uses_template_parms.
4516         (lookup_template_class): Avoid calling uses_template_parms more
4517         than once.
4518         (uses_template_parms): Reimplement, using dependency-checking
4519         functions.
4520         (instantiate_class_template): Use push_to_top_level, not
4521         maybe_push_to_top_level.
4522         (type_unification_real): Simplify.
4523         (type_dependent_expression_p): Handle OFFSET_REFs and
4524         TEMPLATE_DECLs.
4525         (any_dependent_template_arguments_p): Handle multiple levels of
4526         template argument.
4527         * semantics.c (expand_or_defer_fn): Do not check
4528         uses_template_parms for template instantiations.
4529         * typeck.c (comptypes): Avoid calling cp_type_quals.
4530
4531 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
4532
4533         PR c++/13833
4534         * call.c (build_over_call): Do not convert arguments when
4535         processing a template.
4536         * pt.c (build_non_dependent_expr): Do not build a
4537         NON_DEPENDENT_EXPR for arithmetic constants.
4538
4539 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4540
4541         PR c++/13810
4542         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
4543         returns a TYPE_DECL. no further lookup is required.
4544         * semantics.c (check_template_template_default_arg): A TYPE_DECL
4545         is invalid. Rework to give better diagnostics.
4546
4547 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4548
4549         PR c++/13797
4550         * pt.c (instantiate_class_template): Add an error_mark_node
4551         check.
4552         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
4553
4554 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
4555
4556         PR c++/13701
4557         * decl.c (finish_function): Move the call to
4558         finish_fname_decls below the call to
4559         finish_eh_spec_block.
4560
4561 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
4562
4563         * optimize.c, typeck2.c: Update copyright.
4564
4565 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
4566
4567         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
4568         init.c, mangle.c, typeck.c: Update copyright.
4569
4570 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
4571
4572         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
4573
4574 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
4575
4576         * Make-lang.in: Replace $(docdir) with doc.
4577         (c++.info, c++.srcinfo): Dummy entry.
4578         (c++.man, c++.srcman): New rules.
4579         (c++.install-man): Revamp rule.
4580
4581 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
4582
4583         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
4584         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
4585         immediate $(shell) instead of deferred backquote.
4586
4587 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
4588
4589         PR c++/13651
4590         * parser.c (cp_parser_postfix_expression): When encountering
4591         incomplete type on left-hand side of "->" or ".", treat the entire
4592         expression as erroneous.
4593
4594         PR c++/13592
4595         * call.c (build_field_call): Remove.
4596         (n_build_method_call): Likewise.
4597         (build_method_call): Likewise.
4598         (build_new_method_call): Do not call build_field_call.
4599         * class.c (n_build_method_call): Remove.
4600         (print_class_statistics): Do not print it.
4601         * cp-tree.h (build_method_call): Remove declaration.
4602         (finish_object_call_expr): Likewise.
4603         (build_new_1): Do not use build_method_call.
4604         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
4605         when the function appearing on the right-hand-side of "." or "->"
4606         is not actually a function.
4607         * pt.c (tsubst_copy_and_build): Likewise.
4608         * semantics.c (finish_object_call_expr): Remove.
4609
4610 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
4611
4612         PR c++/13710
4613         * pt.c (tsubst): Use finish_typeof.
4614
4615 2004-01-18  Jason Merrill  <jason@redhat.com>
4616
4617         PR c++/11725
4618         * except.c (build_throw): In a template, set
4619         current_function_returns_abnormally.
4620
4621 2004-01-17  Fred Fish  <fnf@intrinsity.com>
4622
4623         PR c++/11895
4624         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
4625         except don't call array_type_nelts() with a VECTOR_TYPE.
4626
4627 2004-01-16  Jan Hubicka  <jh@suse.cz>
4628
4629         * mangle.c (write_mangled_name): Remove inline modifier.
4630
4631 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
4632
4633         PR c++/13574
4634         * decl.c (compute_array_index_type): Fix grammar in comment.
4635         * init.c (build_zero_init): Handle zero-sized arrays correctly.
4636
4637         PR c++/13178
4638         * call.c (name_as_c_string): Print conversion operator names
4639         correctly.
4640
4641         PR c++/13478
4642         * call.c (initialize_reference): Pass -1 for inner parameter to
4643         convert_like_real.
4644
4645 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4646
4647         PR c++/13407
4648         * parser.c (cp_parser_base_specifier): Check for an invalid
4649         keyword `typename' and emit an user-friendly error message.
4650
4651 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
4652
4653         PR pch/13361
4654         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
4655         (handle_pragma_implementation): Likewise.
4656
4657 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4658
4659         PR c++/9259
4660         * typeck.c (build_class_member_access_expr): Allow to access members
4661         of the currently open class.
4662         (finish_class_member_access_expr): Likewise.
4663
4664 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
4665
4666         PR c++/13659
4667         * name-lookup.c (validate_nonmember_using_decl): Take scope and
4668         name by value, instead of computing them.
4669         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
4670         arguments.  Pass them to validate_nonmember_using_decl.
4671         * name-lookup.h (do_local_using_decl): Adjust.
4672         (do_toplevel_using_decl): Likewise.
4673         * parser.c (cp_parser_using_declaration): Likewise.
4674         * pt.c (tsubst_expr): Likewise.
4675
4676 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
4677
4678         PR c++/13594
4679         PR c++/13658
4680         * name-lookup.c (qualified_lookup_using_namespace): Search
4681         strongly-associated namespaces first, and only then try other
4682         namespaces.
4683
4684 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
4685
4686         * Make-lang.in (c++.srcextra): Dummy entry.
4687
4688 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4689
4690         PR c++/8856
4691         * parser.c (cp_parser_template_name): Don't try to parse a
4692         conversion-function-id, as it cannot be a template-name.
4693         (cp_parser_simple_type_specifier): Check for invalid template-ids
4694         even after a built-in type.
4695
4696 2004-01-14  Jan Hubicka  <jh@suse.cz>
4697
4698         PR c++/12850
4699         * pt.c (instantiate_decl):  Do not increase function_depth.
4700
4701 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
4702
4703         PR c++/9021
4704         PR c++/11005
4705         * parser.c (cp_parser_elaborated_type_specifier): Warn about
4706         attributes and discard.
4707         * decl.c (xref_tag): Don't overwite existing attributes with
4708         NULL_TREE.
4709
4710 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4711
4712         PR c++/12335
4713         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
4714         is no destructor while looking up a BIT_NOT_EXPR.
4715
4716 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
4717
4718         * cxxfilt.c: Remove unused file.
4719
4720 2004-01-14  Jan Hubicka  <jh@suse.cz>
4721
4722         Partial fix to PR c++/12850
4723         * decl2.c (mark_used): Do not proactively instantiate templates
4724         when compiling in unit-at-a-time or not optimizing.
4725         * optimize.c (maybe_clone_body): Do not increase function depth.
4726
4727 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4728
4729         PR c++/13474
4730         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
4731
4732 2004-01-12  Steven Bosscher  <stevenb@suse.de>
4733
4734         PR c++/13558
4735         * parser.c (cp_parser_member_declaration): Any non-type is also
4736         not a class or a function.
4737
4738 2004-01-12  Jason Merrill  <jason@redhat.com>
4739
4740         PR c++/12815
4741         * class.c (build_base_path): Do not mark vtable references as
4742         TREE_CONSTANT.
4743         (build_vtbl_ref_1): Likewise.
4744
4745 2004-01-12  Richard Henderson  <rth@redhat.com>
4746
4747         PR opt/10776
4748         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
4749         (store_init_value): Use it.
4750         * decl.c (check_initializer): Expect full initialization code
4751         from store_init_value.
4752         * init.c (expand_aggr_init_1): Likewise.
4753         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
4754
4755 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
4756
4757         * class.c (layout_class_type): For non-POD class types, also copy
4758         the DECL_SIZE and DECL_MODE of fields to the base class type.
4759
4760 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4761
4762         PR c++/13289
4763         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
4764         calling regenerate_decl_from_template.
4765
4766 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
4767
4768         PR c++/4100
4769         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
4770         decl-specifier occurring along with a class definition.
4771
4772 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
4773
4774         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
4775         clauses to comments describing declares_class_or_enum.
4776         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
4777         false.
4778
4779 2004-01-12  Jan Hubicka  <jh@suse.cz>
4780
4781         * pt.c (for_each_template_parm): Do not check for duplicates.
4782         (for_each_template_parm): Use walk_tree duplicate checking code.
4783
4784 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
4785
4786         PR c++/3478
4787         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
4788         is error_mark_node, don't add any more decl_specs.
4789         (cp_parser_init_declarator): After committing to a declaration, if
4790         the decl_specifiers start with error_mark_node, issue an error and
4791         change the type to "int".
4792
4793 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
4794
4795         PR bootstrap/7817
4796         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
4797
4798 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4799
4800         DR 337
4801         PR c++/9256
4802         * pt.c (tsubst): Substitution must fail if we are attempting to
4803         create an array with element type that is an abstract class type.
4804         * decl.c (cp_finish_decl): Strip pointers and array types recursively
4805         before calling abstract_virtuals_error.
4806
4807 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
4808
4809         * name-lookup.c (qualified_lookup_using_namespace): Consider
4810         strong using directives even if we've already found a binding.
4811
4812 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
4813
4814         * cp-tree.h (cxx_expand_expr): Change prototype.
4815         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
4816
4817 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4818
4819         PR c++/12573
4820         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
4821         looking into them recursively. They can be there because of the
4822         new __offsetof__ extension.
4823
4824 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
4825
4826         * parser.c (cp_parser_save_member_function_body): Mark the
4827         definition static.
4828
4829 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
4830
4831         PR c++/13057
4832         * class.c (build_clone): Copy type attributes from the original
4833         function to the clone.
4834
4835         PR c++/12815
4836         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
4837         references as constant.
4838
4839         PR c++/12132
4840         * parser.c (cp_parser_explicit_instantiation): Improve error
4841         recovery.
4842         (cp_parser_require): Improve indication of the error location.
4843
4844         PR c++/13451
4845         * parser.c (cp_parser_class_head): Reorder logic to check for
4846         invalid qualification.
4847
4848 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
4849
4850         PR c++/13157
4851         * name-lookup.c (lookup_using_namespace): Remove spacesp
4852         parameter.
4853         (unqualified_namespace_lookup): Likewise.
4854         (lookup_qualified_name): Adjust accordingly.
4855         (lookup_name_real): Likewise.
4856         (lookup_arg_dependent): Do not eliminate the namespace of the
4857         functions found by unqualified name lookup unless that is the
4858         current namespace.
4859
4860 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
4861
4862         * semantics.c (push_deferring_access_checks): Fix format.
4863         (resume_deferring_access_checks): Likewise.
4864         (stop_deferring_access_checks): Likewise.
4865         (pop_deferring_access_checks): Likewise.
4866         (get_deferred_access_checks): Likewise.
4867         (pop_to_parent_deferring_access_checks): Likewise.
4868         (perform_deferred_access_checks): Likewise.
4869         (perform_or_defer_access_check): Likewise.
4870
4871 2004-01-04  Richard Henderson  <rth@redhat.com>
4872
4873         * call.c (build_over_call): Don't create a save_expr of an
4874         aggregate, but rather its address.
4875
4876 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
4877
4878         PR c++/13529
4879         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
4880         an offsetof expression.
4881
4882         * parser.c (cp_parser_parameter_declaration): Fix comment.
4883
4884         PR c++/12226
4885         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
4886         (reference_binding): Set it when appropriate.
4887         (build_temp): New function, split out from ...
4888         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
4889         (initialize_reference): Likewise.
4890
4891         PR c++/13536
4892         * parser.c (cp_parser): Add in_type_id_in_expr_p.
4893         (cp_parser_new): Initialize it.
4894         (cp_parser_postfix_expression): Set it.
4895         (cp_parser_sizeof_operand): Likewise.
4896         (cp_parser_parameteR_declaration): Do not commit early to tenative
4897         parsers when in_type_id_in_expr_p is set.
4898
4899 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4900
4901         PR c++/13094
4902         * parser.c (cp_parser_template_argument): Don't call
4903         make_unbound_class_template directly.
4904         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
4905         UNBOUND_CLASS_TEMPLATE tree node.
4906
4907 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
4908
4909         PR target/12729
4910         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
4911
4912 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4913
4914         PR c++/13520
4915         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
4916         (DECL_FUNCTION_TEMPLATE_P): Use it.
4917         (DECL_CLASS_TEMPLATE_P): Likewise.
4918         * parser.c (cp_parser_lookup_name): Add is_template parameter.
4919         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
4920         (cp_parser_template_name): Likewise.
4921         (cp_parser_elaborated_type_specifier): Likewise.
4922         (cp_parser_namespace_name): Likewise.
4923         (cp_parser_class_name): Likewise.
4924         (cp_parser_lookup_name_simple): Likewise.
4925
4926 See ChangeLog.3 for earlier changes.