OSDN Git Service

* method.c (implicitly_declare_fn): Don't call defer_fn; abort
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2004-05-24  Geoffrey Keating  <geoffk@apple.com>
2
3         * method.c (implicitly_declare_fn): Don't call defer_fn; abort
4         if it might be needed.
5         * pt.c (mark_decl_instantiated): Only call defer_fn if
6         the function actually needs processing in finish_file.
7         * decl2.c (finish_file): Add check that elements in
8         deferred_fns_used are really needed there.  Remove unnecessary
9         test of DECL_SAVED_TREE.
10
11 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
12
13         * Make-lang.in: No need to specify $(LIBCPP).
14
15 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
16
17         PR c++/15044
18         * parser.c (cp_parser_class_head): Robustify.
19
20         PR c++/15317
21         * parser.c (cp_parser_decl_specifier_seq): Correct error in
22         comment.
23         (cp_parser_constructor_declarator_p): Treat attributes
24         as decl-specifiers.
25
26         PR c++/15329
27         * typeck.c (build_unary_op): Do not attempt to resolve casts to
28         base classes in templates.
29
30 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
31
32         PR c++/15165
33         * pt.c (instantiate_template): Robustify.
34
35 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
36
37         PR c++/15025
38         * decl.c (xref_tag): Issue errors about redeclaring template
39         classes as non-template classes.
40
41 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
42
43         PR c++/14821
44         * name-lookup.c (supplement_binding): Allow redefinitions of
45         namespace aliases.
46
47         PR c++/14883
48         * parser.c (cp_parser_template_argument): Robustify.
49
50 2004-05-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
51
52         * class.c (alter_access): Use %E format specifier to print an
53         identifier node.  Avoid looking at the IDENTIFIER_POINTER.
54         (push_lang_context): Likewise.
55         * decl.c (lookup_label): Likewise.
56         (grokdeclarator): Likewise.
57         * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
58         * pt.c (do_type_instantiation): Likewise.
59         * tree.c (handle_java_interface_attribute): Likewise.
60         (handle_com_interface_attribute): Likewise.
61         (handle_init_priority_attribute): Likewise.
62
63 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
64
65         PR c++/15285
66         PR c++/15299
67         * pt.c (build_non_dependent_expr): Expand the set of tree nodes
68         recognized as overloaded functions.
69
70 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
71
72         PR c++/15507
73         * class.c (layout_nonempty_base_or_field): Do not try to avoid
74         layout conflicts for unions.
75
76         PR c++/15542
77         * typeck.c (build_x_unary_op): Instantiate template class
78         specializations before looking for "operator &".
79
80         PR c++/15427
81         * typeck.c (complete_type): Layout non-dependent array types, even
82         in templates.
83
84         PR c++/15287
85         * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
86         template.
87
88 2004-05-22  Roger Sayle  <roger@eyesopen.com>
89
90         * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
91         returning when TREE_TYPE is error_mark_node.
92         * typeck.c (require_complete_type): Return error_mark_node if
93         value's type is an error_mark_node.
94
95 2005-05-20  Andrew Pinski  <pinskia@physics.uc.edu>
96
97         * optimize.c (calls_setjmp_r): Remove.
98         (calls_setjmp_p): Remove.
99         * cp-tree.c (calls_setjmp_p): Remove.
100         * decl.c (finish_function): Do not call calls_setjmp_p.
101
102 2004-05-18  Zack Weinberg  <zack@codesourcery.com>
103
104         * decl.c (cp_finish_decl): Use mark_decl_referenced.
105         * decl2.c (maybe_make_one_only): Likewise.
106         * method.c (use_thunk): Likewise.
107
108 2004-05-18  Jason Merrill  <jason@redhat.com>
109
110         * class.c (build_base_path): Tidy a bit.
111
112 2004-05-14  Geoffrey Keating  <geoffk@apple.com>
113
114         * name-lookup.c (struct scope_binding): New.
115         (EMPTY_SCOPE_BINDING): New.
116         (lookup_using_namespace): Take a scope_binding instead of a
117         cxx_binding.
118         (qualified_lookup_using_namespace): Likewise.
119         (cxx_binding_clear): Delete.
120         (do_nonmember_using_decl): Use a scope_binding instead of a
121         cxx_binding.
122         (lookup_tag): Don't call select_decl.
123         (ambiguous_decl): Don't return anything (and change callers to match).
124         Take a scope_binding as the second parameter.
125         (lookup_namespace_name): Use a scope_binding instead of a
126         cxx_binding.
127         (unqualified_namespace_lookup): Likewise.
128         (lookup_qualified_name): Likewise.
129         (select_decl): Take a scope_binding instead of a cxx_binding.
130         Use macros rather than hand-coding tests for type-ness.
131
132 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
133
134         * cp-gimplify.c: Rename from cp-simplify.c.
135         * Make-lang.in, optimize.c: Update.
136
137 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
138
139         Merge from tree-ssa-20020619-branch.  See
140         ChangeLog.tree-ssa for details.
141
142         * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
143         cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
144         expr.c, init.c, name-lookup.h, optimize.c, parser.c,
145         pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
146         Merged.
147         * cp-mudflap.c: New file.
148         * cp-simplify.c:: New file.
149
150 2004-05-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
151
152         PR c++/14389
153         * decl2.c (check_classfn): For member templates, compare also the
154         template parameters to match the declaration.
155         * cp-tree.h: Adjust declaration of check_classfn.
156         * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
157         * friend.c (do_friend): Likewise.
158         * pt.c (tsubst_friend_function): Likewise.
159
160 2004-05-01  Zack Weinberg  <zack@codesourcery.com>
161
162         * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
163         Instead, dig into the representation type to find the array bound.
164
165 2004-04-30  Jason Merrill  <jason@redhat.com>
166
167         Refer to base members using COMPONENT_REFs where possible.
168         * class.c (build_simple_base_path): New fn.
169         (build_base_path): Use it for non-virtual base references.
170         (layout_class_type): Change base fields to their real type
171         after layout is done.
172         * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
173         * cp-lang.c (cxx_get_alias_set): Use it.
174
175 2004-04-30  Kazu Hirata  <kazu@cs.umass.edu>
176
177         * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
178         comment typos.
179
180 2004-04-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
181
182         PR c++/15064
183         * parser.c (cp_parser_postfix_expression): typeid operator cannot be
184         used in integral constant expressions.
185
186 2004-04-22  Mark Mitchell  <mark@codesourcery.com>
187
188         * init.c (build_aggr_init): Fix accidental use of C99 construct in
189         previous change.
190
191         * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
192         braced initializer.
193         * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
194         * decl.c (reshape_init): Use it.
195         * init.c (perform_member_init): Remove redundant condition.
196         (build_aggr_init): Adjust to handle brace-enclosed initializers
197         correctly.
198         (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
199
200         * parser.c (cp_parser_initializer_clause): Do not set
201         TREE_HAS_CONSTRUCTOR on the initializer.
202         * rtti.c (tinfo_base_init): Likewise.
203         (generic_initializer): Likewise.
204         (ptr_initializer): Likewise.
205         (ptm_initializer): Likewise.
206         (class_initializer): Likewise.
207         (get_pseudo_ti_init): Likewise.
208         * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
209
210 2004-04-22  Alan Modra  <amodra@bigpond.net.au>
211
212         * name-lookup.c (anonymous_namespace_name): Make static.
213
214 2004-04-19  Roger Sayle  <roger@eyesopen.com>
215
216         PR middle-end/14531
217         * class.c (build_base_path): Call fold whilst building the NULL
218         pointer check expression trees.
219
220 2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>
221
222         * init.c (build_new_1): Don't use type size argument for Java
223         _Jv_AllocObject call.
224
225 2004-04-09  Danny Smith  <dannysmith@users.sourceforge.net>
226
227         * method.c (make_alias_for_thunk): Remove preprocessor guard on
228         declaration and definition.
229
230 2004-04-08  Danny Smith  <dannysmith@users.sourceforge.net>
231
232         PR c++/14808
233         * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
234         than ASM_OUTPUT_DEF.
235
236 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
237
238         * decl2.c (mark_used): Don't segfault if cfun != NULL but
239         current_function_decl == NULL.
240
241 2004-04-05  Nathan Sidwell  <nathan@codesourcery.com>
242
243         PR c++/3518
244         * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
245         level.
246
247 2004-04-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
248
249         * init.c (decl_constant_value): Don't look at DECL_INITIAL
250         of PARM_DECL.
251         * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
252         or TREE_SIDE_EFFECTS of a type.
253
254 2004-04-02  Nathan Sidwell  <nathan@codesourcery.com>
255
256         PR c++/14007
257         * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
258         cv-qualifier unification.
259         * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
260
261 2004-04-02  Jan Hubicka  <jh@suse.cz>
262
263         * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
264         * cp-tree.h (cp_update_decl_after_saving): Declare.
265         * tree.c (cp_update_decl_after_saving): Define.
266
267 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
268
269         PR c++/14803
270         * typeck.c (get_delta_difference): Call fold before returning the
271         value.
272
273 2004-04-01  Richard Henderson  <rth@redhat.com>
274
275         PR c++/14804
276         * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
277         * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
278
279 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
280
281         PR c++/14810
282         * name-lookup.c (maybe_push_cleanup_level): Robustify.
283
284 2004-04-01  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
285
286         * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
287
288 2004-03-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
289
290         * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
291         * class.c (check_bitfield_decl): Likewise.
292         * cvt.c (type_promotes_to): Likewise.
293         * decl.c (finish_enum): Likewise.
294         * mangle.c (write_builtin_type): Likewise.
295         * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
296         * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
297         (build_binary_op): Likewise.
298
299 2004-03-31  Jan Hubicka  <jh@suse.cz>
300
301         * tree.h (optimize_function): Kill prototype.
302         * optimize.c (dump_function, optimize_function, dump_finction): Kill.
303         * semantics.c (expand_body): Kill.
304
305 2004-03-30  Mark Mitchell  <mark@codesourcery.com>
306
307         PR c++/14724
308         * decl.c (start_decl_1): Do not decide whether or not to create a
309         new cleanup level until after the type has been completed.
310
311         PR c++/14763
312         * pt.c (tsubst_default_argument): Clear current_function_decl.
313
314 2004-03-30  Zack Weinberg  <zack@codesourcery.com>
315
316         * name-lookup.c, parser.c: Use new shorter form of GTY markers.
317
318 2004-03-29  Zack Weinberg  <zack@codesourcery.com>
319
320         * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
321         is null, just print the literal name and return.
322
323 2004-03-25  Kazu Hirata  <kazu@cs.umass.edu>
324
325         * cxx-pretty-print.c: Fix comment typos.
326
327 2004-03-24  Kazu Hirata  <kazu@cs.umass.edu>
328
329         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
330         Update copyright.
331
332 2004-03-23  Ziemowit Laski  <zlaski@apple.com>
333
334         * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
335         * mangle.c (write_type): Add call to 'mangle_fundamental_type'
336         target hook.
337
338 2004-03-23  Zack Weinberg  <zack@codesourcery.com>
339
340         PR 12267, 12391, 12560, 13129, 14114, 14133
341         * cp-lang.c (c_reset_state): Delete.
342         (push_file_scope, pop_file_scope): New stubs.
343         * parser.c (c_parse_file): Call sorry() here if called more than once.
344
345 2004-03-23  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
346
347         * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
348         for INTEGER_CST.
349
350 2004-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
351
352         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
353
354 2004-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
355
356         * error.c (enum pad): Remove.
357         (dump_qualifiers): Likewise.
358         (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
359         (dump_aggr_type): Likewise.
360         (dump_type_suffix): Likewise.
361         (dump_simple_decl): Likewise.
362         (dump_function_decl): Likewise.
363         (cv_to_string): Likewise.
364         (dump_type_prefix): Likewise.  Adjust return void.
365         * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
366         cxx_pretty_print.h.
367         (pp_cxx_template_keyword_if_needed): Document.
368         (pp_cxx_qualified_id): Document case FUNCTION_DECL.  Tidy.
369         (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
370         MUST_NOT_THROW_EXPR.
371
372 2004-03-21  Mark Mitchell  <mark@codesourcery.com>
373
374         PR c++/14616
375         * decl.c (cp_finish_decl): Compute the size of arrays declared in
376         templates, if their type is non-dependent.
377
378 2004-03-19  Mark Mitchell  <mark@codesourcery.com>
379
380         * call.c (build_op_delete_call): Do not forget the placement
381         arguments when iterating through mutiple delete operators.
382
383         * cp-tree.h (svaed_scope): Remove last_parms.
384         (NEW_DELETE_OPNAME_P): New macro.
385         (last_function_parms): Remove.
386         (do_friend): Adjust prototype.
387         * decl.c (grokparms): Return the PARM_DECLs directly, rather than
388         using last_function_parms.
389         (grokfndecl): Take the PARM_DECLs as an argument, rather than
390         using last_function_parms.
391         (grokdeclarator): Adjust accordingly.  Do not form METHOD_TYPEs
392         for class-specific operator new and operator delete.
393         (grok_op_properties): Do not look for allocation functions with
394         METHOD_TYPEs.
395         (start_function): Use DECL_ARGUMENTS instead of
396         last_function_parms.
397         * decl.h (last_function_parms): Do not declare.
398         * decl2.c (grokclassfn): Do not use last_function_parms.
399         * friend.c (do_friend): Remove parmdecls parameter.
400         * name-lookup.c (push_to_top_level): Do not save last_function_parms.
401         (pop_from_top_level): Do not restore it.
402         * pt.c (check_explicit_specialization): Do not adjust
403         last_function_parms.
404
405         * name-lookup.c (do_local_using_decl): Create a local binding for
406         types brought in via using declarations.
407
408         * name-lookup.c (lookup_arg_dependent): Handle block-scope
409         function declarations correctly.
410
411         * semantics.c (finish_id_expression): Correct handling of
412         conversion operators to dependent types.
413
414         * typeck.c (lookup_destructor): Allow the use of destructors from
415         base classes.
416
417 2004-03-19  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
418
419         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
420         TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
421         * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
422         the field is named TEMPLATE_TYPE_PARM_INDEX.
423
424 2004-03-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
425
426         PR c++/14545
427         * parser.c (cp_parser_functional_cast): A cast to anything
428         but integral or enumaration type is not an integral constant
429         expression.
430         * pt.c (value_dependent_expression_p): Handle cast expressions
431         without operands (such as "int()").
432
433 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
434
435         * semantics.c (finish_pseudo_destructor_expr): Allow differing
436         cv-qualification between the type named by the
437         pseudo-destructor-name and the object-type.
438
439         * search.c (accessible_base_p): Handle non-proper bases.
440
441         * name-lookup.c (do_nonmember_using_decl): If a using declaration
442         refers to a single overloaded function, set the type of the
443         function.
444         * tree.c (lvalue_type): Simplify.
445         * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
446         unknown type.
447         (build_unary_op): Handle OVERLOADs with known types.
448
449         * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
450         function templates.
451
452         * parser.c (cp_parser_postfix_expression): Handle the use of
453         "typename" in non-dependent contexts.  Convert appropriately when
454         when using a qualified name after "->" or ".".
455
456         * call.c (conditional_conversion): Honor the requirement that some
457         conversions refer to the original object.
458
459 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
460
461         * call.c (build_conditional_expr): Do not call force_rvalue for
462         operands of void_type when the conditional expression itself has
463         void type.
464         * name-lookup.c (pushdecl): Don't consider a declaration of a
465         function named "main" to be an overload of a type named "main".
466         * parser.c (cp_parser_template_name): Perform name lookup when the
467         template name is proceeded by "template" if the qualifying scope
468         is non-dependent.
469         * typeck.c (composite_pointer_type_r): Correctly handle
470         pointer-to-member types.
471         (build_const_cast): Likewise.
472
473 2004-03-18  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
474
475         * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
476         * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
477         (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
478         (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
479         (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
480         (TYPEOF_TYPE_EXPR): New macro.
481         * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
482         * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
483         * pt.c (tsubst): Likewise.
484         * semantics.c (finish_typeof): Likewise.
485         * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
486         and TEMPLATE_TYPE_PARM.
487         * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
488         (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
489
490 2004-03-16  Mark Mitchell  <mark@codesourcery.com>
491
492         PR c++/14586
493         * cp-tree.h (build_new_op): Change prototype.
494         (build_x_binary_op): Likewise.
495         * call.c (build_new_op): Add overloaded_p parameter.
496         * decl2.c (grok_array_decl): Adjust call to build_new_op.
497         * parser.c (cp_parser_binary_expression): Note that uses of
498         overloaded operators prevents an expression from being considered
499         an integral constant.
500         * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
501         build_x_binary_op.
502         * semantics.c (finish_call_expr): Likewise.
503         * typeck.c (rationalize_conditional_expr): Likewise.
504         (build_x_indirect_ref): Likewise.
505         (build_x_binary_op): Likewise.
506         (build_x_unary_op): Likewise.
507         (build_x_compound_expr): Likewise.
508         (build_modify_expr): Likewise.
509         * typeck2.c (build_x_arrow): Likewise.
510
511 2004-03-15  Kazu Hirata  <kazu@cs.umass.edu>
512
513         * cp-lang.c, ptree.c: Update copyright.
514
515 2004-03-13  Mark Mitchell  <mark@codesourcery.com>
516
517         PR c++/14550
518         * parser.c (cp_parser_non_integral_constant_expression): Encode
519         more of the idiom that surrounded calls to this function within
520         the function itself
521         (cp_parser_primary_expression): Adjust accordingly.
522         (cp_parser_postfix_expression): Likewise.
523         (cp_parser_unary_expression): Likewise.
524         (cp_parser_cast_expression): Likewise.
525         (cp_parser_assignment_expression): Likewise.
526         (cp_parser_expression): Likewise.
527         (cp_parser_new_expression): Note that new-expressions are not
528         allowed in integral constant expressions.
529         (cp_parser_delete_expression): Likewise.
530
531 2004-03-12  Matt Austern  <austern@apple.com>
532
533         * decl2.c (maybe_make_one_only): Look at
534         TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
535         to make an explicit instantiation weak.
536         * method.c (use_thunk): Make sure we call comdat_linkage
537         when appropriate.
538         * pt.c (do_type_instantiation): On systems where weak symbols
539         don't go in a static archive's TOC, explicit instantiation of a
540         class must imply *explicit* instantiation of its memeber.
541
542 2004-03-11  Kazu Hirata  <kazu@cs.umass.edu>
543
544         * call.c, cp-tree.h, pt.c: Fix comment typos.
545
546 2004-03-10  Mark Mitchell  <mark@codesourcery.com>
547
548         PR c++/14510
549         * decl.c (xref_tag): Disregard non-type declarations when
550         looking up a tagged type.
551
552 2004-03-09  Nathan Sidwell  <nathan@codesourcery.com>
553
554         PR c++/14397
555         * call.c (convert_like_real): Build a const qualified temporary,
556         when testing ctor access.
557
558 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
559
560         * call.c (initialize_reference): Fix typo.
561
562 2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
563
564         PR c++/14409
565         * pt.c (determine_specialization): For member templates, match also
566         constness.
567
568         PR c++/14448
569         * parser.c (cp_parser_initializer_clause): Fold initializer if it is
570         non-dependent.
571         * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
572
573 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
574
575         PR c++/14230
576         * call.c (initialize_reference): Handle initializers that are
577         class-member access expressions applies to rvalues.
578
579 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
580
581         PR c++/14432
582         * name-lookup.c (supplement_binding): Ignore functions that are
583         marked DECL_ANTICIPATED.
584
585 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
586
587         PR c++/14401
588         * class.c (check_field_decls): Complain about non-static data
589         members of reference type in unions.  Propagate
590         CLASSTYPE_REF_FIELDS_NEED_INIT and
591         CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
592         data members.
593         * init.c (perform_member_init): Complain about mbmers with const
594         type that are not explicitly initialized.
595
596 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
597
598         * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
599         * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
600         (lang_identifier): Remove implicit_decl and error_locus.
601         (IDENTIFIER_IMPLICIT_DECL): Remove.
602         (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
603         (IDENTIFIER_ERROR_LOCUS): Likewise.
604         (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
605         (TYPE_ASSEMBLER_NAME_STRING): Likewise.
606         (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
607         (implicitly_declare): Remove.
608         * decl.c (warn_extern_redeclared_static): Remove check of
609         IDENTIFIER_IMPLICIT_DECL.
610         (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
611         (implicitly_declare): Remove.
612         (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
613         (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
614         (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
615         * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
616         in the innermost scope, rather than at namespace scope.
617         * name-lookup.c (push_local_binding): Give it external linkage.
618         (pushdecl): Remove dead code.
619         * name-lookup.h (push_local_binding): Declare it.
620         * ptree.c (cxx_print_identifier): Don't print
621         IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
622         * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
623         not IDENTIFIER_ERROR_LOCUS.
624         * typeck.c (build_function_call): Remove dead code.
625
626 2004-03-08  Jason Merrill  <jason@redhat.com>
627
628         PR c++/13170
629         * decl.c (xref_tag): Remove attribute handling.
630         * cp-tree.h: Adjust prototype.
631         * decl.c, parser.c, rtti.c: Adjust callers.
632         * parser.c (cp_parser_class_head): Pass back attributes in the
633         class head.
634         (cp_parser_class_specifier): Adjust.
635
636 2004-03-08  Matt Austern  <austern@apple.com>
637
638         PR debug/14079
639         * name-lookup.c (add_decl_to_level): Add extern variables, as well
640         as static, to static_decls array.
641
642 2004-03-05  Jason Merrill  <jason@redhat.com>
643
644         * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
645
646 2004-03-04  Geoffrey Keating  <geoffk@apple.com>
647
648         * decl.c (grokfndecl): Update old incorrect comment.
649         (grokvardecl): Diagnose C++ variables of type with no linkage.
650
651 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
652
653         PR c++/14369
654         * pt.c (build_non_dependent_expr): Do not create a
655         NON_DEPENDENT_EXPR for a THROW_EXPR.
656
657 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
658
659         PR c++/14369
660         * error.c (dump_expr): Handle THROW_EXPR.
661
662 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
663
664         PR c++/14360
665         * parser.c (cp_parser_postfix_expression): Do not perform Koenig
666         lookup if ordinary name-lookup finds a non-function.
667         * pt.c (tsubst_copy_and_build): Likewise.
668
669         PR c++/14361
670         * parser.c (cp_parser_late_parsing_default_args): Check that there
671         are no extra tokens after the end of the default-argument
672         expression.
673
674 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
675
676         PR c++/14324
677         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
678         having C++ linkage for name-mangling purposes.
679
680         PR c++/14260
681         * parser.c (cp_parser_direct_declarator): Recognize constructor
682         declarators that use a template-id to name the class being
683         constructed.
684
685         PR c++/14337
686         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
687         (tsubst_expr): Do not call tsubst_copy, even when
688         processing_template_decl.
689
690 2004-03-01  Jeff Law  <law@redhat.com>
691
692         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
693         the proper type.
694
695 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
696
697         PR c++/14138
698         * name-lookup.h (push_scope): Change prototype.
699         * name-lookup.c (push_scope): Do not reenter the current class
700         scope.
701         * decl.c (grokfndecl): Check return code from push_scope before
702         calling pop_scope.
703         * decl2.c (check_classfn): Likewise.
704         * parser.c (cp_parser_conversion_function_id): Likewise.
705         (cp_parser_init_declarator): Likewise.
706         (cp_parser_direct_declarator): Likewise.
707         (cp_parser_class_specifier): Likewise.
708         (cp_parser_class_head): Likewise.
709         (cp_parser_lookup_name): Likewise.
710         (cp_parser_constructor_declarator_p): Likewise.
711         * pt.c (instantiate_class_template): Likewise.
712         (resolve_typename_type): Likewise.
713
714 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
715
716         PR c++/14267
717         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
718         extension.
719
720         PR debug/12103
721         * class.c (update_vtable_entry_for_fn): Do not go through
722         covariance machinery if the type returned by an overrider is the
723         same as the original.
724
725 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
726
727         * call.c: Fix a comment typo.
728
729 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
730
731         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
732
733 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
734
735         PR c++/14278
736         * parser.c (cp_parser_parameter_declaration_list): Commit
737         to fewer tentative parses.
738
739 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
740
741         PR c++/14284
742         * pt.c (dependent_type_p_r): A template template parameter is a
743         dependent type.
744
745 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
746
747         PR c++/14246
748         * mangle.c (write_template_arg_literal): Don't rely on identity for
749         boolean constants.
750
751 2004-02-24  Jason Merrill  <jason@redhat.com>
752
753         * tree.c (build_exception_variant): Use check_qualified_type.
754
755 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
756             Kazu Hirata  <kazu@cs.umass.edu>
757
758         * decl.c (cxx_init_decl_processing): Don't check
759         flag_writable_strings.
760
761 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
762
763         PR c++/14156
764         * typeck.c (maybe_warn_about_returning_address_of_location):
765         Change check for VAR_DECL to use DECL_P instead.
766
767 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
768
769         PR c++/14250
770         * cvt.c (build_expr_type_conversion): Type must be complete before
771         looking up for conversions.
772
773 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
774
775         PR c++/14143
776         * name-lookup.c (arg_assoc_class): Don't look into template
777         arguments if it is not a primary template.
778
779 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
780
781         PR c++/12007
782         * method.c (use_thunk): Always clone function argument tree.
783
784 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
785
786         PR c++/14199
787         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
788
789         PR c++/14173
790         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
791         for all type variants.
792
793 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
794
795         PR c++/13927
796         * decl.c (duplicate_decls): Return error_mark_node for invalid
797         redeclarations.
798         * name-lookup.c (push_namespace): Ignore the return value from
799         pushdecl.
800         * pt.c (push_template_decl_real): Robustify.
801
802         PR c++/14186
803         * name-lookup.c (push_class_level_binding): Do not complain about
804         adding a binding for a member whose name is the same as the
805         enclosing class if the member is located in a base class of the
806         current class.
807
808 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
809
810         PR c++/14181
811         * parser.c (cp_parser_new_expression): Parse an ill-formed
812         direct-new-declarator after a parenthesized type-id to emit good
813         diagnostic.
814
815 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
816
817         * cp-tree.def, cvt.c: Update copyright.
818
819 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
820
821         PR c++/11326
822         * cp-tree.h (abi_version_at_least): Remove.
823         * mangle.c: Include flags.h.
824
825 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
826
827         PR c++/13971
828         * call.c (build_conditional_expr): Handle conversions between
829         class types which result in differently cv-qualified type
830         variants.
831
832         PR c++/14086
833         * class.c (delete_duplicate_fields_1): Remove.
834         (delete_duplicate_fields): Likewise.
835         (finish_struct_anon): Remove check for members with the same name
836         as their enclosing class.
837         (check_field_decls): Do not call duplicate_fields.
838         * decl.c (grokdeclarator): Remove check for static data members
839         with the same name as their enclosing class.
840         * name-lookup.c (push_class_level_binding): Check for members with
841         the same name as their enclosing class.
842
843 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
844
845         PR c++/14085
846         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
847
848 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
849
850         PR c++/13635
851         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
852         has full set of arguments.
853
854 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
855
856         PR c++/13927
857         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
858
859 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
860
861         PR c++/14122
862         * cp-tree.h (delete_sanity): Change prototype.
863         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
864         Remove dead code.  Adjust code to warn about deleting an array.
865         * typekc.c (decay_conversion): Use build_address and build_nop.
866
867         PR c++/14108
868         * search.c (accessible_p): Do not check access in thunks.
869
870         PR c++/14083
871         * call.c (build_conditional_expr): Call force_rvalue on the
872         non-void operand in the case that one result is a throw-expression
873         and the other is not.
874
875 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
876
877         PR c++/9851
878         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
879         the type name and look ahead for ::~, and bail out early with a
880         better error message if the parse is going to fail.
881
882 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
883
884         * call.c (conversion_kind): New type.
885         (conversion_rank): Likewise.
886         (conversion): Likewise.
887         (CONVERSION_RANK): New macro.
888         (conversion_obstack): New variable.
889         (obstack_initialized): Likewise.
890         (z_candidate): Change type of convs and second_conv.
891         (candidate_warning): New type.
892         (IDENTITY_RANK): Remove.
893         (EXACT_RANK): Likewise.
894         (PROMO_RANK): Likewise.
895         (STD_RANK): Likewise.
896         (PBOOL_RANK): Likewise.
897         (USER_RANK): Likewise.
898         (ELLIPSIS_RANK): Likewise.
899         (BAD_RANK): Likewise.
900         (ICS_RANK): Likewise.
901         (ICS_STD_RANK): Likewise.
902         (ICS_USER_FLAG): Likewise.
903         (ICS_ELLIPSIS_FLAG): Likewise.
904         (ICS_THIS_FLAG): Likewise.
905         (ICS_BAD_FLAG): Likewise.
906         (NEED_TEMPORARY_P): Likewise.
907         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
908         (USER_CONV_CAND): Likewise.
909         (USER_CONV_FN): Likewise.
910         (conversion_obstack_alloc): New function.
911         (alloc_conversion): Likewise.
912         (validate_conversion_obstack): Likewise.
913         (alloc_conversions): Likewise.
914         (build_conv): Adjust to deal with new conversion data structures.
915         (build_identity_conv): New function.
916         (build_ambiguous_conv): Likewise.
917         (standard_conversion): Adjust to deal with new conversion data
918         structures.
919         (convert_class_to_reference): Likewise.
920         (direct_reference_binding): Likewise.
921         (reference_binding): Likewise.
922         (implicit_conversion): Likewise.
923         (add_candidate): Likewise.
924         (add_function_candidate): Likewise.
925         (add_conv_candidate): Likewise.
926         (build_builtin_candidate): Likewise.
927         (print_z_candidate): Likewise.
928         (merge_conversion_sequences): Likewise.
929         (build_user_type_conversion_1): Likewise.
930         (build_user_type_conversion): Likewise.
931         (build_new_function_call): Likewise.
932         (build_object_call): Likewise.
933         (conditional_conversion): Likewise.
934         (build_conditional_expr): Likewise.
935         (build_new_op): Likewise.
936         (build_op_delete_call): Likewise.
937         (convert_like_real): Likewise.
938         (build_over_call): Likewise.
939         (build_new_method_call): Likewise.
940         (is_subseq): Likewise.
941         (maybe_handle_implicit_object): Likewise.
942         (maybe_handle_ref_bind): Likewise.
943         (compare_ics): Likewise.
944         (source_type): Likewise.
945         (add_warning): Likewise.
946         (joust): Likewise.
947         (can_convert_arg): Likewise.
948         (can_convert_arg_bad): Likewise.
949         (perform_implicit_conversion): Likewise.
950         (perform_direct_initialization_if_possible): Likewise.
951         (initialize_reference): Likewise.
952         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
953         * cp-tree.def (WRAPPER): Likewise.
954         (IDENTITY_CONV): Remove.
955         (LVALUE_CONV): Likewise.
956         (QUAL_CONV): Likewise.
957         (STD_CONV): Likewise.
958         (PTR_CONV): Likewise.
959         (PMEM_CONV): Likewise.
960         (BASE_CONV): Likewise.
961         (REF_BIND): Likewise.
962         (USER_CONV): Likewise.
963         (AMBIG_CONV): Likewise.
964         (RVALUE_CONV): Likewise.
965         * cp-tree.h (tree_wrapper): Remove.
966         (WRAPPER_ZC): Remove.
967         (lang_tree_node): Remove wrapper.
968         (LOOKUP_SPECULATIVELY): Remove.
969         (build_op_delete_call): Adjust prototype.
970         (validate_conversion_obstack): Declare.
971         (build_zc_wrapper): Remove.
972         * cvt.c (convert_to_reference): Remove dead code.
973         (ocp_convert): Likewise.
974         * decl.c (redeclaration_error_message): Correct handling of
975         templates.
976         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
977         (cp_tree_node_structure): Remove WRAPPER case.
978         * decl2.c (finish_file): Call validate_conversion_obstack.
979         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
980         (build_op_delete_call): Likewise.
981         (build_x_delete): Likewise.
982         (build_delete): Adjust call to build_op_delete_call.
983         * pt.c (tsubst_friend_declaration): Adjust code to determine
984         whether or not a friend template is a definition.
985         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
986         * tree.c (build_zc_wrapper): Remove.
987
988 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
989
990         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
991         * cp-tree.h: Don't declare cxx_builtin_type_decls.
992         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
993         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
994
995 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
996
997         * typeck.c (lookup_destructor): Fix typo in error message.
998
999 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
1000
1001         * call.c, parser.c, tree.c: Fix comment typos.
1002
1003 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
1004
1005         Bug 13856
1006         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
1007         * decl.c (duplicate_decls, start_function): Likewise.
1008
1009 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
1010
1011         * name-lookup.c (pushdecl): Issue shadow warnings directly.
1012         * parser.c (free_parser_stacks): Delete.
1013
1014 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
1015
1016         * rtti.c: Update copyright.
1017
1018 2003-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1019
1020         PR c++/14033
1021         * decl.c (require_complete_types_for_parms): Do not insert
1022         error_mark_node in the parameter list.
1023
1024 2003-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1025
1026         PR c++/14028
1027         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
1028         error when terminator can not be found.
1029
1030 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
1031
1032         Make-lang.in (po-generated):  Delete.
1033
1034 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
1035
1036         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
1037         targetm.calls.promote_prototypes.
1038
1039 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
1040
1041         PR middle-end/13750
1042         Revert:
1043         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
1044         PR pch/13361
1045         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
1046         (handle_pragma_implementation): Likewise.
1047
1048 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
1049
1050         PR c++/13714
1051         * typeck.c (lookup_destructor): Tweak error message.
1052
1053 2004-02-05  Jan Hubicka  <jh@suse.cz>
1054
1055         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
1056         functions.
1057
1058 2003-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1059
1060         PR c++/14008
1061         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
1062         code, only emits the diagnostic now. Added lookup of the identifier
1063         and support for qualified ids.
1064         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
1065         Parse an (invalid) type name as id-expression within a declarator.
1066         (cp_parser_simple_declaration): Use it.
1067         (cp_parser_member_declaration): Likewise.
1068         (cp_parser_make_typename_type): New function. Handle errors through
1069         cp_parser_diagnose_invalid_typename.
1070         (cp_parser_elaborated_type_specifier): Use it.
1071
1072 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
1073
1074         PR c++/13932
1075         * call.c (convert_like_real): Use "converting" rather than
1076         "argument" as the descriptive keyword to
1077         dubious_conversion_warnings.
1078         * typeck.c (convert_for_assignment): Do not call
1079         dubious_conversion_warnings.
1080
1081 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1082
1083         PR c++/13086
1084         * init.c (build_delete): Emit a more informative error message in
1085         case of an incomplete type, and on the correct source line.
1086
1087 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
1088
1089         * error.c, search.c: Update copyright.
1090
1091 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
1092
1093         PR c++/9941
1094         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
1095         linkage for the typeinfo name string.
1096
1097 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
1098
1099         PR c++/13969
1100         * cp-tree.h (fold_non_dependent_expr): New function.
1101         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
1102         (cp_parser_template_argument): Use fold_non_dependent_expr.
1103         (cp_parser_direct_declarator): Likewise.
1104         * pt.c (fold_non_dependent_expr): New function.
1105         (convert_nontype_argument): Use it.
1106         (tsubst_qualified_id): Simplify.
1107         (tsubst_copy_and_build): Likewise.
1108
1109 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
1110
1111         * decl.c (cxx_push_function_context): Do not set
1112         current_function_is_thunk.
1113         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
1114         actual function.
1115
1116 2003-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1117
1118         PR c++/13997
1119         * pt.c (more_specialized_class): Increase processing_template_decl
1120         while partial ordering.
1121
1122 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
1123
1124         PR c++/13925
1125         * decl.c (start_function): Do not call pushdecl for any
1126         instantiation or specialization of a primary template.
1127
1128 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
1129
1130         PR c++/13950
1131         * parser.c (cp_parser_class_name): Robustify.
1132
1133         PR c++/13970
1134         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
1135
1136         PR c++/14002
1137         * semantics.c (finish_id_expression): Do not return an
1138         IDENTIFIER_NODE when lookup finds a PARM_DECL.
1139
1140 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
1141
1142         PR c++/13978
1143         * pt.c (build_non_dependent_expr): Do not build
1144         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
1145
1146         PR c++/13968
1147         * semantics.c (finish_id_expression): Do not return an
1148         IDENTIFIER_NODE when lookup finds a VAR_DECL.
1149
1150         PR c++/13975
1151         * parser.c (cp_parser_simple_declaration): When skipping to the
1152         end of the statement swallow the terminating semicolon.
1153
1154 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
1155
1156         PR c++/13113
1157         * init.c (build_offset_ref): Improve error recovery for invalid
1158         uses of non-static member functions.
1159
1160         PR c++/13854
1161         * cp-tree.h (cp_build_type_attribute_variant): New function.
1162         * class.c (build_clone): Use cp_build_type_attribute_variant.
1163         * decl.c (duplicate_decls): Likewise.
1164         * pt.c (copy_default_args_to_explicit_spec): Likewise.
1165         (tsubst_function_type): Likewise.
1166         * tree.c (build_exception_variant): Check attributes before
1167         concluding that two types are the same.
1168         (cp_build_type-attribute_variant): New method.
1169         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
1170
1171         PR c++/13907
1172         * call.c (convert_class_to_reference): Keep better track of
1173         pedantically invalid user-defined conversions.
1174
1175 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1176
1177         PR c++/13957
1178         * pt.c (tsubst_qualified_id): Improved error message when a type
1179         is expected but not found.
1180
1181 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
1182
1183         * class.c: Fix comment typos.
1184         * decl.c: Likewise.
1185         * error.c: Likewise.
1186         * parser.c: Likewise.
1187         * pt.c: Likewise.
1188         * search.c: Likewise.
1189         * typeck.c: Likewise.
1190
1191 2004-01-30  Richard Henderson  <rth@redhat.com>
1192
1193         PR c++/13693
1194         * method.c (use_thunk): Don't force_target_expr for void thunks.
1195         * tree.c (build_target_expr_with_type): Assert non-void type.
1196         (force_target_expr): Likewise.
1197
1198 2004-01-30  Michael Matz  <matz@suse.de>
1199
1200         * parser.c (cp_parser_labeled_statement): Accept case ranges.
1201
1202 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1203
1204         DR206
1205         PR c++/13813
1206         * decl.c (grokdeclarator): Check immediatly type completeness for
1207         non-dependent types.
1208
1209 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1210
1211         PR c++/13683
1212         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
1213         a sizeof expression.block
1214
1215 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
1216
1217         PR c++/13883
1218         * mangle.c (write_encoding): Correct encoding of member template
1219         constructors.
1220
1221 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1222
1223         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
1224         template name as it was `<::' (digraph typo).
1225         (cp_parser_nth_token_starts_template_argument_list_p): New function.
1226         (cp_parser_id_expression): Use it.
1227         (cp_parser_nested_name_specifier_opt): Likewise.
1228         (cp_parser_template_name): Likewise.
1229         (cp_parser_class_name): Likewise.
1230         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
1231
1232 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
1233
1234         PR c++/13791
1235         * typeck.c (merge_types): Do not merge attributes into
1236         TYPENAME_TYPEs.
1237
1238         PR c++/13736
1239         * parser.c (cp_parser_direct_declarator): Do not prevent
1240         backtracking inside a parenthesized declarator.
1241         (cp_parser_parameter_declaration): Fix typo in comment.
1242
1243 2004-01-28  Jan Hubicka  <jh@suse.cz>
1244
1245         * semantics.c (expand_body)  Do emit_associated_thunks before
1246         expansion.
1247
1248 2004-01-27  Devang Patel  <dpatel@apple.com>
1249
1250         * name-lookup.c: Include "debug.h"
1251         (do_namespace_alias): Invoke debug_hooks to emit debug info
1252         for namespace alias.
1253         (do_local_using_decl): Invoke debug_hooks to emit debug info
1254         for using decl.
1255         (do_class_using_decl): Same.
1256         (do_toplevel_using_decl): Same.
1257         (do_using_directive): Same.
1258         (cp_emit_debug_info_for_using): New function.
1259         * Make-lang.in (cp/parser.o): Depend on debug.h
1260         (cp/name-lookup.o): Same.
1261
1262 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1263
1264         * cp-tree.h (language_function, lang_type_header): Use
1265         BOOL_BITFIELD.
1266         * name-lookup.h (cp_binding_level): Likewise.
1267
1268 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
1269
1270         PR c++/13663
1271         * semantics.c (finish_for_expr): Check for unresolved overloaded
1272         functions.
1273
1274         * class.c (add_method): Just check processing_template_decl to
1275         determine whether or not we are within a template.
1276         * decl2.c (maybe_retrofit_in_chrg): Likewise.
1277         * init.c (decl_constant_value): Check the type of the declaration,
1278         not TREE_READONLY.
1279         * name-lookup.c (maybe_push_to_top_level): Rename to ...
1280         (push_to_top_level): ... this.
1281         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
1282         * pt.c (push_template_decl_real): Reorder condition for speed.
1283         (convert_template_argument): Use dependency-checking functions in
1284         place of uses_template_parms.
1285         (lookup_template_class): Avoid calling uses_template_parms more
1286         than once.
1287         (uses_template_parms): Reimplement, using dependency-checking
1288         functions.
1289         (instantiate_class_template): Use push_to_top_level, not
1290         maybe_push_to_top_level.
1291         (type_unification_real): Simplify.
1292         (type_dependent_expression_p): Handle OFFSET_REFs and
1293         TEMPLATE_DECLs.
1294         (any_dependent_template_arguments_p): Handle multiple levels of
1295         template argument.
1296         * semantics.c (expand_or_defer_fn): Do not check
1297         uses_template_parms for template instantiations.
1298         * typeck.c (comptypes): Avoid calling cp_type_quals.
1299
1300 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
1301
1302         PR c++/13833
1303         * call.c (build_over_call): Do not convert arguments when
1304         processing a template.
1305         * pt.c (build_non_dependent_expr): Do not build a
1306         NON_DEPENDENT_EXPR for arithmetic constants.
1307
1308 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1309
1310         PR c++/13810
1311         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
1312         returns a TYPE_DECL. no further lookup is required.
1313         * semantics.c (check_template_template_default_arg): A TYPE_DECL
1314         is invalid. Rework to give better diagnostics.
1315
1316 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1317
1318         PR c++/13797
1319         * pt.c (instantiate_class_template): Add an error_mark_node
1320         check.
1321         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
1322
1323 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
1324
1325         PR c++/13701
1326         * decl.c (finish_function): Move the call to
1327         finish_fname_decls below the call to
1328         finish_eh_spec_block.
1329
1330 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
1331
1332         * optimize.c, typeck2.c: Update copyright.
1333
1334 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
1335
1336         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
1337         init.c, mangle.c, typeck.c: Update copyright.
1338
1339 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
1340
1341         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
1342
1343 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
1344
1345         * Make-lang.in: Replace $(docdir) with doc.
1346         (c++.info, c++.srcinfo): Dummy entry.
1347         (c++.man, c++.srcman): New rules.
1348         (c++.install-man): Revamp rule.
1349
1350 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
1351
1352         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
1353         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
1354         immediate $(shell) instead of deferred backquote.
1355
1356 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
1357
1358         PR c++/13651
1359         * parser.c (cp_parser_postfix_expression): When encountering
1360         incomplete type on left-hand side of "->" or ".", treat the entire
1361         expression as erroneous.
1362
1363         PR c++/13592
1364         * call.c (build_field_call): Remove.
1365         (n_build_method_call): Likewise.
1366         (build_method_call): Likewise.
1367         (build_new_method_call): Do not call build_field_call.
1368         * class.c (n_build_method_call): Remove.
1369         (print_class_statistics): Do not print it.
1370         * cp-tree.h (build_method_call): Remove declaration.
1371         (finish_object_call_expr): Likewise.
1372         (build_new_1): Do not use build_method_call.
1373         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
1374         when the function appearing on the right-hand-side of "." or "->"
1375         is not actually a function.
1376         * pt.c (tsubst_copy_and_build): Likewise.
1377         * semantics.c (finish_object_call_expr): Remove.
1378
1379 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
1380
1381         PR c++/13710
1382         * pt.c (tsubst): Use finish_typeof.
1383
1384 2004-01-18  Jason Merrill  <jason@redhat.com>
1385
1386         PR c++/11725
1387         * except.c (build_throw): In a template, set
1388         current_function_returns_abnormally.
1389
1390 2004-01-17  Fred Fish  <fnf@intrinsity.com>
1391
1392         PR c++/11895
1393         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
1394         except don't call array_type_nelts() with a VECTOR_TYPE.
1395
1396 2004-01-16  Jan Hubicka  <jh@suse.cz>
1397
1398         * mangle.c (write_mangled_name): Remove inline modifier.
1399
1400 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
1401
1402         PR c++/13574
1403         * decl.c (compute_array_index_type): Fix grammar in comment.
1404         * init.c (build_zero_init): Handle zero-sized arrays correctly.
1405
1406         PR c++/13178
1407         * call.c (name_as_c_string): Print conversion operator names
1408         correctly.
1409
1410         PR c++/13478
1411         * call.c (initialize_reference): Pass -1 for inner parameter to
1412         convert_like_real.
1413
1414 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1415
1416         PR c++/13407
1417         * parser.c (cp_parser_base_specifier): Check for an invalid
1418         keyword `typename' and emit an user-friendly error message.
1419
1420 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
1421
1422         PR pch/13361
1423         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
1424         (handle_pragma_implementation): Likewise.
1425
1426 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1427
1428         PR c++/9259
1429         * typeck.c (build_class_member_access_expr): Allow to access members
1430         of the currently open class.
1431         (finish_class_member_access_expr): Likewise.
1432
1433 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
1434
1435         PR c++/13659
1436         * name-lookup.c (validate_nonmember_using_decl): Take scope and
1437         name by value, instead of computing them.
1438         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
1439         arguments.  Pass them to validate_nonmember_using_decl.
1440         * name-lookup.h (do_local_using_decl): Adjust.
1441         (do_toplevel_using_decl): Likewise.
1442         * parser.c (cp_parser_using_declaration): Likewise.
1443         * pt.c (tsubst_expr): Likewise.
1444
1445 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
1446
1447         PR c++/13594
1448         PR c++/13658
1449         * name-lookup.c (qualified_lookup_using_namespace): Search
1450         strongly-associated namespaces first, and only then try other
1451         namespaces.
1452
1453 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
1454
1455         * Make-lang.in (c++.srcextra): Dummy entry.
1456
1457 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1458
1459         PR c++/8856
1460         * parser.c (cp_parser_template_name): Don't try to parse a
1461         conversion-function-id, as it cannot be a template-name.
1462         (cp_parser_simple_type_specifier): Check for invalid template-ids
1463         even after a built-in type.
1464
1465 2004-01-14  Jan Hubicka  <jh@suse.cz>
1466
1467         PR c++/12850
1468         * pt.c (instantiate_decl):  Do not increase function_depth.
1469
1470 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
1471
1472         PR c++/9021
1473         PR c++/11005
1474         * parser.c (cp_parser_elaborated_type_specifier): Warn about
1475         attributes and discard.
1476         * decl.c (xref_tag): Don't overwite existing attributes with
1477         NULL_TREE.
1478
1479 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1480
1481         PR c++/12335
1482         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
1483         is no destructor while looking up a BIT_NOT_EXPR.
1484
1485 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
1486
1487         * cxxfilt.c: Remove unused file.
1488
1489 2004-01-14  Jan Hubicka  <jh@suse.cz>
1490
1491         Partial fix to PR c++/12850
1492         * decl2.c (mark_used): Do not proactively instantiate templates
1493         when compiling in unit-at-a-time or not optimizing.
1494         * optimize.c (maybe_clone_body): Do not increase function depth.
1495
1496 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1497
1498         PR c++/13474
1499         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
1500
1501 2003-01-12  Steven Bosscher  <stevenb@suse.de>
1502
1503         PR c++/13558
1504         * parser.c (cp_parser_member_declaration): Any non-type is also
1505         not a class or a function.
1506
1507 2004-01-12  Jason Merrill  <jason@redhat.com>
1508
1509         PR c++/12815
1510         * class.c (build_base_path): Do not mark vtable references as
1511         TREE_CONSTANT.
1512         (build_vtbl_ref_1): Likewise.
1513
1514 2004-01-12  Richard Henderson  <rth@redhat.com>
1515
1516         PR opt/10776
1517         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
1518         (store_init_value): Use it.
1519         * decl.c (check_initializer): Expect full initialization code
1520         from store_init_value.
1521         * init.c (expand_aggr_init_1): Likewise.
1522         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
1523
1524 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
1525
1526         * class.c (layout_class_type): For non-POD class types, also copy
1527         the DECL_SIZE and DECL_MODE of fields to the base class type.
1528
1529 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1530
1531         PR c++/13289
1532         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
1533         calling regenerate_decl_from_template.
1534
1535 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
1536
1537         PR c++/4100
1538         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
1539         decl-specifier occurring along with a class definition.
1540
1541 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
1542
1543         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
1544         clauses to comments describing declares_class_or_enum.
1545         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
1546         false.
1547
1548 2004-01-12  Jan Hubicka  <jh@suse.cz>
1549
1550         * pt.c (for_each_template_parm): Do not check for duplicates.
1551         (for_each_template_parm): Use walk_tree duplicate checking code.
1552
1553 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
1554
1555         PR c++/3478
1556         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
1557         is error_mark_node, don't add any more decl_specs.
1558         (cp_parser_init_declarator): After committing to a declaration, if
1559         the decl_specifiers start with error_mark_node, issue an error and
1560         change the type to "int".
1561
1562 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
1563
1564         PR bootstrap/7817
1565         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
1566
1567 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1568
1569         DR 337
1570         PR c++/9256
1571         * pt.c (tsubst): Substitution must fail if we are attempting to
1572         create an array with element type that is an abstract class type.
1573         * decl.c (cp_finish_decl): Strip pointers and array types recursively
1574         before calling abstract_virtuals_error.
1575
1576 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
1577
1578         * name-lookup.c (qualified_lookup_using_namespace): Consider
1579         strong using directives even if we've already found a binding.
1580
1581 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
1582
1583         * cp-tree.h (cxx_expand_expr): Change prototype.
1584         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
1585
1586 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1587
1588         PR c++/12573
1589         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
1590         looking into them recursively. They can be there because of the
1591         new __offsetof__ extension.
1592
1593 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
1594
1595         * parser.c (cp_parser_save_member_function_body): Mark the
1596         definition static.
1597
1598 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
1599
1600         PR c++/13057
1601         * class.c (build_clone): Copy type attributes from the original
1602         function to the clone.
1603
1604         PR c++/12815
1605         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
1606         references as constant.
1607
1608         PR c++/12132
1609         * parser.c (cp_parser_explicit_instantiation): Improve error
1610         recovery.
1611         (cp_parser_require): Improve indication of the error location.
1612
1613         PR c++/13451
1614         * parser.c (cp_parser_class_head): Reorder logic to check for
1615         invalid qualification.
1616
1617 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
1618
1619         PR c++/13157
1620         * name-lookup.c (lookup_using_namespace): Remove spacesp
1621         parameter.
1622         (unqualified_namespace_lookup): Likewise.
1623         (lookup_qualified_name): Adjust accordingly.
1624         (lookup_name_real): Likewise.
1625         (lookup_arg_dependent): Do not eliminate the namespace of the
1626         functions found by unqualified name lookup unless that is the
1627         current namespace.
1628
1629 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
1630
1631         * semantics.c (push_deferring_access_checks): Fix format.
1632         (resume_deferring_access_checks): Likewise.
1633         (stop_deferring_access_checks): Likewise.
1634         (pop_deferring_access_checks): Likewise.
1635         (get_deferred_access_checks): Likewise.
1636         (pop_to_parent_deferring_access_checks): Likewise.
1637         (perform_deferred_access_checks): Likewise.
1638         (perform_or_defer_access_check): Likewise.
1639
1640 2004-01-04  Richard Henderson  <rth@redhat.com>
1641
1642         * call.c (build_over_call): Don't create a save_expr of an
1643         aggregate, but rather its address.
1644
1645 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
1646
1647         PR c++/13529
1648         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
1649         an offsetof expression.
1650
1651         * parser.c (cp_parser_parameter_declaration): Fix comment.
1652
1653         PR c++/12226
1654         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
1655         (reference_binding): Set it when appropriate.
1656         (build_temp): New function, split out from ...
1657         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
1658         (initialize_reference): Likewise.
1659
1660         PR c++/13536
1661         * parser.c (cp_parser): Add in_type_id_in_expr_p.
1662         (cp_parser_new): Initialize it.
1663         (cp_parser_postfix_expression): Set it.
1664         (cp_parser_sizeof_operand): Likewise.
1665         (cp_parser_parameteR_declaration): Do not commit early to tenative
1666         parsers when in_type_id_in_expr_p is set.
1667
1668 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1669
1670         PR c++/13094
1671         * parser.c (cp_parser_template_argument): Don't call
1672         make_unbound_class_template directly.
1673         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
1674         UNBOUND_CLASS_TEMPLATE tree node.
1675
1676 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
1677
1678         PR target/12729
1679         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
1680
1681 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1682
1683         PR c++/13520
1684         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
1685         (DECL_FUNCTION_TEMPLATE_P): Use it.
1686         (DECL_CLASS_TEMPLATE_P): Likewise.
1687         * parser.c (cp_parser_lookup_name): Add is_template parameter.
1688         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
1689         (cp_parser_template_name): Likewise.
1690         (cp_parser_elaborated_type_specifier): Likewise.
1691         (cp_parser_namespace_name): Likewise.
1692         (cp_parser_class_name): Likewise.
1693         (cp_parser_lookup_name_simple): Likewise.
1694
1695 See ChangeLog.3 for earlier changes.