OSDN Git Service

b3d0f6897af3763371a101659be7aa466d79beaa
[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
3421         visibility.
3422         (check_methods): Default method visibility to class visibility.
3423         * cp-tree.h: Added CLASSTYPE_VISIBILITY and
3424         CLASSTYPE_VISIBILITY_SPECIFIED macro.
3425         * decl.c (duplicate_decls): New logic for merging definition decls
3426         with declaration decls. Added ignore & warning when non default
3427         applied to global operator new or delete.
3428         * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
3429         wherever VISIBILITY was changed
3430         * rtti.c (get_tinfo_decl): Set typeinfo visibility to class
3431         visibility.
3432         (tinfo_base_init): Set typeinfo name visibility to class visibility.
3433
3434 2004-07-25  Bernardo Innocenti  <bernie@develer.com>
3435
3436         * decl.c: Rename all identifiers named `class' to `cl'.
3437         * cp-tree.h: Likewise.
3438
3439 2004-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3440
3441         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
3442         * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
3443         * name-lookup.c (binding_entry_make): Use GGC_NEW.
3444         (binding_table_construct): Use GGC_CNEWVEC.
3445         (binding_table_new): Use GGC_NEW.
3446         (cxx_binding_make): Likewise.
3447         (begin_scope): Likewise.
3448         (push_to_top_level): Use GCC_CNEW.
3449         * parser.c (cp_token_cache_new): Likewise.
3450         (cp_token_cache_push_token): Likewise.
3451         (cp_lexer_new_main): Likewise.
3452         (cp_lexer_new_from_tokens): Likewise.
3453         (cp_parser_context_new): Likewise.
3454         (cp_parser_new): Likewise.
3455         (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
3456         * lex.c (cxx_make_type): Use GGC_CNEW.
3457         (retrofit_lang_decl): Use GGC_NEWVAR.
3458         (cxx_dup_lang_specific_decl): Likewise.
3459         (copy_lang_type): Likewise.
3460         * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
3461         (save_function_data): Likewise.
3462         (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
3463         (cxx_push_function_context): Likewise.
3464
3465 2004-07-25  Richard Henderson  <rth@redhat.com>
3466
3467         * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
3468         DECL_IGNORED_P on RESULT_DECL.
3469         * semantics.c (finalize_nrv): Copy them too.
3470
3471 2004-07-23  Nathan Sidwell  <nathan@codesourcery.com>
3472
3473         * search.c (lookup_conversion_operator): Avoid two loops.
3474         (add_conversions): Remove.
3475         (check_hidden_convs, split_conversions,
3476         lookup_conversions_r):  New.
3477         (lookup_conversions): Use lookup_conversions_r.
3478
3479 2004-07-22  Nathan Sidwell  <nathan@codesourcery.com>
3480
3481         * pt.c (get_template_base): Check type is completable.
3482
3483 2004-07-21  Eric Christopher  <echristo@redhat.com>
3484
3485         * decl.c (poplevel): Inline unused variable checking.
3486         Change formatting.
3487
3488 2004-07-21  Paolo Bonzini  <bonzini@gnu.org>
3489
3490         * typeck.c (build_binary_op): Do not use RDIV_EXPR for
3491         integer vectors.
3492
3493 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3494
3495         PR c++/14497
3496         * pt.c (check_explicit_specialization): Remove extension to accept
3497         specializations without template headers. Fall-through to normal
3498         processing.
3499
3500 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3501
3502         PR c++/509
3503         * pt.c (determine_specialization): New parameter template_count.
3504         Disambiguate between member templates and member functions counting
3505         the template headers.
3506         (check_explicit_specialization): Update caller.
3507         (tsubst_friend_function): Likewise.
3508
3509 2004-07-20  Steven Bosscher  <stevenb@suse.de>
3510
3511         * cp-tree.def (TINST_LEVEL): Make it an 'x' node.
3512         * cp-tree.h (tinst_level_t): New tree type.
3513         (union lang_tree_node): Handle it.
3514         (TINST_LOCATION): New accessor macro.
3515         (make_tinst_level): New prototype.
3516         * cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
3517         * decl.c (cp_tree_node_structure): Likewise.
3518         * error.c (print_instantiation_full_context): Use TINST_LOCATION.
3519         (print_instantiation_partial_context): Likewise.
3520         * pt.c (pop_tinst_level): Likewise.
3521          (push_tinst_level): Use make_tinst_level.
3522         * tree.c (make_tinst_level): New function.
3523         (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.
3524
3525 2004-07-20  Mark Mitchell  <mark@codesourcery.com>
3526
3527         * parser.c (cp_parser_simple_type_specifier): Fix typo.
3528
3529         PR c++/16637
3530         * parser.c (cp_parser_simple_type_specifier): Do not record usage
3531         of globally-qualified names.
3532
3533 2004-07-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3534
3535         PR c++/16175
3536         * error.c (dump_type) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Output
3537         cv qualifier.
3538
3539 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3540
3541         PR c++/16623
3542         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
3543         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
3544         * class.c (add_implicitly_declared_members): Use
3545         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3546         * method.c (lazily_declare_fn): Clear
3547         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3548         * search.c (lookup_fnfields_1): Check it.
3549
3550 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
3551
3552         * cp-tree.h (vec_binfo_member): Remove.
3553         * tree.c (vec_binfo_member): Remove.
3554
3555         * cp-tree.h (struct lang_type_class): Remove vfields field.
3556         (CLASSTYPE_VFIELDS): Remove.
3557         (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
3558         * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
3559         handling.
3560         (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
3561         (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
3562         * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
3563
3564 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
3565
3566         * cp-tree.h (DEF_VEC_P(tree)): Remove here.
3567         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
3568         Moved to common.
3569         (BINFO_LANG_SLOTS): Remove.
3570         * tree.c (copy_binfo): Adjust BINFO creation and accessors.
3571         * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
3572         * class.c (check_bases): Adjust BINFO accessors.
3573         (determine_primary_base, finish_struct_bits,
3574         maybe_warn_about_overly_private_class, warn_hidden,
3575         walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
3576         warn_about_ambiguous_bases, get_vfield_name,
3577         dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
3578         add_vcall_offset_vtbl_entries_r): Likewise.
3579         * dump.c (cp_dump_tree): Likewise.
3580         * init.c (sort_mem_initializers, expand_member_init, build_delete,
3581         push_base_cleanups): Likewise.
3582         * method.c (do_build_copy_constructor, do_build_assign_ref,
3583         synthesize_exception_spec): Likewise.
3584         name-lookup.c (arg_assoc_class): Likewise.
3585         * pt.c (instantiate_class_template,
3586         get_template_base_recursive): Likewise.
3587         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
3588         * typeck2.c (process_init_constructor): Likewise.
3589         * search.c (lookup_base_r, dynamic_cast_base_recurse,
3590         dfs_access_in_type, dfs_walk_real, look_for_overrides,
3591         types_overlap_p, copied_binfo, original_binfo): Likewise.
3592         (binfo_for_vtable): Remove
3593
3594 2004-07-20  Steven Bosscher  <stevenb@suse.de>
3595
3596         * cp-tree.h (struct lang_decl_flags): Unify the template_info and
3597         thunk_alias, and the access and virtual_offset fields.
3598         (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
3599         * decl.c (finish_case_label): Update c_add_case_node call.
3600
3601 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3602
3603         Revert patch for PR c++/16623.
3604
3605 2004-07-19  Kelley Cook  <kcook@gcc.gnu.org>
3606
3607         * except.c: Remove two spurious carriage returns.
3608
3609 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
3610
3611         PR c++/16623
3612         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
3613         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
3614         * class.c (add_implicitly_declared_members): Use
3615         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3616         * method.c (lazily_declare_fn): Clear
3617         CLASSTYPE_LAZY_ASSIGNMENT_OP.
3618         * search.c (lookup_fnfields_1): Check it.
3619
3620 2004-07-19  Nathan Sidwell  <nathan@codesourcery.com>
3621
3622         * class.c (add_method): Delay adding the slot until the end.
3623         (determine_primary_base): Adjust VEC_iterate invokation.
3624         (resort_type_method_vec, finish_struct_methods, warn_hidden,
3625         walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
3626         build_vtbl_initializer): Likewise.
3627         * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
3628         build_vbase_delete): Likewise.
3629         * method.c (do_build_copy_constructor): Likewise.
3630         * name-lookup.c (new_class_binding, print_binding_level,
3631         poplevel_class, store_class_bindings, push_to_top_level,
3632         pop_from_top_level): Likewise.
3633         * pt.c (check_explicit_specialization): Likewise.
3634         * search.c (lookup_conversion_operator, lookup_fnfields_1,
3635         get_pure_virtuals, add_conversions, dfs_check_overlap,
3636         binfo_for_vbase): Likewise.
3637
3638 2004-07-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3639
3640         PR c++/12170
3641         * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
3642         innermost set of template arguments during deduction.  Simplify.
3643
3644 2004-07-19  Joseph S. Myers  <jsm@polyomino.org.uk>
3645
3646         * typeck.c (build_modify_expr, build_x_modify_expr): Set
3647         TREE_NO_WARNING on assignments with an operator other than '='.
3648
3649 2004-07-10  Steven Bosscher  <stevenb@suse.de>
3650             Joseph S. Myers  <jsm@polyomino.org.uk>
3651
3652         * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
3653         * decl2.c (grokfield): Don't check current_class_depth via
3654         unused TREE_COMPLEXITY.
3655         * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
3656         to avoid the missing parentheses warning.
3657         Don't set C_SET_EXP_ORIGINAL_CODE.
3658
3659 2004-07-18  Mark Mitchell  <mark@codesourcery.com>
3660
3661         * tree.c (no_linkage_helper): Remove.
3662         (no_linkage_check): Don't use walk_tree_without_duplicates.
3663
3664         * mangle.c (write_expression): Issue a sorry for zero-operand
3665         functional casts.
3666
3667 2004-07-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3668
3669         PR c++/13092
3670         * init.c (build_offset_ref): Build SCOPE_REF with non-null
3671         TREE_TYPE for non-dependent names.
3672         * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
3673         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
3674         unknown_type_node as its TREE_TYPE.
3675         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
3676         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
3677         (dump_expr) <SCOPE_REF case>: Likewise.
3678
3679 2004-07-17  Jason Merrill  <jason@redhat.com>
3680
3681         PR c++/16115
3682         * call.c (type_passed_as): Make the invisible reference type
3683         __restrict.
3684         * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
3685         cp_genericize_r.  Handle invisible reference lowering.
3686         (is_invisiref_parm): New fn.
3687         (cp_genericize): Adjust the types of invisible reference parms.
3688         Don't repeat the walk for clones.
3689         * decl.c (store_parm_decls): Don't generate any code for clones.
3690
3691 2004-07-17  Joseph S. Myers  <jsm@polyomino.org.uk>
3692
3693         * cp-tree.h (builtin_function): Declare.
3694
3695 2004-07-16  Mark Mitchell  <mark@codesourcery.com>
3696
3697         * class.c (finish_struct_methods): Remove unncessary code.
3698         (add_implicitly_declared_members): Create declarations for default
3699         constructors and copy constructors lazily.
3700         * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
3701         lazy_copy_ctor.
3702         (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
3703         (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
3704         * decl2.c (check_classfn): Robustify.
3705         (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
3706         (locate_ctor): Handle lazy default constructors.
3707         (locate_copy): Handle lazy copy constructors.
3708         (implicitly_declare_fn): Make sure we're looking at the
3709         TYPE_MAIN_VARIANT for a class before creating functions.  Don't
3710         set TYPE_HAS_CONSTRUCTOR.
3711         (lazily_declare_fn): New function.
3712         * name-lookup.c (constructor_name_full): Simplify.
3713         * search.c (lookup_fnfields_1): Lazily create methods, as
3714         necessary.
3715         (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
3716
3717 2004-07-16  Steven Bosscher  <stevenb@suse.de>
3718
3719         * cp-tree.h (struct lang_type): Don't have three GTY options on a
3720         single bit GTY desc.
3721
3722 2004-07-16  Richard Henderson  <rth@redhat.com>
3723
3724         * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
3725         * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
3726         * tree.c (cp_copy_res_decl_for_inlining): Remove.
3727
3728 2004-07-16  Nathan Sidwell  <nathan@codesourcery.com>
3729
3730         * class.c (finish_struct_bits): Use for loop.
3731         (propagate_binfo_offsets): Do primary binfo outside of loop.
3732
3733         PR c++/16583
3734         * dump.c (cp_dump_tree): Don't dump the bases if there's no
3735         binfo.
3736
3737         * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
3738
3739 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
3740
3741         * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
3742         has_abstract_assign_ref.  Make methods a VEC(tree) *.
3743         (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
3744         (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
3745         (CLASSTYPE_DESTRUCTORS): Likewise.
3746         (TYPE_HAS_REAL_ASSIGN_REF): Remove.
3747         (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
3748         (add_method): Change prototoype.
3749         * class.c (add_method): Remove error_p parameter.  Adjust for
3750         changes to CLASSTYPE_METHOD_VEC.
3751         (handle_using_decl): Adjust call to add_method.
3752         (maybe_warn_about_overly_private_class): Adjust for
3753         changes to CLASSTYPE_METHOD_VEC.
3754         (resort_type_method_vec): Likewise.
3755         (finish_struct_methods): Likewise.
3756         (check_for_override): Likewise.
3757         (warn_hidden): Likewise.
3758         (add_implicitly_declared_members): Defer creation of assignment
3759         operators.  Adjust call to add_method.
3760         (clone_function_decl): Adjust call to add_method.
3761         (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
3762         (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
3763         * decl.c (grok_special_member_properties): Don't set
3764         TYPE_HAS_ABSTRACT_ASSIGN_REF.
3765         * decl2.c (check_classfn): Adjust for
3766         changes to CLASSTYPE_METHOD_VEC.
3767         * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
3768         (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
3769         (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
3770         (implicitly_declare_fn): Set DECL_SOURCE_LOCATION.  Do not call
3771         cp_finish_decl.
3772         * pt.c (check_explicit_specialization): Adjust for
3773         changes to CLASSTYPE_METHOD_VEC.
3774         (instantiate_class_template): Do not set
3775         TYPE_HAS_ABSTRACT_ASSIGN_REF.
3776         * ptree.c (cxx_print_type): Don't try to print
3777         CLASSTYPE_METHOD_VEC.
3778         * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
3779         * search.c (lookup_field_r): Adjust for
3780         changes to CLASSTYPE_METHOD_VEC.
3781         (lookup_fnfields): Likewise.
3782         (lookup_conversion_operator): Likewise.
3783         (lookup_fnfields_1): Likewise.  Create assignment operators
3784         lazily.
3785         (look_for_overrides_here): Adjust for
3786         changes to CLASSTYPE_METHOD_VEC.
3787         (add_conversions): Likewise.
3788         * semantics.c (finish_member_declaration): Adjust call to add_method.
3789
3790 2004-07-15  Jason Merrill  <jason@redhat.com>
3791
3792         * cp-lang.c (cxx_types_compatible_p): To the middle-end,
3793         references and pointers are compatible.
3794
3795 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
3796
3797         * decl.c (xref_basetypes): Refactor.
3798         * tree.c (copy_base_binfos): Replace with ...
3799         (copy_binfo): ... this. Deep copy the given binfo, (not the just
3800         bases of the given base).
3801         * cp-tree.h (copy_base_binfo): Remove.
3802         (copy_binfo): Declare.
3803
3804 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
3805
3806         * name-lookup.c (set_inherited_value_binding_p): Add class_type
3807         parameter.
3808         (get_class_binding): Adjust.
3809         (push_class_level_binding): Don't use set_inherited_value_binding_p.
3810
3811 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
3812
3813         * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
3814         * decl.c (xref_basetypes): Set it here.
3815
3816         * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here.
3817         Don't check for incomplete base.
3818         (get_vfield_name): Simplify while loop.
3819         * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here.
3820
3821 2004-07-14  Mark Mitchell  <mark@codesourcery.com>
3822
3823         * lex.c (cxx_make_type): Remove call to get_pointer_type.
3824
3825         * cp-tree.h (IDENTIFIER_VALUE): Remove.
3826         (BINFO_PUSHDECLS_MARKED): Likewise.
3827         (maybe_inject_for_scope_var): Likewise.
3828         (push_class_decls): Likewise.
3829         * name-lookup.h (push_class_binding): Remove.
3830         (innermost_non_namespace_value): New function.
3831         (outer_binding): Likewise.
3832         * class.c (add_method): Push bindings before adding to
3833         TYPE_METHODS.
3834         (restore_class_cache): Do not restore class_shadowed.
3835         (pushclass): Do not add USING_DECLs.  Do not call
3836         push_class_decls.
3837         * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c.
3838         * decl.c (pushdecl): Use outer_binding.
3839         (poplevel): Set the scope for an out-of-scope for-loop declaration
3840         appropriately.
3841         (cp_finish_decl): Don't call maybe_inject_for_scope_var.
3842         * name-lookup.c (new_class_binding): New function.
3843         (push_binding): Use it.
3844         (pushdecl): Use innermost_non_namespace_value.
3845         (maybe_inject_for_scope_var): Remove.
3846         (push_class_binding): Remove.
3847         (set_inherited_value_binding_p): New function.
3848         (get_class_binding): New function.
3849         (push_class_level_binding): Assert that the current_class_type is
3850         being defined.
3851         (outer_binding): New function.
3852         (innermost_non_namespace_value): Likewise.
3853         (lookup_name_real): Use outer_binding.
3854         (lookup_name_current_level): Ignore out-of-scope variables.
3855         * pt.c (check_template_shadow): Use innermost_non_namespace_value.
3856         (lookup_template_class): Likewise.
3857         * search.c (dfs_push_type_decls): Remove.
3858         (dfs_push_decls): Likewise.
3859         (setup_class_bindings): Likewise.
3860         (lookup_field_1): Handle USING_DECLs from dependent scopes.
3861         (marked_pushdecls_p): Remove.
3862         (unmarked_pushdecls_p): Remove.
3863         (marked_identifiers): Remove.
3864         (setup_class_bindings): Remove.
3865         (dfs_push_type_decls): Remove.
3866         (dfs_push_decls): Remove.
3867         (push_class_decls): Remove.
3868
3869 2004-07-13  Mark Mitchell  <mark@codesourcery.com>
3870
3871         PR c++/16518
3872         PR c++/16337
3873         * decl.c (grokvardecl): Make declspecs parameter const.
3874         (grokdeclarator): Likewise.  Adjust accordingly.
3875         * decl.h (grokdeclarator): Adjust declaration.
3876         * parser.c (cp_parser_init_declarator): Do not clear
3877         decl_specifiers->attributes.
3878
3879         * cp-tree.h (lang_identifier): Remove class_value.
3880         (IDENTIFIER_CLASS_VALUE): Remove.
3881         (pop_class_decls): Likewise.
3882         (init_search_processing): Likewise.
3883         * class.c (handle_using_decl): Use lookup_member, not
3884         IDENTIFIER_CLASS_VALUE.
3885         (restore_class_cache): New function, split out from ...
3886         (pushclass): ... here.  Do not call clear_identifier_class_values.
3887         (invalidate_class_lookup_cache): Do not clear
3888         IDENTIFIER_CLASS_VALUE.
3889         (popclass): Do not call pop_class_decls.
3890         (maybe_note_name_used_in_class): Do not save names looked up after
3891         the class is complete.  Use lookup_member, not
3892         IDENTIFIER_CLASS_VALUE.
3893         * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c.
3894         * decl.c (cxx_init_decl_processing): Do not call
3895         init_search_processing.
3896         * method.c (do_build_copy_constructor): Remove unnecessary code.
3897         (do_build_assign_ref): Likewise.
3898         * name-lookup.c (pushdecl): Use lookup_member, not
3899         IDENTIFIER_CLASS_VALUE.
3900         (set_identifier_type_value_with_scope): Set TREE_TYPE on the
3901         type_shadowed list.
3902         (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE.
3903         (push_class_binding): Do not set it.
3904         (clear_identifier_class_values): Remove.
3905         (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE.
3906         (store_binding): Do not save it.
3907         (pop_from_top_level): Do not restore it.
3908         * name-lookup.h (cxx_saved_binding): Remove class_value.
3909         (clear_identifier_class_values): Remove.
3910         * ptree.c (cxx_print_identifier): Do not print
3911         IDENTIFIER_CLASS_VALUE.
3912         * search.c (search_obstack): Remove.
3913         (push_stack_level): Remove.
3914         (pop_stack_level): Remove.
3915         (search_level): Remove.
3916         (search_stack): Remove.
3917         (lookup_member): Don't check IDENTIFIER_CLASS_VALUE.
3918         (setup_class_bindings): Use IDENTIFIER_MARKED, not
3919         IDENTIFIER_CLASS_VALUE.
3920         (marked_identifiers): New variable.
3921         (push_class_decls): Clear IDENTIFIER_MARKED.
3922         (pop_class_decls): Don't call pop_search_level.
3923         (init_search_processing): Remove.
3924
3925 2004-07-12  Mark Mitchell  <mark@codesourcery.com>
3926
3927         * cp-tree.h (get_aggr_typedef): Remove.
3928         * init.c (get_aggr_typedef): Likewise.
3929
3930         * name-lookup.c (push_class_level_binding): Simplify.
3931
3932 2004-07-12  Andrew Pinski  <apinski@apple.com>
3933
3934         PR c++/16475
3935         Revert:
3936         2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
3937                 PR c++/16276
3938                 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
3939                 is not public.
3940
3941 2004-07-12  Eric Christopher  <echristo@redhat.com>
3942
3943         * parser.c (cp_parser_class_head): Remove unused variable.
3944
3945 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3946
3947         * decl.c (grok_op_properties): Reject [de-]allocation functions
3948         declared in a namespace, or declared as static.
3949
3950 2004-07-12  Nathan Sidwell  <nathan@codesourcery.com>
3951
3952         * cp-tree.h (make_binfo): Remove.
3953         * decl.c (xref_basetypes): Use make_tree_binfo directly.
3954         * tree.h (copy_base_binfos): Likewise.
3955         (make_binfo): Remove.
3956
3957         * call.c (build_user_type_conversion_1, build_new_op,
3958         check_constructor_callable, build_temp,
3959         perform_direct_initialization_of_possible): Pass type directly to
3960         lookup_fnfields & build_special_member_call.
3961         (build_special_member_call): Accept a type, and complete it.
3962         * class.c (finish_stuct_bits): Copy the BINFOs here.
3963         * cvt.c (ocp_convert): Pass type directly to
3964         build_special_member_call.
3965         * decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
3966         (xref_basetypes): Allocate the binfo here. Adjust.
3967         * init.c (build_init, build_new_1): Pass type directly to
3968         build_special_member_call.
3969         * lex.c (cxx_make_type): Do not allocate binfo here.
3970         * name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
3971         * parser.c (cp_parser_class_head): Always call xref_basetypes.
3972         * pt.c (instantiate_class_template): Likewise. Inhibit access
3973         checking for template friends.
3974         * ptree.c (cxx_print_type): Adjust record printing.
3975         * search.c (lookup_base): When taking a type, complete it before
3976         looking for a binfo.
3977         (lookup_member): Delay completing a type.
3978         (push_class_decls): Don't walk an incomplete type.
3979         (lookup_conversions): Likewise.
3980         * semantics.c (finish_stmt_expr_expr): Pass type directly to
3981         build_special_member_call.
3982         * tree.c (copy_base_binfos): Adjust.
3983         (make_binfo): Likewise.
3984         * typeck.c (build_modify_expr): Pass type directly to
3985         build_special_member_call.
3986         * typeck2.c (process_init_constructor): Check a binfo exists.
3987         (build_m_component_ref): Allow accessing an incomplete type.
3988         (build_functional_cast): Pass type directly to
3989         build_special_member_call.
3990
3991 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3992
3993         PR c++/2204
3994         * config-lang.in (gtfiles): Add typeck2.c.
3995         * Make-lang.in: Tweak typeck2.c dependencies, and add rule for
3996         gt-cp-typeck2.h.
3997         * cp-tree.h: Declare complete_type_check_abstract.
3998         * typeck2.c (pat_calc_hash, pat_compare,
3999         complete_type_check_abstract): New functions.
4000         (abstract_virtuals_error): If the type is abstract, register the
4001         declaration within abstract_pending_vars for further checks.
4002         Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
4003         * decl.c (cp_finish_decl): Do not strip array types.
4004         (create_array_type_for_decl): Check for abstractness of the element
4005         type.
4006         (complete_vars): Call complete_type_check_abstract.
4007         * class.c (finish_struct): Prepare a list of virtual functions for
4008         template types, and call complete_vars on it to check for abstractness.
4009
4010 2004-07-12  Paolo Bonzini  <bonzini@gnu.org>
4011
4012         PR tree-optimization/14107
4013         * decl.c (finish_function): Remove temporary band-aid.
4014
4015 2004-07-11  Mark Mitchell  <mark@codesourcery.com>
4016
4017         * call.c (build_operator_new_call): Avoid using push_to_top_level.
4018         (build_new_op): Adjust call to lookup_function_nonclass.
4019         * name-lookup.c (identifier_type_value): Adjust call to
4020         lookup_name_real.
4021         (lookup_name_real): Add block_p parameter.
4022         (lookup_name_nonclass): Adjust call to lookup_name_real.
4023         (lookup_function_nonclass): Likewise.
4024         (lookup_name): Likewise.
4025         * name-lookup.h (lookup_name_real): Change prototype.
4026         (lookup_name_nonclass): Likewise.
4027         * parser.c (cp_parser_lookup_name): Likewise.
4028
4029         * cp-tree.h (saved_scope): Make old_bindings a vector.
4030         (unuse_fields): Remove.
4031         * name-lookup.h (cxx_saved_binding): Define it.
4032         * class.c (pushclass): Don't use unuse_fields.
4033         * name-lookup.c (cxx_saved_binding_make): Remove.
4034         (store_binding): Add new bindings to a vector, using an
4035         accumulator style, rather than adding them to a list.
4036         (store_bindings): Adjust accordingly.
4037         (store_class_bindings): Likewise.
4038         (push_to_top_level): Likewise.
4039         (pop_from_top_level): Likewise.
4040         * optimize.c (maybe_clone_body): Must push_to_top_level and
4041         pop_from_top_level calls outside of loop.
4042         * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope
4043         calls here from cp_parser_late_parsing_default_args.
4044         (cp_parser_save_default_args): Record the class type in which the
4045         function is declared.
4046         (cp_parser_late_parsing_default_args): Do not call
4047         push_nested_class/pop_nested_class.
4048         * search.c (dfs_unuse_fields): Remove.
4049         (unuse_fields): Remove.
4050
4051 2004-07-11  Joseph S. Myers  <jsm@polyomino.org.uk>
4052
4053         * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
4054         LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
4055         * cp-tree.h (poplevel): Declare.
4056         (set_block): Remove.
4057         * decl.c (set_block): Remove.
4058
4059 2004-07-10  Mike Stump  <mrs@apple.com>
4060
4061         * decl2.c (import_export_class): Never export/import vtables
4062         with inline key functions.
4063
4064 2004-07-09  Steven Bosscher  <stevenb@suse.de>
4065
4066         * typeck.c (c_expand_asm_operands): Remove.
4067
4068 2004-07-09  Mike Stump  <mrs@apple.com>
4069
4070         * typeck.c (build_class_member_access_expr): Skip null deref
4071         warning when we don't dereference it.
4072
4073 2004-07-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4074
4075         PR c++/8211
4076         PR c++/16165
4077         * class.c (check_field_decls): Improve -Weffc++ warning: do not
4078         warn for pointers to functions/members, or for classes without
4079         destructors.
4080
4081 2004-07-08  Mark Mitchell  <mark@codesourcery.com>
4082
4083         * name-lookup.h (struct cp_binding_level): Update documentation
4084         for class_shadowed.
4085
4086 2004-07-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4087
4088         PR c++/16169
4089         * typeck.c (check_return_expr): Improve -Weffc++ warning: handle
4090         returning CALL_EXPR, and non-reference return type.
4091
4092 2004-07-08  Nathan Sidwell  <nathan@codesourcery.com>
4093
4094         * name-lookup.c (push_binding): Use VEC_reserve.
4095
4096 2004-07-08  Richard Henderson  <rth@redhat.com>
4097
4098         * cp-tree.h (expand_eh_spec_block): Remove.
4099
4100 2004-07-07  Mark Mitchell  <mark@codesourcery.com>
4101
4102         * cp-tree.h (saved_scope): Remove x_previous_class_type and
4103         x_previous_class_values; add x_previous_class_level.
4104         (previous_class_type): Remove.
4105         (previous_class_values): Remove.
4106         (previous_class_level): New macro.
4107         * class.c (pushclass): Restore the identifier cache more
4108         expeditiously.
4109         (invalidate_class_lookup_cache): Use vector for class_shadowed and
4110         previous_class_values.
4111         * decl.c (poplevel): Likewise.
4112         * name-lookup.c (cxx_binding_init): New function.
4113         (cxx_binding_make): Use it.
4114         (push_binding): For a binding in a class level, use a vector of
4115         cp_class_binding nodes.
4116         (push_binding_level): New function.
4117         (begin_scope): Use it.
4118         (leave_scope): Do not put class binding levels on the free list.
4119         (print_binding_level): Adjust for the fact that class_shadowed is
4120         a vector.
4121         (poplevel_class): Likewise.
4122         (clear_identifier_class_values): Likewise.
4123         (push_class_level_binding): Likewise.
4124         (set_class_shadows): Remove.
4125         (store_binding): New function.
4126         (store_class_bindings): New function.
4127         (push_to_top_level): Use store_class_bindings as appropriate.
4128         (pop_from_top_level): Use previous_class_level, not
4129         previous_class_type.
4130         * name-lookup.h (cp_class_binding): New type.
4131         (cp_binding_level): Use a vector object for class_shadowed.
4132         (push_binding_level): Declare.
4133         (set_class_shadows): Remove.
4134
4135 2004-07-07  Andrew Pinski  <apinski@apple.com>
4136
4137         * class.c (instantiate_type): BUFFER_REF is dead.
4138         * lex.c (init_operators): IN_EXPR is dead.
4139
4140 2004-07-07  Jason Merrill  <jason@redhat.com>
4141
4142         PR c++/16334
4143         * call.c (build_new_op): Give overload warnings for built-in
4144         candidates.
4145
4146 2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
4147
4148         PR c++/16276
4149         * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
4150         is not public.
4151
4152 2004-07-07  Nathan Sidwell  <nathan@codesourcery.com>
4153
4154         * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
4155         * class.c (build_primary_vtable, check_bases,
4156         determine_primary_base, finish_struct_bits,
4157         maybe_warn_about_overly_private_class, dfs_find_final_overrider_q,
4158         get_basefndecls, warn_hidden, walk_subobject_offsets,
4159         build_base_fields, create_vtable_ptr, propagate_binfo_offsets,
4160         layout_virtual_bases, end_of_class, warn_about_ambiguous_bases,
4161         finish_struct_1, get_vfield_name, contains_empty_class_p,
4162         dump_class_hierarchy_r, finish_vtbls, build_vtt_inits,
4163         dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits,
4164         add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust
4165         BINFO macros.
4166         * decl.c (xref_basetypes): Likewise.
4167         * dump.c (cp_dump_tree): Likewise.
4168         * error.c (dump_expr): Likewise.
4169         * init.c (sort_mem_initializers, expand_member_init,
4170         push_base_cleanups): Likewise.
4171         * method.c (do_build_copy_constructor, do_build_assign_reg,
4172         synthesize_exception_spec): Likewise.
4173         * name-lookup.c (arg_assoc_class): Likewise.
4174         * pt.c (instantiate_class_template, tsubst,
4175         get_template_base_recursive): Likewise.
4176         * ptree.c (cxx_print_type): Likewise.
4177         * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
4178         * search.c (lookup_base_r, dynamic_cast_base_recurse,
4179         dfs_access_in_type, access_in_type, lookup_field_queue_p,
4180         bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp,
4181         marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp,
4182         dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet,
4183         binfo_for_vtable, copied_binfo, original_binfo): Likewise
4184         * tree.c (copy_base_binfos, make_binfo): Likewise.
4185         * typeck.c (commmon_base_type): Likewise
4186         * typeck2.c (process_init_constructor): Likewise
4187
4188 2004-07-06  Joseph S. Myers  <jsm@polyomino.org.uk>
4189
4190         * decl.c (check_tag_decl): Name redeclared type in diagnostic.
4191
4192 2004-07-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4193
4194         PR c++/3671
4195         * pt.c (convert_nontype_argument): Disallow conversions between
4196         different enumeration types.
4197
4198 2004-07-06  Nathan Sidwell  <nathan@codesourcery.com>
4199
4200         * cp-tree.h (BINFO_MARKED): Remove.
4201         (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED,
4202         BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P,
4203         BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n.
4204         (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P.
4205         * class.c (build_base_path): Use BINFO_VIRTUAL_P.
4206         (mark_primary_bases, determine_primary_base, base_derived_from,
4207         dfs_find_final_overrider, dfs_find_final_overrider_q,
4208         dfs_find_inal_overrider_post, update_vtable_entry_for_fn,
4209         dfs_modify_vtables, walk_subobject_offsets,
4210         layout_nonempty_base_or_field, build_base_field,
4211         build_base_fields, propagate_binfo_offsets, layout_virtual_bases,
4212         end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable,
4213         finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits,
4214         build_ctor_vtbl_group, accumulate_vtble_inits,
4215         dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries,
4216         build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r,
4217         add_vcall_offset_vtbl_entries_1): Likewise.
4218         * decl.c (xref_basetypes): Incomming virtual base indicated by
4219         TREE_TYPE. Adjust.
4220         * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P.
4221         * init.c (finish_init_stmts, sort_mem_initializers,
4222         emit_mem_initializers, build_vtble_address, expand_member_init,
4223         push_base_cleanups): Likewise.
4224         * method.c (do_build_copy_constructor): Likewise.
4225         * pt.c (instantiate_class_template,
4226         get_template_base_recursive): Likewise.
4227         * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init,
4228         get_pseudo_ti_desc): Likewise.
4229         * search.c (lookup_base_r, dynamic_cast_base_recurse,
4230         binfo_from_vbase, binfo_via_virtual, copied_binfo,
4231         original_binfo): Likewise.
4232         * semantics.c (finish_base_specifier): Virtualness is indicated
4233         by TREE_TYPE.
4234         * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P.
4235
4236 2004-07-06  Mark Mitchell  <mark@codesourcery.com>
4237
4238         Revert:
4239         2004-06-24  Jason Merrill  <jason@redhat.com>
4240         PR c++/16115
4241         * decl.c (grokparms): Give the PARM_DECL reference type if the
4242         parameter is passed by invisible reference.
4243
4244 2004-07-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4245
4246         * cp-lang.c (cp_var_mod_type_p): Add extra arg.
4247         * decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
4248         * pt.c (check_instantiated_args, unify): Likewise.
4249
4250 2004-07-05  Phil Edwards  <phil@codesourcery.com>
4251
4252         * Make-lang.in (check-c++, lang_checks):  Add some comments.
4253
4254 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
4255
4256         * cp-mudflap.c: Delete file.
4257         * Makefile.in: Remove all references to cp-mudflap.o.
4258
4259 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
4260
4261         * decl.c (cxx_init_decl_processing): Call
4262         build_common_tree_nodes before creating the global NAMESPACE_DECL.
4263
4264 2004-07-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4265
4266         PR c++/2518
4267         * call.c (build_operator_new_call): Look only at global scope.
4268
4269 2004-07-05  Nathan Sidwell  <nathan@codesourcery.com>
4270
4271         * call.c (enforce_access): Expect TREE_BINFO.
4272         * class.c (binfo_ctor_vtable): Check TREE_BINFO.
4273         * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
4274         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
4275         Adjust.
4276         (BINFO_LANG_ELTS): Remove.
4277         (BINFO_LANG_SLOTS): New.
4278         (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
4279         (CLASSTYPE_TEMPLATE_INFO): Adjust.
4280         * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
4281         * search.c (lookup_member): Check TREE_BINFO.
4282         * semantics.c (perform_or_defer_access_check): Likewise.
4283         (check_accessibility_of_qualified_id): Check
4284         deferred_access_no_check.
4285         * tree.c (make_binfo): Use make_tree_binfo.
4286
4287 2004-07-04  Mark Mitchell  <mark@codesourcery.com>
4288
4289         * method.c (implicitly_declare_fn): Set linkage of generated
4290         functions.
4291
4292 2004-07-04  Richard Henderson  <rth@redhat.com>
4293
4294         * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
4295
4296 2004-07-03  Scott Brumbaugh  <scottb.lists@verizon.net>
4297
4298         PR c++/3761
4299         * name-lookup.c (push_class_level_binding): Don't pass a
4300         TREE_LIST of ambiguous names to check_template_shadow as it
4301         only handles declarations. Instead, pull the declaration
4302         out and pass that.
4303
4304 2004-07-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4305
4306         PR c++/14971
4307         * pt.c (check_explicit_specialization): Clarify error message.
4308
4309 2004-07-02  Richard Henderson  <rth@redhat.com>
4310
4311         * tree.c (cp_unsave_r): Update remap_save_expr call.
4312
4313 2004-07-02  Mark Mitchell  <mark@codesourcery.com>
4314
4315         PR c++/16240
4316         * mangle.c (write_template_arg): Correct mangling.
4317
4318         PR c++/16297
4319         * decl.c (grokdeclarator): Robustify.
4320
4321 2004-07-01  Richard Henderson  <rth@redhat.com>
4322
4323         * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
4324         * method.c (synthesize_method): Don't clear_last_expr.
4325         * name-lookup.c (maybe_push_cleanup_level): Likewise.
4326
4327 2004-07-01  Nick Clifton  <nickc@redhat.com>
4328
4329         * decl2.c (import_export_class): Invoke the
4330         import_export_class field in the gcc_target structure if it is not
4331         empty.
4332
4333 2004-06-30  Richard Henderson  (rth@redhat.com>
4334
4335         * decl.c (start_preparsed_function): Don't set immediate_size_expand.
4336         * method.c (use_thunk): Likewise.
4337
4338 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
4339
4340         * call.c (build_over_call), typeck.c (build_function_call): Call
4341         check_function_arguments instead of check_function_format.
4342
4343 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
4344
4345         * call.c (build_over_call), typeck.c (build_function_call): Update
4346         calls to check_function_format.
4347
4348 2004-06-30  Richard Henderson  <rth@redhat.com>
4349
4350         * call.c (build_over_call): Use __builtin_memcpy for copying
4351         CLASS_AS_BASE rather than funny casting.
4352
4353 2004-06-30  Richard Henderson  <rth@redhat.com>
4354
4355         * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and
4356         TYPE_SIZE_UNIT of full_type.
4357
4358 2004-06-30  Per Bothner  <per@bothner.com>
4359
4360         Conditionally compile support for --enable-mapped_location.
4361         * decl.c (pop_label):  Handle (imperfectly) USE_MAPPED_LOCATION case.
4362         * decl2.c:  If USE_MAPPED_LOCATION, don't do some line number
4363         adjustments - which I don't understand.
4364         * error.c (dump_decl):  Rename "<interrnal>" to "<built-in>".
4365         * error.c:  Use LOCATION_FILE and EXPR_LOCATION macros.
4366         (print_instantiation_partial_context):  Use expand_location.
4367         * decl.c (duplicate_decl):  Use new DECL_IS_BUILTIN macro.
4368         * name-lookup.c:  Likewise.
4369         * lex.c (cxx_init):  Likewise.  Also use BUILTINS_LOCATION.
4370         * name-lookup.c:  Use input_line macro.
4371         * parser.c (cp_lexer_get_preprocessor_token):  Use UNKNOWN_LOCATION.
4372         (cp_parser_statement):  Rename locaal variable statement_locus to
4373         statement_location and use SET_EXPR_LOCATION macro.
4374         * pt.c:  Handle USE_MAPPED_LOCATION case.  Use new macros.
4375         * tree.c (cp_walk_subtrees):  Likewise.
4376
4377 2004-06-29  Per Bothner  <per@bothner.com>
4378
4379         * tree.c (build_min_nt, build_min, build_min_non_dep):
4380         Don't set TREE_COMPLEXITY from input_line.
4381
4382 2004-06-29  Paul Brook  <paul@codesourcery.com>
4383
4384         * init.c: Include target.h.
4385         (get_cookie_size): Remove and replace with target hook.
4386         Update callers.
4387         (build_new_1): Store the element size in the cookie.
4388
4389 2004-06-29  Nathan Sidwell  <nathan@codesourcery.com>
4390
4391         PR c++/16260
4392         * parser.c (cp_parser_template_declaration_after_export): Disable
4393         access checks here ...
4394         (cp_parser_class_specifier): ... not here.
4395
4396 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4397
4398         * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
4399         VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
4400         BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate
4401         TREE_CHECK macro.
4402
4403 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4404
4405         * cp-tree.h (struct deferred_access): Move to ...
4406         * semantics.c (struct deferred_access): ... here. Adjust.
4407         (deferred_access_stack): Make a VEC(deferred_access),
4408         (deferred_access_free_list): Remove.
4409         (deferred_access_no_check): New.
4410         (push_deferring_access_checks, resume_deferring_access_checks,
4411         stop_deferring_access_checks, pop_deferring_access_checks,
4412         get_deferred_access_checks, pop_to_parent_deferring_access_checks,
4413         perform_deferred_access_checks, perform_or_defer_access_check): Adjust.
4414
4415 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4416
4417         PR c++/16174
4418         * call.c (build_temp): Declare.
4419         (check_constructor_callable): New.
4420         (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
4421         CONSTRUCTOR_CALLABLE.
4422         (convert_like_real, initialize_reference): Use
4423         check_constructor_callable.
4424         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
4425         (LOOKUP_*): Renumber.
4426
4427 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4428
4429         * friend.c (add_friend): Only perform access checks when context
4430         is a class.
4431         * lex.c (cxx_make_type): Only create a binfo for aggregate types.
4432         * parser.c (cp_parser_class_specifier): Disable access checks here
4433         when parsing the body of a templated class.
4434         * semantics.c (perform_or_defer_access_checks): Reorder to allow
4435         NULL binfos when not checking access.
4436
4437 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
4438
4439         Use vector API for vbase list.
4440         * cp-tree.h: Include vec.h
4441         (DEF_VEC_P (tree)): New type.
4442         (struct lang_type_class): Change vbase's member type.
4443         (binfo_for_vbase): Declare.
4444         * class.c (determine_primary_base, base_derived_from,
4445         update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
4446         warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
4447         build_vtbl_initializer): Adjust.
4448         * decl.c (xref_basetypes): Adjust, accumulate upper bound of
4449         vbases.
4450         * init.c (sort_mem_initializers, expand_member_init,
4451         push_base_cleanups): Adjust.
4452         * method.c (do_build_copy_constructor): Adjust.
4453         * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
4454         (binfo_for_vbase): New.
4455         * tree.c (copy_base_binfos): Adjust.
4456
4457 2004-06-28  Mark Mitchell  <mark@codesourcery.com>
4458
4459         * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
4460
4461 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4462
4463         PR c++/14123
4464         * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
4465         paranthesis in case of pointers to array members.
4466         * error.c (dump_type_prefix): Likewise.
4467         (dump_type_suffix): Maybe issue a whitespace when printing
4468         ARRAY_TYPE.
4469
4470 2004-06-27  Mark Mitchell  <mark@codesourcery.com>
4471
4472         PR c++/16193
4473         * parser.c (cp_parser_set_decl_spec_type): Refine test for
4474         redefinition of built-in types.
4475
4476 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4477
4478         * error.c (pp_template_argument_list_start): Remove.
4479         (pp_template_argument_list_end): Likewise.
4480         (pp_separate_with_comma): Use pp_cxx_separate_with.
4481         (reinit_global_formatting_buffer): Remove.
4482         (pp_non_consecutive_character): Likewise.
4483         (dump_scope): Use pp_cxx_colon_colon.
4484         (dump_template_parameter): Use pp_cxx_identifier,
4485         pp_cxx_tree_identifier and pp_cxx_whitespace.
4486         (dump_templat_bindings): Replace use of pp_string with sequence
4487         of pp_cxx_whitespace and pp_equal.
4488         (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
4489         pp_cxx_colon_colon, pp_cxx_whitespace throughout.  Don't set
4490         padding here.
4491         (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
4492         (dump_type_prefix): Don't set padding.  Use pp_cxx_whitespace,
4493         pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
4494         (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
4495         pp_cxx_right_bracket, pp_cxx_identifier throughout,
4496         (dump_decl): Likewise.
4497         (dump_template_decl): Likewise.
4498         (dump_function_decl): Likewise.  Set padding as appropriate.
4499         (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
4500         pp_cxx_right_paren.
4501         (dump_exception_spec): Likewise.
4502         (dump_function_name): Use pp_cxx_tree_identifier and
4503         pp_cxx_identifier.
4504         (dump_template_parms): Use pp_cxx_begin_template_argument_list and
4505         pp_cxx_end_template_argument_list.
4506         (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
4507         pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
4508         pp_cxx_whitespace throughout.
4509         (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
4510         pp_cxx_right_paren.
4511         (dump_unary_op): Likewise.
4512         (reinit_cxx_pp): New function.
4513         (type_as_string); Use it.
4514         (expr_as_string): Likewise.
4515         (decl_as_string); Likewise.
4516         (context_as_string): Likewise.
4517         (lang_decl_name): Likewise.
4518         (decl_to_string): Likewise.
4519         (expr_to_string): Likewise.
4520         (parm_to_string): Likewise.
4521         (type_to_string): Likewise.
4522         (args_to_string): Likewise.
4523         (cv_to_string): Likewise.
4524
4525 2004-06-26  Mark Mitchell  <mark@codesourcery.com>
4526
4527         * cp-tree.h (cp_cv_quals): New type.
4528         (cp_declarator): Use it instead of "tree" as appropriate.
4529         (grok_method_quals): Adjust prototype.
4530         (grokclassfn): Likewise.
4531         (do_friend): Likewise.
4532         * decl.c (grokfndecl): Use cp_cv_quals, not tree.
4533         (grokdeclarator): Likewise.
4534         * decl2.c (grok_method_quals): Likewise.
4535         (grokclassfn): Likewise.
4536         * friend.c (do_friend): Likewise.
4537         * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
4538         * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
4539         (make_pointer_declarator): Likewise.
4540         (make_reference_declarator): Likewise.
4541         (make_ptrmem_declarator): Likewise.
4542         (cp_parser_ptr_operator): Likewise.
4543         (cp_parser_cv_qualifier_seq_opt): Likewise.
4544         (cp_parser_cv_qualifier_opt): Remove.
4545         (cp_parser_new_declarator_opt): Adjust call to
4546         cp_parser_ptr_operator.
4547         (cp_parser_conversion_declaration_opt): Likewise.
4548         (cp_parser_declarator): Use cp_cv_quals, not tree.
4549         (cp_parser_direct_declarator): Likewise.
4550
4551 2004-06-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4552
4553         * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
4554         Rename DECL_STMT to DECL_EXPR.
4555         * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
4556         * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
4557         * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
4558
4559 2004-06-26  Jan Hubicka  <jh@suse.cz>
4560
4561         PR C++/14865
4562         * decl2.c (maybe_emit_vtables):  Always import_export_vtable for the
4563         reachability analysis.
4564
4565 2004-06-25  Mark Mitchell  <mark@codesourcery.com>
4566
4567         * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
4568         2004-06-23 change.
4569
4570 2004-06-25  Paul Brook  <paul@codesourcery.com>
4571
4572         * decl2.c (get_guard): Call targetm.cxx.guard_type.
4573         (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
4574
4575 2004-06-24  Mark Mitchell  <mark@codesourcery.com>
4576
4577         * decl.c (grokdeclarator): Restore error messages about __thread.
4578         * parser.c (cp_parser_decl_specifier_seq): Likewise.
4579
4580 2004-06-24  Jason Merrill  <jason@redhat.com>
4581
4582         PR c++/16115
4583         * decl.c (grokparms): Give the PARM_DECL reference type if the
4584         parameter is passed by invisible reference.
4585
4586 2004-06-24  Andreas Schwab  <schwab@suse.de>
4587
4588         * cp-tree.h (enum cp_storage_class): Remove trailing comma.
4589
4590 2004-06-23  Mark Mitchell  <mark@codesourcery.com>
4591
4592         * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
4593         (cp/decl.o): Likewise.
4594         (cp/decl2.o): Likewise.
4595         (cp/pt.o): Likewise.
4596         (cp/semantics.o): Likewise.
4597         * config-lang.in (gtfiles): Do not reference cp/lex.h.
4598         * class.c: Do not include lex.h.
4599         (add_implicitly_declared_members): Do not use
4600         adding_implicit_members.
4601         (check_bases_and_members): Do not talk about grok_x_components.
4602         * cp/cp-tree.h (adding_implicit_members): Remove.
4603         (cp_storage_class): New type.
4604         (cp_decl_spec): Likewise.
4605         (cp_decl_specifier_seq): Likewise.
4606         (cp_parameter_declarator): Use it for the decl_specifiers field.
4607         (check_tag_decl): Adjust prototype.
4608         (shadow_tag): Likewise.
4609         (groktypename): Likewise.
4610         (start_decl): Likewise.
4611         (start_function): Likewise.
4612         (start_method): Likewise.
4613         (grok_x_components): Remove.
4614         (grokfield): Adjust prototype.
4615         (grokbitfield): Likewise.
4616         (finish_member_class_template): Remove.
4617         * decl.c: Do not include lex.h.
4618         (adding_implicit_members): Do not define.
4619         (check_tag_decl): Do not use trees to represent decl-specifiers.
4620         (shadow_tag): Likewise.
4621         (groktypename): Likewise.
4622         (start_decl): Likewise.
4623         (grokvardecl): Likewise.
4624         (grokdeclarator): Likewise.
4625         (grokparms): Likewise.
4626         (start_function): Likewise.
4627         (start_method): Likewise.
4628         * decl.h (grokdeclarator): Adjust prototype.
4629         * decl2.c: Do not include lex.h.
4630         (grok_x_components): Remove.
4631         (grokfield): Do not use trees to represent decl-specifiers.
4632         (grokbitfield): Likewise.
4633         * lex.c: Do not include lex.h.
4634         * lex.h: Remove.
4635         * parser.c: Include target.h.
4636         (clear_decl_specs): New function.
4637         (cp_parser_translation_unit): Do not use trees to represent
4638         decl-specifiers.
4639         (cp_parser_postfix_expression): Likewise.
4640         (cp_parser_new_type_id): Likewise.
4641         (cp_parser_condition): Likewise.
4642         (cp_parser_simple_declaration): Likewise.
4643         (cp_parser_decl_specifier_seq): Likewise.
4644         (cp_parser_function_specifier_opt): Likewise.
4645         (cp_parser_conversion_type_id): Likewise.
4646         (cp_parser_template_parameter): Likewise.
4647         (cp_parser_explicit_instantiation): Likewise.
4648         (cp_parser_type_specifier): Likewise.
4649         (cp_parser_simple_type_specifier): Likewise.
4650         (cp_parser_init_declarator): Likewise.
4651         (cp_parser_type_id): Likewise.
4652         (cp_parser_type_specifier_seq): Likewise.
4653         (cp_parser_parameter_declaration): Likewise.
4654         (cp_parser_member_declaration): Likewise.
4655         (cp_parser_exception_declaration): Likewise.
4656         (cp_parser_function_definition_from_specifiers_and_declarator):
4657         Likewise.
4658         (cp_parser_single_declaration): Likewise.
4659         (cp_parser_save_member_function_body): Likewise.
4660         (cp_parser_friend_p): Likewise.
4661         (cp_parser_set_storage_class): New function.
4662         (cp_parser_set_decl_spec_type): Likewise.
4663         * pt.c: Do not include lex.h.
4664         * semantics.c: Likewise.
4665         (finish_member_class_template): Remove.
4666
4667 2004-06-23  Roger Sayle  <roger@eyesopen.com>
4668
4669         * call.c (build_cxx_call): Don't call expand_tree_builtin.  No
4670         longer take both "args" and "convert_args" as arguments.
4671         (build_op_delete_call): Update call to build_cxx_call.
4672         (build_over_call): Likewise, update call to build_cxx_call.
4673         * cp-tree.h (build_cxx_call): Update funtion prototype.
4674         * typeck.c (build_function_call): Don't call expand_tree_builtin.
4675         * rtti.c (throw_bad_cast): Update call to build_cxx_call.
4676         (throw_bad_typeid): Likewise.
4677         (build_dynamic_cast_1): Likewise.
4678
4679 2004-06-22  Richard Henderson  <rth@redhat.com>
4680
4681         * class.c (build_vfn_ref): Take a pointer not object.  Build
4682         an OBJ_TYPE_REF.
4683         (cp_fold_obj_type_ref): New.
4684         * call.c (build_over_call): Update build_vfn_ref call.
4685         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
4686         * cp-tree.h (cp_fold_obj_type_ref): Declare.
4687
4688 2004-06-21  Jason Merrill  <jason@redhat.com>
4689
4690         PR c++/16112
4691         * cp-gimplify.c (cp_gimplify_init_expr): Look through
4692         CLEANUP_POINT_EXPR.
4693
4694 2004-06-21  Mark Mitchell  <mark@codesourcery.com>
4695
4696         * cp-tree.def (NEW_EXPR): Add a fourth slot.
4697         * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
4698         (TREE_PARMLIST): Likewise.
4699         (CALL_DECLARATOR_PARMS): Likewise.
4700         (CALL_DECLARATOR_QUALS): Likewise.
4701         (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
4702         (cp_declarator_kind): New type.
4703         (cp_parameter_declarator): Likewise.
4704         (cp_declarator): Likewise.
4705         (cp_error_declarator): Likewise.
4706         (no_parameters): Likewise.
4707         (groktypename): Change prototype.
4708         (start_decl): Likewise.
4709         (start_handler_parms): Likewise.
4710         (get_scope_of_declarator): Likewise.
4711         (start_function): Likewise.
4712         (start_preparsed_function): New function.
4713         (start_function): Change prototype.
4714         (start_method): Likewise.
4715         (grokfield): Likewise.
4716         (grokbitfield): Likewise.
4717         (build_new): Likewise.
4718         (make_pointer_declarator): Remove.
4719         (make_reference_declarator): Likewise.
4720         (make_call_declarator): Likewise.
4721         (set_quals_and_spec): Likewise.
4722         (process_template_parm): Change prototype.
4723         (begin_function_definition): Remove.
4724         (finish_parmlist): Remove.
4725         * decl.c (groktypename): Do not use trees to represent
4726         declarators.
4727         (start_decl): Likewise.
4728         (start_handler_parms): Remove.
4729         (get_scope_of_declarator): Reimplement.
4730         (grokdeclarator): Do not use trees to represent declarators.
4731         (grokparms): Likewise.
4732         (start_function): Likewise.
4733         (start_method): Likewise.
4734         (build_void_list_mode): Do not use TREE_PARMLIST.
4735         * decl.h (grokdeclarator): Change prototype.
4736         * decl2.c (grok_method_quals): Robustify.
4737         (grok_x_components): Do not use trees to represent declarators.
4738         (grokfield): Likewise.
4739         (grokbitfield): Likewise.
4740         (start_objects): Build FUNCTION_DECLs, not declarators.
4741         (start_static_storage_duration_function): Likewise.
4742         * init.c (build_new): Simplify.
4743         * lex.c (make_pointer_declarator): Remove.
4744         (make_reference_declarator): Likewise.
4745         (make_call_declarator): Likewise.
4746         (set_quals_and_spec): Likewise.
4747         * method.c (use_thunk): Use start_preparsed_function.
4748         (synthesize_method): Likewise.
4749         (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
4750         * optimize.c (maybe_clone_body): Use start_preparsed_function.
4751         * parser.c (cp_error_declarator): New variable.
4752         (declarator_obstack): Likewise.
4753         (alloc_declarator): New function.
4754         (make_declarator): Likewise.
4755         (make_id_declarator): Likewise.
4756         (make_pointer_declarator): Likewise.
4757         (make_reference_declarator): Likewise.
4758         (make_ptrmem_declarator): Likewise.
4759         (make_call_declarator): Likewise.
4760         (make_array_declarator): Likewise.
4761         (no_parameters): New variable.
4762         (make_parameter_declarator): Likewise.
4763         (cp_parser_check_for_definition_in_return_type): Do not use trees
4764         to represent declarators.
4765         (cp_parser_translation_unit): Likewise.
4766         (cp_parser_new_expression): Likewise.
4767         (cp_parser_new_type_id): Likewise.
4768         (cp_parser_new_declarator_opt): Likewise.
4769         (cp_parser_direct_new_declarator): Likewise.
4770         (cp_parser_condition): Likewise.
4771         (cp_parser_declaration_statement): Likewise.
4772         (cp_parser_declaration): Likewise.
4773         (cp_parser_conversion_type_id): Likewise.
4774         (cp_parser_conversion_declarator_opt): Likewise.
4775         (cp_parser_template_parameter_list): Likewise.
4776         (cp_parser_template_parameter): Likewise.
4777         (cp_parser_explicit_instantiation): Likewise.
4778         (cp_parser_init_declarator): Likewise.
4779         (cp_parser_declarator): Likewise.
4780         (cp_parser_direct_declarator): Likewise.
4781         (cp_parser_type_id): Likewise.
4782         (cp_parser_parameter_declaration_clause): Likewise.
4783         (cp_parser_parameter_declaration_list): Likewise.
4784         (cp_parser_parameter_declaration): Likewise.
4785         (cp_parser_member_declaration): Likewise.
4786         (cp_parser_exception_declaration): Likewise.
4787         (cp_parser_check_declarator_template_parameters): Likewise.
4788         (cp_parser_function_definition_from_specifiers_and_declarator):
4789         Likewise.
4790         (cp_parser_save_member_function_body): Likewise.
4791         * pt.c (process_template_parm): Add is_non_type parameter.
4792         (convert_template_argument): Adjust call to groktypename.
4793         (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
4794         (tsubst): Do not expect declarators.
4795         (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
4796         argument.
4797         (instantiate_decl): Use start_preparsed_function.
4798         * semantics.c (begin_function_definition): Remove.
4799         (finish_parmlist): Remove.
4800         * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
4801         declarators.
4802
4803 2004-06-21  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4804
4805         * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
4806         (build_new_method_call): Likewise.
4807         * decl.c (local_variable_p_walkfn): Don't walk into types.
4808         * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
4809         (build_anon_union_vars): Add new operand for COMPONENT_REF.
4810         * init.c (buld_new): Add new operand for ARRAY_REF.
4811         * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
4812         (do_build_assign_ref): Likewise.
4813         * parser.c (cp_parser_direct_new_declarator): Add new operands
4814         for ARRAY_REF.
4815         (cp_parser_direct_declarator): Likewise.
4816         * pt.c (tsubst): Likewise.
4817         (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
4818         for COMPONENT_REF.
4819         * semantics.c (finish_non_static_data_member): Add new operand
4820         for COMPONENT_REF.
4821         * typeck.c (build_class_member_access_expr): Likewise.
4822         (build_class_member_access_expr, finish_class_member_access_expr):
4823         Likewise.
4824         (build_ptrmemfunc_access_expr): Likewise.
4825         (build_array_ref): Add new operands for ARRAY_REF.
4826         * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
4827         * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
4828
4829 2004-06-21  Richard Henderson  <rth@redhat.com>
4830
4831         * dump.c (cp_dump_tree): Don't use dump_next_stmt.
4832         * parser.c (cp_parser_jump_statement): Update commentary.
4833         * pt.c (tsubst_expr): Use RETURN_EXPR.
4834         * semantics.c (finish_return_stmt): Likewise.
4835         (finalize_nrv_r): Likewise.
4836         * typeck.c, typeck2.c: Update file start commentary.
4837
4838 2004-06-21  Richard Henderson  <rth@redhat.com>
4839
4840         * semantics.c (finish_expr_stmt): Call verify_sequence_points.
4841
4842 2004-06-20  Richard Henderson  <rth@redhat.com>
4843
4844         * cp-tree.h (add_decl_stmt): Declare.
4845         * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
4846         * semantics.c (maybe_cleanup_point_expr): New.
4847         (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
4848         finish_for_expr, finish_switch_cond): Use it.
4849         (finalize_nrv_r): Don't build an EXPR_STMT.  Don't frob TREE_CHAIN.
4850
4851 2004-06-20  Richard Henderson  <rth@redhat.com>
4852
4853         * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
4854         * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
4855         (cp_gimplify_expr): Call it.
4856         (gimplify_cleanup_stmt): Move from c-gimplify.c.
4857         (cp_genericize): New.
4858         * decl.c (finish_function): Call it.
4859         * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
4860         (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
4861         (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
4862         (cp_genericize): Declare.
4863         * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
4864         * dump.c (cp_dump_tree): Likewise.
4865         * semantics.c (push_cleanup): Move from c-semantics.c.
4866
4867 2004-06-20  Zack Weinberg  <zack@codesourcery.com>
4868
4869         * cp-lang.c (has_c_linkage): Implement.
4870
4871         * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
4872         * decl.c (duplicate_decls): Use COPY_DECL_RTL.
4873         (builtin_function_1): Don't call make_decl_rtl.
4874         (build_cp_library_fn): Don't call set_mangled_name_for_decl.
4875         (grokvardecl): Don't call mangle_decl.
4876         * except.c (nothrow_libfn_p): Look at DECL_NAME, not
4877         DECL_ASSEMBLER_NAME.
4878         * method.c (set_mangled_name_for_decl): Delete.
4879         * name-lookup.c (pushdecl): When a local extern shadows a
4880         file-scope declaration of the same object, give both DECLs the
4881         same DECL_UID.
4882         * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
4883         on DECL_ASSEMBLER_NAME.
4884
4885 2004-06-19  Richard Henderson  <rth@redhat.com>
4886
4887         * cp-gimplify.c: Remove unnecessary prototypes.
4888         (cp_gimplify_stmt): Merge into ...
4889         (cp_gimplify_expr): ... here.  Move to end of file.  Handle
4890         stmts_are_full_exprs_p frobbing.
4891         * cp-tree.h (cp_gimplify_stmt): Remove.
4892         * pt.c (tsubst_expr): Merge prep_stmt and unify.
4893         * tree.c (init_tree): Don't set lang_gimplify_stmt.
4894
4895 2004-06-18  Richard Henderson  <rth@redhat.com>
4896
4897         PR c++/16034
4898         * semantics.c (begin_cond): New.
4899         (finish_cond): Rewrite to handle template DECL_STMTs specially.
4900         Assume that non-template decls go land before the conditional.
4901         (simplify_loop_decl_cond): Likewise.
4902         (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
4903         finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
4904         begin_switch_stmt, finish_switch_cond): Update to match.
4905
4906 2004-06-17  Jason Merrill  <jason@redhat.com>
4907
4908         PR c++/16015
4909         * semantics.c (simplify_aggr_init_expr): Don't return the slot.
4910         (finish_stmt_expr_expr): Update type after conversions.
4911         (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
4912         Handle void initializer.
4913         * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
4914
4915 2004-06-17  Geoffrey Keating  <geoffk@apple.com>
4916
4917         * class.c (build_clone): Don't call defer_fn, let mark_used do it.
4918         * cp-tree.h (defer_fn): Delete.
4919         * decl2.c (defer_fn): Delete.
4920         (finish_file): Simplify deferred_fns loops; check that
4921         only used inline functions get into deferred_fns.
4922         (mark_used): Inline previous contents of defer_fn.
4923
4924 2004-06-16  Richard Henderson  <rth@redhat.com>
4925
4926         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
4927         (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
4928         * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
4929         of CTOR_INITIALIZER ...
4930         (pp_cxx_statement): ... here.
4931         * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
4932         (finish_function): Use alloc_stmt_list to zap entire function.
4933         * parser.c (cp_parser_compound_statement): Update commentary.
4934         * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
4935         * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
4936         (finish_stmt_expr): Don't look through COMPOUND_STMT.
4937
4938 2004-06-16  Geoffrey Keating  <geoffk@apple.com>
4939
4940         * pt.c (mark_decl_instantiated): Don't call defer_fn.
4941
4942 2004-06-16  Richard Henderson  <rth@redhat.com>
4943
4944         * parser.c (cp_parser_labeled_statement): Update commentary.
4945         * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
4946         * tree.c (mark_local_for_remap_r): Likewise.
4947
4948 2004-06-16  Richard Henderson  <rth@redhat.com>
4949
4950         * parser.c (cp_parser_asm_definition): Update commentary.
4951         * pt.c (tsubst_expr): Use ASM_EXPR.
4952         * semantics.c (finish_asm_stmt): Likewise.
4953
4954 2004-06-16  Richard Henderson  <rth@redhat.com>
4955
4956         * decl.c (finish_destructor_body): Use LABEL_EXPR.
4957         * parser.c (cp_parser_statement): Update commentary.
4958         * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
4959         * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
4960         * tree.c (mark_local_for_remap_r): Likewise.
4961
4962 2004-06-16  Richard Henderson  <rth@redhat.com>
4963
4964         PR c++/16012
4965         * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
4966         statement in FOR_INIT_STMT for templates.
4967
4968 2004-06-15  Richard Henderson  <rth@redhat.com>
4969
4970         * call.c (initialize_reference): Don't build CLEANUP_STMT here.
4971         * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
4972         (genericize_try_block): Use gimplify_stmt.
4973         (genericize_catch_block, genericize_eh_spec_block): Likewise.
4974         (cp_gimplify_init_expr): Remove STMT_EXPR special case.
4975         (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
4976         * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
4977         (cp_tree_chain_matters_p): Remove.
4978         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
4979         (COMPOUND_STMT_BODY_BLOCK): New.
4980         (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
4981         (EXPR_STMT_STMT_EXPR_RESULT): New.
4982         (building_stmt_tree): Check cur_stmt_list.
4983         (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
4984         (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
4985         * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
4986         (cp_finish_decl): Use push_cleanup.
4987         (start_function, finish_function): Use statement lists.
4988         (finish_stmt): Do nothing.
4989         * except.c (begin_eh_spec_block): Use statement lists.
4990         (check_handlers_1, check_handlers): Likewise.
4991         * init.c (construct_virtual_base): Don't add extra compound stmts.
4992         (build_vec_init): Likewise.
4993         * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
4994         * name-lookup.h (struct cp_binding_level): Add statement_list.
4995         * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
4996         (cp_parser_labeled_statement, cp_parser_expression_statement,
4997         cp_parser_statement_seq_opt): Likewise.
4998         (cp_parser_compound_statement): Likewise.  Take bool for try block.
4999         (cp_parser_selection_statement): Tidy if processing.
5000         (cp_parser_already_scoped_statement): Rewrite to do what it says.
5001         * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
5002         (tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
5003         Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
5004         * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
5005         (finish_cond): New, rewritten from FINISH_COND.
5006         (simplify_loop_decl_cond): New.
5007         (finish_expr_stmt): Avoid nested EXPR_STMTs.
5008         (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
5009         begin_else_clause, finish_else_clause, finish_if_stmt,
5010         begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
5011         begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
5012         finish_for_cond, finish_for_stmt, begin_switch_stmt,
5013         finish_switch_cond, finish_switch_stmt, begin_try_block,
5014         finish_try_block, finish_cleanup_try_block, finish_function_try_block,
5015         finish_handler_sequence, finish_function_handler_sequence,
5016         begin_handler, finish_handler_parms, finish_handler,
5017         begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
5018         using statement lists.
5019         (begin_compound_stmt): Replace has_no_scope argument with flags.
5020         Update all callers.  Use statement lists.
5021         (finish_compound_stmt): Likewise.
5022         (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
5023         (current_scope_stmt_stack): Remove.
5024         (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
5025         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
5026         Rewrite with statement lists.
5027
5028 2004-06-15  Alexandre Oliva  <aoliva@redhat.com>
5029
5030         * parser.c: Change all assignments of c_lex_string_translate
5031         to true and false to 1 and 0.
5032         (cp_lexer_read_token): Convert type of the translated string.
5033         (cp_parser_skip_to_closing_parentheses): Preserve original
5034         value of c_lex_string_translate, and set it to -1 while
5035         running.
5036         (cp_parser_cache_group): Likewise.
5037         (cp_parser_cache_group_1): Renamed.
5038         (cp_parser_asm_operand_list): Remove redundant setting of
5039         c_lex_string_translate.
5040         (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
5041         Handle chained strings.
5042
5043 2004-06-12  Andrew Pinski  <apinski@apple.com>
5044
5045         PR c++/14639
5046         Revert:
5047         2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
5048
5049                 * cp-tree.h: Fix typo.
5050
5051                 * cp-tree.h: Include cgraph.h
5052                 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
5053                 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
5054
5055 2004-06-12  Jason Merrill  <jason@redhat.com>
5056
5057         PR tree-optimization/14107
5058         * decl.c (finish_function): Warn about no return in all functions.
5059
5060 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
5061
5062         * cp-tree.h (struct language_function): Remove cannot_inline.
5063         * decl.c (save_function_data): cannot_inline is no more.
5064         (cxx_push_function_context): Likewise.
5065         * decl2.c (start_objects, start_static_storage_duration_function):
5066         Reset DECL_INLINE, set DECL_UNINLINABLE.
5067
5068 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5069
5070         PR c++/15967
5071         * search.c (lookup_field): Propagate the ambiguity list.
5072         (lookup_fnfields): Likewise.
5073
5074 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5075
5076         PR c++/15947
5077         * parser.c (cp_parser_template_name): Ctors/dtors never need a
5078         template keyword to disambiguate.
5079
5080 2004-06-14  Mark Mitchell  <mark@codesourcery.com>
5081
5082         PR c++/15096
5083         * decl.c (grokdeclarator): Ignore pointer-to-members when
5084         computing template depth.
5085
5086         PR c++/14930
5087         * name-lookup.c (pushtag): Do not try to put class declarations in
5088         explicit specialization scopes.
5089
5090 2004-06-11  Andrew Pinski  <pinskia@physics.uc.edu>
5091
5092         * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
5093
5094 2004-06-11  Mark Mitchell  <mark@codesourcery.com>
5095
5096         PR c++/15862
5097         * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
5098         bindings for undeclared built-ins.
5099
5100 2004-06-11  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5101
5102         * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
5103         appear at the correct location.
5104
5105 2004-06-10  Jason Merrill  <jason@redhat.com>
5106
5107         PR c++/15875
5108         Revert:
5109         2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
5110         * init.c (build_offset_ref): Build SCOPE_REF with non-null
5111         TREE_TYPE for non-dependent names.
5112         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
5113         unknown_type_node as its TREE_TYPE.
5114         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
5115         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
5116         (dump_expr) <SCOPE_REF case>: Likewise.
5117
5118 2004-06-10  Mark Mitchell  <mark@codesourcery.com>
5119
5120         PR c++/15227
5121         * parser.c (cp_parser_direct_declarator): Robustify.
5122
5123         PR c++/15877
5124         * pt.c (tsubst_copy): Use decl_constant_value on enumeration
5125         constants in non-dependent contexts.
5126
5127         PR c++/14211
5128         PR c++/15076
5129         * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
5130         necessary.
5131
5132 2004-06-10  Jakub Jelinek  <jakub@redhat.com>
5133
5134         PR c++/14791
5135         * decl.c (duplicate_decls): Handle fileptr_type_node arguments
5136         specially.
5137
5138 2004-06-09  Mark Mitchell  <mark@codesourcery.com>
5139
5140         Revert:
5141         PR c++/15815
5142         2004-06-07  Mark Mitchell  <mark@codesourcery.com>
5143         * lex.c (handle_pragma_interface): Deprecate.
5144         (handle_pragma_implementation): Likewise.
5145
5146 2004-06-09  Andrew Pinski  <pinskia@physics.uc.edu>
5147
5148         * g++spec.c (lang_specific_driver): Remove check for -lm
5149         and -lmath when check it see if it was the math library.
5150
5151 2004-06-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5152
5153         PR c++/7841
5154         * parser.c (cp_parser_direct_declarator): Reject constructor named
5155         as qualified template-id.
5156
5157 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
5158
5159         PR c++/15815
5160         * lex.c (handle_pragma_interface): Deprecate.
5161         (handle_pragma_implementation): Likewise.
5162
5163 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
5164
5165         PR c++/15766
5166         * parser.c (cp_parser_iteration_statement): Fix typo in error
5167         message.
5168
5169         PR c++/14777
5170         * pt.c (tsubst_default_argument): Do not defer access checks
5171         while substituting into the default argument.
5172
5173         PR c++/15554
5174         * pt.c (tsubst_copy): Do not try to substitute for an enumeration
5175         constant in a non-dependent context.
5176
5177         PR c++/15057
5178         * except.c (build_throw): Ensure that temp_expr has been
5179         initialized.
5180
5181 2004-06-06  Roger Sayle  <roger@eyesopen.com>
5182
5183         * cp/cp-tree.h (lvalue_or_else): Add function prototype.
5184
5185 2004-06-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5186
5187         PR c++/15503
5188         * parser.c (cp_parser_mem_initializer_id): Gracefully reject
5189         'typename', and accept 'template'.
5190
5191 2004-06-03  Andrew Pinski  <pinskia@physics.uc.edu>
5192             Jan Hubicka  <jh@suse.cz>
5193
5194         PR c++/14639
5195         * method.c (use_think): Do not mark thunk as referenced.
5196
5197 2004-06-03  Matt Austern  <austern@apple.com>
5198
5199         PR c++/15428
5200         * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
5201         is nonzero, and if we see a noninline definition of a key method,
5202         make the vtables nonweak.
5203
5204 2004-06-02  Matt Austern  <austern@apple.com>
5205
5206         * cp-tree.h (instantiate_decl): new boolean parameter,
5207         undefined_ok. Current behavior is equivalent to its being 0.
5208         * decl2.c (mark_used): Add new argument when calling instantiate_decl
5209         * pt.c (mark_decl_instantiated): Unconditionally make
5210         instantiations explicit unconditionally
5211         (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
5212         since mark_decl_instantiated now does it.
5213         (instantiate_class_member): New.  Instantiate a member of an
5214         explicitly instantiated class template.
5215         (do_type_instantiation): Explicitly instantiate members of an
5216         explicitly instantiated class template.
5217         (instantiate_decl): if undefined_ok is nonzero, and if we're
5218         trying to explicitly instantiated a template with no definition,
5219         change it to an implicit instantiation.
5220         (instantiate_pending_templates): Add new argument to instantiate_decl.
5221         * tree.c (cp_cannot_inline_tree_fn): Likewise.
5222
5223 2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
5224
5225         * cp-tree.h: Fix typo.
5226
5227         * cp-tree.h: Include cgraph.h
5228         (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
5229         TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
5230
5231 2004-06-01  Jason Merrill  <jason@redhat.com>
5232
5233         PR c++/15142
5234         * call.c (call_builtin_trap): Remove type parm.
5235         (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
5236         (build_x_va_arg): Dereference a null pointer for a non-POD argument.
5237
5238 2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
5239
5240         PR c++/13092
5241         * init.c (build_offset_ref): Build SCOPE_REF with non-null
5242         TREE_TYPE for non-dependent names.
5243         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
5244         unknown_type_node as its TREE_TYPE.
5245         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
5246         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
5247         (dump_expr) <SCOPE_REF case>: Likewise.
5248
5249 2004-06-01  Richard Henderson  <rth@redhat.com>
5250             Andrew Pinski  <pinskia@physics.uc.edu>
5251
5252         * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
5253         * parser.c (struct cp_parser): Remove in_offsetof.
5254         (cp_parser_new): Don't set it.
5255         (cp_parser_unary_expression): Don't check it.
5256         (cp_parser_postfix_open_square_expression): Split out from ...
5257         (cp_parser_postfix_expression): ... here.
5258         (cp_parser_postfix_dot_deref_expression): Likewise.
5259         (cp_parser_builtin_offsetof): New.
5260         (cp_parser_primary_expression): Use it.
5261
5262 2004-06-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5263
5264         PR c++/14932
5265         * parser.c (cp_parser_postfix_expression): Allow subscript
5266         operator in offsetof.
5267
5268 2004-05-31  Mark Mitchell  <mark@codesourcery.com>
5269
5270         PR c++/15701
5271         * friend.c (add_friend): Do not try to perform access checks for
5272         functions from dependent classes.
5273
5274 2004-05-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5275
5276         * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
5277         (pp_cxx_begin_template_argument_list): Turn into a function.
5278         (pp_cxx_end_template_argument_list): Likewise.
5279         (pp_cxx_separate_with): Define.
5280         (pp_cxx_unqualified_id): Tidy.
5281         (pp_cxx_primary_expression): Likewise.
5282         (pp_cxx_postfix_expression): Likewise.
5283         (pp_cxx_expression): Likewise.
5284         (pp_cxx_simple_type_specifier): Likewise.
5285         (pp_cxx_type_specifier_seq): Likewise.
5286         (pp_cxx_parameter_declaration_clause): Likewise.
5287         (pp_cxx_exception_specification): Likewise.
5288         (pp_cxx_direct_declarator): Likewise.
5289         (pp_cxx_type_id): Likewise.
5290         * cxx-pretty-print.h (pp_cxx_whitespace): Export from
5291         cxx-pretty-print.c.
5292         (pp_cxx_left_paren): Likewise.
5293         (pp_cxx_right_paren): Likewise.
5294         (pp_cxx_left_brace): Likewise.
5295         (pp_cxx_right_brace): Likewise.
5296         (pp_cxx_left_bracket): Likewise.
5297         (pp_cxx_right_bracket): Likewise.
5298         (pp_cxx_dot): Likewise.
5299         (pp_cxx_identifier): Likewise.
5300         (pp_cxx_tree_identifier): Likewise.
5301         (pp_cxx_ampersand): New macro.
5302         (pp_cxx_star): Likewise.
5303         (pp_cxx_arrow): Likewise.
5304         (pp_cxx_semicolon): Likewise.
5305         (pp_cxx_complement): Likewise.
5306         (pp_cxx_begin_template_argument_list): Declaree.
5307         (pp_cxx_end_template_argument_list): Likewise.
5308         (pp_cxx_colon_colon): likewise.
5309
5310 2004-05-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
5311
5312         * parser.c (cp_parser_simple_type_specifier): Explicitly test
5313         against NULL_TREE.
5314
5315 2004-05-31  Kazu Hirata  <kazu@cs.umass.edu>
5316
5317         * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
5318         typeck.c: Fix comment formatting.
5319
5320 2004-05-30  Andrew Pinski  <pinskia@physics.uc.edu>
5321
5322         * cp-lang.c (cp_expand_decl): Remove.
5323         (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
5324
5325 2004-05-30  Andreas Jaeger  <aj@suse.de>
5326
5327         * lang-specs.h: Add missing initializers for .ii.
5328
5329 2004-05-28  Aldy Hernandez  <aldyh@redhat.com>
5330
5331         * decl.c (cp_make_fname_decl): Free return value from
5332         fname_as_string.
5333
5334 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
5335
5336         PR c++/15083
5337         * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
5338         even in a templat.e
5339         * init.c (build_new): Likewise.
5340
5341         PR c++/15640
5342         * name-lookup.c (arg_assoc): Robustify.
5343
5344         PR c++/15471
5345         * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
5346         when determining the scope to use for a pointer to member.
5347         (lookup_anon_field): Give it external linkage.
5348         * cp-tree.h (lookup_anon_field): Declare it.
5349         * expr.c (cplus_expand_constant): Use it.
5350
5351 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
5352
5353         PR c++/14668
5354         * parser.c (cp_parser_simple_type_specifier): Call
5355         maybe_note_name_used_in_class.
5356
5357 2004-05-28  Tom Marshall  <tmarshall@real.com>
5358
5359         PR c++/15214
5360         * class.c (finish_struct_1): Warn only if the dtor is non-private or
5361         the class has friends.
5362
5363 2004-05-27  Adam Nemet  <anemet@lnxw.com>
5364
5365         PR c++/12883
5366         * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
5367         TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
5368
5369 2004-05-24  Geoffrey Keating  <geoffk@apple.com>
5370
5371         * method.c (implicitly_declare_fn): Don't call defer_fn; abort
5372         if it might be needed.
5373         * pt.c (mark_decl_instantiated): Only call defer_fn if
5374         the function actually needs processing in finish_file.
5375         * decl2.c (finish_file): Add check that elements in
5376         deferred_fns_used are really needed there.  Remove unnecessary
5377         test of DECL_SAVED_TREE.
5378
5379 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
5380
5381         * Make-lang.in: No need to specify $(LIBCPP).
5382
5383 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
5384
5385         PR c++/15044
5386         * parser.c (cp_parser_class_head): Robustify.
5387
5388         PR c++/15317
5389         * parser.c (cp_parser_decl_specifier_seq): Correct error in
5390         comment.
5391         (cp_parser_constructor_declarator_p): Treat attributes
5392         as decl-specifiers.
5393
5394         PR c++/15329
5395         * typeck.c (build_unary_op): Do not attempt to resolve casts to
5396         base classes in templates.
5397
5398 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
5399
5400         PR c++/15165
5401         * pt.c (instantiate_template): Robustify.
5402
5403 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
5404
5405         PR c++/15025
5406         * decl.c (xref_tag): Issue errors about redeclaring template
5407         classes as non-template classes.
5408
5409 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
5410
5411         PR c++/14821
5412         * name-lookup.c (supplement_binding): Allow redefinitions of
5413         namespace aliases.
5414
5415         PR c++/14883
5416         * parser.c (cp_parser_template_argument): Robustify.
5417
5418 2004-05-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5419
5420         * class.c (alter_access): Use %E format specifier to print an
5421         identifier node.  Avoid looking at the IDENTIFIER_POINTER.
5422         (push_lang_context): Likewise.
5423         * decl.c (lookup_label): Likewise.
5424         (grokdeclarator): Likewise.
5425         * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
5426         * pt.c (do_type_instantiation): Likewise.
5427         * tree.c (handle_java_interface_attribute): Likewise.
5428         (handle_com_interface_attribute): Likewise.
5429         (handle_init_priority_attribute): Likewise.
5430
5431 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
5432
5433         PR c++/15285
5434         PR c++/15299
5435         * pt.c (build_non_dependent_expr): Expand the set of tree nodes
5436         recognized as overloaded functions.
5437
5438 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
5439
5440         PR c++/15507
5441         * class.c (layout_nonempty_base_or_field): Do not try to avoid
5442         layout conflicts for unions.
5443
5444         PR c++/15542
5445         * typeck.c (build_x_unary_op): Instantiate template class
5446         specializations before looking for "operator &".
5447
5448         PR c++/15427
5449         * typeck.c (complete_type): Layout non-dependent array types, even
5450         in templates.
5451
5452         PR c++/15287
5453         * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
5454         template.
5455
5456 2004-05-22  Roger Sayle  <roger@eyesopen.com>
5457
5458         * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
5459         returning when TREE_TYPE is error_mark_node.
5460         * typeck.c (require_complete_type): Return error_mark_node if
5461         value's type is an error_mark_node.
5462
5463 2004-05-20  Andrew Pinski  <pinskia@physics.uc.edu>
5464
5465         * optimize.c (calls_setjmp_r): Remove.
5466         (calls_setjmp_p): Remove.
5467         * cp-tree.c (calls_setjmp_p): Remove.
5468         * decl.c (finish_function): Do not call calls_setjmp_p.
5469
5470 2004-05-18  Zack Weinberg  <zack@codesourcery.com>
5471
5472         * decl.c (cp_finish_decl): Use mark_decl_referenced.
5473         * decl2.c (maybe_make_one_only): Likewise.
5474         * method.c (use_thunk): Likewise.
5475
5476 2004-05-18  Jason Merrill  <jason@redhat.com>
5477
5478         * class.c (build_base_path): Tidy a bit.
5479
5480 2004-05-14  Geoffrey Keating  <geoffk@apple.com>
5481
5482         * name-lookup.c (struct scope_binding): New.
5483         (EMPTY_SCOPE_BINDING): New.
5484         (lookup_using_namespace): Take a scope_binding instead of a
5485         cxx_binding.
5486         (qualified_lookup_using_namespace): Likewise.
5487         (cxx_binding_clear): Delete.
5488         (do_nonmember_using_decl): Use a scope_binding instead of a
5489         cxx_binding.
5490         (lookup_tag): Don't call select_decl.
5491         (ambiguous_decl): Don't return anything (and change callers to match).
5492         Take a scope_binding as the second parameter.
5493         (lookup_namespace_name): Use a scope_binding instead of a
5494         cxx_binding.
5495         (unqualified_namespace_lookup): Likewise.
5496         (lookup_qualified_name): Likewise.
5497         (select_decl): Take a scope_binding instead of a cxx_binding.
5498         Use macros rather than hand-coding tests for type-ness.
5499
5500 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
5501
5502         * cp-gimplify.c: Rename from cp-simplify.c.
5503         * Make-lang.in, optimize.c: Update.
5504
5505 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
5506
5507         Merge from tree-ssa-20020619-branch.  See
5508         ChangeLog.tree-ssa for details.
5509
5510         * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
5511         cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
5512         expr.c, init.c, name-lookup.h, optimize.c, parser.c,
5513         pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
5514         Merged.
5515         * cp-mudflap.c: New file.
5516         * cp-simplify.c:: New file.
5517
5518 2004-05-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5519
5520         PR c++/14389
5521         * decl2.c (check_classfn): For member templates, compare also the
5522         template parameters to match the declaration.
5523         * cp-tree.h: Adjust declaration of check_classfn.
5524         * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
5525         * friend.c (do_friend): Likewise.
5526         * pt.c (tsubst_friend_function): Likewise.
5527
5528 2004-05-01  Zack Weinberg  <zack@codesourcery.com>
5529
5530         * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
5531         Instead, dig into the representation type to find the array bound.
5532
5533 2004-04-30  Jason Merrill  <jason@redhat.com>
5534
5535         Refer to base members using COMPONENT_REFs where possible.
5536         * class.c (build_simple_base_path): New fn.
5537         (build_base_path): Use it for non-virtual base references.
5538         (layout_class_type): Change base fields to their real type
5539         after layout is done.
5540         * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
5541         * cp-lang.c (cxx_get_alias_set): Use it.
5542
5543 2004-04-30  Kazu Hirata  <kazu@cs.umass.edu>
5544
5545         * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
5546         comment typos.
5547
5548 2004-04-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5549
5550         PR c++/15064
5551         * parser.c (cp_parser_postfix_expression): typeid operator cannot be
5552         used in integral constant expressions.
5553
5554 2004-04-22  Mark Mitchell  <mark@codesourcery.com>
5555
5556         * init.c (build_aggr_init): Fix accidental use of C99 construct in
5557         previous change.
5558
5559         * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
5560         braced initializer.
5561         * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
5562         * decl.c (reshape_init): Use it.
5563         * init.c (perform_member_init): Remove redundant condition.
5564         (build_aggr_init): Adjust to handle brace-enclosed initializers
5565         correctly.
5566         (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
5567
5568         * parser.c (cp_parser_initializer_clause): Do not set
5569         TREE_HAS_CONSTRUCTOR on the initializer.
5570         * rtti.c (tinfo_base_init): Likewise.
5571         (generic_initializer): Likewise.
5572         (ptr_initializer): Likewise.
5573         (ptm_initializer): Likewise.
5574         (class_initializer): Likewise.
5575         (get_pseudo_ti_init): Likewise.
5576         * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
5577
5578 2004-04-22  Alan Modra  <amodra@bigpond.net.au>
5579
5580         * name-lookup.c (anonymous_namespace_name): Make static.
5581
5582 2004-04-19  Roger Sayle  <roger@eyesopen.com>
5583
5584         PR middle-end/14531
5585         * class.c (build_base_path): Call fold whilst building the NULL
5586         pointer check expression trees.
5587
5588 2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>
5589
5590         * init.c (build_new_1): Don't use type size argument for Java
5591         _Jv_AllocObject call.
5592
5593 2004-04-09  Danny Smith  <dannysmith@users.sourceforge.net>
5594
5595         * method.c (make_alias_for_thunk): Remove preprocessor guard on
5596         declaration and definition.
5597
5598 2004-04-08  Danny Smith  <dannysmith@users.sourceforge.net>
5599
5600         PR c++/14808
5601         * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
5602         than ASM_OUTPUT_DEF.
5603
5604 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5605
5606         * decl2.c (mark_used): Don't segfault if cfun != NULL but
5607         current_function_decl == NULL.
5608
5609 2004-04-05  Nathan Sidwell  <nathan@codesourcery.com>
5610
5611         PR c++/3518
5612         * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
5613         level.
5614
5615 2004-04-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5616
5617         * init.c (decl_constant_value): Don't look at DECL_INITIAL
5618         of PARM_DECL.
5619         * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
5620         or TREE_SIDE_EFFECTS of a type.
5621
5622 2004-04-02  Nathan Sidwell  <nathan@codesourcery.com>
5623
5624         PR c++/14007
5625         * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
5626         cv-qualifier unification.
5627         * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
5628
5629 2004-04-02  Jan Hubicka  <jh@suse.cz>
5630
5631         * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
5632         * cp-tree.h (cp_update_decl_after_saving): Declare.
5633         * tree.c (cp_update_decl_after_saving): Define.
5634
5635 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
5636
5637         PR c++/14803
5638         * typeck.c (get_delta_difference): Call fold before returning the
5639         value.
5640
5641 2004-04-01  Richard Henderson  <rth@redhat.com>
5642
5643         PR c++/14804
5644         * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
5645         * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
5646
5647 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
5648
5649         PR c++/14810
5650         * name-lookup.c (maybe_push_cleanup_level): Robustify.
5651
5652 2004-04-01  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5653
5654         * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
5655
5656 2004-03-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5657
5658         * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
5659         * class.c (check_bitfield_decl): Likewise.
5660         * cvt.c (type_promotes_to): Likewise.
5661         * decl.c (finish_enum): Likewise.
5662         * mangle.c (write_builtin_type): Likewise.
5663         * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
5664         * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
5665         (build_binary_op): Likewise.
5666
5667 2004-03-31  Jan Hubicka  <jh@suse.cz>
5668
5669         * tree.h (optimize_function): Kill prototype.
5670         * optimize.c (dump_function, optimize_function, dump_finction): Kill.
5671         * semantics.c (expand_body): Kill.
5672
5673 2004-03-30  Mark Mitchell  <mark@codesourcery.com>
5674
5675         PR c++/14724
5676         * decl.c (start_decl_1): Do not decide whether or not to create a
5677         new cleanup level until after the type has been completed.
5678
5679         PR c++/14763
5680         * pt.c (tsubst_default_argument): Clear current_function_decl.
5681
5682 2004-03-30  Zack Weinberg  <zack@codesourcery.com>
5683
5684         * name-lookup.c, parser.c: Use new shorter form of GTY markers.
5685
5686 2004-03-29  Zack Weinberg  <zack@codesourcery.com>
5687
5688         * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
5689         is null, just print the literal name and return.
5690
5691 2004-03-25  Kazu Hirata  <kazu@cs.umass.edu>
5692
5693         * cxx-pretty-print.c: Fix comment typos.
5694
5695 2004-03-24  Kazu Hirata  <kazu@cs.umass.edu>
5696
5697         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
5698         Update copyright.
5699
5700 2004-03-23  Ziemowit Laski  <zlaski@apple.com>
5701
5702         * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
5703         * mangle.c (write_type): Add call to 'mangle_fundamental_type'
5704         target hook.
5705
5706 2004-03-23  Zack Weinberg  <zack@codesourcery.com>
5707
5708         PR 12267, 12391, 12560, 13129, 14114, 14133
5709         * cp-lang.c (c_reset_state): Delete.
5710         (push_file_scope, pop_file_scope): New stubs.
5711         * parser.c (c_parse_file): Call sorry() here if called more than once.
5712
5713 2004-03-23  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5714
5715         * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
5716         for INTEGER_CST.
5717
5718 2004-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5719
5720         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
5721
5722 2004-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5723
5724         * error.c (enum pad): Remove.
5725         (dump_qualifiers): Likewise.
5726         (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
5727         (dump_aggr_type): Likewise.
5728         (dump_type_suffix): Likewise.
5729         (dump_simple_decl): Likewise.
5730         (dump_function_decl): Likewise.
5731         (cv_to_string): Likewise.
5732         (dump_type_prefix): Likewise.  Adjust return void.
5733         * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
5734         cxx_pretty_print.h.
5735         (pp_cxx_template_keyword_if_needed): Document.
5736         (pp_cxx_qualified_id): Document case FUNCTION_DECL.  Tidy.
5737         (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
5738         MUST_NOT_THROW_EXPR.
5739
5740 2004-03-21  Mark Mitchell  <mark@codesourcery.com>
5741
5742         PR c++/14616
5743         * decl.c (cp_finish_decl): Compute the size of arrays declared in
5744         templates, if their type is non-dependent.
5745
5746 2004-03-19  Mark Mitchell  <mark@codesourcery.com>
5747
5748         * call.c (build_op_delete_call): Do not forget the placement
5749         arguments when iterating through mutiple delete operators.
5750
5751         * cp-tree.h (svaed_scope): Remove last_parms.
5752         (NEW_DELETE_OPNAME_P): New macro.
5753         (last_function_parms): Remove.
5754         (do_friend): Adjust prototype.
5755         * decl.c (grokparms): Return the PARM_DECLs directly, rather than
5756         using last_function_parms.
5757         (grokfndecl): Take the PARM_DECLs as an argument, rather than
5758         using last_function_parms.
5759         (grokdeclarator): Adjust accordingly.  Do not form METHOD_TYPEs
5760         for class-specific operator new and operator delete.
5761         (grok_op_properties): Do not look for allocation functions with
5762         METHOD_TYPEs.
5763         (start_function): Use DECL_ARGUMENTS instead of
5764         last_function_parms.
5765         * decl.h (last_function_parms): Do not declare.
5766         * decl2.c (grokclassfn): Do not use last_function_parms.
5767         * friend.c (do_friend): Remove parmdecls parameter.
5768         * name-lookup.c (push_to_top_level): Do not save last_function_parms.
5769         (pop_from_top_level): Do not restore it.
5770         * pt.c (check_explicit_specialization): Do not adjust
5771         last_function_parms.
5772
5773         * name-lookup.c (do_local_using_decl): Create a local binding for
5774         types brought in via using declarations.
5775
5776         * name-lookup.c (lookup_arg_dependent): Handle block-scope
5777         function declarations correctly.
5778
5779         * semantics.c (finish_id_expression): Correct handling of
5780         conversion operators to dependent types.
5781
5782         * typeck.c (lookup_destructor): Allow the use of destructors from
5783         base classes.
5784
5785 2004-03-19  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5786
5787         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
5788         TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
5789         * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
5790         the field is named TEMPLATE_TYPE_PARM_INDEX.
5791
5792 2004-03-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5793
5794         PR c++/14545
5795         * parser.c (cp_parser_functional_cast): A cast to anything
5796         but integral or enumaration type is not an integral constant
5797         expression.
5798         * pt.c (value_dependent_expression_p): Handle cast expressions
5799         without operands (such as "int()").
5800
5801 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
5802
5803         * semantics.c (finish_pseudo_destructor_expr): Allow differing
5804         cv-qualification between the type named by the
5805         pseudo-destructor-name and the object-type.
5806
5807         * search.c (accessible_base_p): Handle non-proper bases.
5808
5809         * name-lookup.c (do_nonmember_using_decl): If a using declaration
5810         refers to a single overloaded function, set the type of the
5811         function.
5812         * tree.c (lvalue_type): Simplify.
5813         * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
5814         unknown type.
5815         (build_unary_op): Handle OVERLOADs with known types.
5816
5817         * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
5818         function templates.
5819
5820         * parser.c (cp_parser_postfix_expression): Handle the use of
5821         "typename" in non-dependent contexts.  Convert appropriately when
5822         when using a qualified name after "->" or ".".
5823
5824         * call.c (conditional_conversion): Honor the requirement that some
5825         conversions refer to the original object.
5826
5827 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
5828
5829         * call.c (build_conditional_expr): Do not call force_rvalue for
5830         operands of void_type when the conditional expression itself has
5831         void type.
5832         * name-lookup.c (pushdecl): Don't consider a declaration of a
5833         function named "main" to be an overload of a type named "main".
5834         * parser.c (cp_parser_template_name): Perform name lookup when the
5835         template name is proceeded by "template" if the qualifying scope
5836         is non-dependent.
5837         * typeck.c (composite_pointer_type_r): Correctly handle
5838         pointer-to-member types.
5839         (build_const_cast): Likewise.
5840
5841 2004-03-18  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5842
5843         * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
5844         * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
5845         (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
5846         (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
5847         (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
5848         (TYPEOF_TYPE_EXPR): New macro.
5849         * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
5850         * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
5851         * pt.c (tsubst): Likewise.
5852         * semantics.c (finish_typeof): Likewise.
5853         * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
5854         and TEMPLATE_TYPE_PARM.
5855         * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
5856         (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
5857
5858 2004-03-16  Mark Mitchell  <mark@codesourcery.com>
5859
5860         PR c++/14586
5861         * cp-tree.h (build_new_op): Change prototype.
5862         (build_x_binary_op): Likewise.
5863         * call.c (build_new_op): Add overloaded_p parameter.
5864         * decl2.c (grok_array_decl): Adjust call to build_new_op.
5865         * parser.c (cp_parser_binary_expression): Note that uses of
5866         overloaded operators prevents an expression from being considered
5867         an integral constant.
5868         * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
5869         build_x_binary_op.
5870         * semantics.c (finish_call_expr): Likewise.
5871         * typeck.c (rationalize_conditional_expr): Likewise.
5872         (build_x_indirect_ref): Likewise.
5873         (build_x_binary_op): Likewise.
5874         (build_x_unary_op): Likewise.
5875         (build_x_compound_expr): Likewise.
5876         (build_modify_expr): Likewise.
5877         * typeck2.c (build_x_arrow): Likewise.
5878
5879 2004-03-15  Kazu Hirata  <kazu@cs.umass.edu>
5880
5881         * cp-lang.c, ptree.c: Update copyright.
5882
5883 2004-03-13  Mark Mitchell  <mark@codesourcery.com>
5884
5885         PR c++/14550
5886         * parser.c (cp_parser_non_integral_constant_expression): Encode
5887         more of the idiom that surrounded calls to this function within
5888         the function itself
5889         (cp_parser_primary_expression): Adjust accordingly.
5890         (cp_parser_postfix_expression): Likewise.
5891         (cp_parser_unary_expression): Likewise.
5892         (cp_parser_cast_expression): Likewise.
5893         (cp_parser_assignment_expression): Likewise.
5894         (cp_parser_expression): Likewise.
5895         (cp_parser_new_expression): Note that new-expressions are not
5896         allowed in integral constant expressions.
5897         (cp_parser_delete_expression): Likewise.
5898
5899 2004-03-12  Matt Austern  <austern@apple.com>
5900
5901         * decl2.c (maybe_make_one_only): Look at
5902         TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
5903         to make an explicit instantiation weak.
5904         * method.c (use_thunk): Make sure we call comdat_linkage
5905         when appropriate.
5906         * pt.c (do_type_instantiation): On systems where weak symbols
5907         don't go in a static archive's TOC, explicit instantiation of a
5908         class must imply *explicit* instantiation of its memeber.
5909
5910 2004-03-11  Kazu Hirata  <kazu@cs.umass.edu>
5911
5912         * call.c, cp-tree.h, pt.c: Fix comment typos.
5913
5914 2004-03-10  Mark Mitchell  <mark@codesourcery.com>
5915
5916         PR c++/14510
5917         * decl.c (xref_tag): Disregard non-type declarations when
5918         looking up a tagged type.
5919
5920 2004-03-09  Nathan Sidwell  <nathan@codesourcery.com>
5921
5922         PR c++/14397
5923         * call.c (convert_like_real): Build a const qualified temporary,
5924         when testing ctor access.
5925
5926 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
5927
5928         * call.c (initialize_reference): Fix typo.
5929
5930 2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5931
5932         PR c++/14409
5933         * pt.c (determine_specialization): For member templates, match also
5934         constness.
5935
5936         PR c++/14448
5937         * parser.c (cp_parser_initializer_clause): Fold initializer if it is
5938         non-dependent.
5939         * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
5940
5941 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
5942
5943         PR c++/14230
5944         * call.c (initialize_reference): Handle initializers that are
5945         class-member access expressions applies to rvalues.
5946
5947 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
5948
5949         PR c++/14432
5950         * name-lookup.c (supplement_binding): Ignore functions that are
5951         marked DECL_ANTICIPATED.
5952
5953 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
5954
5955         PR c++/14401
5956         * class.c (check_field_decls): Complain about non-static data
5957         members of reference type in unions.  Propagate
5958         CLASSTYPE_REF_FIELDS_NEED_INIT and
5959         CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
5960         data members.
5961         * init.c (perform_member_init): Complain about mbmers with const
5962         type that are not explicitly initialized.
5963
5964 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
5965
5966         * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
5967         * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
5968         (lang_identifier): Remove implicit_decl and error_locus.
5969         (IDENTIFIER_IMPLICIT_DECL): Remove.
5970         (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
5971         (IDENTIFIER_ERROR_LOCUS): Likewise.
5972         (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
5973         (TYPE_ASSEMBLER_NAME_STRING): Likewise.
5974         (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
5975         (implicitly_declare): Remove.
5976         * decl.c (warn_extern_redeclared_static): Remove check of
5977         IDENTIFIER_IMPLICIT_DECL.
5978         (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
5979         (implicitly_declare): Remove.
5980         (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
5981         (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
5982         (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
5983         * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
5984         in the innermost scope, rather than at namespace scope.
5985         * name-lookup.c (push_local_binding): Give it external linkage.
5986         (pushdecl): Remove dead code.
5987         * name-lookup.h (push_local_binding): Declare it.
5988         * ptree.c (cxx_print_identifier): Don't print
5989         IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
5990         * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
5991         not IDENTIFIER_ERROR_LOCUS.
5992         * typeck.c (build_function_call): Remove dead code.
5993
5994 2004-03-08  Jason Merrill  <jason@redhat.com>
5995
5996         PR c++/13170
5997         * decl.c (xref_tag): Remove attribute handling.
5998         * cp-tree.h: Adjust prototype.
5999         * decl.c, parser.c, rtti.c: Adjust callers.
6000         * parser.c (cp_parser_class_head): Pass back attributes in the
6001         class head.
6002         (cp_parser_class_specifier): Adjust.
6003
6004 2004-03-08  Matt Austern  <austern@apple.com>
6005
6006         PR debug/14079
6007         * name-lookup.c (add_decl_to_level): Add extern variables, as well
6008         as static, to static_decls array.
6009
6010 2004-03-05  Jason Merrill  <jason@redhat.com>
6011
6012         * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
6013
6014 2004-03-04  Geoffrey Keating  <geoffk@apple.com>
6015
6016         * decl.c (grokfndecl): Update old incorrect comment.
6017         (grokvardecl): Diagnose C++ variables of type with no linkage.
6018
6019 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
6020
6021         PR c++/14369
6022         * pt.c (build_non_dependent_expr): Do not create a
6023         NON_DEPENDENT_EXPR for a THROW_EXPR.
6024
6025 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6026
6027         PR c++/14369
6028         * error.c (dump_expr): Handle THROW_EXPR.
6029
6030 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
6031
6032         PR c++/14360
6033         * parser.c (cp_parser_postfix_expression): Do not perform Koenig
6034         lookup if ordinary name-lookup finds a non-function.
6035         * pt.c (tsubst_copy_and_build): Likewise.
6036
6037         PR c++/14361
6038         * parser.c (cp_parser_late_parsing_default_args): Check that there
6039         are no extra tokens after the end of the default-argument
6040         expression.
6041
6042 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
6043
6044         PR c++/14324
6045         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
6046         having C++ linkage for name-mangling purposes.
6047
6048         PR c++/14260
6049         * parser.c (cp_parser_direct_declarator): Recognize constructor
6050         declarators that use a template-id to name the class being
6051         constructed.
6052
6053         PR c++/14337
6054         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
6055         (tsubst_expr): Do not call tsubst_copy, even when
6056         processing_template_decl.
6057
6058 2004-03-01  Jeff Law  <law@redhat.com>
6059
6060         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
6061         the proper type.
6062
6063 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
6064
6065         PR c++/14138
6066         * name-lookup.h (push_scope): Change prototype.
6067         * name-lookup.c (push_scope): Do not reenter the current class
6068         scope.
6069         * decl.c (grokfndecl): Check return code from push_scope before
6070         calling pop_scope.
6071         * decl2.c (check_classfn): Likewise.
6072         * parser.c (cp_parser_conversion_function_id): Likewise.
6073         (cp_parser_init_declarator): Likewise.
6074         (cp_parser_direct_declarator): Likewise.
6075         (cp_parser_class_specifier): Likewise.
6076         (cp_parser_class_head): Likewise.
6077         (cp_parser_lookup_name): Likewise.
6078         (cp_parser_constructor_declarator_p): Likewise.
6079         * pt.c (instantiate_class_template): Likewise.
6080         (resolve_typename_type): Likewise.
6081
6082 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
6083
6084         PR c++/14267
6085         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
6086         extension.
6087
6088         PR debug/12103
6089         * class.c (update_vtable_entry_for_fn): Do not go through
6090         covariance machinery if the type returned by an overrider is the
6091         same as the original.
6092
6093 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
6094
6095         * call.c: Fix a comment typo.
6096
6097 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
6098
6099         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
6100
6101 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
6102
6103         PR c++/14278
6104         * parser.c (cp_parser_parameter_declaration_list): Commit
6105         to fewer tentative parses.
6106
6107 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6108
6109         PR c++/14284
6110         * pt.c (dependent_type_p_r): A template template parameter is a
6111         dependent type.
6112
6113 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6114
6115         PR c++/14246
6116         * mangle.c (write_template_arg_literal): Don't rely on identity for
6117         boolean constants.
6118
6119 2004-02-24  Jason Merrill  <jason@redhat.com>
6120
6121         * tree.c (build_exception_variant): Use check_qualified_type.
6122
6123 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
6124             Kazu Hirata  <kazu@cs.umass.edu>
6125
6126         * decl.c (cxx_init_decl_processing): Don't check
6127         flag_writable_strings.
6128
6129 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
6130
6131         PR c++/14156
6132         * typeck.c (maybe_warn_about_returning_address_of_location):
6133         Change check for VAR_DECL to use DECL_P instead.
6134
6135 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6136
6137         PR c++/14250
6138         * cvt.c (build_expr_type_conversion): Type must be complete before
6139         looking up for conversions.
6140
6141 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6142
6143         PR c++/14143
6144         * name-lookup.c (arg_assoc_class): Don't look into template
6145         arguments if it is not a primary template.
6146
6147 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6148
6149         PR c++/12007
6150         * method.c (use_thunk): Always clone function argument tree.
6151
6152 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
6153
6154         PR c++/14199
6155         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
6156
6157         PR c++/14173
6158         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
6159         for all type variants.
6160
6161 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
6162
6163         PR c++/13927
6164         * decl.c (duplicate_decls): Return error_mark_node for invalid
6165         redeclarations.
6166         * name-lookup.c (push_namespace): Ignore the return value from
6167         pushdecl.
6168         * pt.c (push_template_decl_real): Robustify.
6169
6170         PR c++/14186
6171         * name-lookup.c (push_class_level_binding): Do not complain about
6172         adding a binding for a member whose name is the same as the
6173         enclosing class if the member is located in a base class of the
6174         current class.
6175
6176 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6177
6178         PR c++/14181
6179         * parser.c (cp_parser_new_expression): Parse an ill-formed
6180         direct-new-declarator after a parenthesized type-id to emit good
6181         diagnostic.
6182
6183 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
6184
6185         * cp-tree.def, cvt.c: Update copyright.
6186
6187 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
6188
6189         PR c++/11326
6190         * cp-tree.h (abi_version_at_least): Remove.
6191         * mangle.c: Include flags.h.
6192
6193 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
6194
6195         PR c++/13971
6196         * call.c (build_conditional_expr): Handle conversions between
6197         class types which result in differently cv-qualified type
6198         variants.
6199
6200         PR c++/14086
6201         * class.c (delete_duplicate_fields_1): Remove.
6202         (delete_duplicate_fields): Likewise.
6203         (finish_struct_anon): Remove check for members with the same name
6204         as their enclosing class.
6205         (check_field_decls): Do not call duplicate_fields.
6206         * decl.c (grokdeclarator): Remove check for static data members
6207         with the same name as their enclosing class.
6208         * name-lookup.c (push_class_level_binding): Check for members with
6209         the same name as their enclosing class.
6210
6211 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6212
6213         PR c++/14085
6214         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
6215
6216 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6217
6218         PR c++/13635
6219         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
6220         has full set of arguments.
6221
6222 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6223
6224         PR c++/13927
6225         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
6226
6227 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
6228
6229         PR c++/14122
6230         * cp-tree.h (delete_sanity): Change prototype.
6231         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
6232         Remove dead code.  Adjust code to warn about deleting an array.
6233         * typekc.c (decay_conversion): Use build_address and build_nop.
6234
6235         PR c++/14108
6236         * search.c (accessible_p): Do not check access in thunks.
6237
6238         PR c++/14083
6239         * call.c (build_conditional_expr): Call force_rvalue on the
6240         non-void operand in the case that one result is a throw-expression
6241         and the other is not.
6242
6243 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
6244
6245         PR c++/9851
6246         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
6247         the type name and look ahead for ::~, and bail out early with a
6248         better error message if the parse is going to fail.
6249
6250 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
6251
6252         * call.c (conversion_kind): New type.
6253         (conversion_rank): Likewise.
6254         (conversion): Likewise.
6255         (CONVERSION_RANK): New macro.
6256         (conversion_obstack): New variable.
6257         (obstack_initialized): Likewise.
6258         (z_candidate): Change type of convs and second_conv.
6259         (candidate_warning): New type.
6260         (IDENTITY_RANK): Remove.
6261         (EXACT_RANK): Likewise.
6262         (PROMO_RANK): Likewise.
6263         (STD_RANK): Likewise.
6264         (PBOOL_RANK): Likewise.
6265         (USER_RANK): Likewise.
6266         (ELLIPSIS_RANK): Likewise.
6267         (BAD_RANK): Likewise.
6268         (ICS_RANK): Likewise.
6269         (ICS_STD_RANK): Likewise.
6270         (ICS_USER_FLAG): Likewise.
6271         (ICS_ELLIPSIS_FLAG): Likewise.
6272         (ICS_THIS_FLAG): Likewise.
6273         (ICS_BAD_FLAG): Likewise.
6274         (NEED_TEMPORARY_P): Likewise.
6275         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
6276         (USER_CONV_CAND): Likewise.
6277         (USER_CONV_FN): Likewise.
6278         (conversion_obstack_alloc): New function.
6279         (alloc_conversion): Likewise.
6280         (validate_conversion_obstack): Likewise.
6281         (alloc_conversions): Likewise.
6282         (build_conv): Adjust to deal with new conversion data structures.
6283         (build_identity_conv): New function.
6284         (build_ambiguous_conv): Likewise.
6285         (standard_conversion): Adjust to deal with new conversion data
6286         structures.
6287         (convert_class_to_reference): Likewise.
6288         (direct_reference_binding): Likewise.
6289         (reference_binding): Likewise.
6290         (implicit_conversion): Likewise.
6291         (add_candidate): Likewise.
6292         (add_function_candidate): Likewise.
6293         (add_conv_candidate): Likewise.
6294         (build_builtin_candidate): Likewise.
6295         (print_z_candidate): Likewise.
6296         (merge_conversion_sequences): Likewise.
6297         (build_user_type_conversion_1): Likewise.
6298         (build_user_type_conversion): Likewise.
6299         (build_new_function_call): Likewise.
6300         (build_object_call): Likewise.
6301         (conditional_conversion): Likewise.
6302         (build_conditional_expr): Likewise.
6303         (build_new_op): Likewise.
6304         (build_op_delete_call): Likewise.
6305         (convert_like_real): Likewise.
6306         (build_over_call): Likewise.
6307         (build_new_method_call): Likewise.
6308         (is_subseq): Likewise.
6309         (maybe_handle_implicit_object): Likewise.
6310         (maybe_handle_ref_bind): Likewise.
6311         (compare_ics): Likewise.
6312         (source_type): Likewise.
6313         (add_warning): Likewise.
6314         (joust): Likewise.
6315         (can_convert_arg): Likewise.
6316         (can_convert_arg_bad): Likewise.
6317         (perform_implicit_conversion): Likewise.
6318         (perform_direct_initialization_if_possible): Likewise.
6319         (initialize_reference): Likewise.
6320         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
6321         * cp-tree.def (WRAPPER): Likewise.
6322         (IDENTITY_CONV): Remove.
6323         (LVALUE_CONV): Likewise.
6324         (QUAL_CONV): Likewise.
6325         (STD_CONV): Likewise.
6326         (PTR_CONV): Likewise.
6327         (PMEM_CONV): Likewise.
6328         (BASE_CONV): Likewise.
6329         (REF_BIND): Likewise.
6330         (USER_CONV): Likewise.
6331         (AMBIG_CONV): Likewise.
6332         (RVALUE_CONV): Likewise.
6333         * cp-tree.h (tree_wrapper): Remove.
6334         (WRAPPER_ZC): Remove.
6335         (lang_tree_node): Remove wrapper.
6336         (LOOKUP_SPECULATIVELY): Remove.
6337         (build_op_delete_call): Adjust prototype.
6338         (validate_conversion_obstack): Declare.
6339         (build_zc_wrapper): Remove.
6340         * cvt.c (convert_to_reference): Remove dead code.
6341         (ocp_convert): Likewise.
6342         * decl.c (redeclaration_error_message): Correct handling of
6343         templates.
6344         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
6345         (cp_tree_node_structure): Remove WRAPPER case.
6346         * decl2.c (finish_file): Call validate_conversion_obstack.
6347         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
6348         (build_op_delete_call): Likewise.
6349         (build_x_delete): Likewise.
6350         (build_delete): Adjust call to build_op_delete_call.
6351         * pt.c (tsubst_friend_declaration): Adjust code to determine
6352         whether or not a friend template is a definition.
6353         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
6354         * tree.c (build_zc_wrapper): Remove.
6355
6356 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
6357
6358         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
6359         * cp-tree.h: Don't declare cxx_builtin_type_decls.
6360         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
6361         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
6362
6363 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
6364
6365         * typeck.c (lookup_destructor): Fix typo in error message.
6366
6367 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
6368
6369         * call.c, parser.c, tree.c: Fix comment typos.
6370
6371 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
6372
6373         Bug 13856
6374         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
6375         * decl.c (duplicate_decls, start_function): Likewise.
6376
6377 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
6378
6379         * name-lookup.c (pushdecl): Issue shadow warnings directly.
6380         * parser.c (free_parser_stacks): Delete.
6381
6382 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
6383
6384         * rtti.c: Update copyright.
6385
6386 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6387
6388         PR c++/14033
6389         * decl.c (require_complete_types_for_parms): Do not insert
6390         error_mark_node in the parameter list.
6391
6392 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6393
6394         PR c++/14028
6395         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
6396         error when terminator can not be found.
6397
6398 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
6399
6400         Make-lang.in (po-generated):  Delete.
6401
6402 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
6403
6404         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
6405         targetm.calls.promote_prototypes.
6406
6407 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
6408
6409         PR middle-end/13750
6410         Revert:
6411         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
6412         PR pch/13361
6413         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
6414         (handle_pragma_implementation): Likewise.
6415
6416 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
6417
6418         PR c++/13714
6419         * typeck.c (lookup_destructor): Tweak error message.
6420
6421 2004-02-05  Jan Hubicka  <jh@suse.cz>
6422
6423         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
6424         functions.
6425
6426 2004-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6427
6428         PR c++/14008
6429         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
6430         code, only emits the diagnostic now. Added lookup of the identifier
6431         and support for qualified ids.
6432         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
6433         Parse an (invalid) type name as id-expression within a declarator.
6434         (cp_parser_simple_declaration): Use it.
6435         (cp_parser_member_declaration): Likewise.
6436         (cp_parser_make_typename_type): New function. Handle errors through
6437         cp_parser_diagnose_invalid_typename.
6438         (cp_parser_elaborated_type_specifier): Use it.
6439
6440 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
6441
6442         PR c++/13932
6443         * call.c (convert_like_real): Use "converting" rather than
6444         "argument" as the descriptive keyword to
6445         dubious_conversion_warnings.
6446         * typeck.c (convert_for_assignment): Do not call
6447         dubious_conversion_warnings.
6448
6449 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6450
6451         PR c++/13086
6452         * init.c (build_delete): Emit a more informative error message in
6453         case of an incomplete type, and on the correct source line.
6454
6455 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
6456
6457         * error.c, search.c: Update copyright.
6458
6459 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
6460
6461         PR c++/9941
6462         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
6463         linkage for the typeinfo name string.
6464
6465 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
6466
6467         PR c++/13969
6468         * cp-tree.h (fold_non_dependent_expr): New function.
6469         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
6470         (cp_parser_template_argument): Use fold_non_dependent_expr.
6471         (cp_parser_direct_declarator): Likewise.
6472         * pt.c (fold_non_dependent_expr): New function.
6473         (convert_nontype_argument): Use it.
6474         (tsubst_qualified_id): Simplify.
6475         (tsubst_copy_and_build): Likewise.
6476
6477 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
6478
6479         * decl.c (cxx_push_function_context): Do not set
6480         current_function_is_thunk.
6481         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
6482         actual function.
6483
6484 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6485
6486         PR c++/13997
6487         * pt.c (more_specialized_class): Increase processing_template_decl
6488         while partial ordering.
6489
6490 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
6491
6492         PR c++/13925
6493         * decl.c (start_function): Do not call pushdecl for any
6494         instantiation or specialization of a primary template.
6495
6496 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
6497
6498         PR c++/13950
6499         * parser.c (cp_parser_class_name): Robustify.
6500
6501         PR c++/13970
6502         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
6503
6504         PR c++/14002
6505         * semantics.c (finish_id_expression): Do not return an
6506         IDENTIFIER_NODE when lookup finds a PARM_DECL.
6507
6508 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
6509
6510         PR c++/13978
6511         * pt.c (build_non_dependent_expr): Do not build
6512         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
6513
6514         PR c++/13968
6515         * semantics.c (finish_id_expression): Do not return an
6516         IDENTIFIER_NODE when lookup finds a VAR_DECL.
6517
6518         PR c++/13975
6519         * parser.c (cp_parser_simple_declaration): When skipping to the
6520         end of the statement swallow the terminating semicolon.
6521
6522 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
6523
6524         PR c++/13113
6525         * init.c (build_offset_ref): Improve error recovery for invalid
6526         uses of non-static member functions.
6527
6528         PR c++/13854
6529         * cp-tree.h (cp_build_type_attribute_variant): New function.
6530         * class.c (build_clone): Use cp_build_type_attribute_variant.
6531         * decl.c (duplicate_decls): Likewise.
6532         * pt.c (copy_default_args_to_explicit_spec): Likewise.
6533         (tsubst_function_type): Likewise.
6534         * tree.c (build_exception_variant): Check attributes before
6535         concluding that two types are the same.
6536         (cp_build_type-attribute_variant): New method.
6537         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
6538
6539         PR c++/13907
6540         * call.c (convert_class_to_reference): Keep better track of
6541         pedantically invalid user-defined conversions.
6542
6543 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6544
6545         PR c++/13957
6546         * pt.c (tsubst_qualified_id): Improved error message when a type
6547         is expected but not found.
6548
6549 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
6550
6551         * class.c: Fix comment typos.
6552         * decl.c: Likewise.
6553         * error.c: Likewise.
6554         * parser.c: Likewise.
6555         * pt.c: Likewise.
6556         * search.c: Likewise.
6557         * typeck.c: Likewise.
6558
6559 2004-01-30  Richard Henderson  <rth@redhat.com>
6560
6561         PR c++/13693
6562         * method.c (use_thunk): Don't force_target_expr for void thunks.
6563         * tree.c (build_target_expr_with_type): Assert non-void type.
6564         (force_target_expr): Likewise.
6565
6566 2004-01-30  Michael Matz  <matz@suse.de>
6567
6568         * parser.c (cp_parser_labeled_statement): Accept case ranges.
6569
6570 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6571
6572         DR206
6573         PR c++/13813
6574         * decl.c (grokdeclarator): Check immediatly type completeness for
6575         non-dependent types.
6576
6577 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6578
6579         PR c++/13683
6580         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
6581         a sizeof expression.block
6582
6583 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
6584
6585         PR c++/13883
6586         * mangle.c (write_encoding): Correct encoding of member template
6587         constructors.
6588
6589 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6590
6591         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
6592         template name as it was `<::' (digraph typo).
6593         (cp_parser_nth_token_starts_template_argument_list_p): New function.
6594         (cp_parser_id_expression): Use it.
6595         (cp_parser_nested_name_specifier_opt): Likewise.
6596         (cp_parser_template_name): Likewise.
6597         (cp_parser_class_name): Likewise.
6598         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
6599
6600 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
6601
6602         PR c++/13791
6603         * typeck.c (merge_types): Do not merge attributes into
6604         TYPENAME_TYPEs.
6605
6606         PR c++/13736
6607         * parser.c (cp_parser_direct_declarator): Do not prevent
6608         backtracking inside a parenthesized declarator.
6609         (cp_parser_parameter_declaration): Fix typo in comment.
6610
6611 2004-01-28  Jan Hubicka  <jh@suse.cz>
6612
6613         * semantics.c (expand_body)  Do emit_associated_thunks before
6614         expansion.
6615
6616 2004-01-27  Devang Patel  <dpatel@apple.com>
6617
6618         * name-lookup.c: Include "debug.h"
6619         (do_namespace_alias): Invoke debug_hooks to emit debug info
6620         for namespace alias.
6621         (do_local_using_decl): Invoke debug_hooks to emit debug info
6622         for using decl.
6623         (do_class_using_decl): Same.
6624         (do_toplevel_using_decl): Same.
6625         (do_using_directive): Same.
6626         (cp_emit_debug_info_for_using): New function.
6627         * Make-lang.in (cp/parser.o): Depend on debug.h
6628         (cp/name-lookup.o): Same.
6629
6630 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6631
6632         * cp-tree.h (language_function, lang_type_header): Use
6633         BOOL_BITFIELD.
6634         * name-lookup.h (cp_binding_level): Likewise.
6635
6636 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
6637
6638         PR c++/13663
6639         * semantics.c (finish_for_expr): Check for unresolved overloaded
6640         functions.
6641
6642         * class.c (add_method): Just check processing_template_decl to
6643         determine whether or not we are within a template.
6644         * decl2.c (maybe_retrofit_in_chrg): Likewise.
6645         * init.c (decl_constant_value): Check the type of the declaration,
6646         not TREE_READONLY.
6647         * name-lookup.c (maybe_push_to_top_level): Rename to ...
6648         (push_to_top_level): ... this.
6649         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
6650         * pt.c (push_template_decl_real): Reorder condition for speed.
6651         (convert_template_argument): Use dependency-checking functions in
6652         place of uses_template_parms.
6653         (lookup_template_class): Avoid calling uses_template_parms more
6654         than once.
6655         (uses_template_parms): Reimplement, using dependency-checking
6656         functions.
6657         (instantiate_class_template): Use push_to_top_level, not
6658         maybe_push_to_top_level.
6659         (type_unification_real): Simplify.
6660         (type_dependent_expression_p): Handle OFFSET_REFs and
6661         TEMPLATE_DECLs.
6662         (any_dependent_template_arguments_p): Handle multiple levels of
6663         template argument.
6664         * semantics.c (expand_or_defer_fn): Do not check
6665         uses_template_parms for template instantiations.
6666         * typeck.c (comptypes): Avoid calling cp_type_quals.
6667
6668 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
6669
6670         PR c++/13833
6671         * call.c (build_over_call): Do not convert arguments when
6672         processing a template.
6673         * pt.c (build_non_dependent_expr): Do not build a
6674         NON_DEPENDENT_EXPR for arithmetic constants.
6675
6676 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6677
6678         PR c++/13810
6679         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
6680         returns a TYPE_DECL. no further lookup is required.
6681         * semantics.c (check_template_template_default_arg): A TYPE_DECL
6682         is invalid. Rework to give better diagnostics.
6683
6684 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6685
6686         PR c++/13797
6687         * pt.c (instantiate_class_template): Add an error_mark_node
6688         check.
6689         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
6690
6691 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
6692
6693         PR c++/13701
6694         * decl.c (finish_function): Move the call to
6695         finish_fname_decls below the call to
6696         finish_eh_spec_block.
6697
6698 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
6699
6700         * optimize.c, typeck2.c: Update copyright.
6701
6702 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
6703
6704         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
6705         init.c, mangle.c, typeck.c: Update copyright.
6706
6707 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
6708
6709         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
6710
6711 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
6712
6713         * Make-lang.in: Replace $(docdir) with doc.
6714         (c++.info, c++.srcinfo): Dummy entry.
6715         (c++.man, c++.srcman): New rules.
6716         (c++.install-man): Revamp rule.
6717
6718 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
6719
6720         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
6721         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
6722         immediate $(shell) instead of deferred backquote.
6723
6724 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
6725
6726         PR c++/13651
6727         * parser.c (cp_parser_postfix_expression): When encountering
6728         incomplete type on left-hand side of "->" or ".", treat the entire
6729         expression as erroneous.
6730
6731         PR c++/13592
6732         * call.c (build_field_call): Remove.
6733         (n_build_method_call): Likewise.
6734         (build_method_call): Likewise.
6735         (build_new_method_call): Do not call build_field_call.
6736         * class.c (n_build_method_call): Remove.
6737         (print_class_statistics): Do not print it.
6738         * cp-tree.h (build_method_call): Remove declaration.
6739         (finish_object_call_expr): Likewise.
6740         (build_new_1): Do not use build_method_call.
6741         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
6742         when the function appearing on the right-hand-side of "." or "->"
6743         is not actually a function.
6744         * pt.c (tsubst_copy_and_build): Likewise.
6745         * semantics.c (finish_object_call_expr): Remove.
6746
6747 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
6748
6749         PR c++/13710
6750         * pt.c (tsubst): Use finish_typeof.
6751
6752 2004-01-18  Jason Merrill  <jason@redhat.com>
6753
6754         PR c++/11725
6755         * except.c (build_throw): In a template, set
6756         current_function_returns_abnormally.
6757
6758 2004-01-17  Fred Fish  <fnf@intrinsity.com>
6759
6760         PR c++/11895
6761         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
6762         except don't call array_type_nelts() with a VECTOR_TYPE.
6763
6764 2004-01-16  Jan Hubicka  <jh@suse.cz>
6765
6766         * mangle.c (write_mangled_name): Remove inline modifier.
6767
6768 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
6769
6770         PR c++/13574
6771         * decl.c (compute_array_index_type): Fix grammar in comment.
6772         * init.c (build_zero_init): Handle zero-sized arrays correctly.
6773
6774         PR c++/13178
6775         * call.c (name_as_c_string): Print conversion operator names
6776         correctly.
6777
6778         PR c++/13478
6779         * call.c (initialize_reference): Pass -1 for inner parameter to
6780         convert_like_real.
6781
6782 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6783
6784         PR c++/13407
6785         * parser.c (cp_parser_base_specifier): Check for an invalid
6786         keyword `typename' and emit an user-friendly error message.
6787
6788 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
6789
6790         PR pch/13361
6791         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
6792         (handle_pragma_implementation): Likewise.
6793
6794 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6795
6796         PR c++/9259
6797         * typeck.c (build_class_member_access_expr): Allow to access members
6798         of the currently open class.
6799         (finish_class_member_access_expr): Likewise.
6800
6801 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
6802
6803         PR c++/13659
6804         * name-lookup.c (validate_nonmember_using_decl): Take scope and
6805         name by value, instead of computing them.
6806         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
6807         arguments.  Pass them to validate_nonmember_using_decl.
6808         * name-lookup.h (do_local_using_decl): Adjust.
6809         (do_toplevel_using_decl): Likewise.
6810         * parser.c (cp_parser_using_declaration): Likewise.
6811         * pt.c (tsubst_expr): Likewise.
6812
6813 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
6814
6815         PR c++/13594
6816         PR c++/13658
6817         * name-lookup.c (qualified_lookup_using_namespace): Search
6818         strongly-associated namespaces first, and only then try other
6819         namespaces.
6820
6821 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
6822
6823         * Make-lang.in (c++.srcextra): Dummy entry.
6824
6825 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6826
6827         PR c++/8856
6828         * parser.c (cp_parser_template_name): Don't try to parse a
6829         conversion-function-id, as it cannot be a template-name.
6830         (cp_parser_simple_type_specifier): Check for invalid template-ids
6831         even after a built-in type.
6832
6833 2004-01-14  Jan Hubicka  <jh@suse.cz>
6834
6835         PR c++/12850
6836         * pt.c (instantiate_decl):  Do not increase function_depth.
6837
6838 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
6839
6840         PR c++/9021
6841         PR c++/11005
6842         * parser.c (cp_parser_elaborated_type_specifier): Warn about
6843         attributes and discard.
6844         * decl.c (xref_tag): Don't overwite existing attributes with
6845         NULL_TREE.
6846
6847 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6848
6849         PR c++/12335
6850         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
6851         is no destructor while looking up a BIT_NOT_EXPR.
6852
6853 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
6854
6855         * cxxfilt.c: Remove unused file.
6856
6857 2004-01-14  Jan Hubicka  <jh@suse.cz>
6858
6859         Partial fix to PR c++/12850
6860         * decl2.c (mark_used): Do not proactively instantiate templates
6861         when compiling in unit-at-a-time or not optimizing.
6862         * optimize.c (maybe_clone_body): Do not increase function depth.
6863
6864 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6865
6866         PR c++/13474
6867         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
6868
6869 2004-01-12  Steven Bosscher  <stevenb@suse.de>
6870
6871         PR c++/13558
6872         * parser.c (cp_parser_member_declaration): Any non-type is also
6873         not a class or a function.
6874
6875 2004-01-12  Jason Merrill  <jason@redhat.com>
6876
6877         PR c++/12815
6878         * class.c (build_base_path): Do not mark vtable references as
6879         TREE_CONSTANT.
6880         (build_vtbl_ref_1): Likewise.
6881
6882 2004-01-12  Richard Henderson  <rth@redhat.com>
6883
6884         PR opt/10776
6885         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
6886         (store_init_value): Use it.
6887         * decl.c (check_initializer): Expect full initialization code
6888         from store_init_value.
6889         * init.c (expand_aggr_init_1): Likewise.
6890         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
6891
6892 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
6893
6894         * class.c (layout_class_type): For non-POD class types, also copy
6895         the DECL_SIZE and DECL_MODE of fields to the base class type.
6896
6897 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6898
6899         PR c++/13289
6900         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
6901         calling regenerate_decl_from_template.
6902
6903 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
6904
6905         PR c++/4100
6906         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
6907         decl-specifier occurring along with a class definition.
6908
6909 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
6910
6911         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
6912         clauses to comments describing declares_class_or_enum.
6913         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
6914         false.
6915
6916 2004-01-12  Jan Hubicka  <jh@suse.cz>
6917
6918         * pt.c (for_each_template_parm): Do not check for duplicates.
6919         (for_each_template_parm): Use walk_tree duplicate checking code.
6920
6921 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
6922
6923         PR c++/3478
6924         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
6925         is error_mark_node, don't add any more decl_specs.
6926         (cp_parser_init_declarator): After committing to a declaration, if
6927         the decl_specifiers start with error_mark_node, issue an error and
6928         change the type to "int".
6929
6930 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
6931
6932         PR bootstrap/7817
6933         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
6934
6935 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6936
6937         DR 337
6938         PR c++/9256
6939         * pt.c (tsubst): Substitution must fail if we are attempting to
6940         create an array with element type that is an abstract class type.
6941         * decl.c (cp_finish_decl): Strip pointers and array types recursively
6942         before calling abstract_virtuals_error.
6943
6944 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
6945
6946         * name-lookup.c (qualified_lookup_using_namespace): Consider
6947         strong using directives even if we've already found a binding.
6948
6949 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
6950
6951         * cp-tree.h (cxx_expand_expr): Change prototype.
6952         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
6953
6954 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6955
6956         PR c++/12573
6957         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
6958         looking into them recursively. They can be there because of the
6959         new __offsetof__ extension.
6960
6961 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
6962
6963         * parser.c (cp_parser_save_member_function_body): Mark the
6964         definition static.
6965
6966 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
6967
6968         PR c++/13057
6969         * class.c (build_clone): Copy type attributes from the original
6970         function to the clone.
6971
6972         PR c++/12815
6973         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
6974         references as constant.
6975
6976         PR c++/12132
6977         * parser.c (cp_parser_explicit_instantiation): Improve error
6978         recovery.
6979         (cp_parser_require): Improve indication of the error location.
6980
6981         PR c++/13451
6982         * parser.c (cp_parser_class_head): Reorder logic to check for
6983         invalid qualification.
6984
6985 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
6986
6987         PR c++/13157
6988         * name-lookup.c (lookup_using_namespace): Remove spacesp
6989         parameter.
6990         (unqualified_namespace_lookup): Likewise.
6991         (lookup_qualified_name): Adjust accordingly.
6992         (lookup_name_real): Likewise.
6993         (lookup_arg_dependent): Do not eliminate the namespace of the
6994         functions found by unqualified name lookup unless that is the
6995         current namespace.
6996
6997 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
6998
6999         * semantics.c (push_deferring_access_checks): Fix format.
7000         (resume_deferring_access_checks): Likewise.
7001         (stop_deferring_access_checks): Likewise.
7002         (pop_deferring_access_checks): Likewise.
7003         (get_deferred_access_checks): Likewise.
7004         (pop_to_parent_deferring_access_checks): Likewise.
7005         (perform_deferred_access_checks): Likewise.
7006         (perform_or_defer_access_check): Likewise.
7007
7008 2004-01-04  Richard Henderson  <rth@redhat.com>
7009
7010         * call.c (build_over_call): Don't create a save_expr of an
7011         aggregate, but rather its address.
7012
7013 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
7014
7015         PR c++/13529
7016         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
7017         an offsetof expression.
7018
7019         * parser.c (cp_parser_parameter_declaration): Fix comment.
7020
7021         PR c++/12226
7022         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
7023         (reference_binding): Set it when appropriate.
7024         (build_temp): New function, split out from ...
7025         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
7026         (initialize_reference): Likewise.
7027
7028         PR c++/13536
7029         * parser.c (cp_parser): Add in_type_id_in_expr_p.
7030         (cp_parser_new): Initialize it.
7031         (cp_parser_postfix_expression): Set it.
7032         (cp_parser_sizeof_operand): Likewise.
7033         (cp_parser_parameteR_declaration): Do not commit early to tenative
7034         parsers when in_type_id_in_expr_p is set.
7035
7036 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
7037
7038         PR c++/13094
7039         * parser.c (cp_parser_template_argument): Don't call
7040         make_unbound_class_template directly.
7041         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
7042         UNBOUND_CLASS_TEMPLATE tree node.
7043
7044 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
7045
7046         PR target/12729
7047         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
7048
7049 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
7050
7051         PR c++/13520
7052         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
7053         (DECL_FUNCTION_TEMPLATE_P): Use it.
7054         (DECL_CLASS_TEMPLATE_P): Likewise.
7055         * parser.c (cp_parser_lookup_name): Add is_template parameter.
7056         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
7057         (cp_parser_template_name): Likewise.
7058         (cp_parser_elaborated_type_specifier): Likewise.
7059         (cp_parser_namespace_name): Likewise.
7060         (cp_parser_class_name): Likewise.
7061         (cp_parser_lookup_name_simple): Likewise.
7062
7063 See ChangeLog.3 for earlier changes.