OSDN Git Service

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