PR c++/14369
[official-gcc.git] / gcc / cp / ChangeLog
blob02b99e44b308da68ad67483ccf273784cf310bfc
1 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3         PR c++/14369
4         * error.c (dump_expr): Handle THROW_EXPR.
6 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
8         PR c++/14324
9         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
10         having C++ linkage for name-mangling purposes.
12         PR c++/14260
13         * parser.c (cp_parser_direct_declarator): Recognize constructor
14         declarators that use a template-id to name the class being
15         constructed.
17         PR c++/14337
18         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
19         (tsubst_expr): Do not call tsubst_copy, even when
20         processing_template_decl.       
22 2004-03-01  Jeff Law  <law@redhat.com>
24         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
25         the proper type.
27 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
29         PR c++/14138
30         * name-lookup.h (push_scope): Change prototype.
31         * name-lookup.c (push_scope): Do not reenter the current class
32         scope.
33         * decl.c (grokfndecl): Check return code from push_scope before
34         calling pop_scope.
35         * decl2.c (check_classfn): Likewise.
36         * parser.c (cp_parser_conversion_function_id): Likewise.
37         (cp_parser_init_declarator): Likewise.
38         (cp_parser_direct_declarator): Likewise.
39         (cp_parser_class_specifier): Likewise.
40         (cp_parser_class_head): Likewise.
41         (cp_parser_lookup_name): Likewise.
42         (cp_parser_constructor_declarator_p): Likewise.
43         * pt.c (instantiate_class_template): Likewise.
44         (resolve_typename_type): Likewise.
46 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
48         PR c++/14267
49         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
50         extension.
52         PR debug/12103
53         * class.c (update_vtable_entry_for_fn): Do not go through
54         covariance machinery if the type returned by an overrider is the
55         same as the original.
57 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
59         * call.c: Fix a comment typo.
61 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
63         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
65 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
67         PR c++/14278
68         * parser.c (cp_parser_parameter_declaration_list): Commit
69         to fewer tentative parses.
71 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
73         PR c++/14284
74         * pt.c (dependent_type_p_r): A template template parameter is a
75         dependent type.
77 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
79         PR c++/14246
80         * mangle.c (write_template_arg_literal): Don't rely on identity for
81         boolean constants.
83 2004-02-24  Jason Merrill  <jason@redhat.com>
85         * tree.c (build_exception_variant): Use check_qualified_type.
87 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
88             Kazu Hirata  <kazu@cs.umass.edu>
90         * decl.c (cxx_init_decl_processing): Don't check
91         flag_writable_strings.
93 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
95         PR c++/14156
96         * typeck.c (maybe_warn_about_returning_address_of_location):
97         Change check for VAR_DECL to use DECL_P instead.
99 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
101         PR c++/14250
102         * cvt.c (build_expr_type_conversion): Type must be complete before
103         looking up for conversions.
105 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
107         PR c++/14143
108         * name-lookup.c (arg_assoc_class): Don't look into template 
109         arguments if it is not a primary template.
111 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
113         PR c++/12007
114         * method.c (use_thunk): Always clone function argument tree.
116 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
118         PR c++/14199
119         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
121         PR c++/14173
122         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
123         for all type variants.
125 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
127         PR c++/13927
128         * decl.c (duplicate_decls): Return error_mark_node for invalid
129         redeclarations.
130         * name-lookup.c (push_namespace): Ignore the return value from
131         pushdecl.
132         * pt.c (push_template_decl_real): Robustify.
134         PR c++/14186
135         * name-lookup.c (push_class_level_binding): Do not complain about
136         adding a binding for a member whose name is the same as the
137         enclosing class if the member is located in a base class of the
138         current class.
140 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
142         PR c++/14181
143         * parser.c (cp_parser_new_expression): Parse an ill-formed 
144         direct-new-declarator after a parenthesized type-id to emit good
145         diagnostic.
147 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
149         * cp-tree.def, cvt.c: Update copyright.
151 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
153         PR c++/11326
154         * cp-tree.h (abi_version_at_least): Remove.
155         * mangle.c: Include flags.h.
157 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
159         PR c++/13971
160         * call.c (build_conditional_expr): Handle conversions between
161         class types which result in differently cv-qualified type
162         variants.
164         PR c++/14086
165         * class.c (delete_duplicate_fields_1): Remove.
166         (delete_duplicate_fields): Likewise.
167         (finish_struct_anon): Remove check for members with the same name
168         as their enclosing class.
169         (check_field_decls): Do not call duplicate_fields.
170         * decl.c (grokdeclarator): Remove check for static data members
171         with the same name as their enclosing class.
172         * name-lookup.c (push_class_level_binding): Check for members with
173         the same name as their enclosing class.
175 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
177         PR c++/14085
178         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
180 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
182         PR c++/13635
183         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
184         has full set of arguments.
186 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
188         PR c++/13927
189         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
191 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
193         PR c++/14122
194         * cp-tree.h (delete_sanity): Change prototype.
195         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
196         Remove dead code.  Adjust code to warn about deleting an array.
197         * typekc.c (decay_conversion): Use build_address and build_nop.
199         PR c++/14108
200         * search.c (accessible_p): Do not check access in thunks.
202         PR c++/14083
203         * call.c (build_conditional_expr): Call force_rvalue on the
204         non-void operand in the case that one result is a throw-expression
205         and the other is not.
207 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
209         PR c++/9851
210         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
211         the type name and look ahead for ::~, and bail out early with a
212         better error message if the parse is going to fail.
214 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
216         * call.c (conversion_kind): New type.
217         (conversion_rank): Likewise.
218         (conversion): Likewise.
219         (CONVERSION_RANK): New macro.
220         (conversion_obstack): New variable.
221         (obstack_initialized): Likewise.
222         (z_candidate): Change type of convs and second_conv.
223         (candidate_warning): New type.
224         (IDENTITY_RANK): Remove.
225         (EXACT_RANK): Likewise.
226         (PROMO_RANK): Likewise.
227         (STD_RANK): Likewise.
228         (PBOOL_RANK): Likewise.
229         (USER_RANK): Likewise.
230         (ELLIPSIS_RANK): Likewise.
231         (BAD_RANK): Likewise.
232         (ICS_RANK): Likewise.
233         (ICS_STD_RANK): Likewise.
234         (ICS_USER_FLAG): Likewise.
235         (ICS_ELLIPSIS_FLAG): Likewise.
236         (ICS_THIS_FLAG): Likewise.
237         (ICS_BAD_FLAG): Likewise.
238         (NEED_TEMPORARY_P): Likewise.
239         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
240         (USER_CONV_CAND): Likewise.
241         (USER_CONV_FN): Likewise.
242         (conversion_obstack_alloc): New function.
243         (alloc_conversion): Likewise.
244         (validate_conversion_obstack): Likewise.
245         (alloc_conversions): Likewise.
246         (build_conv): Adjust to deal with new conversion data structures.
247         (build_identity_conv): New function.
248         (build_ambiguous_conv): Likewise.
249         (standard_conversion): Adjust to deal with new conversion data
250         structures.
251         (convert_class_to_reference): Likewise.
252         (direct_reference_binding): Likewise.
253         (reference_binding): Likewise.
254         (implicit_conversion): Likewise.
255         (add_candidate): Likewise.
256         (add_function_candidate): Likewise.
257         (add_conv_candidate): Likewise.
258         (build_builtin_candidate): Likewise.
259         (print_z_candidate): Likewise.
260         (merge_conversion_sequences): Likewise.
261         (build_user_type_conversion_1): Likewise.
262         (build_user_type_conversion): Likewise.
263         (build_new_function_call): Likewise.
264         (build_object_call): Likewise.
265         (conditional_conversion): Likewise.
266         (build_conditional_expr): Likewise.
267         (build_new_op): Likewise.
268         (build_op_delete_call): Likewise.
269         (convert_like_real): Likewise.
270         (build_over_call): Likewise.
271         (build_new_method_call): Likewise.
272         (is_subseq): Likewise.
273         (maybe_handle_implicit_object): Likewise.
274         (maybe_handle_ref_bind): Likewise.
275         (compare_ics): Likewise.
276         (source_type): Likewise.
277         (add_warning): Likewise.
278         (joust): Likewise.
279         (can_convert_arg): Likewise.
280         (can_convert_arg_bad): Likewise.
281         (perform_implicit_conversion): Likewise.
282         (perform_direct_initialization_if_possible): Likewise.
283         (initialize_reference): Likewise.
284         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
285         * cp-tree.def (WRAPPER): Likewise.
286         (IDENTITY_CONV): Remove.
287         (LVALUE_CONV): Likewise.
288         (QUAL_CONV): Likewise.
289         (STD_CONV): Likewise.
290         (PTR_CONV): Likewise.
291         (PMEM_CONV): Likewise.
292         (BASE_CONV): Likewise.
293         (REF_BIND): Likewise.
294         (USER_CONV): Likewise.
295         (AMBIG_CONV): Likewise.
296         (RVALUE_CONV): Likewise.
297         * cp-tree.h (tree_wrapper): Remove.
298         (WRAPPER_ZC): Remove.
299         (lang_tree_node): Remove wrapper.
300         (LOOKUP_SPECULATIVELY): Remove.
301         (build_op_delete_call): Adjust prototype.
302         (validate_conversion_obstack): Declare.
303         (build_zc_wrapper): Remove.
304         * cvt.c (convert_to_reference): Remove dead code.
305         (ocp_convert): Likewise.
306         * decl.c (redeclaration_error_message): Correct handling of
307         templates.
308         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
309         (cp_tree_node_structure): Remove WRAPPER case.
310         * decl2.c (finish_file): Call validate_conversion_obstack.
311         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
312         (build_op_delete_call): Likewise.
313         (build_x_delete): Likewise.
314         (build_delete): Adjust call to build_op_delete_call.
315         * pt.c (tsubst_friend_declaration): Adjust code to determine
316         whether or not a friend template is a definition.
317         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
318         * tree.c (build_zc_wrapper): Remove.
319         
320 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
322         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
323         * cp-tree.h: Don't declare cxx_builtin_type_decls.
324         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
325         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
327 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
329         * typeck.c (lookup_destructor): Fix typo in error message.
331 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
333         * call.c, parser.c, tree.c: Fix comment typos.
335 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
337         Bug 13856
338         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
339         * decl.c (duplicate_decls, start_function): Likewise.
341 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
343         * name-lookup.c (pushdecl): Issue shadow warnings directly.
344         * parser.c (free_parser_stacks): Delete.
346 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
348         * rtti.c: Update copyright.
350 2003-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
352         PR c++/14033
353         * decl.c (require_complete_types_for_parms): Do not insert
354         error_mark_node in the parameter list.
356 2003-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
358         PR c++/14028
359         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
360         error when terminator can not be found.
362 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
364         Make-lang.in (po-generated):  Delete.
366 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
368         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
369         targetm.calls.promote_prototypes.
371 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
373         PR middle-end/13750
374         Revert:
375         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
376         PR pch/13361
377         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
378         (handle_pragma_implementation): Likewise.
380 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
382         PR c++/13714
383         * typeck.c (lookup_destructor): Tweak error message.
385 2004-02-05  Jan Hubicka  <jh@suse.cz>
387         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
388         functions.
390 2003-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
392         PR c++/14008
393         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
394         code, only emits the diagnostic now. Added lookup of the identifier
395         and support for qualified ids.
396         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
397         Parse an (invalid) type name as id-expression within a declarator.
398         (cp_parser_simple_declaration): Use it.
399         (cp_parser_member_declaration): Likewise.
400         (cp_parser_make_typename_type): New function. Handle errors through
401         cp_parser_diagnose_invalid_typename.
402         (cp_parser_elaborated_type_specifier): Use it.
404 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
406         PR c++/13932
407         * call.c (convert_like_real): Use "converting" rather than
408         "argument" as the descriptive keyword to
409         dubious_conversion_warnings.
410         * typeck.c (convert_for_assignment): Do not call
411         dubious_conversion_warnings.
413 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
415         PR c++/13086
416         * init.c (build_delete): Emit a more informative error message in
417         case of an incomplete type, and on the correct source line.
419 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
421         * error.c, search.c: Update copyright.
423 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
425         PR c++/9941
426         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
427         linkage for the typeinfo name string.
429 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
431         PR c++/13969
432         * cp-tree.h (fold_non_dependent_expr): New function.
433         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
434         (cp_parser_template_argument): Use fold_non_dependent_expr.
435         (cp_parser_direct_declarator): Likewise.
436         * pt.c (fold_non_dependent_expr): New function.
437         (convert_nontype_argument): Use it.
438         (tsubst_qualified_id): Simplify.
439         (tsubst_copy_and_build): Likewise.
441 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
443         * decl.c (cxx_push_function_context): Do not set
444         current_function_is_thunk.
445         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
446         actual function.
448 2003-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
450         PR c++/13997
451         * pt.c (more_specialized_class): Increase processing_template_decl
452         while partial ordering.
454 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
456         PR c++/13925
457         * decl.c (start_function): Do not call pushdecl for any
458         instantiation or specialization of a primary template.
460 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
462         PR c++/13950
463         * parser.c (cp_parser_class_name): Robustify.
465         PR c++/13970
466         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
468         PR c++/14002
469         * semantics.c (finish_id_expression): Do not return an
470         IDENTIFIER_NODE when lookup finds a PARM_DECL.
472 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
474         PR c++/13978
475         * pt.c (build_non_dependent_expr): Do not build
476         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
478         PR c++/13968
479         * semantics.c (finish_id_expression): Do not return an
480         IDENTIFIER_NODE when lookup finds a VAR_DECL.
482         PR c++/13975
483         * parser.c (cp_parser_simple_declaration): When skipping to the
484         end of the statement swallow the terminating semicolon.
486 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
488         PR c++/13113
489         * init.c (build_offset_ref): Improve error recovery for invalid
490         uses of non-static member functions.
492         PR c++/13854
493         * cp-tree.h (cp_build_type_attribute_variant): New function.
494         * class.c (build_clone): Use cp_build_type_attribute_variant.
495         * decl.c (duplicate_decls): Likewise.
496         * pt.c (copy_default_args_to_explicit_spec): Likewise.
497         (tsubst_function_type): Likewise.
498         * tree.c (build_exception_variant): Check attributes before
499         concluding that two types are the same.
500         (cp_build_type-attribute_variant): New method.
501         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
503         PR c++/13907
504         * call.c (convert_class_to_reference): Keep better track of
505         pedantically invalid user-defined conversions.
507 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
509         PR c++/13957
510         * pt.c (tsubst_qualified_id): Improved error message when a type
511         is expected but not found.
513 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
515         * class.c: Fix comment typos.
516         * decl.c: Likewise.
517         * error.c: Likewise.
518         * parser.c: Likewise.
519         * pt.c: Likewise.
520         * search.c: Likewise.
521         * typeck.c: Likewise.
523 2004-01-30  Richard Henderson  <rth@redhat.com>
525         PR c++/13693
526         * method.c (use_thunk): Don't force_target_expr for void thunks.
527         * tree.c (build_target_expr_with_type): Assert non-void type.
528         (force_target_expr): Likewise.
530 2004-01-30  Michael Matz  <matz@suse.de>
532         * parser.c (cp_parser_labeled_statement): Accept case ranges.
534 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
536         DR206
537         PR c++/13813
538         * decl.c (grokdeclarator): Check immediatly type completeness for
539         non-dependent types.
541 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
543         PR c++/13683
544         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
545         a sizeof expression.block
547 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
549         PR c++/13883
550         * mangle.c (write_encoding): Correct encoding of member template
551         constructors.
553 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
555         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
556         template name as it was `<::' (digraph typo).
557         (cp_parser_nth_token_starts_template_argument_list_p): New function.
558         (cp_parser_id_expression): Use it.
559         (cp_parser_nested_name_specifier_opt): Likewise.
560         (cp_parser_template_name): Likewise.
561         (cp_parser_class_name): Likewise.
562         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
564 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
566         PR c++/13791
567         * typeck.c (merge_types): Do not merge attributes into
568         TYPENAME_TYPEs.
570         PR c++/13736
571         * parser.c (cp_parser_direct_declarator): Do not prevent
572         backtracking inside a parenthesized declarator.
573         (cp_parser_parameter_declaration): Fix typo in comment.
575 2004-01-28  Jan Hubicka  <jh@suse.cz>
577         * semantics.c (expand_body)  Do emit_associated_thunks before
578         expansion.
580 2004-01-27  Devang Patel  <dpatel@apple.com>
582         * name-lookup.c: Include "debug.h"
583         (do_namespace_alias): Invoke debug_hooks to emit debug info
584         for namespace alias.
585         (do_local_using_decl): Invoke debug_hooks to emit debug info
586         for using decl.
587         (do_class_using_decl): Same.
588         (do_toplevel_using_decl): Same.
589         (do_using_directive): Same.
590         (cp_emit_debug_info_for_using): New function.
591         * Make-lang.in (cp/parser.o): Depend on debug.h
592         (cp/name-lookup.o): Same.
594 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
596         * cp-tree.h (language_function, lang_type_header): Use
597         BOOL_BITFIELD.
598         * name-lookup.h (cp_binding_level): Likewise.
600 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
602         PR c++/13663
603         * semantics.c (finish_for_expr): Check for unresolved overloaded
604         functions.
606         * class.c (add_method): Just check processing_template_decl to
607         determine whether or not we are within a template.
608         * decl2.c (maybe_retrofit_in_chrg): Likewise.
609         * init.c (decl_constant_value): Check the type of the declaration,
610         not TREE_READONLY.
611         * name-lookup.c (maybe_push_to_top_level): Rename to ...
612         (push_to_top_level): ... this.
613         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
614         * pt.c (push_template_decl_real): Reorder condition for speed.
615         (convert_template_argument): Use dependency-checking functions in
616         place of uses_template_parms.
617         (lookup_template_class): Avoid calling uses_template_parms more
618         than once.
619         (uses_template_parms): Reimplement, using dependency-checking
620         functions.
621         (instantiate_class_template): Use push_to_top_level, not
622         maybe_push_to_top_level.
623         (type_unification_real): Simplify.
624         (type_dependent_expression_p): Handle OFFSET_REFs and
625         TEMPLATE_DECLs.
626         (any_dependent_template_arguments_p): Handle multiple levels of
627         template argument.
628         * semantics.c (expand_or_defer_fn): Do not check
629         uses_template_parms for template instantiations.
630         * typeck.c (comptypes): Avoid calling cp_type_quals.
632 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
634         PR c++/13833
635         * call.c (build_over_call): Do not convert arguments when
636         processing a template.
637         * pt.c (build_non_dependent_expr): Do not build a
638         NON_DEPENDENT_EXPR for arithmetic constants.
640 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
642         PR c++/13810
643         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
644         returns a TYPE_DECL. no further lookup is required.
645         * semantics.c (check_template_template_default_arg): A TYPE_DECL
646         is invalid. Rework to give better diagnostics.
648 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
650         PR c++/13797
651         * pt.c (instantiate_class_template): Add an error_mark_node
652         check.
653         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
655 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
657         PR c++/13701
658         * decl.c (finish_function): Move the call to
659         finish_fname_decls below the call to
660         finish_eh_spec_block.
662 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
664         * optimize.c, typeck2.c: Update copyright.
666 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
668         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
669         init.c, mangle.c, typeck.c: Update copyright.
671 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
673         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
675 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
677         * Make-lang.in: Replace $(docdir) with doc.
678         (c++.info, c++.srcinfo): Dummy entry.
679         (c++.man, c++.srcman): New rules.
680         (c++.install-man): Revamp rule.
682 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
684         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
685         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
686         immediate $(shell) instead of deferred backquote.
688 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
690         PR c++/13651
691         * parser.c (cp_parser_postfix_expression): When encountering
692         incomplete type on left-hand side of "->" or ".", treat the entire
693         expression as erroneous.
695         PR c++/13592
696         * call.c (build_field_call): Remove.
697         (n_build_method_call): Likewise.
698         (build_method_call): Likewise.
699         (build_new_method_call): Do not call build_field_call.
700         * class.c (n_build_method_call): Remove.
701         (print_class_statistics): Do not print it.
702         * cp-tree.h (build_method_call): Remove declaration.
703         (finish_object_call_expr): Likewise.
704         (build_new_1): Do not use build_method_call.
705         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
706         when the function appearing on the right-hand-side of "." or "->"
707         is not actually a function.
708         * pt.c (tsubst_copy_and_build): Likewise.
709         * semantics.c (finish_object_call_expr): Remove.
711 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
713         PR c++/13710
714         * pt.c (tsubst): Use finish_typeof.
716 2004-01-18  Jason Merrill  <jason@redhat.com>
718         PR c++/11725
719         * except.c (build_throw): In a template, set
720         current_function_returns_abnormally.
722 2004-01-17  Fred Fish  <fnf@intrinsity.com>
724         PR c++/11895
725         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
726         except don't call array_type_nelts() with a VECTOR_TYPE.
728 2004-01-16  Jan Hubicka  <jh@suse.cz>
730         * mangle.c (write_mangled_name): Remove inline modifier.
732 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
734         PR c++/13574
735         * decl.c (compute_array_index_type): Fix grammar in comment.
736         * init.c (build_zero_init): Handle zero-sized arrays correctly.
738         PR c++/13178
739         * call.c (name_as_c_string): Print conversion operator names
740         correctly.
742         PR c++/13478
743         * call.c (initialize_reference): Pass -1 for inner parameter to
744         convert_like_real.
746 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
748         PR c++/13407
749         * parser.c (cp_parser_base_specifier): Check for an invalid
750         keyword `typename' and emit an user-friendly error message.
752 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
754         PR pch/13361
755         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
756         (handle_pragma_implementation): Likewise.
758 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
760         PR c++/9259
761         * typeck.c (build_class_member_access_expr): Allow to access members
762         of the currently open class.
763         (finish_class_member_access_expr): Likewise.
765 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
767         PR c++/13659
768         * name-lookup.c (validate_nonmember_using_decl): Take scope and
769         name by value, instead of computing them.
770         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
771         arguments.  Pass them to validate_nonmember_using_decl.
772         * name-lookup.h (do_local_using_decl): Adjust.
773         (do_toplevel_using_decl): Likewise.
774         * parser.c (cp_parser_using_declaration): Likewise.
775         * pt.c (tsubst_expr): Likewise.
777 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
779         PR c++/13594
780         PR c++/13658
781         * name-lookup.c (qualified_lookup_using_namespace): Search
782         strongly-associated namespaces first, and only then try other
783         namespaces.
785 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
787         * Make-lang.in (c++.srcextra): Dummy entry.
789 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
791         PR c++/8856
792         * parser.c (cp_parser_template_name): Don't try to parse a
793         conversion-function-id, as it cannot be a template-name.
794         (cp_parser_simple_type_specifier): Check for invalid template-ids
795         even after a built-in type.
797 2004-01-14  Jan Hubicka  <jh@suse.cz>
799         PR c++/12850
800         * pt.c (instantiate_decl):  Do not increase function_depth.
802 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
804         PR c++/9021
805         PR c++/11005
806         * parser.c (cp_parser_elaborated_type_specifier): Warn about
807         attributes and discard.
808         * decl.c (xref_tag): Don't overwite existing attributes with
809         NULL_TREE.
811 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
813         PR c++/12335
814         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
815         is no destructor while looking up a BIT_NOT_EXPR.
817 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
819         * cxxfilt.c: Remove unused file.
821 2004-01-14  Jan Hubicka  <jh@suse.cz>
823         Partial fix to PR c++/12850
824         * decl2.c (mark_used): Do not proactively instantiate templates
825         when compiling in unit-at-a-time or not optimizing.
826         * optimize.c (maybe_clone_body): Do not increase function depth.
828 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
830         PR c++/13474
831         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
833 2003-01-12  Steven Bosscher  <stevenb@suse.de>
835         PR c++/13558
836         * parser.c (cp_parser_member_declaration): Any non-type is also
837         not a class or a function.
839 2004-01-12  Jason Merrill  <jason@redhat.com>
841         PR c++/12815
842         * class.c (build_base_path): Do not mark vtable references as
843         TREE_CONSTANT.
844         (build_vtbl_ref_1): Likewise.
846 2004-01-12  Richard Henderson  <rth@redhat.com>
848         PR opt/10776
849         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
850         (store_init_value): Use it.
851         * decl.c (check_initializer): Expect full initialization code
852         from store_init_value.
853         * init.c (expand_aggr_init_1): Likewise.
854         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
856 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
858         * class.c (layout_class_type): For non-POD class types, also copy
859         the DECL_SIZE and DECL_MODE of fields to the base class type.
861 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
863         PR c++/13289
864         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
865         calling regenerate_decl_from_template.
867 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
869         PR c++/4100
870         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
871         decl-specifier occurring along with a class definition.
873 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
875         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
876         clauses to comments describing declares_class_or_enum.
877         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
878         false.
880 2004-01-12  Jan Hubicka  <jh@suse.cz>
882         * pt.c (for_each_template_parm): Do not check for duplicates.
883         (for_each_template_parm): Use walk_tree duplicate checking code.
885 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
887         PR c++/3478
888         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
889         is error_mark_node, don't add any more decl_specs.
890         (cp_parser_init_declarator): After committing to a declaration, if
891         the decl_specifiers start with error_mark_node, issue an error and
892         change the type to "int".
894 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
896         PR bootstrap/7817
897         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
899 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
901         DR 337
902         PR c++/9256
903         * pt.c (tsubst): Substitution must fail if we are attempting to
904         create an array with element type that is an abstract class type.
905         * decl.c (cp_finish_decl): Strip pointers and array types recursively
906         before calling abstract_virtuals_error.
908 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
910         * name-lookup.c (qualified_lookup_using_namespace): Consider
911         strong using directives even if we've already found a binding.
913 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
915         * cp-tree.h (cxx_expand_expr): Change prototype.
916         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
918 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
920         PR c++/12573
921         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
922         looking into them recursively. They can be there because of the
923         new __offsetof__ extension.
925 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
927         * parser.c (cp_parser_save_member_function_body): Mark the
928         definition static.
930 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
932         PR c++/13057
933         * class.c (build_clone): Copy type attributes from the original
934         function to the clone.
936         PR c++/12815
937         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
938         references as constant.
940         PR c++/12132
941         * parser.c (cp_parser_explicit_instantiation): Improve error
942         recovery.
943         (cp_parser_require): Improve indication of the error location.
945         PR c++/13451
946         * parser.c (cp_parser_class_head): Reorder logic to check for
947         invalid qualification.
949 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
951         PR c++/13157
952         * name-lookup.c (lookup_using_namespace): Remove spacesp
953         parameter.
954         (unqualified_namespace_lookup): Likewise.
955         (lookup_qualified_name): Adjust accordingly.
956         (lookup_name_real): Likewise.
957         (lookup_arg_dependent): Do not eliminate the namespace of the
958         functions found by unqualified name lookup unless that is the
959         current namespace.
961 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
963         * semantics.c (push_deferring_access_checks): Fix format.
964         (resume_deferring_access_checks): Likewise.
965         (stop_deferring_access_checks): Likewise.
966         (pop_deferring_access_checks): Likewise.
967         (get_deferred_access_checks): Likewise.
968         (pop_to_parent_deferring_access_checks): Likewise.
969         (perform_deferred_access_checks): Likewise.
970         (perform_or_defer_access_check): Likewise.
972 2004-01-04  Richard Henderson  <rth@redhat.com>
974         * call.c (build_over_call): Don't create a save_expr of an
975         aggregate, but rather its address.
977 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
979         PR c++/13529
980         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
981         an offsetof expression.
983         * parser.c (cp_parser_parameter_declaration): Fix comment.
985         PR c++/12226
986         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
987         (reference_binding): Set it when appropriate.
988         (build_temp): New function, split out from ...
989         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
990         (initialize_reference): Likewise.
992         PR c++/13536
993         * parser.c (cp_parser): Add in_type_id_in_expr_p.
994         (cp_parser_new): Initialize it.
995         (cp_parser_postfix_expression): Set it.
996         (cp_parser_sizeof_operand): Likewise.
997         (cp_parser_parameteR_declaration): Do not commit early to tenative
998         parsers when in_type_id_in_expr_p is set.
1000 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1002         PR c++/13094
1003         * parser.c (cp_parser_template_argument): Don't call
1004         make_unbound_class_template directly.
1005         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
1006         UNBOUND_CLASS_TEMPLATE tree node.
1008 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
1010         PR target/12729
1011         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
1013 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1015         PR c++/13520
1016         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
1017         (DECL_FUNCTION_TEMPLATE_P): Use it.
1018         (DECL_CLASS_TEMPLATE_P): Likewise.
1019         * parser.c (cp_parser_lookup_name): Add is_template parameter.
1020         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
1021         (cp_parser_template_name): Likewise.
1022         (cp_parser_elaborated_type_specifier): Likewise.
1023         (cp_parser_namespace_name): Likewise.
1024         (cp_parser_class_name): Likewise.
1025         (cp_parser_lookup_name_simple): Likewise.
1027 See ChangeLog.3 for earlier changes.