OSDN Git Service

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