OSDN Git Service

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