OSDN Git Service

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