OSDN Git Service

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