OSDN Git Service

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