OSDN Git Service

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