Enabled linkonce support for Darwin.
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2004-03-12  Matt Austern  <austern@apple.com>
2
3         * decl2.c (maybe_make_one_only): Look at
4         TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
5         to make an explicit instantiation weak.
6         * method.c (use_thunk): Make sure we call comdat_linkage
7         when appropriate.
8         * pt.c (do_type_instantiation): On systems where weak symbols
9         don't go in a static archive's TOC, explicit instantiation of a
10         class must imply *explicit* instantiation of its memeber.
11         
12 2004-03-11  Kazu Hirata  <kazu@cs.umass.edu>
13
14         * call.c, cp-tree.h, pt.c: Fix comment typos.
15
16 2004-03-10  Mark Mitchell  <mark@codesourcery.com>
17
18         PR c++/14510
19         * decl.c (xref_tag): Disregard non-type declarations when
20         looking up a tagged type. 
21
22 2004-03-09  Nathan Sidwell  <nathan@codesourcery.com>
23
24         PR c++/14397
25         * call.c (convert_like_real): Build a const qualified temporary,
26         when testing ctor access.
27
28 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
29
30         * call.c (initialize_reference): Fix typo.
31
32 2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
33
34         PR c++/14409
35         * pt.c (determine_specialization): For member templates, match also
36         constness.
37
38         PR c++/14448
39         * parser.c (cp_parser_initializer_clause): Fold initializer if it is
40         non-dependent.
41         * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
42
43 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
44
45         PR c++/14230
46         * call.c (initialize_reference): Handle initializers that are
47         class-member access expressions applies to rvalues.
48
49 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
50
51         PR c++/14432
52         * name-lookup.c (supplement_binding): Ignore functions that are
53         marked DECL_ANTICIPATED.
54
55 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
56
57         PR c++/14401
58         * class.c (check_field_decls): Complain about non-static data
59         members of reference type in unions.  Propagate
60         CLASSTYPE_REF_FIELDS_NEED_INIT and
61         CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
62         data members.
63         * init.c (perform_member_init): Complain about mbmers with const
64         type that are not explicitly initialized.
65
66 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
67
68         * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
69         * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
70         (lang_identifier): Remove implicit_decl and error_locus.
71         (IDENTIFIER_IMPLICIT_DECL): Remove.
72         (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
73         (IDENTIFIER_ERROR_LOCUS): Likewise.
74         (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
75         (TYPE_ASSEMBLER_NAME_STRING): Likewise.
76         (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
77         (implicitly_declare): Remove.
78         * decl.c (warn_extern_redeclared_static): Remove check of
79         IDENTIFIER_IMPLICIT_DECL.
80         (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
81         (implicitly_declare): Remove.
82         (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
83         (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
84         (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
85         * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
86         in the innermost scope, rather than at namespace scope.
87         * name-lookup.c (push_local_binding): Give it external linkage.
88         (pushdecl): Remove dead code.
89         * name-lookup.h (push_local_binding): Declare it.
90         * ptree.c (cxx_print_identifier): Don't print
91         IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
92         * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
93         not IDENTIFIER_ERROR_LOCUS.
94         * typeck.c (build_function_call): Remove dead code.
95
96 2004-03-08  Jason Merrill  <jason@redhat.com>
97
98         PR c++/13170
99         * decl.c (xref_tag): Remove attribute handling.
100         * cp-tree.h: Adjust prototype.
101         * decl.c, parser.c, rtti.c: Adjust callers.
102         * parser.c (cp_parser_class_head): Pass back attributes in the
103         class head.
104         (cp_parser_class_specifier): Adjust.
105
106 2004-03-08  Matt Austern  <austern@apple.com>
107
108         PR debug/14079
109         * name-lookup.c (add_decl_to_level): Add extern variables, as well
110         as static, to static_decls array.
111         
112 2004-03-05  Jason Merrill  <jason@redhat.com>
113
114         * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
115
116 2004-03-04  Geoffrey Keating  <geoffk@apple.com>
117
118         * decl.c (grokfndecl): Update old incorrect comment.
119         (grokvardecl): Diagnose C++ variables of type with no linkage.
120
121 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
122
123         PR c++/14369
124         * pt.c (build_non_dependent_expr): Do not create a
125         NON_DEPENDENT_EXPR for a THROW_EXPR.
126
127 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
128
129         PR c++/14369
130         * error.c (dump_expr): Handle THROW_EXPR.
131
132 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
133
134         PR c++/14360
135         * parser.c (cp_parser_postfix_expression): Do not perform Koenig
136         lookup if ordinary name-lookup finds a non-function.
137         * pt.c (tsubst_copy_and_build): Likewise.
138
139         PR c++/14361
140         * parser.c (cp_parser_late_parsing_default_args): Check that there
141         are no extra tokens after the end of the default-argument
142         expression.
143         
144 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
145
146         PR c++/14324
147         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
148         having C++ linkage for name-mangling purposes.
149
150         PR c++/14260
151         * parser.c (cp_parser_direct_declarator): Recognize constructor
152         declarators that use a template-id to name the class being
153         constructed.
154
155         PR c++/14337
156         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
157         (tsubst_expr): Do not call tsubst_copy, even when
158         processing_template_decl.       
159
160 2004-03-01  Jeff Law  <law@redhat.com>
161
162         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
163         the proper type.
164
165 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
166
167         PR c++/14138
168         * name-lookup.h (push_scope): Change prototype.
169         * name-lookup.c (push_scope): Do not reenter the current class
170         scope.
171         * decl.c (grokfndecl): Check return code from push_scope before
172         calling pop_scope.
173         * decl2.c (check_classfn): Likewise.
174         * parser.c (cp_parser_conversion_function_id): Likewise.
175         (cp_parser_init_declarator): Likewise.
176         (cp_parser_direct_declarator): Likewise.
177         (cp_parser_class_specifier): Likewise.
178         (cp_parser_class_head): Likewise.
179         (cp_parser_lookup_name): Likewise.
180         (cp_parser_constructor_declarator_p): Likewise.
181         * pt.c (instantiate_class_template): Likewise.
182         (resolve_typename_type): Likewise.
183
184 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
185
186         PR c++/14267
187         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
188         extension.
189
190         PR debug/12103
191         * class.c (update_vtable_entry_for_fn): Do not go through
192         covariance machinery if the type returned by an overrider is the
193         same as the original.
194
195 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
196
197         * call.c: Fix a comment typo.
198
199 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
200
201         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
202
203 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
204
205         PR c++/14278
206         * parser.c (cp_parser_parameter_declaration_list): Commit
207         to fewer tentative parses.
208
209 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
210
211         PR c++/14284
212         * pt.c (dependent_type_p_r): A template template parameter is a
213         dependent type.
214
215 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
216
217         PR c++/14246
218         * mangle.c (write_template_arg_literal): Don't rely on identity for
219         boolean constants.
220
221 2004-02-24  Jason Merrill  <jason@redhat.com>
222
223         * tree.c (build_exception_variant): Use check_qualified_type.
224
225 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
226             Kazu Hirata  <kazu@cs.umass.edu>
227
228         * decl.c (cxx_init_decl_processing): Don't check
229         flag_writable_strings.
230
231 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
232
233         PR c++/14156
234         * typeck.c (maybe_warn_about_returning_address_of_location):
235         Change check for VAR_DECL to use DECL_P instead.
236
237 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
238
239         PR c++/14250
240         * cvt.c (build_expr_type_conversion): Type must be complete before
241         looking up for conversions.
242
243 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
244
245         PR c++/14143
246         * name-lookup.c (arg_assoc_class): Don't look into template 
247         arguments if it is not a primary template.
248
249 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
250
251         PR c++/12007
252         * method.c (use_thunk): Always clone function argument tree.
253
254 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
255
256         PR c++/14199
257         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
258
259         PR c++/14173
260         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
261         for all type variants.
262
263 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
264
265         PR c++/13927
266         * decl.c (duplicate_decls): Return error_mark_node for invalid
267         redeclarations.
268         * name-lookup.c (push_namespace): Ignore the return value from
269         pushdecl.
270         * pt.c (push_template_decl_real): Robustify.
271
272         PR c++/14186
273         * name-lookup.c (push_class_level_binding): Do not complain about
274         adding a binding for a member whose name is the same as the
275         enclosing class if the member is located in a base class of the
276         current class.
277
278 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
279
280         PR c++/14181
281         * parser.c (cp_parser_new_expression): Parse an ill-formed 
282         direct-new-declarator after a parenthesized type-id to emit good
283         diagnostic.
284
285 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
286
287         * cp-tree.def, cvt.c: Update copyright.
288
289 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
290
291         PR c++/11326
292         * cp-tree.h (abi_version_at_least): Remove.
293         * mangle.c: Include flags.h.
294
295 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
296
297         PR c++/13971
298         * call.c (build_conditional_expr): Handle conversions between
299         class types which result in differently cv-qualified type
300         variants.
301
302         PR c++/14086
303         * class.c (delete_duplicate_fields_1): Remove.
304         (delete_duplicate_fields): Likewise.
305         (finish_struct_anon): Remove check for members with the same name
306         as their enclosing class.
307         (check_field_decls): Do not call duplicate_fields.
308         * decl.c (grokdeclarator): Remove check for static data members
309         with the same name as their enclosing class.
310         * name-lookup.c (push_class_level_binding): Check for members with
311         the same name as their enclosing class.
312
313 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
314
315         PR c++/14085
316         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
317
318 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
319
320         PR c++/13635
321         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
322         has full set of arguments.
323
324 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
325
326         PR c++/13927
327         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
328
329 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
330
331         PR c++/14122
332         * cp-tree.h (delete_sanity): Change prototype.
333         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
334         Remove dead code.  Adjust code to warn about deleting an array.
335         * typekc.c (decay_conversion): Use build_address and build_nop.
336
337         PR c++/14108
338         * search.c (accessible_p): Do not check access in thunks.
339
340         PR c++/14083
341         * call.c (build_conditional_expr): Call force_rvalue on the
342         non-void operand in the case that one result is a throw-expression
343         and the other is not.
344
345 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
346
347         PR c++/9851
348         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
349         the type name and look ahead for ::~, and bail out early with a
350         better error message if the parse is going to fail.
351
352 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
353
354         * call.c (conversion_kind): New type.
355         (conversion_rank): Likewise.
356         (conversion): Likewise.
357         (CONVERSION_RANK): New macro.
358         (conversion_obstack): New variable.
359         (obstack_initialized): Likewise.
360         (z_candidate): Change type of convs and second_conv.
361         (candidate_warning): New type.
362         (IDENTITY_RANK): Remove.
363         (EXACT_RANK): Likewise.
364         (PROMO_RANK): Likewise.
365         (STD_RANK): Likewise.
366         (PBOOL_RANK): Likewise.
367         (USER_RANK): Likewise.
368         (ELLIPSIS_RANK): Likewise.
369         (BAD_RANK): Likewise.
370         (ICS_RANK): Likewise.
371         (ICS_STD_RANK): Likewise.
372         (ICS_USER_FLAG): Likewise.
373         (ICS_ELLIPSIS_FLAG): Likewise.
374         (ICS_THIS_FLAG): Likewise.
375         (ICS_BAD_FLAG): Likewise.
376         (NEED_TEMPORARY_P): Likewise.
377         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
378         (USER_CONV_CAND): Likewise.
379         (USER_CONV_FN): Likewise.
380         (conversion_obstack_alloc): New function.
381         (alloc_conversion): Likewise.
382         (validate_conversion_obstack): Likewise.
383         (alloc_conversions): Likewise.
384         (build_conv): Adjust to deal with new conversion data structures.
385         (build_identity_conv): New function.
386         (build_ambiguous_conv): Likewise.
387         (standard_conversion): Adjust to deal with new conversion data
388         structures.
389         (convert_class_to_reference): Likewise.
390         (direct_reference_binding): Likewise.
391         (reference_binding): Likewise.
392         (implicit_conversion): Likewise.
393         (add_candidate): Likewise.
394         (add_function_candidate): Likewise.
395         (add_conv_candidate): Likewise.
396         (build_builtin_candidate): Likewise.
397         (print_z_candidate): Likewise.
398         (merge_conversion_sequences): Likewise.
399         (build_user_type_conversion_1): Likewise.
400         (build_user_type_conversion): Likewise.
401         (build_new_function_call): Likewise.
402         (build_object_call): Likewise.
403         (conditional_conversion): Likewise.
404         (build_conditional_expr): Likewise.
405         (build_new_op): Likewise.
406         (build_op_delete_call): Likewise.
407         (convert_like_real): Likewise.
408         (build_over_call): Likewise.
409         (build_new_method_call): Likewise.
410         (is_subseq): Likewise.
411         (maybe_handle_implicit_object): Likewise.
412         (maybe_handle_ref_bind): Likewise.
413         (compare_ics): Likewise.
414         (source_type): Likewise.
415         (add_warning): Likewise.
416         (joust): Likewise.
417         (can_convert_arg): Likewise.
418         (can_convert_arg_bad): Likewise.
419         (perform_implicit_conversion): Likewise.
420         (perform_direct_initialization_if_possible): Likewise.
421         (initialize_reference): Likewise.
422         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
423         * cp-tree.def (WRAPPER): Likewise.
424         (IDENTITY_CONV): Remove.
425         (LVALUE_CONV): Likewise.
426         (QUAL_CONV): Likewise.
427         (STD_CONV): Likewise.
428         (PTR_CONV): Likewise.
429         (PMEM_CONV): Likewise.
430         (BASE_CONV): Likewise.
431         (REF_BIND): Likewise.
432         (USER_CONV): Likewise.
433         (AMBIG_CONV): Likewise.
434         (RVALUE_CONV): Likewise.
435         * cp-tree.h (tree_wrapper): Remove.
436         (WRAPPER_ZC): Remove.
437         (lang_tree_node): Remove wrapper.
438         (LOOKUP_SPECULATIVELY): Remove.
439         (build_op_delete_call): Adjust prototype.
440         (validate_conversion_obstack): Declare.
441         (build_zc_wrapper): Remove.
442         * cvt.c (convert_to_reference): Remove dead code.
443         (ocp_convert): Likewise.
444         * decl.c (redeclaration_error_message): Correct handling of
445         templates.
446         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
447         (cp_tree_node_structure): Remove WRAPPER case.
448         * decl2.c (finish_file): Call validate_conversion_obstack.
449         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
450         (build_op_delete_call): Likewise.
451         (build_x_delete): Likewise.
452         (build_delete): Adjust call to build_op_delete_call.
453         * pt.c (tsubst_friend_declaration): Adjust code to determine
454         whether or not a friend template is a definition.
455         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
456         * tree.c (build_zc_wrapper): Remove.
457         
458 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
459
460         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
461         * cp-tree.h: Don't declare cxx_builtin_type_decls.
462         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
463         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
464
465 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
466
467         * typeck.c (lookup_destructor): Fix typo in error message.
468
469 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
470
471         * call.c, parser.c, tree.c: Fix comment typos.
472
473 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
474
475         Bug 13856
476         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
477         * decl.c (duplicate_decls, start_function): Likewise.
478
479 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
480
481         * name-lookup.c (pushdecl): Issue shadow warnings directly.
482         * parser.c (free_parser_stacks): Delete.
483
484 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
485
486         * rtti.c: Update copyright.
487
488 2003-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
489
490         PR c++/14033
491         * decl.c (require_complete_types_for_parms): Do not insert
492         error_mark_node in the parameter list.
493
494 2003-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
495
496         PR c++/14028
497         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
498         error when terminator can not be found.
499
500 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
501
502         Make-lang.in (po-generated):  Delete.
503
504 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
505
506         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
507         targetm.calls.promote_prototypes.
508
509 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
510
511         PR middle-end/13750
512         Revert:
513         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
514         PR pch/13361
515         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
516         (handle_pragma_implementation): Likewise.
517
518 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
519
520         PR c++/13714
521         * typeck.c (lookup_destructor): Tweak error message.
522
523 2004-02-05  Jan Hubicka  <jh@suse.cz>
524
525         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
526         functions.
527
528 2003-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
529
530         PR c++/14008
531         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
532         code, only emits the diagnostic now. Added lookup of the identifier
533         and support for qualified ids.
534         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
535         Parse an (invalid) type name as id-expression within a declarator.
536         (cp_parser_simple_declaration): Use it.
537         (cp_parser_member_declaration): Likewise.
538         (cp_parser_make_typename_type): New function. Handle errors through
539         cp_parser_diagnose_invalid_typename.
540         (cp_parser_elaborated_type_specifier): Use it.
541
542 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
543
544         PR c++/13932
545         * call.c (convert_like_real): Use "converting" rather than
546         "argument" as the descriptive keyword to
547         dubious_conversion_warnings.
548         * typeck.c (convert_for_assignment): Do not call
549         dubious_conversion_warnings.
550
551 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
552
553         PR c++/13086
554         * init.c (build_delete): Emit a more informative error message in
555         case of an incomplete type, and on the correct source line.
556
557 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
558
559         * error.c, search.c: Update copyright.
560
561 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
562
563         PR c++/9941
564         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
565         linkage for the typeinfo name string.
566
567 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
568
569         PR c++/13969
570         * cp-tree.h (fold_non_dependent_expr): New function.
571         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
572         (cp_parser_template_argument): Use fold_non_dependent_expr.
573         (cp_parser_direct_declarator): Likewise.
574         * pt.c (fold_non_dependent_expr): New function.
575         (convert_nontype_argument): Use it.
576         (tsubst_qualified_id): Simplify.
577         (tsubst_copy_and_build): Likewise.
578
579 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
580
581         * decl.c (cxx_push_function_context): Do not set
582         current_function_is_thunk.
583         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
584         actual function.
585
586 2003-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
587
588         PR c++/13997
589         * pt.c (more_specialized_class): Increase processing_template_decl
590         while partial ordering.
591
592 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
593
594         PR c++/13925
595         * decl.c (start_function): Do not call pushdecl for any
596         instantiation or specialization of a primary template.
597
598 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
599
600         PR c++/13950
601         * parser.c (cp_parser_class_name): Robustify.
602
603         PR c++/13970
604         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
605
606         PR c++/14002
607         * semantics.c (finish_id_expression): Do not return an
608         IDENTIFIER_NODE when lookup finds a PARM_DECL.
609
610 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
611
612         PR c++/13978
613         * pt.c (build_non_dependent_expr): Do not build
614         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
615
616         PR c++/13968
617         * semantics.c (finish_id_expression): Do not return an
618         IDENTIFIER_NODE when lookup finds a VAR_DECL.
619
620         PR c++/13975
621         * parser.c (cp_parser_simple_declaration): When skipping to the
622         end of the statement swallow the terminating semicolon.
623
624 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
625
626         PR c++/13113
627         * init.c (build_offset_ref): Improve error recovery for invalid
628         uses of non-static member functions.
629
630         PR c++/13854
631         * cp-tree.h (cp_build_type_attribute_variant): New function.
632         * class.c (build_clone): Use cp_build_type_attribute_variant.
633         * decl.c (duplicate_decls): Likewise.
634         * pt.c (copy_default_args_to_explicit_spec): Likewise.
635         (tsubst_function_type): Likewise.
636         * tree.c (build_exception_variant): Check attributes before
637         concluding that two types are the same.
638         (cp_build_type-attribute_variant): New method.
639         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
640
641         PR c++/13907
642         * call.c (convert_class_to_reference): Keep better track of
643         pedantically invalid user-defined conversions.
644
645 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
646
647         PR c++/13957
648         * pt.c (tsubst_qualified_id): Improved error message when a type
649         is expected but not found.
650
651 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
652
653         * class.c: Fix comment typos.
654         * decl.c: Likewise.
655         * error.c: Likewise.
656         * parser.c: Likewise.
657         * pt.c: Likewise.
658         * search.c: Likewise.
659         * typeck.c: Likewise.
660
661 2004-01-30  Richard Henderson  <rth@redhat.com>
662
663         PR c++/13693
664         * method.c (use_thunk): Don't force_target_expr for void thunks.
665         * tree.c (build_target_expr_with_type): Assert non-void type.
666         (force_target_expr): Likewise.
667
668 2004-01-30  Michael Matz  <matz@suse.de>
669
670         * parser.c (cp_parser_labeled_statement): Accept case ranges.
671
672 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
673
674         DR206
675         PR c++/13813
676         * decl.c (grokdeclarator): Check immediatly type completeness for
677         non-dependent types.
678
679 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
680
681         PR c++/13683
682         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
683         a sizeof expression.block
684
685 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
686
687         PR c++/13883
688         * mangle.c (write_encoding): Correct encoding of member template
689         constructors.
690
691 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
692
693         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
694         template name as it was `<::' (digraph typo).
695         (cp_parser_nth_token_starts_template_argument_list_p): New function.
696         (cp_parser_id_expression): Use it.
697         (cp_parser_nested_name_specifier_opt): Likewise.
698         (cp_parser_template_name): Likewise.
699         (cp_parser_class_name): Likewise.
700         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
701
702 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
703
704         PR c++/13791
705         * typeck.c (merge_types): Do not merge attributes into
706         TYPENAME_TYPEs.
707
708         PR c++/13736
709         * parser.c (cp_parser_direct_declarator): Do not prevent
710         backtracking inside a parenthesized declarator.
711         (cp_parser_parameter_declaration): Fix typo in comment.
712
713 2004-01-28  Jan Hubicka  <jh@suse.cz>
714
715         * semantics.c (expand_body)  Do emit_associated_thunks before
716         expansion.
717
718 2004-01-27  Devang Patel  <dpatel@apple.com>
719
720         * name-lookup.c: Include "debug.h"
721         (do_namespace_alias): Invoke debug_hooks to emit debug info
722         for namespace alias.
723         (do_local_using_decl): Invoke debug_hooks to emit debug info
724         for using decl.
725         (do_class_using_decl): Same.
726         (do_toplevel_using_decl): Same.
727         (do_using_directive): Same.
728         (cp_emit_debug_info_for_using): New function.
729         * Make-lang.in (cp/parser.o): Depend on debug.h
730         (cp/name-lookup.o): Same.
731
732 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
733
734         * cp-tree.h (language_function, lang_type_header): Use
735         BOOL_BITFIELD.
736         * name-lookup.h (cp_binding_level): Likewise.
737
738 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
739
740         PR c++/13663
741         * semantics.c (finish_for_expr): Check for unresolved overloaded
742         functions.
743
744         * class.c (add_method): Just check processing_template_decl to
745         determine whether or not we are within a template.
746         * decl2.c (maybe_retrofit_in_chrg): Likewise.
747         * init.c (decl_constant_value): Check the type of the declaration,
748         not TREE_READONLY.
749         * name-lookup.c (maybe_push_to_top_level): Rename to ...
750         (push_to_top_level): ... this.
751         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
752         * pt.c (push_template_decl_real): Reorder condition for speed.
753         (convert_template_argument): Use dependency-checking functions in
754         place of uses_template_parms.
755         (lookup_template_class): Avoid calling uses_template_parms more
756         than once.
757         (uses_template_parms): Reimplement, using dependency-checking
758         functions.
759         (instantiate_class_template): Use push_to_top_level, not
760         maybe_push_to_top_level.
761         (type_unification_real): Simplify.
762         (type_dependent_expression_p): Handle OFFSET_REFs and
763         TEMPLATE_DECLs.
764         (any_dependent_template_arguments_p): Handle multiple levels of
765         template argument.
766         * semantics.c (expand_or_defer_fn): Do not check
767         uses_template_parms for template instantiations.
768         * typeck.c (comptypes): Avoid calling cp_type_quals.
769
770 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
771
772         PR c++/13833
773         * call.c (build_over_call): Do not convert arguments when
774         processing a template.
775         * pt.c (build_non_dependent_expr): Do not build a
776         NON_DEPENDENT_EXPR for arithmetic constants.
777
778 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
779
780         PR c++/13810
781         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
782         returns a TYPE_DECL. no further lookup is required.
783         * semantics.c (check_template_template_default_arg): A TYPE_DECL
784         is invalid. Rework to give better diagnostics.
785
786 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
787
788         PR c++/13797
789         * pt.c (instantiate_class_template): Add an error_mark_node
790         check.
791         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
792
793 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
794
795         PR c++/13701
796         * decl.c (finish_function): Move the call to
797         finish_fname_decls below the call to
798         finish_eh_spec_block.
799
800 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
801
802         * optimize.c, typeck2.c: Update copyright.
803
804 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
805
806         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
807         init.c, mangle.c, typeck.c: Update copyright.
808
809 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
810
811         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
812
813 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
814
815         * Make-lang.in: Replace $(docdir) with doc.
816         (c++.info, c++.srcinfo): Dummy entry.
817         (c++.man, c++.srcman): New rules.
818         (c++.install-man): Revamp rule.
819
820 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
821
822         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
823         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
824         immediate $(shell) instead of deferred backquote.
825
826 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
827
828         PR c++/13651
829         * parser.c (cp_parser_postfix_expression): When encountering
830         incomplete type on left-hand side of "->" or ".", treat the entire
831         expression as erroneous.
832
833         PR c++/13592
834         * call.c (build_field_call): Remove.
835         (n_build_method_call): Likewise.
836         (build_method_call): Likewise.
837         (build_new_method_call): Do not call build_field_call.
838         * class.c (n_build_method_call): Remove.
839         (print_class_statistics): Do not print it.
840         * cp-tree.h (build_method_call): Remove declaration.
841         (finish_object_call_expr): Likewise.
842         (build_new_1): Do not use build_method_call.
843         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
844         when the function appearing on the right-hand-side of "." or "->"
845         is not actually a function.
846         * pt.c (tsubst_copy_and_build): Likewise.
847         * semantics.c (finish_object_call_expr): Remove.
848
849 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
850
851         PR c++/13710
852         * pt.c (tsubst): Use finish_typeof.
853
854 2004-01-18  Jason Merrill  <jason@redhat.com>
855
856         PR c++/11725
857         * except.c (build_throw): In a template, set
858         current_function_returns_abnormally.
859
860 2004-01-17  Fred Fish  <fnf@intrinsity.com>
861
862         PR c++/11895
863         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
864         except don't call array_type_nelts() with a VECTOR_TYPE.
865
866 2004-01-16  Jan Hubicka  <jh@suse.cz>
867
868         * mangle.c (write_mangled_name): Remove inline modifier.
869
870 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
871
872         PR c++/13574
873         * decl.c (compute_array_index_type): Fix grammar in comment.
874         * init.c (build_zero_init): Handle zero-sized arrays correctly.
875
876         PR c++/13178
877         * call.c (name_as_c_string): Print conversion operator names
878         correctly.
879
880         PR c++/13478
881         * call.c (initialize_reference): Pass -1 for inner parameter to
882         convert_like_real.
883
884 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
885
886         PR c++/13407
887         * parser.c (cp_parser_base_specifier): Check for an invalid
888         keyword `typename' and emit an user-friendly error message.
889
890 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
891
892         PR pch/13361
893         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
894         (handle_pragma_implementation): Likewise.
895
896 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
897
898         PR c++/9259
899         * typeck.c (build_class_member_access_expr): Allow to access members
900         of the currently open class.
901         (finish_class_member_access_expr): Likewise.
902
903 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
904
905         PR c++/13659
906         * name-lookup.c (validate_nonmember_using_decl): Take scope and
907         name by value, instead of computing them.
908         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
909         arguments.  Pass them to validate_nonmember_using_decl.
910         * name-lookup.h (do_local_using_decl): Adjust.
911         (do_toplevel_using_decl): Likewise.
912         * parser.c (cp_parser_using_declaration): Likewise.
913         * pt.c (tsubst_expr): Likewise.
914
915 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
916
917         PR c++/13594
918         PR c++/13658
919         * name-lookup.c (qualified_lookup_using_namespace): Search
920         strongly-associated namespaces first, and only then try other
921         namespaces.
922
923 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
924
925         * Make-lang.in (c++.srcextra): Dummy entry.
926
927 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
928
929         PR c++/8856
930         * parser.c (cp_parser_template_name): Don't try to parse a
931         conversion-function-id, as it cannot be a template-name.
932         (cp_parser_simple_type_specifier): Check for invalid template-ids
933         even after a built-in type.
934
935 2004-01-14  Jan Hubicka  <jh@suse.cz>
936
937         PR c++/12850
938         * pt.c (instantiate_decl):  Do not increase function_depth.
939
940 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
941
942         PR c++/9021
943         PR c++/11005
944         * parser.c (cp_parser_elaborated_type_specifier): Warn about
945         attributes and discard.
946         * decl.c (xref_tag): Don't overwite existing attributes with
947         NULL_TREE.
948
949 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
950
951         PR c++/12335
952         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
953         is no destructor while looking up a BIT_NOT_EXPR.
954
955 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
956
957         * cxxfilt.c: Remove unused file.
958
959 2004-01-14  Jan Hubicka  <jh@suse.cz>
960
961         Partial fix to PR c++/12850
962         * decl2.c (mark_used): Do not proactively instantiate templates
963         when compiling in unit-at-a-time or not optimizing.
964         * optimize.c (maybe_clone_body): Do not increase function depth.
965
966 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
967
968         PR c++/13474
969         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
970
971 2003-01-12  Steven Bosscher  <stevenb@suse.de>
972
973         PR c++/13558
974         * parser.c (cp_parser_member_declaration): Any non-type is also
975         not a class or a function.
976
977 2004-01-12  Jason Merrill  <jason@redhat.com>
978
979         PR c++/12815
980         * class.c (build_base_path): Do not mark vtable references as
981         TREE_CONSTANT.
982         (build_vtbl_ref_1): Likewise.
983
984 2004-01-12  Richard Henderson  <rth@redhat.com>
985
986         PR opt/10776
987         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
988         (store_init_value): Use it.
989         * decl.c (check_initializer): Expect full initialization code
990         from store_init_value.
991         * init.c (expand_aggr_init_1): Likewise.
992         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
993
994 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
995
996         * class.c (layout_class_type): For non-POD class types, also copy
997         the DECL_SIZE and DECL_MODE of fields to the base class type.
998
999 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1000
1001         PR c++/13289
1002         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
1003         calling regenerate_decl_from_template.
1004
1005 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
1006
1007         PR c++/4100
1008         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
1009         decl-specifier occurring along with a class definition.
1010
1011 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
1012
1013         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
1014         clauses to comments describing declares_class_or_enum.
1015         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
1016         false.
1017
1018 2004-01-12  Jan Hubicka  <jh@suse.cz>
1019
1020         * pt.c (for_each_template_parm): Do not check for duplicates.
1021         (for_each_template_parm): Use walk_tree duplicate checking code.
1022
1023 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
1024
1025         PR c++/3478
1026         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
1027         is error_mark_node, don't add any more decl_specs.
1028         (cp_parser_init_declarator): After committing to a declaration, if
1029         the decl_specifiers start with error_mark_node, issue an error and
1030         change the type to "int".
1031
1032 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
1033
1034         PR bootstrap/7817
1035         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
1036
1037 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1038
1039         DR 337
1040         PR c++/9256
1041         * pt.c (tsubst): Substitution must fail if we are attempting to
1042         create an array with element type that is an abstract class type.
1043         * decl.c (cp_finish_decl): Strip pointers and array types recursively
1044         before calling abstract_virtuals_error.
1045
1046 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
1047
1048         * name-lookup.c (qualified_lookup_using_namespace): Consider
1049         strong using directives even if we've already found a binding.
1050
1051 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
1052
1053         * cp-tree.h (cxx_expand_expr): Change prototype.
1054         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
1055
1056 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1057
1058         PR c++/12573
1059         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
1060         looking into them recursively. They can be there because of the
1061         new __offsetof__ extension.
1062
1063 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
1064
1065         * parser.c (cp_parser_save_member_function_body): Mark the
1066         definition static.
1067
1068 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
1069
1070         PR c++/13057
1071         * class.c (build_clone): Copy type attributes from the original
1072         function to the clone.
1073
1074         PR c++/12815
1075         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
1076         references as constant.
1077
1078         PR c++/12132
1079         * parser.c (cp_parser_explicit_instantiation): Improve error
1080         recovery.
1081         (cp_parser_require): Improve indication of the error location.
1082
1083         PR c++/13451
1084         * parser.c (cp_parser_class_head): Reorder logic to check for
1085         invalid qualification.
1086
1087 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
1088
1089         PR c++/13157
1090         * name-lookup.c (lookup_using_namespace): Remove spacesp
1091         parameter.
1092         (unqualified_namespace_lookup): Likewise.
1093         (lookup_qualified_name): Adjust accordingly.
1094         (lookup_name_real): Likewise.
1095         (lookup_arg_dependent): Do not eliminate the namespace of the
1096         functions found by unqualified name lookup unless that is the
1097         current namespace.
1098
1099 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
1100
1101         * semantics.c (push_deferring_access_checks): Fix format.
1102         (resume_deferring_access_checks): Likewise.
1103         (stop_deferring_access_checks): Likewise.
1104         (pop_deferring_access_checks): Likewise.
1105         (get_deferred_access_checks): Likewise.
1106         (pop_to_parent_deferring_access_checks): Likewise.
1107         (perform_deferred_access_checks): Likewise.
1108         (perform_or_defer_access_check): Likewise.
1109
1110 2004-01-04  Richard Henderson  <rth@redhat.com>
1111
1112         * call.c (build_over_call): Don't create a save_expr of an
1113         aggregate, but rather its address.
1114
1115 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
1116
1117         PR c++/13529
1118         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
1119         an offsetof expression.
1120
1121         * parser.c (cp_parser_parameter_declaration): Fix comment.
1122
1123         PR c++/12226
1124         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
1125         (reference_binding): Set it when appropriate.
1126         (build_temp): New function, split out from ...
1127         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
1128         (initialize_reference): Likewise.
1129
1130         PR c++/13536
1131         * parser.c (cp_parser): Add in_type_id_in_expr_p.
1132         (cp_parser_new): Initialize it.
1133         (cp_parser_postfix_expression): Set it.
1134         (cp_parser_sizeof_operand): Likewise.
1135         (cp_parser_parameteR_declaration): Do not commit early to tenative
1136         parsers when in_type_id_in_expr_p is set.
1137
1138 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1139
1140         PR c++/13094
1141         * parser.c (cp_parser_template_argument): Don't call
1142         make_unbound_class_template directly.
1143         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
1144         UNBOUND_CLASS_TEMPLATE tree node.
1145
1146 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
1147
1148         PR target/12729
1149         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
1150
1151 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1152
1153         PR c++/13520
1154         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
1155         (DECL_FUNCTION_TEMPLATE_P): Use it.
1156         (DECL_CLASS_TEMPLATE_P): Likewise.
1157         * parser.c (cp_parser_lookup_name): Add is_template parameter.
1158         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
1159         (cp_parser_template_name): Likewise.
1160         (cp_parser_elaborated_type_specifier): Likewise.
1161         (cp_parser_namespace_name): Likewise.
1162         (cp_parser_class_name): Likewise.
1163         (cp_parser_lookup_name_simple): Likewise.
1164
1165 See ChangeLog.3 for earlier changes.