OSDN Git Service

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