OSDN Git Service

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