OSDN Git Service

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