OSDN Git Service

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