OSDN Git Service

PR c++/19044
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2004-12-20  Matt Austern <austern@apple.com>
2
3         PR c++/19044
4         * decl.c (make_rtl_for_nonlocal_decl): Use set_builtin_user_assembler_name
5         
6 2004-12-19  Mark Mitchell  <mark@codesourcery.com>
7
8         * cp-tree.h (note_decl_for_pch): New function.
9         * class.c (build_clone): Call note_decl_for_pch.
10         * semantics.c (finish_member_declaration): Likewise.
11         (note_decl_for_pch): New function.
12
13 2004-12-17  Steven Bosscher  <stevenb@suse.de>
14
15         * init.c (build_zero_init): max_index is the number of
16         elements, minus 1.
17
18 2004-12-17  Nathan Sidwell  <nathan@codesourcery.com>
19
20         PR c++/18721
21         * class.c (add_method): Do not push conversion operators into a
22         binding level.
23
24         * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE_TYPE): Reformat.
25         * error.c (dump_decl): <TYPE_DECL case> Remove extraneous braces.
26
27 2004-12-16  Nathan Sidwell  <nathan@codesourcery.com>
28
29         PR c++/18905
30         * cp-tree.h (integral_constant_value): Declare.
31         * call.c (null_ptr_cst_p): Use integral_constant_value, not
32         decl_constant_value.
33         (convert_like_real): Likewise.
34         * class.c (check_bitfield_decl): Likewise.
35         * cvt.c (ocp_convert): Likewise.
36         (convert): Remove unnecessary decl_constant_value call.
37         * decl.c (compute_array_index_type): Use integral_constant_value,
38         not decl_constant_value.
39         (build_enumerator): Likewise.
40         * decl2.c (grokfield): Likewise.
41         * init.c (decl_constant_value): Simplify.
42         (integral_constant_value): New.
43         * pt.c (fold_decl_constant_value): Use integral_constant_value,
44         remove subsequent check.
45         (tsubst): Use integral_constant_value, not decl_constant_value.
46         (tsubst_copy, unify): Likewise.
47         * typeck.c (decay_conversion): Likewise.
48         (build_compound_expr): Remove unnecessary decl_constant_value
49         calls.
50         (build_static_cast_1, build_reinterpret_cast_1):
51         (convert_for_assignment): Remove comment about not calling
52         decl_constant_value.
53
54 2004-12-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
55
56         PR c++/18825
57         * pt.c (instantiate_class_template): Set input_location for
58         friend function.
59         (tsubst_friend_function): Don't set input_location here.
60         Make sure the context is complete if necessary.
61
62 2004-12-15  Nathan Sidwell  <nathan@codesourcery.com>
63
64         PR c++/18981
65         * parser.c (cp_parser_lookup_name): Remove unneeded TYPENAME_TYPE
66         flag setting.
67
68 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
69
70         PR c++/18738
71         * decl.c (make_typename_type): Do not handle namespace-scoped
72         names here.
73         (tag_name): Handle typename_type.
74         (check_elaborated_type_specifier): Handle typenames.
75         * parser.c (cp_parser_diagnose_invalid_type_name): Improve
76         comment.
77         (cp_parser_elaborated_type_specifier): Use
78         cp_parser_diagnose_invalid_type_name.
79
80 2004-12-14  Andrew Pinski  <pinskia@physics.uc.edu>
81
82         PR c++/18965
83         * init.c (build_zero_init): If the max_index is 0, there is no
84         need to create a RANGE_EXPR.
85
86 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
87
88         PR c++/18793
89         * cp-objcp-common.c (cp_expr_size): Loosen assertion.
90
91 2004-12-14  Nathan Sidwell  <nathan@codesourcery.com>
92
93         PR c++/18949
94         * pt.c (tsubst_copy_and_build): <INDIRECT_REF case> Check that a
95         REFERENCE_REF_P is dereferencing a reference type.
96         * typeck.c (build_static_cast): Convert from reference even in a
97         template.
98         (build_reinterpret_cast, build_const_cast, build_c_cast): Likewise.
99
100 2004-12-14  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
101
102         * parser.c (cp_parser_uncommitted_to_tentative_parse_p): New function.
103         (cp_parser_name_lookup_error): Use it.
104         (cp_parser_check_for_invalid_template_id): Likewise.
105         (cp_parser_skip_to_closing_parenthesis): Likewise.
106         (cp_parser_nested_name_specifier_opt): Likewise.
107         (cp_parser_simple_declaration, cp_parser_template_id): Likewise.
108         (cp_parser_parameter_declaration_list): Likewise.
109         (cp_parser_parameter_declaration): Likewise.
110         (cp_parser_template_name): Let cp_parser_simulate_error perform
111         the checking.
112         (cp_parser_committed_to_tentative_parse): Remove.
113
114 2004-12-13  Andrew Pinski  <pinskia@physics.uc.edu>
115
116         PR c++/18968
117         * class.c (build_base_path): Convert the zero constant to the correct
118         type when comparing.
119
120 2004-12-13  Mark Mitchell  <mark@codesourcery.com>
121
122         PR c++/18925
123         * class.c (layout_class_type): Determine the visibility of static
124         data members.
125
126 2004-12-12  Roger Sayle  <roger@eyesopen.com>
127
128         PR middle-end/12454
129         * cp-gimplify.c (gimplify_if_stmt): Optimize the case where the
130         condition is a constant and the unexecuted clause is empty.
131
132 2004-12-10  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
133
134         PR c++/18731
135         * parser.c (cp_parser_class_head): Reject typedef-name in class head.
136
137 2004-12-09  Matt Austern  <austern@apple.com>
138
139         PR c++/18514
140         * name-lookup.c (do_nonmember_using_decl): A real function
141         declaration takes precedence over an anticipated declaration.
142         
143 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
144
145         * parser.c (cp_parser_member_declaration): Fix comment typo.
146
147 2004-12-09  Alexandre Oliva  <aoliva@redhat.com>
148
149         PR c++/18757
150         * parser.c (cp_parser_template_id): Don't create a CPP_TEMPLATE_ID
151         if parsing failed.
152
153 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
154
155         PR c++/18073
156         * typeck.c (build_reinterpret_cast_1): Allow cast from vector type.
157
158 2004-12-09  Nathan Sidwell  <nathan@codesourcery.com>
159
160         PR c++/16681
161         * init.c (build_zero_init): Build a RANGE_EXPR for an array
162         initializer.
163
164 2004-12-08  Kelley Cook  <kcook@gcc.gnu.org>
165
166         * typeck.c: Remove DOS line endings.
167
168 2004-12-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
169
170         PR c++/18100
171         * decl.c (lookup_and_check_tag): Diagnose nested class with 
172         the same name as enclosing class.
173
174 2004-12-08  Nathan Sidwell  <nathan@codesourcery.com>
175
176         PR c++/18803
177         * cp-tree.h (REFERENCE_REF_P): New.
178         (CPTI_TYPE_INFO_TYPE): Rename to ...
179         (CPTI_CONST_TYPE_INFO_TYPE): ... here.
180         (CPTI_TYPE_INFO_REF_TYPE): Remove.
181         (type_info_type_node): Rename to ...
182         (const_type_info_type_node): ... here.
183         (type_info_ref_type): Remove.
184         * call.c (build_user_type_conversion): Reformat.
185         (resolve_args): Do not convert_from_reference.
186         (build_object_call): Call convert_from_reference.
187         (prep_operand): Do not convert_from_reference.
188         (build_new_method_call): Likewise.
189         * class.c (build_vfield_ref): Likewise.
190         * cvt.c (convert_to_reference): Likewise.
191         (convert_from_reference): Build INDIRECT_REF here, not with
192         build_indirect_ref.
193         (convert_force): Do not convert_from_reference.
194         (build_expr_type_conversion): Likewise.
195         * decl.c (grok_reference_init): Likewise.
196         * decl2.c (delete_sanity): Likewise.
197         * except.c (initialize_handler_parm): Use POINTER_TYPE_P.
198         * init.c (build_dtor_call): Do not convert_from_reference.
199         * parser.c (cp_parser_template_argument): Unwrap indirected
200         reference. Allow TEMPLATE_PARM_INDEX as an object parm.
201         * pt.c (tsubst_copy_and_build) <case INDIRECT_REF>: Use
202         convert_from_reference, if indicated.
203         <case CALL_EXPR>: Do not convert_from_reference.
204         <case PARM_DECL, VAR_DECL>: Convert_from_reference if needed.
205         (tsubst_initializer_list): Do not convert_from_reference.
206         * rtti.c (init_rtti_processing): Adjust node creation.
207         (throw_bad_typeid): Use const_type_info_type_node.
208         Do not convert_from_reference.
209         (typeid_ok_p): Use const_type_info_type_node.
210         (build_typeid, get_typeid): Always return type_info typed node.
211         (build_dynamic_cast_1): Dont convert_from_reference. Refactor.
212         * semantics.c (finish_stmt_expr_expr): Do not
213         convert_from_reference.
214         (finish_id_expression): Convert_from_reference as appropriate.
215         * typeck.c (decay_conversion): Do not convert_from_reference.
216         (finish_class_member_access_expr): Likewise.
217         (build_indirect_ref): Use POINTER_TYPE_P.
218         (convert_arguments): Do not convert_from_reference.
219         (build_modify_expr): Likewise.
220         (convert_for_initialization): Likewise.
221         * typeck2.c (build_x_arrow): Likewise.
222
223 2004-12-07  Ziemowit Laski  <zlaski@apple.com>
224
225         * cp-tree.h (struct lang_type_class): Rename 'objc_protocols'
226         field to 'objc_info'.
227
228 2004-12-07  Kazu Hirata  <kazu@cs.umass.edu>
229
230         * pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH.
231
232 2004-12-07  Roger Sayle  <roger@eyesopen.com>
233
234         * name-lookup.c (leave_scope): We only need to update
235         class_binding_level when leaving a class scope.
236
237 2004-12-06  Ziemowit Laski  <zlaski@apple.com>
238
239         * cp-tree.h (struct lang_type_class): Add 'objc_protocols' field.
240
241 2004-12-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
242
243         PR c++/17011, c++/17971
244         * pt.c (tsubst_copy) <FIELD_DECL case>: Check and diagnose
245         invalid field.
246         (tsubst_copy_and_build) <COMPONENT_REF case>: Check
247         error_mark_node after member substitution.
248         * semantics.c (finish_id_expression): Call
249         finish_non_static_data_member for non-dependent FIELD_DECL.
250
251 2004-12-03  Nathan Sidwell  <nathan@codesourcery.com>
252
253         PR c++/18782
254         * decl.c (grokdeclarator): Make sure class in pointer to member is
255         not a namespace.
256
257 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
258
259         PR c++/18318
260         * parser.c (cp_parser_new_type_id): Move array size expression
261         checks from here ...
262         * init.c (build_new): ... to here.
263
264 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
265
266         PR c++/18758
267         * parser.c (cp_parser_class_head): Return NULL_TREE when
268         push_template_decl fails.  Update comment.
269
270 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
271
272         PR c++/15664, c++/18276
273         * pt.c (tsubst_decl) <TEMPLATE_DECL case>: Reorganize.  Correctly
274         tsubst TEMPLATE_DECL that is a TEMPLATE_TEMPLATE_PARM.
275
276 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
277
278         PR c++/18123
279         * parser.c (cp_parser_type_specifier): Catch template declaration
280         of enum.
281
282 2004-12-01  Matt Austern  <austern@apple.com>
283
284         * name-lookup.c (namespace_binding): Omit alias check for global
285         namespace.
286
287 2004-12-01  Nathan Sidwell  <nathan@codesourcery.com>
288
289         PR c++/18729
290         * parser.c (cp_parser_class_name): Check decl's type is not
291         error_mark_node.
292
293         PR c++/17431
294         * call.c (standard_conversion): Add FLAGS parameter. Do not allow
295         derived to base conversion when checking constructor
296         accessibility.
297         (implicit_conversion): Pass FLAGS to standard_conversion.
298         (check_constructir_callable): Disallow conversion functions.
299
300 2004-11-30  Kazu Hirata  <kazu@cs.umass.edu>
301
302         * parser.c: Fix comment typos.
303
304 2004-11-27  Mark Mitchell  <mark@codesourcery.com>
305
306         PR c++/18368
307         * parser.c (cp_parser_check_for_definition_in_return_type): Take
308         the defined type as a parameter, and inform the user about the
309         possibility of a missing semicolon.
310         (cp_parser_explicit_instantiation): Adjust call to
311         cp_parser_check_for_definition_in_return_type.
312         (cp_parser_init_declarator): Likewise.
313         (cp_parser_member_declaration): Likewise.
314
315         PR c++/18674
316         * cp-tree.def (TYPENAME_TYPE): Remove discussion of implicit
317         typename from comments.
318         * cp-tree.h (TYPENAME_IS_ENUM_P): New macro.
319         (TYPENAME_IS_CLASS_P): Likewise.
320         (make_typename_type): Change prototype.
321         * decl.c (struct_typename_info): New type.
322         (typename_compare): Expect the second argument to be a
323         typename_info, not a tree.
324         (build_typename_type): Add tag_type parameter.  Do not create a
325         new type until necessary.
326         (make_typename_type): Add tag_type parameter.
327         * error.c (TYPENAME_TYPE): Print tags other than "typename" if
328         appropriate.
329         * friend.c (make_friend_class): Adjust call to make_typename_type.
330         * parser.c (cp_parser_make_typename_type): Likewise.
331         (cp_parser_primary_expression): Adjust call to
332         cp_parser_lookup_name.
333         (cp_parser_unqualified_id): Adjust calls to cp_parser_class_name.
334         (cp_parser_class_or_namespace_name): Likewise.
335         (cp_parser_postfix_expression): Adjust calls to
336         make_typename_type.
337         (cp_parser_mem_initializer_id): Adjust calls to
338         cp_parser_class_name.
339         (cp_parser_type_parameter): Adjust calls to cp_parser_lookup_name.
340         (cp_parser_template_name): Likewise.
341         (cp_parser_template_argument): Likewise.
342         (cp_parser_type_name): Adjust call to cp_parser_class_name.
343         (cp_parser_elaborated_type_specifier): Adjust calls to
344         make_typename_type and cp_parser_lookup_name.
345         (cp_parser_namespace_name): Likewise.
346         (cp_parser_class_name): Replace type_p parameter with tag_type.
347         Adjust calls to make_typename_type and cp_parser_lookup_name.
348         (cp_parser_class_head): Adjust calls to cp_parser_class_name.
349         (cp_parser_base_specifier): Likewise.
350         (cp_parser_lookup_name): Replace is_type parameter with tag_type.
351         Adjust calls to make_typename_type and lookup_qualified_name.
352         (cp_parser_lookup_name_simple): Adjust call to
353         cp_parser_lookup_name.
354         (cp_parser_constructor_declarator_p): Adjust call to
355         cp_parser_class_name.
356         * pt.c (convert_template_argument): Adjust all to
357         make_typename_type.
358         (tsubst_decl): Do not pre-substitute the type of the declaration.
359         (tsubst): Hand off declarations more quickly.  Adjust call to
360         make_typename_type. 
361
362         PR c++/18512
363         * parser.c (cp_parser_postfix_dot_deref_expression): Robustify.
364
365 2004-11-29  Daniel Jacobowitz  <dan@codesourcery.com>
366
367         PR c/7544
368         * Make-lang.in (cp/decl2.o): Update dependencies.
369         * decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks.
370
371 2004-11-29  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
372
373         PR c++/18652
374         * name-lookup.c (pushtag): Change return type to tree.
375         * cp-tree.h (pushtag): Adjust declaration.
376         * decl.c (xref_tag, start_enum): Use return value of pushtag.
377         * pt.c (push_template_decl_real): Return immediately if
378         pushdecl_namespace_level returns error_mark_node.
379
380 2004-11-27  Kazu Hirata  <kazu@cs.umass.edu>
381
382         * pt.c: Fix a comment typo.
383
384 2004-11-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
385
386         Friend class name lookup 4/n
387         * class.c (pushclass): Don't call cxx_remember_type_decls.
388         * cp-tree.h (clear_anon_tags): Remove declaration.
389         * decl.c (grokdeclarator): Don't call lookup_tag_reverse.
390         * name-lookup.c (binding_entry_free, binding_table_free): Comment
391         out functions.
392         (binding_table_find_anon_type, binding_table_reverse_maybe_remap,
393         binding_table_remove_anonymous_types, cxx_remember_type_decls,
394         bt_print_entry, clear_anon_tags, follow_tag_typedef, lookup_tag,
395         lookup_tag_reverse): Remove
396         (begin_scope, leave_scope, kept_level_p, print_binding_level):
397         Don't use type_decls field in cp_binding_level.
398         (maybe_process_template_type_declaration, pushtag): Set
399         CLASSTYPE_NESTED_UTDS directly.
400         * name-lookup.h (binding_table_remove_anonymous_types,
401         cxx_remember_type_decls, lookup_tag, lookup_tag_reverse): Remove
402         declaration.
403         (cp_binding_level): Remove type_decls field.
404
405 2004-11-26  Kazu Hirata  <kazu@cs.umass.edu>
406
407         * typeck.c: Fix a comment typo.
408
409 2004-11-25  Mark Mitchell  <mark@codesourcery.com>
410
411         PR c++/18445
412         * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with
413         unknown_type as non matching.  Tidy up.
414         * pt.c (build_non_dependent_expr): Do not build a
415         NON_DEPENDENT_EXPR for a VAR_DECL.
416
417         PR c++/18001
418         * cp-tree.h (lvalue_or_else): Remove declaration.
419         * tree.c (lvalue_or_else): Remove.
420         * typeck.c (build_unary_op): Adjust call to lvalue_or_else.
421         (build_modify_expr): Likewise.
422
423         PR c++/18625
424         * decl.c (duplicate_decls): Return error_mark_node on error, as
425         specified.
426
427         PR c++/18466
428         * decl.c (grokvardecl): Keep track of whether or not a there was
429         explicit qualification.
430         * name-lookup.c (set_decl_namespace): Complain about explicit
431         qualification of a name within its own namespace.
432
433         PR c++/18545
434         * typeck.c (check_return_expr): Robustify.
435
436 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
437
438         Friend class name lookup 3/n, PR c++/3332
439         * name-lookup.c (push_inner_scope, pop_inner_scope): New functions.
440         (lookup_type_scope): Don't deal with name from user declaration
441         specially.
442         * name-lookup.h (push_inner_scope, pop_inner_scope): Add declarations.
443         * parser.c (cp_parser_class_specifier): Use push_inner_scope and
444         pop_inner_scope.
445
446 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
447
448         Friend class name lookup 2/n, PR c++/14513, c++/15410
449         * name-lookup.c (lookup_name_real): Simplify.
450         (lookup_type_scope): Add SCOPE parameter.  Handle friend class
451         lookup.
452         * name-lookup.h (tag_scope): New enum type.
453         (lookup_type_scope): Adjust declaration.
454         * decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type):
455         Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE.
456         (start_enum): Likewise.  Add assertion test that NAME is 
457         IDENTIFIER_NODE.  Use anonymous name for dummy ENUMERAL_TYPE in
458         case of error.
459         * cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations.
460         * parser.c (cp_parser_elaborated_type_specifier,
461         cp_parser_class_head): Adjust call to xref_tag.
462         * pt.c (lookup_template_class, instantiate_class_template):
463         Likewise.
464         * rtti.c (init_rtti_processing, build_dynamic_cast_1,
465         tinfo_base_init, emit_support_tinfos): Likewise.
466
467 2004-11-25  Joseph S. Myers  <joseph@codesourcery.com>
468
469         * g++spec.c, lex.c: Avoid ` as left quote in diagnostics.
470
471 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
472
473         PR c++/17473
474         * name-lookup.c (supplement_binding): Do not allow typedefs to be
475         redefined in class scope.
476
477         PR c++/18285
478         * parser.c (cp_parser_set_decl_type_spec): Do not try to allow
479         redefinitions of builtin types other that "bool" or "wchar_t".
480
481 2004-11-24  Steven Bosscher  <stevenb@suse.de>
482
483         * decl.c (cxx_init_decl_processing): Don't clear
484         flag_inline_functions.
485
486 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
487
488         * pt.c (tsubst_function_type): Do not permit function types which
489         return arrays or functions.
490
491         PR c++/18586
492         * parser.c (cp_parser_init_declarator): Do not pop scope twice.
493
494         PR c++/18530
495         * cp-tree.h (CTOR_NAME): Remove.
496         (DTOR_NAME): Remove.
497         * decl.c (initialize_predefined_identifiers): Add spaces to the
498         end of constructor and destructor names.
499
500 2004-11-24  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
501
502         PR c++/8929
503         * decl.c (start_decl): Check for invalid specialization headers.
504
505 2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
506
507         PR c++/16882
508
509         * call.c (standard_conversion): Move check for conversions between
510         vector pointers...
511         * typeck.c (ptr_reasonably_similar): ... here.
512
513 2004-11-23  Ben Elliston  <bje@au.ibm.com>
514
515         * cp-tree.h (context_as_string): Remove extern.
516         * error.c (context_as_string): Remove.
517
518         * cp-tree.h (cp_type_qual_from_rid): Remove extern.
519         * lex.c (cp_type_qual_from_rid): Remove.
520
521         * cp-tree.h (do_poplevel): Remove extern.
522         (check_multiple_declarators): Likewise.
523         * semantics.c (do_poplevel): Make static.
524         (check_multiple_declarators): Remove.
525
526         * cp-tree.h (check_final_overrider): Remove extern.
527         * search.c (check_final_overrider): Make static.
528
529         * cp-tree.h (build_artificial_parm): Remove extern.
530         * decl2.c (build_artificial_parm): Make static.
531
532 2004-11-22  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
533
534         PR c++/18354
535         * typeck.c (build_unary_op) <CONVERT_EXPR, NEGATE_EXPR>: Unify code.
536         Make sure the result is always a rvalue.
537
538 2004-11-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
539
540         * decl.c (start_preparsed_function): Call check_function_type even
541         in templates.
542         (require_complete_types_for_parms): Skip dependent types.
543         (check_function_type): Likewise.
544
545 2004-11-16  Steven Bosscher  <stevenb@suse.de>
546
547         * Make-lang.in (cp/decl.o, cp/search.o): Don't depend on stack.h.
548         * search.c: Don't include it.
549
550 2004-11-15  Andrew Pinski  <pinskia@physics.uc.edu>
551
552         * cp-gimplify.c: Include pointer-set.h
553         (cp_genericize_r): Use pointer_sets instead of a hashtable.
554         Also instert the new statement for CLEANUP_STMT.
555         (cp_genericize): Use pointer_sets instead of a hashtable.
556         * Make-lang.in (cp-gimplify.o): Depend on pointer-set.h.
557
558 2004-11-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
559
560         Friend class name lookup 1/n, PR c++/18471
561         * decl.c (lookup_and_check_tag): New function.
562         (xref_tag, start_enum): Use it.
563         (check_elaborated_type_specifier): Move TEMPLATE_TYPE_PARM check
564         before !DECL_IMPLICIT_TYPEDEF_P.  Also display previously declared
565         location.
566         * name-lookup.c (lookup_name_current_level): Rename to ...
567         (lookup_name_innermost_nonclass_level): ... this.
568         (lookup_type_scope): New function.
569         * name-lookup.h (lookup_name_current_level): Rename to ...
570         (lookup_name_innermost_nonclass_level): ... this.
571         (lookup_type_scope): Add declaration.
572
573 2004-11-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
574
575         PR c++/17344
576         * pt.c (coerce_template_parms): Only emit error message about
577         invalid template argument when TF_ERROR.
578
579 2004-11-12  Mark Mitchell  <mark@codesourcery.com>
580
581         PR c++/18389
582         * decl.c (start_decl): Make sure to set *pop_scope_p.  Return
583         error_mark_node to indicate errors.
584
585         PR c++/18429
586         * parser.c (cp_parser_direct_declarator): Disallow non-constant
587         array bounds when not inside a function.
588
589         PR c++/18436
590         * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an
591         unqualified name resolves to a member function.
592
593         PR c++/18407
594         * pt.c (tsubst_copy_and_build): Handle qualified names used from a
595         derived class correctly.
596         
597         * decl2.c (import_export_decl): Fix typo in comment.
598         * tree.c (pod_type_p): Likewise.
599
600 2004-11-10  Andrew Pinski  <pinskia@physics.uc.edu>
601
602         * typeck.c (cxx_mark_addressable): Add braces around the first if.
603
604 2004-11-10  Adam Nemet  <anemet@lnxw.com>
605
606         PR middle-end/18160  
607         * typeck.c (cxx_mark_addressable): Issue an error if address of an
608         explicit register variable is requested.
609
610 2004-11-10  Nathan Sidwell  <nathan@codesourcery.com>
611
612         PR c++/18143
613         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK): New.
614         (struct lang_decl_flags): Add thunk_p flag.
615         (struct lang_decl): Remove separate fixed_offset. Place
616         cloned_function and fixed_offset into union.
617         (DECL_CLONED_FUNCTION_P, DECL_CLONED_FUNCTION): Adjust.
618         (DECL_THUNK_P, SET_DECL_THUNK_P): Adjust.
619         (THUNK_FIXED_OFFSET): Adjust.
620         * method.c (make_thunk): Adjust.
621
622 2004-11-09  Mark Mitchell  <mark@codesourcery.com>
623
624         PR c++/18369
625         * init.c (build_new_1): Handle parenthesized type-ids that name an
626         array type.  Tidy.
627
628 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
629
630         * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
631         pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
632         quoting in diagnostics.
633         * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
634         quoting in printf format.
635         * decl.c (duplicate_decls, start_decl): Use %qD instead of
636         unquoted %D.
637
638 2004-11-08  Kazu Hirata  <kazu@cs.umass.edu>
639
640         * class.c, decl.c, lex.c, name-lookup.c, parser.c, pt.c,
641         search.c, typeck2.c: Fix comment formatting.
642
643 2004-11-04  Ulrich Weigand  <uweigand@de.ibm.com>
644         
645         PR tree-optimization/18184
646         * cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers
647         of different modes or alias-all flags as equivalent.
648         * typeck.c (comptypes): Likewise.
649
650 2004-11-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
651
652         DR 49, 100
653         * cp-tree.h (TYPE_REF_OBJ_P): New macro.
654         (TYPE_PTR_P, TYPE_PTROB_P, TYPE_PTROBV_P, TYPE_PTRFN_P,
655         TYPE_REFFN_P): Document.
656         (fold_decl_constant_value): New prototype.
657         * pt.c (convert_nontype_argument_function): Rewrite and extract
658         parts into...
659         (fold_decl_constant_value, convert_nontype_argument_function): New.
660         (lookup_template_class): Add comment about useless double call.
661         * mangle.c (write_expression): Strip conversions before lowering
662         pointer to members.
663         * cvt.c (ocp_convert): Check LOOKUP_COMPLAIN for a pedwarn. Disallow
664         enum to enum conversion.
665
666 2004-11-02  Mark Mitchell  <mark@codesourcery.com>
667
668         PR c++/18124
669         * parser.c (cp_parser_type_parameter): Robustify.
670
671         PR c++/18155
672         * parser.c (cp_parser_single_declaration): Disallow template
673         typedefs.
674
675         PR c++/18177
676         * typeck.c (build_const_cast): Use error_operand_p.
677
678 2004-11-02  Ziemowit Laski  <zlaski@apple.com>
679
680         * cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
681         (LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
682         * cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
683         from cp-lang.c.
684         * cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
685         from cp-lang.c.
686         (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.
687
688 2004-11-01  Nathan Sidwell  <nathan@codesourcery.com>
689
690         PR c++/18064
691         * search.c (check_final_overrider): Deprecate gnu covariant extension.
692
693 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
694
695         Convert diagnostics to use quoting flag q 9/n
696         * typeck.c (build_x_unary_op, convert_member_func_to_ptr, 
697         get_delta_difference):  Use new quotation style.
698         * repo.c (reopen_repo_file_for_write): Likewise.
699         * pt.c (do_type_instantiation): Likewise.
700         * parser.c (cp_parser_diagnose_invalid_type_name): 
701         * name-lookup.c (push_overloaded_decl, set_decl_namespace): 
702         * error.c (cp_print_error_function,
703         print_instantiation_full_context): Likewise.
704         * decl.c (define_label, grok_reference_init, 
705         maybe_deduce_size_from_array_init, revert_static_member_fn): 
706         * decl2.c (check_classfn): Likewise.
707         * class.c (add_method, check_field_decls, layout_class_type, 
708         resolve_address_of_overloaded_function): Likewise.
709         * call.c (build_x_va_arg, build_over_call): Likewise.
710
711 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
712
713         Convert diagnostics to use quoting flag q 8/n
714         * cvt.c (cp_convert_to_pointer, warn_ref_binding, 
715         convert_to_reference, ocp_convert, convert_to_void 
716         cp_convert_to_pointer): Use new quotation style.
717
718 2004-10-31  Mark Mitchell  <mark@codesourcery.com>
719
720         PR c++/15172
721         * typeck2.c (store_init_value): Use split_nonconstant_init even
722         for types that require construction.
723         
724 1004-10-28  Matt Austern  <austern@apple.com>
725
726         PR c++/17542
727         * cp-tree.h (class_key_or_enum_as_string): Declare.
728         * error.c (class_key_or_enum): Rename to class_key_or_enum_as_string
729         and remove static qualifier.
730         * decl.c (shadow_tag): Warn about ignored attributes in class/struct/
731         union/enum declaration.
732         
733 2004-10-29  Kazu Hirata  <kazu@cs.umass.edu>
734
735         * pt.c: Fix a comment typo.
736
737 2004-10-28  Nathan Sidwell  <nathan@codesourcery.com>
738
739         * typeck.c (composite_pointer_type): Remove comment about DR 195.
740         (build_reinterpret_cast_1): Revert DR195 patch. Only emit a
741         warning when being pedantic.
742         (build_reinterpet_cast, build_c_cast): Adjust.
743
744 2004-10-29  Mark Mitchell  <mark@codesourcery.com>
745
746         PR c++/17695
747         * decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they
748         appear in a constructor/destructor that will be cloned.
749
750 1004-10-28  Matt Austern  <austern@apple.com>
751
752         PR c++/14124
753         * decl.c (finish_enum): Handle packed attribute.
754         * parser.c (cp_parser_enum_specifier): Process trailing attributes.
755         
756 2004-10-28  Mark Mitchell  <mark@codesourcery.com>
757
758         PR c++/17132
759         * pt.c (instantiate_class_template): Increment
760         processing_template_decl when substituting into a member class
761         template.
762
763 2004-10-27  Mark Mitchell  <mark@codesourcery.com>
764
765         PR c++/17435
766         * call.c (convert_like_real): Fix formatting.
767         (initialize_reference): When binding a temporary to a base class,
768         ensure that the nominal copy made is to the derived class, not the
769         base class.
770
771         PR c++/18140
772         * parser.c (cp_parser_next_token_ends_template_argument_p): Do not
773         include ">>".
774
775 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
776
777         * decl.c (bad_specifiers): Move the q after the %.
778
779 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
780
781         * parser.c (cp_parser_diagnose_invalid_type_name): Move the q after
782         the %.
783
784 2004-10-26  Mark Mitchell  <mark@codesourcery.com>
785
786         * name-lookup.c (do_namespace_alias): Use FROB_CONTEXT.
787         * search.c (current_scope): Fix prototype.
788
789         PR c++/18093
790         * search.c (current_scope): Return the innermost non-block scope,
791         not the innermost non-block, non-namespace scope.
792         (at_namespace_scope_p): Adjust accordingly.
793         (dfs_accessible_post): Do not pass namespaces to is_friend.
794         (dfs_walk_once_accessible_r): Likewise.
795         * decl.c (grokvardecl): Adjust call to current_scope.
796         (build_enumerator): Likewise.
797         * parser.c (cp_parser_using_declaration): Likewise.
798         (cp_parser_direct_declarator): Use at_namespace_scope_p instead of
799         current_scope.
800         (cp_parser_class_head): Adjust call to current_scope.
801         * name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the
802         alias.
803
804         PR c++/18020
805         * pt.c (tusbst_copy_and_build): Resolve enumeration constants to
806         their underlying values.
807
808         PR c++/18161
809         * typeck.c (build_binary_op): Honor build_type, even when in a
810         template.
811
812 2004-10-26  Nathan Sidwell  <nathan@codesourcery.com>
813
814         * parser.c (cp_lexer_get_preprocessor_token): Remove unneeded
815         padding token checking.
816
817 2004-10-25  Andrew Pinski  <pinskia@physics.uc.edu>
818
819         PR c++/18121
820         * decl.c (grokdeclarator) <case cdk_array>: Remove the call
821         layout_type as it is already done by create_array_type_for_decl.
822
823 2004-10-22  Nathan Sidwell  <nathan@codesourcery.com>
824
825         PR c++/18095
826         * parser.c (eof_token): Make const, correctly initialize rid and
827         location fields.
828         (struct cp_lexer): Replace buffer_end pointer with buffer_length
829         count. Adjust.
830         (cp_lexer_new_main): Directly grow lexer's buffer here.  Don't
831         zero it out.
832         (cp_lexer_new_from_tokens): Adjust.
833         (cp_lexer_grow_buffer): Remove.
834         (cp_lexer_peek_nth_token, cp_lexer_consume_token,
835         cp_lexer_purge_token): Add const casts.
836
837 2004-10-21  Mark Mitchell  <mark@codesourcery.com>
838
839         PR c++/18073
840         PR c++/10841
841         * cp-tree.h (convert_to_base): Change prototype.
842         (build_ptrmemfunc): Likewise.
843         (convert_ptrmem): New function.
844         * call.c (struct conversion): Adjust documentation for base_p.
845         (standard_conversion): Set base_p for ck_pmem conversions as
846         appropriate.
847         (convert_like_real): Use convert_to_base for ck_pmem and ck_ptr
848         conversions.
849         * class.c (convert_to_base): Handle both pointers and objects.
850         Add nonnull parameter.
851         (build_vfield_ref): Adjust call to convert_to_base.
852         * cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc.
853         (convert_force): Likewise.
854         * typeck.c (build_unary_op): Likewise.
855         (convert_ptrmem): New function.
856         (build_static_cast_1): Use it.
857         (build_reinterpret_cast): Allow conversions to vector types.
858         (get_delta_difference): Add c_cast_p parameter.
859         (build_ptrmemfunc): Likewise.  Adjust calls to
860         get_delta_difference.
861
862 2004-10-21  Andrew Pinski  <pinskia@physics.uc.edu>
863
864         PR c++/13560
865         * error.c (cp_error_at): Output the context as it might be
866         different file as the other location.
867
868 2004-10-21  Kazu Hirata  <kazu@cs.umass.edu>
869
870         * typeck.c: Fix a comment typo.
871
872 2004-10-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
873
874         PR c++/13495
875         * decl.c (make_unbound_class_template): Add PARM_LIST parameter.
876         * cp-tree.h (make_unbound_class_template): Adjust prototype.
877         * parser.c (cp_parser_lookup_name): Adjust call to
878         make_unbound_class_template.
879         (cp_parser_single_declaration): Handle member class of class
880         template as template friend parsing correctly.
881         * friend.c (is_friend): Call is_specialization_of_friend for
882         template friend class.
883         (make_friend_class): Handle member class of class template as
884         template friend.
885         * pt.c (is_specialization_of_friend): Likewise.
886         (instantiate_class_template): Likewise.
887         (tsubst): Adjust call to make_unbound_class_template.
888
889 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
890
891         * typeck.c (composite_pointer_type): Add comment about DR 195
892         (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter.
893         Allow function pointer conversions that DR195 suggests.
894         (build_reinterpret_cast, build_c_cast): Update
895         build_reinterpret_cast_1 calls. 
896
897 2004-10-20  Kazu Hirata  <kazu@cs.umass.edu>
898
899         * call.c, typeck.c: Fix comment typos.
900
901 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
902
903         * parser.c (cp_token_position): New typedef. Define VEC thereof.
904         (struct cp_lexer): Allow buffer and buffer_end to be NULL. Make
905         next_token and last_token cp_token_position. Make saved_tokens a
906         VEC(cp_token_position).
907         (eof_token): New static variable.
908         (CP_SAVED_TOKENS_SIZE): Rename to ...
909         (CP_SAVED_TOKEN_STACK): ... here.
910         (cp_lexer_new_main): Adjust main lexer creation and buffer
911         filling.
912         (cp_lexer_new_from_tokens): Do not copy the tokens, merely point
913         to the parent buffer.  Do not append eof token.
914         (cp_lexer_destroy): Only free buffer if non-NULL. Free token
915         stack.
916         (cp_lexer_next_token, cp_lexer_prev_token): Remove.
917         (cp_lexer_token_position, cp_lexer_token_at): New.
918         (cp_lexer_saving_tokens): Adjust. Make inline.
919         (cp_lexer_advance_token, cp_lexer_token_difference): Remove.
920         (cp_lexer_peek_token_emit_debug_info): Fold into ...
921         (cp_lexer_peek_token): ... here.
922         (cp_lexer_peek_nth_token): Don't peek past EOF.
923         (cp_lexer_consume_token): Set next_token to eof_token, if reaching
924         EOF.
925         (cp_lexer_purge_token): Adjust eof setting.
926         (cp_lexer_purge_tokens_after): Likewise.
927         (cp_lexer_save_tokens): Push next_token directly.
928         (cp_lexer_commit_tokens): Adjust.
929         (cp_lexer_rollback_tokens): Pop next_token directly.
930         (cp_parser_check_for_invalid_template_id): Adjust token purging.
931         (cp_parser_translation_unit): Do not consume the EOF.
932         (cp_parser_nested_name_specifier_opt): Adjust token purging.
933         (cp_parser_template_id, cp_parser_template_name): Likewise.
934
935 2004-10-19  Mark Mitchell  <mark@codesourcery.com>
936
937         PR c++/14035
938         * call.c (struct conversion): Add base_p.
939         (convert_like): Add c_cast_p argument.
940         (convert_like_with_conversion): Likewise.
941         (build_conv): Clear base_p.
942         (standard_conversion): Set it, for derived-to-base conversions.
943         (convert_like_real): Add c_cast_p parameter.  Handle pointer
944         conversions directly rather than relying on ocp_convert.
945         (perform_direct_initialization_if_possible): Add c_cast_p
946         parameter.
947         * cp-tree.h (perform_direct_initialization_if_possible): Change
948         prototype.
949         (convert_member_func_to_ptr): New function.
950         * typeck.c (check_for_casting_away_constness): Add diag_fn
951         parameter.
952         (build_static_cast_1): New function, split out from ...
953         (build_static_cast): ... here.  Use build_static_cast_1.
954         (build_reinterpret_cast_1): New function, split out from ...
955         (build_reinterpret_cast): ... here.  Use build_reinterpret_cast_1.
956         (build_const_cast_1): New function, split out from ...
957         (build_const_cast): ... here.  Use build_const_cast_1.
958         (build_c_cast): Rewrite to use build_const_cast_1,
959         build_static_cast_1, and build_reinterpret_cast_1.
960         (convert_member_func_to_ptr): New function.
961
962 2004-10-19  Paolo Bonzini  <bonzini@gnu.org>
963
964         PR c++/18047
965         * parser.c (enum cp_parser_prec): Give relational expressions
966         a higher precedence than equality expressions.
967
968 2004-10-15  Nathan Sidwell  <nathan@codesourcery.com>
969
970         * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call.
971         (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove.
972         (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call.
973         (enum base_access): Reorganize.
974         (accessible_base_p, accessible_p): Add consider_local_p parameter.
975         * call.c (standard_conversion): Update comment about
976         DERIVED_FROM_P.
977         (enforce_access): Adjust accessible_p call.
978         (build_over_call): Adjust accessible_base_p call.
979         * class.c (convert_to_base): Adjust lookup_base call.
980         (build_vtbl_ref_1): Likewise.
981         (warn_about_ambiguous_bases): Likewise. Add early exit.
982         * cvt.c (convert_to_pointer_force) Adjust lookup_base call.
983         * search.c (accessible_base_p): Add consider_local_p parameter.
984         (lookup_base): Pass consider_local_p to accessible_base_p call.
985         (friend_accessible_p): Check whether scope is a class member.
986         Remove unnecessary class template check.
987         (accessible_p): Add consider_local_p parameter. Use it.
988         (adjust_result_of_qualified_name_lookup): Adjust lookup_base call.
989         * tree.c (maybe_dummy_object): Likewise.
990         * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P.
991         (build_class_member_access_expr): Adjust lookup_base call.
992         * typeck2.c (binfo_or_else): Likewise.
993         * rtti.c (build_dynamic_cast_1): Access can consider friendship
994         and current scope.
995
996 2004-10-17  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
997
998         PR c++/17743
999         * decl2.c (grokfield): Apply attributes also to TYPE_DECLs.
1000
1001 2004-10-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1002
1003         PR c++/10479
1004         * parser.c (cp_parser_parenthesized_expression_list): Fold
1005         non-dependent expressions in attribute lists.
1006
1007 2004-10-15  Mark Mitchell  <mark@codesourcery.com>
1008
1009         PR c++/17042
1010         * decl.c (declare_global_var): Use the return value from pushdecl.
1011
1012         PR c++/14667
1013         * parser.c (cp_parser_simple_declaration): Do not diagnose invalid
1014         type names if we have already found a valid type.
1015         (cp_parser_member_declaration): Likewise.
1016         
1017         PR c++/17916
1018         * parser.c (cp_parser_member_specification_opt): Handle
1019         CPP_PRAGMA.
1020
1021 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
1022
1023         * dump.c, g++spec.c, repo.c: Update copyright.
1024
1025 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
1026
1027         * decl.c: Fix a comment typo.
1028
1029 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
1030
1031         PR c++/16301
1032         * name-lookup.c (parse_using_directive): If we have a
1033         error_mark_node, do not set the decl namespace associations
1034         on it.
1035
1036 2004-10-14  Mark Mitchell  <mark@codesourcery.com>
1037
1038         PR c++/17976
1039         * decl.c (cp_finish_decl): Do not call expand_static_init more
1040         than once for a single variable.
1041
1042 2004-10-14  Matt Austern  <austern@apple.com>
1043
1044         * Make-lang.in (pt.o): depends on pointer-set.h
1045         * cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now.
1046         * pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
1047         (for_each_template_parm): Convert from htab_t to pointer_set_t.
1048         * tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
1049         
1050 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
1051
1052         PR c++/17661
1053         * semantics.c (finish_for_expr): Convert expression to void
1054         so that we don't create temporaries for a?b:c.
1055
1056 2004-10-13  Kazu Hirata  <kazu@cs.umass.edu>
1057
1058         * search.c: Fix a comment typo.
1059
1060 2004-10-12  Nathan Sidwell  <nathan@codesourcery.com>
1061
1062         * class.c (dfs_modify_vtables): Simplify condition. Return
1063         dfs_skip_bases as appropriate.
1064         (modify_all_vtables): Walk in pre-order.
1065         * search.c (dfs_walk_all, dfs_walk_once_r,
1066         dfs_walk_once_accessible_r): Assert post order function never
1067         returns dfs_skip_bases.
1068
1069         * search.c (struct lookup_base_data_s): New.
1070         (lookup_base_r): Replace with ...
1071         (dfs_lookup_base): ... this.
1072         (lookup_base): Use dfs_walk_all.
1073
1074 2004-10-12  Kazu Hirata  <kazu@cs.umass.edu>
1075
1076         * search.c: Fix comment typos.
1077
1078 2004-10-11  Mark Mitchell  <mark@codesourcery.com>
1079
1080         PR c++/15786
1081         * parser.c (cp_parser_declarator): Add member_p parameter. 
1082         (cp_parser_condition): Adjust calls to cp_parser_declarator.
1083         (cp_parser_explicit_instantiation): Likewise.
1084         (cp_parser_init_declarator): Likewise.
1085         (cp_parser_direct_declarator): Add member_p parameter.  Do not
1086         parse tentatively when parsing the parameters to a member.
1087         (cp_parser_type_id): Adjust calls to cp_parser_declarator.
1088         (cp_parser_parameter_declaration): Likewise.
1089         (cp_parser_member_declaration): Likewise.
1090         (cp_parser_exception_declaration): Likewise.
1091
1092         PR c++/17936
1093         * cp-tree.h (CLASSTYPE_TEMPLATE_SPECIALIZATION): Add a comment.
1094         * pt.c (optimize_specialization_lookup_p): Do not optimize lookups
1095         for members of partial or explicit specializations.
1096
1097         PR c++/17929
1098         * decl2.c (finish_anon_union): Robustify.
1099
1100 2004-10-11  Nathan Sidwell  <nathan@codesourcery.com>
1101
1102         * cp-tree.h (get_dynamic_cast_base_type): Rename to ...
1103         (dcast_base_hint): ... here.
1104         * rtti.c (build_dynamic_cast_1): Use dcast_base_hint.
1105         * search.c (struct dcast_data_s): New.
1106         (dynamic_cast_base_recurse): Remove. Replace with ...
1107         (dfs_dcast_hint_pre, dfs_dcast_base_post): ... these. New.
1108         (get_dynamic_cast_base_type): Rename to ...
1109         (dcast_base_hint): ... here.  Use dfs_walk_once_accessible.
1110         (accessible_r): Remove.
1111         (dfs_accessible_post): New, broken out of accessible_r.
1112         (accessible_p): Use dfs_walk_once_accessible.
1113         (dfs_walk_once_accessible_r): New. From accessible_r.
1114         (dfs_walk_once_accessible): New. From acessible_p.
1115
1116         * cp-tree.h (SAME_BINFO_TYPE_P): New.
1117         * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare
1118         binfo types.
1119         (convert_to_base_statically, determine_primary_bases,
1120         update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits,
1121         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
1122         accumulate_vtbl_inits, dfs_accumulate_vtbl_inits,
1123         build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise.
1124         * init.c (expand_member_init): Likewise.
1125         * search.c (lookup_base_r, dynamic_cast_base_recurse,
1126         binfo_via_virtual, copied_binfo, binfo_for_vbase,
1127         original_binfo): Likewise.
1128         * tree.c (copy_binfo): Likewise.
1129
1130 2004-10-11  Kazu Hirata  <kazu@cs.umass.edu>
1131
1132         * semantics.c: Fix comment typos.
1133
1134 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
1135
1136         PR c++/17554
1137         part of c++/17657
1138         middle-end/17703
1139         * semantics.c (maybe_cleanup_point_expr): Call
1140         fold_build_cleanup_point_expr.
1141         (maybe_cleanup_point_expr_void): New function.
1142         (add_decl_expr): Call maybe_cleanup_point_expr_void.
1143         (finish_expr_stmt): Likewise.
1144         (finish_return_stmt): Likewise.
1145         (finish_for_expr): Likewise.
1146         (finish_asm_stmt): Likewise.
1147         * typeck.c (condition_conversion): Call
1148         fold_build_cleanup_point_expr.
1149
1150 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
1151
1152         PR c++/17907
1153         * semantics.c (add_decl_expr): If the decl has a size which
1154         has side effects then the decl expression needs a cleanup point.
1155
1156 2004-10-10  Mark Mitchell  <mark@codesourcery.com>
1157
1158         PR c++/17393
1159         * decl.c (grokdeclarator): Robustify error-recovery on invalid
1160         declarations.
1161
1162 2004-10-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1163
1164         Convert diagnostics to use quoting flag q 7/n
1165         * typeck.c (composite_pointer_type_r, composite_pointer_type, 
1166         cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr, 
1167         string_conv_p, build_class_member_access_expr, 
1168         build_class_member_access_expr, lookup_destructor, 
1169         finish_class_member_access_expr, build_indirect_ref, 
1170         get_member_function_from_ptrfunc, build_function_call, 
1171         convert_arguments, build_binary_op, pointer_diff, build_unary_op, 
1172         check_for_casting_away_constness, build_static_cast, 
1173         build_reinterpret_cast, build_const_cast, build_c_cast, 
1174         build_modify_expr, get_delta_difference, build_ptrmemfunc, 
1175         dubious_conversion_warnings, convert_for_assignment, 
1176         convert_for_initialization, 
1177         maybe_warn_about_returning_address_of_local, check_return_expr): 
1178         Use quoting marks.
1179
1180         * typeck2.c (error_not_base_type, readonly_error, 
1181         abstract_virtuals_error, cxx_incomplete_type_diagnostic, 
1182         store_init_value, digest_init, build_x_arrow, 
1183         build_m_component_ref, require_complete_eh_spec_types): Likewise.
1184
1185         * tree.c (cp_build_qualified_type_real, 
1186         handle_java_interface_attribute, handle_init_priority_attribute):
1187         Likewise.
1188
1189         * semantics.c (finish_asm_stmt, finish_non_static_data_member, 
1190         finish_pseudo_destructor_expr, 
1191         check_template_template_default_arg, begin_class_definition, 
1192         finish_base_specifier, qualified_name_lookup_error, 
1193         finish_id_expression, finish_typeof): Likewise.
1194
1195         * search.c (lookup_base, check_final_overrider,
1196         look_for_overrides_r): Likewise.
1197
1198         * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise.
1199
1200 2004-10-09  Mark Mitchell  <mark@codesourcery.com>
1201
1202         PR c++/17867
1203         * error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a
1204         constructor.
1205
1206         PR c++/17670
1207         * init.c (build_new): Correct comments.
1208         * parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in
1209         the non-array case.
1210
1211         PR c++/17821
1212         * parser.c (cp_parser_postfix_dot_deref_expression): If the
1213         pseduo-destructor-name production does not work, fall back to the
1214         ordinary production.
1215
1216         PR c++/17826
1217         * tree.c (cp_tree_equal): Handle a BASELINK.
1218
1219         PR c++/17524
1220         * cp-tree.h (check_var_type): New function.
1221         * decl.c (check_var_type): New function, split out from ...
1222         (grokdeclarator): ... here.
1223         * pt.c (tsubst_decl): Use check_var_type.
1224
1225         PR c++/17685
1226         * decl.c (grokdeclarator): Disallow declarations of operators as
1227         non-functions.
1228         
1229 2004-10-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1230
1231         PR c++/17868
1232         * error.c (dump_expr): Add missing case for RDIV_EXPR.
1233
1234 2004-10-08  Kazu Hirata  <kazu@cs.umass.edu>
1235
1236         * pt.c, search.c: Fix comment typos.
1237
1238 2004-10-08  Nathan Sidwell  <nathan@codesourcery.com>
1239
1240         * cp-tree.h (dfs_walk, dfs_walk_real, dfs_unmark, markedp,
1241         unmarkedp): Remove.
1242         (dfs_skip_bases, dfs_walk_all, dfs_walk_once): New.
1243         * class.c (struct find_final_overrider_data): Remove most_derived,
1244         vpath_list and vpath fields.  Add path field.
1245         (dfs_find_final_ocerrider_1): Add DEPTH parameter. Adjust.
1246         (dfs_find_final_overrider): Rename to ...
1247         (dfs_find_final_overrider_pre): ... here. Adjust.
1248         (dfs_find_final_overrider_post): Adjust.
1249         (dfs_find_final_overrider_q): Fold into
1250         dfs_find_final_overrider_pre.
1251         (find_final_overrider): Adjust dfs searching.
1252         (dfs_modify_vtables): Don't mark binfo here.
1253         (modify_all_vtables): Use dfs_walk_once.
1254         (build_vtt_inits): Likwise. Use dfs_walk_all.
1255         (dfs_build_secondary_vptr_vtt_inits): Don't mark binfo here.
1256         Return dfs_skip_bases as appropriate.
1257         (dfs_fixup_binfo_vtbls): Return dfs_skip_bases as appropriate.
1258         * init.c (dfs_initialized_vtbl_ptrs): Return dfs_skip_bases as
1259         appropriate. Don't mark binfo here.
1260         (initialize_vtbl_ptrs): Use dfs_walk_once.
1261         * search.c (struct vbase_info): Remove unused struct.
1262         (access_in_type): Use dfs_walk_once.
1263         (dfs_access_in_type): Don't mark binfo here.
1264         (dfs_accessible_queue_p, dfs_accessible_p) Remove.
1265         Fold into ...
1266         (accessible_r): ... here. New. Specialize dfs_walk_once.
1267         (accessible_p): Use accessible_r.
1268         (lookup_field_queue_p): Remove. Fold into ...
1269         (lookup_field_r): ... here. Adjust.
1270         (lookup_member): Use dfs_walk_all.
1271         (dfs_walk_real, dfs_walk): Replace with ...
1272         (dfs_walk_all, dfs_walk_once): ... these.
1273         (dfs_walk_once_r, dfs_unmark_r): Workers for dfs_walk_once.
1274         (dfs_unmark, unmarkedp, markedp): Remove.
1275         (dfs_get_pure_virtuals): Don't mark binfo here.
1276         (get_pure_virtuals): Use dfs_walk_once.
1277         (dfs_debug_unmarked_p): Remove. Fold into ...
1278         (dfs_debug_mark): ... here.
1279         (note_debug_info_needed): Use dfs_walk_all.
1280
1281 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
1282
1283         * pt.c (tsubst_expr) <case ASM_EXPR>: Look passed the
1284         CLEANUP_POINT_EXPR to get the asm expression.
1285
1286 2004-10-07  Mark Mitchell  <mark@codesourcery.com>
1287
1288         * cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
1289         (DECL_MEMBER_TEMPLATE_P): New macro.
1290         (is_member_template): Remove.
1291         (class_method_index_for_fn): New function.
1292         * pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P.
1293         * class.c (finish_struct_methods): Remove out-of-date comment.
1294         * decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P.
1295         * decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and
1296         class_method_index_for_fn.
1297         * pt.c (is_member_template): Remove.
1298         (is_member_template_class): Likewise.
1299         (optimize_specialization_lookup_p): New function.
1300         (retrieve_specialization): Optimize lookups for members that are
1301         not member templates.
1302         (register_specialization): Adjust accordingly.
1303         (build_template_decl): Add member_template_p parameter.  Set
1304         DECL_MEMBER_TEMPLATE_P.
1305         (process_partial_specialization): Adjust call to
1306         retrieve_specialization.
1307         (push_template_decl_real): Determine whether the template is a
1308         member template.
1309         (lookup_template_class): Use retrieve_specialization.
1310         (tsubst_decl): Adjust call to retrieve_specialization.
1311         (tsubst_exception_specification): New function.
1312         (tsubst): Use it.
1313         (tsubst_copy): Use DECL_MEMBER_TEMPLATE_P.
1314         (instantiate_template): Adjust call to retrieve_specialization.
1315         (regenerate_decl_from_template): Do not actually generate a new
1316         DECL.
1317         (instantiate_decl): Adjust call to retrieve_specialization.
1318         (class_method_index_for_fn): New method.
1319
1320 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
1321
1322         * parser.c (cp_parser_asm_definition): Look passed the
1323         CLEANUP_POINT_EXPR to get the asm expression.
1324
1325 2004-10-06  Andrew Pinski  <pinskia@physics.uc.edu>
1326
1327         PR c++/17368
1328         * semantics.c (finish_asm_stmt): Asm expressions need cleanup
1329         also.
1330
1331 2004-10-05  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1332
1333         Convert diagnostics to use quoting flag q 6/n
1334         * pt.c (finish_member_template_decl, check_specialization_scope, 
1335         maybe_process_partial_specialization, determine_specialization, 
1336         check_explicit_specialization, maybe_check_template_type, 
1337         process_partial_specialization, check_default_tmpl_args, 
1338         push_template_decl_real, redeclare_class_template, 
1339         convert_nontype_argument, coerce_template_parms, 
1340         lookup_template_class, push_tinst_level, 
1341         instantiate_class_template, tsubst_arg_types, 
1342         tsubst_function_type, tsubst, tsubst_qualified_id, 
1343         tsubst_copy_and_build, check_instantiated_args, 
1344         do_decl_instantiation, do_type_instantiation, 
1345         invalid_nontype_parm_type_p, check_specialization_namespace, 
1346         convert_template_argument, determine_specialization, 
1347         check_template_shadow, tsubst_decl 
1348         instantiate_pending_templates): Use quoting marks.
1349
1350 2004-10-05  Nathan Sidwell  <nathan@codesourcery.com>
1351
1352         PR c++/17829
1353         * parser.c (cp_parser_postfix_expression): Inhibit Koenig when
1354         unqualified lookup finds a member function.
1355
1356 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1357
1358         Convert diagnostics to use quoting flag q 5/n
1359         * parser.c (cp_parser_name_lookup_error, 
1360         cp_parser_diagnose_invalid_type_name, 
1361         cp_parser_primary_expression, cp_parser_unqualified_id, 
1362         cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement, 
1363         cp_parser_jump_statement, cp_parser_simple_declaration, 
1364         cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id, 
1365         cp_parser_type_parameter, cp_parser_template_id, 
1366         cp_parser_template_name, cp_parser_direct_declarator, 
1367         cp_parser_parameter_declaration_list, cp_parser_class_head, 
1368         cp_parser_base_specifier, cp_parser_lookup_name, 
1369         cp_parser_late_parsing_default_args, 
1370         cp_parser_optional_template_keyword 
1371         cp_parser_elaborated_type_specifier, cp_parser_check_class_key, 
1372         cp_parser_check_access_in_redeclaration): Use quoting marks.
1373
1374         * name-lookup.c (supplement_binding, pushdecl, 
1375         check_for_out_of_scope_variable, validate_nonmember_using_decl, 
1376         do_nonmember_using_decl, lookup_tag, set_decl_namespace, 
1377         push_namespace, do_namespace_alias, do_using_directive, 
1378         ambiguous_decl, lookup_namespace_name, add_function): Likewise.
1379
1380         * method.c (use_thunk): Likewise.
1381
1382         * lex.c (unqualified_name_lookup_error, 
1383         unqualified_fn_lookup_error): Likewise.
1384
1385 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1386
1387         Convert diagnostics to use quoting flag q 4/n
1388         * except.c (decl_is_java_type, build_throw, 
1389         is_admissible_throw_operand, check_handlers_1, check_handlers): 
1390         Use quoting formats.
1391         * friend.c (add_friend, make_friend_class, do_friend): Likewise.
1392         * init.c (sort_mem_initializers, emit_mem_initializers, 
1393         member_init_ok_or_else, expand_member_init, is_aggr_type, 
1394         build_offset_ref, build_java_class_ref): Likewise.
1395
1396 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1397
1398         Convert diagnostics to use quoting flag q 3/n
1399         * decl.c (pop_label, duplicate_decls, redeclaration_error_message,
1400         redeclaration_error_message, lookup_label, check_goto,
1401         make_typename_type, make_unbound_class_template,
1402         fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1, 
1403         grok_reference_init, layout_var_decl, maybe_commonize_var, 
1404         check_for_uninitialized_const_var, reshape_init_array, 
1405         reshape_init, check_initializer, cp_finish_decl,
1406         member_function_or_else, bad_specifiers, grokfndecl, grokvardecl, 
1407         check_static_variable_definition, compute_array_index_type, 
1408         create_array_type_for_decl, check_special_function_return_type, 
1409         grokdeclarator, check_default_argument, grokparms, 
1410         grok_ctor_properties, grok_op_properties, 
1411         check_elaborated_type_specifier, xref_tag, finish_enum, 
1412         build_enumerator, check_function_type, start_preparsed_function, 
1413         store_parm_decls): Use quoting formats.
1414         * decl2.c (grok_array_decl, delete_sanity, check_member_template, 
1415         check_java_method, check_classfn, finish_static_data_member_decl, 
1416         grokfield, grokbitfield, grok_function_init,
1417         build_anon_union_vars, coerce_new_type, coerce_delete_type,
1418         check_default_args): Likewise.
1419         * parser.c (cp_parser_decl_specifier_seq): Likewise.
1420
1421 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1422
1423         Convert diagnostics to use quoting flag q 2/n
1424         * class.c (build_base_path, add_method, alter_access,
1425         handle_using_decl, check_bases,
1426         maybe_warn_about_overly_private_class, find_final_overrider,
1427         warn_hidden, finish_struct_anon, add_implicitly_declared_members,
1428         check_bitfield_decl, check_field_decls, layout_empty_base,
1429         build_base_field, check_methods, layout_virtual_bases,
1430         warn_about_ambiguous_bases, layout_class_type, finish_struct_1,
1431         resolve_address_of_overloaded_function, instantiate_type,
1432         note_name_declared_in_class): Use format flag "q" for quoting.
1433
1434 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1435
1436         Convert diagnostics to use quoting flag q 1/n
1437         * error.c (locate_error): Ignore quoting flag q.
1438         * call.c (build_user_type_conversion_1, build_operator_new_call,
1439         build_object_call, op_error, build_conditional_expr,
1440         build_new_op, build_op_delete_call, enforce_access,
1441         convert_like_real, convert_arg_to_ellipsis, build_x_va_arg,
1442         convert_default_arg, build_over_call, build_new_method_call,
1443         joust, perform_implicit_conversion, initialize_reference): Use the
1444         quoting flag q.
1445
1446 2004-10-03  Andrew Pinski  <pinskia@physics.uc.edu>
1447
1448         PR c++/17797
1449         * typeck.c (build_reinterpret_cast): Return if the inner type
1450         is error_mark_node.
1451
1452 2004-10-01  Jan Hubicka  <jh@suse.cz>
1453
1454         * semantics.c (expand_body): Update call of tree_rest_of_compilation.
1455
1456 2004-09-30  Nathan Sidwell  <nathan@codesourcery.com>
1457
1458         * cp-tree.h (struct lang_decl): Shrink by reordering fields and
1459         turning operator_code and fixed_offset into bitfields.
1460
1461 2004-09-29  Joseph S. Myers  <jsm@polyomino.org.uk>
1462
1463         * decl.c (duplicate_decls): Merge TREE_DEPRECATED.
1464
1465 2004-09-29  Jason Merrill  <jason@redhat.com>
1466
1467         PR tree-optimization/17697
1468         * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl.
1469
1470 2004-09-28  Jason Merrill  <jason@redhat.com>
1471
1472         PR middle-end/17525
1473         * class.c (build_base_field): Set TYPE_MODE.
1474
1475 2004-09-28  Roger Sayle  <roger@eyesopen.com>
1476
1477         PR driver/17537
1478         * g++spec.c (lang_specific_driver): Unrecognized libraries, other
1479         than -lc and -lm, may require linking against libstc++.
1480
1481 2004-09-28  Kazu Hirata  <kazu@cs.umass.edu>
1482
1483         * tree.c: Fix a comment typo.
1484
1485 2004-09-28  Nathan Sidwell  <nathan@codesourcery.com>
1486
1487         * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove.
1488         (struct secondary_vptr_vtt_init_data_s): New.
1489         (build_vtt_inits): Adjust dfs_walkers.
1490         (dfs_build_secondary_vptr_vtt_inits): Caller data is a
1491         secondary_vptr_vtt_init_data_s structure. Adjust.
1492         (dfs_ctor_vtable_bases_queue_p): Remove.
1493         (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify.
1494
1495         * pt.c (struct get_template_base_data_s): Remove.
1496         (get_template_base_r): Fold into get_template_base.
1497         (get_template_base): Walk base binfos directly in inheritance
1498         graph order.
1499
1500 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
1501
1502         PR c++/17642
1503         * cp-tree.h (fold_if_not_in_template): New function.
1504         * call.c (build_conditional_expr): Use fold_if_not_in_template.
1505         (build_cxx_call): Likewise.
1506         * cvt.c (convert_to_complex): Likewise.
1507         (ocp_convert): Likewise.
1508         (convert): Likewise.
1509         (convert_force): Likewise.
1510         * decl.c (compute_array_index_type): Clear
1511         processing_template_decl while folding array bounds.
1512         * pt.c (convert_nontype_argument): Clear
1513         processing_template_decl while processing non-type argument
1514         initialization.
1515         * tree.c (fold_if_not_in_template): New function.
1516         * typeck.c (build_class_member_access_expr): Use
1517         fold_if_not_in_template.
1518         (build_array_ref): Likewise.
1519         (build_binary_op): Likewise.  Do not try to optimize computations
1520         when processing templates.
1521         (cp_pointer_int_sum): Use fold_if_not_in_template.
1522         (pointer_diff): Likewise.
1523         (build_unary_op): Likewise.
1524         (build_reinterpret_cast): Likewise.
1525         (get_delta_difference): Likewise.
1526         (expand_ptrmemfunc_cst): Likewise.
1527         (dubious_conversion_warnings): Likewise.
1528
1529 2004-09-27  Matt Austern  <austern@apple.com>
1530
1531         * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c
1532         (cp_lexer_get_preprocessor_token): Set implicit_extern_c for
1533         tokens that come from headers that are implicitly extern "C".
1534         (struct cp_parser): new one-bit field, implicit_extern_c.
1535         (cp_parser_new): Set parser's implicit_extern_c to false.
1536         (cp_parser_translation_unit): Pop lang context if we were in a
1537         header that was implicitly extern "C".
1538         (cp_parser_declaration_seq_opt): Push/pop lang context as
1539         required by the token's and parser's implicit_extern_c.
1540         
1541 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
1542
1543         PR c++/17585
1544         * cp-tree.h (shared_member_p): Declare.
1545         * search.c (shared_member_p): Give it external linkage.
1546         * semantics.c (finish_qualified_id_expr): Use it.
1547         (finish_id_expression): Likewise.
1548
1549         PR c++/17585
1550         * semantics.c (finish_id_expression): Do not add "this->" to
1551         static member functions.
1552
1553 2004-09-27  Nathan Sidwell  <nathan@codesourcery.com>
1554
1555         PR c++/17681
1556         * error.c (dump_type): Change TREE_VEC case into TREE_BINFO.
1557
1558         * class.c (struct count_depth_data): Remove.
1559         (dfs_depth_post, dfs_depth_q): Remove.
1560         (find_final_overrider): Use number of vbase classes as depth
1561         bound.
1562         
1563         * cp-tree.h (types_overlap_p): Remove.
1564         * search.c (struct overlap_info): Remove.
1565         (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove.
1566         
1567         * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove.
1568         (get_template_base_recursive): Remove. Replace with ...
1569         (get_template_base_r): ... this.
1570         (struct get_template_base_data_s): New.
1571         (get_template_base): Use get_template_base_r via dfs_walk.  Always
1572         return NULL on failure.
1573         (unify): Remove error_mark_node check from get_template_base result.
1574
1575 2004-09-24  Paolo Bonzini  <bonzini@gnu.org>
1576
1577         * parser.c (cp_parser_expression_stack): Clarify why it is
1578         an array of NUM_PREC_VALUES elements.
1579         (cp_parser_binary_expression): Clarify why we do not need to
1580         handle stack overflow.
1581
1582 2004-09-24  Nathan Sidwell  <nathan@codesourcery.com>
1583
1584         PR c++/16889
1585         * search.c (lookup_field_queue_p): Correct check for hidden base.
1586
1587         * search.c (bfs_walk): Remove.
1588         (lookup_member): Use dfs_walk_real.
1589         (dfs_walk_real): Move and adjust documentation from bfs_walk.
1590
1591 2004-09-23  Zack Weinberg  <zack@codesourcery.com>
1592
1593         * decl.c (grokfndecl): If ::main is found not to return int,
1594         correct it after issuing a diagnostic.
1595         (grokdeclarator): If the incoming type was error_mark_node, do
1596         not complain about declaring something with no type.
1597         (start_function): Change check for ::main not returning int to
1598         an assertion, as grokfndecl now catches this when the user did it.
1599         * init.c (perform_member_init, sort_mem_initializers)
1600         (emit_mem_initializers): Make most diagnostics be issued on
1601         the line of current_function_decl, not whatever the current
1602         input line is.
1603         * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
1604         definition and declaration with #ifdef ENABLE_CHECKING.
1605         Avoid unnecessary use of fprintf.
1606         (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
1607         definitions to avoid warnings.
1608         (cp_lexer_new_main): Add assertion that first token is not a
1609         padding token.
1610         (cp_lexer_new_from_token_array): Fold into ...
1611         (cp_lexer_new_from_tokens): ... here.  Add assertion that
1612         first token is not a padding token.
1613         (cp_lexer_set_source_position_from_token): Move nearer to callers.
1614         Remove unused lexer argument.
1615         (cp_lexer_peek_token): Just print debugging report (if enabled)
1616         and return lexer->next_token.
1617         (cp_lexer_skip_purged_tokens): Delete.
1618         (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
1619         inline, simplify bodies.
1620         (cp_lexer_peek_nth_token): Add debugging report a la
1621         cp_lexer_peek_token.
1622         (cp_lexer_consume_token): Correct commentary.  Advance over
1623         purged tokens here.  Set current source position here, from
1624         token to be returned.  Avoid unnecessary use of fprintf.
1625         (cp_lexer_purge_token): Advance next_token pointer over this and
1626         subsequent purged tokens.
1627         (cp_parser_error): Adjust source position to that of the
1628         peeked token.
1629         (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
1630         (cp_parser_string_literal): Remove some excessive cleverness.
1631         (cp_parser_enum_specifier): Call start_enum before consuming
1632         the opening brace.
1633         (cp_parser_member_declaration): Make the "extra semicolon"
1634         diagnostic consistently-worded with the other place this is
1635         diagnosed.  Explicitly set the diagnostic location to the
1636         location of the offending semicolon.
1637         (cp_parser_enclosed_template_argument_list): Use %</%> quoting
1638         in diagnostics.  Do not use cp_parser_require.  Set location
1639         of diagnostics about improper use of '>>' to location of
1640         offending token.
1641         (cp_parser_late_parsing_for_member):
1642         Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
1643         (cp_parser_late_parsing_default_args): Likewise.  Manually
1644         move some logic outside the loop.
1645
1646 2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
1647
1648         PR c++/17618
1649         * cvt.c (cp_convert_to_pointer): Return early when the type is
1650         an error_mark_node.
1651
1652 2004-09-21 Fariborz Jahanian <fjahanian@apple.com>
1653
1654         PR c++/13989
1655         PR c++/9844
1656         * decl.c (grokfndecl): Add new argument "attrlist", use it
1657         to call cplus_decl_attributes.
1658         (start_function): Remove call to cplus_decl_attributes.
1659         * cvt.c (ocp_convert): Add support to use type conversion
1660         function to vector type.
1661         * parser.c (cp_parser_conversion_type_id): Add attributes, if any,
1662         to the parsed type.
1663
1664 2004-09-23  Paolo Bonzini  <bonzini@gnu.org>
1665
1666         PR c++/17596
1667
1668         * parser.c (cp_parser_token_tree_map_node,
1669         cp_parser_pm_expression, cp_parser_additive_expression,
1670         cp_parser_multiplicative_expression, cp_parser_shift_expression,
1671         cp_parser_relational_expression, cp_parser_equality_expression,
1672         cp_parser_and_expression, cp_parser_exclusive_or_expression,
1673         cp_parser_inclusive_or_expression,
1674         cp_parser_logical_and_expression,
1675         cp_parser_logical_or_expression): Removed.
1676         (enum cp_parser_prec, struct cp_parser_token_tree_map_node,
1677         binops, binops_by_token): New.
1678         (cp_parser_assignment_expression): Use cp_parser_binary_expression.
1679         (cp_parser_new): Initialize binops_by_token.
1680         (cp_parser_binary_expression): Rewritten.
1681         (N_CP_TTYPES): New.
1682
1683 2004-09-23  Kazu Hirata  <kazu@cs.umass.edu>
1684
1685         * parser.c: Fix a comment typo.
1686
1687 2004-09-23  Nathan Sidwell  <nathan@codesourcery.com>
1688
1689         PR c++/17620
1690         * decl.c (xref_basetypes): Look through typedefs before checking
1691         for duplicate base.
1692
1693 2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
1694
1695         * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
1696         * decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
1697         * rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
1698         (init_rtti_processing): Initialize it to something realistic.
1699         (get_tinfo_decl): Adjust pushing the new decl.
1700
1701         * cp-tree.h (struct lang_type_class): Remove marked flags, add
1702         diamond_shaped and repeated_base flags.  Reorder to keep 8-bit blocks.
1703         (TYPE_MARKED_P): New.
1704         (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New.
1705         (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
1706         CLEAR_CLASSTYPE_MARKED_N): Remove.
1707         (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*,
1708         CLEAR_CLASSTYPE_MARKED_*): Remove.
1709         * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond
1710         shaped and repeated base properties.
1711         * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET.
1712         * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark,
1713         class_hint_flags): Remove.
1714         (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
1715         CLASSTYPE_DIAMOND_SHAPED_P.
1716
1717 2004-09-21  Ziemowit Laski  <zlaski@apple.com>
1718
1719         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
1720         cp-objcp-common.h.
1721         (objcp_tsubst_copy_and_build): Reformat function signature.
1722         * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
1723         (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.
1724
1725 2004-09-21  Zack Weinberg  <zack@codesourcery.com>
1726
1727         * parser.c (cp_lexer_peek_token, cp_lexer_consume_token):
1728         Don't handle CPP_PRAGMA tokens specially.
1729         (cp_lexer_handle_pragma): Use cp_lexer_consume_token.  Don't
1730         purge the token; do clear token->value after processing.  Add
1731         assertion at beginning that token->value is nonzero.
1732         (cp_parser_statement, cp_parser_declaration_seq_opt): Handle
1733         CPP_PRAGMA as a full statement or declaration in its own right.
1734
1735 2004-09-21  Matt Austern  <austern@apple.com>
1736
1737         PR c++/15049
1738         * decl.c (grokvardecl): Accept declarations of global variables
1739         using anonymous types.
1740
1741 2004-09-21  Roger Sayle  <roger@eyesopen.com>
1742
1743         PR c++/7503
1744         * tree.c (lvalue_p_1):  Disallow MIN_EXPR and MAX_EXPR as lvalues
1745         if either operand has side-effects.
1746         * typeck.c (rationalize_conditional_expr): Assert that neither
1747         operand of MIN_EXPR or MAX_EXPR has side-effects.
1748         (build_modify_expr):  Add support for MIN_EXPR and MAX_EXPR.
1749         Check that the "lhs" is a valid lvalue, i.e. that neither operand
1750         of a MIN_EXPR or MAX_EXPR has a side-effect.
1751
1752 2004-09-21  Nathan Sidwell  <nathan@codesourcery.com>
1753
1754         * cp-tree.h (struct lang_type_header): Remove
1755         uses_multiple_inheritance field.
1756         (TYPE_USES_MULTIPLE_INHERITANCE): Remove.
1757         (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
1758         (TYPE_USES_VIRTUAL_BASECLASSES): Remove.
1759         (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
1760         (TYPE_CONTAINS_VPTR_P): Likewise.
1761         * call.c (add_template_candidate_real): Use
1762         CLASSTYPE_VBASECLASSES.
1763         (build_special_member_call): Likewise.
1764         * class.c (finish_struct_bits): Remove
1765         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
1766         bookkeeping.
1767         (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
1768         (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
1769         bookkeeping.
1770         (build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
1771         (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
1772         Likewise.
1773         * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
1774         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
1775         bookkeeping.
1776         (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
1777         * decl2.c (maybe_retrofit_in_chrg): Likewise.
1778         * init.c (expand_member, push_base_cleanups): Likewise.
1779         * pt.c (instantiate_class_template): Remove
1780         TYPE_USES_MULTIPLE_INHERITANCE,
1781         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
1782         bookkeeping.
1783         * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
1784         check.
1785         * typeck2.c (process_init_constructor): Replace some sorrys with
1786         asserts.
1787
1788 2004-09-21  Andreas Tobler  <a.tobler@schweiz.ch>
1789
1790         * decl.c (reshape_init_array): Initialize max_index_cst to fix
1791         bootstrap failure.
1792
1793 2004-09-20  Mark Mitchell  <mark@codesourcery.com>
1794
1795         PR c++/17530
1796         * pt.c (tsubst): Fix parentheses to accomodate emacs.
1797         (tsubst_baselink): If we get a single function, mark it as used.
1798
1799 2004-09-20  Matt Austern <austern@apple.com>
1800             Zack Weinberg  <zack@codesourcery.com>
1801
1802         * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
1803         Apply lbasename to input_filename before passing to get_fileinfo.
1804         * semantics.c (begin_class_definition): Likewise.
1805         * lex.c (handle_pragma_interface): Apply get_fileinfo to the
1806         correct filename.  Rename variables to be less confusing.
1807         (handle_pragma_implementation): Likewise.  Disable "appears
1808         after file is included" diagnostic.
1809
1810         * parser.c (struct cp_token): Add in_system_header fiag.
1811         (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
1812         (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
1813         (CPP_NONE, cp_lexer_read_token): Delete.
1814         (struct cp_lexer): Remove first_token, string_tokens,
1815         main_lexer_p fields.  Clarify comments.
1816         (struct cp_token_cache): Now just a pair of pointers.
1817         (CP_LEXER_BUFFER_SIZE): New #define.
1818         (CPP_PURGED): New fake token type.
1819         (cp_lexer_new_from_token_array, cp_lexer_destroy)
1820         (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
1821         (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
1822         New functions.
1823         (cp_lexer_new_from_tokens): Now a simple wrapper around
1824         cp_lexer_new_from_token_array.
1825         (cp_lexer_set_source_position_from_token): Also update
1826         in_system_header.
1827         (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
1828         Don't wrap round.
1829         (cp_lexer_token_difference): Dont handle wrapping round.
1830         (cp_lexer_new_main): Enable pragma deferral and raw strings,
1831         read the entire translation unit through c_lex_with_flags into
1832         this lexer's buffer, then turn raw strings back off again.
1833         (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
1834         (cp_lexer_get_preprocessor_token): No need to handle not being
1835         the main lexer.  Set token->in_system_header too.
1836         (cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
1837         to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
1838         (cp_lexer_peek_nth_token): Likewise.
1839         (cp_lexer_purge_token): Mark the token PURGED, don't shift all
1840         the other tokens down.
1841         (cp_lexer_purge_tokens_after): Likewise.
1842         (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
1843         about there being no tokens.
1844         (cp_lexer_print_token): Revise to give useful information on
1845         all tokens.
1846         (struct cp_parser): Add field translate_strings_p.
1847         (cp_parser_new): Initialize it.
1848         (cp_parser_translation_unit): Destroy the lexer when done.
1849         (cp_parser_parameter_declaration): Restructure saving of
1850         default arguments.
1851         (cp_parser_save_member_function_body): Likewise.
1852         (cp_parser_check_for_invalid_template_id)
1853         (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
1854         Adjust calls to cp_lexer_advance_token.
1855         (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
1856         No need to fiddle c_lex_string_translate.
1857         (cp_parser_primary_expression, cp_parser_linkage_specification)
1858         (cp_parser_asm_definition, cp_parser_asm_specification_opt)
1859         (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
1860         Use cp_parser_string_literal.
1861         (cp_parser_attribute_list): Save and restore
1862         parser->translate_strings_p, not c_lex_string_translate.
1863         (cp_parser_cache_group): Delete.
1864         (cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
1865         not take a cache argument.
1866
1867 2004-09-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1868
1869         PR c++/14179
1870         * decl.c (reshape_init): Extract array handling into...
1871         (reshape_init_array): New function. Use integers instead of trees
1872         for indices. Handle out-of-range designated initializers.
1873
1874 2004-09-20  Steven Bosscher  <stevenb@suse.de>
1875
1876         * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
1877         to null_node.
1878
1879 2004-09-19  Mark Mitchell  <mark@codesourcery.com>
1880
1881         * decl2.c (determine_visibility): Allow class visibility
1882         directives to override targetm.cxx.export_class_data.
1883
1884 2004-09-18  Kazu Hirata  <kazu@cs.umass.edu>
1885
1886         * call.c, semantics.c: Follow spelling conventions.
1887         * class.c: Fix a comment typo.
1888
1889 2004-09-16  Geoffrey Keating  <geoffk@apple.com>
1890
1891         PR pch/13361
1892         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
1893         (handle_pragma_implementation): Likewise.
1894
1895 2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
1896             Zack Weinberg  <zack@codesourcery.com>
1897
1898         * cp-tree.def: Use tree_code_class enumeration constants
1899         instead of code letters.
1900         * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
1901         * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
1902         Update for new tree-class enumeration constants.
1903
1904 2004-09-16  Mark Mitchell  <mark@codesourcery.com>
1905
1906         PR c++/16002
1907         * parser.c (cp_parser_simple_declaration): Commit to tentative
1908         parses after seeing a decl-specifier.
1909         (cp_parser_simple_declaration): Eliminate spurious message.
1910         (cp_parser_init_declarator): Adjust error message.
1911
1912         PR c++/16029
1913         * lex.c (unqualified_name_lookup_error): Mark the dummy
1914         declaration as used.
1915
1916         PR c++/17501
1917         * parser.c (cp_parser_nested_name_specifier): Do not resolve
1918         typename types if the user explicitly said "typename".
1919
1920 2004-09-16  Andrew MacLeod  <amacleod@redhat.com>
1921
1922         * error.c (dump_decl): Make sure there is lang_specific info before
1923         checking for DTOR and CTOR decls.
1924
1925 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
1926
1927         * class.c (copy_virtuals): Remove.
1928         (build_primary_vtable): Use copy_list directly.
1929         (build_secondary_vtable): Likewise.
1930         (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
1931         (create_vtable_ptr): Likewise.
1932
1933 2004-09-16  Kazu Hirata  <kazu@cs.umass.edu>
1934
1935         * search.c: Follow spelling conventions.
1936
1937 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
1938
1939         * cp-tree.h (struct lang_type_class): Make pure_virtuals a
1940         VEC(tree).
1941         (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
1942         comments.
1943         * call.c (build_new_method_call): Don't confirm a pure virtual is
1944         in CLASSTYPE_PURE_VIRTUALS.  Reorder checks. Make it a warning.
1945         * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
1946         (fixup_inline_methods, finish_struct): Likewise.
1947         * decl.c (finish_method): Likewise.
1948         * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
1949         CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
1950         * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
1951         vector to avoid repeating the list in error messages.
1952
1953 2004-09-15  Mark Mitchell  <mark@codesourcery.com>
1954
1955         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
1956         * cp-tree.h (cxx_comdat_group): Declare.
1957         * decl.c (cxx_comdat_group): New function.
1958
1959 2004-09-15  Nathan Sidwell  <nathan@codesourcery.com>
1960
1961         * search.c (get_pure_virtuals): Remove unused variables.
1962
1963         * cp-tree.h (struct lang_decl_flags): Remove
1964         needs_final_overrider.
1965         (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
1966         * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
1967         * class.c (finish_struct_bits): Correct comment about
1968         CLASSTYPE_PURE_VIRTUALS.
1969         * search.c (get_pure_virtuals): Remove useless loop.
1970
1971 2004-09-14  Mark Mitchell  <mark@codesourcery.com>
1972
1973         PR c++/17324
1974         * mangle.c (partially_mangled_name): New variable.
1975         (partially_mangled_name_len): Likewise.
1976         (save_partially_mangled_name): New function.
1977         (restore_partially_mangled_name): Likewise.
1978         (write_encoding): Save and restore partially mangled names around
1979         calls to get_mostly_instantiated_function_type.
1980         (write_unqualified_name): Likewise.
1981
1982 2004-09-14  Nathan Sidwell  <nathan@codesourcery.com>
1983
1984         * pt.c (unify): Replace gcc_unreachable with gcc_assert.
1985
1986 2004-09-13  Mark Mitchell  <mark@codesourcery.com>
1987
1988         PR c++/16162
1989         * parser.c (cp_parser_id_expression): Correct value for
1990         is_declarator.
1991         (cp_parser_nested_name_specifier_opt): Look through typenames as
1992         necessary.
1993         (cp_parser_template_name): Honor check_dependency_p.
1994
1995         PR c++/16716
1996         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
1997         Robustify.
1998
1999         PR c++/17327
2000         * pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
2001         gcc_unreacable.
2002
2003 2004-09-12  Richard Henderson  <rth@redhat.com>
2004
2005         PR c++/16254
2006         * semantics.c (maybe_cleanup_point_expr): Don't call fold.
2007         * typeck.c (condition_conversion): Likewise.
2008
2009 2004-09-11  Richard Henderson  <rth@redhat.com>
2010
2011         PR c++/17404
2012         * pt.c (cur_stmt_expr): Move from tsubst_expr.
2013         (tsubst_expr) <case STMT_EXPR>: Move ...
2014         (tsubst_copy_and_build): ... here.
2015
2016 2004-09-10  Zack Weinberg  <zack@codesourcery.com>
2017
2018         * cp-tree.h (interface_only, interface_unknown): Delete declarations;
2019         comment explaining them moved to c-common.h.
2020         * lex.c (interface_only, interface_unknown, extract_interface_info):
2021         Delete definitions.
2022         (cxx_finish): Don't reset interface_unknown.
2023         (handle_pragma_interface): Don't set interface_only and
2024         interface_unknown; just the like-named fields in finfo.
2025         (handle_pragma_implementation): Adjust comment.
2026         * decl2.c (cp_finish_file): Don't reset interface_only and
2027         interface_unknown.
2028         * method.c (synthesize_method): Don't reset interface_unknown or
2029         call extract_interface_info.
2030         * pt.c (pop_tinst_level): Don't call extract_interface_info.
2031         * decl.c (start_cleanup_fn): Don't save or restore interface_only
2032         and interface_unknown.
2033         (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
2034         and use the result instead of the interface_only/interface_unknown
2035         globals.
2036         (start_preparsed_function): Likewise.
2037         * lex.c (cxx_make_type): Likewise.
2038         * semantics.c (begin_class_definition): Likewise.
2039         (expand_body): Don't call extract_interface_info.
2040
2041 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
2042
2043         * decl.c (objc_mark_locals_volatile): Make description of
2044         routine more descriptive; only mark VAR_DECLs at each
2045         binding level.
2046
2047 2004-09-10  Richard Henderson  <rth@redhat.com>
2048
2049         PR c++/17386
2050         * call.c (build_vfield_ref): Move...
2051         * class.c (build_vfield_ref): ... here.  Convert datum to the
2052         primary base containing the vptr.
2053         (make_new_vtable): Simplify build_primary_vtable arguments.
2054         (finish_struct_1): Do not duplicate TYPE_VFIELD.
2055         * typeck.c (build_class_member_access_expr): Don't warn for
2056         null object access to base fields.
2057
2058 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
2059
2060         * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
2061         New functions, to be called from ObjC++.
2062
2063 2004-09-10  Kazu Hirata  <kazu@cs.umass.edu>
2064
2065         * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
2066         name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
2067         comment typos.
2068
2069 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
2070
2071         * typeck.c (build_c_cast): Preserve the cast if casting
2072         to and from an Objective-C type.
2073
2074 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
2075
2076         * Make-lang.in (cp/typeck.o): Depend on c-common.h.
2077         * typeck.c: Include c-common.h.
2078         (comptypes): For RECORD_TYPEs, call objc_comptypes() and
2079         return the result if nonnegative.
2080
2081 2004-09-09  Zack Weinberg  <zack@codesourcery.com>
2082
2083         * decl2.c (import_export_class)
2084         * lex.c (handle_pragma_interface):
2085         Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
2086
2087 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
2088
2089         * Make-lang.in (cp/semantics.o): Depend on c-common.h.
2090         * semantics.c: Include c-common.h.
2091         (finish_compound_stmt): Call objc_clear_super_receiver().
2092
2093 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
2094
2095         * cp-tree.h (do_poplevel): New prototype.
2096         * semantics.c (do_poplevel): Make externally visible.
2097
2098 2004-09-08  Nathan Sidwell  <nathan@codesourcery.com>
2099
2100         * cp-tree.h (tree_pair_s): Define a GC'd vector.
2101         * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
2102         * semantics.c (deferred_access): Likewise.
2103
2104 2004-09-06  Daniel Jacobowitz  <dan@debian.org>
2105
2106         * semantics.c (expand_body): Assert that we are not nested.
2107
2108 2004-09-06  Zack Weinberg  <zack@codesourcery.com>
2109
2110         * decl.c (build_enumerator): Use add_double and int_fits_type_p
2111         instead of cp_build_binary_op, to avoid creating short-lived trees.
2112         * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
2113         lookahead instead of backtracking.  Move some code to avoid a
2114         conditional branch.
2115         (cp_parser_enum_specifier): Avoid duplication of effort with caller.
2116         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
2117         (cp_parser_enumerator_list, cp_parser_enumerator_definition):
2118         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
2119
2120 2004-09-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2121
2122         * decl.c (grok_declarator): Remove a redundant semicolon.
2123
2124         * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
2125         Correct comments describing function parameters.
2126
2127 2004-09-03  Matt Austern  <austern@apple.com>
2128         Compile speed improvement.
2129         * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
2130         Otherwise define a stub macro that expands to nothing.
2131         (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set.  Otherwise
2132         define a stub macro that expands to 0.
2133         (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
2134         (cp_lexer_stop_debugging): Likewise.
2135         (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set.  Otherwise
2136         define a stub macro that expands to NULL.
2137         (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
2138         (cp_lexer_new_from_tokens): Likewise.
2139
2140 2004-09-03  Jan Hubicka  <jh@suse.cz>
2141
2142         * decl.c (finish_function): Clean out pointers we no longer need.
2143
2144 2004-09-03  Jan Beulich  <jbeulich@novell.com>
2145
2146         * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
2147         than "-lm".
2148
2149 2004-09-02  Paul Brook  <paul@codesourcery.com>
2150
2151         * decl2.c (determine_visibility): Only check data visibility
2152         for VAR_DECLS.
2153
2154 2004-08-31  Mark Mitchell  <mark@codesourcery.com>
2155
2156         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
2157         * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
2158         * decl2.c (determine_visibility): Honor
2159         TARGET_CXX_EXPORT_CLASS_DATA.
2160
2161         * class.c (key_method): Rename to ...
2162         (determine_key_method): ... this.
2163         (finish_struct_1): Adjust accordingly.
2164         * cp-tree.h (key_method): Declare.
2165         * decl2.c (maybe_emit_vtables): Determine the key method here if
2166         it has not already been done.
2167
2168 2004-08-31  Ziemowit Laski  <zlaski@apple.com>
2169
2170         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
2171         (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
2172         (cp/cp-decl.c): Do not depend on gtype-cp.h.
2173         (cp/cp-objcp-common.o): New target.
2174         * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
2175         (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
2176         cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
2177         prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
2178         respectively.
2179         (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
2180         LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
2181         LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
2182         LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
2183         LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
2184         LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
2185         LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
2186         LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
2187         LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
2188         LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
2189         LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
2190         LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
2191         LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
2192         LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
2193         LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
2194         LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
2195         LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
2196         LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
2197         LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
2198         LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
2199         LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
2200         LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
2201         LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
2202         LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
2203         LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
2204         LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
2205         LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
2206         LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
2207         LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
2208         LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
2209         LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
2210         hooks to cp-objcp-common.h.
2211         (finish_file): New function.
2212         * cp-objcp-common.c: New file.
2213         * cp-objcp-common.h: New file.
2214         * cp-tree.h (cp_finish_file): New prototype.
2215         * decl.c: Do not include gtype-cp.h.
2216         * decl2.c (finish_file): Rename to cp_finish_file.
2217
2218 2004-08-31  Richard Henderson  <rth@redhat.com>
2219
2220         PR c++/17221
2221         * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
2222         (tsubst_copy_and_build): ... here.
2223
2224 2004-08-30  Mark Mitchell  <mark@codesourcery.com>
2225
2226         * cp-tree.h (initialize_artificial_var): Declare.
2227         * decl.c (initialize_artifical_var): New function.
2228         * class.c (initialize_array): Remove.
2229         (initialize_vtable): Use initialize_artificial_var.
2230         (build_vtt): Likewise.
2231         (build_ctor_vtbl_group): Likewise.
2232
2233 2004-08-30  Richard Henderson  <rth@redhat.com>
2234
2235         * class.c (build_base_path): Use build_address directly.
2236         * typeck.c (build_unary_op): Don't lower &a.b to pointer
2237         arithmetic directly.
2238         * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
2239         means !initializer_constant_valid_p.
2240
2241 2004-08-30  Richard Henderson  <rth@redhat.com>
2242
2243         * class.c (fixed_type_or_null): Use get_base_address before
2244         assuming an ADDR_EXPR is non-null.
2245
2246 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
2247
2248         * name-lookup.c (pop_binding, pushdecl,
2249         set_identifier_type_value_with_scope, push_overloaded_decl,
2250         arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
2251         * parser.c (cp_parser_diagnose_invalid_type_name,
2252         cp_parser_postfix_expression, cp_parser_unary_expression,
2253         cp_parser_check_declarator_template_para): Likewise.
2254         * pt.c (push_inline_template_parms_recursive,
2255         check_explicit_specialization, convert_nontype_argument,
2256         coerce_template_template_parms, uses_template_parms,
2257         instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
2258         tsubst_expr, instantiate_template,
2259         maybe_adjust_types_for_deduction, type_unification_real,
2260         resolve_overloaded_unification, template_decl_level,
2261         type_dependent_expression_p): Likewise.
2262         * search.c (lookup_base_r): Likewise.
2263         * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
2264         * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
2265         verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
2266         * typeck.c (common_type, get_member_function_from_ptrfunc,
2267         build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
2268         * typeck2.c (cxx_incomplete_type_diagnostic,
2269         split_nonconstant_init_1, store_init_value,
2270         process_init_constructor): Likewise.
2271
2272 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
2273
2274         * call.c (check_dtor_name): Replace abort with gcc_assert or
2275         gcc_unreachable.
2276         (build_call, add_builtin_candidate, build_new_op,
2277         convert_like_real, build_over_call, in_charge_arg_for_name,
2278         source_type, joust): Likewise.
2279         * class.c (build_simple_base_path, get_vcall_index,
2280         finish_struct_1, instantiate_type, get_enclosing_class,
2281         add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
2282         * cp-gimplify.c (cp_genericize): Likewise.
2283         * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
2284         * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
2285         * decl.c (poplevel, make_unbound_class_template, reshape_init,
2286         check_special_function_return_type, grokdeclarator,
2287         grok_op_properties, tag_name, xref_tag, start_preparsed_function,
2288         finish_function): Likewise.
2289         * decl2.c (grokfield, maybe_emit_vtables):Likewise.
2290         * error.c (dump_global_iord, dump_decl, dump_template_decl,
2291         language_to_string): Likewise.
2292         * except.c (choose_personality_routine): Likewise.
2293         * friend.c (do_friend): Likewise.
2294         * g++spec.c (lang_specific_driver): Likewise.
2295         * init.c (build_zero_init, expand_default_init, build_new_1,
2296         build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
2297         * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
2298         * mangle.c (add_substitution, write_unscoped_name,
2299         write_template_prefix, write_identifier,
2300         write_special_name_destructor, write_type, write_builtin_type,
2301         write_expression, write_template_param,
2302         write_java_integer_type_codes): Likewise.
2303         * method.c (implicitly_declare_fn): Likewise.
2304
2305 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
2306
2307         * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
2308         (BINFO_INDIRECT_PRIMARY_P): Remove.
2309         * class.c (determine_primary_base): Rename to ...
2310         (determine_primary_bases): ... here.  Set all primary bases.
2311         (set_primary_base): Remove.
2312         (mark_primary_bases): Remove.
2313         (build_simple_base_path, walk_subobject_offsets,
2314         propagate_binfo_offsets, end_of_class): Adjust.
2315         (layout_class_type): Rename determine_primary_base call.
2316         (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
2317         to type_as_string.
2318         (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
2319         build_rtti_vtbl_entries): Adjust.
2320         * init.c (build_vtbl_address): Adjust.
2321
2322         * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
2323
2324 2004-08-28  Ziemowit Laski  <zlaski@apple.com>
2325
2326         * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
2327         CXX_AND_OBJCXX_OBJS.
2328         (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
2329         separately on the link line.
2330
2331 2004-08-28  Jason Merrill  <jason@redhat.com>
2332
2333         * decl.c (expand_static_init): Avoid bogus warnings.
2334
2335 2004-08-27  Jason Merrill  <jason@redhat.com>
2336
2337         PR c++/16851
2338         * tree.c (stabilize_init): See through a COMPOUND_EXPR.
2339
2340         PR c++/13684
2341         * decl.c (expand_static_init): Use thread-safety API.
2342         (register_dtor_fn): Return the call, don't expand it.
2343         * tree.c (add_stmt_to_compound): New fn.
2344         (stabilize_call): Use it.
2345
2346 2004-08-27  Richard Henderson  <rth@redhat.com>
2347
2348         * cp-tree.def (OFFSETOF_EXPR): New.
2349         * parser.c (cp_parser_builtin_offsetof): Either built an
2350         OFFSETOF_EXPR, or call fold_offsetof immediately.
2351         * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
2352
2353 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
2354
2355         * call.c (validate_conversion_obstack): Replace
2356         my_friendly_assert with gcc_assert or gcc_unreachable.
2357         (direct_reference_binding, merge_conversion_sequences,
2358         build_user_type_conversion_1, perform_overload_resolution,
2359         build_op_delete_call, enforce_access, call_builtin_trap,
2360         build_over_call, build_special_member_call, build_new_method_call,
2361         initialize_reference): Likewise.
2362         * class.c (build_base_path, build_primary_vtable, alter_access,
2363         check_bases, update_vtable_entry_for_fn, layout_empty_base,
2364         clone_function_decl, adjust_clone_args,
2365         type_requires_array_cookie, include_empty_classes,
2366         finish_struct_1, resolve_address_of_overloaded_function,
2367         instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
2368         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
2369         accumulate_vtbl_inits, build_vtbl_initializer,
2370         build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
2371         * cvt.c (build_up_reference, convert_to_reference): Likewise.
2372         * decl.c (poplevel, duplicate_decls, make_typename_type,
2373         cxx_init_decl_processing, reshape_init, check_initializer,
2374         make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
2375         expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
2376         grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
2377         xref_basetypes, start_preparsed_function, save_function_data,
2378         finish_function, finish_method, maybe_register_incomplete_var,
2379         complete_vars): Likewise.
2380         * decl2.c (grok_array_decl, check_member_template,
2381         check_classfn, finish_static_data_member_decl, coerce_new_type,
2382         coerce_delete_type, import_export_class, decl_needed_p,
2383         determine_visibility, import_export_decl, build_cleanup,
2384         start_static_initialization_or_destructi, do_static_destruction,
2385         prune_vars_needing_no_initialization,
2386         build_offset_ref_call_from_tree): Likewise.
2387         * error.c (dump_decl, dump_expr): Likewise.
2388         * init.c (finish_init_stmts, build_zero_init,
2389         expand_virtual_init, expand_default_init, expand_aggr_init_1,
2390         build_offset_ref, build_new_1, build_delete, build_vbase_delete):
2391         Likewise.
2392         * mangle.c (write_method_parms, write_template_args,
2393         write_expression, write_template_arg): Likewise.
2394         * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
2395         * name-lookup.c (pop_binding, begin_scope, leave_scope,
2396         resume_scope, push_using_decl, validate_nonmember_using_decl,
2397         is_ancestor, poplevel_class, set_inherited_value_binding_p,
2398         push_class_level_binding, do_class_using_decl, push_namespace,
2399         pop_namespace, add_using_namespace, ambiguous_decl,
2400         lookup_namespace_name, lookup_type_current_level,
2401         maybe_process_template_type_declaration): Likewise.
2402         * parser.c (cp_lexer_peek_nth_token,
2403         cp_parser_parse_and_diagnose_invalid_typ,
2404         cp_parser_translation_unit, cp_parser_template_id,
2405         cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
2406         * pt.c (push_access_scope, finish_member_template_decl,
2407         push_inline_template_parms_recursive, add_outermost_template_args,
2408         get_innermost_template_args, begin_explicit_instantiation,
2409         end_explicit_instantiation, retrieve_specialization,
2410         is_specialization_of, is_specialization_of_friend,
2411         register_specialization, check_explicit_specialization,
2412         comp_template_parms, process_template_parm,
2413         process_partial_specialization, convert_nontype_argument,
2414         coerce_template_template_parms, coerce_template_parms,
2415         mangle_class_name_for_template, lookup_template_function,
2416         lookup_template_class, instantiate_class_template, tsubst_decl,
2417         tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
2418         instantiate_template, fn_type_unification, type_unification_real,
2419         get_template_base, regenerate_decl_from_template,
2420         template_for_substitution, instantiate_decl,
2421         get_mostly_instantiated_function_type, dependent_scope_ref_p,
2422         value_dependent_expression_p, resolve_typename_type): Likewise.
2423         * repo.c (repo_emit_p): Likewise.
2424         * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
2425         create_tinfo_types, emit_tinfo_decl): Likewise.
2426         * search.c (lookup_base_r, lookup_base, lookup_field_1,
2427         dfs_access_in_type, build_baselink, lookup_member,
2428         adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
2429         * semantics.c (perform_or_defer_access_check,
2430         finish_non_static_data_member, finish_stmt_expr_expr,
2431         finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
2432         finish_template_template_parm, finish_member_declaration,
2433         emit_associated_thunks): Likewise.
2434         * tree.c (build_target_expr_with_type, force_target_expr,
2435         copy_binfo, get_first_fn, cp_tree_equal): Likewise.
2436         * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
2437         cxx_sizeof_or_alignof_type, perform_integral_promotions,
2438         build_class_member_access_expr, finish_class_member_access_expr,
2439         build_ptrmemfunc_access_expr, build_unary_op,
2440         unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
2441         build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
2442         * typeck2.c (complete_type_check_abstract,
2443         abstract_virtuals_error, process_init_constructor,
2444         add_exception_specifier): Likewise.
2445
2446 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
2447
2448         * class.c (build_vtbl_initializer): Use ssize_int.
2449         * decl.c (complete_array_type): Likewise.
2450         * method.c (finish_thunk): Likewise.
2451         * search.c (get_dynamic_base_type): Likewise.
2452
2453 2004-08-26  Richard Henderson  <rth@redhat.com>
2454
2455         * cp-tree.h (DECL_FIELD_IS_BASE): New.
2456         * class.c (build_base_field): Set it.
2457         (build_simple_base_path): Use it.
2458         (fixed_type_or_null): Don't consider base fields definitive.
2459
2460 2004-08-25  Roger Sayle  <roger@eyesopen.com>
2461
2462         PR middle-end/16693
2463         PR tree-optimization/16372
2464         * decl.c (finish_enum): Make the precision of the enumerated type
2465         the same width as the underlying integer type.
2466
2467 2004-08-25  Mark Mitchell  <mark@codesourcery.com>
2468
2469         PR c++/17155
2470         * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
2471         functions.
2472
2473         * mangle.c (get_identifier_nocopy): Add cast.
2474
2475         * cp-tree.h (mangle_type): Remove.
2476         * mangle.c (globals): GTY it.
2477         (mangle_obstack): New variable.
2478         (name_obstack): Likewise.
2479         (name_base): Likewise.
2480         (write_char): Adjust accordingly.
2481         (write_chars): Likewise.
2482         (write_string): Likewise.
2483         (start_mangling): Initialize G.substitutions only one.  Add
2484         ident_p parameter.
2485         (finish_mangling): Use VARRAY_CLEAR to reclaim
2486         storage in G.substitutions.  Use obstack_finish.
2487         (init_mangle): Adjust for changes to variable names above.
2488         Initialize G.substitutions.
2489         (mangle_decl_string): Adjust call to start_mangling.
2490         (get_identifier_nocopy): New function.
2491         (mangle_decl): Use it.
2492         (mangle_type_string): Adjust call to start_mangling.
2493         (mangle_special_for_type): Likewise.
2494         (mangle_vtt_for_type): Likewise.
2495         (mangle_ctor_vtbl_for_type): Likewise.
2496         (mangle_thunk): Likewise.
2497         (mangle_guard_variable): Likewise.
2498         (mangle_ref_init_variable): Likewise.
2499
2500 2004-08-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2501
2502         PR c++/14428
2503         * pt.c (redeclare_class_template): Check the type of non-type and
2504         template template parameter.
2505
2506 2004-08-25  Nathan Sidwell  <nathan@codesourcery.com>
2507
2508         * call.c (convert_class_to_reference): Adjust build_int_cst calls.
2509         (build_user_type_conversion_1, convert_like_real,
2510         build_java_interface_fn_ref, build_special_member_call): Likewise.
2511         * class.c (finish_struct_1, build_vtbl_initializer): Likewise.
2512         * cp-gimplify.c (cp_gimplify_expr): Likewise.
2513         * cvt.c (cp_convert_to_pointer): Likewise.
2514         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
2515         * decl2.c (start_static_initialization_or_destruction,
2516         generate_ctor_or_dtor_function): Likewise.
2517         * except.c (build_throw): Likewise.
2518         * mangle.c (write_integer_cst): Likewise.
2519         * method.c (finish_thunk): Likewise.
2520         * rtti.c (build_headof, get_tinfo_decl_dynamic,
2521         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
2522         get_pseudo_ti_init): Likewise.
2523         * search.c (get_dynamic_cast_base_type): Likewise.
2524
2525 2004-08-25  Zack Weinberg  <zack@codesourcery.com>
2526
2527         * class.c, search.c: Remove references to DWARF_DEBUG.
2528
2529 2004-08-25  Adam Nemet  <anemet@lnxw.com>
2530
2531         * repo.c (extract_string): Reset backquote after one character.
2532         (get_base_filename): Fix indentation.
2533
2534 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
2535
2536         * decl.c (cxx_init_decl_processing): Adjust
2537         build_common_tree_nodes call.
2538
2539 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
2540
2541         PR c++/16889
2542         * (is_subobject_of_p): Resurrect & optimize.
2543         (lookup_field_r): Use it.
2544
2545 2004-08-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2546
2547         PR c++/16706
2548         * search.c (friend_accessible_p): Increment processing_template_decl
2549         when deal with TEMPLATE_DECL of SCOPE.
2550
2551 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
2552
2553         PR c++/17149
2554         * semantics.c (check_accessibility_of_qualified_id): Defer check
2555         if qualifying_type is a template parameter.
2556
2557 2004-08-23  Mark Mitchell  <mark@codesourcery.com>
2558
2559         PR c++/17163
2560         * pt.c (instantiate_decl): Do not try to apply
2561         DECL_DECLARED_INLINED_P to a VAR_DECL.
2562
2563         * search.c (build_baselink): Fix typo in comment.
2564
2565 2004-08-22 Andrew Pinski  <apinski@apple.com>
2566
2567         Revert:
2568         2004-08-22  Andrew Pinski  <apinski@apple.com>
2569         PR c++/14029
2570         * typeck.c (build_unary_op): Use &a.b if the folded lowered
2571         expression is not constant.
2572
2573 2004-08-23  Nathan Sidwell  <nathan@codesourcery.com>
2574
2575         * name-lookup.c (pushdecl): Rename build_type_copy call.
2576         * tree.c (cp_build_qualified_type_real,
2577         build_exception_variant, handle_java_interface_attribute): Likewise.
2578
2579 2004-08-22  Andrew Pinski  <apinski@apple.com>
2580
2581         PR c++/14029
2582         * typeck.c (build_unary_op): Use &a.b if the folded lowered
2583         expression is not constant.
2584
2585 2004-08-20  Mark Mitchell  <mark@codesourcery.com>
2586
2587         PR c++/17121
2588         * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P.
2589
2590 2004-08-21  Joseph S. Myers  <jsm@polyomino.org.uk>
2591
2592         PR c++/17120
2593         * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for
2594         MODOP_EXPR.
2595
2596 2004-08-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2597
2598         * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION
2599         before calling comp_template_args.
2600
2601 2004-08-20  Nathan Sidwell  <nathan@codesourcery.com>
2602
2603         * class.c (build_vtbl_initializer): Use build_int_cst for
2604         negative size types.
2605         * decl.c (complete_array_type): Likewise.
2606         * method.c (finish_thunk): Likewise.
2607
2608 2004-08-20  Andreas Tobler  <a.tobler@schweiz.ch>
2609
2610         * tree.c: Remove unused mark_local_for_remap_r.
2611
2612 2004-08-19  Eric Christopher  <echristo@redhat.com>
2613
2614         * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
2615         * tree.c (cxx_unsave_expr_now): Delete.
2616         (cp_unsave_r): Ditto.
2617
2618 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
2619
2620         PR c++/15890
2621         * pt.c (push_template_decl_real): Disallow template allocation
2622         functions with fewer than two parameters.
2623
2624 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
2625
2626         * cp-tree.h (build_shared_int_cst): Remove.
2627         * tree.c (shared_int_cache): Remove.
2628         (build_shared_int_cst): Remove.
2629         * class.c (finish_struct_1): Use build_int_cst.
2630
2631 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
2632
2633         * decl.c (finish_enum): Do not copy value node early, copy
2634         later.
2635         * lex.c (cxx_init): Force null_node to be unique.
2636
2637 2004-08-19  Joseph S. Myers  <jsm@polyomino.org.uk>
2638
2639         PR c++/17041
2640         * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
2641         from input for MODOP_EXPR.
2642
2643 2004-08-18  Mark Mitchell  <mark@codesourcery.com>
2644
2645         * pt.c (dependent_template_p): Fix typo in commment.
2646
2647         PR c++/17068
2648         * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
2649         dependent.
2650
2651 2004-08-17  Mark Mitchell  <mark@codesourcery.com>
2652
2653         PR c++/16246
2654         * pt.c (unify): Tidy ARRAY_TYPE handling.  Make sure that non-type
2655         arguments have the same type as the corresponding parameter.
2656
2657         PR c++/16215
2658         * parser.c (cp_parser_name_lookup_error): If parser->object_scope
2659         is set use it for diagnostic purposes.
2660         (cp_parser_pseudo_destructor_name): Remove special-case error
2661         message.
2662
2663         PR c++/15871
2664         * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions.
2665
2666         PR c++/16965
2667         * cp-tree.h (qualified_name_lookup_error): Add parameter.
2668         * name-lookup.c (do_class_using_decl): Restrict set of entities
2669         passed to cp_emit_debug_info_for_using more carefully.
2670         (lookup_qualified_name): Allow lookup_member to return sets of
2671         ambiguous entries.
2672         * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter.
2673         (cp_parser_primary_expression): Handle ambiguous lookups.
2674         (cp_parser_template_name): Adjust use of cp_parser_lookup_name.
2675         (cp_parser_template_argument): Likewise.
2676         (cp_parser_elaborate_type_specifier): Likewise.
2677         (cp_parser_namespace_name): Likewise.
2678         (cp_parser_class_name): Likewise.
2679         (cp_parser_lookup_name_simple): Likewise.
2680         * pt.c (tsubst_qualified_id): Handle ambiguous results.
2681         (tsubst_expr): Likewise.
2682         * semantics.c (qualified_name_lookup_error): Add decl paramter.
2683         For ambiguous lookups, print candidates.
2684
2685 2004-08-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2686
2687         PR c++/6749
2688         * pt.c (instantiate_pending_templates): Add int parameter.  Don't
2689         return anything.
2690         * cp-tree.h (instantiate_pending_templates): Adjust prototype.
2691         * decl2.c (finish_file): Adjust call to
2692         instantiate_pending_templates.
2693
2694 2004-08-15  Roger Sayle  <roger@eyesopen.com>
2695
2696         * call.c (build_vfield_ref, build_call, build_conditional_expr,
2697         convert_arg_to_ellipsis, build_x_va_arg, build_over_call,
2698         build_java_interface_fn_ref, build_special_member_call,
2699         build_new_method_call, initialize_reference): Replace calls to
2700         build with calls to buildN.
2701         * class.c (build_base_path, convert_to_base_statically,
2702         build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits,
2703         build_vtbl_initializer): Likewise.
2704         * cp-gimplify.c (genericize_try_block, genericize_catch_block,
2705         gimplify_if_stmt, cp_genericize_r): Likewise.
2706         * cvt.c (convert_to_void): Likewise.
2707         * decl.c (check_initializer, finish_constructor_body,
2708         finish_destructor_body): Likewise.
2709         * error.c (dump_expr): Likewise.
2710         * except.c (build_exc_ptr, expand_start_catch_block, build_throw):
2711         Likewise.
2712         * init.c (perform_member_init, expand_virtual_init,
2713         expand_cleanup_for_base, build_init, expand_default_init,
2714         build_offset_ref, decl_constant_value, build_new, build_new_1,
2715         build_vec_delete_1, build_vec_init, build_delete,
2716         push_base_cleanups, build_vec_delete): Likewise.
2717         * mangle.c (write_integer_cst): Likewise.
2718         * method.c (thunk_adjust, do_build_copy_constructor,
2719         do_build_assign_ref): Likewise.
2720         * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build,
2721         unify, build_non_dependent_expr): Likewise.
2722         * rtti.c (build_headof, build_typeid, ifnonnull,
2723         build_dyanmic_cast_1, tinfo_base_init): Likewise.
2724         * semantics.c (begin_compound_stmt, finish_call_expr,
2725         finish_pseudo_destructor_expr, finish_id_expression,
2726         simplify_aggr_init_expr, finalize_nrv_r): Likewise.
2727         * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top,
2728         array_type_nelts_total, stabilize_call): Likewise.
2729         * typeck.c (decay_conversion, build_class_member_access_expr,
2730         lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref,
2731         get_member_function_from_ptrfunc, build_binary_op, pointer_diff,
2732         build_x_unary_op, build_unary_op, unary_complex_lvalue,
2733         build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst,
2734         check_return_expr): Likewise.
2735         * typeck2.c (split_nonconstant_1, split_nonconstant_init_1,
2736         split_nonconstant_init, store_init_value, build_m_component_ref):
2737         Likewise.
2738
2739 2004-08-15  Nathan Sidwell  <nathan@codesourcery.com>
2740
2741         * call.c (convert_class_to_reference,
2742         build_user_type_conversion_1, convert_like_real,
2743         build_java_interface_fn_ref, build_special_member_call): Use
2744         build_int_cst.
2745         * class.c (build_vtbl_initializer): Likewise.
2746         * cp-gimplify.c (cp_gimplify_expr): Likewise.
2747         * cvt.c (cp_convert_to_pointer): Likewise.
2748         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
2749         * decl2.c (start_static_initialization_or_destruction,
2750         generate_ctor_or_dtor_function): Likewise.
2751         * except.c (build_throw): Likewise.
2752         * lex.c (cxx_init): Likewise.
2753         * mangle.c (write_integer_cst): Likewise.
2754         * rtti.c (build_headof, get_tinfo_decl_dynamic,
2755         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
2756         get_pseudo_ti_init): Likewise.
2757         * search.c (get_dynamic_cast_base_type): Likewise.
2758         * tree.c (build_shared_int_cst): Likewise.
2759
2760 2004-08-12  Mark Mitchell  <mark@codesourcery.com>
2761
2762         PR c++/16273
2763         * class.c (count_depth_data): New type.
2764         (dfs_depth_post): New function.
2765         (dfs_depth_q): Likewise.
2766         (find_final_overrider_data_s): Change type of vpath.
2767         Add vpath_list.
2768         (dfs_find_final_overrider_1): New function.
2769         (dfs_find_final_overrider): Use it.
2770         (dfs_find_final_overrider_q): Adjust use of vpath.
2771         (dfs_find_final_overrider_post): Likewise.
2772         (find_final_overrider): Use dfs_depth.  Allocate and deallocate
2773         vpath_list.
2774
2775 2004-08-12 Jan Beulich <jbeulich@novell.com>
2776
2777         * parser.c (cp_parser_asm_definition): Properly consume scope operator
2778         tokens preceding the clobbers. Don't check for scope operator
2779         following inputs. Simplify inputs handling to match that now used for
2780         clobbers.
2781
2782 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
2783
2784         PR c++/16698
2785         * except.c (build_throw): Allocate cleanup_type and the function
2786         for __cxa_throw separately.
2787
2788         PR c++/16853
2789         * call.c (standard_conversion): Do not accept conversions between
2790         pointers to members if the class types are unrelated.
2791
2792         PR c++/16618
2793         * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile
2794         char &" instead of just "char &".
2795
2796         PR c++/16870
2797         * pt.c (tsubst): Just return the unknown_type_node.
2798
2799 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
2800
2801         PR c++/16964
2802         * parser.c (cp_parser_class_specifier): Robustify.
2803
2804         PR c++/16904
2805         * pt.c (tsubst_copy_and_build): Complain about invalid
2806         qualification.
2807
2808         PR c++/16929
2809         * pt.c (tsubst_default_argument): Clear out current_class_ptr and
2810         current_class_ref while tsubsting.
2811
2812 2004-08-10  Mark Mitchell  <mark@codesourcery.com>
2813
2814         PR c++/16971
2815         * parser.c (cp_parser_init_declarator): Robustify.
2816
2817 2004-08-06  Richard Sandiford  <rsandifo@redhat.com>
2818
2819         * typeck2.c (process_init_constructor): Guard the missing field warning
2820         with warn_missing_field_initializers rather than extra_warnings.
2821
2822 2004-08-06  Paolo Bonzini  <bonzini@gnu.org>
2823
2824         * class.c (instantiate_type) <ENTRY_VALUE_EXPR>: Do not handle.
2825
2826 2004-08-05  Mark Mitchell  <mark@codesourcery.com>
2827
2828         * decl.c (start_preparsed_function): Move determine_visibility
2829         call.
2830         * decl2.c (determine_visibility): Incorporate dllexport testing.
2831
2832 2004-08-05  Geoffrey Keating  <geoffk@apple.com>
2833
2834         * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option
2835         means that libstdc++ is needed.
2836
2837 2004-08-05  Nathan Sidwell  <nathan@codesourcery.com>
2838
2839         * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call.
2840
2841 2004-08-04  Geoffrey Keating  <geoffk@apple.com>
2842
2843         * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
2844         than passing it as a parameter to rest_of_decl_compilation.
2845         * decl2.c (grokfield): Use set_user_assembler_name.
2846
2847 2004-08-04  Nathan Sidwell  <nathan@codesourcery.com>
2848
2849         * decl.c (complete_array_type): Don't gratuitously copy
2850         maxindex. Its type is always set.
2851
2852 2004-08-04  Paul Brook  <paul@codesourcery.com>
2853
2854         * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H.
2855         * cp-tree.h (struct language_function): Rename x_dtor_label to
2856         x_cdtor_label.
2857         (dtor_label): Rename ...
2858         (cdtor_label): ... to this.
2859         * decl.c (begin_constructor_body): Remove.
2860         (check_special_function_return_type): Maybe change the return type.
2861         (grokdeclarator): Pass the class type.
2862         (start_preparsed_function): Constructors may need a return label.
2863         (finish_constructor_body, finish_destructor_body): Set the return
2864         value.
2865         (begin_function_body): Don't call begin_constructor_body.
2866         (finish_function): Don't warn for constructors or destructors.
2867         (implicitly_declare_fn): Maybe change the return type.
2868         * optimize.c: Include target.h.
2869         (maybe_clone_body): Remap the function result.
2870         * semantics.c: Include target.h.
2871         (finish_return_stmt): Maybe jump to return label for constructors.
2872
2873 2004-08-03  Mark Mitchell  <mark@codesourcery.com>
2874
2875         * class.c (build_vtable): Do not set DECL_VISIBILITY here.
2876         (check_field_decls): Or here.
2877         (check_methods): Or here.
2878         (initialize_array): Don't mess with DECL_CONTEXT.
2879         * cp-tree.h (start_decl): Adjust prototype.
2880         (determine_visibility): New function.
2881         * decl.c (duplicate_decls): Remove checks for hidden "operator
2882         new".
2883         (build_library_fn_1): Give all library functions default
2884         visibility.
2885         (start_decl): Add pop_scope_p parameter.  Tidy.
2886         (cp_finish_decl): Do not pop scopes here.  Call
2887         determine_visibility for variable definitions.
2888         (start_preparsed_function): Call determine_visibility.
2889         * decl2.c (determine_visibility): New function.
2890         * method.c (use_thunk): Fix formatting.
2891         * parser.c (cp_parser_condition): Adjust calls to start_decl.
2892         (cp_parser_init_declarator): Likewise.
2893         * pt.c (instantiate_decl): Always call pop_nested_class.
2894         * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY.
2895         (tinfo_base_init): Likewise.
2896
2897 2004-08-02  Mark Mitchell  <mark@codesourcery.com>
2898
2899         PR c++/16707
2900         * name-lookup.c (validate_nonmember_using_decl): Robustify.
2901
2902 2004-08-01  Mark Mitchell  <mark@codesourcery.com>
2903
2904         PR c++/16224
2905         * name-lookup.c (decl_namespace): Remove.
2906         (current_decl_namespace): Use decl_namespace_context instead of
2907         decl_namespace.
2908         (push_decl_namespace): Likewise.
2909         (arg_assoc_class): Likewise.
2910         (arg_assoc_type): Likewise.
2911         * pt.c (check_specialization_namespace): New function.
2912         (maybe_process_partial_specialization): Use it.
2913         (register_specialization): Likewise.
2914
2915         PR c++/16489
2916         * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro.
2917         * call.c (null_ptr_cst_p): Handle variables with constant
2918         initializers.
2919         * pt.c (convert_nontype_argument): Use
2920         DECL_INTEGRAL_CONSTANT_VAR_P.
2921         * semantics.c (finish_id_expression): Likewise.
2922
2923         PR c++/16529
2924         * decl.c (duplicate_decls): Reject duplicate namespace
2925         declarations.
2926
2927         PR c++/16810
2928         * typeck.c (build_ptrmemfunc): Loosen assertion.
2929
2930 2004-08-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2931
2932         * call.c (z_candidate::template_decl): Rename from template.
2933         (add_template_candidate_real): Adjust member reference.
2934         (joust): Likewise.
2935
2936 2004-07-29  Mark Mitchell  <mark@codesourcery.com>
2937
2938         * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
2939         (lang_decl_flags): Narrow the width of "languages".  Add
2940         repo_available_p.
2941         (DECL_NEEDED_P): Remove.
2942         (FOR_EACH_CLONE): New macro.
2943         (DECL_REPO_AVAILABLE_P): Likewise.
2944         (DECL_TINFO_P): Likewise.
2945         (set_linkage_according_to_type): Declare.
2946         (import_export_vtable): Remove.
2947         (import_export_tinfo): Likewise.
2948         (mark_needed): New function.
2949         (decl_needed_p): Likewise.
2950         (note_vauge_linkage_fn): Likewise.
2951         (init_repo): Change prototype.
2952         (repo_template_used): Remove.
2953         (repo_template_instantiated): Likewise.
2954         (repo_emit_p): New function.
2955         (repo_export_class_p): Likewise.
2956         (no_linkage_check): Change prototype.
2957         * class.c (set_linkage_according_to_type): New function.
2958         (build_vtable): Use it.  Do not call import_export_vtable.  Set
2959         DECL_IGNORED_P if appropriate.
2960         * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
2961         (make_rtL_for_nonlocal_decls): Check for template instantiations
2962         explicitly.
2963         (grokfndecl): Adjust call to no_linkage_check.
2964         (set_linkage_for_static_data_member): New function.
2965         (grokvardecl): Use it.  Adjust call to no_linkage_check.
2966         (grokdeclarator): Use set_linkage_for_static_data_member.
2967         * decl2.c (note_vague_linkage_fn): New function.
2968         (note_vague_linkage_var): Likewise.
2969         (finish_static_data_member_decl): Use it.
2970         (import_export_vtable): Remove.
2971         (import_export_class): Use repo_export_class_p.
2972         (var_finalized_p): Simplify.
2973         (maybe_emit_vtables): Simplify.
2974         (mark_needed): New function.
2975         (decl_needed_p): Likewise.
2976         (import_export_decl): Add documentation and consistency checks.
2977         Use repo_emit_p.  Handle virtual tables and RTTI information
2978         here.
2979         (import_export_tinfo): Remove.
2980         (write_out_vars): Call import_export_decl.
2981         (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
2982         whenever one is.
2983         (finish_file): Use decl_needed_p.  Do not call import_export_decl
2984         for undefined static data members.  Do not warn about undefined
2985         inlines when using a repository.
2986         (mark_used): Use note_vague_linkage_fn.  Always defer template
2987         instantiations.
2988         * lex.c (cxx_init): Adjust call to init_repo.  Always set
2989         flag_unit_at_a-time.
2990         * method.c (synthesize_method): Remove unncessary
2991         import_export_decl call.
2992         (implicitly_declare_fn): Use set_linkage_according_to_type.
2993         * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
2994         * pt.c (instantiate_class_template): Don't redundantly add classes
2995         to keyed_classes.  Don't call repo_template_used.
2996         (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
2997         templates with internal linkage.
2998         (check_instantiated_args): Adjust call to no_linkage_check.
2999         (instantiate_template): Use FOR_EACH_CLONE.
3000         (mark_definable): New function.
3001         (mark_decl_instantiated): Use it.
3002         (do_decl_instantiation): Adjust tests for explicit instantiation
3003         after "extern template".
3004         (instantiate_class_member): Do not use repo_template_instantiated.
3005         (do_type_instantiation): Simplify.
3006         (instantiate_decl): Use mark_definable.  Check repo_emit_p.
3007         Simplify.
3008         * repo.c (repo_get_id): Remove.
3009         (original_repo): Remove.
3010         (IDENTIFIER_REPO_USED): Remove.
3011         (IDENTIFIER_REPO_CHOSEN): Remove.
3012         Remove all #if 0'd code.
3013         (repo_template_used): Remove.
3014         (repo_template_instantiated): Remove.
3015         (temporary_obstack_initialized_p): New variable.
3016         (init_repo): Register with lang_post_pch_load.  Avoid creating
3017         identifiers unnecessarily.  Don't use original_repo.  Close the
3018         file here.
3019         (reopen_repo_file_for_write): Not here.
3020         (finish_repo): Always write out a new repository file.
3021         (repo_emit_p): New function.
3022         (repo_export_class_p): Likewise.
3023         * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
3024         (involves_incomplete_p): New function.
3025         (tinfo_base_init): Use it.
3026         (ptr_initializer): Remove non_public_ptr parameter.
3027         (ptm_initializer): Likewise.
3028         (get_pseudo_ti_init): Likewise.
3029         (unemitted_tinfo_decl_p): Remove.
3030         (emit_tinfo_decl): Use import_export_decl.
3031         * semantics.c (expand_body): Move updates of static_ctors and
3032         static_dtors to ...
3033         (expand_or_defer_fn): ... here.
3034         * tree.c (no_linkage_check): Add relaxed_p parameter.
3035
3036 2004-07-28  Eric Christopher  <echristo@redhat.com>
3037
3038         * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
3039
3040 2004-07-28  Nathan Sidwell  <nathan@codesourcery.com>
3041
3042         * cp-tree.h (struct tree_pair_s): New.
3043         (typedef tree_pair_p): New.
3044         (DEF_VEC_O(tree_pair_s)): New.
3045         (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s).
3046         (CLASSTYPE_VCALL_INDICES): Update documentation.
3047         * class.c (get_vcall_index): Adjust.
3048         (add_vcall_offset): Adjust.
3049
3050 2004-07-27  Kelley Cook  <kcook@gcc.gnu.org>
3051
3052         * pt.c, typeck.c: Remove spurious carriage returns.
3053
3054 2004-07-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3055
3056         PR c++/14429
3057         * pt.c (coerce_template_template_parms) <PARM_DECL case>: Only check
3058         when the type of ARG is not dependent.
3059
3060 2004-07-26  Geoffrey Keating  <geoffk@apple.com>
3061
3062         * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
3063         (lang_specific_driver): If the C++ or math library options don't
3064         start with '-l', don't count them as added libraries.
3065
3066 2004-07-26  Nathan Sidwell  <nathan@codesourcery.com>
3067
3068         * decl.c (xref_basetypes): Adjust base access vector creation.
3069         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
3070         access accesses.
3071         * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.
3072
3073 2004-07-26  Niall Douglas  <s_fsfeurope2@nedprod.com>
3074             Brian Ryner  <bryner@brianryner.com>
3075
3076         PR c++/15000
3077         PR c++/9283
3078         * class.c (check_field_decls): Apply hidden visibility if
3079         -fvisibility-inlines-hidden and inlined unless otherwise specified
3080         (build_vtable): Set vtable visibility to class visibility.
3081         (check_field_decls): Default static member visibility to class
3082         visibility.
3083         (check_methods): Default method visibility to class visibility.
3084         * cp-tree.h: Added CLASSTYPE_VISIBILITY and
3085         CLASSTYPE_VISIBILITY_SPECIFIED macro.
3086         * decl.c (duplicate_decls): New logic for merging definition decls
3087         with declaration decls. Added ignore & warning when non default
3088         applied to global operator new or delete.
3089         * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
3090         wherever VISIBILITY was changed
3091         * rtti.c (get_tinfo_decl): Set typeinfo visibility to class
3092         visibility.
3093         (tinfo_base_init): Set typeinfo name visibility to class visibility.
3094
3095 2004-07-25  Bernardo Innocenti  <bernie@develer.com>
3096
3097         * decl.c: Rename all identifiers named `class' to `cl'.
3098         * cp-tree.h: Likewise.
3099
3100 2004-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3101
3102         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
3103         * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
3104         * name-lookup.c (binding_entry_make): Use GGC_NEW.
3105         (binding_table_construct): Use GGC_CNEWVEC.
3106         (binding_table_new): Use GGC_NEW.
3107         (cxx_binding_make): Likewise.
3108         (begin_scope): Likewise.
3109         (push_to_top_level): Use GCC_CNEW.
3110         * parser.c (cp_token_cache_new): Likewise.
3111         (cp_token_cache_push_token): Likewise.
3112         (cp_lexer_new_main): Likewise.
3113         (cp_lexer_new_from_tokens): Likewise.
3114         (cp_parser_context_new): Likewise.
3115         (cp_parser_new): Likewise.
3116         (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
3117         * lex.c (cxx_make_type): Use GGC_CNEW.
3118         (retrofit_lang_decl): Use GGC_NEWVAR.
3119         (cxx_dup_lang_specific_decl): Likewise.
3120         (copy_lang_type): Likewise.
3121         * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
3122         (save_function_data): Likewise.
3123         (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
3124         (cxx_push_function_context): Likewise.
3125
3126 2004-07-25  Richard Henderson  <rth@redhat.com>
3127
3128         * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
3129         DECL_IGNORED_P on RESULT_DECL.
3130         * semantics.c (finalize_nrv): Copy them too.
3131
3132 2004-07-23  Nathan Sidwell  <nathan@codesourcery.com>
3133
3134         * search.c (lookup_conversion_operator): Avoid two loops.
3135         (add_conversions): Remove.
3136         (check_hidden_convs, split_conversions,
3137         lookup_conversions_r):  New.
3138         (lookup_conversions): Use lookup_conversions_r.
3139
3140 2004-07-22  Nathan Sidwell  <nathan@codesourcery.com>
3141
3142         * pt.c (get_template_base): Check type is completable.
3143
3144 2004-07-21  Eric Christopher  <echristo@redhat.com>
3145
3146         * decl.c (poplevel): Inline unused variable checking.
3147         Change formatting.
3148
3149 2004-07-21  Paolo Bonzini  <bonzini@gnu.org>
3150
3151         * typeck.c (build_binary_op): Do not use RDIV_EXPR for
3152         integer vectors.
3153
3154 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3155
3156         PR c++/14497
3157         * pt.c (check_explicit_specialization): Remove extension to accept
3158         specializations without template headers. Fall-through to normal
3159         processing.
3160
3161 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3162
3163         PR c++/509
3164         * pt.c (determine_specialization): New parameter template_count.
3165         Disambiguate between member templates and member functions counting
3166         the template headers.
3167         (check_explicit_specialization): Update caller.
3168         (tsubst_friend_function): Likewise.
3169
3170 2004-07-20  Steven Bosscher  <stevenb@suse.de>
3171
3172         * cp-tree.def (TINST_LEVEL): Make it an 'x' node.
3173         * cp-tree.h (tinst_level_t): New tree type.
3174         (union lang_tree_node): Handle it.
3175         (TINST_LOCATION): New accessor macro.
3176         (make_tinst_level): New prototype.
3177         * cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
3178         * decl.c (cp_tree_node_structure): Likewise.
3179         * error.c (print_instantiation_full_context): Use TINST_LOCATION.
3180         (print_instantiation_partial_context): Likewise.
3181         * pt.c (pop_tinst_level): Likewise.
3182          (push_tinst_level): Use make_tinst_level.
3183         * tree.c (make_tinst_level): New function.
3184         (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.
3185
3186 2004-07-20  Mark Mitchell  <mark@codesourcery.com>
3187
3188         * parser.c (cp_parser_simple_type_specifier): Fix typo.
3189
3190         PR c++/16637
3191         * parser.c (cp_parser_simple_type_specifier): Do not record usage
3192         of globally-qualified names.
3193
3194 2004-07-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3195
3196         PR c++/16175
3197         * error.c (dump_type) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Output
3198         cv qualifier.
3199
3200 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3201
3202         PR c++/16623
3203         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
3204         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
3205         * class.c (add_implicitly_declared_members): Use
3206         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3207         * method.c (lazily_declare_fn): Clear
3208         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3209         * search.c (lookup_fnfields_1): Check it.
3210
3211 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
3212
3213         * cp-tree.h (vec_binfo_member): Remove.
3214         * tree.c (vec_binfo_member): Remove.
3215
3216         * cp-tree.h (struct lang_type_class): Remove vfields field.
3217         (CLASSTYPE_VFIELDS): Remove.
3218         (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
3219         * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
3220         handling.
3221         (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
3222         (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
3223         * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
3224
3225 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
3226
3227         * cp-tree.h (DEF_VEC_P(tree)): Remove here.
3228         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
3229         Moved to common.
3230         (BINFO_LANG_SLOTS): Remove.
3231         * tree.c (copy_binfo): Adjust BINFO creation and accessors.
3232         * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
3233         * class.c (check_bases): Adjust BINFO accessors.
3234         (determine_primary_base, finish_struct_bits,
3235         maybe_warn_about_overly_private_class, warn_hidden,
3236         walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
3237         warn_about_ambiguous_bases, get_vfield_name,
3238         dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
3239         add_vcall_offset_vtbl_entries_r): Likewise.
3240         * dump.c (cp_dump_tree): Likewise.
3241         * init.c (sort_mem_initializers, expand_member_init, build_delete,
3242         push_base_cleanups): Likewise.
3243         * method.c (do_build_copy_constructor, do_build_assign_ref,
3244         synthesize_exception_spec): Likewise.
3245         name-lookup.c (arg_assoc_class): Likewise.
3246         * pt.c (instantiate_class_template,
3247         get_template_base_recursive): Likewise.
3248         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
3249         * typeck2.c (process_init_constructor): Likewise.
3250         * search.c (lookup_base_r, dynamic_cast_base_recurse,
3251         dfs_access_in_type, dfs_walk_real, look_for_overrides,
3252         types_overlap_p, copied_binfo, original_binfo): Likewise.
3253         (binfo_for_vtable): Remove
3254
3255 2004-07-20  Steven Bosscher  <stevenb@suse.de>
3256
3257         * cp-tree.h (struct lang_decl_flags): Unify the template_info and
3258         thunk_alias, and the access and virtual_offset fields.
3259         (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
3260         * decl.c (finish_case_label): Update c_add_case_node call.
3261
3262 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3263
3264         Revert patch for PR c++/16623.
3265
3266 2004-07-19  Kelley Cook  <kcook@gcc.gnu.org>
3267
3268         * except.c: Remove two spurious carriage returns.
3269
3270 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3271
3272         PR c++/16623
3273         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
3274         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
3275         * class.c (add_implicitly_declared_members): Use
3276         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3277         * method.c (lazily_declare_fn): Clear
3278         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3279         * search.c (lookup_fnfields_1): Check it.
3280
3281 2004-07-19  Nathan Sidwell  <nathan@codesourcery.com>
3282
3283         * class.c (add_method): Delay adding the slot until the end.
3284         (determine_primary_base): Adjust VEC_iterate invokation.
3285         (resort_type_method_vec, finish_struct_methods, warn_hidden,
3286         walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
3287         build_vtbl_initializer): Likewise.
3288         * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
3289         build_vbase_delete): Likewise.
3290         * method.c (do_build_copy_constructor): Likewise.
3291         * name-lookup.c (new_class_binding, print_binding_level,
3292         poplevel_class, store_class_bindings, push_to_top_level,
3293         pop_from_top_level): Likewise.
3294         * pt.c (check_explicit_specialization): Likewise.
3295         * search.c (lookup_conversion_operator, lookup_fnfields_1,
3296         get_pure_virtuals, add_conversions, dfs_check_overlap,
3297         binfo_for_vbase): Likewise.
3298
3299 2004-07-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3300
3301         PR c++/12170
3302         * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
3303         innermost set of template arguments during deduction.  Simplify.
3304
3305 2004-07-19  Joseph S. Myers  <jsm@polyomino.org.uk>
3306
3307         * typeck.c (build_modify_expr, build_x_modify_expr): Set
3308         TREE_NO_WARNING on assignments with an operator other than '='.
3309
3310 2004-07-10  Steven Bosscher  <stevenb@suse.de>
3311             Joseph S. Myers  <jsm@polyomino.org.uk>
3312
3313         * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
3314         * decl2.c (grokfield): Don't check current_class_depth via
3315         unused TREE_COMPLEXITY.
3316         * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
3317         to avoid the missing parentheses warning.
3318         Don't set C_SET_EXP_ORIGINAL_CODE.
3319
3320 2004-07-18  Mark Mitchell  <mark@codesourcery.com>
3321
3322         * tree.c (no_linkage_helper): Remove.
3323         (no_linkage_check): Don't use walk_tree_without_duplicates.
3324
3325         * mangle.c (write_expression): Issue a sorry for zero-operand
3326         functional casts.
3327
3328 2004-07-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3329
3330         PR c++/13092
3331         * init.c (build_offset_ref): Build SCOPE_REF with non-null
3332         TREE_TYPE for non-dependent names.
3333         * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
3334         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
3335         unknown_type_node as its TREE_TYPE.
3336         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
3337         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
3338         (dump_expr) <SCOPE_REF case>: Likewise.
3339
3340 2004-07-17  Jason Merrill  <jason@redhat.com>
3341
3342         PR c++/16115
3343         * call.c (type_passed_as): Make the invisible reference type
3344         __restrict.
3345         * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
3346         cp_genericize_r.  Handle invisible reference lowering.
3347         (is_invisiref_parm): New fn.
3348         (cp_genericize): Adjust the types of invisible reference parms.
3349         Don't repeat the walk for clones.
3350         * decl.c (store_parm_decls): Don't generate any code for clones.
3351
3352 2004-07-17  Joseph S. Myers  <jsm@polyomino.org.uk>
3353
3354         * cp-tree.h (builtin_function): Declare.
3355
3356 2004-07-16  Mark Mitchell  <mark@codesourcery.com>
3357
3358         * class.c (finish_struct_methods): Remove unncessary code.
3359         (add_implicitly_declared_members): Create declarations for default
3360         constructors and copy constructors lazily.
3361         * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
3362         lazy_copy_ctor.
3363         (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
3364         (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
3365         * decl2.c (check_classfn): Robustify.
3366         (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
3367         (locate_ctor): Handle lazy default constructors.
3368         (locate_copy): Handle lazy copy constructors.
3369         (implicitly_declare_fn): Make sure we're looking at the
3370         TYPE_MAIN_VARIANT for a class before creating functions.  Don't
3371         set TYPE_HAS_CONSTRUCTOR.
3372         (lazily_declare_fn): New function.
3373         * name-lookup.c (constructor_name_full): Simplify.
3374         * search.c (lookup_fnfields_1): Lazily create methods, as
3375         necessary.
3376         (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
3377
3378 2004-07-16  Steven Bosscher  <stevenb@suse.de>
3379
3380         * cp-tree.h (struct lang_type): Don't have three GTY options on a
3381         single bit GTY desc.
3382
3383 2004-07-16  Richard Henderson  <rth@redhat.com>
3384
3385         * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
3386         * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
3387         * tree.c (cp_copy_res_decl_for_inlining): Remove.
3388
3389 2004-07-16  Nathan Sidwell  <nathan@codesourcery.com>
3390
3391         * class.c (finish_struct_bits): Use for loop.
3392         (propagate_binfo_offsets): Do primary binfo outside of loop.
3393
3394         PR c++/16583
3395         * dump.c (cp_dump_tree): Don't dump the bases if there's no
3396         binfo.
3397
3398         * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
3399
3400 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
3401
3402         * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
3403         has_abstract_assign_ref.  Make methods a VEC(tree) *.
3404         (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
3405         (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
3406         (CLASSTYPE_DESTRUCTORS): Likewise.
3407         (TYPE_HAS_REAL_ASSIGN_REF): Remove.
3408         (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
3409         (add_method): Change prototoype.
3410         * class.c (add_method): Remove error_p parameter.  Adjust for
3411         changes to CLASSTYPE_METHOD_VEC.
3412         (handle_using_decl): Adjust call to add_method.
3413         (maybe_warn_about_overly_private_class): Adjust for
3414         changes to CLASSTYPE_METHOD_VEC.
3415         (resort_type_method_vec): Likewise.
3416         (finish_struct_methods): Likewise.
3417         (check_for_override): Likewise.
3418         (warn_hidden): Likewise.
3419         (add_implicitly_declared_members): Defer creation of assignment
3420         operators.  Adjust call to add_method.
3421         (clone_function_decl): Adjust call to add_method.
3422         (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
3423         (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
3424         * decl.c (grok_special_member_properties): Don't set
3425         TYPE_HAS_ABSTRACT_ASSIGN_REF.
3426         * decl2.c (check_classfn): Adjust for
3427         changes to CLASSTYPE_METHOD_VEC.
3428         * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
3429         (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
3430         (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
3431         (implicitly_declare_fn): Set DECL_SOURCE_LOCATION.  Do not call
3432         cp_finish_decl.
3433         * pt.c (check_explicit_specialization): Adjust for
3434         changes to CLASSTYPE_METHOD_VEC.
3435         (instantiate_class_template): Do not set
3436         TYPE_HAS_ABSTRACT_ASSIGN_REF.
3437         * ptree.c (cxx_print_type): Don't try to print
3438         CLASSTYPE_METHOD_VEC.
3439         * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
3440         * search.c (lookup_field_r): Adjust for
3441         changes to CLASSTYPE_METHOD_VEC.
3442         (lookup_fnfields): Likewise.
3443         (lookup_conversion_operator): Likewise.
3444         (lookup_fnfields_1): Likewise.  Create assignment operators
3445         lazily.
3446         (look_for_overrides_here): Adjust for
3447         changes to CLASSTYPE_METHOD_VEC.
3448         (add_conversions): Likewise.
3449         * semantics.c (finish_member_declaration): Adjust call to add_method.
3450
3451 2004-07-15  Jason Merrill  <jason@redhat.com>
3452
3453         * cp-lang.c (cxx_types_compatible_p): To the middle-end,
3454         references and pointers are compatible.
3455
3456 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
3457
3458         * decl.c (xref_basetypes): Refactor.
3459         * tree.c (copy_base_binfos): Replace with ...
3460         (copy_binfo): ... this. Deep copy the given binfo, (not the just
3461         bases of the given base).
3462         * cp-tree.h (copy_base_binfo): Remove.
3463         (copy_binfo): Declare.
3464
3465 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
3466
3467         * name-lookup.c (set_inherited_value_binding_p): Add class_type
3468         parameter.
3469         (get_class_binding): Adjust.
3470         (push_class_level_binding): Don't use set_inherited_value_binding_p.
3471
3472 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
3473
3474         * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
3475         * decl.c (xref_basetypes): Set it here.
3476
3477         * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here.
3478         Don't check for incomplete base.
3479         (get_vfield_name): Simplify while loop.
3480         * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here.
3481
3482 2004-07-14  Mark Mitchell  <mark@codesourcery.com>
3483
3484         * lex.c (cxx_make_type): Remove call to get_pointer_type.
3485
3486         * cp-tree.h (IDENTIFIER_VALUE): Remove.
3487         (BINFO_PUSHDECLS_MARKED): Likewise.
3488         (maybe_inject_for_scope_var): Likewise.
3489         (push_class_decls): Likewise.
3490         * name-lookup.h (push_class_binding): Remove.
3491         (innermost_non_namespace_value): New function.
3492         (outer_binding): Likewise.
3493         * class.c (add_method): Push bindings before adding to
3494         TYPE_METHODS.
3495         (restore_class_cache): Do not restore class_shadowed.
3496         (pushclass): Do not add USING_DECLs.  Do not call
3497         push_class_decls.
3498         * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c.
3499         * decl.c (pushdecl): Use outer_binding.
3500         (poplevel): Set the scope for an out-of-scope for-loop declaration
3501         appropriately.
3502         (cp_finish_decl): Don't call maybe_inject_for_scope_var.
3503         * name-lookup.c (new_class_binding): New function.
3504         (push_binding): Use it.
3505         (pushdecl): Use innermost_non_namespace_value.
3506         (maybe_inject_for_scope_var): Remove.
3507         (push_class_binding): Remove.
3508         (set_inherited_value_binding_p): New function.
3509         (get_class_binding): New function.
3510         (push_class_level_binding): Assert that the current_class_type is
3511         being defined.
3512         (outer_binding): New function.
3513         (innermost_non_namespace_value): Likewise.
3514         (lookup_name_real): Use outer_binding.
3515         (lookup_name_current_level): Ignore out-of-scope variables.
3516         * pt.c (check_template_shadow): Use innermost_non_namespace_value.
3517         (lookup_template_class): Likewise.
3518         * search.c (dfs_push_type_decls): Remove.
3519         (dfs_push_decls): Likewise.
3520         (setup_class_bindings): Likewise.
3521         (lookup_field_1): Handle USING_DECLs from dependent scopes.
3522         (marked_pushdecls_p): Remove.
3523         (unmarked_pushdecls_p): Remove.
3524         (marked_identifiers): Remove.
3525         (setup_class_bindings): Remove.
3526         (dfs_push_type_decls): Remove.
3527         (dfs_push_decls): Remove.
3528         (push_class_decls): Remove.
3529
3530 2004-07-13  Mark Mitchell  <mark@codesourcery.com>
3531
3532         PR c++/16518
3533         PR c++/16337
3534         * decl.c (grokvardecl): Make declspecs parameter const.
3535         (grokdeclarator): Likewise.  Adjust accordingly.
3536         * decl.h (grokdeclarator): Adjust declaration.
3537         * parser.c (cp_parser_init_declarator): Do not clear
3538         decl_specifiers->attributes.
3539
3540         * cp-tree.h (lang_identifier): Remove class_value.
3541         (IDENTIFIER_CLASS_VALUE): Remove.
3542         (pop_class_decls): Likewise.
3543         (init_search_processing): Likewise.
3544         * class.c (handle_using_decl): Use lookup_member, not
3545         IDENTIFIER_CLASS_VALUE.
3546         (restore_class_cache): New function, split out from ...
3547         (pushclass): ... here.  Do not call clear_identifier_class_values.
3548         (invalidate_class_lookup_cache): Do not clear
3549         IDENTIFIER_CLASS_VALUE.
3550         (popclass): Do not call pop_class_decls.
3551         (maybe_note_name_used_in_class): Do not save names looked up after
3552         the class is complete.  Use lookup_member, not
3553         IDENTIFIER_CLASS_VALUE.
3554         * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c.
3555         * decl.c (cxx_init_decl_processing): Do not call
3556         init_search_processing.
3557         * method.c (do_build_copy_constructor): Remove unnecessary code.
3558         (do_build_assign_ref): Likewise.
3559         * name-lookup.c (pushdecl): Use lookup_member, not
3560         IDENTIFIER_CLASS_VALUE.
3561         (set_identifier_type_value_with_scope): Set TREE_TYPE on the
3562         type_shadowed list.
3563         (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE.
3564         (push_class_binding): Do not set it.
3565         (clear_identifier_class_values): Remove.
3566         (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE.
3567         (store_binding): Do not save it.
3568         (pop_from_top_level): Do not restore it.
3569         * name-lookup.h (cxx_saved_binding): Remove class_value.
3570         (clear_identifier_class_values): Remove.
3571         * ptree.c (cxx_print_identifier): Do not print
3572         IDENTIFIER_CLASS_VALUE.
3573         * search.c (search_obstack): Remove.
3574         (push_stack_level): Remove.
3575         (pop_stack_level): Remove.
3576         (search_level): Remove.
3577         (search_stack): Remove.
3578         (lookup_member): Don't check IDENTIFIER_CLASS_VALUE.
3579         (setup_class_bindings): Use IDENTIFIER_MARKED, not
3580         IDENTIFIER_CLASS_VALUE.
3581         (marked_identifiers): New variable.
3582         (push_class_decls): Clear IDENTIFIER_MARKED.
3583         (pop_class_decls): Don't call pop_search_level.
3584         (init_search_processing): Remove.
3585
3586 2004-07-12  Mark Mitchell  <mark@codesourcery.com>
3587
3588         * cp-tree.h (get_aggr_typedef): Remove.
3589         * init.c (get_aggr_typedef): Likewise.
3590
3591         * name-lookup.c (push_class_level_binding): Simplify.
3592
3593 2004-07-12  Andrew Pinski  <apinski@apple.com>
3594
3595         PR c++/16475
3596         Revert:
3597         2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
3598                 PR c++/16276
3599                 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
3600                 is not public.
3601
3602 2004-07-12  Eric Christopher  <echristo@redhat.com>
3603
3604         * parser.c (cp_parser_class_head): Remove unused variable.
3605
3606 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3607
3608         * decl.c (grok_op_properties): Reject [de-]allocation functions
3609         declared in a namespace, or declared as static.
3610
3611 2004-07-12  Nathan Sidwell  <nathan@codesourcery.com>
3612
3613         * cp-tree.h (make_binfo): Remove.
3614         * decl.c (xref_basetypes): Use make_tree_binfo directly.
3615         * tree.h (copy_base_binfos): Likewise.
3616         (make_binfo): Remove.
3617
3618         * call.c (build_user_type_conversion_1, build_new_op,
3619         check_constructor_callable, build_temp,
3620         perform_direct_initialization_of_possible): Pass type directly to
3621         lookup_fnfields & build_special_member_call.
3622         (build_special_member_call): Accept a type, and complete it.
3623         * class.c (finish_stuct_bits): Copy the BINFOs here.
3624         * cvt.c (ocp_convert): Pass type directly to
3625         build_special_member_call.
3626         * decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
3627         (xref_basetypes): Allocate the binfo here. Adjust.
3628         * init.c (build_init, build_new_1): Pass type directly to
3629         build_special_member_call.
3630         * lex.c (cxx_make_type): Do not allocate binfo here.
3631         * name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
3632         * parser.c (cp_parser_class_head): Always call xref_basetypes.
3633         * pt.c (instantiate_class_template): Likewise. Inhibit access
3634         checking for template friends.
3635         * ptree.c (cxx_print_type): Adjust record printing.
3636         * search.c (lookup_base): When taking a type, complete it before
3637         looking for a binfo.
3638         (lookup_member): Delay completing a type.
3639         (push_class_decls): Don't walk an incomplete type.
3640         (lookup_conversions): Likewise.
3641         * semantics.c (finish_stmt_expr_expr): Pass type directly to
3642         build_special_member_call.
3643         * tree.c (copy_base_binfos): Adjust.
3644         (make_binfo): Likewise.
3645         * typeck.c (build_modify_expr): Pass type directly to
3646         build_special_member_call.
3647         * typeck2.c (process_init_constructor): Check a binfo exists.
3648         (build_m_component_ref): Allow accessing an incomplete type.
3649         (build_functional_cast): Pass type directly to
3650         build_special_member_call.
3651
3652 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3653
3654         PR c++/2204
3655         * config-lang.in (gtfiles): Add typeck2.c.
3656         * Make-lang.in: Tweak typeck2.c dependencies, and add rule for
3657         gt-cp-typeck2.h.
3658         * cp-tree.h: Declare complete_type_check_abstract.
3659         * typeck2.c (pat_calc_hash, pat_compare,
3660         complete_type_check_abstract): New functions.
3661         (abstract_virtuals_error): If the type is abstract, register the
3662         declaration within abstract_pending_vars for further checks.
3663         Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
3664         * decl.c (cp_finish_decl): Do not strip array types.
3665         (create_array_type_for_decl): Check for abstractness of the element
3666         type.
3667         (complete_vars): Call complete_type_check_abstract.
3668         * class.c (finish_struct): Prepare a list of virtual functions for
3669         template types, and call complete_vars on it to check for abstractness.
3670
3671 2004-07-12  Paolo Bonzini  <bonzini@gnu.org>
3672
3673         PR tree-optimization/14107
3674         * decl.c (finish_function): Remove temporary band-aid.
3675
3676 2004-07-11  Mark Mitchell  <mark@codesourcery.com>
3677
3678         * call.c (build_operator_new_call): Avoid using push_to_top_level.
3679         (build_new_op): Adjust call to lookup_function_nonclass.
3680         * name-lookup.c (identifier_type_value): Adjust call to
3681         lookup_name_real.
3682         (lookup_name_real): Add block_p parameter.
3683         (lookup_name_nonclass): Adjust call to lookup_name_real.
3684         (lookup_function_nonclass): Likewise.
3685         (lookup_name): Likewise.
3686         * name-lookup.h (lookup_name_real): Change prototype.
3687         (lookup_name_nonclass): Likewise.
3688         * parser.c (cp_parser_lookup_name): Likewise.
3689
3690         * cp-tree.h (saved_scope): Make old_bindings a vector.
3691         (unuse_fields): Remove.
3692         * name-lookup.h (cxx_saved_binding): Define it.
3693         * class.c (pushclass): Don't use unuse_fields.
3694         * name-lookup.c (cxx_saved_binding_make): Remove.
3695         (store_binding): Add new bindings to a vector, using an
3696         accumulator style, rather than adding them to a list.
3697         (store_bindings): Adjust accordingly.
3698         (store_class_bindings): Likewise.
3699         (push_to_top_level): Likewise.
3700         (pop_from_top_level): Likewise.
3701         * optimize.c (maybe_clone_body): Must push_to_top_level and
3702         pop_from_top_level calls outside of loop.
3703         * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope
3704         calls here from cp_parser_late_parsing_default_args.
3705         (cp_parser_save_default_args): Record the class type in which the
3706         function is declared.
3707         (cp_parser_late_parsing_default_args): Do not call
3708         push_nested_class/pop_nested_class.
3709         * search.c (dfs_unuse_fields): Remove.
3710         (unuse_fields): Remove.
3711
3712 2004-07-11  Joseph S. Myers  <jsm@polyomino.org.uk>
3713
3714         * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
3715         LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
3716         * cp-tree.h (poplevel): Declare.
3717         (set_block): Remove.
3718         * decl.c (set_block): Remove.
3719
3720 2004-07-10  Mike Stump  <mrs@apple.com>
3721
3722         * decl2.c (import_export_class): Never export/import vtables
3723         with inline key functions.
3724
3725 2004-07-09  Steven Bosscher  <stevenb@suse.de>
3726
3727         * typeck.c (c_expand_asm_operands): Remove.
3728
3729 2004-07-09  Mike Stump  <mrs@apple.com>
3730
3731         * typeck.c (build_class_member_access_expr): Skip null deref
3732         warning when we don't dereference it.
3733
3734 2004-07-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3735
3736         PR c++/8211
3737         PR c++/16165
3738         * class.c (check_field_decls): Improve -Weffc++ warning: do not
3739         warn for pointers to functions/members, or for classes without
3740         destructors.
3741
3742 2004-07-08  Mark Mitchell  <mark@codesourcery.com>
3743
3744         * name-lookup.h (struct cp_binding_level): Update documentation
3745         for class_shadowed.
3746
3747 2004-07-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3748
3749         PR c++/16169
3750         * typeck.c (check_return_expr): Improve -Weffc++ warning: handle
3751         returning CALL_EXPR, and non-reference return type.
3752
3753 2004-07-08  Nathan Sidwell  <nathan@codesourcery.com>
3754
3755         * name-lookup.c (push_binding): Use VEC_reserve.
3756
3757 2004-07-08  Richard Henderson  <rth@redhat.com>
3758
3759         * cp-tree.h (expand_eh_spec_block): Remove.
3760
3761 2004-07-07  Mark Mitchell  <mark@codesourcery.com>
3762
3763         * cp-tree.h (saved_scope): Remove x_previous_class_type and
3764         x_previous_class_values; add x_previous_class_level.
3765         (previous_class_type): Remove.
3766         (previous_class_values): Remove.
3767         (previous_class_level): New macro.
3768         * class.c (pushclass): Restore the identifier cache more
3769         expeditiously.
3770         (invalidate_class_lookup_cache): Use vector for class_shadowed and
3771         previous_class_values.
3772         * decl.c (poplevel): Likewise.
3773         * name-lookup.c (cxx_binding_init): New function.
3774         (cxx_binding_make): Use it.
3775         (push_binding): For a binding in a class level, use a vector of
3776         cp_class_binding nodes.
3777         (push_binding_level): New function.
3778         (begin_scope): Use it.
3779         (leave_scope): Do not put class binding levels on the free list.
3780         (print_binding_level): Adjust for the fact that class_shadowed is
3781         a vector.
3782         (poplevel_class): Likewise.
3783         (clear_identifier_class_values): Likewise.
3784         (push_class_level_binding): Likewise.
3785         (set_class_shadows): Remove.
3786         (store_binding): New function.
3787         (store_class_bindings): New function.
3788         (push_to_top_level): Use store_class_bindings as appropriate.
3789         (pop_from_top_level): Use previous_class_level, not
3790         previous_class_type.
3791         * name-lookup.h (cp_class_binding): New type.
3792         (cp_binding_level): Use a vector object for class_shadowed.
3793         (push_binding_level): Declare.
3794         (set_class_shadows): Remove.
3795
3796 2004-07-07  Andrew Pinski  <apinski@apple.com>
3797
3798         * class.c (instantiate_type): BUFFER_REF is dead.
3799         * lex.c (init_operators): IN_EXPR is dead.
3800
3801 2004-07-07  Jason Merrill  <jason@redhat.com>
3802
3803         PR c++/16334
3804         * call.c (build_new_op): Give overload warnings for built-in
3805         candidates.
3806
3807 2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
3808
3809         PR c++/16276
3810         * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
3811         is not public.
3812
3813 2004-07-07  Nathan Sidwell  <nathan@codesourcery.com>
3814
3815         * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
3816         * class.c (build_primary_vtable, check_bases,
3817         determine_primary_base, finish_struct_bits,
3818         maybe_warn_about_overly_private_class, dfs_find_final_overrider_q,
3819         get_basefndecls, warn_hidden, walk_subobject_offsets,
3820         build_base_fields, create_vtable_ptr, propagate_binfo_offsets,
3821         layout_virtual_bases, end_of_class, warn_about_ambiguous_bases,
3822         finish_struct_1, get_vfield_name, contains_empty_class_p,
3823         dump_class_hierarchy_r, finish_vtbls, build_vtt_inits,
3824         dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits,
3825         add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust
3826         BINFO macros.
3827         * decl.c (xref_basetypes): Likewise.
3828         * dump.c (cp_dump_tree): Likewise.
3829         * error.c (dump_expr): Likewise.
3830         * init.c (sort_mem_initializers, expand_member_init,
3831         push_base_cleanups): Likewise.
3832         * method.c (do_build_copy_constructor, do_build_assign_reg,
3833         synthesize_exception_spec): Likewise.
3834         * name-lookup.c (arg_assoc_class): Likewise.
3835         * pt.c (instantiate_class_template, tsubst,
3836         get_template_base_recursive): Likewise.
3837         * ptree.c (cxx_print_type): Likewise.
3838         * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
3839         * search.c (lookup_base_r, dynamic_cast_base_recurse,
3840         dfs_access_in_type, access_in_type, lookup_field_queue_p,
3841         bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp,
3842         marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp,
3843         dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet,
3844         binfo_for_vtable, copied_binfo, original_binfo): Likewise
3845         * tree.c (copy_base_binfos, make_binfo): Likewise.
3846         * typeck.c (commmon_base_type): Likewise
3847         * typeck2.c (process_init_constructor): Likewise
3848
3849 2004-07-06  Joseph S. Myers  <jsm@polyomino.org.uk>
3850
3851         * decl.c (check_tag_decl): Name redeclared type in diagnostic.
3852
3853 2004-07-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3854
3855         PR c++/3671
3856         * pt.c (convert_nontype_argument): Disallow conversions between
3857         different enumeration types.
3858
3859 2004-07-06  Nathan Sidwell  <nathan@codesourcery.com>
3860
3861         * cp-tree.h (BINFO_MARKED): Remove.
3862         (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED,
3863         BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P,
3864         BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n.
3865         (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P.
3866         * class.c (build_base_path): Use BINFO_VIRTUAL_P.
3867         (mark_primary_bases, determine_primary_base, base_derived_from,
3868         dfs_find_final_overrider, dfs_find_final_overrider_q,
3869         dfs_find_inal_overrider_post, update_vtable_entry_for_fn,
3870         dfs_modify_vtables, walk_subobject_offsets,
3871         layout_nonempty_base_or_field, build_base_field,
3872         build_base_fields, propagate_binfo_offsets, layout_virtual_bases,
3873         end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable,
3874         finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits,
3875         build_ctor_vtbl_group, accumulate_vtble_inits,
3876         dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries,
3877         build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r,
3878         add_vcall_offset_vtbl_entries_1): Likewise.
3879         * decl.c (xref_basetypes): Incomming virtual base indicated by
3880         TREE_TYPE. Adjust.
3881         * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P.
3882         * init.c (finish_init_stmts, sort_mem_initializers,
3883         emit_mem_initializers, build_vtble_address, expand_member_init,
3884         push_base_cleanups): Likewise.
3885         * method.c (do_build_copy_constructor): Likewise.
3886         * pt.c (instantiate_class_template,
3887         get_template_base_recursive): Likewise.
3888         * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init,
3889         get_pseudo_ti_desc): Likewise.
3890         * search.c (lookup_base_r, dynamic_cast_base_recurse,
3891         binfo_from_vbase, binfo_via_virtual, copied_binfo,
3892         original_binfo): Likewise.
3893         * semantics.c (finish_base_specifier): Virtualness is indicated
3894         by TREE_TYPE.
3895         * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P.
3896
3897 2004-07-06  Mark Mitchell  <mark@codesourcery.com>
3898
3899         Revert:
3900         2004-06-24  Jason Merrill  <jason@redhat.com>
3901         PR c++/16115
3902         * decl.c (grokparms): Give the PARM_DECL reference type if the
3903         parameter is passed by invisible reference.
3904
3905 2004-07-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3906
3907         * cp-lang.c (cp_var_mod_type_p): Add extra arg.
3908         * decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
3909         * pt.c (check_instantiated_args, unify): Likewise.
3910
3911 2004-07-05  Phil Edwards  <phil@codesourcery.com>
3912
3913         * Make-lang.in (check-c++, lang_checks):  Add some comments.
3914
3915 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
3916
3917         * cp-mudflap.c: Delete file.
3918         * Makefile.in: Remove all references to cp-mudflap.o.
3919
3920 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
3921
3922         * decl.c (cxx_init_decl_processing): Call
3923         build_common_tree_nodes before creating the global NAMESPACE_DECL.
3924
3925 2004-07-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3926
3927         PR c++/2518
3928         * call.c (build_operator_new_call): Look only at global scope.
3929
3930 2004-07-05  Nathan Sidwell  <nathan@codesourcery.com>
3931
3932         * call.c (enforce_access): Expect TREE_BINFO.
3933         * class.c (binfo_ctor_vtable): Check TREE_BINFO.
3934         * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
3935         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
3936         Adjust.
3937         (BINFO_LANG_ELTS): Remove.
3938         (BINFO_LANG_SLOTS): New.
3939         (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
3940         (CLASSTYPE_TEMPLATE_INFO): Adjust.
3941         * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
3942         * search.c (lookup_member): Check TREE_BINFO.
3943         * semantics.c (perform_or_defer_access_check): Likewise.
3944         (check_accessibility_of_qualified_id): Check
3945         deferred_access_no_check.
3946         * tree.c (make_binfo): Use make_tree_binfo.
3947
3948 2004-07-04  Mark Mitchell  <mark@codesourcery.com>
3949
3950         * method.c (implicitly_declare_fn): Set linkage of generated
3951         functions.
3952
3953 2004-07-04  Richard Henderson  <rth@redhat.com>
3954
3955         * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
3956
3957 2004-07-03  Scott Brumbaugh  <scottb.lists@verizon.net>
3958
3959         PR c++/3761
3960         * name-lookup.c (push_class_level_binding): Don't pass a
3961         TREE_LIST of ambiguous names to check_template_shadow as it
3962         only handles declarations. Instead, pull the declaration
3963         out and pass that.
3964
3965 2004-07-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3966
3967         PR c++/14971
3968         * pt.c (check_explicit_specialization): Clarify error message.
3969
3970 2004-07-02  Richard Henderson  <rth@redhat.com>
3971
3972         * tree.c (cp_unsave_r): Update remap_save_expr call.
3973
3974 2004-07-02  Mark Mitchell  <mark@codesourcery.com>
3975
3976         PR c++/16240
3977         * mangle.c (write_template_arg): Correct mangling.
3978
3979         PR c++/16297
3980         * decl.c (grokdeclarator): Robustify.
3981
3982 2004-07-01  Richard Henderson  <rth@redhat.com>
3983
3984         * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
3985         * method.c (synthesize_method): Don't clear_last_expr.
3986         * name-lookup.c (maybe_push_cleanup_level): Likewise.
3987
3988 2004-07-01  Nick Clifton  <nickc@redhat.com>
3989
3990         * decl2.c (import_export_class): Invoke the
3991         import_export_class field in the gcc_target structure if it is not
3992         empty.
3993
3994 2004-06-30  Richard Henderson  (rth@redhat.com>
3995
3996         * decl.c (start_preparsed_function): Don't set immediate_size_expand.
3997         * method.c (use_thunk): Likewise.
3998
3999 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
4000
4001         * call.c (build_over_call), typeck.c (build_function_call): Call
4002         check_function_arguments instead of check_function_format.
4003
4004 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
4005
4006         * call.c (build_over_call), typeck.c (build_function_call): Update
4007         calls to check_function_format.
4008
4009 2004-06-30  Richard Henderson  <rth@redhat.com>
4010
4011         * call.c (build_over_call): Use __builtin_memcpy for copying
4012         CLASS_AS_BASE rather than funny casting.
4013
4014 2004-06-30  Richard Henderson  <rth@redhat.com>
4015
4016         * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and
4017         TYPE_SIZE_UNIT of full_type.
4018
4019 2004-06-30  Per Bothner  <per@bothner.com>
4020
4021         Conditionally compile support for --enable-mapped_location.
4022         * decl.c (pop_label):  Handle (imperfectly) USE_MAPPED_LOCATION case.
4023         * decl2.c:  If USE_MAPPED_LOCATION, don't do some line number
4024         adjustments - which I don't understand.
4025         * error.c (dump_decl):  Rename "<interrnal>" to "<built-in>".
4026         * error.c:  Use LOCATION_FILE and EXPR_LOCATION macros.
4027         (print_instantiation_partial_context):  Use expand_location.
4028         * decl.c (duplicate_decl):  Use new DECL_IS_BUILTIN macro.
4029         * name-lookup.c:  Likewise.
4030         * lex.c (cxx_init):  Likewise.  Also use BUILTINS_LOCATION.
4031         * name-lookup.c:  Use input_line macro.
4032         * parser.c (cp_lexer_get_preprocessor_token):  Use UNKNOWN_LOCATION.
4033         (cp_parser_statement):  Rename locaal variable statement_locus to
4034         statement_location and use SET_EXPR_LOCATION macro.
4035         * pt.c:  Handle USE_MAPPED_LOCATION case.  Use new macros.
4036         * tree.c (cp_walk_subtrees):  Likewise.
4037
4038 2004-06-29  Per Bothner  <per@bothner.com>
4039
4040         * tree.c (build_min_nt, build_min, build_min_non_dep):
4041         Don't set TREE_COMPLEXITY from input_line.
4042
4043 2004-06-29  Paul Brook  <paul@codesourcery.com>
4044
4045         * init.c: Include target.h.
4046         (get_cookie_size): Remove and replace with target hook.
4047         Update callers.
4048         (build_new_1): Store the element size in the cookie.
4049
4050 2004-06-29  Nathan Sidwell  <nathan@codesourcery.com>
4051
4052         PR c++/16260
4053         * parser.c (cp_parser_template_declaration_after_export): Disable
4054         access checks here ...
4055         (cp_parser_class_specifier): ... not here.
4056
4057 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4058
4059         * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
4060         VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
4061         BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate
4062         TREE_CHECK macro.
4063
4064 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4065
4066         * cp-tree.h (struct deferred_access): Move to ...
4067         * semantics.c (struct deferred_access): ... here. Adjust.
4068         (deferred_access_stack): Make a VEC(deferred_access),
4069         (deferred_access_free_list): Remove.
4070         (deferred_access_no_check): New.
4071         (push_deferring_access_checks, resume_deferring_access_checks,
4072         stop_deferring_access_checks, pop_deferring_access_checks,
4073         get_deferred_access_checks, pop_to_parent_deferring_access_checks,
4074         perform_deferred_access_checks, perform_or_defer_access_check): Adjust.
4075
4076 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4077
4078         PR c++/16174
4079         * call.c (build_temp): Declare.
4080         (check_constructor_callable): New.
4081         (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
4082         CONSTRUCTOR_CALLABLE.
4083         (convert_like_real, initialize_reference): Use
4084         check_constructor_callable.
4085         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
4086         (LOOKUP_*): Renumber.
4087
4088 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4089
4090         * friend.c (add_friend): Only perform access checks when context
4091         is a class.
4092         * lex.c (cxx_make_type): Only create a binfo for aggregate types.
4093         * parser.c (cp_parser_class_specifier): Disable access checks here
4094         when parsing the body of a templated class.
4095         * semantics.c (perform_or_defer_access_checks): Reorder to allow
4096         NULL binfos when not checking access.
4097
4098 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4099
4100         Use vector API for vbase list.
4101         * cp-tree.h: Include vec.h
4102         (DEF_VEC_P (tree)): New type.
4103         (struct lang_type_class): Change vbase's member type.
4104         (binfo_for_vbase): Declare.
4105         * class.c (determine_primary_base, base_derived_from,
4106         update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
4107         warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
4108         build_vtbl_initializer): Adjust.
4109         * decl.c (xref_basetypes): Adjust, accumulate upper bound of
4110         vbases.
4111         * init.c (sort_mem_initializers, expand_member_init,
4112         push_base_cleanups): Adjust.
4113         * method.c (do_build_copy_constructor): Adjust.
4114         * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
4115         (binfo_for_vbase): New.
4116         * tree.c (copy_base_binfos): Adjust.
4117
4118 2004-06-28  Mark Mitchell  <mark@codesourcery.com>
4119
4120         * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
4121
4122 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4123
4124         PR c++/14123
4125         * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
4126         paranthesis in case of pointers to array members.
4127         * error.c (dump_type_prefix): Likewise.
4128         (dump_type_suffix): Maybe issue a whitespace when printing
4129         ARRAY_TYPE.
4130
4131 2004-06-27  Mark Mitchell  <mark@codesourcery.com>
4132
4133         PR c++/16193
4134         * parser.c (cp_parser_set_decl_spec_type): Refine test for
4135         redefinition of built-in types.
4136
4137 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4138
4139         * error.c (pp_template_argument_list_start): Remove.
4140         (pp_template_argument_list_end): Likewise.
4141         (pp_separate_with_comma): Use pp_cxx_separate_with.
4142         (reinit_global_formatting_buffer): Remove.
4143         (pp_non_consecutive_character): Likewise.
4144         (dump_scope): Use pp_cxx_colon_colon.
4145         (dump_template_parameter): Use pp_cxx_identifier,
4146         pp_cxx_tree_identifier and pp_cxx_whitespace.
4147         (dump_templat_bindings): Replace use of pp_string with sequence
4148         of pp_cxx_whitespace and pp_equal.
4149         (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
4150         pp_cxx_colon_colon, pp_cxx_whitespace throughout.  Don't set
4151         padding here.
4152         (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
4153         (dump_type_prefix): Don't set padding.  Use pp_cxx_whitespace,
4154         pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
4155         (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
4156         pp_cxx_right_bracket, pp_cxx_identifier throughout,
4157         (dump_decl): Likewise.
4158         (dump_template_decl): Likewise.
4159         (dump_function_decl): Likewise.  Set padding as appropriate.
4160         (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
4161         pp_cxx_right_paren.
4162         (dump_exception_spec): Likewise.
4163         (dump_function_name): Use pp_cxx_tree_identifier and
4164         pp_cxx_identifier.
4165         (dump_template_parms): Use pp_cxx_begin_template_argument_list and
4166         pp_cxx_end_template_argument_list.
4167         (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
4168         pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
4169         pp_cxx_whitespace throughout.
4170         (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
4171         pp_cxx_right_paren.
4172         (dump_unary_op): Likewise.
4173         (reinit_cxx_pp): New function.
4174         (type_as_string); Use it.
4175         (expr_as_string): Likewise.
4176         (decl_as_string); Likewise.
4177         (context_as_string): Likewise.
4178         (lang_decl_name): Likewise.
4179         (decl_to_string): Likewise.
4180         (expr_to_string): Likewise.
4181         (parm_to_string): Likewise.
4182         (type_to_string): Likewise.
4183         (args_to_string): Likewise.
4184         (cv_to_string): Likewise.
4185
4186 2004-06-26  Mark Mitchell  <mark@codesourcery.com>
4187
4188         * cp-tree.h (cp_cv_quals): New type.
4189         (cp_declarator): Use it instead of "tree" as appropriate.
4190         (grok_method_quals): Adjust prototype.
4191         (grokclassfn): Likewise.
4192         (do_friend): Likewise.
4193         * decl.c (grokfndecl): Use cp_cv_quals, not tree.
4194         (grokdeclarator): Likewise.
4195         * decl2.c (grok_method_quals): Likewise.
4196         (grokclassfn): Likewise.
4197         * friend.c (do_friend): Likewise.
4198         * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
4199         * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
4200         (make_pointer_declarator): Likewise.
4201         (make_reference_declarator): Likewise.
4202         (make_ptrmem_declarator): Likewise.
4203         (cp_parser_ptr_operator): Likewise.
4204         (cp_parser_cv_qualifier_seq_opt): Likewise.
4205         (cp_parser_cv_qualifier_opt): Remove.
4206         (cp_parser_new_declarator_opt): Adjust call to
4207         cp_parser_ptr_operator.
4208         (cp_parser_conversion_declaration_opt): Likewise.
4209         (cp_parser_declarator): Use cp_cv_quals, not tree.
4210         (cp_parser_direct_declarator): Likewise.
4211
4212 2004-06-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4213
4214         * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
4215         Rename DECL_STMT to DECL_EXPR.
4216         * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
4217         * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
4218         * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
4219
4220 2004-06-26  Jan Hubicka  <jh@suse.cz>
4221
4222         PR C++/14865
4223         * decl2.c (maybe_emit_vtables):  Always import_export_vtable for the
4224         reachability analysis.
4225
4226 2004-06-25  Mark Mitchell  <mark@codesourcery.com>
4227
4228         * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
4229         2004-06-23 change.
4230
4231 2004-06-25  Paul Brook  <paul@codesourcery.com>
4232
4233         * decl2.c (get_guard): Call targetm.cxx.guard_type.
4234         (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
4235
4236 2004-06-24  Mark Mitchell  <mark@codesourcery.com>
4237
4238         * decl.c (grokdeclarator): Restore error messages about __thread.
4239         * parser.c (cp_parser_decl_specifier_seq): Likewise.
4240
4241 2004-06-24  Jason Merrill  <jason@redhat.com>
4242
4243         PR c++/16115
4244         * decl.c (grokparms): Give the PARM_DECL reference type if the
4245         parameter is passed by invisible reference.
4246
4247 2004-06-24  Andreas Schwab  <schwab@suse.de>
4248
4249         * cp-tree.h (enum cp_storage_class): Remove trailing comma.
4250
4251 2004-06-23  Mark Mitchell  <mark@codesourcery.com>
4252
4253         * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
4254         (cp/decl.o): Likewise.
4255         (cp/decl2.o): Likewise.
4256         (cp/pt.o): Likewise.
4257         (cp/semantics.o): Likewise.
4258         * config-lang.in (gtfiles): Do not reference cp/lex.h.
4259         * class.c: Do not include lex.h.
4260         (add_implicitly_declared_members): Do not use
4261         adding_implicit_members.
4262         (check_bases_and_members): Do not talk about grok_x_components.
4263         * cp/cp-tree.h (adding_implicit_members): Remove.
4264         (cp_storage_class): New type.
4265         (cp_decl_spec): Likewise.
4266         (cp_decl_specifier_seq): Likewise.
4267         (cp_parameter_declarator): Use it for the decl_specifiers field.
4268         (check_tag_decl): Adjust prototype.
4269         (shadow_tag): Likewise.
4270         (groktypename): Likewise.
4271         (start_decl): Likewise.
4272         (start_function): Likewise.
4273         (start_method): Likewise.
4274         (grok_x_components): Remove.
4275         (grokfield): Adjust prototype.
4276         (grokbitfield): Likewise.
4277         (finish_member_class_template): Remove.
4278         * decl.c: Do not include lex.h.
4279         (adding_implicit_members): Do not define.
4280         (check_tag_decl): Do not use trees to represent decl-specifiers.
4281         (shadow_tag): Likewise.
4282         (groktypename): Likewise.
4283         (start_decl): Likewise.
4284         (grokvardecl): Likewise.
4285         (grokdeclarator): Likewise.
4286         (grokparms): Likewise.
4287         (start_function): Likewise.
4288         (start_method): Likewise.
4289         * decl.h (grokdeclarator): Adjust prototype.
4290         * decl2.c: Do not include lex.h.
4291         (grok_x_components): Remove.
4292         (grokfield): Do not use trees to represent decl-specifiers.
4293         (grokbitfield): Likewise.
4294         * lex.c: Do not include lex.h.
4295         * lex.h: Remove.
4296         * parser.c: Include target.h.
4297         (clear_decl_specs): New function.
4298         (cp_parser_translation_unit): Do not use trees to represent
4299         decl-specifiers.
4300         (cp_parser_postfix_expression): Likewise.
4301         (cp_parser_new_type_id): Likewise.
4302         (cp_parser_condition): Likewise.
4303         (cp_parser_simple_declaration): Likewise.
4304         (cp_parser_decl_specifier_seq): Likewise.
4305         (cp_parser_function_specifier_opt): Likewise.
4306         (cp_parser_conversion_type_id): Likewise.
4307         (cp_parser_template_parameter): Likewise.
4308         (cp_parser_explicit_instantiation): Likewise.
4309         (cp_parser_type_specifier): Likewise.
4310         (cp_parser_simple_type_specifier): Likewise.
4311         (cp_parser_init_declarator): Likewise.
4312         (cp_parser_type_id): Likewise.
4313         (cp_parser_type_specifier_seq): Likewise.
4314         (cp_parser_parameter_declaration): Likewise.
4315         (cp_parser_member_declaration): Likewise.
4316         (cp_parser_exception_declaration): Likewise.
4317         (cp_parser_function_definition_from_specifiers_and_declarator):
4318         Likewise.
4319         (cp_parser_single_declaration): Likewise.
4320         (cp_parser_save_member_function_body): Likewise.
4321         (cp_parser_friend_p): Likewise.
4322         (cp_parser_set_storage_class): New function.
4323         (cp_parser_set_decl_spec_type): Likewise.
4324         * pt.c: Do not include lex.h.
4325         * semantics.c: Likewise.
4326         (finish_member_class_template): Remove.
4327
4328 2004-06-23  Roger Sayle  <roger@eyesopen.com>
4329
4330         * call.c (build_cxx_call): Don't call expand_tree_builtin.  No
4331         longer take both "args" and "convert_args" as arguments.
4332         (build_op_delete_call): Update call to build_cxx_call.
4333         (build_over_call): Likewise, update call to build_cxx_call.
4334         * cp-tree.h (build_cxx_call): Update funtion prototype.
4335         * typeck.c (build_function_call): Don't call expand_tree_builtin.
4336         * rtti.c (throw_bad_cast): Update call to build_cxx_call.
4337         (throw_bad_typeid): Likewise.
4338         (build_dynamic_cast_1): Likewise.
4339
4340 2004-06-22  Richard Henderson  <rth@redhat.com>
4341
4342         * class.c (build_vfn_ref): Take a pointer not object.  Build
4343         an OBJ_TYPE_REF.
4344         (cp_fold_obj_type_ref): New.
4345         * call.c (build_over_call): Update build_vfn_ref call.
4346         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
4347         * cp-tree.h (cp_fold_obj_type_ref): Declare.
4348
4349 2004-06-21  Jason Merrill  <jason@redhat.com>
4350
4351         PR c++/16112
4352         * cp-gimplify.c (cp_gimplify_init_expr): Look through
4353         CLEANUP_POINT_EXPR.
4354
4355 2004-06-21  Mark Mitchell  <mark@codesourcery.com>
4356
4357         * cp-tree.def (NEW_EXPR): Add a fourth slot.
4358         * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
4359         (TREE_PARMLIST): Likewise.
4360         (CALL_DECLARATOR_PARMS): Likewise.
4361         (CALL_DECLARATOR_QUALS): Likewise.
4362         (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
4363         (cp_declarator_kind): New type.
4364         (cp_parameter_declarator): Likewise.
4365         (cp_declarator): Likewise.
4366         (cp_error_declarator): Likewise.
4367         (no_parameters): Likewise.
4368         (groktypename): Change prototype.
4369         (start_decl): Likewise.
4370         (start_handler_parms): Likewise.
4371         (get_scope_of_declarator): Likewise.
4372         (start_function): Likewise.
4373         (start_preparsed_function): New function.
4374         (start_function): Change prototype.
4375         (start_method): Likewise.
4376         (grokfield): Likewise.
4377         (grokbitfield): Likewise.
4378         (build_new): Likewise.
4379         (make_pointer_declarator): Remove.
4380         (make_reference_declarator): Likewise.
4381         (make_call_declarator): Likewise.
4382         (set_quals_and_spec): Likewise.
4383         (process_template_parm): Change prototype.
4384         (begin_function_definition): Remove.
4385         (finish_parmlist): Remove.
4386         * decl.c (groktypename): Do not use trees to represent
4387         declarators.
4388         (start_decl): Likewise.
4389         (start_handler_parms): Remove.
4390         (get_scope_of_declarator): Reimplement.
4391         (grokdeclarator): Do not use trees to represent declarators.
4392         (grokparms): Likewise.
4393         (start_function): Likewise.
4394         (start_method): Likewise.
4395         (build_void_list_mode): Do not use TREE_PARMLIST.
4396         * decl.h (grokdeclarator): Change prototype.
4397         * decl2.c (grok_method_quals): Robustify.
4398         (grok_x_components): Do not use trees to represent declarators.
4399         (grokfield): Likewise.
4400         (grokbitfield): Likewise.
4401         (start_objects): Build FUNCTION_DECLs, not declarators.
4402         (start_static_storage_duration_function): Likewise.
4403         * init.c (build_new): Simplify.
4404         * lex.c (make_pointer_declarator): Remove.
4405         (make_reference_declarator): Likewise.
4406         (make_call_declarator): Likewise.
4407         (set_quals_and_spec): Likewise.
4408         * method.c (use_thunk): Use start_preparsed_function.
4409         (synthesize_method): Likewise.
4410         (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
4411         * optimize.c (maybe_clone_body): Use start_preparsed_function.
4412         * parser.c (cp_error_declarator): New variable.
4413         (declarator_obstack): Likewise.
4414         (alloc_declarator): New function.
4415         (make_declarator): Likewise.
4416         (make_id_declarator): Likewise.
4417         (make_pointer_declarator): Likewise.
4418         (make_reference_declarator): Likewise.
4419         (make_ptrmem_declarator): Likewise.
4420         (make_call_declarator): Likewise.
4421         (make_array_declarator): Likewise.
4422         (no_parameters): New variable.
4423         (make_parameter_declarator): Likewise.
4424         (cp_parser_check_for_definition_in_return_type): Do not use trees
4425         to represent declarators.
4426         (cp_parser_translation_unit): Likewise.
4427         (cp_parser_new_expression): Likewise.
4428         (cp_parser_new_type_id): Likewise.
4429         (cp_parser_new_declarator_opt): Likewise.
4430         (cp_parser_direct_new_declarator): Likewise.
4431         (cp_parser_condition): Likewise.
4432         (cp_parser_declaration_statement): Likewise.
4433         (cp_parser_declaration): Likewise.
4434         (cp_parser_conversion_type_id): Likewise.
4435         (cp_parser_conversion_declarator_opt): Likewise.
4436         (cp_parser_template_parameter_list): Likewise.
4437         (cp_parser_template_parameter): Likewise.
4438         (cp_parser_explicit_instantiation): Likewise.
4439         (cp_parser_init_declarator): Likewise.
4440         (cp_parser_declarator): Likewise.
4441         (cp_parser_direct_declarator): Likewise.
4442         (cp_parser_type_id): Likewise.
4443         (cp_parser_parameter_declaration_clause): Likewise.
4444         (cp_parser_parameter_declaration_list): Likewise.
4445         (cp_parser_parameter_declaration): Likewise.
4446         (cp_parser_member_declaration): Likewise.
4447         (cp_parser_exception_declaration): Likewise.
4448         (cp_parser_check_declarator_template_parameters): Likewise.
4449         (cp_parser_function_definition_from_specifiers_and_declarator):
4450         Likewise.
4451         (cp_parser_save_member_function_body): Likewise.
4452         * pt.c (process_template_parm): Add is_non_type parameter.
4453         (convert_template_argument): Adjust call to groktypename.
4454         (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
4455         (tsubst): Do not expect declarators.
4456         (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
4457         argument.
4458         (instantiate_decl): Use start_preparsed_function.
4459         * semantics.c (begin_function_definition): Remove.
4460         (finish_parmlist): Remove.
4461         * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
4462         declarators.
4463
4464 2004-06-21  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4465
4466         * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
4467         (build_new_method_call): Likewise.
4468         * decl.c (local_variable_p_walkfn): Don't walk into types.
4469         * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
4470         (build_anon_union_vars): Add new operand for COMPONENT_REF.
4471         * init.c (buld_new): Add new operand for ARRAY_REF.
4472         * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
4473         (do_build_assign_ref): Likewise.
4474         * parser.c (cp_parser_direct_new_declarator): Add new operands
4475         for ARRAY_REF.
4476         (cp_parser_direct_declarator): Likewise.
4477         * pt.c (tsubst): Likewise.
4478         (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
4479         for COMPONENT_REF.
4480         * semantics.c (finish_non_static_data_member): Add new operand
4481         for COMPONENT_REF.
4482         * typeck.c (build_class_member_access_expr): Likewise.
4483         (build_class_member_access_expr, finish_class_member_access_expr):
4484         Likewise.
4485         (build_ptrmemfunc_access_expr): Likewise.
4486         (build_array_ref): Add new operands for ARRAY_REF.
4487         * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
4488         * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
4489
4490 2004-06-21  Richard Henderson  <rth@redhat.com>
4491
4492         * dump.c (cp_dump_tree): Don't use dump_next_stmt.
4493         * parser.c (cp_parser_jump_statement): Update commentary.
4494         * pt.c (tsubst_expr): Use RETURN_EXPR.
4495         * semantics.c (finish_return_stmt): Likewise.
4496         (finalize_nrv_r): Likewise.
4497         * typeck.c, typeck2.c: Update file start commentary.
4498
4499 2004-06-21  Richard Henderson  <rth@redhat.com>
4500
4501         * semantics.c (finish_expr_stmt): Call verify_sequence_points.
4502
4503 2004-06-20  Richard Henderson  <rth@redhat.com>
4504
4505         * cp-tree.h (add_decl_stmt): Declare.
4506         * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
4507         * semantics.c (maybe_cleanup_point_expr): New.
4508         (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
4509         finish_for_expr, finish_switch_cond): Use it.
4510         (finalize_nrv_r): Don't build an EXPR_STMT.  Don't frob TREE_CHAIN.
4511
4512 2004-06-20  Richard Henderson  <rth@redhat.com>
4513
4514         * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
4515         * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
4516         (cp_gimplify_expr): Call it.
4517         (gimplify_cleanup_stmt): Move from c-gimplify.c.
4518         (cp_genericize): New.
4519         * decl.c (finish_function): Call it.
4520         * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
4521         (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
4522         (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
4523         (cp_genericize): Declare.
4524         * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
4525         * dump.c (cp_dump_tree): Likewise.
4526         * semantics.c (push_cleanup): Move from c-semantics.c.
4527
4528 2004-06-20  Zack Weinberg  <zack@codesourcery.com>
4529
4530         * cp-lang.c (has_c_linkage): Implement.
4531
4532         * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
4533         * decl.c (duplicate_decls): Use COPY_DECL_RTL.
4534         (builtin_function_1): Don't call make_decl_rtl.
4535         (build_cp_library_fn): Don't call set_mangled_name_for_decl.
4536         (grokvardecl): Don't call mangle_decl.
4537         * except.c (nothrow_libfn_p): Look at DECL_NAME, not
4538         DECL_ASSEMBLER_NAME.
4539         * method.c (set_mangled_name_for_decl): Delete.
4540         * name-lookup.c (pushdecl): When a local extern shadows a
4541         file-scope declaration of the same object, give both DECLs the
4542         same DECL_UID.
4543         * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
4544         on DECL_ASSEMBLER_NAME.
4545
4546 2004-06-19  Richard Henderson  <rth@redhat.com>
4547
4548         * cp-gimplify.c: Remove unnecessary prototypes.
4549         (cp_gimplify_stmt): Merge into ...
4550         (cp_gimplify_expr): ... here.  Move to end of file.  Handle
4551         stmts_are_full_exprs_p frobbing.
4552         * cp-tree.h (cp_gimplify_stmt): Remove.
4553         * pt.c (tsubst_expr): Merge prep_stmt and unify.
4554         * tree.c (init_tree): Don't set lang_gimplify_stmt.
4555
4556 2004-06-18  Richard Henderson  <rth@redhat.com>
4557
4558         PR c++/16034
4559         * semantics.c (begin_cond): New.
4560         (finish_cond): Rewrite to handle template DECL_STMTs specially.
4561         Assume that non-template decls go land before the conditional.
4562         (simplify_loop_decl_cond): Likewise.
4563         (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
4564         finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
4565         begin_switch_stmt, finish_switch_cond): Update to match.
4566
4567 2004-06-17  Jason Merrill  <jason@redhat.com>
4568
4569         PR c++/16015
4570         * semantics.c (simplify_aggr_init_expr): Don't return the slot.
4571         (finish_stmt_expr_expr): Update type after conversions.
4572         (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
4573         Handle void initializer.
4574         * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
4575
4576 2004-06-17  Geoffrey Keating  <geoffk@apple.com>
4577
4578         * class.c (build_clone): Don't call defer_fn, let mark_used do it.
4579         * cp-tree.h (defer_fn): Delete.
4580         * decl2.c (defer_fn): Delete.
4581         (finish_file): Simplify deferred_fns loops; check that
4582         only used inline functions get into deferred_fns.
4583         (mark_used): Inline previous contents of defer_fn.
4584
4585 2004-06-16  Richard Henderson  <rth@redhat.com>
4586
4587         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
4588         (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
4589         * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
4590         of CTOR_INITIALIZER ...
4591         (pp_cxx_statement): ... here.
4592         * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
4593         (finish_function): Use alloc_stmt_list to zap entire function.
4594         * parser.c (cp_parser_compound_statement): Update commentary.
4595         * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
4596         * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
4597         (finish_stmt_expr): Don't look through COMPOUND_STMT.
4598
4599 2004-06-16  Geoffrey Keating  <geoffk@apple.com>
4600
4601         * pt.c (mark_decl_instantiated): Don't call defer_fn.
4602
4603 2004-06-16  Richard Henderson  <rth@redhat.com>
4604
4605         * parser.c (cp_parser_labeled_statement): Update commentary.
4606         * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
4607         * tree.c (mark_local_for_remap_r): Likewise.
4608
4609 2004-06-16  Richard Henderson  <rth@redhat.com>
4610
4611         * parser.c (cp_parser_asm_definition): Update commentary.
4612         * pt.c (tsubst_expr): Use ASM_EXPR.
4613         * semantics.c (finish_asm_stmt): Likewise.
4614
4615 2004-06-16  Richard Henderson  <rth@redhat.com>
4616
4617         * decl.c (finish_destructor_body): Use LABEL_EXPR.
4618         * parser.c (cp_parser_statement): Update commentary.
4619         * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
4620         * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
4621         * tree.c (mark_local_for_remap_r): Likewise.
4622
4623 2004-06-16  Richard Henderson  <rth@redhat.com>
4624
4625         PR c++/16012
4626         * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
4627         statement in FOR_INIT_STMT for templates.
4628
4629 2004-06-15  Richard Henderson  <rth@redhat.com>
4630
4631         * call.c (initialize_reference): Don't build CLEANUP_STMT here.
4632         * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
4633         (genericize_try_block): Use gimplify_stmt.
4634         (genericize_catch_block, genericize_eh_spec_block): Likewise.
4635         (cp_gimplify_init_expr): Remove STMT_EXPR special case.
4636         (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
4637         * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
4638         (cp_tree_chain_matters_p): Remove.
4639         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
4640         (COMPOUND_STMT_BODY_BLOCK): New.
4641         (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
4642         (EXPR_STMT_STMT_EXPR_RESULT): New.
4643         (building_stmt_tree): Check cur_stmt_list.
4644         (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
4645         (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
4646         * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
4647         (cp_finish_decl): Use push_cleanup.
4648         (start_function, finish_function): Use statement lists.
4649         (finish_stmt): Do nothing.
4650         * except.c (begin_eh_spec_block): Use statement lists.
4651         (check_handlers_1, check_handlers): Likewise.
4652         * init.c (construct_virtual_base): Don't add extra compound stmts.
4653         (build_vec_init): Likewise.
4654         * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
4655         * name-lookup.h (struct cp_binding_level): Add statement_list.
4656         * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
4657         (cp_parser_labeled_statement, cp_parser_expression_statement,
4658         cp_parser_statement_seq_opt): Likewise.
4659         (cp_parser_compound_statement): Likewise.  Take bool for try block.
4660         (cp_parser_selection_statement): Tidy if processing.
4661         (cp_parser_already_scoped_statement): Rewrite to do what it says.
4662         * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
4663         (tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
4664         Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
4665         * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
4666         (finish_cond): New, rewritten from FINISH_COND.
4667         (simplify_loop_decl_cond): New.
4668         (finish_expr_stmt): Avoid nested EXPR_STMTs.
4669         (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
4670         begin_else_clause, finish_else_clause, finish_if_stmt,
4671         begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
4672         begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
4673         finish_for_cond, finish_for_stmt, begin_switch_stmt,
4674         finish_switch_cond, finish_switch_stmt, begin_try_block,
4675         finish_try_block, finish_cleanup_try_block, finish_function_try_block,
4676         finish_handler_sequence, finish_function_handler_sequence,
4677         begin_handler, finish_handler_parms, finish_handler,
4678         begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
4679         using statement lists.
4680         (begin_compound_stmt): Replace has_no_scope argument with flags.
4681         Update all callers.  Use statement lists.
4682         (finish_compound_stmt): Likewise.
4683         (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
4684         (current_scope_stmt_stack): Remove.
4685         (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
4686         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
4687         Rewrite with statement lists.
4688
4689 2004-06-15  Alexandre Oliva  <aoliva@redhat.com>
4690
4691         * parser.c: Change all assignments of c_lex_string_translate
4692         to true and false to 1 and 0.
4693         (cp_lexer_read_token): Convert type of the translated string.
4694         (cp_parser_skip_to_closing_parentheses): Preserve original
4695         value of c_lex_string_translate, and set it to -1 while
4696         running.
4697         (cp_parser_cache_group): Likewise.
4698         (cp_parser_cache_group_1): Renamed.
4699         (cp_parser_asm_operand_list): Remove redundant setting of
4700         c_lex_string_translate.
4701         (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
4702         Handle chained strings.
4703
4704 2004-06-12  Andrew Pinski  <apinski@apple.com>
4705
4706         PR c++/14639
4707         Revert:
4708         2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
4709
4710                 * cp-tree.h: Fix typo.
4711
4712                 * cp-tree.h: Include cgraph.h
4713                 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
4714                 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
4715
4716 2004-06-12  Jason Merrill  <jason@redhat.com>
4717
4718         PR tree-optimization/14107
4719         * decl.c (finish_function): Warn about no return in all functions.
4720
4721 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
4722
4723         * cp-tree.h (struct language_function): Remove cannot_inline.
4724         * decl.c (save_function_data): cannot_inline is no more.
4725         (cxx_push_function_context): Likewise.
4726         * decl2.c (start_objects, start_static_storage_duration_function):
4727         Reset DECL_INLINE, set DECL_UNINLINABLE.
4728
4729 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4730
4731         PR c++/15967
4732         * search.c (lookup_field): Propagate the ambiguity list.
4733         (lookup_fnfields): Likewise.
4734
4735 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4736
4737         PR c++/15947
4738         * parser.c (cp_parser_template_name): Ctors/dtors never need a
4739         template keyword to disambiguate.
4740
4741 2004-06-14  Mark Mitchell  <mark@codesourcery.com>
4742
4743         PR c++/15096
4744         * decl.c (grokdeclarator): Ignore pointer-to-members when
4745         computing template depth.
4746
4747         PR c++/14930
4748         * name-lookup.c (pushtag): Do not try to put class declarations in
4749         explicit specialization scopes.
4750
4751 2004-06-11  Andrew Pinski  <pinskia@physics.uc.edu>
4752
4753         * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
4754
4755 2004-06-11  Mark Mitchell  <mark@codesourcery.com>
4756
4757         PR c++/15862
4758         * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
4759         bindings for undeclared built-ins.
4760
4761 2004-06-11  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4762
4763         * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
4764         appear at the correct location.
4765
4766 2004-06-10  Jason Merrill  <jason@redhat.com>
4767
4768         PR c++/15875
4769         Revert:
4770         2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4771         * init.c (build_offset_ref): Build SCOPE_REF with non-null
4772         TREE_TYPE for non-dependent names.
4773         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
4774         unknown_type_node as its TREE_TYPE.
4775         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
4776         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
4777         (dump_expr) <SCOPE_REF case>: Likewise.
4778
4779 2004-06-10  Mark Mitchell  <mark@codesourcery.com>
4780
4781         PR c++/15227
4782         * parser.c (cp_parser_direct_declarator): Robustify.
4783
4784         PR c++/15877
4785         * pt.c (tsubst_copy): Use decl_constant_value on enumeration
4786         constants in non-dependent contexts.
4787
4788         PR c++/14211
4789         PR c++/15076
4790         * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
4791         necessary.
4792
4793 2004-06-10  Jakub Jelinek  <jakub@redhat.com>
4794
4795         PR c++/14791
4796         * decl.c (duplicate_decls): Handle fileptr_type_node arguments
4797         specially.
4798
4799 2004-06-09  Mark Mitchell  <mark@codesourcery.com>
4800
4801         Revert:
4802         PR c++/15815
4803         2004-06-07  Mark Mitchell  <mark@codesourcery.com>
4804         * lex.c (handle_pragma_interface): Deprecate.
4805         (handle_pragma_implementation): Likewise.
4806
4807 2004-06-09  Andrew Pinski  <pinskia@physics.uc.edu>
4808
4809         * g++spec.c (lang_specific_driver): Remove check for -lm
4810         and -lmath when check it see if it was the math library.
4811
4812 2004-06-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4813
4814         PR c++/7841
4815         * parser.c (cp_parser_direct_declarator): Reject constructor named
4816         as qualified template-id.
4817
4818 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
4819
4820         PR c++/15815
4821         * lex.c (handle_pragma_interface): Deprecate.
4822         (handle_pragma_implementation): Likewise.
4823
4824 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
4825
4826         PR c++/15766
4827         * parser.c (cp_parser_iteration_statement): Fix typo in error
4828         message.
4829
4830         PR c++/14777
4831         * pt.c (tsubst_default_argument): Do not defer access checks
4832         while substituting into the default argument.
4833
4834         PR c++/15554
4835         * pt.c (tsubst_copy): Do not try to substitute for an enumeration
4836         constant in a non-dependent context.
4837
4838         PR c++/15057
4839         * except.c (build_throw): Ensure that temp_expr has been
4840         initialized.
4841
4842 2004-06-06  Roger Sayle  <roger@eyesopen.com>
4843
4844         * cp/cp-tree.h (lvalue_or_else): Add function prototype.
4845
4846 2004-06-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4847
4848         PR c++/15503
4849         * parser.c (cp_parser_mem_initializer_id): Gracefully reject
4850         'typename', and accept 'template'.
4851
4852 2004-06-03  Andrew Pinski  <pinskia@physics.uc.edu>
4853             Jan Hubicka  <jh@suse.cz>
4854
4855         PR c++/14639
4856         * method.c (use_think): Do not mark thunk as referenced.
4857
4858 2004-06-03  Matt Austern  <austern@apple.com>
4859
4860         PR c++/15428
4861         * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
4862         is nonzero, and if we see a noninline definition of a key method,
4863         make the vtables nonweak.
4864
4865 2004-06-02  Matt Austern  <austern@apple.com>
4866
4867         * cp-tree.h (instantiate_decl): new boolean parameter,
4868         undefined_ok. Current behavior is equivalent to its being 0.
4869         * decl2.c (mark_used): Add new argument when calling instantiate_decl
4870         * pt.c (mark_decl_instantiated): Unconditionally make
4871         instantiations explicit unconditionally
4872         (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
4873         since mark_decl_instantiated now does it.
4874         (instantiate_class_member): New.  Instantiate a member of an
4875         explicitly instantiated class template.
4876         (do_type_instantiation): Explicitly instantiate members of an
4877         explicitly instantiated class template.
4878         (instantiate_decl): if undefined_ok is nonzero, and if we're
4879         trying to explicitly instantiated a template with no definition,
4880         change it to an implicit instantiation.
4881         (instantiate_pending_templates): Add new argument to instantiate_decl.
4882         * tree.c (cp_cannot_inline_tree_fn): Likewise.
4883
4884 2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
4885
4886         * cp-tree.h: Fix typo.
4887
4888         * cp-tree.h: Include cgraph.h
4889         (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
4890         TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
4891
4892 2004-06-01  Jason Merrill  <jason@redhat.com>
4893
4894         PR c++/15142
4895         * call.c (call_builtin_trap): Remove type parm.
4896         (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
4897         (build_x_va_arg): Dereference a null pointer for a non-POD argument.
4898
4899 2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4900
4901         PR c++/13092
4902         * init.c (build_offset_ref): Build SCOPE_REF with non-null
4903         TREE_TYPE for non-dependent names.
4904         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
4905         unknown_type_node as its TREE_TYPE.
4906         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
4907         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
4908         (dump_expr) <SCOPE_REF case>: Likewise.
4909
4910 2004-06-01  Richard Henderson  <rth@redhat.com>
4911             Andrew Pinski  <pinskia@physics.uc.edu>
4912
4913         * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
4914         * parser.c (struct cp_parser): Remove in_offsetof.
4915         (cp_parser_new): Don't set it.
4916         (cp_parser_unary_expression): Don't check it.
4917         (cp_parser_postfix_open_square_expression): Split out from ...
4918         (cp_parser_postfix_expression): ... here.
4919         (cp_parser_postfix_dot_deref_expression): Likewise.
4920         (cp_parser_builtin_offsetof): New.
4921         (cp_parser_primary_expression): Use it.
4922
4923 2004-06-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4924
4925         PR c++/14932
4926         * parser.c (cp_parser_postfix_expression): Allow subscript
4927         operator in offsetof.
4928
4929 2004-05-31  Mark Mitchell  <mark@codesourcery.com>
4930
4931         PR c++/15701
4932         * friend.c (add_friend): Do not try to perform access checks for
4933         functions from dependent classes.
4934
4935 2004-05-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4936
4937         * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
4938         (pp_cxx_begin_template_argument_list): Turn into a function.
4939         (pp_cxx_end_template_argument_list): Likewise.
4940         (pp_cxx_separate_with): Define.
4941         (pp_cxx_unqualified_id): Tidy.
4942         (pp_cxx_primary_expression): Likewise.
4943         (pp_cxx_postfix_expression): Likewise.
4944         (pp_cxx_expression): Likewise.
4945         (pp_cxx_simple_type_specifier): Likewise.
4946         (pp_cxx_type_specifier_seq): Likewise.
4947         (pp_cxx_parameter_declaration_clause): Likewise.
4948         (pp_cxx_exception_specification): Likewise.
4949         (pp_cxx_direct_declarator): Likewise.
4950         (pp_cxx_type_id): Likewise.
4951         * cxx-pretty-print.h (pp_cxx_whitespace): Export from
4952         cxx-pretty-print.c.
4953         (pp_cxx_left_paren): Likewise.
4954         (pp_cxx_right_paren): Likewise.
4955         (pp_cxx_left_brace): Likewise.
4956         (pp_cxx_right_brace): Likewise.
4957         (pp_cxx_left_bracket): Likewise.
4958         (pp_cxx_right_bracket): Likewise.
4959         (pp_cxx_dot): Likewise.
4960         (pp_cxx_identifier): Likewise.
4961         (pp_cxx_tree_identifier): Likewise.
4962         (pp_cxx_ampersand): New macro.
4963         (pp_cxx_star): Likewise.
4964         (pp_cxx_arrow): Likewise.
4965         (pp_cxx_semicolon): Likewise.
4966         (pp_cxx_complement): Likewise.
4967         (pp_cxx_begin_template_argument_list): Declaree.
4968         (pp_cxx_end_template_argument_list): Likewise.
4969         (pp_cxx_colon_colon): likewise.
4970
4971 2004-05-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
4972
4973         * parser.c (cp_parser_simple_type_specifier): Explicitly test
4974         against NULL_TREE.
4975
4976 2004-05-31  Kazu Hirata  <kazu@cs.umass.edu>
4977
4978         * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
4979         typeck.c: Fix comment formatting.
4980
4981 2004-05-30  Andrew Pinski  <pinskia@physics.uc.edu>
4982
4983         * cp-lang.c (cp_expand_decl): Remove.
4984         (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
4985
4986 2004-05-30  Andreas Jaeger  <aj@suse.de>
4987
4988         * lang-specs.h: Add missing initializers for .ii.
4989
4990 2004-05-28  Aldy Hernandez  <aldyh@redhat.com>
4991
4992         * decl.c (cp_make_fname_decl): Free return value from
4993         fname_as_string.
4994
4995 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
4996
4997         PR c++/15083
4998         * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
4999         even in a templat.e
5000         * init.c (build_new): Likewise.
5001
5002         PR c++/15640
5003         * name-lookup.c (arg_assoc): Robustify.
5004
5005         PR c++/15471
5006         * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
5007         when determining the scope to use for a pointer to member.
5008         (lookup_anon_field): Give it external linkage.
5009         * cp-tree.h (lookup_anon_field): Declare it.
5010         * expr.c (cplus_expand_constant): Use it.
5011
5012 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
5013
5014         PR c++/14668
5015         * parser.c (cp_parser_simple_type_specifier): Call
5016         maybe_note_name_used_in_class.
5017
5018 2004-05-28  Tom Marshall  <tmarshall@real.com>
5019
5020         PR c++/15214
5021         * class.c (finish_struct_1): Warn only if the dtor is non-private or
5022         the class has friends.
5023
5024 2004-05-27  Adam Nemet  <anemet@lnxw.com>
5025
5026         PR c++/12883
5027         * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
5028         TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
5029
5030 2004-05-24  Geoffrey Keating  <geoffk@apple.com>
5031
5032         * method.c (implicitly_declare_fn): Don't call defer_fn; abort
5033         if it might be needed.
5034         * pt.c (mark_decl_instantiated): Only call defer_fn if
5035         the function actually needs processing in finish_file.
5036         * decl2.c (finish_file): Add check that elements in
5037         deferred_fns_used are really needed there.  Remove unnecessary
5038         test of DECL_SAVED_TREE.
5039
5040 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
5041
5042         * Make-lang.in: No need to specify $(LIBCPP).
5043
5044 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
5045
5046         PR c++/15044
5047         * parser.c (cp_parser_class_head): Robustify.
5048
5049         PR c++/15317
5050         * parser.c (cp_parser_decl_specifier_seq): Correct error in
5051         comment.
5052         (cp_parser_constructor_declarator_p): Treat attributes
5053         as decl-specifiers.
5054
5055         PR c++/15329
5056         * typeck.c (build_unary_op): Do not attempt to resolve casts to
5057         base classes in templates.
5058
5059 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
5060
5061         PR c++/15165
5062         * pt.c (instantiate_template): Robustify.
5063
5064 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
5065
5066         PR c++/15025
5067         * decl.c (xref_tag): Issue errors about redeclaring template
5068         classes as non-template classes.
5069
5070 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
5071
5072         PR c++/14821
5073         * name-lookup.c (supplement_binding): Allow redefinitions of
5074         namespace aliases.
5075
5076         PR c++/14883
5077         * parser.c (cp_parser_template_argument): Robustify.
5078
5079 2004-05-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5080
5081         * class.c (alter_access): Use %E format specifier to print an
5082         identifier node.  Avoid looking at the IDENTIFIER_POINTER.
5083         (push_lang_context): Likewise.
5084         * decl.c (lookup_label): Likewise.
5085         (grokdeclarator): Likewise.
5086         * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
5087         * pt.c (do_type_instantiation): Likewise.
5088         * tree.c (handle_java_interface_attribute): Likewise.
5089         (handle_com_interface_attribute): Likewise.
5090         (handle_init_priority_attribute): Likewise.
5091
5092 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
5093
5094         PR c++/15285
5095         PR c++/15299
5096         * pt.c (build_non_dependent_expr): Expand the set of tree nodes
5097         recognized as overloaded functions.
5098
5099 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
5100
5101         PR c++/15507
5102         * class.c (layout_nonempty_base_or_field): Do not try to avoid
5103         layout conflicts for unions.
5104
5105         PR c++/15542
5106         * typeck.c (build_x_unary_op): Instantiate template class
5107         specializations before looking for "operator &".
5108
5109         PR c++/15427
5110         * typeck.c (complete_type): Layout non-dependent array types, even
5111         in templates.
5112
5113         PR c++/15287
5114         * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
5115         template.
5116
5117 2004-05-22  Roger Sayle  <roger@eyesopen.com>
5118
5119         * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
5120         returning when TREE_TYPE is error_mark_node.
5121         * typeck.c (require_complete_type): Return error_mark_node if
5122         value's type is an error_mark_node.
5123
5124 2004-05-20  Andrew Pinski  <pinskia@physics.uc.edu>
5125
5126         * optimize.c (calls_setjmp_r): Remove.
5127         (calls_setjmp_p): Remove.
5128         * cp-tree.c (calls_setjmp_p): Remove.
5129         * decl.c (finish_function): Do not call calls_setjmp_p.
5130
5131 2004-05-18  Zack Weinberg  <zack@codesourcery.com>
5132
5133         * decl.c (cp_finish_decl): Use mark_decl_referenced.
5134         * decl2.c (maybe_make_one_only): Likewise.
5135         * method.c (use_thunk): Likewise.
5136
5137 2004-05-18  Jason Merrill  <jason@redhat.com>
5138
5139         * class.c (build_base_path): Tidy a bit.
5140
5141 2004-05-14  Geoffrey Keating  <geoffk@apple.com>
5142
5143         * name-lookup.c (struct scope_binding): New.
5144         (EMPTY_SCOPE_BINDING): New.
5145         (lookup_using_namespace): Take a scope_binding instead of a
5146         cxx_binding.
5147         (qualified_lookup_using_namespace): Likewise.
5148         (cxx_binding_clear): Delete.
5149         (do_nonmember_using_decl): Use a scope_binding instead of a
5150         cxx_binding.
5151         (lookup_tag): Don't call select_decl.
5152         (ambiguous_decl): Don't return anything (and change callers to match).
5153         Take a scope_binding as the second parameter.
5154         (lookup_namespace_name): Use a scope_binding instead of a
5155         cxx_binding.
5156         (unqualified_namespace_lookup): Likewise.
5157         (lookup_qualified_name): Likewise.
5158         (select_decl): Take a scope_binding instead of a cxx_binding.
5159         Use macros rather than hand-coding tests for type-ness.
5160
5161 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
5162
5163         * cp-gimplify.c: Rename from cp-simplify.c.
5164         * Make-lang.in, optimize.c: Update.
5165
5166 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
5167
5168         Merge from tree-ssa-20020619-branch.  See
5169         ChangeLog.tree-ssa for details.
5170
5171         * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
5172         cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
5173         expr.c, init.c, name-lookup.h, optimize.c, parser.c,
5174         pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
5175         Merged.
5176         * cp-mudflap.c: New file.
5177         * cp-simplify.c:: New file.
5178
5179 2004-05-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5180
5181         PR c++/14389
5182         * decl2.c (check_classfn): For member templates, compare also the
5183         template parameters to match the declaration.
5184         * cp-tree.h: Adjust declaration of check_classfn.
5185         * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
5186         * friend.c (do_friend): Likewise.
5187         * pt.c (tsubst_friend_function): Likewise.
5188
5189 2004-05-01  Zack Weinberg  <zack@codesourcery.com>
5190
5191         * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
5192         Instead, dig into the representation type to find the array bound.
5193
5194 2004-04-30  Jason Merrill  <jason@redhat.com>
5195
5196         Refer to base members using COMPONENT_REFs where possible.
5197         * class.c (build_simple_base_path): New fn.
5198         (build_base_path): Use it for non-virtual base references.
5199         (layout_class_type): Change base fields to their real type
5200         after layout is done.
5201         * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
5202         * cp-lang.c (cxx_get_alias_set): Use it.
5203
5204 2004-04-30  Kazu Hirata  <kazu@cs.umass.edu>
5205
5206         * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
5207         comment typos.
5208
5209 2004-04-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5210
5211         PR c++/15064
5212         * parser.c (cp_parser_postfix_expression): typeid operator cannot be
5213         used in integral constant expressions.
5214
5215 2004-04-22  Mark Mitchell  <mark@codesourcery.com>
5216
5217         * init.c (build_aggr_init): Fix accidental use of C99 construct in
5218         previous change.
5219
5220         * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
5221         braced initializer.
5222         * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
5223         * decl.c (reshape_init): Use it.
5224         * init.c (perform_member_init): Remove redundant condition.
5225         (build_aggr_init): Adjust to handle brace-enclosed initializers
5226         correctly.
5227         (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
5228
5229         * parser.c (cp_parser_initializer_clause): Do not set
5230         TREE_HAS_CONSTRUCTOR on the initializer.
5231         * rtti.c (tinfo_base_init): Likewise.
5232         (generic_initializer): Likewise.
5233         (ptr_initializer): Likewise.
5234         (ptm_initializer): Likewise.
5235         (class_initializer): Likewise.
5236         (get_pseudo_ti_init): Likewise.
5237         * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
5238
5239 2004-04-22  Alan Modra  <amodra@bigpond.net.au>
5240
5241         * name-lookup.c (anonymous_namespace_name): Make static.
5242
5243 2004-04-19  Roger Sayle  <roger@eyesopen.com>
5244
5245         PR middle-end/14531
5246         * class.c (build_base_path): Call fold whilst building the NULL
5247         pointer check expression trees.
5248
5249 2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>
5250
5251         * init.c (build_new_1): Don't use type size argument for Java
5252         _Jv_AllocObject call.
5253
5254 2004-04-09  Danny Smith  <dannysmith@users.sourceforge.net>
5255
5256         * method.c (make_alias_for_thunk): Remove preprocessor guard on
5257         declaration and definition.
5258
5259 2004-04-08  Danny Smith  <dannysmith@users.sourceforge.net>
5260
5261         PR c++/14808
5262         * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
5263         than ASM_OUTPUT_DEF.
5264
5265 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5266
5267         * decl2.c (mark_used): Don't segfault if cfun != NULL but
5268         current_function_decl == NULL.
5269
5270 2004-04-05  Nathan Sidwell  <nathan@codesourcery.com>
5271
5272         PR c++/3518
5273         * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
5274         level.
5275
5276 2004-04-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5277
5278         * init.c (decl_constant_value): Don't look at DECL_INITIAL
5279         of PARM_DECL.
5280         * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
5281         or TREE_SIDE_EFFECTS of a type.
5282
5283 2004-04-02  Nathan Sidwell  <nathan@codesourcery.com>
5284
5285         PR c++/14007
5286         * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
5287         cv-qualifier unification.
5288         * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
5289
5290 2004-04-02  Jan Hubicka  <jh@suse.cz>
5291
5292         * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
5293         * cp-tree.h (cp_update_decl_after_saving): Declare.
5294         * tree.c (cp_update_decl_after_saving): Define.
5295
5296 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
5297
5298         PR c++/14803
5299         * typeck.c (get_delta_difference): Call fold before returning the
5300         value.
5301
5302 2004-04-01  Richard Henderson  <rth@redhat.com>
5303
5304         PR c++/14804
5305         * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
5306         * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
5307
5308 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
5309
5310         PR c++/14810
5311         * name-lookup.c (maybe_push_cleanup_level): Robustify.
5312
5313 2004-04-01  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5314
5315         * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
5316
5317 2004-03-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5318
5319         * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
5320         * class.c (check_bitfield_decl): Likewise.
5321         * cvt.c (type_promotes_to): Likewise.
5322         * decl.c (finish_enum): Likewise.
5323         * mangle.c (write_builtin_type): Likewise.
5324         * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
5325         * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
5326         (build_binary_op): Likewise.
5327
5328 2004-03-31  Jan Hubicka  <jh@suse.cz>
5329
5330         * tree.h (optimize_function): Kill prototype.
5331         * optimize.c (dump_function, optimize_function, dump_finction): Kill.
5332         * semantics.c (expand_body): Kill.
5333
5334 2004-03-30  Mark Mitchell  <mark@codesourcery.com>
5335
5336         PR c++/14724
5337         * decl.c (start_decl_1): Do not decide whether or not to create a
5338         new cleanup level until after the type has been completed.
5339
5340         PR c++/14763
5341         * pt.c (tsubst_default_argument): Clear current_function_decl.
5342
5343 2004-03-30  Zack Weinberg  <zack@codesourcery.com>
5344
5345         * name-lookup.c, parser.c: Use new shorter form of GTY markers.
5346
5347 2004-03-29  Zack Weinberg  <zack@codesourcery.com>
5348
5349         * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
5350         is null, just print the literal name and return.
5351
5352 2004-03-25  Kazu Hirata  <kazu@cs.umass.edu>
5353
5354         * cxx-pretty-print.c: Fix comment typos.
5355
5356 2004-03-24  Kazu Hirata  <kazu@cs.umass.edu>
5357
5358         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
5359         Update copyright.
5360
5361 2004-03-23  Ziemowit Laski  <zlaski@apple.com>
5362
5363         * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
5364         * mangle.c (write_type): Add call to 'mangle_fundamental_type'
5365         target hook.
5366
5367 2004-03-23  Zack Weinberg  <zack@codesourcery.com>
5368
5369         PR 12267, 12391, 12560, 13129, 14114, 14133
5370         * cp-lang.c (c_reset_state): Delete.
5371         (push_file_scope, pop_file_scope): New stubs.
5372         * parser.c (c_parse_file): Call sorry() here if called more than once.
5373
5374 2004-03-23  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5375
5376         * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
5377         for INTEGER_CST.
5378
5379 2004-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5380
5381         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
5382
5383 2004-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5384
5385         * error.c (enum pad): Remove.
5386         (dump_qualifiers): Likewise.
5387         (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
5388         (dump_aggr_type): Likewise.
5389         (dump_type_suffix): Likewise.
5390         (dump_simple_decl): Likewise.
5391         (dump_function_decl): Likewise.
5392         (cv_to_string): Likewise.
5393         (dump_type_prefix): Likewise.  Adjust return void.
5394         * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
5395         cxx_pretty_print.h.
5396         (pp_cxx_template_keyword_if_needed): Document.
5397         (pp_cxx_qualified_id): Document case FUNCTION_DECL.  Tidy.
5398         (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
5399         MUST_NOT_THROW_EXPR.
5400
5401 2004-03-21  Mark Mitchell  <mark@codesourcery.com>
5402
5403         PR c++/14616
5404         * decl.c (cp_finish_decl): Compute the size of arrays declared in
5405         templates, if their type is non-dependent.
5406
5407 2004-03-19  Mark Mitchell  <mark@codesourcery.com>
5408
5409         * call.c (build_op_delete_call): Do not forget the placement
5410         arguments when iterating through mutiple delete operators.
5411
5412         * cp-tree.h (svaed_scope): Remove last_parms.
5413         (NEW_DELETE_OPNAME_P): New macro.
5414         (last_function_parms): Remove.
5415         (do_friend): Adjust prototype.
5416         * decl.c (grokparms): Return the PARM_DECLs directly, rather than
5417         using last_function_parms.
5418         (grokfndecl): Take the PARM_DECLs as an argument, rather than
5419         using last_function_parms.
5420         (grokdeclarator): Adjust accordingly.  Do not form METHOD_TYPEs
5421         for class-specific operator new and operator delete.
5422         (grok_op_properties): Do not look for allocation functions with
5423         METHOD_TYPEs.
5424         (start_function): Use DECL_ARGUMENTS instead of
5425         last_function_parms.
5426         * decl.h (last_function_parms): Do not declare.
5427         * decl2.c (grokclassfn): Do not use last_function_parms.
5428         * friend.c (do_friend): Remove parmdecls parameter.
5429         * name-lookup.c (push_to_top_level): Do not save last_function_parms.
5430         (pop_from_top_level): Do not restore it.
5431         * pt.c (check_explicit_specialization): Do not adjust
5432         last_function_parms.
5433
5434         * name-lookup.c (do_local_using_decl): Create a local binding for
5435         types brought in via using declarations.
5436
5437         * name-lookup.c (lookup_arg_dependent): Handle block-scope
5438         function declarations correctly.
5439
5440         * semantics.c (finish_id_expression): Correct handling of
5441         conversion operators to dependent types.
5442
5443         * typeck.c (lookup_destructor): Allow the use of destructors from
5444         base classes.
5445
5446 2004-03-19  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5447
5448         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
5449         TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
5450         * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
5451         the field is named TEMPLATE_TYPE_PARM_INDEX.
5452
5453 2004-03-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5454
5455         PR c++/14545
5456         * parser.c (cp_parser_functional_cast): A cast to anything
5457         but integral or enumaration type is not an integral constant
5458         expression.
5459         * pt.c (value_dependent_expression_p): Handle cast expressions
5460         without operands (such as "int()").
5461
5462 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
5463
5464         * semantics.c (finish_pseudo_destructor_expr): Allow differing
5465         cv-qualification between the type named by the
5466         pseudo-destructor-name and the object-type.
5467
5468         * search.c (accessible_base_p): Handle non-proper bases.
5469
5470         * name-lookup.c (do_nonmember_using_decl): If a using declaration
5471         refers to a single overloaded function, set the type of the
5472         function.
5473         * tree.c (lvalue_type): Simplify.
5474         * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
5475         unknown type.
5476         (build_unary_op): Handle OVERLOADs with known types.
5477
5478         * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
5479         function templates.
5480
5481         * parser.c (cp_parser_postfix_expression): Handle the use of
5482         "typename" in non-dependent contexts.  Convert appropriately when
5483         when using a qualified name after "->" or ".".
5484
5485         * call.c (conditional_conversion): Honor the requirement that some
5486         conversions refer to the original object.
5487
5488 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
5489
5490         * call.c (build_conditional_expr): Do not call force_rvalue for
5491         operands of void_type when the conditional expression itself has
5492         void type.
5493         * name-lookup.c (pushdecl): Don't consider a declaration of a
5494         function named "main" to be an overload of a type named "main".
5495         * parser.c (cp_parser_template_name): Perform name lookup when the
5496         template name is proceeded by "template" if the qualifying scope
5497         is non-dependent.
5498         * typeck.c (composite_pointer_type_r): Correctly handle
5499         pointer-to-member types.
5500         (build_const_cast): Likewise.
5501
5502 2004-03-18  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5503
5504         * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
5505         * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
5506         (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
5507         (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
5508         (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
5509         (TYPEOF_TYPE_EXPR): New macro.
5510         * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
5511         * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
5512         * pt.c (tsubst): Likewise.
5513         * semantics.c (finish_typeof): Likewise.
5514         * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
5515         and TEMPLATE_TYPE_PARM.
5516         * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
5517         (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
5518
5519 2004-03-16  Mark Mitchell  <mark@codesourcery.com>
5520
5521         PR c++/14586
5522         * cp-tree.h (build_new_op): Change prototype.
5523         (build_x_binary_op): Likewise.
5524         * call.c (build_new_op): Add overloaded_p parameter.
5525         * decl2.c (grok_array_decl): Adjust call to build_new_op.
5526         * parser.c (cp_parser_binary_expression): Note that uses of
5527         overloaded operators prevents an expression from being considered
5528         an integral constant.
5529         * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
5530         build_x_binary_op.
5531         * semantics.c (finish_call_expr): Likewise.
5532         * typeck.c (rationalize_conditional_expr): Likewise.
5533         (build_x_indirect_ref): Likewise.
5534         (build_x_binary_op): Likewise.
5535         (build_x_unary_op): Likewise.
5536         (build_x_compound_expr): Likewise.
5537         (build_modify_expr): Likewise.
5538         * typeck2.c (build_x_arrow): Likewise.
5539
5540 2004-03-15  Kazu Hirata  <kazu@cs.umass.edu>
5541
5542         * cp-lang.c, ptree.c: Update copyright.
5543
5544 2004-03-13  Mark Mitchell  <mark@codesourcery.com>
5545
5546         PR c++/14550
5547         * parser.c (cp_parser_non_integral_constant_expression): Encode
5548         more of the idiom that surrounded calls to this function within
5549         the function itself
5550         (cp_parser_primary_expression): Adjust accordingly.
5551         (cp_parser_postfix_expression): Likewise.
5552         (cp_parser_unary_expression): Likewise.
5553         (cp_parser_cast_expression): Likewise.
5554         (cp_parser_assignment_expression): Likewise.
5555         (cp_parser_expression): Likewise.
5556         (cp_parser_new_expression): Note that new-expressions are not
5557         allowed in integral constant expressions.
5558         (cp_parser_delete_expression): Likewise.
5559
5560 2004-03-12  Matt Austern  <austern@apple.com>
5561
5562         * decl2.c (maybe_make_one_only): Look at
5563         TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
5564         to make an explicit instantiation weak.
5565         * method.c (use_thunk): Make sure we call comdat_linkage
5566         when appropriate.
5567         * pt.c (do_type_instantiation): On systems where weak symbols
5568         don't go in a static archive's TOC, explicit instantiation of a
5569         class must imply *explicit* instantiation of its memeber.
5570
5571 2004-03-11  Kazu Hirata  <kazu@cs.umass.edu>
5572
5573         * call.c, cp-tree.h, pt.c: Fix comment typos.
5574
5575 2004-03-10  Mark Mitchell  <mark@codesourcery.com>
5576
5577         PR c++/14510
5578         * decl.c (xref_tag): Disregard non-type declarations when
5579         looking up a tagged type.
5580
5581 2004-03-09  Nathan Sidwell  <nathan@codesourcery.com>
5582
5583         PR c++/14397
5584         * call.c (convert_like_real): Build a const qualified temporary,
5585         when testing ctor access.
5586
5587 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
5588
5589         * call.c (initialize_reference): Fix typo.
5590
5591 2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5592
5593         PR c++/14409
5594         * pt.c (determine_specialization): For member templates, match also
5595         constness.
5596
5597         PR c++/14448
5598         * parser.c (cp_parser_initializer_clause): Fold initializer if it is
5599         non-dependent.
5600         * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
5601
5602 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
5603
5604         PR c++/14230
5605         * call.c (initialize_reference): Handle initializers that are
5606         class-member access expressions applies to rvalues.
5607
5608 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
5609
5610         PR c++/14432
5611         * name-lookup.c (supplement_binding): Ignore functions that are
5612         marked DECL_ANTICIPATED.
5613
5614 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
5615
5616         PR c++/14401
5617         * class.c (check_field_decls): Complain about non-static data
5618         members of reference type in unions.  Propagate
5619         CLASSTYPE_REF_FIELDS_NEED_INIT and
5620         CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
5621         data members.
5622         * init.c (perform_member_init): Complain about mbmers with const
5623         type that are not explicitly initialized.
5624
5625 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
5626
5627         * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
5628         * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
5629         (lang_identifier): Remove implicit_decl and error_locus.
5630         (IDENTIFIER_IMPLICIT_DECL): Remove.
5631         (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
5632         (IDENTIFIER_ERROR_LOCUS): Likewise.
5633         (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
5634         (TYPE_ASSEMBLER_NAME_STRING): Likewise.
5635         (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
5636         (implicitly_declare): Remove.
5637         * decl.c (warn_extern_redeclared_static): Remove check of
5638         IDENTIFIER_IMPLICIT_DECL.
5639         (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
5640         (implicitly_declare): Remove.
5641         (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
5642         (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
5643         (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
5644         * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
5645         in the innermost scope, rather than at namespace scope.
5646         * name-lookup.c (push_local_binding): Give it external linkage.
5647         (pushdecl): Remove dead code.
5648         * name-lookup.h (push_local_binding): Declare it.
5649         * ptree.c (cxx_print_identifier): Don't print
5650         IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
5651         * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
5652         not IDENTIFIER_ERROR_LOCUS.
5653         * typeck.c (build_function_call): Remove dead code.
5654
5655 2004-03-08  Jason Merrill  <jason@redhat.com>
5656
5657         PR c++/13170
5658         * decl.c (xref_tag): Remove attribute handling.
5659         * cp-tree.h: Adjust prototype.
5660         * decl.c, parser.c, rtti.c: Adjust callers.
5661         * parser.c (cp_parser_class_head): Pass back attributes in the
5662         class head.
5663         (cp_parser_class_specifier): Adjust.
5664
5665 2004-03-08  Matt Austern  <austern@apple.com>
5666
5667         PR debug/14079
5668         * name-lookup.c (add_decl_to_level): Add extern variables, as well
5669         as static, to static_decls array.
5670
5671 2004-03-05  Jason Merrill  <jason@redhat.com>
5672
5673         * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
5674
5675 2004-03-04  Geoffrey Keating  <geoffk@apple.com>
5676
5677         * decl.c (grokfndecl): Update old incorrect comment.
5678         (grokvardecl): Diagnose C++ variables of type with no linkage.
5679
5680 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
5681
5682         PR c++/14369
5683         * pt.c (build_non_dependent_expr): Do not create a
5684         NON_DEPENDENT_EXPR for a THROW_EXPR.
5685
5686 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5687
5688         PR c++/14369
5689         * error.c (dump_expr): Handle THROW_EXPR.
5690
5691 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
5692
5693         PR c++/14360
5694         * parser.c (cp_parser_postfix_expression): Do not perform Koenig
5695         lookup if ordinary name-lookup finds a non-function.
5696         * pt.c (tsubst_copy_and_build): Likewise.
5697
5698         PR c++/14361
5699         * parser.c (cp_parser_late_parsing_default_args): Check that there
5700         are no extra tokens after the end of the default-argument
5701         expression.
5702
5703 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
5704
5705         PR c++/14324
5706         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
5707         having C++ linkage for name-mangling purposes.
5708
5709         PR c++/14260
5710         * parser.c (cp_parser_direct_declarator): Recognize constructor
5711         declarators that use a template-id to name the class being
5712         constructed.
5713
5714         PR c++/14337
5715         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
5716         (tsubst_expr): Do not call tsubst_copy, even when
5717         processing_template_decl.
5718
5719 2004-03-01  Jeff Law  <law@redhat.com>
5720
5721         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
5722         the proper type.
5723
5724 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
5725
5726         PR c++/14138
5727         * name-lookup.h (push_scope): Change prototype.
5728         * name-lookup.c (push_scope): Do not reenter the current class
5729         scope.
5730         * decl.c (grokfndecl): Check return code from push_scope before
5731         calling pop_scope.
5732         * decl2.c (check_classfn): Likewise.
5733         * parser.c (cp_parser_conversion_function_id): Likewise.
5734         (cp_parser_init_declarator): Likewise.
5735         (cp_parser_direct_declarator): Likewise.
5736         (cp_parser_class_specifier): Likewise.
5737         (cp_parser_class_head): Likewise.
5738         (cp_parser_lookup_name): Likewise.
5739         (cp_parser_constructor_declarator_p): Likewise.
5740         * pt.c (instantiate_class_template): Likewise.
5741         (resolve_typename_type): Likewise.
5742
5743 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
5744
5745         PR c++/14267
5746         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
5747         extension.
5748
5749         PR debug/12103
5750         * class.c (update_vtable_entry_for_fn): Do not go through
5751         covariance machinery if the type returned by an overrider is the
5752         same as the original.
5753
5754 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
5755
5756         * call.c: Fix a comment typo.
5757
5758 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
5759
5760         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
5761
5762 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
5763
5764         PR c++/14278
5765         * parser.c (cp_parser_parameter_declaration_list): Commit
5766         to fewer tentative parses.
5767
5768 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5769
5770         PR c++/14284
5771         * pt.c (dependent_type_p_r): A template template parameter is a
5772         dependent type.
5773
5774 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5775
5776         PR c++/14246
5777         * mangle.c (write_template_arg_literal): Don't rely on identity for
5778         boolean constants.
5779
5780 2004-02-24  Jason Merrill  <jason@redhat.com>
5781
5782         * tree.c (build_exception_variant): Use check_qualified_type.
5783
5784 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
5785             Kazu Hirata  <kazu@cs.umass.edu>
5786
5787         * decl.c (cxx_init_decl_processing): Don't check
5788         flag_writable_strings.
5789
5790 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
5791
5792         PR c++/14156
5793         * typeck.c (maybe_warn_about_returning_address_of_location):
5794         Change check for VAR_DECL to use DECL_P instead.
5795
5796 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5797
5798         PR c++/14250
5799         * cvt.c (build_expr_type_conversion): Type must be complete before
5800         looking up for conversions.
5801
5802 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5803
5804         PR c++/14143
5805         * name-lookup.c (arg_assoc_class): Don't look into template
5806         arguments if it is not a primary template.
5807
5808 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5809
5810         PR c++/12007
5811         * method.c (use_thunk): Always clone function argument tree.
5812
5813 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
5814
5815         PR c++/14199
5816         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
5817
5818         PR c++/14173
5819         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
5820         for all type variants.
5821
5822 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
5823
5824         PR c++/13927
5825         * decl.c (duplicate_decls): Return error_mark_node for invalid
5826         redeclarations.
5827         * name-lookup.c (push_namespace): Ignore the return value from
5828         pushdecl.
5829         * pt.c (push_template_decl_real): Robustify.
5830
5831         PR c++/14186
5832         * name-lookup.c (push_class_level_binding): Do not complain about
5833         adding a binding for a member whose name is the same as the
5834         enclosing class if the member is located in a base class of the
5835         current class.
5836
5837 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5838
5839         PR c++/14181
5840         * parser.c (cp_parser_new_expression): Parse an ill-formed
5841         direct-new-declarator after a parenthesized type-id to emit good
5842         diagnostic.
5843
5844 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
5845
5846         * cp-tree.def, cvt.c: Update copyright.
5847
5848 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
5849
5850         PR c++/11326
5851         * cp-tree.h (abi_version_at_least): Remove.
5852         * mangle.c: Include flags.h.
5853
5854 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
5855
5856         PR c++/13971
5857         * call.c (build_conditional_expr): Handle conversions between
5858         class types which result in differently cv-qualified type
5859         variants.
5860
5861         PR c++/14086
5862         * class.c (delete_duplicate_fields_1): Remove.
5863         (delete_duplicate_fields): Likewise.
5864         (finish_struct_anon): Remove check for members with the same name
5865         as their enclosing class.
5866         (check_field_decls): Do not call duplicate_fields.
5867         * decl.c (grokdeclarator): Remove check for static data members
5868         with the same name as their enclosing class.
5869         * name-lookup.c (push_class_level_binding): Check for members with
5870         the same name as their enclosing class.
5871
5872 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5873
5874         PR c++/14085
5875         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
5876
5877 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
5878
5879         PR c++/13635
5880         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
5881         has full set of arguments.
5882
5883 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5884
5885         PR c++/13927
5886         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
5887
5888 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
5889
5890         PR c++/14122
5891         * cp-tree.h (delete_sanity): Change prototype.
5892         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
5893         Remove dead code.  Adjust code to warn about deleting an array.
5894         * typekc.c (decay_conversion): Use build_address and build_nop.
5895
5896         PR c++/14108
5897         * search.c (accessible_p): Do not check access in thunks.
5898
5899         PR c++/14083
5900         * call.c (build_conditional_expr): Call force_rvalue on the
5901         non-void operand in the case that one result is a throw-expression
5902         and the other is not.
5903
5904 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
5905
5906         PR c++/9851
5907         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
5908         the type name and look ahead for ::~, and bail out early with a
5909         better error message if the parse is going to fail.
5910
5911 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
5912
5913         * call.c (conversion_kind): New type.
5914         (conversion_rank): Likewise.
5915         (conversion): Likewise.
5916         (CONVERSION_RANK): New macro.
5917         (conversion_obstack): New variable.
5918         (obstack_initialized): Likewise.
5919         (z_candidate): Change type of convs and second_conv.
5920         (candidate_warning): New type.
5921         (IDENTITY_RANK): Remove.
5922         (EXACT_RANK): Likewise.
5923         (PROMO_RANK): Likewise.
5924         (STD_RANK): Likewise.
5925         (PBOOL_RANK): Likewise.
5926         (USER_RANK): Likewise.
5927         (ELLIPSIS_RANK): Likewise.
5928         (BAD_RANK): Likewise.
5929         (ICS_RANK): Likewise.
5930         (ICS_STD_RANK): Likewise.
5931         (ICS_USER_FLAG): Likewise.
5932         (ICS_ELLIPSIS_FLAG): Likewise.
5933         (ICS_THIS_FLAG): Likewise.
5934         (ICS_BAD_FLAG): Likewise.
5935         (NEED_TEMPORARY_P): Likewise.
5936         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
5937         (USER_CONV_CAND): Likewise.
5938         (USER_CONV_FN): Likewise.
5939         (conversion_obstack_alloc): New function.
5940         (alloc_conversion): Likewise.
5941         (validate_conversion_obstack): Likewise.
5942         (alloc_conversions): Likewise.
5943         (build_conv): Adjust to deal with new conversion data structures.
5944         (build_identity_conv): New function.
5945         (build_ambiguous_conv): Likewise.
5946         (standard_conversion): Adjust to deal with new conversion data
5947         structures.
5948         (convert_class_to_reference): Likewise.
5949         (direct_reference_binding): Likewise.
5950         (reference_binding): Likewise.
5951         (implicit_conversion): Likewise.
5952         (add_candidate): Likewise.
5953         (add_function_candidate): Likewise.
5954         (add_conv_candidate): Likewise.
5955         (build_builtin_candidate): Likewise.
5956         (print_z_candidate): Likewise.
5957         (merge_conversion_sequences): Likewise.
5958         (build_user_type_conversion_1): Likewise.
5959         (build_user_type_conversion): Likewise.
5960         (build_new_function_call): Likewise.
5961         (build_object_call): Likewise.
5962         (conditional_conversion): Likewise.
5963         (build_conditional_expr): Likewise.
5964         (build_new_op): Likewise.
5965         (build_op_delete_call): Likewise.
5966         (convert_like_real): Likewise.
5967         (build_over_call): Likewise.
5968         (build_new_method_call): Likewise.
5969         (is_subseq): Likewise.
5970         (maybe_handle_implicit_object): Likewise.
5971         (maybe_handle_ref_bind): Likewise.
5972         (compare_ics): Likewise.
5973         (source_type): Likewise.
5974         (add_warning): Likewise.
5975         (joust): Likewise.
5976         (can_convert_arg): Likewise.
5977         (can_convert_arg_bad): Likewise.
5978         (perform_implicit_conversion): Likewise.
5979         (perform_direct_initialization_if_possible): Likewise.
5980         (initialize_reference): Likewise.
5981         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
5982         * cp-tree.def (WRAPPER): Likewise.
5983         (IDENTITY_CONV): Remove.
5984         (LVALUE_CONV): Likewise.
5985         (QUAL_CONV): Likewise.
5986         (STD_CONV): Likewise.
5987         (PTR_CONV): Likewise.
5988         (PMEM_CONV): Likewise.
5989         (BASE_CONV): Likewise.
5990         (REF_BIND): Likewise.
5991         (USER_CONV): Likewise.
5992         (AMBIG_CONV): Likewise.
5993         (RVALUE_CONV): Likewise.
5994         * cp-tree.h (tree_wrapper): Remove.
5995         (WRAPPER_ZC): Remove.
5996         (lang_tree_node): Remove wrapper.
5997         (LOOKUP_SPECULATIVELY): Remove.
5998         (build_op_delete_call): Adjust prototype.
5999         (validate_conversion_obstack): Declare.
6000         (build_zc_wrapper): Remove.
6001         * cvt.c (convert_to_reference): Remove dead code.
6002         (ocp_convert): Likewise.
6003         * decl.c (redeclaration_error_message): Correct handling of
6004         templates.
6005         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
6006         (cp_tree_node_structure): Remove WRAPPER case.
6007         * decl2.c (finish_file): Call validate_conversion_obstack.
6008         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
6009         (build_op_delete_call): Likewise.
6010         (build_x_delete): Likewise.
6011         (build_delete): Adjust call to build_op_delete_call.
6012         * pt.c (tsubst_friend_declaration): Adjust code to determine
6013         whether or not a friend template is a definition.
6014         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
6015         * tree.c (build_zc_wrapper): Remove.
6016
6017 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
6018
6019         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
6020         * cp-tree.h: Don't declare cxx_builtin_type_decls.
6021         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
6022         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
6023
6024 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
6025
6026         * typeck.c (lookup_destructor): Fix typo in error message.
6027
6028 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
6029
6030         * call.c, parser.c, tree.c: Fix comment typos.
6031
6032 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
6033
6034         Bug 13856
6035         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
6036         * decl.c (duplicate_decls, start_function): Likewise.
6037
6038 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
6039
6040         * name-lookup.c (pushdecl): Issue shadow warnings directly.
6041         * parser.c (free_parser_stacks): Delete.
6042
6043 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
6044
6045         * rtti.c: Update copyright.
6046
6047 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6048
6049         PR c++/14033
6050         * decl.c (require_complete_types_for_parms): Do not insert
6051         error_mark_node in the parameter list.
6052
6053 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6054
6055         PR c++/14028
6056         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
6057         error when terminator can not be found.
6058
6059 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
6060
6061         Make-lang.in (po-generated):  Delete.
6062
6063 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
6064
6065         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
6066         targetm.calls.promote_prototypes.
6067
6068 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
6069
6070         PR middle-end/13750
6071         Revert:
6072         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
6073         PR pch/13361
6074         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
6075         (handle_pragma_implementation): Likewise.
6076
6077 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
6078
6079         PR c++/13714
6080         * typeck.c (lookup_destructor): Tweak error message.
6081
6082 2004-02-05  Jan Hubicka  <jh@suse.cz>
6083
6084         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
6085         functions.
6086
6087 2004-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6088
6089         PR c++/14008
6090         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
6091         code, only emits the diagnostic now. Added lookup of the identifier
6092         and support for qualified ids.
6093         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
6094         Parse an (invalid) type name as id-expression within a declarator.
6095         (cp_parser_simple_declaration): Use it.
6096         (cp_parser_member_declaration): Likewise.
6097         (cp_parser_make_typename_type): New function. Handle errors through
6098         cp_parser_diagnose_invalid_typename.
6099         (cp_parser_elaborated_type_specifier): Use it.
6100
6101 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
6102
6103         PR c++/13932
6104         * call.c (convert_like_real): Use "converting" rather than
6105         "argument" as the descriptive keyword to
6106         dubious_conversion_warnings.
6107         * typeck.c (convert_for_assignment): Do not call
6108         dubious_conversion_warnings.
6109
6110 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6111
6112         PR c++/13086
6113         * init.c (build_delete): Emit a more informative error message in
6114         case of an incomplete type, and on the correct source line.
6115
6116 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
6117
6118         * error.c, search.c: Update copyright.
6119
6120 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
6121
6122         PR c++/9941
6123         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
6124         linkage for the typeinfo name string.
6125
6126 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
6127
6128         PR c++/13969
6129         * cp-tree.h (fold_non_dependent_expr): New function.
6130         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
6131         (cp_parser_template_argument): Use fold_non_dependent_expr.
6132         (cp_parser_direct_declarator): Likewise.
6133         * pt.c (fold_non_dependent_expr): New function.
6134         (convert_nontype_argument): Use it.
6135         (tsubst_qualified_id): Simplify.
6136         (tsubst_copy_and_build): Likewise.
6137
6138 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
6139
6140         * decl.c (cxx_push_function_context): Do not set
6141         current_function_is_thunk.
6142         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
6143         actual function.
6144
6145 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6146
6147         PR c++/13997
6148         * pt.c (more_specialized_class): Increase processing_template_decl
6149         while partial ordering.
6150
6151 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
6152
6153         PR c++/13925
6154         * decl.c (start_function): Do not call pushdecl for any
6155         instantiation or specialization of a primary template.
6156
6157 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
6158
6159         PR c++/13950
6160         * parser.c (cp_parser_class_name): Robustify.
6161
6162         PR c++/13970
6163         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
6164
6165         PR c++/14002
6166         * semantics.c (finish_id_expression): Do not return an
6167         IDENTIFIER_NODE when lookup finds a PARM_DECL.
6168
6169 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
6170
6171         PR c++/13978
6172         * pt.c (build_non_dependent_expr): Do not build
6173         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
6174
6175         PR c++/13968
6176         * semantics.c (finish_id_expression): Do not return an
6177         IDENTIFIER_NODE when lookup finds a VAR_DECL.
6178
6179         PR c++/13975
6180         * parser.c (cp_parser_simple_declaration): When skipping to the
6181         end of the statement swallow the terminating semicolon.
6182
6183 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
6184
6185         PR c++/13113
6186         * init.c (build_offset_ref): Improve error recovery for invalid
6187         uses of non-static member functions.
6188
6189         PR c++/13854
6190         * cp-tree.h (cp_build_type_attribute_variant): New function.
6191         * class.c (build_clone): Use cp_build_type_attribute_variant.
6192         * decl.c (duplicate_decls): Likewise.
6193         * pt.c (copy_default_args_to_explicit_spec): Likewise.
6194         (tsubst_function_type): Likewise.
6195         * tree.c (build_exception_variant): Check attributes before
6196         concluding that two types are the same.
6197         (cp_build_type-attribute_variant): New method.
6198         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
6199
6200         PR c++/13907
6201         * call.c (convert_class_to_reference): Keep better track of
6202         pedantically invalid user-defined conversions.
6203
6204 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6205
6206         PR c++/13957
6207         * pt.c (tsubst_qualified_id): Improved error message when a type
6208         is expected but not found.
6209
6210 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
6211
6212         * class.c: Fix comment typos.
6213         * decl.c: Likewise.
6214         * error.c: Likewise.
6215         * parser.c: Likewise.
6216         * pt.c: Likewise.
6217         * search.c: Likewise.
6218         * typeck.c: Likewise.
6219
6220 2004-01-30  Richard Henderson  <rth@redhat.com>
6221
6222         PR c++/13693
6223         * method.c (use_thunk): Don't force_target_expr for void thunks.
6224         * tree.c (build_target_expr_with_type): Assert non-void type.
6225         (force_target_expr): Likewise.
6226
6227 2004-01-30  Michael Matz  <matz@suse.de>
6228
6229         * parser.c (cp_parser_labeled_statement): Accept case ranges.
6230
6231 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6232
6233         DR206
6234         PR c++/13813
6235         * decl.c (grokdeclarator): Check immediatly type completeness for
6236         non-dependent types.
6237
6238 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6239
6240         PR c++/13683
6241         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
6242         a sizeof expression.block
6243
6244 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
6245
6246         PR c++/13883
6247         * mangle.c (write_encoding): Correct encoding of member template
6248         constructors.
6249
6250 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6251
6252         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
6253         template name as it was `<::' (digraph typo).
6254         (cp_parser_nth_token_starts_template_argument_list_p): New function.
6255         (cp_parser_id_expression): Use it.
6256         (cp_parser_nested_name_specifier_opt): Likewise.
6257         (cp_parser_template_name): Likewise.
6258         (cp_parser_class_name): Likewise.
6259         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
6260
6261 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
6262
6263         PR c++/13791
6264         * typeck.c (merge_types): Do not merge attributes into
6265         TYPENAME_TYPEs.
6266
6267         PR c++/13736
6268         * parser.c (cp_parser_direct_declarator): Do not prevent
6269         backtracking inside a parenthesized declarator.
6270         (cp_parser_parameter_declaration): Fix typo in comment.
6271
6272 2004-01-28  Jan Hubicka  <jh@suse.cz>
6273
6274         * semantics.c (expand_body)  Do emit_associated_thunks before
6275         expansion.
6276
6277 2004-01-27  Devang Patel  <dpatel@apple.com>
6278
6279         * name-lookup.c: Include "debug.h"
6280         (do_namespace_alias): Invoke debug_hooks to emit debug info
6281         for namespace alias.
6282         (do_local_using_decl): Invoke debug_hooks to emit debug info
6283         for using decl.
6284         (do_class_using_decl): Same.
6285         (do_toplevel_using_decl): Same.
6286         (do_using_directive): Same.
6287         (cp_emit_debug_info_for_using): New function.
6288         * Make-lang.in (cp/parser.o): Depend on debug.h
6289         (cp/name-lookup.o): Same.
6290
6291 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6292
6293         * cp-tree.h (language_function, lang_type_header): Use
6294         BOOL_BITFIELD.
6295         * name-lookup.h (cp_binding_level): Likewise.
6296
6297 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
6298
6299         PR c++/13663
6300         * semantics.c (finish_for_expr): Check for unresolved overloaded
6301         functions.
6302
6303         * class.c (add_method): Just check processing_template_decl to
6304         determine whether or not we are within a template.
6305         * decl2.c (maybe_retrofit_in_chrg): Likewise.
6306         * init.c (decl_constant_value): Check the type of the declaration,
6307         not TREE_READONLY.
6308         * name-lookup.c (maybe_push_to_top_level): Rename to ...
6309         (push_to_top_level): ... this.
6310         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
6311         * pt.c (push_template_decl_real): Reorder condition for speed.
6312         (convert_template_argument): Use dependency-checking functions in
6313         place of uses_template_parms.
6314         (lookup_template_class): Avoid calling uses_template_parms more
6315         than once.
6316         (uses_template_parms): Reimplement, using dependency-checking
6317         functions.
6318         (instantiate_class_template): Use push_to_top_level, not
6319         maybe_push_to_top_level.
6320         (type_unification_real): Simplify.
6321         (type_dependent_expression_p): Handle OFFSET_REFs and
6322         TEMPLATE_DECLs.
6323         (any_dependent_template_arguments_p): Handle multiple levels of
6324         template argument.
6325         * semantics.c (expand_or_defer_fn): Do not check
6326         uses_template_parms for template instantiations.
6327         * typeck.c (comptypes): Avoid calling cp_type_quals.
6328
6329 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
6330
6331         PR c++/13833
6332         * call.c (build_over_call): Do not convert arguments when
6333         processing a template.
6334         * pt.c (build_non_dependent_expr): Do not build a
6335         NON_DEPENDENT_EXPR for arithmetic constants.
6336
6337 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6338
6339         PR c++/13810
6340         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
6341         returns a TYPE_DECL. no further lookup is required.
6342         * semantics.c (check_template_template_default_arg): A TYPE_DECL
6343         is invalid. Rework to give better diagnostics.
6344
6345 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6346
6347         PR c++/13797
6348         * pt.c (instantiate_class_template): Add an error_mark_node
6349         check.
6350         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
6351
6352 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
6353
6354         PR c++/13701
6355         * decl.c (finish_function): Move the call to
6356         finish_fname_decls below the call to
6357         finish_eh_spec_block.
6358
6359 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
6360
6361         * optimize.c, typeck2.c: Update copyright.
6362
6363 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
6364
6365         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
6366         init.c, mangle.c, typeck.c: Update copyright.
6367
6368 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
6369
6370         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
6371
6372 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
6373
6374         * Make-lang.in: Replace $(docdir) with doc.
6375         (c++.info, c++.srcinfo): Dummy entry.
6376         (c++.man, c++.srcman): New rules.
6377         (c++.install-man): Revamp rule.
6378
6379 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
6380
6381         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
6382         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
6383         immediate $(shell) instead of deferred backquote.
6384
6385 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
6386
6387         PR c++/13651
6388         * parser.c (cp_parser_postfix_expression): When encountering
6389         incomplete type on left-hand side of "->" or ".", treat the entire
6390         expression as erroneous.
6391
6392         PR c++/13592
6393         * call.c (build_field_call): Remove.
6394         (n_build_method_call): Likewise.
6395         (build_method_call): Likewise.
6396         (build_new_method_call): Do not call build_field_call.
6397         * class.c (n_build_method_call): Remove.
6398         (print_class_statistics): Do not print it.
6399         * cp-tree.h (build_method_call): Remove declaration.
6400         (finish_object_call_expr): Likewise.
6401         (build_new_1): Do not use build_method_call.
6402         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
6403         when the function appearing on the right-hand-side of "." or "->"
6404         is not actually a function.
6405         * pt.c (tsubst_copy_and_build): Likewise.
6406         * semantics.c (finish_object_call_expr): Remove.
6407
6408 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
6409
6410         PR c++/13710
6411         * pt.c (tsubst): Use finish_typeof.
6412
6413 2004-01-18  Jason Merrill  <jason@redhat.com>
6414
6415         PR c++/11725
6416         * except.c (build_throw): In a template, set
6417         current_function_returns_abnormally.
6418
6419 2004-01-17  Fred Fish  <fnf@intrinsity.com>
6420
6421         PR c++/11895
6422         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
6423         except don't call array_type_nelts() with a VECTOR_TYPE.
6424
6425 2004-01-16  Jan Hubicka  <jh@suse.cz>
6426
6427         * mangle.c (write_mangled_name): Remove inline modifier.
6428
6429 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
6430
6431         PR c++/13574
6432         * decl.c (compute_array_index_type): Fix grammar in comment.
6433         * init.c (build_zero_init): Handle zero-sized arrays correctly.
6434
6435         PR c++/13178
6436         * call.c (name_as_c_string): Print conversion operator names
6437         correctly.
6438
6439         PR c++/13478
6440         * call.c (initialize_reference): Pass -1 for inner parameter to
6441         convert_like_real.
6442
6443 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6444
6445         PR c++/13407
6446         * parser.c (cp_parser_base_specifier): Check for an invalid
6447         keyword `typename' and emit an user-friendly error message.
6448
6449 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
6450
6451         PR pch/13361
6452         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
6453         (handle_pragma_implementation): Likewise.
6454
6455 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6456
6457         PR c++/9259
6458         * typeck.c (build_class_member_access_expr): Allow to access members
6459         of the currently open class.
6460         (finish_class_member_access_expr): Likewise.
6461
6462 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
6463
6464         PR c++/13659
6465         * name-lookup.c (validate_nonmember_using_decl): Take scope and
6466         name by value, instead of computing them.
6467         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
6468         arguments.  Pass them to validate_nonmember_using_decl.
6469         * name-lookup.h (do_local_using_decl): Adjust.
6470         (do_toplevel_using_decl): Likewise.
6471         * parser.c (cp_parser_using_declaration): Likewise.
6472         * pt.c (tsubst_expr): Likewise.
6473
6474 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
6475
6476         PR c++/13594
6477         PR c++/13658
6478         * name-lookup.c (qualified_lookup_using_namespace): Search
6479         strongly-associated namespaces first, and only then try other
6480         namespaces.
6481
6482 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
6483
6484         * Make-lang.in (c++.srcextra): Dummy entry.
6485
6486 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6487
6488         PR c++/8856
6489         * parser.c (cp_parser_template_name): Don't try to parse a
6490         conversion-function-id, as it cannot be a template-name.
6491         (cp_parser_simple_type_specifier): Check for invalid template-ids
6492         even after a built-in type.
6493
6494 2004-01-14  Jan Hubicka  <jh@suse.cz>
6495
6496         PR c++/12850
6497         * pt.c (instantiate_decl):  Do not increase function_depth.
6498
6499 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
6500
6501         PR c++/9021
6502         PR c++/11005
6503         * parser.c (cp_parser_elaborated_type_specifier): Warn about
6504         attributes and discard.
6505         * decl.c (xref_tag): Don't overwite existing attributes with
6506         NULL_TREE.
6507
6508 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6509
6510         PR c++/12335
6511         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
6512         is no destructor while looking up a BIT_NOT_EXPR.
6513
6514 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
6515
6516         * cxxfilt.c: Remove unused file.
6517
6518 2004-01-14  Jan Hubicka  <jh@suse.cz>
6519
6520         Partial fix to PR c++/12850
6521         * decl2.c (mark_used): Do not proactively instantiate templates
6522         when compiling in unit-at-a-time or not optimizing.
6523         * optimize.c (maybe_clone_body): Do not increase function depth.
6524
6525 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6526
6527         PR c++/13474
6528         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
6529
6530 2004-01-12  Steven Bosscher  <stevenb@suse.de>
6531
6532         PR c++/13558
6533         * parser.c (cp_parser_member_declaration): Any non-type is also
6534         not a class or a function.
6535
6536 2004-01-12  Jason Merrill  <jason@redhat.com>
6537
6538         PR c++/12815
6539         * class.c (build_base_path): Do not mark vtable references as
6540         TREE_CONSTANT.
6541         (build_vtbl_ref_1): Likewise.
6542
6543 2004-01-12  Richard Henderson  <rth@redhat.com>
6544
6545         PR opt/10776
6546         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
6547         (store_init_value): Use it.
6548         * decl.c (check_initializer): Expect full initialization code
6549         from store_init_value.
6550         * init.c (expand_aggr_init_1): Likewise.
6551         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
6552
6553 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
6554
6555         * class.c (layout_class_type): For non-POD class types, also copy
6556         the DECL_SIZE and DECL_MODE of fields to the base class type.
6557
6558 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6559
6560         PR c++/13289
6561         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
6562         calling regenerate_decl_from_template.
6563
6564 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
6565
6566         PR c++/4100
6567         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
6568         decl-specifier occurring along with a class definition.
6569
6570 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
6571
6572         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
6573         clauses to comments describing declares_class_or_enum.
6574         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
6575         false.
6576
6577 2004-01-12  Jan Hubicka  <jh@suse.cz>
6578
6579         * pt.c (for_each_template_parm): Do not check for duplicates.
6580         (for_each_template_parm): Use walk_tree duplicate checking code.
6581
6582 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
6583
6584         PR c++/3478
6585         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
6586         is error_mark_node, don't add any more decl_specs.
6587         (cp_parser_init_declarator): After committing to a declaration, if
6588         the decl_specifiers start with error_mark_node, issue an error and
6589         change the type to "int".
6590
6591 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
6592
6593         PR bootstrap/7817
6594         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
6595
6596 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6597
6598         DR 337
6599         PR c++/9256
6600         * pt.c (tsubst): Substitution must fail if we are attempting to
6601         create an array with element type that is an abstract class type.
6602         * decl.c (cp_finish_decl): Strip pointers and array types recursively
6603         before calling abstract_virtuals_error.
6604
6605 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
6606
6607         * name-lookup.c (qualified_lookup_using_namespace): Consider
6608         strong using directives even if we've already found a binding.
6609
6610 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
6611
6612         * cp-tree.h (cxx_expand_expr): Change prototype.
6613         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
6614
6615 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6616
6617         PR c++/12573
6618         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
6619         looking into them recursively. They can be there because of the
6620         new __offsetof__ extension.
6621
6622 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
6623
6624         * parser.c (cp_parser_save_member_function_body): Mark the
6625         definition static.
6626
6627 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
6628
6629         PR c++/13057
6630         * class.c (build_clone): Copy type attributes from the original
6631         function to the clone.
6632
6633         PR c++/12815
6634         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
6635         references as constant.
6636
6637         PR c++/12132
6638         * parser.c (cp_parser_explicit_instantiation): Improve error
6639         recovery.
6640         (cp_parser_require): Improve indication of the error location.
6641
6642         PR c++/13451
6643         * parser.c (cp_parser_class_head): Reorder logic to check for
6644         invalid qualification.
6645
6646 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
6647
6648         PR c++/13157
6649         * name-lookup.c (lookup_using_namespace): Remove spacesp
6650         parameter.
6651         (unqualified_namespace_lookup): Likewise.
6652         (lookup_qualified_name): Adjust accordingly.
6653         (lookup_name_real): Likewise.
6654         (lookup_arg_dependent): Do not eliminate the namespace of the
6655         functions found by unqualified name lookup unless that is the
6656         current namespace.
6657
6658 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
6659
6660         * semantics.c (push_deferring_access_checks): Fix format.
6661         (resume_deferring_access_checks): Likewise.
6662         (stop_deferring_access_checks): Likewise.
6663         (pop_deferring_access_checks): Likewise.
6664         (get_deferred_access_checks): Likewise.
6665         (pop_to_parent_deferring_access_checks): Likewise.
6666         (perform_deferred_access_checks): Likewise.
6667         (perform_or_defer_access_check): Likewise.
6668
6669 2004-01-04  Richard Henderson  <rth@redhat.com>
6670
6671         * call.c (build_over_call): Don't create a save_expr of an
6672         aggregate, but rather its address.
6673
6674 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
6675
6676         PR c++/13529
6677         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
6678         an offsetof expression.
6679
6680         * parser.c (cp_parser_parameter_declaration): Fix comment.
6681
6682         PR c++/12226
6683         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
6684         (reference_binding): Set it when appropriate.
6685         (build_temp): New function, split out from ...
6686         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
6687         (initialize_reference): Likewise.
6688
6689         PR c++/13536
6690         * parser.c (cp_parser): Add in_type_id_in_expr_p.
6691         (cp_parser_new): Initialize it.
6692         (cp_parser_postfix_expression): Set it.
6693         (cp_parser_sizeof_operand): Likewise.
6694         (cp_parser_parameteR_declaration): Do not commit early to tenative
6695         parsers when in_type_id_in_expr_p is set.
6696
6697 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6698
6699         PR c++/13094
6700         * parser.c (cp_parser_template_argument): Don't call
6701         make_unbound_class_template directly.
6702         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
6703         UNBOUND_CLASS_TEMPLATE tree node.
6704
6705 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
6706
6707         PR target/12729
6708         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
6709
6710 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6711
6712         PR c++/13520
6713         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
6714         (DECL_FUNCTION_TEMPLATE_P): Use it.
6715         (DECL_CLASS_TEMPLATE_P): Likewise.
6716         * parser.c (cp_parser_lookup_name): Add is_template parameter.
6717         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
6718         (cp_parser_template_name): Likewise.
6719         (cp_parser_elaborated_type_specifier): Likewise.
6720         (cp_parser_namespace_name): Likewise.
6721         (cp_parser_class_name): Likewise.
6722         (cp_parser_lookup_name_simple): Likewise.
6723
6724 See ChangeLog.3 for earlier changes.