OSDN Git Service

cp:
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2004-12-15  Nathan Sidwell  <nathan@codesourcery.com>
2
3         PR c++/18981
4         * parser.c (cp_parser_lookup_name): Remove unneeded TYPENAME_TYPE
5         flag setting.
6
7 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
8
9         PR c++/18738
10         * decl.c (make_typename_type): Do not handle namespace-scoped
11         names here.
12         (tag_name): Handle typename_type.
13         (check_elaborated_type_specifier): Handle typenames.
14         * parser.c (cp_parser_diagnose_invalid_type_name): Improve
15         comment.
16         (cp_parser_elaborated_type_specifier): Use
17         cp_parser_diagnose_invalid_type_name.
18
19 2004-12-14  Andrew Pinski  <pinskia@physics.uc.edu>
20
21         PR c++/18965
22         * init.c (build_zero_init): If the max_index is 0, there is no
23         need to create a RANGE_EXPR.
24
25 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
26
27         PR c++/18793
28         * cp-objcp-common.c (cp_expr_size): Loosen assertion.
29
30 2004-12-14  Nathan Sidwell  <nathan@codesourcery.com>
31
32         PR c++/18949
33         * pt.c (tsubst_copy_and_build): <INDIRECT_REF case> Check that a
34         REFERENCE_REF_P is dereferencing a reference type.
35         * typeck.c (build_static_cast): Convert from reference even in a
36         template.
37         (build_reinterpret_cast, build_const_cast, build_c_cast): Likewise.
38
39 2004-12-14  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
40
41         * parser.c (cp_parser_uncommitted_to_tentative_parse_p): New function.
42         (cp_parser_name_lookup_error): Use it.
43         (cp_parser_check_for_invalid_template_id): Likewise.
44         (cp_parser_skip_to_closing_parenthesis): Likewise.
45         (cp_parser_nested_name_specifier_opt): Likewise.
46         (cp_parser_simple_declaration, cp_parser_template_id): Likewise.
47         (cp_parser_parameter_declaration_list): Likewise.
48         (cp_parser_parameter_declaration): Likewise.
49         (cp_parser_template_name): Let cp_parser_simulate_error perform
50         the checking.
51         (cp_parser_committed_to_tentative_parse): Remove.
52
53 2004-12-13  Andrew Pinski  <pinskia@physics.uc.edu>
54
55         PR c++/18968
56         * class.c (build_base_path): Convert the zero constant to the correct
57         type when comparing.
58
59 2004-12-13  Mark Mitchell  <mark@codesourcery.com>
60
61         PR c++/18925
62         * class.c (layout_class_type): Determine the visibility of static
63         data members.
64
65 2004-12-12  Roger Sayle  <roger@eyesopen.com>
66
67         PR middle-end/12454
68         * cp-gimplify.c (gimplify_if_stmt): Optimize the case where the
69         condition is a constant and the unexecuted clause is empty.
70
71 2004-12-10  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
72
73         PR c++/18731
74         * parser.c (cp_parser_class_head): Reject typedef-name in class head.
75
76 2004-12-09  Matt Austern  <austern@apple.com>
77
78         PR c++/18514
79         * name-lookup.c (do_nonmember_using_decl): A real function
80         declaration takes precedence over an anticipated declaration.
81         
82 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
83
84         * parser.c (cp_parser_member_declaration): Fix comment typo.
85
86 2004-12-09  Alexandre Oliva  <aoliva@redhat.com>
87
88         PR c++/18757
89         * parser.c (cp_parser_template_id): Don't create a CPP_TEMPLATE_ID
90         if parsing failed.
91
92 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
93
94         PR c++/18073
95         * typeck.c (build_reinterpret_cast_1): Allow cast from vector type.
96
97 2004-12-09  Nathan Sidwell  <nathan@codesourcery.com>
98
99         PR c++/16681
100         * init.c (build_zero_init): Build a RANGE_EXPR for an array
101         initializer.
102
103 2004-12-08  Kelley Cook  <kcook@gcc.gnu.org>
104
105         * typeck.c: Remove DOS line endings.
106
107 2004-12-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
108
109         PR c++/18100
110         * decl.c (lookup_and_check_tag): Diagnose nested class with 
111         the same name as enclosing class.
112
113 2004-12-08  Nathan Sidwell  <nathan@codesourcery.com>
114
115         PR c++/18803
116         * cp-tree.h (REFERENCE_REF_P): New.
117         (CPTI_TYPE_INFO_TYPE): Rename to ...
118         (CPTI_CONST_TYPE_INFO_TYPE): ... here.
119         (CPTI_TYPE_INFO_REF_TYPE): Remove.
120         (type_info_type_node): Rename to ...
121         (const_type_info_type_node): ... here.
122         (type_info_ref_type): Remove.
123         * call.c (build_user_type_conversion): Reformat.
124         (resolve_args): Do not convert_from_reference.
125         (build_object_call): Call convert_from_reference.
126         (prep_operand): Do not convert_from_reference.
127         (build_new_method_call): Likewise.
128         * class.c (build_vfield_ref): Likewise.
129         * cvt.c (convert_to_reference): Likewise.
130         (convert_from_reference): Build INDIRECT_REF here, not with
131         build_indirect_ref.
132         (convert_force): Do not convert_from_reference.
133         (build_expr_type_conversion): Likewise.
134         * decl.c (grok_reference_init): Likewise.
135         * decl2.c (delete_sanity): Likewise.
136         * except.c (initialize_handler_parm): Use POINTER_TYPE_P.
137         * init.c (build_dtor_call): Do not convert_from_reference.
138         * parser.c (cp_parser_template_argument): Unwrap indirected
139         reference. Allow TEMPLATE_PARM_INDEX as an object parm.
140         * pt.c (tsubst_copy_and_build) <case INDIRECT_REF>: Use
141         convert_from_reference, if indicated.
142         <case CALL_EXPR>: Do not convert_from_reference.
143         <case PARM_DECL, VAR_DECL>: Convert_from_reference if needed.
144         (tsubst_initializer_list): Do not convert_from_reference.
145         * rtti.c (init_rtti_processing): Adjust node creation.
146         (throw_bad_typeid): Use const_type_info_type_node.
147         Do not convert_from_reference.
148         (typeid_ok_p): Use const_type_info_type_node.
149         (build_typeid, get_typeid): Always return type_info typed node.
150         (build_dynamic_cast_1): Dont convert_from_reference. Refactor.
151         * semantics.c (finish_stmt_expr_expr): Do not
152         convert_from_reference.
153         (finish_id_expression): Convert_from_reference as appropriate.
154         * typeck.c (decay_conversion): Do not convert_from_reference.
155         (finish_class_member_access_expr): Likewise.
156         (build_indirect_ref): Use POINTER_TYPE_P.
157         (convert_arguments): Do not convert_from_reference.
158         (build_modify_expr): Likewise.
159         (convert_for_initialization): Likewise.
160         * typeck2.c (build_x_arrow): Likewise.
161
162 2004-12-07  Ziemowit Laski  <zlaski@apple.com>
163
164         * cp-tree.h (struct lang_type_class): Rename 'objc_protocols'
165         field to 'objc_info'.
166
167 2004-12-07  Kazu Hirata  <kazu@cs.umass.edu>
168
169         * pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH.
170
171 2004-12-07  Roger Sayle  <roger@eyesopen.com>
172
173         * name-lookup.c (leave_scope): We only need to update
174         class_binding_level when leaving a class scope.
175
176 2004-12-06  Ziemowit Laski  <zlaski@apple.com>
177
178         * cp-tree.h (struct lang_type_class): Add 'objc_protocols' field.
179
180 2004-12-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
181
182         PR c++/17011, c++/17971
183         * pt.c (tsubst_copy) <FIELD_DECL case>: Check and diagnose
184         invalid field.
185         (tsubst_copy_and_build) <COMPONENT_REF case>: Check
186         error_mark_node after member substitution.
187         * semantics.c (finish_id_expression): Call
188         finish_non_static_data_member for non-dependent FIELD_DECL.
189
190 2004-12-03  Nathan Sidwell  <nathan@codesourcery.com>
191
192         PR c++/18782
193         * decl.c (grokdeclarator): Make sure class in pointer to member is
194         not a namespace.
195
196 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
197
198         PR c++/18318
199         * parser.c (cp_parser_new_type_id): Move array size expression
200         checks from here ...
201         * init.c (build_new): ... to here.
202
203 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
204
205         PR c++/18758
206         * parser.c (cp_parser_class_head): Return NULL_TREE when
207         push_template_decl fails.  Update comment.
208
209 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
210
211         PR c++/15664, c++/18276
212         * pt.c (tsubst_decl) <TEMPLATE_DECL case>: Reorganize.  Correctly
213         tsubst TEMPLATE_DECL that is a TEMPLATE_TEMPLATE_PARM.
214
215 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
216
217         PR c++/18123
218         * parser.c (cp_parser_type_specifier): Catch template declaration
219         of enum.
220
221 2004-12-01  Matt Austern  <austern@apple.com>
222
223         * name-lookup.c (namespace_binding): Omit alias check for global
224         namespace.
225
226 2004-12-01  Nathan Sidwell  <nathan@codesourcery.com>
227
228         PR c++/18729
229         * parser.c (cp_parser_class_name): Check decl's type is not
230         error_mark_node.
231
232         PR c++/17431
233         * call.c (standard_conversion): Add FLAGS parameter. Do not allow
234         derived to base conversion when checking constructor
235         accessibility.
236         (implicit_conversion): Pass FLAGS to standard_conversion.
237         (check_constructir_callable): Disallow conversion functions.
238
239 2004-11-30  Kazu Hirata  <kazu@cs.umass.edu>
240
241         * parser.c: Fix comment typos.
242
243 2004-11-27  Mark Mitchell  <mark@codesourcery.com>
244
245         PR c++/18368
246         * parser.c (cp_parser_check_for_definition_in_return_type): Take
247         the defined type as a parameter, and inform the user about the
248         possibility of a missing semicolon.
249         (cp_parser_explicit_instantiation): Adjust call to
250         cp_parser_check_for_definition_in_return_type.
251         (cp_parser_init_declarator): Likewise.
252         (cp_parser_member_declaration): Likewise.
253
254         PR c++/18674
255         * cp-tree.def (TYPENAME_TYPE): Remove discussion of implicit
256         typename from comments.
257         * cp-tree.h (TYPENAME_IS_ENUM_P): New macro.
258         (TYPENAME_IS_CLASS_P): Likewise.
259         (make_typename_type): Change prototype.
260         * decl.c (struct_typename_info): New type.
261         (typename_compare): Expect the second argument to be a
262         typename_info, not a tree.
263         (build_typename_type): Add tag_type parameter.  Do not create a
264         new type until necessary.
265         (make_typename_type): Add tag_type parameter.
266         * error.c (TYPENAME_TYPE): Print tags other than "typename" if
267         appropriate.
268         * friend.c (make_friend_class): Adjust call to make_typename_type.
269         * parser.c (cp_parser_make_typename_type): Likewise.
270         (cp_parser_primary_expression): Adjust call to
271         cp_parser_lookup_name.
272         (cp_parser_unqualified_id): Adjust calls to cp_parser_class_name.
273         (cp_parser_class_or_namespace_name): Likewise.
274         (cp_parser_postfix_expression): Adjust calls to
275         make_typename_type.
276         (cp_parser_mem_initializer_id): Adjust calls to
277         cp_parser_class_name.
278         (cp_parser_type_parameter): Adjust calls to cp_parser_lookup_name.
279         (cp_parser_template_name): Likewise.
280         (cp_parser_template_argument): Likewise.
281         (cp_parser_type_name): Adjust call to cp_parser_class_name.
282         (cp_parser_elaborated_type_specifier): Adjust calls to
283         make_typename_type and cp_parser_lookup_name.
284         (cp_parser_namespace_name): Likewise.
285         (cp_parser_class_name): Replace type_p parameter with tag_type.
286         Adjust calls to make_typename_type and cp_parser_lookup_name.
287         (cp_parser_class_head): Adjust calls to cp_parser_class_name.
288         (cp_parser_base_specifier): Likewise.
289         (cp_parser_lookup_name): Replace is_type parameter with tag_type.
290         Adjust calls to make_typename_type and lookup_qualified_name.
291         (cp_parser_lookup_name_simple): Adjust call to
292         cp_parser_lookup_name.
293         (cp_parser_constructor_declarator_p): Adjust call to
294         cp_parser_class_name.
295         * pt.c (convert_template_argument): Adjust all to
296         make_typename_type.
297         (tsubst_decl): Do not pre-substitute the type of the declaration.
298         (tsubst): Hand off declarations more quickly.  Adjust call to
299         make_typename_type. 
300
301         PR c++/18512
302         * parser.c (cp_parser_postfix_dot_deref_expression): Robustify.
303
304 2004-11-29  Daniel Jacobowitz  <dan@codesourcery.com>
305
306         PR c/7544
307         * Make-lang.in (cp/decl2.o): Update dependencies.
308         * decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks.
309
310 2004-11-29  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
311
312         PR c++/18652
313         * name-lookup.c (pushtag): Change return type to tree.
314         * cp-tree.h (pushtag): Adjust declaration.
315         * decl.c (xref_tag, start_enum): Use return value of pushtag.
316         * pt.c (push_template_decl_real): Return immediately if
317         pushdecl_namespace_level returns error_mark_node.
318
319 2004-11-27  Kazu Hirata  <kazu@cs.umass.edu>
320
321         * pt.c: Fix a comment typo.
322
323 2004-11-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
324
325         Friend class name lookup 4/n
326         * class.c (pushclass): Don't call cxx_remember_type_decls.
327         * cp-tree.h (clear_anon_tags): Remove declaration.
328         * decl.c (grokdeclarator): Don't call lookup_tag_reverse.
329         * name-lookup.c (binding_entry_free, binding_table_free): Comment
330         out functions.
331         (binding_table_find_anon_type, binding_table_reverse_maybe_remap,
332         binding_table_remove_anonymous_types, cxx_remember_type_decls,
333         bt_print_entry, clear_anon_tags, follow_tag_typedef, lookup_tag,
334         lookup_tag_reverse): Remove
335         (begin_scope, leave_scope, kept_level_p, print_binding_level):
336         Don't use type_decls field in cp_binding_level.
337         (maybe_process_template_type_declaration, pushtag): Set
338         CLASSTYPE_NESTED_UTDS directly.
339         * name-lookup.h (binding_table_remove_anonymous_types,
340         cxx_remember_type_decls, lookup_tag, lookup_tag_reverse): Remove
341         declaration.
342         (cp_binding_level): Remove type_decls field.
343
344 2004-11-26  Kazu Hirata  <kazu@cs.umass.edu>
345
346         * typeck.c: Fix a comment typo.
347
348 2004-11-25  Mark Mitchell  <mark@codesourcery.com>
349
350         PR c++/18445
351         * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with
352         unknown_type as non matching.  Tidy up.
353         * pt.c (build_non_dependent_expr): Do not build a
354         NON_DEPENDENT_EXPR for a VAR_DECL.
355
356         PR c++/18001
357         * cp-tree.h (lvalue_or_else): Remove declaration.
358         * tree.c (lvalue_or_else): Remove.
359         * typeck.c (build_unary_op): Adjust call to lvalue_or_else.
360         (build_modify_expr): Likewise.
361
362         PR c++/18625
363         * decl.c (duplicate_decls): Return error_mark_node on error, as
364         specified.
365
366         PR c++/18466
367         * decl.c (grokvardecl): Keep track of whether or not a there was
368         explicit qualification.
369         * name-lookup.c (set_decl_namespace): Complain about explicit
370         qualification of a name within its own namespace.
371
372         PR c++/18545
373         * typeck.c (check_return_expr): Robustify.
374
375 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
376
377         Friend class name lookup 3/n, PR c++/3332
378         * name-lookup.c (push_inner_scope, pop_inner_scope): New functions.
379         (lookup_type_scope): Don't deal with name from user declaration
380         specially.
381         * name-lookup.h (push_inner_scope, pop_inner_scope): Add declarations.
382         * parser.c (cp_parser_class_specifier): Use push_inner_scope and
383         pop_inner_scope.
384
385 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
386
387         Friend class name lookup 2/n, PR c++/14513, c++/15410
388         * name-lookup.c (lookup_name_real): Simplify.
389         (lookup_type_scope): Add SCOPE parameter.  Handle friend class
390         lookup.
391         * name-lookup.h (tag_scope): New enum type.
392         (lookup_type_scope): Adjust declaration.
393         * decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type):
394         Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE.
395         (start_enum): Likewise.  Add assertion test that NAME is 
396         IDENTIFIER_NODE.  Use anonymous name for dummy ENUMERAL_TYPE in
397         case of error.
398         * cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations.
399         * parser.c (cp_parser_elaborated_type_specifier,
400         cp_parser_class_head): Adjust call to xref_tag.
401         * pt.c (lookup_template_class, instantiate_class_template):
402         Likewise.
403         * rtti.c (init_rtti_processing, build_dynamic_cast_1,
404         tinfo_base_init, emit_support_tinfos): Likewise.
405
406 2004-11-25  Joseph S. Myers  <joseph@codesourcery.com>
407
408         * g++spec.c, lex.c: Avoid ` as left quote in diagnostics.
409
410 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
411
412         PR c++/17473
413         * name-lookup.c (supplement_binding): Do not allow typedefs to be
414         redefined in class scope.
415
416         PR c++/18285
417         * parser.c (cp_parser_set_decl_type_spec): Do not try to allow
418         redefinitions of builtin types other that "bool" or "wchar_t".
419
420 2004-11-24  Steven Bosscher  <stevenb@suse.de>
421
422         * decl.c (cxx_init_decl_processing): Don't clear
423         flag_inline_functions.
424
425 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
426
427         * pt.c (tsubst_function_type): Do not permit function types which
428         return arrays or functions.
429
430         PR c++/18586
431         * parser.c (cp_parser_init_declarator): Do not pop scope twice.
432
433         PR c++/18530
434         * cp-tree.h (CTOR_NAME): Remove.
435         (DTOR_NAME): Remove.
436         * decl.c (initialize_predefined_identifiers): Add spaces to the
437         end of constructor and destructor names.
438
439 2004-11-24  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
440
441         PR c++/8929
442         * decl.c (start_decl): Check for invalid specialization headers.
443
444 2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
445
446         PR c++/16882
447
448         * call.c (standard_conversion): Move check for conversions between
449         vector pointers...
450         * typeck.c (ptr_reasonably_similar): ... here.
451
452 2004-11-23  Ben Elliston  <bje@au.ibm.com>
453
454         * cp-tree.h (context_as_string): Remove extern.
455         * error.c (context_as_string): Remove.
456
457         * cp-tree.h (cp_type_qual_from_rid): Remove extern.
458         * lex.c (cp_type_qual_from_rid): Remove.
459
460         * cp-tree.h (do_poplevel): Remove extern.
461         (check_multiple_declarators): Likewise.
462         * semantics.c (do_poplevel): Make static.
463         (check_multiple_declarators): Remove.
464
465         * cp-tree.h (check_final_overrider): Remove extern.
466         * search.c (check_final_overrider): Make static.
467
468         * cp-tree.h (build_artificial_parm): Remove extern.
469         * decl2.c (build_artificial_parm): Make static.
470
471 2004-11-22  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
472
473         PR c++/18354
474         * typeck.c (build_unary_op) <CONVERT_EXPR, NEGATE_EXPR>: Unify code.
475         Make sure the result is always a rvalue.
476
477 2004-11-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
478
479         * decl.c (start_preparsed_function): Call check_function_type even
480         in templates.
481         (require_complete_types_for_parms): Skip dependent types.
482         (check_function_type): Likewise.
483
484 2004-11-16  Steven Bosscher  <stevenb@suse.de>
485
486         * Make-lang.in (cp/decl.o, cp/search.o): Don't depend on stack.h.
487         * search.c: Don't include it.
488
489 2004-11-15  Andrew Pinski  <pinskia@physics.uc.edu>
490
491         * cp-gimplify.c: Include pointer-set.h
492         (cp_genericize_r): Use pointer_sets instead of a hashtable.
493         Also instert the new statement for CLEANUP_STMT.
494         (cp_genericize): Use pointer_sets instead of a hashtable.
495         * Make-lang.in (cp-gimplify.o): Depend on pointer-set.h.
496
497 2004-11-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
498
499         Friend class name lookup 1/n, PR c++/18471
500         * decl.c (lookup_and_check_tag): New function.
501         (xref_tag, start_enum): Use it.
502         (check_elaborated_type_specifier): Move TEMPLATE_TYPE_PARM check
503         before !DECL_IMPLICIT_TYPEDEF_P.  Also display previously declared
504         location.
505         * name-lookup.c (lookup_name_current_level): Rename to ...
506         (lookup_name_innermost_nonclass_level): ... this.
507         (lookup_type_scope): New function.
508         * name-lookup.h (lookup_name_current_level): Rename to ...
509         (lookup_name_innermost_nonclass_level): ... this.
510         (lookup_type_scope): Add declaration.
511
512 2004-11-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
513
514         PR c++/17344
515         * pt.c (coerce_template_parms): Only emit error message about
516         invalid template argument when TF_ERROR.
517
518 2004-11-12  Mark Mitchell  <mark@codesourcery.com>
519
520         PR c++/18389
521         * decl.c (start_decl): Make sure to set *pop_scope_p.  Return
522         error_mark_node to indicate errors.
523
524         PR c++/18429
525         * parser.c (cp_parser_direct_declarator): Disallow non-constant
526         array bounds when not inside a function.
527
528         PR c++/18436
529         * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an
530         unqualified name resolves to a member function.
531
532         PR c++/18407
533         * pt.c (tsubst_copy_and_build): Handle qualified names used from a
534         derived class correctly.
535         
536         * decl2.c (import_export_decl): Fix typo in comment.
537         * tree.c (pod_type_p): Likewise.
538
539 2004-11-10  Andrew Pinski  <pinskia@physics.uc.edu>
540
541         * typeck.c (cxx_mark_addressable): Add braces around the first if.
542
543 2004-11-10  Adam Nemet  <anemet@lnxw.com>
544
545         PR middle-end/18160  
546         * typeck.c (cxx_mark_addressable): Issue an error if address of an
547         explicit register variable is requested.
548
549 2004-11-10  Nathan Sidwell  <nathan@codesourcery.com>
550
551         PR c++/18143
552         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK): New.
553         (struct lang_decl_flags): Add thunk_p flag.
554         (struct lang_decl): Remove separate fixed_offset. Place
555         cloned_function and fixed_offset into union.
556         (DECL_CLONED_FUNCTION_P, DECL_CLONED_FUNCTION): Adjust.
557         (DECL_THUNK_P, SET_DECL_THUNK_P): Adjust.
558         (THUNK_FIXED_OFFSET): Adjust.
559         * method.c (make_thunk): Adjust.
560
561 2004-11-09  Mark Mitchell  <mark@codesourcery.com>
562
563         PR c++/18369
564         * init.c (build_new_1): Handle parenthesized type-ids that name an
565         array type.  Tidy.
566
567 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
568
569         * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
570         pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
571         quoting in diagnostics.
572         * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
573         quoting in printf format.
574         * decl.c (duplicate_decls, start_decl): Use %qD instead of
575         unquoted %D.
576
577 2004-11-08  Kazu Hirata  <kazu@cs.umass.edu>
578
579         * class.c, decl.c, lex.c, name-lookup.c, parser.c, pt.c,
580         search.c, typeck2.c: Fix comment formatting.
581
582 2004-11-04  Ulrich Weigand  <uweigand@de.ibm.com>
583         
584         PR tree-optimization/18184
585         * cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers
586         of different modes or alias-all flags as equivalent.
587         * typeck.c (comptypes): Likewise.
588
589 2004-11-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
590
591         DR 49, 100
592         * cp-tree.h (TYPE_REF_OBJ_P): New macro.
593         (TYPE_PTR_P, TYPE_PTROB_P, TYPE_PTROBV_P, TYPE_PTRFN_P,
594         TYPE_REFFN_P): Document.
595         (fold_decl_constant_value): New prototype.
596         * pt.c (convert_nontype_argument_function): Rewrite and extract
597         parts into...
598         (fold_decl_constant_value, convert_nontype_argument_function): New.
599         (lookup_template_class): Add comment about useless double call.
600         * mangle.c (write_expression): Strip conversions before lowering
601         pointer to members.
602         * cvt.c (ocp_convert): Check LOOKUP_COMPLAIN for a pedwarn. Disallow
603         enum to enum conversion.
604
605 2004-11-02  Mark Mitchell  <mark@codesourcery.com>
606
607         PR c++/18124
608         * parser.c (cp_parser_type_parameter): Robustify.
609
610         PR c++/18155
611         * parser.c (cp_parser_single_declaration): Disallow template
612         typedefs.
613
614         PR c++/18177
615         * typeck.c (build_const_cast): Use error_operand_p.
616
617 2004-11-02  Ziemowit Laski  <zlaski@apple.com>
618
619         * cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
620         (LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
621         * cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
622         from cp-lang.c.
623         * cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
624         from cp-lang.c.
625         (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.
626
627 2004-11-01  Nathan Sidwell  <nathan@codesourcery.com>
628
629         PR c++/18064
630         * search.c (check_final_overrider): Deprecate gnu covariant extension.
631
632 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
633
634         Convert diagnostics to use quoting flag q 9/n
635         * typeck.c (build_x_unary_op, convert_member_func_to_ptr, 
636         get_delta_difference):  Use new quotation style.
637         * repo.c (reopen_repo_file_for_write): Likewise.
638         * pt.c (do_type_instantiation): Likewise.
639         * parser.c (cp_parser_diagnose_invalid_type_name): 
640         * name-lookup.c (push_overloaded_decl, set_decl_namespace): 
641         * error.c (cp_print_error_function,
642         print_instantiation_full_context): Likewise.
643         * decl.c (define_label, grok_reference_init, 
644         maybe_deduce_size_from_array_init, revert_static_member_fn): 
645         * decl2.c (check_classfn): Likewise.
646         * class.c (add_method, check_field_decls, layout_class_type, 
647         resolve_address_of_overloaded_function): Likewise.
648         * call.c (build_x_va_arg, build_over_call): Likewise.
649
650 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
651
652         Convert diagnostics to use quoting flag q 8/n
653         * cvt.c (cp_convert_to_pointer, warn_ref_binding, 
654         convert_to_reference, ocp_convert, convert_to_void 
655         cp_convert_to_pointer): Use new quotation style.
656
657 2004-10-31  Mark Mitchell  <mark@codesourcery.com>
658
659         PR c++/15172
660         * typeck2.c (store_init_value): Use split_nonconstant_init even
661         for types that require construction.
662         
663 1004-10-28  Matt Austern  <austern@apple.com>
664
665         PR c++/17542
666         * cp-tree.h (class_key_or_enum_as_string): Declare.
667         * error.c (class_key_or_enum): Rename to class_key_or_enum_as_string
668         and remove static qualifier.
669         * decl.c (shadow_tag): Warn about ignored attributes in class/struct/
670         union/enum declaration.
671         
672 2004-10-29  Kazu Hirata  <kazu@cs.umass.edu>
673
674         * pt.c: Fix a comment typo.
675
676 2004-10-28  Nathan Sidwell  <nathan@codesourcery.com>
677
678         * typeck.c (composite_pointer_type): Remove comment about DR 195.
679         (build_reinterpret_cast_1): Revert DR195 patch. Only emit a
680         warning when being pedantic.
681         (build_reinterpet_cast, build_c_cast): Adjust.
682
683 2004-10-29  Mark Mitchell  <mark@codesourcery.com>
684
685         PR c++/17695
686         * decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they
687         appear in a constructor/destructor that will be cloned.
688
689 1004-10-28  Matt Austern  <austern@apple.com>
690
691         PR c++/14124
692         * decl.c (finish_enum): Handle packed attribute.
693         * parser.c (cp_parser_enum_specifier): Process trailing attributes.
694         
695 2004-10-28  Mark Mitchell  <mark@codesourcery.com>
696
697         PR c++/17132
698         * pt.c (instantiate_class_template): Increment
699         processing_template_decl when substituting into a member class
700         template.
701
702 2004-10-27  Mark Mitchell  <mark@codesourcery.com>
703
704         PR c++/17435
705         * call.c (convert_like_real): Fix formatting.
706         (initialize_reference): When binding a temporary to a base class,
707         ensure that the nominal copy made is to the derived class, not the
708         base class.
709
710         PR c++/18140
711         * parser.c (cp_parser_next_token_ends_template_argument_p): Do not
712         include ">>".
713
714 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
715
716         * decl.c (bad_specifiers): Move the q after the %.
717
718 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
719
720         * parser.c (cp_parser_diagnose_invalid_type_name): Move the q after
721         the %.
722
723 2004-10-26  Mark Mitchell  <mark@codesourcery.com>
724
725         * name-lookup.c (do_namespace_alias): Use FROB_CONTEXT.
726         * search.c (current_scope): Fix prototype.
727
728         PR c++/18093
729         * search.c (current_scope): Return the innermost non-block scope,
730         not the innermost non-block, non-namespace scope.
731         (at_namespace_scope_p): Adjust accordingly.
732         (dfs_accessible_post): Do not pass namespaces to is_friend.
733         (dfs_walk_once_accessible_r): Likewise.
734         * decl.c (grokvardecl): Adjust call to current_scope.
735         (build_enumerator): Likewise.
736         * parser.c (cp_parser_using_declaration): Likewise.
737         (cp_parser_direct_declarator): Use at_namespace_scope_p instead of
738         current_scope.
739         (cp_parser_class_head): Adjust call to current_scope.
740         * name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the
741         alias.
742
743         PR c++/18020
744         * pt.c (tusbst_copy_and_build): Resolve enumeration constants to
745         their underlying values.
746
747         PR c++/18161
748         * typeck.c (build_binary_op): Honor build_type, even when in a
749         template.
750
751 2004-10-26  Nathan Sidwell  <nathan@codesourcery.com>
752
753         * parser.c (cp_lexer_get_preprocessor_token): Remove unneeded
754         padding token checking.
755
756 2004-10-25  Andrew Pinski  <pinskia@physics.uc.edu>
757
758         PR c++/18121
759         * decl.c (grokdeclarator) <case cdk_array>: Remove the call
760         layout_type as it is already done by create_array_type_for_decl.
761
762 2004-10-22  Nathan Sidwell  <nathan@codesourcery.com>
763
764         PR c++/18095
765         * parser.c (eof_token): Make const, correctly initialize rid and
766         location fields.
767         (struct cp_lexer): Replace buffer_end pointer with buffer_length
768         count. Adjust.
769         (cp_lexer_new_main): Directly grow lexer's buffer here.  Don't
770         zero it out.
771         (cp_lexer_new_from_tokens): Adjust.
772         (cp_lexer_grow_buffer): Remove.
773         (cp_lexer_peek_nth_token, cp_lexer_consume_token,
774         cp_lexer_purge_token): Add const casts.
775
776 2004-10-21  Mark Mitchell  <mark@codesourcery.com>
777
778         PR c++/18073
779         PR c++/10841
780         * cp-tree.h (convert_to_base): Change prototype.
781         (build_ptrmemfunc): Likewise.
782         (convert_ptrmem): New function.
783         * call.c (struct conversion): Adjust documentation for base_p.
784         (standard_conversion): Set base_p for ck_pmem conversions as
785         appropriate.
786         (convert_like_real): Use convert_to_base for ck_pmem and ck_ptr
787         conversions.
788         * class.c (convert_to_base): Handle both pointers and objects.
789         Add nonnull parameter.
790         (build_vfield_ref): Adjust call to convert_to_base.
791         * cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc.
792         (convert_force): Likewise.
793         * typeck.c (build_unary_op): Likewise.
794         (convert_ptrmem): New function.
795         (build_static_cast_1): Use it.
796         (build_reinterpret_cast): Allow conversions to vector types.
797         (get_delta_difference): Add c_cast_p parameter.
798         (build_ptrmemfunc): Likewise.  Adjust calls to
799         get_delta_difference.
800
801 2004-10-21  Andrew Pinski  <pinskia@physics.uc.edu>
802
803         PR c++/13560
804         * error.c (cp_error_at): Output the context as it might be
805         different file as the other location.
806
807 2004-10-21  Kazu Hirata  <kazu@cs.umass.edu>
808
809         * typeck.c: Fix a comment typo.
810
811 2004-10-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
812
813         PR c++/13495
814         * decl.c (make_unbound_class_template): Add PARM_LIST parameter.
815         * cp-tree.h (make_unbound_class_template): Adjust prototype.
816         * parser.c (cp_parser_lookup_name): Adjust call to
817         make_unbound_class_template.
818         (cp_parser_single_declaration): Handle member class of class
819         template as template friend parsing correctly.
820         * friend.c (is_friend): Call is_specialization_of_friend for
821         template friend class.
822         (make_friend_class): Handle member class of class template as
823         template friend.
824         * pt.c (is_specialization_of_friend): Likewise.
825         (instantiate_class_template): Likewise.
826         (tsubst): Adjust call to make_unbound_class_template.
827
828 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
829
830         * typeck.c (composite_pointer_type): Add comment about DR 195
831         (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter.
832         Allow function pointer conversions that DR195 suggests.
833         (build_reinterpret_cast, build_c_cast): Update
834         build_reinterpret_cast_1 calls. 
835
836 2004-10-20  Kazu Hirata  <kazu@cs.umass.edu>
837
838         * call.c, typeck.c: Fix comment typos.
839
840 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
841
842         * parser.c (cp_token_position): New typedef. Define VEC thereof.
843         (struct cp_lexer): Allow buffer and buffer_end to be NULL. Make
844         next_token and last_token cp_token_position. Make saved_tokens a
845         VEC(cp_token_position).
846         (eof_token): New static variable.
847         (CP_SAVED_TOKENS_SIZE): Rename to ...
848         (CP_SAVED_TOKEN_STACK): ... here.
849         (cp_lexer_new_main): Adjust main lexer creation and buffer
850         filling.
851         (cp_lexer_new_from_tokens): Do not copy the tokens, merely point
852         to the parent buffer.  Do not append eof token.
853         (cp_lexer_destroy): Only free buffer if non-NULL. Free token
854         stack.
855         (cp_lexer_next_token, cp_lexer_prev_token): Remove.
856         (cp_lexer_token_position, cp_lexer_token_at): New.
857         (cp_lexer_saving_tokens): Adjust. Make inline.
858         (cp_lexer_advance_token, cp_lexer_token_difference): Remove.
859         (cp_lexer_peek_token_emit_debug_info): Fold into ...
860         (cp_lexer_peek_token): ... here.
861         (cp_lexer_peek_nth_token): Don't peek past EOF.
862         (cp_lexer_consume_token): Set next_token to eof_token, if reaching
863         EOF.
864         (cp_lexer_purge_token): Adjust eof setting.
865         (cp_lexer_purge_tokens_after): Likewise.
866         (cp_lexer_save_tokens): Push next_token directly.
867         (cp_lexer_commit_tokens): Adjust.
868         (cp_lexer_rollback_tokens): Pop next_token directly.
869         (cp_parser_check_for_invalid_template_id): Adjust token purging.
870         (cp_parser_translation_unit): Do not consume the EOF.
871         (cp_parser_nested_name_specifier_opt): Adjust token purging.
872         (cp_parser_template_id, cp_parser_template_name): Likewise.
873
874 2004-10-19  Mark Mitchell  <mark@codesourcery.com>
875
876         PR c++/14035
877         * call.c (struct conversion): Add base_p.
878         (convert_like): Add c_cast_p argument.
879         (convert_like_with_conversion): Likewise.
880         (build_conv): Clear base_p.
881         (standard_conversion): Set it, for derived-to-base conversions.
882         (convert_like_real): Add c_cast_p parameter.  Handle pointer
883         conversions directly rather than relying on ocp_convert.
884         (perform_direct_initialization_if_possible): Add c_cast_p
885         parameter.
886         * cp-tree.h (perform_direct_initialization_if_possible): Change
887         prototype.
888         (convert_member_func_to_ptr): New function.
889         * typeck.c (check_for_casting_away_constness): Add diag_fn
890         parameter.
891         (build_static_cast_1): New function, split out from ...
892         (build_static_cast): ... here.  Use build_static_cast_1.
893         (build_reinterpret_cast_1): New function, split out from ...
894         (build_reinterpret_cast): ... here.  Use build_reinterpret_cast_1.
895         (build_const_cast_1): New function, split out from ...
896         (build_const_cast): ... here.  Use build_const_cast_1.
897         (build_c_cast): Rewrite to use build_const_cast_1,
898         build_static_cast_1, and build_reinterpret_cast_1.
899         (convert_member_func_to_ptr): New function.
900
901 2004-10-19  Paolo Bonzini  <bonzini@gnu.org>
902
903         PR c++/18047
904         * parser.c (enum cp_parser_prec): Give relational expressions
905         a higher precedence than equality expressions.
906
907 2004-10-15  Nathan Sidwell  <nathan@codesourcery.com>
908
909         * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call.
910         (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove.
911         (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call.
912         (enum base_access): Reorganize.
913         (accessible_base_p, accessible_p): Add consider_local_p parameter.
914         * call.c (standard_conversion): Update comment about
915         DERIVED_FROM_P.
916         (enforce_access): Adjust accessible_p call.
917         (build_over_call): Adjust accessible_base_p call.
918         * class.c (convert_to_base): Adjust lookup_base call.
919         (build_vtbl_ref_1): Likewise.
920         (warn_about_ambiguous_bases): Likewise. Add early exit.
921         * cvt.c (convert_to_pointer_force) Adjust lookup_base call.
922         * search.c (accessible_base_p): Add consider_local_p parameter.
923         (lookup_base): Pass consider_local_p to accessible_base_p call.
924         (friend_accessible_p): Check whether scope is a class member.
925         Remove unnecessary class template check.
926         (accessible_p): Add consider_local_p parameter. Use it.
927         (adjust_result_of_qualified_name_lookup): Adjust lookup_base call.
928         * tree.c (maybe_dummy_object): Likewise.
929         * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P.
930         (build_class_member_access_expr): Adjust lookup_base call.
931         * typeck2.c (binfo_or_else): Likewise.
932         * rtti.c (build_dynamic_cast_1): Access can consider friendship
933         and current scope.
934
935 2004-10-17  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
936
937         PR c++/17743
938         * decl2.c (grokfield): Apply attributes also to TYPE_DECLs.
939
940 2004-10-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
941
942         PR c++/10479
943         * parser.c (cp_parser_parenthesized_expression_list): Fold
944         non-dependent expressions in attribute lists.
945
946 2004-10-15  Mark Mitchell  <mark@codesourcery.com>
947
948         PR c++/17042
949         * decl.c (declare_global_var): Use the return value from pushdecl.
950
951         PR c++/14667
952         * parser.c (cp_parser_simple_declaration): Do not diagnose invalid
953         type names if we have already found a valid type.
954         (cp_parser_member_declaration): Likewise.
955         
956         PR c++/17916
957         * parser.c (cp_parser_member_specification_opt): Handle
958         CPP_PRAGMA.
959
960 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
961
962         * dump.c, g++spec.c, repo.c: Update copyright.
963
964 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
965
966         * decl.c: Fix a comment typo.
967
968 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
969
970         PR c++/16301
971         * name-lookup.c (parse_using_directive): If we have a
972         error_mark_node, do not set the decl namespace associations
973         on it.
974
975 2004-10-14  Mark Mitchell  <mark@codesourcery.com>
976
977         PR c++/17976
978         * decl.c (cp_finish_decl): Do not call expand_static_init more
979         than once for a single variable.
980
981 2004-10-14  Matt Austern  <austern@apple.com>
982
983         * Make-lang.in (pt.o): depends on pointer-set.h
984         * cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now.
985         * pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
986         (for_each_template_parm): Convert from htab_t to pointer_set_t.
987         * tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
988         
989 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
990
991         PR c++/17661
992         * semantics.c (finish_for_expr): Convert expression to void
993         so that we don't create temporaries for a?b:c.
994
995 2004-10-13  Kazu Hirata  <kazu@cs.umass.edu>
996
997         * search.c: Fix a comment typo.
998
999 2004-10-12  Nathan Sidwell  <nathan@codesourcery.com>
1000
1001         * class.c (dfs_modify_vtables): Simplify condition. Return
1002         dfs_skip_bases as appropriate.
1003         (modify_all_vtables): Walk in pre-order.
1004         * search.c (dfs_walk_all, dfs_walk_once_r,
1005         dfs_walk_once_accessible_r): Assert post order function never
1006         returns dfs_skip_bases.
1007
1008         * search.c (struct lookup_base_data_s): New.
1009         (lookup_base_r): Replace with ...
1010         (dfs_lookup_base): ... this.
1011         (lookup_base): Use dfs_walk_all.
1012
1013 2004-10-12  Kazu Hirata  <kazu@cs.umass.edu>
1014
1015         * search.c: Fix comment typos.
1016
1017 2004-10-11  Mark Mitchell  <mark@codesourcery.com>
1018
1019         PR c++/15786
1020         * parser.c (cp_parser_declarator): Add member_p parameter. 
1021         (cp_parser_condition): Adjust calls to cp_parser_declarator.
1022         (cp_parser_explicit_instantiation): Likewise.
1023         (cp_parser_init_declarator): Likewise.
1024         (cp_parser_direct_declarator): Add member_p parameter.  Do not
1025         parse tentatively when parsing the parameters to a member.
1026         (cp_parser_type_id): Adjust calls to cp_parser_declarator.
1027         (cp_parser_parameter_declaration): Likewise.
1028         (cp_parser_member_declaration): Likewise.
1029         (cp_parser_exception_declaration): Likewise.
1030
1031         PR c++/17936
1032         * cp-tree.h (CLASSTYPE_TEMPLATE_SPECIALIZATION): Add a comment.
1033         * pt.c (optimize_specialization_lookup_p): Do not optimize lookups
1034         for members of partial or explicit specializations.
1035
1036         PR c++/17929
1037         * decl2.c (finish_anon_union): Robustify.
1038
1039 2004-10-11  Nathan Sidwell  <nathan@codesourcery.com>
1040
1041         * cp-tree.h (get_dynamic_cast_base_type): Rename to ...
1042         (dcast_base_hint): ... here.
1043         * rtti.c (build_dynamic_cast_1): Use dcast_base_hint.
1044         * search.c (struct dcast_data_s): New.
1045         (dynamic_cast_base_recurse): Remove. Replace with ...
1046         (dfs_dcast_hint_pre, dfs_dcast_base_post): ... these. New.
1047         (get_dynamic_cast_base_type): Rename to ...
1048         (dcast_base_hint): ... here.  Use dfs_walk_once_accessible.
1049         (accessible_r): Remove.
1050         (dfs_accessible_post): New, broken out of accessible_r.
1051         (accessible_p): Use dfs_walk_once_accessible.
1052         (dfs_walk_once_accessible_r): New. From accessible_r.
1053         (dfs_walk_once_accessible): New. From acessible_p.
1054
1055         * cp-tree.h (SAME_BINFO_TYPE_P): New.
1056         * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare
1057         binfo types.
1058         (convert_to_base_statically, determine_primary_bases,
1059         update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits,
1060         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
1061         accumulate_vtbl_inits, dfs_accumulate_vtbl_inits,
1062         build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise.
1063         * init.c (expand_member_init): Likewise.
1064         * search.c (lookup_base_r, dynamic_cast_base_recurse,
1065         binfo_via_virtual, copied_binfo, binfo_for_vbase,
1066         original_binfo): Likewise.
1067         * tree.c (copy_binfo): Likewise.
1068
1069 2004-10-11  Kazu Hirata  <kazu@cs.umass.edu>
1070
1071         * semantics.c: Fix comment typos.
1072
1073 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
1074
1075         PR c++/17554
1076         part of c++/17657
1077         middle-end/17703
1078         * semantics.c (maybe_cleanup_point_expr): Call
1079         fold_build_cleanup_point_expr.
1080         (maybe_cleanup_point_expr_void): New function.
1081         (add_decl_expr): Call maybe_cleanup_point_expr_void.
1082         (finish_expr_stmt): Likewise.
1083         (finish_return_stmt): Likewise.
1084         (finish_for_expr): Likewise.
1085         (finish_asm_stmt): Likewise.
1086         * typeck.c (condition_conversion): Call
1087         fold_build_cleanup_point_expr.
1088
1089 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
1090
1091         PR c++/17907
1092         * semantics.c (add_decl_expr): If the decl has a size which
1093         has side effects then the decl expression needs a cleanup point.
1094
1095 2004-10-10  Mark Mitchell  <mark@codesourcery.com>
1096
1097         PR c++/17393
1098         * decl.c (grokdeclarator): Robustify error-recovery on invalid
1099         declarations.
1100
1101 2004-10-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1102
1103         Convert diagnostics to use quoting flag q 7/n
1104         * typeck.c (composite_pointer_type_r, composite_pointer_type, 
1105         cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr, 
1106         string_conv_p, build_class_member_access_expr, 
1107         build_class_member_access_expr, lookup_destructor, 
1108         finish_class_member_access_expr, build_indirect_ref, 
1109         get_member_function_from_ptrfunc, build_function_call, 
1110         convert_arguments, build_binary_op, pointer_diff, build_unary_op, 
1111         check_for_casting_away_constness, build_static_cast, 
1112         build_reinterpret_cast, build_const_cast, build_c_cast, 
1113         build_modify_expr, get_delta_difference, build_ptrmemfunc, 
1114         dubious_conversion_warnings, convert_for_assignment, 
1115         convert_for_initialization, 
1116         maybe_warn_about_returning_address_of_local, check_return_expr): 
1117         Use quoting marks.
1118
1119         * typeck2.c (error_not_base_type, readonly_error, 
1120         abstract_virtuals_error, cxx_incomplete_type_diagnostic, 
1121         store_init_value, digest_init, build_x_arrow, 
1122         build_m_component_ref, require_complete_eh_spec_types): Likewise.
1123
1124         * tree.c (cp_build_qualified_type_real, 
1125         handle_java_interface_attribute, handle_init_priority_attribute):
1126         Likewise.
1127
1128         * semantics.c (finish_asm_stmt, finish_non_static_data_member, 
1129         finish_pseudo_destructor_expr, 
1130         check_template_template_default_arg, begin_class_definition, 
1131         finish_base_specifier, qualified_name_lookup_error, 
1132         finish_id_expression, finish_typeof): Likewise.
1133
1134         * search.c (lookup_base, check_final_overrider,
1135         look_for_overrides_r): Likewise.
1136
1137         * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise.
1138
1139 2004-10-09  Mark Mitchell  <mark@codesourcery.com>
1140
1141         PR c++/17867
1142         * error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a
1143         constructor.
1144
1145         PR c++/17670
1146         * init.c (build_new): Correct comments.
1147         * parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in
1148         the non-array case.
1149
1150         PR c++/17821
1151         * parser.c (cp_parser_postfix_dot_deref_expression): If the
1152         pseduo-destructor-name production does not work, fall back to the
1153         ordinary production.
1154
1155         PR c++/17826
1156         * tree.c (cp_tree_equal): Handle a BASELINK.
1157
1158         PR c++/17524
1159         * cp-tree.h (check_var_type): New function.
1160         * decl.c (check_var_type): New function, split out from ...
1161         (grokdeclarator): ... here.
1162         * pt.c (tsubst_decl): Use check_var_type.
1163
1164         PR c++/17685
1165         * decl.c (grokdeclarator): Disallow declarations of operators as
1166         non-functions.
1167         
1168 2004-10-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1169
1170         PR c++/17868
1171         * error.c (dump_expr): Add missing case for RDIV_EXPR.
1172
1173 2004-10-08  Kazu Hirata  <kazu@cs.umass.edu>
1174
1175         * pt.c, search.c: Fix comment typos.
1176
1177 2004-10-08  Nathan Sidwell  <nathan@codesourcery.com>
1178
1179         * cp-tree.h (dfs_walk, dfs_walk_real, dfs_unmark, markedp,
1180         unmarkedp): Remove.
1181         (dfs_skip_bases, dfs_walk_all, dfs_walk_once): New.
1182         * class.c (struct find_final_overrider_data): Remove most_derived,
1183         vpath_list and vpath fields.  Add path field.
1184         (dfs_find_final_ocerrider_1): Add DEPTH parameter. Adjust.
1185         (dfs_find_final_overrider): Rename to ...
1186         (dfs_find_final_overrider_pre): ... here. Adjust.
1187         (dfs_find_final_overrider_post): Adjust.
1188         (dfs_find_final_overrider_q): Fold into
1189         dfs_find_final_overrider_pre.
1190         (find_final_overrider): Adjust dfs searching.
1191         (dfs_modify_vtables): Don't mark binfo here.
1192         (modify_all_vtables): Use dfs_walk_once.
1193         (build_vtt_inits): Likwise. Use dfs_walk_all.
1194         (dfs_build_secondary_vptr_vtt_inits): Don't mark binfo here.
1195         Return dfs_skip_bases as appropriate.
1196         (dfs_fixup_binfo_vtbls): Return dfs_skip_bases as appropriate.
1197         * init.c (dfs_initialized_vtbl_ptrs): Return dfs_skip_bases as
1198         appropriate. Don't mark binfo here.
1199         (initialize_vtbl_ptrs): Use dfs_walk_once.
1200         * search.c (struct vbase_info): Remove unused struct.
1201         (access_in_type): Use dfs_walk_once.
1202         (dfs_access_in_type): Don't mark binfo here.
1203         (dfs_accessible_queue_p, dfs_accessible_p) Remove.
1204         Fold into ...
1205         (accessible_r): ... here. New. Specialize dfs_walk_once.
1206         (accessible_p): Use accessible_r.
1207         (lookup_field_queue_p): Remove. Fold into ...
1208         (lookup_field_r): ... here. Adjust.
1209         (lookup_member): Use dfs_walk_all.
1210         (dfs_walk_real, dfs_walk): Replace with ...
1211         (dfs_walk_all, dfs_walk_once): ... these.
1212         (dfs_walk_once_r, dfs_unmark_r): Workers for dfs_walk_once.
1213         (dfs_unmark, unmarkedp, markedp): Remove.
1214         (dfs_get_pure_virtuals): Don't mark binfo here.
1215         (get_pure_virtuals): Use dfs_walk_once.
1216         (dfs_debug_unmarked_p): Remove. Fold into ...
1217         (dfs_debug_mark): ... here.
1218         (note_debug_info_needed): Use dfs_walk_all.
1219
1220 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
1221
1222         * pt.c (tsubst_expr) <case ASM_EXPR>: Look passed the
1223         CLEANUP_POINT_EXPR to get the asm expression.
1224
1225 2004-10-07  Mark Mitchell  <mark@codesourcery.com>
1226
1227         * cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
1228         (DECL_MEMBER_TEMPLATE_P): New macro.
1229         (is_member_template): Remove.
1230         (class_method_index_for_fn): New function.
1231         * pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P.
1232         * class.c (finish_struct_methods): Remove out-of-date comment.
1233         * decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P.
1234         * decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and
1235         class_method_index_for_fn.
1236         * pt.c (is_member_template): Remove.
1237         (is_member_template_class): Likewise.
1238         (optimize_specialization_lookup_p): New function.
1239         (retrieve_specialization): Optimize lookups for members that are
1240         not member templates.
1241         (register_specialization): Adjust accordingly.
1242         (build_template_decl): Add member_template_p parameter.  Set
1243         DECL_MEMBER_TEMPLATE_P.
1244         (process_partial_specialization): Adjust call to
1245         retrieve_specialization.
1246         (push_template_decl_real): Determine whether the template is a
1247         member template.
1248         (lookup_template_class): Use retrieve_specialization.
1249         (tsubst_decl): Adjust call to retrieve_specialization.
1250         (tsubst_exception_specification): New function.
1251         (tsubst): Use it.
1252         (tsubst_copy): Use DECL_MEMBER_TEMPLATE_P.
1253         (instantiate_template): Adjust call to retrieve_specialization.
1254         (regenerate_decl_from_template): Do not actually generate a new
1255         DECL.
1256         (instantiate_decl): Adjust call to retrieve_specialization.
1257         (class_method_index_for_fn): New method.
1258
1259 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
1260
1261         * parser.c (cp_parser_asm_definition): Look passed the
1262         CLEANUP_POINT_EXPR to get the asm expression.
1263
1264 2004-10-06  Andrew Pinski  <pinskia@physics.uc.edu>
1265
1266         PR c++/17368
1267         * semantics.c (finish_asm_stmt): Asm expressions need cleanup
1268         also.
1269
1270 2004-10-05  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1271
1272         Convert diagnostics to use quoting flag q 6/n
1273         * pt.c (finish_member_template_decl, check_specialization_scope, 
1274         maybe_process_partial_specialization, determine_specialization, 
1275         check_explicit_specialization, maybe_check_template_type, 
1276         process_partial_specialization, check_default_tmpl_args, 
1277         push_template_decl_real, redeclare_class_template, 
1278         convert_nontype_argument, coerce_template_parms, 
1279         lookup_template_class, push_tinst_level, 
1280         instantiate_class_template, tsubst_arg_types, 
1281         tsubst_function_type, tsubst, tsubst_qualified_id, 
1282         tsubst_copy_and_build, check_instantiated_args, 
1283         do_decl_instantiation, do_type_instantiation, 
1284         invalid_nontype_parm_type_p, check_specialization_namespace, 
1285         convert_template_argument, determine_specialization, 
1286         check_template_shadow, tsubst_decl 
1287         instantiate_pending_templates): Use quoting marks.
1288
1289 2004-10-05  Nathan Sidwell  <nathan@codesourcery.com>
1290
1291         PR c++/17829
1292         * parser.c (cp_parser_postfix_expression): Inhibit Koenig when
1293         unqualified lookup finds a member function.
1294
1295 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1296
1297         Convert diagnostics to use quoting flag q 5/n
1298         * parser.c (cp_parser_name_lookup_error, 
1299         cp_parser_diagnose_invalid_type_name, 
1300         cp_parser_primary_expression, cp_parser_unqualified_id, 
1301         cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement, 
1302         cp_parser_jump_statement, cp_parser_simple_declaration, 
1303         cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id, 
1304         cp_parser_type_parameter, cp_parser_template_id, 
1305         cp_parser_template_name, cp_parser_direct_declarator, 
1306         cp_parser_parameter_declaration_list, cp_parser_class_head, 
1307         cp_parser_base_specifier, cp_parser_lookup_name, 
1308         cp_parser_late_parsing_default_args, 
1309         cp_parser_optional_template_keyword 
1310         cp_parser_elaborated_type_specifier, cp_parser_check_class_key, 
1311         cp_parser_check_access_in_redeclaration): Use quoting marks.
1312
1313         * name-lookup.c (supplement_binding, pushdecl, 
1314         check_for_out_of_scope_variable, validate_nonmember_using_decl, 
1315         do_nonmember_using_decl, lookup_tag, set_decl_namespace, 
1316         push_namespace, do_namespace_alias, do_using_directive, 
1317         ambiguous_decl, lookup_namespace_name, add_function): Likewise.
1318
1319         * method.c (use_thunk): Likewise.
1320
1321         * lex.c (unqualified_name_lookup_error, 
1322         unqualified_fn_lookup_error): Likewise.
1323
1324 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1325
1326         Convert diagnostics to use quoting flag q 4/n
1327         * except.c (decl_is_java_type, build_throw, 
1328         is_admissible_throw_operand, check_handlers_1, check_handlers): 
1329         Use quoting formats.
1330         * friend.c (add_friend, make_friend_class, do_friend): Likewise.
1331         * init.c (sort_mem_initializers, emit_mem_initializers, 
1332         member_init_ok_or_else, expand_member_init, is_aggr_type, 
1333         build_offset_ref, build_java_class_ref): Likewise.
1334
1335 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1336
1337         Convert diagnostics to use quoting flag q 3/n
1338         * decl.c (pop_label, duplicate_decls, redeclaration_error_message,
1339         redeclaration_error_message, lookup_label, check_goto,
1340         make_typename_type, make_unbound_class_template,
1341         fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1, 
1342         grok_reference_init, layout_var_decl, maybe_commonize_var, 
1343         check_for_uninitialized_const_var, reshape_init_array, 
1344         reshape_init, check_initializer, cp_finish_decl,
1345         member_function_or_else, bad_specifiers, grokfndecl, grokvardecl, 
1346         check_static_variable_definition, compute_array_index_type, 
1347         create_array_type_for_decl, check_special_function_return_type, 
1348         grokdeclarator, check_default_argument, grokparms, 
1349         grok_ctor_properties, grok_op_properties, 
1350         check_elaborated_type_specifier, xref_tag, finish_enum, 
1351         build_enumerator, check_function_type, start_preparsed_function, 
1352         store_parm_decls): Use quoting formats.
1353         * decl2.c (grok_array_decl, delete_sanity, check_member_template, 
1354         check_java_method, check_classfn, finish_static_data_member_decl, 
1355         grokfield, grokbitfield, grok_function_init,
1356         build_anon_union_vars, coerce_new_type, coerce_delete_type,
1357         check_default_args): Likewise.
1358         * parser.c (cp_parser_decl_specifier_seq): Likewise.
1359
1360 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1361
1362         Convert diagnostics to use quoting flag q 2/n
1363         * class.c (build_base_path, add_method, alter_access,
1364         handle_using_decl, check_bases,
1365         maybe_warn_about_overly_private_class, find_final_overrider,
1366         warn_hidden, finish_struct_anon, add_implicitly_declared_members,
1367         check_bitfield_decl, check_field_decls, layout_empty_base,
1368         build_base_field, check_methods, layout_virtual_bases,
1369         warn_about_ambiguous_bases, layout_class_type, finish_struct_1,
1370         resolve_address_of_overloaded_function, instantiate_type,
1371         note_name_declared_in_class): Use format flag "q" for quoting.
1372
1373 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1374
1375         Convert diagnostics to use quoting flag q 1/n
1376         * error.c (locate_error): Ignore quoting flag q.
1377         * call.c (build_user_type_conversion_1, build_operator_new_call,
1378         build_object_call, op_error, build_conditional_expr,
1379         build_new_op, build_op_delete_call, enforce_access,
1380         convert_like_real, convert_arg_to_ellipsis, build_x_va_arg,
1381         convert_default_arg, build_over_call, build_new_method_call,
1382         joust, perform_implicit_conversion, initialize_reference): Use the
1383         quoting flag q.
1384
1385 2004-10-03  Andrew Pinski  <pinskia@physics.uc.edu>
1386
1387         PR c++/17797
1388         * typeck.c (build_reinterpret_cast): Return if the inner type
1389         is error_mark_node.
1390
1391 2004-10-01  Jan Hubicka  <jh@suse.cz>
1392
1393         * semantics.c (expand_body): Update call of tree_rest_of_compilation.
1394
1395 2004-09-30  Nathan Sidwell  <nathan@codesourcery.com>
1396
1397         * cp-tree.h (struct lang_decl): Shrink by reordering fields and
1398         turning operator_code and fixed_offset into bitfields.
1399
1400 2004-09-29  Joseph S. Myers  <jsm@polyomino.org.uk>
1401
1402         * decl.c (duplicate_decls): Merge TREE_DEPRECATED.
1403
1404 2004-09-29  Jason Merrill  <jason@redhat.com>
1405
1406         PR tree-optimization/17697
1407         * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl.
1408
1409 2004-09-28  Jason Merrill  <jason@redhat.com>
1410
1411         PR middle-end/17525
1412         * class.c (build_base_field): Set TYPE_MODE.
1413
1414 2004-09-28  Roger Sayle  <roger@eyesopen.com>
1415
1416         PR driver/17537
1417         * g++spec.c (lang_specific_driver): Unrecognized libraries, other
1418         than -lc and -lm, may require linking against libstc++.
1419
1420 2004-09-28  Kazu Hirata  <kazu@cs.umass.edu>
1421
1422         * tree.c: Fix a comment typo.
1423
1424 2004-09-28  Nathan Sidwell  <nathan@codesourcery.com>
1425
1426         * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove.
1427         (struct secondary_vptr_vtt_init_data_s): New.
1428         (build_vtt_inits): Adjust dfs_walkers.
1429         (dfs_build_secondary_vptr_vtt_inits): Caller data is a
1430         secondary_vptr_vtt_init_data_s structure. Adjust.
1431         (dfs_ctor_vtable_bases_queue_p): Remove.
1432         (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify.
1433
1434         * pt.c (struct get_template_base_data_s): Remove.
1435         (get_template_base_r): Fold into get_template_base.
1436         (get_template_base): Walk base binfos directly in inheritance
1437         graph order.
1438
1439 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
1440
1441         PR c++/17642
1442         * cp-tree.h (fold_if_not_in_template): New function.
1443         * call.c (build_conditional_expr): Use fold_if_not_in_template.
1444         (build_cxx_call): Likewise.
1445         * cvt.c (convert_to_complex): Likewise.
1446         (ocp_convert): Likewise.
1447         (convert): Likewise.
1448         (convert_force): Likewise.
1449         * decl.c (compute_array_index_type): Clear
1450         processing_template_decl while folding array bounds.
1451         * pt.c (convert_nontype_argument): Clear
1452         processing_template_decl while processing non-type argument
1453         initialization.
1454         * tree.c (fold_if_not_in_template): New function.
1455         * typeck.c (build_class_member_access_expr): Use
1456         fold_if_not_in_template.
1457         (build_array_ref): Likewise.
1458         (build_binary_op): Likewise.  Do not try to optimize computations
1459         when processing templates.
1460         (cp_pointer_int_sum): Use fold_if_not_in_template.
1461         (pointer_diff): Likewise.
1462         (build_unary_op): Likewise.
1463         (build_reinterpret_cast): Likewise.
1464         (get_delta_difference): Likewise.
1465         (expand_ptrmemfunc_cst): Likewise.
1466         (dubious_conversion_warnings): Likewise.
1467
1468 2004-09-27  Matt Austern  <austern@apple.com>
1469
1470         * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c
1471         (cp_lexer_get_preprocessor_token): Set implicit_extern_c for
1472         tokens that come from headers that are implicitly extern "C".
1473         (struct cp_parser): new one-bit field, implicit_extern_c.
1474         (cp_parser_new): Set parser's implicit_extern_c to false.
1475         (cp_parser_translation_unit): Pop lang context if we were in a
1476         header that was implicitly extern "C".
1477         (cp_parser_declaration_seq_opt): Push/pop lang context as
1478         required by the token's and parser's implicit_extern_c.
1479         
1480 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
1481
1482         PR c++/17585
1483         * cp-tree.h (shared_member_p): Declare.
1484         * search.c (shared_member_p): Give it external linkage.
1485         * semantics.c (finish_qualified_id_expr): Use it.
1486         (finish_id_expression): Likewise.
1487
1488         PR c++/17585
1489         * semantics.c (finish_id_expression): Do not add "this->" to
1490         static member functions.
1491
1492 2004-09-27  Nathan Sidwell  <nathan@codesourcery.com>
1493
1494         PR c++/17681
1495         * error.c (dump_type): Change TREE_VEC case into TREE_BINFO.
1496
1497         * class.c (struct count_depth_data): Remove.
1498         (dfs_depth_post, dfs_depth_q): Remove.
1499         (find_final_overrider): Use number of vbase classes as depth
1500         bound.
1501         
1502         * cp-tree.h (types_overlap_p): Remove.
1503         * search.c (struct overlap_info): Remove.
1504         (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove.
1505         
1506         * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove.
1507         (get_template_base_recursive): Remove. Replace with ...
1508         (get_template_base_r): ... this.
1509         (struct get_template_base_data_s): New.
1510         (get_template_base): Use get_template_base_r via dfs_walk.  Always
1511         return NULL on failure.
1512         (unify): Remove error_mark_node check from get_template_base result.
1513
1514 2004-09-24  Paolo Bonzini  <bonzini@gnu.org>
1515
1516         * parser.c (cp_parser_expression_stack): Clarify why it is
1517         an array of NUM_PREC_VALUES elements.
1518         (cp_parser_binary_expression): Clarify why we do not need to
1519         handle stack overflow.
1520
1521 2004-09-24  Nathan Sidwell  <nathan@codesourcery.com>
1522
1523         PR c++/16889
1524         * search.c (lookup_field_queue_p): Correct check for hidden base.
1525
1526         * search.c (bfs_walk): Remove.
1527         (lookup_member): Use dfs_walk_real.
1528         (dfs_walk_real): Move and adjust documentation from bfs_walk.
1529
1530 2004-09-23  Zack Weinberg  <zack@codesourcery.com>
1531
1532         * decl.c (grokfndecl): If ::main is found not to return int,
1533         correct it after issuing a diagnostic.
1534         (grokdeclarator): If the incoming type was error_mark_node, do
1535         not complain about declaring something with no type.
1536         (start_function): Change check for ::main not returning int to
1537         an assertion, as grokfndecl now catches this when the user did it.
1538         * init.c (perform_member_init, sort_mem_initializers)
1539         (emit_mem_initializers): Make most diagnostics be issued on
1540         the line of current_function_decl, not whatever the current
1541         input line is.
1542         * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
1543         definition and declaration with #ifdef ENABLE_CHECKING.
1544         Avoid unnecessary use of fprintf.
1545         (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
1546         definitions to avoid warnings.
1547         (cp_lexer_new_main): Add assertion that first token is not a
1548         padding token.
1549         (cp_lexer_new_from_token_array): Fold into ...
1550         (cp_lexer_new_from_tokens): ... here.  Add assertion that
1551         first token is not a padding token.
1552         (cp_lexer_set_source_position_from_token): Move nearer to callers.
1553         Remove unused lexer argument.
1554         (cp_lexer_peek_token): Just print debugging report (if enabled)
1555         and return lexer->next_token.
1556         (cp_lexer_skip_purged_tokens): Delete.
1557         (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
1558         inline, simplify bodies.
1559         (cp_lexer_peek_nth_token): Add debugging report a la
1560         cp_lexer_peek_token.
1561         (cp_lexer_consume_token): Correct commentary.  Advance over
1562         purged tokens here.  Set current source position here, from
1563         token to be returned.  Avoid unnecessary use of fprintf.
1564         (cp_lexer_purge_token): Advance next_token pointer over this and
1565         subsequent purged tokens.
1566         (cp_parser_error): Adjust source position to that of the
1567         peeked token.
1568         (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
1569         (cp_parser_string_literal): Remove some excessive cleverness.
1570         (cp_parser_enum_specifier): Call start_enum before consuming
1571         the opening brace.
1572         (cp_parser_member_declaration): Make the "extra semicolon"
1573         diagnostic consistently-worded with the other place this is
1574         diagnosed.  Explicitly set the diagnostic location to the
1575         location of the offending semicolon.
1576         (cp_parser_enclosed_template_argument_list): Use %</%> quoting
1577         in diagnostics.  Do not use cp_parser_require.  Set location
1578         of diagnostics about improper use of '>>' to location of
1579         offending token.
1580         (cp_parser_late_parsing_for_member):
1581         Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
1582         (cp_parser_late_parsing_default_args): Likewise.  Manually
1583         move some logic outside the loop.
1584
1585 2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
1586
1587         PR c++/17618
1588         * cvt.c (cp_convert_to_pointer): Return early when the type is
1589         an error_mark_node.
1590
1591 2004-09-21 Fariborz Jahanian <fjahanian@apple.com>
1592
1593         PR c++/13989
1594         PR c++/9844
1595         * decl.c (grokfndecl): Add new argument "attrlist", use it
1596         to call cplus_decl_attributes.
1597         (start_function): Remove call to cplus_decl_attributes.
1598         * cvt.c (ocp_convert): Add support to use type conversion
1599         function to vector type.
1600         * parser.c (cp_parser_conversion_type_id): Add attributes, if any,
1601         to the parsed type.
1602
1603 2004-09-23  Paolo Bonzini  <bonzini@gnu.org>
1604
1605         PR c++/17596
1606
1607         * parser.c (cp_parser_token_tree_map_node,
1608         cp_parser_pm_expression, cp_parser_additive_expression,
1609         cp_parser_multiplicative_expression, cp_parser_shift_expression,
1610         cp_parser_relational_expression, cp_parser_equality_expression,
1611         cp_parser_and_expression, cp_parser_exclusive_or_expression,
1612         cp_parser_inclusive_or_expression,
1613         cp_parser_logical_and_expression,
1614         cp_parser_logical_or_expression): Removed.
1615         (enum cp_parser_prec, struct cp_parser_token_tree_map_node,
1616         binops, binops_by_token): New.
1617         (cp_parser_assignment_expression): Use cp_parser_binary_expression.
1618         (cp_parser_new): Initialize binops_by_token.
1619         (cp_parser_binary_expression): Rewritten.
1620         (N_CP_TTYPES): New.
1621
1622 2004-09-23  Kazu Hirata  <kazu@cs.umass.edu>
1623
1624         * parser.c: Fix a comment typo.
1625
1626 2004-09-23  Nathan Sidwell  <nathan@codesourcery.com>
1627
1628         PR c++/17620
1629         * decl.c (xref_basetypes): Look through typedefs before checking
1630         for duplicate base.
1631
1632 2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
1633
1634         * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
1635         * decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
1636         * rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
1637         (init_rtti_processing): Initialize it to something realistic.
1638         (get_tinfo_decl): Adjust pushing the new decl.
1639
1640         * cp-tree.h (struct lang_type_class): Remove marked flags, add
1641         diamond_shaped and repeated_base flags.  Reorder to keep 8-bit blocks.
1642         (TYPE_MARKED_P): New.
1643         (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New.
1644         (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
1645         CLEAR_CLASSTYPE_MARKED_N): Remove.
1646         (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*,
1647         CLEAR_CLASSTYPE_MARKED_*): Remove.
1648         * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond
1649         shaped and repeated base properties.
1650         * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET.
1651         * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark,
1652         class_hint_flags): Remove.
1653         (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
1654         CLASSTYPE_DIAMOND_SHAPED_P.
1655
1656 2004-09-21  Ziemowit Laski  <zlaski@apple.com>
1657
1658         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
1659         cp-objcp-common.h.
1660         (objcp_tsubst_copy_and_build): Reformat function signature.
1661         * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
1662         (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.
1663
1664 2004-09-21  Zack Weinberg  <zack@codesourcery.com>
1665
1666         * parser.c (cp_lexer_peek_token, cp_lexer_consume_token):
1667         Don't handle CPP_PRAGMA tokens specially.
1668         (cp_lexer_handle_pragma): Use cp_lexer_consume_token.  Don't
1669         purge the token; do clear token->value after processing.  Add
1670         assertion at beginning that token->value is nonzero.
1671         (cp_parser_statement, cp_parser_declaration_seq_opt): Handle
1672         CPP_PRAGMA as a full statement or declaration in its own right.
1673
1674 2004-09-21  Matt Austern  <austern@apple.com>
1675
1676         PR c++/15049
1677         * decl.c (grokvardecl): Accept declarations of global variables
1678         using anonymous types.
1679
1680 2004-09-21  Roger Sayle  <roger@eyesopen.com>
1681
1682         PR c++/7503
1683         * tree.c (lvalue_p_1):  Disallow MIN_EXPR and MAX_EXPR as lvalues
1684         if either operand has side-effects.
1685         * typeck.c (rationalize_conditional_expr): Assert that neither
1686         operand of MIN_EXPR or MAX_EXPR has side-effects.
1687         (build_modify_expr):  Add support for MIN_EXPR and MAX_EXPR.
1688         Check that the "lhs" is a valid lvalue, i.e. that neither operand
1689         of a MIN_EXPR or MAX_EXPR has a side-effect.
1690
1691 2004-09-21  Nathan Sidwell  <nathan@codesourcery.com>
1692
1693         * cp-tree.h (struct lang_type_header): Remove
1694         uses_multiple_inheritance field.
1695         (TYPE_USES_MULTIPLE_INHERITANCE): Remove.
1696         (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
1697         (TYPE_USES_VIRTUAL_BASECLASSES): Remove.
1698         (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
1699         (TYPE_CONTAINS_VPTR_P): Likewise.
1700         * call.c (add_template_candidate_real): Use
1701         CLASSTYPE_VBASECLASSES.
1702         (build_special_member_call): Likewise.
1703         * class.c (finish_struct_bits): Remove
1704         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
1705         bookkeeping.
1706         (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
1707         (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
1708         bookkeeping.
1709         (build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
1710         (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
1711         Likewise.
1712         * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
1713         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
1714         bookkeeping.
1715         (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
1716         * decl2.c (maybe_retrofit_in_chrg): Likewise.
1717         * init.c (expand_member, push_base_cleanups): Likewise.
1718         * pt.c (instantiate_class_template): Remove
1719         TYPE_USES_MULTIPLE_INHERITANCE,
1720         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
1721         bookkeeping.
1722         * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
1723         check.
1724         * typeck2.c (process_init_constructor): Replace some sorrys with
1725         asserts.
1726
1727 2004-09-21  Andreas Tobler  <a.tobler@schweiz.ch>
1728
1729         * decl.c (reshape_init_array): Initialize max_index_cst to fix
1730         bootstrap failure.
1731
1732 2004-09-20  Mark Mitchell  <mark@codesourcery.com>
1733
1734         PR c++/17530
1735         * pt.c (tsubst): Fix parentheses to accomodate emacs.
1736         (tsubst_baselink): If we get a single function, mark it as used.
1737
1738 2004-09-20  Matt Austern <austern@apple.com>
1739             Zack Weinberg  <zack@codesourcery.com>
1740
1741         * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
1742         Apply lbasename to input_filename before passing to get_fileinfo.
1743         * semantics.c (begin_class_definition): Likewise.
1744         * lex.c (handle_pragma_interface): Apply get_fileinfo to the
1745         correct filename.  Rename variables to be less confusing.
1746         (handle_pragma_implementation): Likewise.  Disable "appears
1747         after file is included" diagnostic.
1748
1749         * parser.c (struct cp_token): Add in_system_header fiag.
1750         (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
1751         (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
1752         (CPP_NONE, cp_lexer_read_token): Delete.
1753         (struct cp_lexer): Remove first_token, string_tokens,
1754         main_lexer_p fields.  Clarify comments.
1755         (struct cp_token_cache): Now just a pair of pointers.
1756         (CP_LEXER_BUFFER_SIZE): New #define.
1757         (CPP_PURGED): New fake token type.
1758         (cp_lexer_new_from_token_array, cp_lexer_destroy)
1759         (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
1760         (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
1761         New functions.
1762         (cp_lexer_new_from_tokens): Now a simple wrapper around
1763         cp_lexer_new_from_token_array.
1764         (cp_lexer_set_source_position_from_token): Also update
1765         in_system_header.
1766         (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
1767         Don't wrap round.
1768         (cp_lexer_token_difference): Dont handle wrapping round.
1769         (cp_lexer_new_main): Enable pragma deferral and raw strings,
1770         read the entire translation unit through c_lex_with_flags into
1771         this lexer's buffer, then turn raw strings back off again.
1772         (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
1773         (cp_lexer_get_preprocessor_token): No need to handle not being
1774         the main lexer.  Set token->in_system_header too.
1775         (cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
1776         to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
1777         (cp_lexer_peek_nth_token): Likewise.
1778         (cp_lexer_purge_token): Mark the token PURGED, don't shift all
1779         the other tokens down.
1780         (cp_lexer_purge_tokens_after): Likewise.
1781         (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
1782         about there being no tokens.
1783         (cp_lexer_print_token): Revise to give useful information on
1784         all tokens.
1785         (struct cp_parser): Add field translate_strings_p.
1786         (cp_parser_new): Initialize it.
1787         (cp_parser_translation_unit): Destroy the lexer when done.
1788         (cp_parser_parameter_declaration): Restructure saving of
1789         default arguments.
1790         (cp_parser_save_member_function_body): Likewise.
1791         (cp_parser_check_for_invalid_template_id)
1792         (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
1793         Adjust calls to cp_lexer_advance_token.
1794         (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
1795         No need to fiddle c_lex_string_translate.
1796         (cp_parser_primary_expression, cp_parser_linkage_specification)
1797         (cp_parser_asm_definition, cp_parser_asm_specification_opt)
1798         (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
1799         Use cp_parser_string_literal.
1800         (cp_parser_attribute_list): Save and restore
1801         parser->translate_strings_p, not c_lex_string_translate.
1802         (cp_parser_cache_group): Delete.
1803         (cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
1804         not take a cache argument.
1805
1806 2004-09-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1807
1808         PR c++/14179
1809         * decl.c (reshape_init): Extract array handling into...
1810         (reshape_init_array): New function. Use integers instead of trees
1811         for indices. Handle out-of-range designated initializers.
1812
1813 2004-09-20  Steven Bosscher  <stevenb@suse.de>
1814
1815         * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
1816         to null_node.
1817
1818 2004-09-19  Mark Mitchell  <mark@codesourcery.com>
1819
1820         * decl2.c (determine_visibility): Allow class visibility
1821         directives to override targetm.cxx.export_class_data.
1822
1823 2004-09-18  Kazu Hirata  <kazu@cs.umass.edu>
1824
1825         * call.c, semantics.c: Follow spelling conventions.
1826         * class.c: Fix a comment typo.
1827
1828 2004-09-16  Geoffrey Keating  <geoffk@apple.com>
1829
1830         PR pch/13361
1831         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
1832         (handle_pragma_implementation): Likewise.
1833
1834 2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
1835             Zack Weinberg  <zack@codesourcery.com>
1836
1837         * cp-tree.def: Use tree_code_class enumeration constants
1838         instead of code letters.
1839         * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
1840         * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
1841         Update for new tree-class enumeration constants.
1842
1843 2004-09-16  Mark Mitchell  <mark@codesourcery.com>
1844
1845         PR c++/16002
1846         * parser.c (cp_parser_simple_declaration): Commit to tentative
1847         parses after seeing a decl-specifier.
1848         (cp_parser_simple_declaration): Eliminate spurious message.
1849         (cp_parser_init_declarator): Adjust error message.
1850
1851         PR c++/16029
1852         * lex.c (unqualified_name_lookup_error): Mark the dummy
1853         declaration as used.
1854
1855         PR c++/17501
1856         * parser.c (cp_parser_nested_name_specifier): Do not resolve
1857         typename types if the user explicitly said "typename".
1858
1859 2004-09-16  Andrew MacLeod  <amacleod@redhat.com>
1860
1861         * error.c (dump_decl): Make sure there is lang_specific info before
1862         checking for DTOR and CTOR decls.
1863
1864 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
1865
1866         * class.c (copy_virtuals): Remove.
1867         (build_primary_vtable): Use copy_list directly.
1868         (build_secondary_vtable): Likewise.
1869         (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
1870         (create_vtable_ptr): Likewise.
1871
1872 2004-09-16  Kazu Hirata  <kazu@cs.umass.edu>
1873
1874         * search.c: Follow spelling conventions.
1875
1876 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
1877
1878         * cp-tree.h (struct lang_type_class): Make pure_virtuals a
1879         VEC(tree).
1880         (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
1881         comments.
1882         * call.c (build_new_method_call): Don't confirm a pure virtual is
1883         in CLASSTYPE_PURE_VIRTUALS.  Reorder checks. Make it a warning.
1884         * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
1885         (fixup_inline_methods, finish_struct): Likewise.
1886         * decl.c (finish_method): Likewise.
1887         * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
1888         CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
1889         * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
1890         vector to avoid repeating the list in error messages.
1891
1892 2004-09-15  Mark Mitchell  <mark@codesourcery.com>
1893
1894         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
1895         * cp-tree.h (cxx_comdat_group): Declare.
1896         * decl.c (cxx_comdat_group): New function.
1897
1898 2004-09-15  Nathan Sidwell  <nathan@codesourcery.com>
1899
1900         * search.c (get_pure_virtuals): Remove unused variables.
1901
1902         * cp-tree.h (struct lang_decl_flags): Remove
1903         needs_final_overrider.
1904         (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
1905         * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
1906         * class.c (finish_struct_bits): Correct comment about
1907         CLASSTYPE_PURE_VIRTUALS.
1908         * search.c (get_pure_virtuals): Remove useless loop.
1909
1910 2004-09-14  Mark Mitchell  <mark@codesourcery.com>
1911
1912         PR c++/17324
1913         * mangle.c (partially_mangled_name): New variable.
1914         (partially_mangled_name_len): Likewise.
1915         (save_partially_mangled_name): New function.
1916         (restore_partially_mangled_name): Likewise.
1917         (write_encoding): Save and restore partially mangled names around
1918         calls to get_mostly_instantiated_function_type.
1919         (write_unqualified_name): Likewise.
1920
1921 2004-09-14  Nathan Sidwell  <nathan@codesourcery.com>
1922
1923         * pt.c (unify): Replace gcc_unreachable with gcc_assert.
1924
1925 2004-09-13  Mark Mitchell  <mark@codesourcery.com>
1926
1927         PR c++/16162
1928         * parser.c (cp_parser_id_expression): Correct value for
1929         is_declarator.
1930         (cp_parser_nested_name_specifier_opt): Look through typenames as
1931         necessary.
1932         (cp_parser_template_name): Honor check_dependency_p.
1933
1934         PR c++/16716
1935         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
1936         Robustify.
1937
1938         PR c++/17327
1939         * pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
1940         gcc_unreacable.
1941
1942 2004-09-12  Richard Henderson  <rth@redhat.com>
1943
1944         PR c++/16254
1945         * semantics.c (maybe_cleanup_point_expr): Don't call fold.
1946         * typeck.c (condition_conversion): Likewise.
1947
1948 2004-09-11  Richard Henderson  <rth@redhat.com>
1949
1950         PR c++/17404
1951         * pt.c (cur_stmt_expr): Move from tsubst_expr.
1952         (tsubst_expr) <case STMT_EXPR>: Move ...
1953         (tsubst_copy_and_build): ... here.
1954
1955 2004-09-10  Zack Weinberg  <zack@codesourcery.com>
1956
1957         * cp-tree.h (interface_only, interface_unknown): Delete declarations;
1958         comment explaining them moved to c-common.h.
1959         * lex.c (interface_only, interface_unknown, extract_interface_info):
1960         Delete definitions.
1961         (cxx_finish): Don't reset interface_unknown.
1962         (handle_pragma_interface): Don't set interface_only and
1963         interface_unknown; just the like-named fields in finfo.
1964         (handle_pragma_implementation): Adjust comment.
1965         * decl2.c (cp_finish_file): Don't reset interface_only and
1966         interface_unknown.
1967         * method.c (synthesize_method): Don't reset interface_unknown or
1968         call extract_interface_info.
1969         * pt.c (pop_tinst_level): Don't call extract_interface_info.
1970         * decl.c (start_cleanup_fn): Don't save or restore interface_only
1971         and interface_unknown.
1972         (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
1973         and use the result instead of the interface_only/interface_unknown
1974         globals.
1975         (start_preparsed_function): Likewise.
1976         * lex.c (cxx_make_type): Likewise.
1977         * semantics.c (begin_class_definition): Likewise.
1978         (expand_body): Don't call extract_interface_info.
1979
1980 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
1981
1982         * decl.c (objc_mark_locals_volatile): Make description of
1983         routine more descriptive; only mark VAR_DECLs at each
1984         binding level.
1985
1986 2004-09-10  Richard Henderson  <rth@redhat.com>
1987
1988         PR c++/17386
1989         * call.c (build_vfield_ref): Move...
1990         * class.c (build_vfield_ref): ... here.  Convert datum to the
1991         primary base containing the vptr.
1992         (make_new_vtable): Simplify build_primary_vtable arguments.
1993         (finish_struct_1): Do not duplicate TYPE_VFIELD.
1994         * typeck.c (build_class_member_access_expr): Don't warn for
1995         null object access to base fields.
1996
1997 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
1998
1999         * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
2000         New functions, to be called from ObjC++.
2001
2002 2004-09-10  Kazu Hirata  <kazu@cs.umass.edu>
2003
2004         * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
2005         name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
2006         comment typos.
2007
2008 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
2009
2010         * typeck.c (build_c_cast): Preserve the cast if casting
2011         to and from an Objective-C type.
2012
2013 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
2014
2015         * Make-lang.in (cp/typeck.o): Depend on c-common.h.
2016         * typeck.c: Include c-common.h.
2017         (comptypes): For RECORD_TYPEs, call objc_comptypes() and
2018         return the result if nonnegative.
2019
2020 2004-09-09  Zack Weinberg  <zack@codesourcery.com>
2021
2022         * decl2.c (import_export_class)
2023         * lex.c (handle_pragma_interface):
2024         Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
2025
2026 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
2027
2028         * Make-lang.in (cp/semantics.o): Depend on c-common.h.
2029         * semantics.c: Include c-common.h.
2030         (finish_compound_stmt): Call objc_clear_super_receiver().
2031
2032 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
2033
2034         * cp-tree.h (do_poplevel): New prototype.
2035         * semantics.c (do_poplevel): Make externally visible.
2036
2037 2004-09-08  Nathan Sidwell  <nathan@codesourcery.com>
2038
2039         * cp-tree.h (tree_pair_s): Define a GC'd vector.
2040         * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
2041         * semantics.c (deferred_access): Likewise.
2042
2043 2004-09-06  Daniel Jacobowitz  <dan@debian.org>
2044
2045         * semantics.c (expand_body): Assert that we are not nested.
2046
2047 2004-09-06  Zack Weinberg  <zack@codesourcery.com>
2048
2049         * decl.c (build_enumerator): Use add_double and int_fits_type_p
2050         instead of cp_build_binary_op, to avoid creating short-lived trees.
2051         * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
2052         lookahead instead of backtracking.  Move some code to avoid a
2053         conditional branch.
2054         (cp_parser_enum_specifier): Avoid duplication of effort with caller.
2055         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
2056         (cp_parser_enumerator_list, cp_parser_enumerator_definition):
2057         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
2058
2059 2004-09-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2060
2061         * decl.c (grok_declarator): Remove a redundant semicolon.
2062
2063         * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
2064         Correct comments describing function parameters.
2065
2066 2004-09-03  Matt Austern  <austern@apple.com>
2067         Compile speed improvement.
2068         * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
2069         Otherwise define a stub macro that expands to nothing.
2070         (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set.  Otherwise
2071         define a stub macro that expands to 0.
2072         (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
2073         (cp_lexer_stop_debugging): Likewise.
2074         (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set.  Otherwise
2075         define a stub macro that expands to NULL.
2076         (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
2077         (cp_lexer_new_from_tokens): Likewise.
2078
2079 2004-09-03  Jan Hubicka  <jh@suse.cz>
2080
2081         * decl.c (finish_function): Clean out pointers we no longer need.
2082
2083 2004-09-03  Jan Beulich  <jbeulich@novell.com>
2084
2085         * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
2086         than "-lm".
2087
2088 2004-09-02  Paul Brook  <paul@codesourcery.com>
2089
2090         * decl2.c (determine_visibility): Only check data visibility
2091         for VAR_DECLS.
2092
2093 2004-08-31  Mark Mitchell  <mark@codesourcery.com>
2094
2095         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
2096         * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
2097         * decl2.c (determine_visibility): Honor
2098         TARGET_CXX_EXPORT_CLASS_DATA.
2099
2100         * class.c (key_method): Rename to ...
2101         (determine_key_method): ... this.
2102         (finish_struct_1): Adjust accordingly.
2103         * cp-tree.h (key_method): Declare.
2104         * decl2.c (maybe_emit_vtables): Determine the key method here if
2105         it has not already been done.
2106
2107 2004-08-31  Ziemowit Laski  <zlaski@apple.com>
2108
2109         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
2110         (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
2111         (cp/cp-decl.c): Do not depend on gtype-cp.h.
2112         (cp/cp-objcp-common.o): New target.
2113         * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
2114         (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
2115         cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
2116         prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
2117         respectively.
2118         (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
2119         LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
2120         LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
2121         LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
2122         LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
2123         LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
2124         LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
2125         LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
2126         LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
2127         LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
2128         LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
2129         LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
2130         LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
2131         LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
2132         LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
2133         LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
2134         LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
2135         LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
2136         LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
2137         LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
2138         LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
2139         LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
2140         LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
2141         LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
2142         LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
2143         LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
2144         LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
2145         LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
2146         LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
2147         LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
2148         LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
2149         hooks to cp-objcp-common.h.
2150         (finish_file): New function.
2151         * cp-objcp-common.c: New file.
2152         * cp-objcp-common.h: New file.
2153         * cp-tree.h (cp_finish_file): New prototype.
2154         * decl.c: Do not include gtype-cp.h.
2155         * decl2.c (finish_file): Rename to cp_finish_file.
2156
2157 2004-08-31  Richard Henderson  <rth@redhat.com>
2158
2159         PR c++/17221
2160         * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
2161         (tsubst_copy_and_build): ... here.
2162
2163 2004-08-30  Mark Mitchell  <mark@codesourcery.com>
2164
2165         * cp-tree.h (initialize_artificial_var): Declare.
2166         * decl.c (initialize_artifical_var): New function.
2167         * class.c (initialize_array): Remove.
2168         (initialize_vtable): Use initialize_artificial_var.
2169         (build_vtt): Likewise.
2170         (build_ctor_vtbl_group): Likewise.
2171
2172 2004-08-30  Richard Henderson  <rth@redhat.com>
2173
2174         * class.c (build_base_path): Use build_address directly.
2175         * typeck.c (build_unary_op): Don't lower &a.b to pointer
2176         arithmetic directly.
2177         * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
2178         means !initializer_constant_valid_p.
2179
2180 2004-08-30  Richard Henderson  <rth@redhat.com>
2181
2182         * class.c (fixed_type_or_null): Use get_base_address before
2183         assuming an ADDR_EXPR is non-null.
2184
2185 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
2186
2187         * name-lookup.c (pop_binding, pushdecl,
2188         set_identifier_type_value_with_scope, push_overloaded_decl,
2189         arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
2190         * parser.c (cp_parser_diagnose_invalid_type_name,
2191         cp_parser_postfix_expression, cp_parser_unary_expression,
2192         cp_parser_check_declarator_template_para): Likewise.
2193         * pt.c (push_inline_template_parms_recursive,
2194         check_explicit_specialization, convert_nontype_argument,
2195         coerce_template_template_parms, uses_template_parms,
2196         instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
2197         tsubst_expr, instantiate_template,
2198         maybe_adjust_types_for_deduction, type_unification_real,
2199         resolve_overloaded_unification, template_decl_level,
2200         type_dependent_expression_p): Likewise.
2201         * search.c (lookup_base_r): Likewise.
2202         * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
2203         * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
2204         verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
2205         * typeck.c (common_type, get_member_function_from_ptrfunc,
2206         build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
2207         * typeck2.c (cxx_incomplete_type_diagnostic,
2208         split_nonconstant_init_1, store_init_value,
2209         process_init_constructor): Likewise.
2210
2211 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
2212
2213         * call.c (check_dtor_name): Replace abort with gcc_assert or
2214         gcc_unreachable.
2215         (build_call, add_builtin_candidate, build_new_op,
2216         convert_like_real, build_over_call, in_charge_arg_for_name,
2217         source_type, joust): Likewise.
2218         * class.c (build_simple_base_path, get_vcall_index,
2219         finish_struct_1, instantiate_type, get_enclosing_class,
2220         add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
2221         * cp-gimplify.c (cp_genericize): Likewise.
2222         * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
2223         * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
2224         * decl.c (poplevel, make_unbound_class_template, reshape_init,
2225         check_special_function_return_type, grokdeclarator,
2226         grok_op_properties, tag_name, xref_tag, start_preparsed_function,
2227         finish_function): Likewise.
2228         * decl2.c (grokfield, maybe_emit_vtables):Likewise.
2229         * error.c (dump_global_iord, dump_decl, dump_template_decl,
2230         language_to_string): Likewise.
2231         * except.c (choose_personality_routine): Likewise.
2232         * friend.c (do_friend): Likewise.
2233         * g++spec.c (lang_specific_driver): Likewise.
2234         * init.c (build_zero_init, expand_default_init, build_new_1,
2235         build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
2236         * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
2237         * mangle.c (add_substitution, write_unscoped_name,
2238         write_template_prefix, write_identifier,
2239         write_special_name_destructor, write_type, write_builtin_type,
2240         write_expression, write_template_param,
2241         write_java_integer_type_codes): Likewise.
2242         * method.c (implicitly_declare_fn): Likewise.
2243
2244 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
2245
2246         * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
2247         (BINFO_INDIRECT_PRIMARY_P): Remove.
2248         * class.c (determine_primary_base): Rename to ...
2249         (determine_primary_bases): ... here.  Set all primary bases.
2250         (set_primary_base): Remove.
2251         (mark_primary_bases): Remove.
2252         (build_simple_base_path, walk_subobject_offsets,
2253         propagate_binfo_offsets, end_of_class): Adjust.
2254         (layout_class_type): Rename determine_primary_base call.
2255         (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
2256         to type_as_string.
2257         (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
2258         build_rtti_vtbl_entries): Adjust.
2259         * init.c (build_vtbl_address): Adjust.
2260
2261         * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
2262
2263 2004-08-28  Ziemowit Laski  <zlaski@apple.com>
2264
2265         * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
2266         CXX_AND_OBJCXX_OBJS.
2267         (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
2268         separately on the link line.
2269
2270 2004-08-28  Jason Merrill  <jason@redhat.com>
2271
2272         * decl.c (expand_static_init): Avoid bogus warnings.
2273
2274 2004-08-27  Jason Merrill  <jason@redhat.com>
2275
2276         PR c++/16851
2277         * tree.c (stabilize_init): See through a COMPOUND_EXPR.
2278
2279         PR c++/13684
2280         * decl.c (expand_static_init): Use thread-safety API.
2281         (register_dtor_fn): Return the call, don't expand it.
2282         * tree.c (add_stmt_to_compound): New fn.
2283         (stabilize_call): Use it.
2284
2285 2004-08-27  Richard Henderson  <rth@redhat.com>
2286
2287         * cp-tree.def (OFFSETOF_EXPR): New.
2288         * parser.c (cp_parser_builtin_offsetof): Either built an
2289         OFFSETOF_EXPR, or call fold_offsetof immediately.
2290         * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
2291
2292 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
2293
2294         * call.c (validate_conversion_obstack): Replace
2295         my_friendly_assert with gcc_assert or gcc_unreachable.
2296         (direct_reference_binding, merge_conversion_sequences,
2297         build_user_type_conversion_1, perform_overload_resolution,
2298         build_op_delete_call, enforce_access, call_builtin_trap,
2299         build_over_call, build_special_member_call, build_new_method_call,
2300         initialize_reference): Likewise.
2301         * class.c (build_base_path, build_primary_vtable, alter_access,
2302         check_bases, update_vtable_entry_for_fn, layout_empty_base,
2303         clone_function_decl, adjust_clone_args,
2304         type_requires_array_cookie, include_empty_classes,
2305         finish_struct_1, resolve_address_of_overloaded_function,
2306         instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
2307         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
2308         accumulate_vtbl_inits, build_vtbl_initializer,
2309         build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
2310         * cvt.c (build_up_reference, convert_to_reference): Likewise.
2311         * decl.c (poplevel, duplicate_decls, make_typename_type,
2312         cxx_init_decl_processing, reshape_init, check_initializer,
2313         make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
2314         expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
2315         grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
2316         xref_basetypes, start_preparsed_function, save_function_data,
2317         finish_function, finish_method, maybe_register_incomplete_var,
2318         complete_vars): Likewise.
2319         * decl2.c (grok_array_decl, check_member_template,
2320         check_classfn, finish_static_data_member_decl, coerce_new_type,
2321         coerce_delete_type, import_export_class, decl_needed_p,
2322         determine_visibility, import_export_decl, build_cleanup,
2323         start_static_initialization_or_destructi, do_static_destruction,
2324         prune_vars_needing_no_initialization,
2325         build_offset_ref_call_from_tree): Likewise.
2326         * error.c (dump_decl, dump_expr): Likewise.
2327         * init.c (finish_init_stmts, build_zero_init,
2328         expand_virtual_init, expand_default_init, expand_aggr_init_1,
2329         build_offset_ref, build_new_1, build_delete, build_vbase_delete):
2330         Likewise.
2331         * mangle.c (write_method_parms, write_template_args,
2332         write_expression, write_template_arg): Likewise.
2333         * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
2334         * name-lookup.c (pop_binding, begin_scope, leave_scope,
2335         resume_scope, push_using_decl, validate_nonmember_using_decl,
2336         is_ancestor, poplevel_class, set_inherited_value_binding_p,
2337         push_class_level_binding, do_class_using_decl, push_namespace,
2338         pop_namespace, add_using_namespace, ambiguous_decl,
2339         lookup_namespace_name, lookup_type_current_level,
2340         maybe_process_template_type_declaration): Likewise.
2341         * parser.c (cp_lexer_peek_nth_token,
2342         cp_parser_parse_and_diagnose_invalid_typ,
2343         cp_parser_translation_unit, cp_parser_template_id,
2344         cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
2345         * pt.c (push_access_scope, finish_member_template_decl,
2346         push_inline_template_parms_recursive, add_outermost_template_args,
2347         get_innermost_template_args, begin_explicit_instantiation,
2348         end_explicit_instantiation, retrieve_specialization,
2349         is_specialization_of, is_specialization_of_friend,
2350         register_specialization, check_explicit_specialization,
2351         comp_template_parms, process_template_parm,
2352         process_partial_specialization, convert_nontype_argument,
2353         coerce_template_template_parms, coerce_template_parms,
2354         mangle_class_name_for_template, lookup_template_function,
2355         lookup_template_class, instantiate_class_template, tsubst_decl,
2356         tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
2357         instantiate_template, fn_type_unification, type_unification_real,
2358         get_template_base, regenerate_decl_from_template,
2359         template_for_substitution, instantiate_decl,
2360         get_mostly_instantiated_function_type, dependent_scope_ref_p,
2361         value_dependent_expression_p, resolve_typename_type): Likewise.
2362         * repo.c (repo_emit_p): Likewise.
2363         * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
2364         create_tinfo_types, emit_tinfo_decl): Likewise.
2365         * search.c (lookup_base_r, lookup_base, lookup_field_1,
2366         dfs_access_in_type, build_baselink, lookup_member,
2367         adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
2368         * semantics.c (perform_or_defer_access_check,
2369         finish_non_static_data_member, finish_stmt_expr_expr,
2370         finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
2371         finish_template_template_parm, finish_member_declaration,
2372         emit_associated_thunks): Likewise.
2373         * tree.c (build_target_expr_with_type, force_target_expr,
2374         copy_binfo, get_first_fn, cp_tree_equal): Likewise.
2375         * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
2376         cxx_sizeof_or_alignof_type, perform_integral_promotions,
2377         build_class_member_access_expr, finish_class_member_access_expr,
2378         build_ptrmemfunc_access_expr, build_unary_op,
2379         unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
2380         build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
2381         * typeck2.c (complete_type_check_abstract,
2382         abstract_virtuals_error, process_init_constructor,
2383         add_exception_specifier): Likewise.
2384
2385 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
2386
2387         * class.c (build_vtbl_initializer): Use ssize_int.
2388         * decl.c (complete_array_type): Likewise.
2389         * method.c (finish_thunk): Likewise.
2390         * search.c (get_dynamic_base_type): Likewise.
2391
2392 2004-08-26  Richard Henderson  <rth@redhat.com>
2393
2394         * cp-tree.h (DECL_FIELD_IS_BASE): New.
2395         * class.c (build_base_field): Set it.
2396         (build_simple_base_path): Use it.
2397         (fixed_type_or_null): Don't consider base fields definitive.
2398
2399 2004-08-25  Roger Sayle  <roger@eyesopen.com>
2400
2401         PR middle-end/16693
2402         PR tree-optimization/16372
2403         * decl.c (finish_enum): Make the precision of the enumerated type
2404         the same width as the underlying integer type.
2405
2406 2004-08-25  Mark Mitchell  <mark@codesourcery.com>
2407
2408         PR c++/17155
2409         * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
2410         functions.
2411
2412         * mangle.c (get_identifier_nocopy): Add cast.
2413
2414         * cp-tree.h (mangle_type): Remove.
2415         * mangle.c (globals): GTY it.
2416         (mangle_obstack): New variable.
2417         (name_obstack): Likewise.
2418         (name_base): Likewise.
2419         (write_char): Adjust accordingly.
2420         (write_chars): Likewise.
2421         (write_string): Likewise.
2422         (start_mangling): Initialize G.substitutions only one.  Add
2423         ident_p parameter.
2424         (finish_mangling): Use VARRAY_CLEAR to reclaim
2425         storage in G.substitutions.  Use obstack_finish.
2426         (init_mangle): Adjust for changes to variable names above.
2427         Initialize G.substitutions.
2428         (mangle_decl_string): Adjust call to start_mangling.
2429         (get_identifier_nocopy): New function.
2430         (mangle_decl): Use it.
2431         (mangle_type_string): Adjust call to start_mangling.
2432         (mangle_special_for_type): Likewise.
2433         (mangle_vtt_for_type): Likewise.
2434         (mangle_ctor_vtbl_for_type): Likewise.
2435         (mangle_thunk): Likewise.
2436         (mangle_guard_variable): Likewise.
2437         (mangle_ref_init_variable): Likewise.
2438
2439 2004-08-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2440
2441         PR c++/14428
2442         * pt.c (redeclare_class_template): Check the type of non-type and
2443         template template parameter.
2444
2445 2004-08-25  Nathan Sidwell  <nathan@codesourcery.com>
2446
2447         * call.c (convert_class_to_reference): Adjust build_int_cst calls.
2448         (build_user_type_conversion_1, convert_like_real,
2449         build_java_interface_fn_ref, build_special_member_call): Likewise.
2450         * class.c (finish_struct_1, build_vtbl_initializer): Likewise.
2451         * cp-gimplify.c (cp_gimplify_expr): Likewise.
2452         * cvt.c (cp_convert_to_pointer): Likewise.
2453         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
2454         * decl2.c (start_static_initialization_or_destruction,
2455         generate_ctor_or_dtor_function): Likewise.
2456         * except.c (build_throw): Likewise.
2457         * mangle.c (write_integer_cst): Likewise.
2458         * method.c (finish_thunk): Likewise.
2459         * rtti.c (build_headof, get_tinfo_decl_dynamic,
2460         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
2461         get_pseudo_ti_init): Likewise.
2462         * search.c (get_dynamic_cast_base_type): Likewise.
2463
2464 2004-08-25  Zack Weinberg  <zack@codesourcery.com>
2465
2466         * class.c, search.c: Remove references to DWARF_DEBUG.
2467
2468 2004-08-25  Adam Nemet  <anemet@lnxw.com>
2469
2470         * repo.c (extract_string): Reset backquote after one character.
2471         (get_base_filename): Fix indentation.
2472
2473 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
2474
2475         * decl.c (cxx_init_decl_processing): Adjust
2476         build_common_tree_nodes call.
2477
2478 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
2479
2480         PR c++/16889
2481         * (is_subobject_of_p): Resurrect & optimize.
2482         (lookup_field_r): Use it.
2483
2484 2004-08-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2485
2486         PR c++/16706
2487         * search.c (friend_accessible_p): Increment processing_template_decl
2488         when deal with TEMPLATE_DECL of SCOPE.
2489
2490 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
2491
2492         PR c++/17149
2493         * semantics.c (check_accessibility_of_qualified_id): Defer check
2494         if qualifying_type is a template parameter.
2495
2496 2004-08-23  Mark Mitchell  <mark@codesourcery.com>
2497
2498         PR c++/17163
2499         * pt.c (instantiate_decl): Do not try to apply
2500         DECL_DECLARED_INLINED_P to a VAR_DECL.
2501
2502         * search.c (build_baselink): Fix typo in comment.
2503
2504 2004-08-22 Andrew Pinski  <apinski@apple.com>
2505
2506         Revert:
2507         2004-08-22  Andrew Pinski  <apinski@apple.com>
2508         PR c++/14029
2509         * typeck.c (build_unary_op): Use &a.b if the folded lowered
2510         expression is not constant.
2511
2512 2004-08-23  Nathan Sidwell  <nathan@codesourcery.com>
2513
2514         * name-lookup.c (pushdecl): Rename build_type_copy call.
2515         * tree.c (cp_build_qualified_type_real,
2516         build_exception_variant, handle_java_interface_attribute): Likewise.
2517
2518 2004-08-22  Andrew Pinski  <apinski@apple.com>
2519
2520         PR c++/14029
2521         * typeck.c (build_unary_op): Use &a.b if the folded lowered
2522         expression is not constant.
2523
2524 2004-08-20  Mark Mitchell  <mark@codesourcery.com>
2525
2526         PR c++/17121
2527         * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P.
2528
2529 2004-08-21  Joseph S. Myers  <jsm@polyomino.org.uk>
2530
2531         PR c++/17120
2532         * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for
2533         MODOP_EXPR.
2534
2535 2004-08-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2536
2537         * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION
2538         before calling comp_template_args.
2539
2540 2004-08-20  Nathan Sidwell  <nathan@codesourcery.com>
2541
2542         * class.c (build_vtbl_initializer): Use build_int_cst for
2543         negative size types.
2544         * decl.c (complete_array_type): Likewise.
2545         * method.c (finish_thunk): Likewise.
2546
2547 2004-08-20  Andreas Tobler  <a.tobler@schweiz.ch>
2548
2549         * tree.c: Remove unused mark_local_for_remap_r.
2550
2551 2004-08-19  Eric Christopher  <echristo@redhat.com>
2552
2553         * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
2554         * tree.c (cxx_unsave_expr_now): Delete.
2555         (cp_unsave_r): Ditto.
2556
2557 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
2558
2559         PR c++/15890
2560         * pt.c (push_template_decl_real): Disallow template allocation
2561         functions with fewer than two parameters.
2562
2563 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
2564
2565         * cp-tree.h (build_shared_int_cst): Remove.
2566         * tree.c (shared_int_cache): Remove.
2567         (build_shared_int_cst): Remove.
2568         * class.c (finish_struct_1): Use build_int_cst.
2569
2570 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
2571
2572         * decl.c (finish_enum): Do not copy value node early, copy
2573         later.
2574         * lex.c (cxx_init): Force null_node to be unique.
2575
2576 2004-08-19  Joseph S. Myers  <jsm@polyomino.org.uk>
2577
2578         PR c++/17041
2579         * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
2580         from input for MODOP_EXPR.
2581
2582 2004-08-18  Mark Mitchell  <mark@codesourcery.com>
2583
2584         * pt.c (dependent_template_p): Fix typo in commment.
2585
2586         PR c++/17068
2587         * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
2588         dependent.
2589
2590 2004-08-17  Mark Mitchell  <mark@codesourcery.com>
2591
2592         PR c++/16246
2593         * pt.c (unify): Tidy ARRAY_TYPE handling.  Make sure that non-type
2594         arguments have the same type as the corresponding parameter.
2595
2596         PR c++/16215
2597         * parser.c (cp_parser_name_lookup_error): If parser->object_scope
2598         is set use it for diagnostic purposes.
2599         (cp_parser_pseudo_destructor_name): Remove special-case error
2600         message.
2601
2602         PR c++/15871
2603         * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions.
2604
2605         PR c++/16965
2606         * cp-tree.h (qualified_name_lookup_error): Add parameter.
2607         * name-lookup.c (do_class_using_decl): Restrict set of entities
2608         passed to cp_emit_debug_info_for_using more carefully.
2609         (lookup_qualified_name): Allow lookup_member to return sets of
2610         ambiguous entries.
2611         * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter.
2612         (cp_parser_primary_expression): Handle ambiguous lookups.
2613         (cp_parser_template_name): Adjust use of cp_parser_lookup_name.
2614         (cp_parser_template_argument): Likewise.
2615         (cp_parser_elaborate_type_specifier): Likewise.
2616         (cp_parser_namespace_name): Likewise.
2617         (cp_parser_class_name): Likewise.
2618         (cp_parser_lookup_name_simple): Likewise.
2619         * pt.c (tsubst_qualified_id): Handle ambiguous results.
2620         (tsubst_expr): Likewise.
2621         * semantics.c (qualified_name_lookup_error): Add decl paramter.
2622         For ambiguous lookups, print candidates.
2623
2624 2004-08-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2625
2626         PR c++/6749
2627         * pt.c (instantiate_pending_templates): Add int parameter.  Don't
2628         return anything.
2629         * cp-tree.h (instantiate_pending_templates): Adjust prototype.
2630         * decl2.c (finish_file): Adjust call to
2631         instantiate_pending_templates.
2632
2633 2004-08-15  Roger Sayle  <roger@eyesopen.com>
2634
2635         * call.c (build_vfield_ref, build_call, build_conditional_expr,
2636         convert_arg_to_ellipsis, build_x_va_arg, build_over_call,
2637         build_java_interface_fn_ref, build_special_member_call,
2638         build_new_method_call, initialize_reference): Replace calls to
2639         build with calls to buildN.
2640         * class.c (build_base_path, convert_to_base_statically,
2641         build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits,
2642         build_vtbl_initializer): Likewise.
2643         * cp-gimplify.c (genericize_try_block, genericize_catch_block,
2644         gimplify_if_stmt, cp_genericize_r): Likewise.
2645         * cvt.c (convert_to_void): Likewise.
2646         * decl.c (check_initializer, finish_constructor_body,
2647         finish_destructor_body): Likewise.
2648         * error.c (dump_expr): Likewise.
2649         * except.c (build_exc_ptr, expand_start_catch_block, build_throw):
2650         Likewise.
2651         * init.c (perform_member_init, expand_virtual_init,
2652         expand_cleanup_for_base, build_init, expand_default_init,
2653         build_offset_ref, decl_constant_value, build_new, build_new_1,
2654         build_vec_delete_1, build_vec_init, build_delete,
2655         push_base_cleanups, build_vec_delete): Likewise.
2656         * mangle.c (write_integer_cst): Likewise.
2657         * method.c (thunk_adjust, do_build_copy_constructor,
2658         do_build_assign_ref): Likewise.
2659         * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build,
2660         unify, build_non_dependent_expr): Likewise.
2661         * rtti.c (build_headof, build_typeid, ifnonnull,
2662         build_dyanmic_cast_1, tinfo_base_init): Likewise.
2663         * semantics.c (begin_compound_stmt, finish_call_expr,
2664         finish_pseudo_destructor_expr, finish_id_expression,
2665         simplify_aggr_init_expr, finalize_nrv_r): Likewise.
2666         * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top,
2667         array_type_nelts_total, stabilize_call): Likewise.
2668         * typeck.c (decay_conversion, build_class_member_access_expr,
2669         lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref,
2670         get_member_function_from_ptrfunc, build_binary_op, pointer_diff,
2671         build_x_unary_op, build_unary_op, unary_complex_lvalue,
2672         build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst,
2673         check_return_expr): Likewise.
2674         * typeck2.c (split_nonconstant_1, split_nonconstant_init_1,
2675         split_nonconstant_init, store_init_value, build_m_component_ref):
2676         Likewise.
2677
2678 2004-08-15  Nathan Sidwell  <nathan@codesourcery.com>
2679
2680         * call.c (convert_class_to_reference,
2681         build_user_type_conversion_1, convert_like_real,
2682         build_java_interface_fn_ref, build_special_member_call): Use
2683         build_int_cst.
2684         * class.c (build_vtbl_initializer): Likewise.
2685         * cp-gimplify.c (cp_gimplify_expr): Likewise.
2686         * cvt.c (cp_convert_to_pointer): Likewise.
2687         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
2688         * decl2.c (start_static_initialization_or_destruction,
2689         generate_ctor_or_dtor_function): Likewise.
2690         * except.c (build_throw): Likewise.
2691         * lex.c (cxx_init): Likewise.
2692         * mangle.c (write_integer_cst): Likewise.
2693         * rtti.c (build_headof, get_tinfo_decl_dynamic,
2694         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
2695         get_pseudo_ti_init): Likewise.
2696         * search.c (get_dynamic_cast_base_type): Likewise.
2697         * tree.c (build_shared_int_cst): Likewise.
2698
2699 2004-08-12  Mark Mitchell  <mark@codesourcery.com>
2700
2701         PR c++/16273
2702         * class.c (count_depth_data): New type.
2703         (dfs_depth_post): New function.
2704         (dfs_depth_q): Likewise.
2705         (find_final_overrider_data_s): Change type of vpath.
2706         Add vpath_list.
2707         (dfs_find_final_overrider_1): New function.
2708         (dfs_find_final_overrider): Use it.
2709         (dfs_find_final_overrider_q): Adjust use of vpath.
2710         (dfs_find_final_overrider_post): Likewise.
2711         (find_final_overrider): Use dfs_depth.  Allocate and deallocate
2712         vpath_list.
2713
2714 2004-08-12 Jan Beulich <jbeulich@novell.com>
2715
2716         * parser.c (cp_parser_asm_definition): Properly consume scope operator
2717         tokens preceding the clobbers. Don't check for scope operator
2718         following inputs. Simplify inputs handling to match that now used for
2719         clobbers.
2720
2721 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
2722
2723         PR c++/16698
2724         * except.c (build_throw): Allocate cleanup_type and the function
2725         for __cxa_throw separately.
2726
2727         PR c++/16853
2728         * call.c (standard_conversion): Do not accept conversions between
2729         pointers to members if the class types are unrelated.
2730
2731         PR c++/16618
2732         * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile
2733         char &" instead of just "char &".
2734
2735         PR c++/16870
2736         * pt.c (tsubst): Just return the unknown_type_node.
2737
2738 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
2739
2740         PR c++/16964
2741         * parser.c (cp_parser_class_specifier): Robustify.
2742
2743         PR c++/16904
2744         * pt.c (tsubst_copy_and_build): Complain about invalid
2745         qualification.
2746
2747         PR c++/16929
2748         * pt.c (tsubst_default_argument): Clear out current_class_ptr and
2749         current_class_ref while tsubsting.
2750
2751 2004-08-10  Mark Mitchell  <mark@codesourcery.com>
2752
2753         PR c++/16971
2754         * parser.c (cp_parser_init_declarator): Robustify.
2755
2756 2004-08-06  Richard Sandiford  <rsandifo@redhat.com>
2757
2758         * typeck2.c (process_init_constructor): Guard the missing field warning
2759         with warn_missing_field_initializers rather than extra_warnings.
2760
2761 2004-08-06  Paolo Bonzini  <bonzini@gnu.org>
2762
2763         * class.c (instantiate_type) <ENTRY_VALUE_EXPR>: Do not handle.
2764
2765 2004-08-05  Mark Mitchell  <mark@codesourcery.com>
2766
2767         * decl.c (start_preparsed_function): Move determine_visibility
2768         call.
2769         * decl2.c (determine_visibility): Incorporate dllexport testing.
2770
2771 2004-08-05  Geoffrey Keating  <geoffk@apple.com>
2772
2773         * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option
2774         means that libstdc++ is needed.
2775
2776 2004-08-05  Nathan Sidwell  <nathan@codesourcery.com>
2777
2778         * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call.
2779
2780 2004-08-04  Geoffrey Keating  <geoffk@apple.com>
2781
2782         * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
2783         than passing it as a parameter to rest_of_decl_compilation.
2784         * decl2.c (grokfield): Use set_user_assembler_name.
2785
2786 2004-08-04  Nathan Sidwell  <nathan@codesourcery.com>
2787
2788         * decl.c (complete_array_type): Don't gratuitously copy
2789         maxindex. Its type is always set.
2790
2791 2004-08-04  Paul Brook  <paul@codesourcery.com>
2792
2793         * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H.
2794         * cp-tree.h (struct language_function): Rename x_dtor_label to
2795         x_cdtor_label.
2796         (dtor_label): Rename ...
2797         (cdtor_label): ... to this.
2798         * decl.c (begin_constructor_body): Remove.
2799         (check_special_function_return_type): Maybe change the return type.
2800         (grokdeclarator): Pass the class type.
2801         (start_preparsed_function): Constructors may need a return label.
2802         (finish_constructor_body, finish_destructor_body): Set the return
2803         value.
2804         (begin_function_body): Don't call begin_constructor_body.
2805         (finish_function): Don't warn for constructors or destructors.
2806         (implicitly_declare_fn): Maybe change the return type.
2807         * optimize.c: Include target.h.
2808         (maybe_clone_body): Remap the function result.
2809         * semantics.c: Include target.h.
2810         (finish_return_stmt): Maybe jump to return label for constructors.
2811
2812 2004-08-03  Mark Mitchell  <mark@codesourcery.com>
2813
2814         * class.c (build_vtable): Do not set DECL_VISIBILITY here.
2815         (check_field_decls): Or here.
2816         (check_methods): Or here.
2817         (initialize_array): Don't mess with DECL_CONTEXT.
2818         * cp-tree.h (start_decl): Adjust prototype.
2819         (determine_visibility): New function.
2820         * decl.c (duplicate_decls): Remove checks for hidden "operator
2821         new".
2822         (build_library_fn_1): Give all library functions default
2823         visibility.
2824         (start_decl): Add pop_scope_p parameter.  Tidy.
2825         (cp_finish_decl): Do not pop scopes here.  Call
2826         determine_visibility for variable definitions.
2827         (start_preparsed_function): Call determine_visibility.
2828         * decl2.c (determine_visibility): New function.
2829         * method.c (use_thunk): Fix formatting.
2830         * parser.c (cp_parser_condition): Adjust calls to start_decl.
2831         (cp_parser_init_declarator): Likewise.
2832         * pt.c (instantiate_decl): Always call pop_nested_class.
2833         * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY.
2834         (tinfo_base_init): Likewise.
2835
2836 2004-08-02  Mark Mitchell  <mark@codesourcery.com>
2837
2838         PR c++/16707
2839         * name-lookup.c (validate_nonmember_using_decl): Robustify.
2840
2841 2004-08-01  Mark Mitchell  <mark@codesourcery.com>
2842
2843         PR c++/16224
2844         * name-lookup.c (decl_namespace): Remove.
2845         (current_decl_namespace): Use decl_namespace_context instead of
2846         decl_namespace.
2847         (push_decl_namespace): Likewise.
2848         (arg_assoc_class): Likewise.
2849         (arg_assoc_type): Likewise.
2850         * pt.c (check_specialization_namespace): New function.
2851         (maybe_process_partial_specialization): Use it.
2852         (register_specialization): Likewise.
2853
2854         PR c++/16489
2855         * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro.
2856         * call.c (null_ptr_cst_p): Handle variables with constant
2857         initializers.
2858         * pt.c (convert_nontype_argument): Use
2859         DECL_INTEGRAL_CONSTANT_VAR_P.
2860         * semantics.c (finish_id_expression): Likewise.
2861
2862         PR c++/16529
2863         * decl.c (duplicate_decls): Reject duplicate namespace
2864         declarations.
2865
2866         PR c++/16810
2867         * typeck.c (build_ptrmemfunc): Loosen assertion.
2868
2869 2004-08-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2870
2871         * call.c (z_candidate::template_decl): Rename from template.
2872         (add_template_candidate_real): Adjust member reference.
2873         (joust): Likewise.
2874
2875 2004-07-29  Mark Mitchell  <mark@codesourcery.com>
2876
2877         * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
2878         (lang_decl_flags): Narrow the width of "languages".  Add
2879         repo_available_p.
2880         (DECL_NEEDED_P): Remove.
2881         (FOR_EACH_CLONE): New macro.
2882         (DECL_REPO_AVAILABLE_P): Likewise.
2883         (DECL_TINFO_P): Likewise.
2884         (set_linkage_according_to_type): Declare.
2885         (import_export_vtable): Remove.
2886         (import_export_tinfo): Likewise.
2887         (mark_needed): New function.
2888         (decl_needed_p): Likewise.
2889         (note_vauge_linkage_fn): Likewise.
2890         (init_repo): Change prototype.
2891         (repo_template_used): Remove.
2892         (repo_template_instantiated): Likewise.
2893         (repo_emit_p): New function.
2894         (repo_export_class_p): Likewise.
2895         (no_linkage_check): Change prototype.
2896         * class.c (set_linkage_according_to_type): New function.
2897         (build_vtable): Use it.  Do not call import_export_vtable.  Set
2898         DECL_IGNORED_P if appropriate.
2899         * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
2900         (make_rtL_for_nonlocal_decls): Check for template instantiations
2901         explicitly.
2902         (grokfndecl): Adjust call to no_linkage_check.
2903         (set_linkage_for_static_data_member): New function.
2904         (grokvardecl): Use it.  Adjust call to no_linkage_check.
2905         (grokdeclarator): Use set_linkage_for_static_data_member.
2906         * decl2.c (note_vague_linkage_fn): New function.
2907         (note_vague_linkage_var): Likewise.
2908         (finish_static_data_member_decl): Use it.
2909         (import_export_vtable): Remove.
2910         (import_export_class): Use repo_export_class_p.
2911         (var_finalized_p): Simplify.
2912         (maybe_emit_vtables): Simplify.
2913         (mark_needed): New function.
2914         (decl_needed_p): Likewise.
2915         (import_export_decl): Add documentation and consistency checks.
2916         Use repo_emit_p.  Handle virtual tables and RTTI information
2917         here.
2918         (import_export_tinfo): Remove.
2919         (write_out_vars): Call import_export_decl.
2920         (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
2921         whenever one is.
2922         (finish_file): Use decl_needed_p.  Do not call import_export_decl
2923         for undefined static data members.  Do not warn about undefined
2924         inlines when using a repository.
2925         (mark_used): Use note_vague_linkage_fn.  Always defer template
2926         instantiations.
2927         * lex.c (cxx_init): Adjust call to init_repo.  Always set
2928         flag_unit_at_a-time.
2929         * method.c (synthesize_method): Remove unncessary
2930         import_export_decl call.
2931         (implicitly_declare_fn): Use set_linkage_according_to_type.
2932         * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
2933         * pt.c (instantiate_class_template): Don't redundantly add classes
2934         to keyed_classes.  Don't call repo_template_used.
2935         (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
2936         templates with internal linkage.
2937         (check_instantiated_args): Adjust call to no_linkage_check.
2938         (instantiate_template): Use FOR_EACH_CLONE.
2939         (mark_definable): New function.
2940         (mark_decl_instantiated): Use it.
2941         (do_decl_instantiation): Adjust tests for explicit instantiation
2942         after "extern template".
2943         (instantiate_class_member): Do not use repo_template_instantiated.
2944         (do_type_instantiation): Simplify.
2945         (instantiate_decl): Use mark_definable.  Check repo_emit_p.
2946         Simplify.
2947         * repo.c (repo_get_id): Remove.
2948         (original_repo): Remove.
2949         (IDENTIFIER_REPO_USED): Remove.
2950         (IDENTIFIER_REPO_CHOSEN): Remove.
2951         Remove all #if 0'd code.
2952         (repo_template_used): Remove.
2953         (repo_template_instantiated): Remove.
2954         (temporary_obstack_initialized_p): New variable.
2955         (init_repo): Register with lang_post_pch_load.  Avoid creating
2956         identifiers unnecessarily.  Don't use original_repo.  Close the
2957         file here.
2958         (reopen_repo_file_for_write): Not here.
2959         (finish_repo): Always write out a new repository file.
2960         (repo_emit_p): New function.
2961         (repo_export_class_p): Likewise.
2962         * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
2963         (involves_incomplete_p): New function.
2964         (tinfo_base_init): Use it.
2965         (ptr_initializer): Remove non_public_ptr parameter.
2966         (ptm_initializer): Likewise.
2967         (get_pseudo_ti_init): Likewise.
2968         (unemitted_tinfo_decl_p): Remove.
2969         (emit_tinfo_decl): Use import_export_decl.
2970         * semantics.c (expand_body): Move updates of static_ctors and
2971         static_dtors to ...
2972         (expand_or_defer_fn): ... here.
2973         * tree.c (no_linkage_check): Add relaxed_p parameter.
2974
2975 2004-07-28  Eric Christopher  <echristo@redhat.com>
2976
2977         * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
2978
2979 2004-07-28  Nathan Sidwell  <nathan@codesourcery.com>
2980
2981         * cp-tree.h (struct tree_pair_s): New.
2982         (typedef tree_pair_p): New.
2983         (DEF_VEC_O(tree_pair_s)): New.
2984         (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s).
2985         (CLASSTYPE_VCALL_INDICES): Update documentation.
2986         * class.c (get_vcall_index): Adjust.
2987         (add_vcall_offset): Adjust.
2988
2989 2004-07-27  Kelley Cook  <kcook@gcc.gnu.org>
2990
2991         * pt.c, typeck.c: Remove spurious carriage returns.
2992
2993 2004-07-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2994
2995         PR c++/14429
2996         * pt.c (coerce_template_template_parms) <PARM_DECL case>: Only check
2997         when the type of ARG is not dependent.
2998
2999 2004-07-26  Geoffrey Keating  <geoffk@apple.com>
3000
3001         * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
3002         (lang_specific_driver): If the C++ or math library options don't
3003         start with '-l', don't count them as added libraries.
3004
3005 2004-07-26  Nathan Sidwell  <nathan@codesourcery.com>
3006
3007         * decl.c (xref_basetypes): Adjust base access vector creation.
3008         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
3009         access accesses.
3010         * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.
3011
3012 2004-07-26  Niall Douglas  <s_fsfeurope2@nedprod.com>
3013             Brian Ryner  <bryner@brianryner.com>
3014
3015         PR c++/15000
3016         PR c++/9283
3017         * class.c (check_field_decls): Apply hidden visibility if
3018         -fvisibility-inlines-hidden and inlined unless otherwise specified
3019         (build_vtable): Set vtable visibility to class visibility.
3020         (check_field_decls): Default static member visibility to class
3021         visibility.
3022         (check_methods): Default method visibility to class visibility.
3023         * cp-tree.h: Added CLASSTYPE_VISIBILITY and
3024         CLASSTYPE_VISIBILITY_SPECIFIED macro.
3025         * decl.c (duplicate_decls): New logic for merging definition decls
3026         with declaration decls. Added ignore & warning when non default
3027         applied to global operator new or delete.
3028         * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
3029         wherever VISIBILITY was changed
3030         * rtti.c (get_tinfo_decl): Set typeinfo visibility to class
3031         visibility.
3032         (tinfo_base_init): Set typeinfo name visibility to class visibility.
3033
3034 2004-07-25  Bernardo Innocenti  <bernie@develer.com>
3035
3036         * decl.c: Rename all identifiers named `class' to `cl'.
3037         * cp-tree.h: Likewise.
3038
3039 2004-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3040
3041         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
3042         * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
3043         * name-lookup.c (binding_entry_make): Use GGC_NEW.
3044         (binding_table_construct): Use GGC_CNEWVEC.
3045         (binding_table_new): Use GGC_NEW.
3046         (cxx_binding_make): Likewise.
3047         (begin_scope): Likewise.
3048         (push_to_top_level): Use GCC_CNEW.
3049         * parser.c (cp_token_cache_new): Likewise.
3050         (cp_token_cache_push_token): Likewise.
3051         (cp_lexer_new_main): Likewise.
3052         (cp_lexer_new_from_tokens): Likewise.
3053         (cp_parser_context_new): Likewise.
3054         (cp_parser_new): Likewise.
3055         (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
3056         * lex.c (cxx_make_type): Use GGC_CNEW.
3057         (retrofit_lang_decl): Use GGC_NEWVAR.
3058         (cxx_dup_lang_specific_decl): Likewise.
3059         (copy_lang_type): Likewise.
3060         * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
3061         (save_function_data): Likewise.
3062         (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
3063         (cxx_push_function_context): Likewise.
3064
3065 2004-07-25  Richard Henderson  <rth@redhat.com>
3066
3067         * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
3068         DECL_IGNORED_P on RESULT_DECL.
3069         * semantics.c (finalize_nrv): Copy them too.
3070
3071 2004-07-23  Nathan Sidwell  <nathan@codesourcery.com>
3072
3073         * search.c (lookup_conversion_operator): Avoid two loops.
3074         (add_conversions): Remove.
3075         (check_hidden_convs, split_conversions,
3076         lookup_conversions_r):  New.
3077         (lookup_conversions): Use lookup_conversions_r.
3078
3079 2004-07-22  Nathan Sidwell  <nathan@codesourcery.com>
3080
3081         * pt.c (get_template_base): Check type is completable.
3082
3083 2004-07-21  Eric Christopher  <echristo@redhat.com>
3084
3085         * decl.c (poplevel): Inline unused variable checking.
3086         Change formatting.
3087
3088 2004-07-21  Paolo Bonzini  <bonzini@gnu.org>
3089
3090         * typeck.c (build_binary_op): Do not use RDIV_EXPR for
3091         integer vectors.
3092
3093 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3094
3095         PR c++/14497
3096         * pt.c (check_explicit_specialization): Remove extension to accept
3097         specializations without template headers. Fall-through to normal
3098         processing.
3099
3100 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3101
3102         PR c++/509
3103         * pt.c (determine_specialization): New parameter template_count.
3104         Disambiguate between member templates and member functions counting
3105         the template headers.
3106         (check_explicit_specialization): Update caller.
3107         (tsubst_friend_function): Likewise.
3108
3109 2004-07-20  Steven Bosscher  <stevenb@suse.de>
3110
3111         * cp-tree.def (TINST_LEVEL): Make it an 'x' node.
3112         * cp-tree.h (tinst_level_t): New tree type.
3113         (union lang_tree_node): Handle it.
3114         (TINST_LOCATION): New accessor macro.
3115         (make_tinst_level): New prototype.
3116         * cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
3117         * decl.c (cp_tree_node_structure): Likewise.
3118         * error.c (print_instantiation_full_context): Use TINST_LOCATION.
3119         (print_instantiation_partial_context): Likewise.
3120         * pt.c (pop_tinst_level): Likewise.
3121          (push_tinst_level): Use make_tinst_level.
3122         * tree.c (make_tinst_level): New function.
3123         (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.
3124
3125 2004-07-20  Mark Mitchell  <mark@codesourcery.com>
3126
3127         * parser.c (cp_parser_simple_type_specifier): Fix typo.
3128
3129         PR c++/16637
3130         * parser.c (cp_parser_simple_type_specifier): Do not record usage
3131         of globally-qualified names.
3132
3133 2004-07-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3134
3135         PR c++/16175
3136         * error.c (dump_type) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Output
3137         cv qualifier.
3138
3139 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3140
3141         PR c++/16623
3142         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
3143         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
3144         * class.c (add_implicitly_declared_members): Use
3145         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3146         * method.c (lazily_declare_fn): Clear
3147         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3148         * search.c (lookup_fnfields_1): Check it.
3149
3150 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
3151
3152         * cp-tree.h (vec_binfo_member): Remove.
3153         * tree.c (vec_binfo_member): Remove.
3154
3155         * cp-tree.h (struct lang_type_class): Remove vfields field.
3156         (CLASSTYPE_VFIELDS): Remove.
3157         (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
3158         * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
3159         handling.
3160         (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
3161         (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
3162         * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
3163
3164 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
3165
3166         * cp-tree.h (DEF_VEC_P(tree)): Remove here.
3167         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
3168         Moved to common.
3169         (BINFO_LANG_SLOTS): Remove.
3170         * tree.c (copy_binfo): Adjust BINFO creation and accessors.
3171         * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
3172         * class.c (check_bases): Adjust BINFO accessors.
3173         (determine_primary_base, finish_struct_bits,
3174         maybe_warn_about_overly_private_class, warn_hidden,
3175         walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
3176         warn_about_ambiguous_bases, get_vfield_name,
3177         dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
3178         add_vcall_offset_vtbl_entries_r): Likewise.
3179         * dump.c (cp_dump_tree): Likewise.
3180         * init.c (sort_mem_initializers, expand_member_init, build_delete,
3181         push_base_cleanups): Likewise.
3182         * method.c (do_build_copy_constructor, do_build_assign_ref,
3183         synthesize_exception_spec): Likewise.
3184         name-lookup.c (arg_assoc_class): Likewise.
3185         * pt.c (instantiate_class_template,
3186         get_template_base_recursive): Likewise.
3187         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
3188         * typeck2.c (process_init_constructor): Likewise.
3189         * search.c (lookup_base_r, dynamic_cast_base_recurse,
3190         dfs_access_in_type, dfs_walk_real, look_for_overrides,
3191         types_overlap_p, copied_binfo, original_binfo): Likewise.
3192         (binfo_for_vtable): Remove
3193
3194 2004-07-20  Steven Bosscher  <stevenb@suse.de>
3195
3196         * cp-tree.h (struct lang_decl_flags): Unify the template_info and
3197         thunk_alias, and the access and virtual_offset fields.
3198         (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
3199         * decl.c (finish_case_label): Update c_add_case_node call.
3200
3201 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3202
3203         Revert patch for PR c++/16623.
3204
3205 2004-07-19  Kelley Cook  <kcook@gcc.gnu.org>
3206
3207         * except.c: Remove two spurious carriage returns.
3208
3209 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3210
3211         PR c++/16623
3212         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
3213         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
3214         * class.c (add_implicitly_declared_members): Use
3215         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3216         * method.c (lazily_declare_fn): Clear
3217         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3218         * search.c (lookup_fnfields_1): Check it.
3219
3220 2004-07-19  Nathan Sidwell  <nathan@codesourcery.com>
3221
3222         * class.c (add_method): Delay adding the slot until the end.
3223         (determine_primary_base): Adjust VEC_iterate invokation.
3224         (resort_type_method_vec, finish_struct_methods, warn_hidden,
3225         walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
3226         build_vtbl_initializer): Likewise.
3227         * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
3228         build_vbase_delete): Likewise.
3229         * method.c (do_build_copy_constructor): Likewise.
3230         * name-lookup.c (new_class_binding, print_binding_level,
3231         poplevel_class, store_class_bindings, push_to_top_level,
3232         pop_from_top_level): Likewise.
3233         * pt.c (check_explicit_specialization): Likewise.
3234         * search.c (lookup_conversion_operator, lookup_fnfields_1,
3235         get_pure_virtuals, add_conversions, dfs_check_overlap,
3236         binfo_for_vbase): Likewise.
3237
3238 2004-07-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3239
3240         PR c++/12170
3241         * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
3242         innermost set of template arguments during deduction.  Simplify.
3243
3244 2004-07-19  Joseph S. Myers  <jsm@polyomino.org.uk>
3245
3246         * typeck.c (build_modify_expr, build_x_modify_expr): Set
3247         TREE_NO_WARNING on assignments with an operator other than '='.
3248
3249 2004-07-10  Steven Bosscher  <stevenb@suse.de>
3250             Joseph S. Myers  <jsm@polyomino.org.uk>
3251
3252         * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
3253         * decl2.c (grokfield): Don't check current_class_depth via
3254         unused TREE_COMPLEXITY.
3255         * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
3256         to avoid the missing parentheses warning.
3257         Don't set C_SET_EXP_ORIGINAL_CODE.
3258
3259 2004-07-18  Mark Mitchell  <mark@codesourcery.com>
3260
3261         * tree.c (no_linkage_helper): Remove.
3262         (no_linkage_check): Don't use walk_tree_without_duplicates.
3263
3264         * mangle.c (write_expression): Issue a sorry for zero-operand
3265         functional casts.
3266
3267 2004-07-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3268
3269         PR c++/13092
3270         * init.c (build_offset_ref): Build SCOPE_REF with non-null
3271         TREE_TYPE for non-dependent names.
3272         * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
3273         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
3274         unknown_type_node as its TREE_TYPE.
3275         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
3276         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
3277         (dump_expr) <SCOPE_REF case>: Likewise.
3278
3279 2004-07-17  Jason Merrill  <jason@redhat.com>
3280
3281         PR c++/16115
3282         * call.c (type_passed_as): Make the invisible reference type
3283         __restrict.
3284         * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
3285         cp_genericize_r.  Handle invisible reference lowering.
3286         (is_invisiref_parm): New fn.
3287         (cp_genericize): Adjust the types of invisible reference parms.
3288         Don't repeat the walk for clones.
3289         * decl.c (store_parm_decls): Don't generate any code for clones.
3290
3291 2004-07-17  Joseph S. Myers  <jsm@polyomino.org.uk>
3292
3293         * cp-tree.h (builtin_function): Declare.
3294
3295 2004-07-16  Mark Mitchell  <mark@codesourcery.com>
3296
3297         * class.c (finish_struct_methods): Remove unncessary code.
3298         (add_implicitly_declared_members): Create declarations for default
3299         constructors and copy constructors lazily.
3300         * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
3301         lazy_copy_ctor.
3302         (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
3303         (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
3304         * decl2.c (check_classfn): Robustify.
3305         (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
3306         (locate_ctor): Handle lazy default constructors.
3307         (locate_copy): Handle lazy copy constructors.
3308         (implicitly_declare_fn): Make sure we're looking at the
3309         TYPE_MAIN_VARIANT for a class before creating functions.  Don't
3310         set TYPE_HAS_CONSTRUCTOR.
3311         (lazily_declare_fn): New function.
3312         * name-lookup.c (constructor_name_full): Simplify.
3313         * search.c (lookup_fnfields_1): Lazily create methods, as
3314         necessary.
3315         (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
3316
3317 2004-07-16  Steven Bosscher  <stevenb@suse.de>
3318
3319         * cp-tree.h (struct lang_type): Don't have three GTY options on a
3320         single bit GTY desc.
3321
3322 2004-07-16  Richard Henderson  <rth@redhat.com>
3323
3324         * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
3325         * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
3326         * tree.c (cp_copy_res_decl_for_inlining): Remove.
3327
3328 2004-07-16  Nathan Sidwell  <nathan@codesourcery.com>
3329
3330         * class.c (finish_struct_bits): Use for loop.
3331         (propagate_binfo_offsets): Do primary binfo outside of loop.
3332
3333         PR c++/16583
3334         * dump.c (cp_dump_tree): Don't dump the bases if there's no
3335         binfo.
3336
3337         * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
3338
3339 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
3340
3341         * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
3342         has_abstract_assign_ref.  Make methods a VEC(tree) *.
3343         (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
3344         (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
3345         (CLASSTYPE_DESTRUCTORS): Likewise.
3346         (TYPE_HAS_REAL_ASSIGN_REF): Remove.
3347         (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
3348         (add_method): Change prototoype.
3349         * class.c (add_method): Remove error_p parameter.  Adjust for
3350         changes to CLASSTYPE_METHOD_VEC.
3351         (handle_using_decl): Adjust call to add_method.
3352         (maybe_warn_about_overly_private_class): Adjust for
3353         changes to CLASSTYPE_METHOD_VEC.
3354         (resort_type_method_vec): Likewise.
3355         (finish_struct_methods): Likewise.
3356         (check_for_override): Likewise.
3357         (warn_hidden): Likewise.
3358         (add_implicitly_declared_members): Defer creation of assignment
3359         operators.  Adjust call to add_method.
3360         (clone_function_decl): Adjust call to add_method.
3361         (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
3362         (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
3363         * decl.c (grok_special_member_properties): Don't set
3364         TYPE_HAS_ABSTRACT_ASSIGN_REF.
3365         * decl2.c (check_classfn): Adjust for
3366         changes to CLASSTYPE_METHOD_VEC.
3367         * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
3368         (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
3369         (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
3370         (implicitly_declare_fn): Set DECL_SOURCE_LOCATION.  Do not call
3371         cp_finish_decl.
3372         * pt.c (check_explicit_specialization): Adjust for
3373         changes to CLASSTYPE_METHOD_VEC.
3374         (instantiate_class_template): Do not set
3375         TYPE_HAS_ABSTRACT_ASSIGN_REF.
3376         * ptree.c (cxx_print_type): Don't try to print
3377         CLASSTYPE_METHOD_VEC.
3378         * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
3379         * search.c (lookup_field_r): Adjust for
3380         changes to CLASSTYPE_METHOD_VEC.
3381         (lookup_fnfields): Likewise.
3382         (lookup_conversion_operator): Likewise.
3383         (lookup_fnfields_1): Likewise.  Create assignment operators
3384         lazily.
3385         (look_for_overrides_here): Adjust for
3386         changes to CLASSTYPE_METHOD_VEC.
3387         (add_conversions): Likewise.
3388         * semantics.c (finish_member_declaration): Adjust call to add_method.
3389
3390 2004-07-15  Jason Merrill  <jason@redhat.com>
3391
3392         * cp-lang.c (cxx_types_compatible_p): To the middle-end,
3393         references and pointers are compatible.
3394
3395 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
3396
3397         * decl.c (xref_basetypes): Refactor.
3398         * tree.c (copy_base_binfos): Replace with ...
3399         (copy_binfo): ... this. Deep copy the given binfo, (not the just
3400         bases of the given base).
3401         * cp-tree.h (copy_base_binfo): Remove.
3402         (copy_binfo): Declare.
3403
3404 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
3405
3406         * name-lookup.c (set_inherited_value_binding_p): Add class_type
3407         parameter.
3408         (get_class_binding): Adjust.