OSDN Git Service

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