re PR middle-end/17407 (ICE in int_mode_for_mode)
[gcc.git] / gcc / cp / ChangeLog
1 2004-10-25 Andrew Pinski <pinskia@physics.uc.edu>
2
3 PR c++/18121
4 * decl.c (grokdeclarator) <case cdk_array>: Remove the call
5 layout_type as it is already done by create_array_type_for_decl.
6
7 2004-10-22 Nathan Sidwell <nathan@codesourcery.com>
8
9 PR c++/18095
10 * parser.c (eof_token): Make const, correctly initialize rid and
11 location fields.
12 (struct cp_lexer): Replace buffer_end pointer with buffer_length
13 count. Adjust.
14 (cp_lexer_new_main): Directly grow lexer's buffer here. Don't
15 zero it out.
16 (cp_lexer_new_from_tokens): Adjust.
17 (cp_lexer_grow_buffer): Remove.
18 (cp_lexer_peek_nth_token, cp_lexer_consume_token,
19 cp_lexer_purge_token): Add const casts.
20
21 2004-10-21 Mark Mitchell <mark@codesourcery.com>
22
23 PR c++/18073
24 PR c++/10841
25 * cp-tree.h (convert_to_base): Change prototype.
26 (build_ptrmemfunc): Likewise.
27 (convert_ptrmem): New function.
28 * call.c (struct conversion): Adjust documentation for base_p.
29 (standard_conversion): Set base_p for ck_pmem conversions as
30 appropriate.
31 (convert_like_real): Use convert_to_base for ck_pmem and ck_ptr
32 conversions.
33 * class.c (convert_to_base): Handle both pointers and objects.
34 Add nonnull parameter.
35 (build_vfield_ref): Adjust call to convert_to_base.
36 * cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc.
37 (convert_force): Likewise.
38 * typeck.c (build_unary_op): Likewise.
39 (convert_ptrmem): New function.
40 (build_static_cast_1): Use it.
41 (build_reinterpret_cast): Allow conversions to vector types.
42 (get_delta_difference): Add c_cast_p parameter.
43 (build_ptrmemfunc): Likewise. Adjust calls to
44 get_delta_difference.
45
46 2004-10-21 Andrew Pinski <pinskia@physics.uc.edu>
47
48 PR c++/13560
49 * error.c (cp_error_at): Output the context as it might be
50 different file as the other location.
51
52 2004-10-21 Kazu Hirata <kazu@cs.umass.edu>
53
54 * typeck.c: Fix a comment typo.
55
56 2004-10-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
57
58 PR c++/13495
59 * decl.c (make_unbound_class_template): Add PARM_LIST parameter.
60 * cp-tree.h (make_unbound_class_template): Adjust prototype.
61 * parser.c (cp_parser_lookup_name): Adjust call to
62 make_unbound_class_template.
63 (cp_parser_single_declaration): Handle member class of class
64 template as template friend parsing correctly.
65 * friend.c (is_friend): Call is_specialization_of_friend for
66 template friend class.
67 (make_friend_class): Handle member class of class template as
68 template friend.
69 * pt.c (is_specialization_of_friend): Likewise.
70 (instantiate_class_template): Likewise.
71 (tsubst): Adjust call to make_unbound_class_template.
72
73 2004-10-20 Nathan Sidwell <nathan@codesourcery.com>
74
75 * typeck.c (composite_pointer_type): Add comment about DR 195
76 (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter.
77 Allow function pointer conversions that DR195 suggests.
78 (build_reinterpret_cast, build_c_cast): Update
79 build_reinterpret_cast_1 calls.
80
81 2004-10-20 Kazu Hirata <kazu@cs.umass.edu>
82
83 * call.c, typeck.c: Fix comment typos.
84
85 2004-10-20 Nathan Sidwell <nathan@codesourcery.com>
86
87 * parser.c (cp_token_position): New typedef. Define VEC thereof.
88 (struct cp_lexer): Allow buffer and buffer_end to be NULL. Make
89 next_token and last_token cp_token_position. Make saved_tokens a
90 VEC(cp_token_position).
91 (eof_token): New static variable.
92 (CP_SAVED_TOKENS_SIZE): Rename to ...
93 (CP_SAVED_TOKEN_STACK): ... here.
94 (cp_lexer_new_main): Adjust main lexer creation and buffer
95 filling.
96 (cp_lexer_new_from_tokens): Do not copy the tokens, merely point
97 to the parent buffer. Do not append eof token.
98 (cp_lexer_destroy): Only free buffer if non-NULL. Free token
99 stack.
100 (cp_lexer_next_token, cp_lexer_prev_token): Remove.
101 (cp_lexer_token_position, cp_lexer_token_at): New.
102 (cp_lexer_saving_tokens): Adjust. Make inline.
103 (cp_lexer_advance_token, cp_lexer_token_difference): Remove.
104 (cp_lexer_peek_token_emit_debug_info): Fold into ...
105 (cp_lexer_peek_token): ... here.
106 (cp_lexer_peek_nth_token): Don't peek past EOF.
107 (cp_lexer_consume_token): Set next_token to eof_token, if reaching
108 EOF.
109 (cp_lexer_purge_token): Adjust eof setting.
110 (cp_lexer_purge_tokens_after): Likewise.
111 (cp_lexer_save_tokens): Push next_token directly.
112 (cp_lexer_commit_tokens): Adjust.
113 (cp_lexer_rollback_tokens): Pop next_token directly.
114 (cp_parser_check_for_invalid_template_id): Adjust token purging.
115 (cp_parser_translation_unit): Do not consume the EOF.
116 (cp_parser_nested_name_specifier_opt): Adjust token purging.
117 (cp_parser_template_id, cp_parser_template_name): Likewise.
118
119 2004-10-19 Mark Mitchell <mark@codesourcery.com>
120
121 PR c++/14035
122 * call.c (struct conversion): Add base_p.
123 (convert_like): Add c_cast_p argument.
124 (convert_like_with_conversion): Likewise.
125 (build_conv): Clear base_p.
126 (standard_conversion): Set it, for derived-to-base conversions.
127 (convert_like_real): Add c_cast_p parameter. Handle pointer
128 conversions directly rather than relying on ocp_convert.
129 (perform_direct_initialization_if_possible): Add c_cast_p
130 parameter.
131 * cp-tree.h (perform_direct_initialization_if_possible): Change
132 prototype.
133 (convert_member_func_to_ptr): New function.
134 * typeck.c (check_for_casting_away_constness): Add diag_fn
135 parameter.
136 (build_static_cast_1): New function, split out from ...
137 (build_static_cast): ... here. Use build_static_cast_1.
138 (build_reinterpret_cast_1): New function, split out from ...
139 (build_reinterpret_cast): ... here. Use build_reinterpret_cast_1.
140 (build_const_cast_1): New function, split out from ...
141 (build_const_cast): ... here. Use build_const_cast_1.
142 (build_c_cast): Rewrite to use build_const_cast_1,
143 build_static_cast_1, and build_reinterpret_cast_1.
144 (convert_member_func_to_ptr): New function.
145
146 2004-10-19 Paolo Bonzini <bonzini@gnu.org>
147
148 PR c++/18047
149 * parser.c (enum cp_parser_prec): Give relational expressions
150 a higher precedence than equality expressions.
151
152 2004-10-15 Nathan Sidwell <nathan@codesourcery.com>
153
154 * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call.
155 (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove.
156 (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call.
157 (enum base_access): Reorganize.
158 (accessible_base_p, accessible_p): Add consider_local_p parameter.
159 * call.c (standard_conversion): Update comment about
160 DERIVED_FROM_P.
161 (enforce_access): Adjust accessible_p call.
162 (build_over_call): Adjust accessible_base_p call.
163 * class.c (convert_to_base): Adjust lookup_base call.
164 (build_vtbl_ref_1): Likewise.
165 (warn_about_ambiguous_bases): Likewise. Add early exit.
166 * cvt.c (convert_to_pointer_force) Adjust lookup_base call.
167 * search.c (accessible_base_p): Add consider_local_p parameter.
168 (lookup_base): Pass consider_local_p to accessible_base_p call.
169 (friend_accessible_p): Check whether scope is a class member.
170 Remove unnecessary class template check.
171 (accessible_p): Add consider_local_p parameter. Use it.
172 (adjust_result_of_qualified_name_lookup): Adjust lookup_base call.
173 * tree.c (maybe_dummy_object): Likewise.
174 * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P.
175 (build_class_member_access_expr): Adjust lookup_base call.
176 * typeck2.c (binfo_or_else): Likewise.
177 * rtti.c (build_dynamic_cast_1): Access can consider friendship
178 and current scope.
179
180 2004-10-17 Giovanni Bajo <giovannibajo@gcc.gnu.org>
181
182 PR c++/17743
183 * decl2.c (grokfield): Apply attributes also to TYPE_DECLs.
184
185 2004-10-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
186
187 PR c++/10479
188 * parser.c (cp_parser_parenthesized_expression_list): Fold
189 non-dependent expressions in attribute lists.
190
191 2004-10-15 Mark Mitchell <mark@codesourcery.com>
192
193 PR c++/17042
194 * decl.c (declare_global_var): Use the return value from pushdecl.
195
196 PR c++/14667
197 * parser.c (cp_parser_simple_declaration): Do not diagnose invalid
198 type names if we have already found a valid type.
199 (cp_parser_member_declaration): Likewise.
200
201 PR c++/17916
202 * parser.c (cp_parser_member_specification_opt): Handle
203 CPP_PRAGMA.
204
205 2004-10-15 Kazu Hirata <kazu@cs.umass.edu>
206
207 * dump.c, g++spec.c, repo.c: Update copyright.
208
209 2004-10-15 Kazu Hirata <kazu@cs.umass.edu>
210
211 * decl.c: Fix a comment typo.
212
213 2004-10-13 Andrew Pinski <pinskia@physics.uc.edu>
214
215 PR c++/16301
216 * name-lookup.c (parse_using_directive): If we have a
217 error_mark_node, do not set the decl namespace associations
218 on it.
219
220 2004-10-14 Mark Mitchell <mark@codesourcery.com>
221
222 PR c++/17976
223 * decl.c (cp_finish_decl): Do not call expand_static_init more
224 than once for a single variable.
225
226 2004-10-14 Matt Austern <austern@apple.com>
227
228 * Make-lang.in (pt.o): depends on pointer-set.h
229 * cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now.
230 * pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
231 (for_each_template_parm): Convert from htab_t to pointer_set_t.
232 * tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
233
234 2004-10-13 Andrew Pinski <pinskia@physics.uc.edu>
235
236 PR c++/17661
237 * semantics.c (finish_for_expr): Convert expression to void
238 so that we don't create temporaries for a?b:c.
239
240 2004-10-13 Kazu Hirata <kazu@cs.umass.edu>
241
242 * search.c: Fix a comment typo.
243
244 2004-10-12 Nathan Sidwell <nathan@codesourcery.com>
245
246 * class.c (dfs_modify_vtables): Simplify condition. Return
247 dfs_skip_bases as appropriate.
248 (modify_all_vtables): Walk in pre-order.
249 * search.c (dfs_walk_all, dfs_walk_once_r,
250 dfs_walk_once_accessible_r): Assert post order function never
251 returns dfs_skip_bases.
252
253 * search.c (struct lookup_base_data_s): New.
254 (lookup_base_r): Replace with ...
255 (dfs_lookup_base): ... this.
256 (lookup_base): Use dfs_walk_all.
257
258 2004-10-12 Kazu Hirata <kazu@cs.umass.edu>
259
260 * search.c: Fix comment typos.
261
262 2004-10-11 Mark Mitchell <mark@codesourcery.com>
263
264 PR c++/15786
265 * parser.c (cp_parser_declarator): Add member_p parameter.
266 (cp_parser_condition): Adjust calls to cp_parser_declarator.
267 (cp_parser_explicit_instantiation): Likewise.
268 (cp_parser_init_declarator): Likewise.
269 (cp_parser_direct_declarator): Add member_p parameter. Do not
270 parse tentatively when parsing the parameters to a member.
271 (cp_parser_type_id): Adjust calls to cp_parser_declarator.
272 (cp_parser_parameter_declaration): Likewise.
273 (cp_parser_member_declaration): Likewise.
274 (cp_parser_exception_declaration): Likewise.
275
276 PR c++/17936
277 * cp-tree.h (CLASSTYPE_TEMPLATE_SPECIALIZATION): Add a comment.
278 * pt.c (optimize_specialization_lookup_p): Do not optimize lookups
279 for members of partial or explicit specializations.
280
281 PR c++/17929
282 * decl2.c (finish_anon_union): Robustify.
283
284 2004-10-11 Nathan Sidwell <nathan@codesourcery.com>
285
286 * cp-tree.h (get_dynamic_cast_base_type): Rename to ...
287 (dcast_base_hint): ... here.
288 * rtti.c (build_dynamic_cast_1): Use dcast_base_hint.
289 * search.c (struct dcast_data_s): New.
290 (dynamic_cast_base_recurse): Remove. Replace with ...
291 (dfs_dcast_hint_pre, dfs_dcast_base_post): ... these. New.
292 (get_dynamic_cast_base_type): Rename to ...
293 (dcast_base_hint): ... here. Use dfs_walk_once_accessible.
294 (accessible_r): Remove.
295 (dfs_accessible_post): New, broken out of accessible_r.
296 (accessible_p): Use dfs_walk_once_accessible.
297 (dfs_walk_once_accessible_r): New. From accessible_r.
298 (dfs_walk_once_accessible): New. From acessible_p.
299
300 * cp-tree.h (SAME_BINFO_TYPE_P): New.
301 * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare
302 binfo types.
303 (convert_to_base_statically, determine_primary_bases,
304 update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits,
305 dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
306 accumulate_vtbl_inits, dfs_accumulate_vtbl_inits,
307 build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise.
308 * init.c (expand_member_init): Likewise.
309 * search.c (lookup_base_r, dynamic_cast_base_recurse,
310 binfo_via_virtual, copied_binfo, binfo_for_vbase,
311 original_binfo): Likewise.
312 * tree.c (copy_binfo): Likewise.
313
314 2004-10-11 Kazu Hirata <kazu@cs.umass.edu>
315
316 * semantics.c: Fix comment typos.
317
318 2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
319
320 PR c++/17554
321 part of c++/17657
322 middle-end/17703
323 * semantics.c (maybe_cleanup_point_expr): Call
324 fold_build_cleanup_point_expr.
325 (maybe_cleanup_point_expr_void): New function.
326 (add_decl_expr): Call maybe_cleanup_point_expr_void.
327 (finish_expr_stmt): Likewise.
328 (finish_return_stmt): Likewise.
329 (finish_for_expr): Likewise.
330 (finish_asm_stmt): Likewise.
331 * typeck.c (condition_conversion): Call
332 fold_build_cleanup_point_expr.
333
334 2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
335
336 PR c++/17907
337 * semantics.c (add_decl_expr): If the decl has a size which
338 has side effects then the decl expression needs a cleanup point.
339
340 2004-10-10 Mark Mitchell <mark@codesourcery.com>
341
342 PR c++/17393
343 * decl.c (grokdeclarator): Robustify error-recovery on invalid
344 declarations.
345
346 2004-10-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
347
348 Convert diagnostics to use quoting flag q 7/n
349 * typeck.c (composite_pointer_type_r, composite_pointer_type,
350 cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr,
351 string_conv_p, build_class_member_access_expr,
352 build_class_member_access_expr, lookup_destructor,
353 finish_class_member_access_expr, build_indirect_ref,
354 get_member_function_from_ptrfunc, build_function_call,
355 convert_arguments, build_binary_op, pointer_diff, build_unary_op,
356 check_for_casting_away_constness, build_static_cast,
357 build_reinterpret_cast, build_const_cast, build_c_cast,
358 build_modify_expr, get_delta_difference, build_ptrmemfunc,
359 dubious_conversion_warnings, convert_for_assignment,
360 convert_for_initialization,
361 maybe_warn_about_returning_address_of_local, check_return_expr):
362 Use quoting marks.
363
364 * typeck2.c (error_not_base_type, readonly_error,
365 abstract_virtuals_error, cxx_incomplete_type_diagnostic,
366 store_init_value, digest_init, build_x_arrow,
367 build_m_component_ref, require_complete_eh_spec_types): Likewise.
368
369 * tree.c (cp_build_qualified_type_real,
370 handle_java_interface_attribute, handle_init_priority_attribute):
371 Likewise.
372
373 * semantics.c (finish_asm_stmt, finish_non_static_data_member,
374 finish_pseudo_destructor_expr,
375 check_template_template_default_arg, begin_class_definition,
376 finish_base_specifier, qualified_name_lookup_error,
377 finish_id_expression, finish_typeof): Likewise.
378
379 * search.c (lookup_base, check_final_overrider,
380 look_for_overrides_r): Likewise.
381
382 * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise.
383
384 2004-10-09 Mark Mitchell <mark@codesourcery.com>
385
386 PR c++/17867
387 * error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a
388 constructor.
389
390 PR c++/17670
391 * init.c (build_new): Correct comments.
392 * parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in
393 the non-array case.
394
395 PR c++/17821
396 * parser.c (cp_parser_postfix_dot_deref_expression): If the
397 pseduo-destructor-name production does not work, fall back to the
398 ordinary production.
399
400 PR c++/17826
401 * tree.c (cp_tree_equal): Handle a BASELINK.
402
403 PR c++/17524
404 * cp-tree.h (check_var_type): New function.
405 * decl.c (check_var_type): New function, split out from ...
406 (grokdeclarator): ... here.
407 * pt.c (tsubst_decl): Use check_var_type.
408
409 PR c++/17685
410 * decl.c (grokdeclarator): Disallow declarations of operators as
411 non-functions.
412
413 2004-10-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
414
415 PR c++/17868
416 * error.c (dump_expr): Add missing case for RDIV_EXPR.
417
418 2004-10-08 Kazu Hirata <kazu@cs.umass.edu>
419
420 * pt.c, search.c: Fix comment typos.
421
422 2004-10-08 Nathan Sidwell <nathan@codesourcery.com>
423
424 * cp-tree.h (dfs_walk, dfs_walk_real, dfs_unmark, markedp,
425 unmarkedp): Remove.
426 (dfs_skip_bases, dfs_walk_all, dfs_walk_once): New.
427 * class.c (struct find_final_overrider_data): Remove most_derived,
428 vpath_list and vpath fields. Add path field.
429 (dfs_find_final_ocerrider_1): Add DEPTH parameter. Adjust.
430 (dfs_find_final_overrider): Rename to ...
431 (dfs_find_final_overrider_pre): ... here. Adjust.
432 (dfs_find_final_overrider_post): Adjust.
433 (dfs_find_final_overrider_q): Fold into
434 dfs_find_final_overrider_pre.
435 (find_final_overrider): Adjust dfs searching.
436 (dfs_modify_vtables): Don't mark binfo here.
437 (modify_all_vtables): Use dfs_walk_once.
438 (build_vtt_inits): Likwise. Use dfs_walk_all.
439 (dfs_build_secondary_vptr_vtt_inits): Don't mark binfo here.
440 Return dfs_skip_bases as appropriate.
441 (dfs_fixup_binfo_vtbls): Return dfs_skip_bases as appropriate.
442 * init.c (dfs_initialized_vtbl_ptrs): Return dfs_skip_bases as
443 appropriate. Don't mark binfo here.
444 (initialize_vtbl_ptrs): Use dfs_walk_once.
445 * search.c (struct vbase_info): Remove unused struct.
446 (access_in_type): Use dfs_walk_once.
447 (dfs_access_in_type): Don't mark binfo here.
448 (dfs_accessible_queue_p, dfs_accessible_p) Remove.
449 Fold into ...
450 (accessible_r): ... here. New. Specialize dfs_walk_once.
451 (accessible_p): Use accessible_r.
452 (lookup_field_queue_p): Remove. Fold into ...
453 (lookup_field_r): ... here. Adjust.
454 (lookup_member): Use dfs_walk_all.
455 (dfs_walk_real, dfs_walk): Replace with ...
456 (dfs_walk_all, dfs_walk_once): ... these.
457 (dfs_walk_once_r, dfs_unmark_r): Workers for dfs_walk_once.
458 (dfs_unmark, unmarkedp, markedp): Remove.
459 (dfs_get_pure_virtuals): Don't mark binfo here.
460 (get_pure_virtuals): Use dfs_walk_once.
461 (dfs_debug_unmarked_p): Remove. Fold into ...
462 (dfs_debug_mark): ... here.
463 (note_debug_info_needed): Use dfs_walk_all.
464
465 2004-10-07 Andrew Pinski <pinskia@physics.uc.edu>
466
467 * pt.c (tsubst_expr) <case ASM_EXPR>: Look passed the
468 CLEANUP_POINT_EXPR to get the asm expression.
469
470 2004-10-07 Mark Mitchell <mark@codesourcery.com>
471
472 * cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
473 (DECL_MEMBER_TEMPLATE_P): New macro.
474 (is_member_template): Remove.
475 (class_method_index_for_fn): New function.
476 * pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P.
477 * class.c (finish_struct_methods): Remove out-of-date comment.
478 * decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P.
479 * decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and
480 class_method_index_for_fn.
481 * pt.c (is_member_template): Remove.
482 (is_member_template_class): Likewise.
483 (optimize_specialization_lookup_p): New function.
484 (retrieve_specialization): Optimize lookups for members that are
485 not member templates.
486 (register_specialization): Adjust accordingly.
487 (build_template_decl): Add member_template_p parameter. Set
488 DECL_MEMBER_TEMPLATE_P.
489 (process_partial_specialization): Adjust call to
490 retrieve_specialization.
491 (push_template_decl_real): Determine whether the template is a
492 member template.
493 (lookup_template_class): Use retrieve_specialization.
494 (tsubst_decl): Adjust call to retrieve_specialization.
495 (tsubst_exception_specification): New function.
496 (tsubst): Use it.
497 (tsubst_copy): Use DECL_MEMBER_TEMPLATE_P.
498 (instantiate_template): Adjust call to retrieve_specialization.
499 (regenerate_decl_from_template): Do not actually generate a new
500 DECL.
501 (instantiate_decl): Adjust call to retrieve_specialization.
502 (class_method_index_for_fn): New method.
503
504 2004-10-07 Andrew Pinski <pinskia@physics.uc.edu>
505
506 * parser.c (cp_parser_asm_definition): Look passed the
507 CLEANUP_POINT_EXPR to get the asm expression.
508
509 2004-10-06 Andrew Pinski <pinskia@physics.uc.edu>
510
511 PR c++/17368
512 * semantics.c (finish_asm_stmt): Asm expressions need cleanup
513 also.
514
515 2004-10-05 Gabriel Dos Reis <gdr@integrable-solutions.net>
516
517 Convert diagnostics to use quoting flag q 6/n
518 * pt.c (finish_member_template_decl, check_specialization_scope,
519 maybe_process_partial_specialization, determine_specialization,
520 check_explicit_specialization, maybe_check_template_type,
521 process_partial_specialization, check_default_tmpl_args,
522 push_template_decl_real, redeclare_class_template,
523 convert_nontype_argument, coerce_template_parms,
524 lookup_template_class, push_tinst_level,
525 instantiate_class_template, tsubst_arg_types,
526 tsubst_function_type, tsubst, tsubst_qualified_id,
527 tsubst_copy_and_build, check_instantiated_args,
528 do_decl_instantiation, do_type_instantiation,
529 invalid_nontype_parm_type_p, check_specialization_namespace,
530 convert_template_argument, determine_specialization,
531 check_template_shadow, tsubst_decl
532 instantiate_pending_templates): Use quoting marks.
533
534 2004-10-05 Nathan Sidwell <nathan@codesourcery.com>
535
536 PR c++/17829
537 * parser.c (cp_parser_postfix_expression): Inhibit Koenig when
538 unqualified lookup finds a member function.
539
540 2004-10-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
541
542 Convert diagnostics to use quoting flag q 5/n
543 * parser.c (cp_parser_name_lookup_error,
544 cp_parser_diagnose_invalid_type_name,
545 cp_parser_primary_expression, cp_parser_unqualified_id,
546 cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement,
547 cp_parser_jump_statement, cp_parser_simple_declaration,
548 cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id,
549 cp_parser_type_parameter, cp_parser_template_id,
550 cp_parser_template_name, cp_parser_direct_declarator,
551 cp_parser_parameter_declaration_list, cp_parser_class_head,
552 cp_parser_base_specifier, cp_parser_lookup_name,
553 cp_parser_late_parsing_default_args,
554 cp_parser_optional_template_keyword
555 cp_parser_elaborated_type_specifier, cp_parser_check_class_key,
556 cp_parser_check_access_in_redeclaration): Use quoting marks.
557
558 * name-lookup.c (supplement_binding, pushdecl,
559 check_for_out_of_scope_variable, validate_nonmember_using_decl,
560 do_nonmember_using_decl, lookup_tag, set_decl_namespace,
561 push_namespace, do_namespace_alias, do_using_directive,
562 ambiguous_decl, lookup_namespace_name, add_function): Likewise.
563
564 * method.c (use_thunk): Likewise.
565
566 * lex.c (unqualified_name_lookup_error,
567 unqualified_fn_lookup_error): Likewise.
568
569 2004-10-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
570
571 Convert diagnostics to use quoting flag q 4/n
572 * except.c (decl_is_java_type, build_throw,
573 is_admissible_throw_operand, check_handlers_1, check_handlers):
574 Use quoting formats.
575 * friend.c (add_friend, make_friend_class, do_friend): Likewise.
576 * init.c (sort_mem_initializers, emit_mem_initializers,
577 member_init_ok_or_else, expand_member_init, is_aggr_type,
578 build_offset_ref, build_java_class_ref): Likewise.
579
580 2004-10-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
581
582 Convert diagnostics to use quoting flag q 3/n
583 * decl.c (pop_label, duplicate_decls, redeclaration_error_message,
584 redeclaration_error_message, lookup_label, check_goto,
585 make_typename_type, make_unbound_class_template,
586 fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1,
587 grok_reference_init, layout_var_decl, maybe_commonize_var,
588 check_for_uninitialized_const_var, reshape_init_array,
589 reshape_init, check_initializer, cp_finish_decl,
590 member_function_or_else, bad_specifiers, grokfndecl, grokvardecl,
591 check_static_variable_definition, compute_array_index_type,
592 create_array_type_for_decl, check_special_function_return_type,
593 grokdeclarator, check_default_argument, grokparms,
594 grok_ctor_properties, grok_op_properties,
595 check_elaborated_type_specifier, xref_tag, finish_enum,
596 build_enumerator, check_function_type, start_preparsed_function,
597 store_parm_decls): Use quoting formats.
598 * decl2.c (grok_array_decl, delete_sanity, check_member_template,
599 check_java_method, check_classfn, finish_static_data_member_decl,
600 grokfield, grokbitfield, grok_function_init,
601 build_anon_union_vars, coerce_new_type, coerce_delete_type,
602 check_default_args): Likewise.
603 * parser.c (cp_parser_decl_specifier_seq): Likewise.
604
605 2004-10-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
606
607 Convert diagnostics to use quoting flag q 2/n
608 * class.c (build_base_path, add_method, alter_access,
609 handle_using_decl, check_bases,
610 maybe_warn_about_overly_private_class, find_final_overrider,
611 warn_hidden, finish_struct_anon, add_implicitly_declared_members,
612 check_bitfield_decl, check_field_decls, layout_empty_base,
613 build_base_field, check_methods, layout_virtual_bases,
614 warn_about_ambiguous_bases, layout_class_type, finish_struct_1,
615 resolve_address_of_overloaded_function, instantiate_type,
616 note_name_declared_in_class): Use format flag "q" for quoting.
617
618 2004-10-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
619
620 Convert diagnostics to use quoting flag q 1/n
621 * error.c (locate_error): Ignore quoting flag q.
622 * call.c (build_user_type_conversion_1, build_operator_new_call,
623 build_object_call, op_error, build_conditional_expr,
624 build_new_op, build_op_delete_call, enforce_access,
625 convert_like_real, convert_arg_to_ellipsis, build_x_va_arg,
626 convert_default_arg, build_over_call, build_new_method_call,
627 joust, perform_implicit_conversion, initialize_reference): Use the
628 quoting flag q.
629
630 2004-10-03 Andrew Pinski <pinskia@physics.uc.edu>
631
632 PR c++/17797
633 * typeck.c (build_reinterpret_cast): Return if the inner type
634 is error_mark_node.
635
636 2004-10-01 Jan Hubicka <jh@suse.cz>
637
638 * semantics.c (expand_body): Update call of tree_rest_of_compilation.
639
640 2004-09-30 Nathan Sidwell <nathan@codesourcery.com>
641
642 * cp-tree.h (struct lang_decl): Shrink by reordering fields and
643 turning operator_code and fixed_offset into bitfields.
644
645 2004-09-29 Joseph S. Myers <jsm@polyomino.org.uk>
646
647 * decl.c (duplicate_decls): Merge TREE_DEPRECATED.
648
649 2004-09-29 Jason Merrill <jason@redhat.com>
650
651 PR tree-optimization/17697
652 * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl.
653
654 2004-09-28 Jason Merrill <jason@redhat.com>
655
656 PR middle-end/17525
657 * class.c (build_base_field): Set TYPE_MODE.
658
659 2004-09-28 Roger Sayle <roger@eyesopen.com>
660
661 PR driver/17537
662 * g++spec.c (lang_specific_driver): Unrecognized libraries, other
663 than -lc and -lm, may require linking against libstc++.
664
665 2004-09-28 Kazu Hirata <kazu@cs.umass.edu>
666
667 * tree.c: Fix a comment typo.
668
669 2004-09-28 Nathan Sidwell <nathan@codesourcery.com>
670
671 * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove.
672 (struct secondary_vptr_vtt_init_data_s): New.
673 (build_vtt_inits): Adjust dfs_walkers.
674 (dfs_build_secondary_vptr_vtt_inits): Caller data is a
675 secondary_vptr_vtt_init_data_s structure. Adjust.
676 (dfs_ctor_vtable_bases_queue_p): Remove.
677 (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify.
678
679 * pt.c (struct get_template_base_data_s): Remove.
680 (get_template_base_r): Fold into get_template_base.
681 (get_template_base): Walk base binfos directly in inheritance
682 graph order.
683
684 2004-09-27 Mark Mitchell <mark@codesourcery.com>
685
686 PR c++/17642
687 * cp-tree.h (fold_if_not_in_template): New function.
688 * call.c (build_conditional_expr): Use fold_if_not_in_template.
689 (build_cxx_call): Likewise.
690 * cvt.c (convert_to_complex): Likewise.
691 (ocp_convert): Likewise.
692 (convert): Likewise.
693 (convert_force): Likewise.
694 * decl.c (compute_array_index_type): Clear
695 processing_template_decl while folding array bounds.
696 * pt.c (convert_nontype_argument): Clear
697 processing_template_decl while processing non-type argument
698 initialization.
699 * tree.c (fold_if_not_in_template): New function.
700 * typeck.c (build_class_member_access_expr): Use
701 fold_if_not_in_template.
702 (build_array_ref): Likewise.
703 (build_binary_op): Likewise. Do not try to optimize computations
704 when processing templates.
705 (cp_pointer_int_sum): Use fold_if_not_in_template.
706 (pointer_diff): Likewise.
707 (build_unary_op): Likewise.
708 (build_reinterpret_cast): Likewise.
709 (get_delta_difference): Likewise.
710 (expand_ptrmemfunc_cst): Likewise.
711 (dubious_conversion_warnings): Likewise.
712
713 2004-09-27 Matt Austern <austern@apple.com>
714
715 * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c
716 (cp_lexer_get_preprocessor_token): Set implicit_extern_c for
717 tokens that come from headers that are implicitly extern "C".
718 (struct cp_parser): new one-bit field, implicit_extern_c.
719 (cp_parser_new): Set parser's implicit_extern_c to false.
720 (cp_parser_translation_unit): Pop lang context if we were in a
721 header that was implicitly extern "C".
722 (cp_parser_declaration_seq_opt): Push/pop lang context as
723 required by the token's and parser's implicit_extern_c.
724
725 2004-09-27 Mark Mitchell <mark@codesourcery.com>
726
727 PR c++/17585
728 * cp-tree.h (shared_member_p): Declare.
729 * search.c (shared_member_p): Give it external linkage.
730 * semantics.c (finish_qualified_id_expr): Use it.
731 (finish_id_expression): Likewise.
732
733 PR c++/17585
734 * semantics.c (finish_id_expression): Do not add "this->" to
735 static member functions.
736
737 2004-09-27 Nathan Sidwell <nathan@codesourcery.com>
738
739 PR c++/17681
740 * error.c (dump_type): Change TREE_VEC case into TREE_BINFO.
741
742 * class.c (struct count_depth_data): Remove.
743 (dfs_depth_post, dfs_depth_q): Remove.
744 (find_final_overrider): Use number of vbase classes as depth
745 bound.
746
747 * cp-tree.h (types_overlap_p): Remove.
748 * search.c (struct overlap_info): Remove.
749 (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove.
750
751 * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove.
752 (get_template_base_recursive): Remove. Replace with ...
753 (get_template_base_r): ... this.
754 (struct get_template_base_data_s): New.
755 (get_template_base): Use get_template_base_r via dfs_walk. Always
756 return NULL on failure.
757 (unify): Remove error_mark_node check from get_template_base result.
758
759 2004-09-24 Paolo Bonzini <bonzini@gnu.org>
760
761 * parser.c (cp_parser_expression_stack): Clarify why it is
762 an array of NUM_PREC_VALUES elements.
763 (cp_parser_binary_expression): Clarify why we do not need to
764 handle stack overflow.
765
766 2004-09-24 Nathan Sidwell <nathan@codesourcery.com>
767
768 PR c++/16889
769 * search.c (lookup_field_queue_p): Correct check for hidden base.
770
771 * search.c (bfs_walk): Remove.
772 (lookup_member): Use dfs_walk_real.
773 (dfs_walk_real): Move and adjust documentation from bfs_walk.
774
775 2004-09-23 Zack Weinberg <zack@codesourcery.com>
776
777 * decl.c (grokfndecl): If ::main is found not to return int,
778 correct it after issuing a diagnostic.
779 (grokdeclarator): If the incoming type was error_mark_node, do
780 not complain about declaring something with no type.
781 (start_function): Change check for ::main not returning int to
782 an assertion, as grokfndecl now catches this when the user did it.
783 * init.c (perform_member_init, sort_mem_initializers)
784 (emit_mem_initializers): Make most diagnostics be issued on
785 the line of current_function_decl, not whatever the current
786 input line is.
787 * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
788 definition and declaration with #ifdef ENABLE_CHECKING.
789 Avoid unnecessary use of fprintf.
790 (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
791 definitions to avoid warnings.
792 (cp_lexer_new_main): Add assertion that first token is not a
793 padding token.
794 (cp_lexer_new_from_token_array): Fold into ...
795 (cp_lexer_new_from_tokens): ... here. Add assertion that
796 first token is not a padding token.
797 (cp_lexer_set_source_position_from_token): Move nearer to callers.
798 Remove unused lexer argument.
799 (cp_lexer_peek_token): Just print debugging report (if enabled)
800 and return lexer->next_token.
801 (cp_lexer_skip_purged_tokens): Delete.
802 (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
803 inline, simplify bodies.
804 (cp_lexer_peek_nth_token): Add debugging report a la
805 cp_lexer_peek_token.
806 (cp_lexer_consume_token): Correct commentary. Advance over
807 purged tokens here. Set current source position here, from
808 token to be returned. Avoid unnecessary use of fprintf.
809 (cp_lexer_purge_token): Advance next_token pointer over this and
810 subsequent purged tokens.
811 (cp_parser_error): Adjust source position to that of the
812 peeked token.
813 (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
814 (cp_parser_string_literal): Remove some excessive cleverness.
815 (cp_parser_enum_specifier): Call start_enum before consuming
816 the opening brace.
817 (cp_parser_member_declaration): Make the "extra semicolon"
818 diagnostic consistently-worded with the other place this is
819 diagnosed. Explicitly set the diagnostic location to the
820 location of the offending semicolon.
821 (cp_parser_enclosed_template_argument_list): Use %</%> quoting
822 in diagnostics. Do not use cp_parser_require. Set location
823 of diagnostics about improper use of '>>' to location of
824 offending token.
825 (cp_parser_late_parsing_for_member):
826 Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
827 (cp_parser_late_parsing_default_args): Likewise. Manually
828 move some logic outside the loop.
829
830 2004-09-23 Andrew Pinski <pinskia@physics.uc.edu>
831
832 PR c++/17618
833 * cvt.c (cp_convert_to_pointer): Return early when the type is
834 an error_mark_node.
835
836 2004-09-21 Fariborz Jahanian <fjahanian@apple.com>
837
838 PR c++/13989
839 PR c++/9844
840 * decl.c (grokfndecl): Add new argument "attrlist", use it
841 to call cplus_decl_attributes.
842 (start_function): Remove call to cplus_decl_attributes.
843 * cvt.c (ocp_convert): Add support to use type conversion
844 function to vector type.
845 * parser.c (cp_parser_conversion_type_id): Add attributes, if any,
846 to the parsed type.
847
848 2004-09-23 Paolo Bonzini <bonzini@gnu.org>
849
850 PR c++/17596
851
852 * parser.c (cp_parser_token_tree_map_node,
853 cp_parser_pm_expression, cp_parser_additive_expression,
854 cp_parser_multiplicative_expression, cp_parser_shift_expression,
855 cp_parser_relational_expression, cp_parser_equality_expression,
856 cp_parser_and_expression, cp_parser_exclusive_or_expression,
857 cp_parser_inclusive_or_expression,
858 cp_parser_logical_and_expression,
859 cp_parser_logical_or_expression): Removed.
860 (enum cp_parser_prec, struct cp_parser_token_tree_map_node,
861 binops, binops_by_token): New.
862 (cp_parser_assignment_expression): Use cp_parser_binary_expression.
863 (cp_parser_new): Initialize binops_by_token.
864 (cp_parser_binary_expression): Rewritten.
865 (N_CP_TTYPES): New.
866
867 2004-09-23 Kazu Hirata <kazu@cs.umass.edu>
868
869 * parser.c: Fix a comment typo.
870
871 2004-09-23 Nathan Sidwell <nathan@codesourcery.com>
872
873 PR c++/17620
874 * decl.c (xref_basetypes): Look through typedefs before checking
875 for duplicate base.
876
877 2004-09-22 Nathan Sidwell <nathan@codesourcery.com>
878
879 * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
880 * decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
881 * rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
882 (init_rtti_processing): Initialize it to something realistic.
883 (get_tinfo_decl): Adjust pushing the new decl.
884
885 * cp-tree.h (struct lang_type_class): Remove marked flags, add
886 diamond_shaped and repeated_base flags. Reorder to keep 8-bit blocks.
887 (TYPE_MARKED_P): New.
888 (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New.
889 (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
890 CLEAR_CLASSTYPE_MARKED_N): Remove.
891 (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*,
892 CLEAR_CLASSTYPE_MARKED_*): Remove.
893 * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond
894 shaped and repeated base properties.
895 * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET.
896 * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark,
897 class_hint_flags): Remove.
898 (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
899 CLASSTYPE_DIAMOND_SHAPED_P.
900
901 2004-09-21 Ziemowit Laski <zlaski@apple.com>
902
903 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
904 cp-objcp-common.h.
905 (objcp_tsubst_copy_and_build): Reformat function signature.
906 * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
907 (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.
908
909 2004-09-21 Zack Weinberg <zack@codesourcery.com>
910
911 * parser.c (cp_lexer_peek_token, cp_lexer_consume_token):
912 Don't handle CPP_PRAGMA tokens specially.
913 (cp_lexer_handle_pragma): Use cp_lexer_consume_token. Don't
914 purge the token; do clear token->value after processing. Add
915 assertion at beginning that token->value is nonzero.
916 (cp_parser_statement, cp_parser_declaration_seq_opt): Handle
917 CPP_PRAGMA as a full statement or declaration in its own right.
918
919 2004-09-21 Matt Austern <austern@apple.com>
920
921 PR c++/15049
922 * decl.c (grokvardecl): Accept declarations of global variables
923 using anonymous types.
924
925 2004-09-21 Roger Sayle <roger@eyesopen.com>
926
927 PR c++/7503
928 * tree.c (lvalue_p_1): Disallow MIN_EXPR and MAX_EXPR as lvalues
929 if either operand has side-effects.
930 * typeck.c (rationalize_conditional_expr): Assert that neither
931 operand of MIN_EXPR or MAX_EXPR has side-effects.
932 (build_modify_expr): Add support for MIN_EXPR and MAX_EXPR.
933 Check that the "lhs" is a valid lvalue, i.e. that neither operand
934 of a MIN_EXPR or MAX_EXPR has a side-effect.
935
936 2004-09-21 Nathan Sidwell <nathan@codesourcery.com>
937
938 * cp-tree.h (struct lang_type_header): Remove
939 uses_multiple_inheritance field.
940 (TYPE_USES_MULTIPLE_INHERITANCE): Remove.
941 (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
942 (TYPE_USES_VIRTUAL_BASECLASSES): Remove.
943 (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
944 (TYPE_CONTAINS_VPTR_P): Likewise.
945 * call.c (add_template_candidate_real): Use
946 CLASSTYPE_VBASECLASSES.
947 (build_special_member_call): Likewise.
948 * class.c (finish_struct_bits): Remove
949 TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
950 bookkeeping.
951 (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
952 (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
953 bookkeeping.
954 (build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
955 (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
956 Likewise.
957 * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
958 TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
959 bookkeeping.
960 (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
961 * decl2.c (maybe_retrofit_in_chrg): Likewise.
962 * init.c (expand_member, push_base_cleanups): Likewise.
963 * pt.c (instantiate_class_template): Remove
964 TYPE_USES_MULTIPLE_INHERITANCE,
965 TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
966 bookkeeping.
967 * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
968 check.
969 * typeck2.c (process_init_constructor): Replace some sorrys with
970 asserts.
971
972 2004-09-21 Andreas Tobler <a.tobler@schweiz.ch>
973
974 * decl.c (reshape_init_array): Initialize max_index_cst to fix
975 bootstrap failure.
976
977 2004-09-20 Mark Mitchell <mark@codesourcery.com>
978
979 PR c++/17530
980 * pt.c (tsubst): Fix parentheses to accomodate emacs.
981 (tsubst_baselink): If we get a single function, mark it as used.
982
983 2004-09-20 Matt Austern <austern@apple.com>
984 Zack Weinberg <zack@codesourcery.com>
985
986 * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
987 Apply lbasename to input_filename before passing to get_fileinfo.
988 * semantics.c (begin_class_definition): Likewise.
989 * lex.c (handle_pragma_interface): Apply get_fileinfo to the
990 correct filename. Rename variables to be less confusing.
991 (handle_pragma_implementation): Likewise. Disable "appears
992 after file is included" diagnostic.
993
994 * parser.c (struct cp_token): Add in_system_header fiag.
995 (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
996 (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
997 (CPP_NONE, cp_lexer_read_token): Delete.
998 (struct cp_lexer): Remove first_token, string_tokens,
999 main_lexer_p fields. Clarify comments.
1000 (struct cp_token_cache): Now just a pair of pointers.
1001 (CP_LEXER_BUFFER_SIZE): New #define.
1002 (CPP_PURGED): New fake token type.
1003 (cp_lexer_new_from_token_array, cp_lexer_destroy)
1004 (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
1005 (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
1006 New functions.
1007 (cp_lexer_new_from_tokens): Now a simple wrapper around
1008 cp_lexer_new_from_token_array.
1009 (cp_lexer_set_source_position_from_token): Also update
1010 in_system_header.
1011 (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
1012 Don't wrap round.
1013 (cp_lexer_token_difference): Dont handle wrapping round.
1014 (cp_lexer_new_main): Enable pragma deferral and raw strings,
1015 read the entire translation unit through c_lex_with_flags into
1016 this lexer's buffer, then turn raw strings back off again.
1017 (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
1018 (cp_lexer_get_preprocessor_token): No need to handle not being
1019 the main lexer. Set token->in_system_header too.
1020 (cp_lexer_peek_token): Skip purged tokens. Feed pragma tokens
1021 to cp_lexer_handle_pragma. No need to call cp_lexer_read_token.
1022 (cp_lexer_peek_nth_token): Likewise.
1023 (cp_lexer_purge_token): Mark the token PURGED, don't shift all
1024 the other tokens down.
1025 (cp_lexer_purge_tokens_after): Likewise.
1026 (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
1027 about there being no tokens.
1028 (cp_lexer_print_token): Revise to give useful information on
1029 all tokens.
1030 (struct cp_parser): Add field translate_strings_p.
1031 (cp_parser_new): Initialize it.
1032 (cp_parser_translation_unit): Destroy the lexer when done.
1033 (cp_parser_parameter_declaration): Restructure saving of
1034 default arguments.
1035 (cp_parser_save_member_function_body): Likewise.
1036 (cp_parser_check_for_invalid_template_id)
1037 (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
1038 Adjust calls to cp_lexer_advance_token.
1039 (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
1040 No need to fiddle c_lex_string_translate.
1041 (cp_parser_primary_expression, cp_parser_linkage_specification)
1042 (cp_parser_asm_definition, cp_parser_asm_specification_opt)
1043 (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
1044 Use cp_parser_string_literal.
1045 (cp_parser_attribute_list): Save and restore
1046 parser->translate_strings_p, not c_lex_string_translate.
1047 (cp_parser_cache_group): Delete.
1048 (cp_parser_cache_group_1): Rename cp_parser_cache_group. Do
1049 not take a cache argument.
1050
1051 2004-09-20 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1052
1053 PR c++/14179
1054 * decl.c (reshape_init): Extract array handling into...
1055 (reshape_init_array): New function. Use integers instead of trees
1056 for indices. Handle out-of-range designated initializers.
1057
1058 2004-09-20 Steven Bosscher <stevenb@suse.de>
1059
1060 * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
1061 to null_node.
1062
1063 2004-09-19 Mark Mitchell <mark@codesourcery.com>
1064
1065 * decl2.c (determine_visibility): Allow class visibility
1066 directives to override targetm.cxx.export_class_data.
1067
1068 2004-09-18 Kazu Hirata <kazu@cs.umass.edu>
1069
1070 * call.c, semantics.c: Follow spelling conventions.
1071 * class.c: Fix a comment typo.
1072
1073 2004-09-16 Geoffrey Keating <geoffk@apple.com>
1074
1075 PR pch/13361
1076 * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
1077 (handle_pragma_implementation): Likewise.
1078
1079 2004-09-17 Jeffrey D. Oldham <oldham@codesourcery.com>
1080 Zack Weinberg <zack@codesourcery.com>
1081
1082 * cp-tree.def: Use tree_code_class enumeration constants
1083 instead of code letters.
1084 * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
1085 * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
1086 Update for new tree-class enumeration constants.
1087
1088 2004-09-16 Mark Mitchell <mark@codesourcery.com>
1089
1090 PR c++/16002
1091 * parser.c (cp_parser_simple_declaration): Commit to tentative
1092 parses after seeing a decl-specifier.
1093 (cp_parser_simple_declaration): Eliminate spurious message.
1094 (cp_parser_init_declarator): Adjust error message.
1095
1096 PR c++/16029
1097 * lex.c (unqualified_name_lookup_error): Mark the dummy
1098 declaration as used.
1099
1100 PR c++/17501
1101 * parser.c (cp_parser_nested_name_specifier): Do not resolve
1102 typename types if the user explicitly said "typename".
1103
1104 2004-09-16 Andrew MacLeod <amacleod@redhat.com>
1105
1106 * error.c (dump_decl): Make sure there is lang_specific info before
1107 checking for DTOR and CTOR decls.
1108
1109 2004-09-16 Nathan Sidwell <nathan@codesourcery.com>
1110
1111 * class.c (copy_virtuals): Remove.
1112 (build_primary_vtable): Use copy_list directly.
1113 (build_secondary_vtable): Likewise.
1114 (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
1115 (create_vtable_ptr): Likewise.
1116
1117 2004-09-16 Kazu Hirata <kazu@cs.umass.edu>
1118
1119 * search.c: Follow spelling conventions.
1120
1121 2004-09-16 Nathan Sidwell <nathan@codesourcery.com>
1122
1123 * cp-tree.h (struct lang_type_class): Make pure_virtuals a
1124 VEC(tree).
1125 (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
1126 comments.
1127 * call.c (build_new_method_call): Don't confirm a pure virtual is
1128 in CLASSTYPE_PURE_VIRTUALS. Reorder checks. Make it a warning.
1129 * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
1130 (fixup_inline_methods, finish_struct): Likewise.
1131 * decl.c (finish_method): Likewise.
1132 * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
1133 CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
1134 * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
1135 vector to avoid repeating the list in error messages.
1136
1137 2004-09-15 Mark Mitchell <mark@codesourcery.com>
1138
1139 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
1140 * cp-tree.h (cxx_comdat_group): Declare.
1141 * decl.c (cxx_comdat_group): New function.
1142
1143 2004-09-15 Nathan Sidwell <nathan@codesourcery.com>
1144
1145 * search.c (get_pure_virtuals): Remove unused variables.
1146
1147 * cp-tree.h (struct lang_decl_flags): Remove
1148 needs_final_overrider.
1149 (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
1150 * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
1151 * class.c (finish_struct_bits): Correct comment about
1152 CLASSTYPE_PURE_VIRTUALS.
1153 * search.c (get_pure_virtuals): Remove useless loop.
1154
1155 2004-09-14 Mark Mitchell <mark@codesourcery.com>
1156
1157 PR c++/17324
1158 * mangle.c (partially_mangled_name): New variable.
1159 (partially_mangled_name_len): Likewise.
1160 (save_partially_mangled_name): New function.
1161 (restore_partially_mangled_name): Likewise.
1162 (write_encoding): Save and restore partially mangled names around
1163 calls to get_mostly_instantiated_function_type.
1164 (write_unqualified_name): Likewise.
1165
1166 2004-09-14 Nathan Sidwell <nathan@codesourcery.com>
1167
1168 * pt.c (unify): Replace gcc_unreachable with gcc_assert.
1169
1170 2004-09-13 Mark Mitchell <mark@codesourcery.com>
1171
1172 PR c++/16162
1173 * parser.c (cp_parser_id_expression): Correct value for
1174 is_declarator.
1175 (cp_parser_nested_name_specifier_opt): Look through typenames as
1176 necessary.
1177 (cp_parser_template_name): Honor check_dependency_p.
1178
1179 PR c++/16716
1180 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
1181 Robustify.
1182
1183 PR c++/17327
1184 * pt.c (unify): Add ENUMERAL_TYPE case. Replace sorry with
1185 gcc_unreacable.
1186
1187 2004-09-12 Richard Henderson <rth@redhat.com>
1188
1189 PR c++/16254
1190 * semantics.c (maybe_cleanup_point_expr): Don't call fold.
1191 * typeck.c (condition_conversion): Likewise.
1192
1193 2004-09-11 Richard Henderson <rth@redhat.com>
1194
1195 PR c++/17404
1196 * pt.c (cur_stmt_expr): Move from tsubst_expr.
1197 (tsubst_expr) <case STMT_EXPR>: Move ...
1198 (tsubst_copy_and_build): ... here.
1199
1200 2004-09-10 Zack Weinberg <zack@codesourcery.com>
1201
1202 * cp-tree.h (interface_only, interface_unknown): Delete declarations;
1203 comment explaining them moved to c-common.h.
1204 * lex.c (interface_only, interface_unknown, extract_interface_info):
1205 Delete definitions.
1206 (cxx_finish): Don't reset interface_unknown.
1207 (handle_pragma_interface): Don't set interface_only and
1208 interface_unknown; just the like-named fields in finfo.
1209 (handle_pragma_implementation): Adjust comment.
1210 * decl2.c (cp_finish_file): Don't reset interface_only and
1211 interface_unknown.
1212 * method.c (synthesize_method): Don't reset interface_unknown or
1213 call extract_interface_info.
1214 * pt.c (pop_tinst_level): Don't call extract_interface_info.
1215 * decl.c (start_cleanup_fn): Don't save or restore interface_only
1216 and interface_unknown.
1217 (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
1218 and use the result instead of the interface_only/interface_unknown
1219 globals.
1220 (start_preparsed_function): Likewise.
1221 * lex.c (cxx_make_type): Likewise.
1222 * semantics.c (begin_class_definition): Likewise.
1223 (expand_body): Don't call extract_interface_info.
1224
1225 2004-09-10 Ziemowit Laski <zlaski@apple.com>
1226
1227 * decl.c (objc_mark_locals_volatile): Make description of
1228 routine more descriptive; only mark VAR_DECLs at each
1229 binding level.
1230
1231 2004-09-10 Richard Henderson <rth@redhat.com>
1232
1233 PR c++/17386
1234 * call.c (build_vfield_ref): Move...
1235 * class.c (build_vfield_ref): ... here. Convert datum to the
1236 primary base containing the vptr.
1237 (make_new_vtable): Simplify build_primary_vtable arguments.
1238 (finish_struct_1): Do not duplicate TYPE_VFIELD.
1239 * typeck.c (build_class_member_access_expr): Don't warn for
1240 null object access to base fields.
1241
1242 2004-09-10 Ziemowit Laski <zlaski@apple.com>
1243
1244 * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
1245 New functions, to be called from ObjC++.
1246
1247 2004-09-10 Kazu Hirata <kazu@cs.umass.edu>
1248
1249 * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
1250 name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
1251 comment typos.
1252
1253 2004-09-09 Ziemowit Laski <zlaski@apple.com>
1254
1255 * typeck.c (build_c_cast): Preserve the cast if casting
1256 to and from an Objective-C type.
1257
1258 2004-09-09 Ziemowit Laski <zlaski@apple.com>
1259
1260 * Make-lang.in (cp/typeck.o): Depend on c-common.h.
1261 * typeck.c: Include c-common.h.
1262 (comptypes): For RECORD_TYPEs, call objc_comptypes() and
1263 return the result if nonnegative.
1264
1265 2004-09-09 Zack Weinberg <zack@codesourcery.com>
1266
1267 * decl2.c (import_export_class)
1268 * lex.c (handle_pragma_interface):
1269 Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
1270
1271 2004-09-08 Ziemowit Laski <zlaski@apple.com>
1272
1273 * Make-lang.in (cp/semantics.o): Depend on c-common.h.
1274 * semantics.c: Include c-common.h.
1275 (finish_compound_stmt): Call objc_clear_super_receiver().
1276
1277 2004-09-08 Ziemowit Laski <zlaski@apple.com>
1278
1279 * cp-tree.h (do_poplevel): New prototype.
1280 * semantics.c (do_poplevel): Make externally visible.
1281
1282 2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
1283
1284 * cp-tree.h (tree_pair_s): Define a GC'd vector.
1285 * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
1286 * semantics.c (deferred_access): Likewise.
1287
1288 2004-09-06 Daniel Jacobowitz <dan@debian.org>
1289
1290 * semantics.c (expand_body): Assert that we are not nested.
1291
1292 2004-09-06 Zack Weinberg <zack@codesourcery.com>
1293
1294 * decl.c (build_enumerator): Use add_double and int_fits_type_p
1295 instead of cp_build_binary_op, to avoid creating short-lived trees.
1296 * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
1297 lookahead instead of backtracking. Move some code to avoid a
1298 conditional branch.
1299 (cp_parser_enum_specifier): Avoid duplication of effort with caller.
1300 Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
1301 (cp_parser_enumerator_list, cp_parser_enumerator_definition):
1302 Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
1303
1304 2004-09-04 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1305
1306 * decl.c (grok_declarator): Remove a redundant semicolon.
1307
1308 * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
1309 Correct comments describing function parameters.
1310
1311 2004-09-03 Matt Austern <austern@apple.com>
1312 Compile speed improvement.
1313 * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
1314 Otherwise define a stub macro that expands to nothing.
1315 (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set. Otherwise
1316 define a stub macro that expands to 0.
1317 (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
1318 (cp_lexer_stop_debugging): Likewise.
1319 (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set. Otherwise
1320 define a stub macro that expands to NULL.
1321 (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
1322 (cp_lexer_new_from_tokens): Likewise.
1323
1324 2004-09-03 Jan Hubicka <jh@suse.cz>
1325
1326 * decl.c (finish_function): Clean out pointers we no longer need.
1327
1328 2004-09-03 Jan Beulich <jbeulich@novell.com>
1329
1330 * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
1331 than "-lm".
1332
1333 2004-09-02 Paul Brook <paul@codesourcery.com>
1334
1335 * decl2.c (determine_visibility): Only check data visibility
1336 for VAR_DECLS.
1337
1338 2004-08-31 Mark Mitchell <mark@codesourcery.com>
1339
1340 * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
1341 * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
1342 * decl2.c (determine_visibility): Honor
1343 TARGET_CXX_EXPORT_CLASS_DATA.
1344
1345 * class.c (key_method): Rename to ...
1346 (determine_key_method): ... this.
1347 (finish_struct_1): Adjust accordingly.
1348 * cp-tree.h (key_method): Declare.
1349 * decl2.c (maybe_emit_vtables): Determine the key method here if
1350 it has not already been done.
1351
1352 2004-08-31 Ziemowit Laski <zlaski@apple.com>
1353
1354 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
1355 (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
1356 (cp/cp-decl.c): Do not depend on gtype-cp.h.
1357 (cp/cp-objcp-common.o): New target.
1358 * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
1359 (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
1360 cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
1361 prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
1362 respectively.
1363 (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
1364 LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
1365 LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
1366 LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
1367 LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
1368 LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
1369 LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
1370 LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
1371 LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
1372 LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
1373 LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
1374 LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
1375 LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
1376 LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
1377 LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
1378 LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
1379 LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
1380 LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
1381 LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
1382 LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
1383 LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
1384 LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
1385 LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
1386 LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
1387 LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
1388 LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
1389 LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
1390 LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
1391 LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
1392 LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
1393 LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
1394 hooks to cp-objcp-common.h.
1395 (finish_file): New function.
1396 * cp-objcp-common.c: New file.
1397 * cp-objcp-common.h: New file.
1398 * cp-tree.h (cp_finish_file): New prototype.
1399 * decl.c: Do not include gtype-cp.h.
1400 * decl2.c (finish_file): Rename to cp_finish_file.
1401
1402 2004-08-31 Richard Henderson <rth@redhat.com>
1403
1404 PR c++/17221
1405 * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
1406 (tsubst_copy_and_build): ... here.
1407
1408 2004-08-30 Mark Mitchell <mark@codesourcery.com>
1409
1410 * cp-tree.h (initialize_artificial_var): Declare.
1411 * decl.c (initialize_artifical_var): New function.
1412 * class.c (initialize_array): Remove.
1413 (initialize_vtable): Use initialize_artificial_var.
1414 (build_vtt): Likewise.
1415 (build_ctor_vtbl_group): Likewise.
1416
1417 2004-08-30 Richard Henderson <rth@redhat.com>
1418
1419 * class.c (build_base_path): Use build_address directly.
1420 * typeck.c (build_unary_op): Don't lower &a.b to pointer
1421 arithmetic directly.
1422 * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
1423 means !initializer_constant_valid_p.
1424
1425 2004-08-30 Richard Henderson <rth@redhat.com>
1426
1427 * class.c (fixed_type_or_null): Use get_base_address before
1428 assuming an ADDR_EXPR is non-null.
1429
1430 2004-08-30 Nathan Sidwell <nathan@codesourcery.com>
1431
1432 * name-lookup.c (pop_binding, pushdecl,
1433 set_identifier_type_value_with_scope, push_overloaded_decl,
1434 arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
1435 * parser.c (cp_parser_diagnose_invalid_type_name,
1436 cp_parser_postfix_expression, cp_parser_unary_expression,
1437 cp_parser_check_declarator_template_para): Likewise.
1438 * pt.c (push_inline_template_parms_recursive,
1439 check_explicit_specialization, convert_nontype_argument,
1440 coerce_template_template_parms, uses_template_parms,
1441 instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
1442 tsubst_expr, instantiate_template,
1443 maybe_adjust_types_for_deduction, type_unification_real,
1444 resolve_overloaded_unification, template_decl_level,
1445 type_dependent_expression_p): Likewise.
1446 * search.c (lookup_base_r): Likewise.
1447 * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
1448 * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
1449 verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
1450 * typeck.c (common_type, get_member_function_from_ptrfunc,
1451 build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
1452 * typeck2.c (cxx_incomplete_type_diagnostic,
1453 split_nonconstant_init_1, store_init_value,
1454 process_init_constructor): Likewise.
1455
1456 2004-08-30 Nathan Sidwell <nathan@codesourcery.com>
1457
1458 * call.c (check_dtor_name): Replace abort with gcc_assert or
1459 gcc_unreachable.
1460 (build_call, add_builtin_candidate, build_new_op,
1461 convert_like_real, build_over_call, in_charge_arg_for_name,
1462 source_type, joust): Likewise.
1463 * class.c (build_simple_base_path, get_vcall_index,
1464 finish_struct_1, instantiate_type, get_enclosing_class,
1465 add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
1466 * cp-gimplify.c (cp_genericize): Likewise.
1467 * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
1468 * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
1469 * decl.c (poplevel, make_unbound_class_template, reshape_init,
1470 check_special_function_return_type, grokdeclarator,
1471 grok_op_properties, tag_name, xref_tag, start_preparsed_function,
1472 finish_function): Likewise.
1473 * decl2.c (grokfield, maybe_emit_vtables):Likewise.
1474 * error.c (dump_global_iord, dump_decl, dump_template_decl,
1475 language_to_string): Likewise.
1476 * except.c (choose_personality_routine): Likewise.
1477 * friend.c (do_friend): Likewise.
1478 * g++spec.c (lang_specific_driver): Likewise.
1479 * init.c (build_zero_init, expand_default_init, build_new_1,
1480 build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
1481 * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
1482 * mangle.c (add_substitution, write_unscoped_name,
1483 write_template_prefix, write_identifier,
1484 write_special_name_destructor, write_type, write_builtin_type,
1485 write_expression, write_template_param,
1486 write_java_integer_type_codes): Likewise.
1487 * method.c (implicitly_declare_fn): Likewise.
1488
1489 2004-08-30 Nathan Sidwell <nathan@codesourcery.com>
1490
1491 * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
1492 (BINFO_INDIRECT_PRIMARY_P): Remove.
1493 * class.c (determine_primary_base): Rename to ...
1494 (determine_primary_bases): ... here. Set all primary bases.
1495 (set_primary_base): Remove.
1496 (mark_primary_bases): Remove.
1497 (build_simple_base_path, walk_subobject_offsets,
1498 propagate_binfo_offsets, end_of_class): Adjust.
1499 (layout_class_type): Rename determine_primary_base call.
1500 (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
1501 to type_as_string.
1502 (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
1503 build_rtti_vtbl_entries): Adjust.
1504 * init.c (build_vtbl_address): Adjust.
1505
1506 * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
1507
1508 2004-08-28 Ziemowit Laski <zlaski@apple.com>
1509
1510 * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
1511 CXX_AND_OBJCXX_OBJS.
1512 (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
1513 separately on the link line.
1514
1515 2004-08-28 Jason Merrill <jason@redhat.com>
1516
1517 * decl.c (expand_static_init): Avoid bogus warnings.
1518
1519 2004-08-27 Jason Merrill <jason@redhat.com>
1520
1521 PR c++/16851
1522 * tree.c (stabilize_init): See through a COMPOUND_EXPR.
1523
1524 PR c++/13684
1525 * decl.c (expand_static_init): Use thread-safety API.
1526 (register_dtor_fn): Return the call, don't expand it.
1527 * tree.c (add_stmt_to_compound): New fn.
1528 (stabilize_call): Use it.
1529
1530 2004-08-27 Richard Henderson <rth@redhat.com>
1531
1532 * cp-tree.def (OFFSETOF_EXPR): New.
1533 * parser.c (cp_parser_builtin_offsetof): Either built an
1534 OFFSETOF_EXPR, or call fold_offsetof immediately.
1535 * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
1536
1537 2004-08-27 Nathan Sidwell <nathan@codesourcery.com>
1538
1539 * call.c (validate_conversion_obstack): Replace
1540 my_friendly_assert with gcc_assert or gcc_unreachable.
1541 (direct_reference_binding, merge_conversion_sequences,
1542 build_user_type_conversion_1, perform_overload_resolution,
1543 build_op_delete_call, enforce_access, call_builtin_trap,
1544 build_over_call, build_special_member_call, build_new_method_call,
1545 initialize_reference): Likewise.
1546 * class.c (build_base_path, build_primary_vtable, alter_access,
1547 check_bases, update_vtable_entry_for_fn, layout_empty_base,
1548 clone_function_decl, adjust_clone_args,
1549 type_requires_array_cookie, include_empty_classes,
1550 finish_struct_1, resolve_address_of_overloaded_function,
1551 instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
1552 dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
1553 accumulate_vtbl_inits, build_vtbl_initializer,
1554 build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
1555 * cvt.c (build_up_reference, convert_to_reference): Likewise.
1556 * decl.c (poplevel, duplicate_decls, make_typename_type,
1557 cxx_init_decl_processing, reshape_init, check_initializer,
1558 make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
1559 expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
1560 grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
1561 xref_basetypes, start_preparsed_function, save_function_data,
1562 finish_function, finish_method, maybe_register_incomplete_var,
1563 complete_vars): Likewise.
1564 * decl2.c (grok_array_decl, check_member_template,
1565 check_classfn, finish_static_data_member_decl, coerce_new_type,
1566 coerce_delete_type, import_export_class, decl_needed_p,
1567 determine_visibility, import_export_decl, build_cleanup,
1568 start_static_initialization_or_destructi, do_static_destruction,
1569 prune_vars_needing_no_initialization,
1570 build_offset_ref_call_from_tree): Likewise.
1571 * error.c (dump_decl, dump_expr): Likewise.
1572 * init.c (finish_init_stmts, build_zero_init,
1573 expand_virtual_init, expand_default_init, expand_aggr_init_1,
1574 build_offset_ref, build_new_1, build_delete, build_vbase_delete):
1575 Likewise.
1576 * mangle.c (write_method_parms, write_template_args,
1577 write_expression, write_template_arg): Likewise.
1578 * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
1579 * name-lookup.c (pop_binding, begin_scope, leave_scope,
1580 resume_scope, push_using_decl, validate_nonmember_using_decl,
1581 is_ancestor, poplevel_class, set_inherited_value_binding_p,
1582 push_class_level_binding, do_class_using_decl, push_namespace,
1583 pop_namespace, add_using_namespace, ambiguous_decl,
1584 lookup_namespace_name, lookup_type_current_level,
1585 maybe_process_template_type_declaration): Likewise.
1586 * parser.c (cp_lexer_peek_nth_token,
1587 cp_parser_parse_and_diagnose_invalid_typ,
1588 cp_parser_translation_unit, cp_parser_template_id,
1589 cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
1590 * pt.c (push_access_scope, finish_member_template_decl,
1591 push_inline_template_parms_recursive, add_outermost_template_args,
1592 get_innermost_template_args, begin_explicit_instantiation,
1593 end_explicit_instantiation, retrieve_specialization,
1594 is_specialization_of, is_specialization_of_friend,
1595 register_specialization, check_explicit_specialization,
1596 comp_template_parms, process_template_parm,
1597 process_partial_specialization, convert_nontype_argument,
1598 coerce_template_template_parms, coerce_template_parms,
1599 mangle_class_name_for_template, lookup_template_function,
1600 lookup_template_class, instantiate_class_template, tsubst_decl,
1601 tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
1602 instantiate_template, fn_type_unification, type_unification_real,
1603 get_template_base, regenerate_decl_from_template,
1604 template_for_substitution, instantiate_decl,
1605 get_mostly_instantiated_function_type, dependent_scope_ref_p,
1606 value_dependent_expression_p, resolve_typename_type): Likewise.
1607 * repo.c (repo_emit_p): Likewise.
1608 * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
1609 create_tinfo_types, emit_tinfo_decl): Likewise.
1610 * search.c (lookup_base_r, lookup_base, lookup_field_1,
1611 dfs_access_in_type, build_baselink, lookup_member,
1612 adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
1613 * semantics.c (perform_or_defer_access_check,
1614 finish_non_static_data_member, finish_stmt_expr_expr,
1615 finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
1616 finish_template_template_parm, finish_member_declaration,
1617 emit_associated_thunks): Likewise.
1618 * tree.c (build_target_expr_with_type, force_target_expr,
1619 copy_binfo, get_first_fn, cp_tree_equal): Likewise.
1620 * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
1621 cxx_sizeof_or_alignof_type, perform_integral_promotions,
1622 build_class_member_access_expr, finish_class_member_access_expr,
1623 build_ptrmemfunc_access_expr, build_unary_op,
1624 unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
1625 build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
1626 * typeck2.c (complete_type_check_abstract,
1627 abstract_virtuals_error, process_init_constructor,
1628 add_exception_specifier): Likewise.
1629
1630 2004-08-27 Nathan Sidwell <nathan@codesourcery.com>
1631
1632 * class.c (build_vtbl_initializer): Use ssize_int.
1633 * decl.c (complete_array_type): Likewise.
1634 * method.c (finish_thunk): Likewise.
1635 * search.c (get_dynamic_base_type): Likewise.
1636
1637 2004-08-26 Richard Henderson <rth@redhat.com>
1638
1639 * cp-tree.h (DECL_FIELD_IS_BASE): New.
1640 * class.c (build_base_field): Set it.
1641 (build_simple_base_path): Use it.
1642 (fixed_type_or_null): Don't consider base fields definitive.
1643
1644 2004-08-25 Roger Sayle <roger@eyesopen.com>
1645
1646 PR middle-end/16693
1647 PR tree-optimization/16372
1648 * decl.c (finish_enum): Make the precision of the enumerated type
1649 the same width as the underlying integer type.
1650
1651 2004-08-25 Mark Mitchell <mark@codesourcery.com>
1652
1653 PR c++/17155
1654 * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
1655 functions.
1656
1657 * mangle.c (get_identifier_nocopy): Add cast.
1658
1659 * cp-tree.h (mangle_type): Remove.
1660 * mangle.c (globals): GTY it.
1661 (mangle_obstack): New variable.
1662 (name_obstack): Likewise.
1663 (name_base): Likewise.
1664 (write_char): Adjust accordingly.
1665 (write_chars): Likewise.
1666 (write_string): Likewise.
1667 (start_mangling): Initialize G.substitutions only one. Add
1668 ident_p parameter.
1669 (finish_mangling): Use VARRAY_CLEAR to reclaim
1670 storage in G.substitutions. Use obstack_finish.
1671 (init_mangle): Adjust for changes to variable names above.
1672 Initialize G.substitutions.
1673 (mangle_decl_string): Adjust call to start_mangling.
1674 (get_identifier_nocopy): New function.
1675 (mangle_decl): Use it.
1676 (mangle_type_string): Adjust call to start_mangling.
1677 (mangle_special_for_type): Likewise.
1678 (mangle_vtt_for_type): Likewise.
1679 (mangle_ctor_vtbl_for_type): Likewise.
1680 (mangle_thunk): Likewise.
1681 (mangle_guard_variable): Likewise.
1682 (mangle_ref_init_variable): Likewise.
1683
1684 2004-08-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1685
1686 PR c++/14428
1687 * pt.c (redeclare_class_template): Check the type of non-type and
1688 template template parameter.
1689
1690 2004-08-25 Nathan Sidwell <nathan@codesourcery.com>
1691
1692 * call.c (convert_class_to_reference): Adjust build_int_cst calls.
1693 (build_user_type_conversion_1, convert_like_real,
1694 build_java_interface_fn_ref, build_special_member_call): Likewise.
1695 * class.c (finish_struct_1, build_vtbl_initializer): Likewise.
1696 * cp-gimplify.c (cp_gimplify_expr): Likewise.
1697 * cvt.c (cp_convert_to_pointer): Likewise.
1698 * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
1699 * decl2.c (start_static_initialization_or_destruction,
1700 generate_ctor_or_dtor_function): Likewise.
1701 * except.c (build_throw): Likewise.
1702 * mangle.c (write_integer_cst): Likewise.
1703 * method.c (finish_thunk): Likewise.
1704 * rtti.c (build_headof, get_tinfo_decl_dynamic,
1705 build_dynamic_cast_1, ptr_initializer, ptm_initializer,
1706 get_pseudo_ti_init): Likewise.
1707 * search.c (get_dynamic_cast_base_type): Likewise.
1708
1709 2004-08-25 Zack Weinberg <zack@codesourcery.com>
1710
1711 * class.c, search.c: Remove references to DWARF_DEBUG.
1712
1713 2004-08-25 Adam Nemet <anemet@lnxw.com>
1714
1715 * repo.c (extract_string): Reset backquote after one character.
1716 (get_base_filename): Fix indentation.
1717
1718 2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
1719
1720 * decl.c (cxx_init_decl_processing): Adjust
1721 build_common_tree_nodes call.
1722
1723 2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
1724
1725 PR c++/16889
1726 * (is_subobject_of_p): Resurrect & optimize.
1727 (lookup_field_r): Use it.
1728
1729 2004-08-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1730
1731 PR c++/16706
1732 * search.c (friend_accessible_p): Increment processing_template_decl
1733 when deal with TEMPLATE_DECL of SCOPE.
1734
1735 2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
1736
1737 PR c++/17149
1738 * semantics.c (check_accessibility_of_qualified_id): Defer check
1739 if qualifying_type is a template parameter.
1740
1741 2004-08-23 Mark Mitchell <mark@codesourcery.com>
1742
1743 PR c++/17163
1744 * pt.c (instantiate_decl): Do not try to apply
1745 DECL_DECLARED_INLINED_P to a VAR_DECL.
1746
1747 * search.c (build_baselink): Fix typo in comment.
1748
1749 2004-08-22 Andrew Pinski <apinski@apple.com>
1750
1751 Revert:
1752 2004-08-22 Andrew Pinski <apinski@apple.com>
1753 PR c++/14029
1754 * typeck.c (build_unary_op): Use &a.b if the folded lowered
1755 expression is not constant.
1756
1757 2004-08-23 Nathan Sidwell <nathan@codesourcery.com>
1758
1759 * name-lookup.c (pushdecl): Rename build_type_copy call.
1760 * tree.c (cp_build_qualified_type_real,
1761 build_exception_variant, handle_java_interface_attribute): Likewise.
1762
1763 2004-08-22 Andrew Pinski <apinski@apple.com>
1764
1765 PR c++/14029
1766 * typeck.c (build_unary_op): Use &a.b if the folded lowered
1767 expression is not constant.
1768
1769 2004-08-20 Mark Mitchell <mark@codesourcery.com>
1770
1771 PR c++/17121
1772 * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P.
1773
1774 2004-08-21 Joseph S. Myers <jsm@polyomino.org.uk>
1775
1776 PR c++/17120
1777 * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for
1778 MODOP_EXPR.
1779
1780 2004-08-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1781
1782 * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION
1783 before calling comp_template_args.
1784
1785 2004-08-20 Nathan Sidwell <nathan@codesourcery.com>
1786
1787 * class.c (build_vtbl_initializer): Use build_int_cst for
1788 negative size types.
1789 * decl.c (complete_array_type): Likewise.
1790 * method.c (finish_thunk): Likewise.
1791
1792 2004-08-20 Andreas Tobler <a.tobler@schweiz.ch>
1793
1794 * tree.c: Remove unused mark_local_for_remap_r.
1795
1796 2004-08-19 Eric Christopher <echristo@redhat.com>
1797
1798 * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
1799 * tree.c (cxx_unsave_expr_now): Delete.
1800 (cp_unsave_r): Ditto.
1801
1802 2004-08-19 Mark Mitchell <mark@codesourcery.com>
1803
1804 PR c++/15890
1805 * pt.c (push_template_decl_real): Disallow template allocation
1806 functions with fewer than two parameters.
1807
1808 2004-08-19 Nathan Sidwell <nathan@codesourcery.com>
1809
1810 * cp-tree.h (build_shared_int_cst): Remove.
1811 * tree.c (shared_int_cache): Remove.
1812 (build_shared_int_cst): Remove.
1813 * class.c (finish_struct_1): Use build_int_cst.
1814
1815 2004-08-19 Nathan Sidwell <nathan@codesourcery.com>
1816
1817 * decl.c (finish_enum): Do not copy value node early, copy
1818 later.
1819 * lex.c (cxx_init): Force null_node to be unique.
1820
1821 2004-08-19 Joseph S. Myers <jsm@polyomino.org.uk>
1822
1823 PR c++/17041
1824 * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
1825 from input for MODOP_EXPR.
1826
1827 2004-08-18 Mark Mitchell <mark@codesourcery.com>
1828
1829 * pt.c (dependent_template_p): Fix typo in commment.
1830
1831 PR c++/17068
1832 * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
1833 dependent.
1834
1835 2004-08-17 Mark Mitchell <mark@codesourcery.com>
1836
1837 PR c++/16246
1838 * pt.c (unify): Tidy ARRAY_TYPE handling. Make sure that non-type
1839 arguments have the same type as the corresponding parameter.
1840
1841 PR c++/16215
1842 * parser.c (cp_parser_name_lookup_error): If parser->object_scope
1843 is set use it for diagnostic purposes.
1844 (cp_parser_pseudo_destructor_name): Remove special-case error
1845 message.
1846
1847 PR c++/15871
1848 * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions.
1849
1850 PR c++/16965
1851 * cp-tree.h (qualified_name_lookup_error): Add parameter.
1852 * name-lookup.c (do_class_using_decl): Restrict set of entities
1853 passed to cp_emit_debug_info_for_using more carefully.
1854 (lookup_qualified_name): Allow lookup_member to return sets of
1855 ambiguous entries.
1856 * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter.
1857 (cp_parser_primary_expression): Handle ambiguous lookups.
1858 (cp_parser_template_name): Adjust use of cp_parser_lookup_name.
1859 (cp_parser_template_argument): Likewise.
1860 (cp_parser_elaborate_type_specifier): Likewise.
1861 (cp_parser_namespace_name): Likewise.
1862 (cp_parser_class_name): Likewise.
1863 (cp_parser_lookup_name_simple): Likewise.
1864 * pt.c (tsubst_qualified_id): Handle ambiguous results.
1865 (tsubst_expr): Likewise.
1866 * semantics.c (qualified_name_lookup_error): Add decl paramter.
1867 For ambiguous lookups, print candidates.
1868
1869 2004-08-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1870
1871 PR c++/6749
1872 * pt.c (instantiate_pending_templates): Add int parameter. Don't
1873 return anything.
1874 * cp-tree.h (instantiate_pending_templates): Adjust prototype.
1875 * decl2.c (finish_file): Adjust call to
1876 instantiate_pending_templates.
1877
1878 2004-08-15 Roger Sayle <roger@eyesopen.com>
1879
1880 * call.c (build_vfield_ref, build_call, build_conditional_expr,
1881 convert_arg_to_ellipsis, build_x_va_arg, build_over_call,
1882 build_java_interface_fn_ref, build_special_member_call,
1883 build_new_method_call, initialize_reference): Replace calls to
1884 build with calls to buildN.
1885 * class.c (build_base_path, convert_to_base_statically,
1886 build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits,
1887 build_vtbl_initializer): Likewise.
1888 * cp-gimplify.c (genericize_try_block, genericize_catch_block,
1889 gimplify_if_stmt, cp_genericize_r): Likewise.
1890 * cvt.c (convert_to_void): Likewise.
1891 * decl.c (check_initializer, finish_constructor_body,
1892 finish_destructor_body): Likewise.
1893 * error.c (dump_expr): Likewise.
1894 * except.c (build_exc_ptr, expand_start_catch_block, build_throw):
1895 Likewise.
1896 * init.c (perform_member_init, expand_virtual_init,
1897 expand_cleanup_for_base, build_init, expand_default_init,
1898 build_offset_ref, decl_constant_value, build_new, build_new_1,
1899 build_vec_delete_1, build_vec_init, build_delete,
1900 push_base_cleanups, build_vec_delete): Likewise.
1901 * mangle.c (write_integer_cst): Likewise.
1902 * method.c (thunk_adjust, do_build_copy_constructor,
1903 do_build_assign_ref): Likewise.
1904 * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build,
1905 unify, build_non_dependent_expr): Likewise.
1906 * rtti.c (build_headof, build_typeid, ifnonnull,
1907 build_dyanmic_cast_1, tinfo_base_init): Likewise.
1908 * semantics.c (begin_compound_stmt, finish_call_expr,
1909 finish_pseudo_destructor_expr, finish_id_expression,
1910 simplify_aggr_init_expr, finalize_nrv_r): Likewise.
1911 * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top,
1912 array_type_nelts_total, stabilize_call): Likewise.
1913 * typeck.c (decay_conversion, build_class_member_access_expr,
1914 lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref,
1915 get_member_function_from_ptrfunc, build_binary_op, pointer_diff,
1916 build_x_unary_op, build_unary_op, unary_complex_lvalue,
1917 build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst,
1918 check_return_expr): Likewise.
1919 * typeck2.c (split_nonconstant_1, split_nonconstant_init_1,
1920 split_nonconstant_init, store_init_value, build_m_component_ref):
1921 Likewise.
1922
1923 2004-08-15 Nathan Sidwell <nathan@codesourcery.com>
1924
1925 * call.c (convert_class_to_reference,
1926 build_user_type_conversion_1, convert_like_real,
1927 build_java_interface_fn_ref, build_special_member_call): Use
1928 build_int_cst.
1929 * class.c (build_vtbl_initializer): Likewise.
1930 * cp-gimplify.c (cp_gimplify_expr): Likewise.
1931 * cvt.c (cp_convert_to_pointer): Likewise.
1932 * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
1933 * decl2.c (start_static_initialization_or_destruction,
1934 generate_ctor_or_dtor_function): Likewise.
1935 * except.c (build_throw): Likewise.
1936 * lex.c (cxx_init): Likewise.
1937 * mangle.c (write_integer_cst): Likewise.
1938 * rtti.c (build_headof, get_tinfo_decl_dynamic,
1939 build_dynamic_cast_1, ptr_initializer, ptm_initializer,
1940 get_pseudo_ti_init): Likewise.
1941 * search.c (get_dynamic_cast_base_type): Likewise.
1942 * tree.c (build_shared_int_cst): Likewise.
1943
1944 2004-08-12 Mark Mitchell <mark@codesourcery.com>
1945
1946 PR c++/16273
1947 * class.c (count_depth_data): New type.
1948 (dfs_depth_post): New function.
1949 (dfs_depth_q): Likewise.
1950 (find_final_overrider_data_s): Change type of vpath.
1951 Add vpath_list.
1952 (dfs_find_final_overrider_1): New function.
1953 (dfs_find_final_overrider): Use it.
1954 (dfs_find_final_overrider_q): Adjust use of vpath.
1955 (dfs_find_final_overrider_post): Likewise.
1956 (find_final_overrider): Use dfs_depth. Allocate and deallocate
1957 vpath_list.
1958
1959 2004-08-12 Jan Beulich <jbeulich@novell.com>
1960
1961 * parser.c (cp_parser_asm_definition): Properly consume scope operator
1962 tokens preceding the clobbers. Don't check for scope operator
1963 following inputs. Simplify inputs handling to match that now used for
1964 clobbers.
1965
1966 2004-08-11 Mark Mitchell <mark@codesourcery.com>
1967
1968 PR c++/16698
1969 * except.c (build_throw): Allocate cleanup_type and the function
1970 for __cxa_throw separately.
1971
1972 PR c++/16853
1973 * call.c (standard_conversion): Do not accept conversions between
1974 pointers to members if the class types are unrelated.
1975
1976 PR c++/16618
1977 * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile
1978 char &" instead of just "char &".
1979
1980 PR c++/16870
1981 * pt.c (tsubst): Just return the unknown_type_node.
1982
1983 2004-08-11 Mark Mitchell <mark@codesourcery.com>
1984
1985 PR c++/16964
1986 * parser.c (cp_parser_class_specifier): Robustify.
1987
1988 PR c++/16904
1989 * pt.c (tsubst_copy_and_build): Complain about invalid
1990 qualification.
1991
1992 PR c++/16929
1993 * pt.c (tsubst_default_argument): Clear out current_class_ptr and
1994 current_class_ref while tsubsting.
1995
1996 2004-08-10 Mark Mitchell <mark@codesourcery.com>
1997
1998 PR c++/16971
1999 * parser.c (cp_parser_init_declarator): Robustify.
2000
2001 2004-08-06 Richard Sandiford <rsandifo@redhat.com>
2002
2003 * typeck2.c (process_init_constructor): Guard the missing field warning
2004 with warn_missing_field_initializers rather than extra_warnings.
2005
2006 2004-08-06 Paolo Bonzini <bonzini@gnu.org>
2007
2008 * class.c (instantiate_type) <ENTRY_VALUE_EXPR>: Do not handle.
2009
2010 2004-08-05 Mark Mitchell <mark@codesourcery.com>
2011
2012 * decl.c (start_preparsed_function): Move determine_visibility
2013 call.
2014 * decl2.c (determine_visibility): Incorporate dllexport testing.
2015
2016 2004-08-05 Geoffrey Keating <geoffk@apple.com>
2017
2018 * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option
2019 means that libstdc++ is needed.
2020
2021 2004-08-05 Nathan Sidwell <nathan@codesourcery.com>
2022
2023 * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call.
2024
2025 2004-08-04 Geoffrey Keating <geoffk@apple.com>
2026
2027 * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
2028 than passing it as a parameter to rest_of_decl_compilation.
2029 * decl2.c (grokfield): Use set_user_assembler_name.
2030
2031 2004-08-04 Nathan Sidwell <nathan@codesourcery.com>
2032
2033 * decl.c (complete_array_type): Don't gratuitously copy
2034 maxindex. Its type is always set.
2035
2036 2004-08-04 Paul Brook <paul@codesourcery.com>
2037
2038 * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H.
2039 * cp-tree.h (struct language_function): Rename x_dtor_label to
2040 x_cdtor_label.
2041 (dtor_label): Rename ...
2042 (cdtor_label): ... to this.
2043 * decl.c (begin_constructor_body): Remove.
2044 (check_special_function_return_type): Maybe change the return type.
2045 (grokdeclarator): Pass the class type.
2046 (start_preparsed_function): Constructors may need a return label.
2047 (finish_constructor_body, finish_destructor_body): Set the return
2048 value.
2049 (begin_function_body): Don't call begin_constructor_body.
2050 (finish_function): Don't warn for constructors or destructors.
2051 (implicitly_declare_fn): Maybe change the return type.
2052 * optimize.c: Include target.h.
2053 (maybe_clone_body): Remap the function result.
2054 * semantics.c: Include target.h.
2055 (finish_return_stmt): Maybe jump to return label for constructors.
2056
2057 2004-08-03 Mark Mitchell <mark@codesourcery.com>
2058
2059 * class.c (build_vtable): Do not set DECL_VISIBILITY here.
2060 (check_field_decls): Or here.
2061 (check_methods): Or here.
2062 (initialize_array): Don't mess with DECL_CONTEXT.
2063 * cp-tree.h (start_decl): Adjust prototype.
2064 (determine_visibility): New function.
2065 * decl.c (duplicate_decls): Remove checks for hidden "operator
2066 new".
2067 (build_library_fn_1): Give all library functions default
2068 visibility.
2069 (start_decl): Add pop_scope_p parameter. Tidy.
2070 (cp_finish_decl): Do not pop scopes here. Call
2071 determine_visibility for variable definitions.
2072 (start_preparsed_function): Call determine_visibility.
2073 * decl2.c (determine_visibility): New function.
2074 * method.c (use_thunk): Fix formatting.
2075 * parser.c (cp_parser_condition): Adjust calls to start_decl.
2076 (cp_parser_init_declarator): Likewise.
2077 * pt.c (instantiate_decl): Always call pop_nested_class.
2078 * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY.
2079 (tinfo_base_init): Likewise.
2080
2081 2004-08-02 Mark Mitchell <mark@codesourcery.com>
2082
2083 PR c++/16707
2084 * name-lookup.c (validate_nonmember_using_decl): Robustify.
2085
2086 2004-08-01 Mark Mitchell <mark@codesourcery.com>
2087
2088 PR c++/16224
2089 * name-lookup.c (decl_namespace): Remove.
2090 (current_decl_namespace): Use decl_namespace_context instead of
2091 decl_namespace.
2092 (push_decl_namespace): Likewise.
2093 (arg_assoc_class): Likewise.
2094 (arg_assoc_type): Likewise.
2095 * pt.c (check_specialization_namespace): New function.
2096 (maybe_process_partial_specialization): Use it.
2097 (register_specialization): Likewise.
2098
2099 PR c++/16489
2100 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro.
2101 * call.c (null_ptr_cst_p): Handle variables with constant
2102 initializers.
2103 * pt.c (convert_nontype_argument): Use
2104 DECL_INTEGRAL_CONSTANT_VAR_P.
2105 * semantics.c (finish_id_expression): Likewise.
2106
2107 PR c++/16529
2108 * decl.c (duplicate_decls): Reject duplicate namespace
2109 declarations.
2110
2111 PR c++/16810
2112 * typeck.c (build_ptrmemfunc): Loosen assertion.
2113
2114 2004-08-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
2115
2116 * call.c (z_candidate::template_decl): Rename from template.
2117 (add_template_candidate_real): Adjust member reference.
2118 (joust): Likewise.
2119
2120 2004-07-29 Mark Mitchell <mark@codesourcery.com>
2121
2122 * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
2123 (lang_decl_flags): Narrow the width of "languages". Add
2124 repo_available_p.
2125 (DECL_NEEDED_P): Remove.
2126 (FOR_EACH_CLONE): New macro.
2127 (DECL_REPO_AVAILABLE_P): Likewise.
2128 (DECL_TINFO_P): Likewise.
2129 (set_linkage_according_to_type): Declare.
2130 (import_export_vtable): Remove.
2131 (import_export_tinfo): Likewise.
2132 (mark_needed): New function.
2133 (decl_needed_p): Likewise.
2134 (note_vauge_linkage_fn): Likewise.
2135 (init_repo): Change prototype.
2136 (repo_template_used): Remove.
2137 (repo_template_instantiated): Likewise.
2138 (repo_emit_p): New function.
2139 (repo_export_class_p): Likewise.
2140 (no_linkage_check): Change prototype.
2141 * class.c (set_linkage_according_to_type): New function.
2142 (build_vtable): Use it. Do not call import_export_vtable. Set
2143 DECL_IGNORED_P if appropriate.
2144 * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
2145 (make_rtL_for_nonlocal_decls): Check for template instantiations
2146 explicitly.
2147 (grokfndecl): Adjust call to no_linkage_check.
2148 (set_linkage_for_static_data_member): New function.
2149 (grokvardecl): Use it. Adjust call to no_linkage_check.
2150 (grokdeclarator): Use set_linkage_for_static_data_member.
2151 * decl2.c (note_vague_linkage_fn): New function.
2152 (note_vague_linkage_var): Likewise.
2153 (finish_static_data_member_decl): Use it.
2154 (import_export_vtable): Remove.
2155 (import_export_class): Use repo_export_class_p.
2156 (var_finalized_p): Simplify.
2157 (maybe_emit_vtables): Simplify.
2158 (mark_needed): New function.
2159 (decl_needed_p): Likewise.
2160 (import_export_decl): Add documentation and consistency checks.
2161 Use repo_emit_p. Handle virtual tables and RTTI information
2162 here.
2163 (import_export_tinfo): Remove.
2164 (write_out_vars): Call import_export_decl.
2165 (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
2166 whenever one is.
2167 (finish_file): Use decl_needed_p. Do not call import_export_decl
2168 for undefined static data members. Do not warn about undefined
2169 inlines when using a repository.
2170 (mark_used): Use note_vague_linkage_fn. Always defer template
2171 instantiations.
2172 * lex.c (cxx_init): Adjust call to init_repo. Always set
2173 flag_unit_at_a-time.
2174 * method.c (synthesize_method): Remove unncessary
2175 import_export_decl call.
2176 (implicitly_declare_fn): Use set_linkage_according_to_type.
2177 * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
2178 * pt.c (instantiate_class_template): Don't redundantly add classes
2179 to keyed_classes. Don't call repo_template_used.
2180 (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
2181 templates with internal linkage.
2182 (check_instantiated_args): Adjust call to no_linkage_check.
2183 (instantiate_template): Use FOR_EACH_CLONE.
2184 (mark_definable): New function.
2185 (mark_decl_instantiated): Use it.
2186 (do_decl_instantiation): Adjust tests for explicit instantiation
2187 after "extern template".
2188 (instantiate_class_member): Do not use repo_template_instantiated.
2189 (do_type_instantiation): Simplify.
2190 (instantiate_decl): Use mark_definable. Check repo_emit_p.
2191 Simplify.
2192 * repo.c (repo_get_id): Remove.
2193 (original_repo): Remove.
2194 (IDENTIFIER_REPO_USED): Remove.
2195 (IDENTIFIER_REPO_CHOSEN): Remove.
2196 Remove all #if 0'd code.
2197 (repo_template_used): Remove.
2198 (repo_template_instantiated): Remove.
2199 (temporary_obstack_initialized_p): New variable.
2200 (init_repo): Register with lang_post_pch_load. Avoid creating
2201 identifiers unnecessarily. Don't use original_repo. Close the
2202 file here.
2203 (reopen_repo_file_for_write): Not here.
2204 (finish_repo): Always write out a new repository file.
2205 (repo_emit_p): New function.
2206 (repo_export_class_p): Likewise.
2207 * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
2208 (involves_incomplete_p): New function.
2209 (tinfo_base_init): Use it.
2210 (ptr_initializer): Remove non_public_ptr parameter.
2211 (ptm_initializer): Likewise.
2212 (get_pseudo_ti_init): Likewise.
2213 (unemitted_tinfo_decl_p): Remove.
2214 (emit_tinfo_decl): Use import_export_decl.
2215 * semantics.c (expand_body): Move updates of static_ctors and
2216 static_dtors to ...
2217 (expand_or_defer_fn): ... here.
2218 * tree.c (no_linkage_check): Add relaxed_p parameter.
2219
2220 2004-07-28 Eric Christopher <echristo@redhat.com>
2221
2222 * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
2223
2224 2004-07-28 Nathan Sidwell <nathan@codesourcery.com>
2225
2226 * cp-tree.h (struct tree_pair_s): New.
2227 (typedef tree_pair_p): New.
2228 (DEF_VEC_O(tree_pair_s)): New.
2229 (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s).
2230 (CLASSTYPE_VCALL_INDICES): Update documentation.
2231 * class.c (get_vcall_index): Adjust.
2232 (add_vcall_offset): Adjust.
2233
2234 2004-07-27 Kelley Cook <kcook@gcc.gnu.org>
2235
2236 * pt.c, typeck.c: Remove spurious carriage returns.
2237
2238 2004-07-27 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2239
2240 PR c++/14429
2241 * pt.c (coerce_template_template_parms) <PARM_DECL case>: Only check
2242 when the type of ARG is not dependent.
2243
2244 2004-07-26 Geoffrey Keating <geoffk@apple.com>
2245
2246 * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
2247 (lang_specific_driver): If the C++ or math library options don't
2248 start with '-l', don't count them as added libraries.
2249
2250 2004-07-26 Nathan Sidwell <nathan@codesourcery.com>
2251
2252 * decl.c (xref_basetypes): Adjust base access vector creation.
2253 * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
2254 access accesses.
2255 * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.
2256
2257 2004-07-26 Niall Douglas <s_fsfeurope2@nedprod.com>
2258 Brian Ryner <bryner@brianryner.com>
2259
2260 PR c++/15000
2261 PR c++/9283
2262 * class.c (check_field_decls): Apply hidden visibility if
2263 -fvisibility-inlines-hidden and inlined unless otherwise specified
2264 (build_vtable): Set vtable visibility to class visibility.
2265 (check_field_decls): Default static member visibility to class
2266 visibility.
2267 (check_methods): Default method visibility to class visibility.
2268 * cp-tree.h: Added CLASSTYPE_VISIBILITY and
2269 CLASSTYPE_VISIBILITY_SPECIFIED macro.
2270 * decl.c (duplicate_decls): New logic for merging definition decls
2271 with declaration decls. Added ignore & warning when non default
2272 applied to global operator new or delete.
2273 * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
2274 wherever VISIBILITY was changed
2275 * rtti.c (get_tinfo_decl): Set typeinfo visibility to class
2276 visibility.
2277 (tinfo_base_init): Set typeinfo name visibility to class visibility.
2278
2279 2004-07-25 Bernardo Innocenti <bernie@develer.com>
2280
2281 * decl.c: Rename all identifiers named `class' to `cl'.
2282 * cp-tree.h: Likewise.
2283
2284 2004-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
2285
2286 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
2287 * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
2288 * name-lookup.c (binding_entry_make): Use GGC_NEW.
2289 (binding_table_construct): Use GGC_CNEWVEC.
2290 (binding_table_new): Use GGC_NEW.
2291 (cxx_binding_make): Likewise.
2292 (begin_scope): Likewise.
2293 (push_to_top_level): Use GCC_CNEW.
2294 * parser.c (cp_token_cache_new): Likewise.
2295 (cp_token_cache_push_token): Likewise.
2296 (cp_lexer_new_main): Likewise.
2297 (cp_lexer_new_from_tokens): Likewise.
2298 (cp_parser_context_new): Likewise.
2299 (cp_parser_new): Likewise.
2300 (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
2301 * lex.c (cxx_make_type): Use GGC_CNEW.
2302 (retrofit_lang_decl): Use GGC_NEWVAR.
2303 (cxx_dup_lang_specific_decl): Likewise.
2304 (copy_lang_type): Likewise.
2305 * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
2306 (save_function_data): Likewise.
2307 (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
2308 (cxx_push_function_context): Likewise.
2309
2310 2004-07-25 Richard Henderson <rth@redhat.com>
2311
2312 * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
2313 DECL_IGNORED_P on RESULT_DECL.
2314 * semantics.c (finalize_nrv): Copy them too.
2315
2316 2004-07-23 Nathan Sidwell <nathan@codesourcery.com>
2317
2318 * search.c (lookup_conversion_operator): Avoid two loops.
2319 (add_conversions): Remove.
2320 (check_hidden_convs, split_conversions,
2321 lookup_conversions_r): New.
2322 (lookup_conversions): Use lookup_conversions_r.
2323
2324 2004-07-22 Nathan Sidwell <nathan@codesourcery.com>
2325
2326 * pt.c (get_template_base): Check type is completable.
2327
2328 2004-07-21 Eric Christopher <echristo@redhat.com>
2329
2330 * decl.c (poplevel): Inline unused variable checking.
2331 Change formatting.
2332
2333 2004-07-21 Paolo Bonzini <bonzini@gnu.org>
2334
2335 * typeck.c (build_binary_op): Do not use RDIV_EXPR for
2336 integer vectors.
2337
2338 2004-07-21 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2339
2340 PR c++/14497
2341 * pt.c (check_explicit_specialization): Remove extension to accept
2342 specializations without template headers. Fall-through to normal
2343 processing.
2344
2345 2004-07-21 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2346
2347 PR c++/509
2348 * pt.c (determine_specialization): New parameter template_count.
2349 Disambiguate between member templates and member functions counting
2350 the template headers.
2351 (check_explicit_specialization): Update caller.
2352 (tsubst_friend_function): Likewise.
2353
2354 2004-07-20 Steven Bosscher <stevenb@suse.de>
2355
2356 * cp-tree.def (TINST_LEVEL): Make it an 'x' node.
2357 * cp-tree.h (tinst_level_t): New tree type.
2358 (union lang_tree_node): Handle it.
2359 (TINST_LOCATION): New accessor macro.
2360 (make_tinst_level): New prototype.
2361 * cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
2362 * decl.c (cp_tree_node_structure): Likewise.
2363 * error.c (print_instantiation_full_context): Use TINST_LOCATION.
2364 (print_instantiation_partial_context): Likewise.
2365 * pt.c (pop_tinst_level): Likewise.
2366 (push_tinst_level): Use make_tinst_level.
2367 * tree.c (make_tinst_level): New function.
2368 (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.
2369
2370 2004-07-20 Mark Mitchell <mark@codesourcery.com>
2371
2372 * parser.c (cp_parser_simple_type_specifier): Fix typo.
2373
2374 PR c++/16637
2375 * parser.c (cp_parser_simple_type_specifier): Do not record usage
2376 of globally-qualified names.
2377
2378 2004-07-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2379
2380 PR c++/16175
2381 * error.c (dump_type) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Output
2382 cv qualifier.
2383
2384 2004-07-19 Mark Mitchell <mark@codesourcery.com>
2385
2386 PR c++/16623
2387 * cp-tree.h (lang_type_class): Add lazy_assignment_op.
2388 (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
2389 * class.c (add_implicitly_declared_members): Use
2390 CLASSTYPE_LAZY_ASSIGNMENT_OP.
2391 * method.c (lazily_declare_fn): Clear
2392 CLASSTYPE_LAZY_ASSIGNMENT_OP.
2393 * search.c (lookup_fnfields_1): Check it.
2394
2395 2004-07-20 Nathan Sidwell <nathan@codesourcery.com>
2396
2397 * cp-tree.h (vec_binfo_member): Remove.
2398 * tree.c (vec_binfo_member): Remove.
2399
2400 * cp-tree.h (struct lang_type_class): Remove vfields field.
2401 (CLASSTYPE_VFIELDS): Remove.
2402 (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
2403 * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
2404 handling.
2405 (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
2406 (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
2407 * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
2408
2409 2004-07-20 Nathan Sidwell <nathan@codesourcery.com>
2410
2411 * cp-tree.h (DEF_VEC_P(tree)): Remove here.
2412 (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
2413 Moved to common.
2414 (BINFO_LANG_SLOTS): Remove.
2415 * tree.c (copy_binfo): Adjust BINFO creation and accessors.
2416 * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
2417 * class.c (check_bases): Adjust BINFO accessors.
2418 (determine_primary_base, finish_struct_bits,
2419 maybe_warn_about_overly_private_class, warn_hidden,
2420 walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
2421 warn_about_ambiguous_bases, get_vfield_name,
2422 dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
2423 add_vcall_offset_vtbl_entries_r): Likewise.
2424 * dump.c (cp_dump_tree): Likewise.
2425 * init.c (sort_mem_initializers, expand_member_init, build_delete,
2426 push_base_cleanups): Likewise.
2427 * method.c (do_build_copy_constructor, do_build_assign_ref,
2428 synthesize_exception_spec): Likewise.
2429 name-lookup.c (arg_assoc_class): Likewise.
2430 * pt.c (instantiate_class_template,
2431 get_template_base_recursive): Likewise.
2432 * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
2433 * typeck2.c (process_init_constructor): Likewise.
2434 * search.c (lookup_base_r, dynamic_cast_base_recurse,
2435 dfs_access_in_type, dfs_walk_real, look_for_overrides,
2436 types_overlap_p, copied_binfo, original_binfo): Likewise.
2437 (binfo_for_vtable): Remove
2438
2439 2004-07-20 Steven Bosscher <stevenb@suse.de>
2440
2441 * cp-tree.h (struct lang_decl_flags): Unify the template_info and
2442 thunk_alias, and the access and virtual_offset fields.
2443 (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
2444 * decl.c (finish_case_label): Update c_add_case_node call.
2445
2446 2004-07-19 Mark Mitchell <mark@codesourcery.com>
2447
2448 Revert patch for PR c++/16623.
2449
2450 2004-07-19 Kelley Cook <kcook@gcc.gnu.org>
2451
2452 * except.c: Remove two spurious carriage returns.
2453
2454 2004-07-19 Mark Mitchell <mark@codesourcery.com>
2455
2456 PR c++/16623
2457 * cp-tree.h (lang_type_class): Add lazy_assignment_op.
2458 (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
2459 * class.c (add_implicitly_declared_members): Use
2460 CLASSTYPE_LAZY_ASSIGNMENT_OP.
2461 * method.c (lazily_declare_fn): Clear
2462 CLASSTYPE_LAZY_ASSIGNMENT_OP.
2463 * search.c (lookup_fnfields_1): Check it.
2464
2465 2004-07-19 Nathan Sidwell <nathan@codesourcery.com>
2466
2467 * class.c (add_method): Delay adding the slot until the end.
2468 (determine_primary_base): Adjust VEC_iterate invokation.
2469 (resort_type_method_vec, finish_struct_methods, warn_hidden,
2470 walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
2471 build_vtbl_initializer): Likewise.
2472 * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
2473 build_vbase_delete): Likewise.
2474 * method.c (do_build_copy_constructor): Likewise.
2475 * name-lookup.c (new_class_binding, print_binding_level,
2476 poplevel_class, store_class_bindings, push_to_top_level,
2477 pop_from_top_level): Likewise.
2478 * pt.c (check_explicit_specialization): Likewise.
2479 * search.c (lookup_conversion_operator, lookup_fnfields_1,
2480 get_pure_virtuals, add_conversions, dfs_check_overlap,
2481 binfo_for_vbase): Likewise.
2482
2483 2004-07-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2484
2485 PR c++/12170
2486 * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
2487 innermost set of template arguments during deduction. Simplify.
2488
2489 2004-07-19 Joseph S. Myers <jsm@polyomino.org.uk>
2490
2491 * typeck.c (build_modify_expr, build_x_modify_expr): Set
2492 TREE_NO_WARNING on assignments with an operator other than '='.
2493
2494 2004-07-10 Steven Bosscher <stevenb@suse.de>
2495 Joseph S. Myers <jsm@polyomino.org.uk>
2496
2497 * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
2498 * decl2.c (grokfield): Don't check current_class_depth via
2499 unused TREE_COMPLEXITY.
2500 * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
2501 to avoid the missing parentheses warning.
2502 Don't set C_SET_EXP_ORIGINAL_CODE.
2503
2504 2004-07-18 Mark Mitchell <mark@codesourcery.com>
2505
2506 * tree.c (no_linkage_helper): Remove.
2507 (no_linkage_check): Don't use walk_tree_without_duplicates.
2508
2509 * mangle.c (write_expression): Issue a sorry for zero-operand
2510 functional casts.
2511
2512 2004-07-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2513
2514 PR c++/13092
2515 * init.c (build_offset_ref): Build SCOPE_REF with non-null
2516 TREE_TYPE for non-dependent names.
2517 * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
2518 * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
2519 unknown_type_node as its TREE_TYPE.
2520 * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
2521 * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
2522 (dump_expr) <SCOPE_REF case>: Likewise.
2523
2524 2004-07-17 Jason Merrill <jason@redhat.com>
2525
2526 PR c++/16115
2527 * call.c (type_passed_as): Make the invisible reference type
2528 __restrict.
2529 * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
2530 cp_genericize_r. Handle invisible reference lowering.
2531 (is_invisiref_parm): New fn.
2532 (cp_genericize): Adjust the types of invisible reference parms.
2533 Don't repeat the walk for clones.
2534 * decl.c (store_parm_decls): Don't generate any code for clones.
2535
2536 2004-07-17 Joseph S. Myers <jsm@polyomino.org.uk>
2537
2538 * cp-tree.h (builtin_function): Declare.
2539
2540 2004-07-16 Mark Mitchell <mark@codesourcery.com>
2541
2542 * class.c (finish_struct_methods): Remove unncessary code.
2543 (add_implicitly_declared_members): Create declarations for default
2544 constructors and copy constructors lazily.
2545 * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
2546 lazy_copy_ctor.
2547 (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
2548 (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
2549 * decl2.c (check_classfn): Robustify.
2550 (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
2551 (locate_ctor): Handle lazy default constructors.
2552 (locate_copy): Handle lazy copy constructors.
2553 (implicitly_declare_fn): Make sure we're looking at the
2554 TYPE_MAIN_VARIANT for a class before creating functions. Don't
2555 set TYPE_HAS_CONSTRUCTOR.
2556 (lazily_declare_fn): New function.
2557 * name-lookup.c (constructor_name_full): Simplify.
2558 * search.c (lookup_fnfields_1): Lazily create methods, as
2559 necessary.
2560 (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
2561
2562 2004-07-16 Steven Bosscher <stevenb@suse.de>
2563
2564 * cp-tree.h (struct lang_type): Don't have three GTY options on a
2565 single bit GTY desc.
2566
2567 2004-07-16 Richard Henderson <rth@redhat.com>
2568
2569 * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
2570 * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
2571 * tree.c (cp_copy_res_decl_for_inlining): Remove.
2572
2573 2004-07-16 Nathan Sidwell <nathan@codesourcery.com>
2574
2575 * class.c (finish_struct_bits): Use for loop.
2576 (propagate_binfo_offsets): Do primary binfo outside of loop.
2577
2578 PR c++/16583
2579 * dump.c (cp_dump_tree): Don't dump the bases if there's no
2580 binfo.
2581
2582 * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
2583
2584 2004-07-15 Mark Mitchell <mark@codesourcery.com>
2585
2586 * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
2587 has_abstract_assign_ref. Make methods a VEC(tree) *.
2588 (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
2589 (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
2590 (CLASSTYPE_DESTRUCTORS): Likewise.
2591 (TYPE_HAS_REAL_ASSIGN_REF): Remove.
2592 (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
2593 (add_method): Change prototoype.
2594 * class.c (add_method): Remove error_p parameter. Adjust for
2595 changes to CLASSTYPE_METHOD_VEC.
2596 (handle_using_decl): Adjust call to add_method.
2597 (maybe_warn_about_overly_private_class): Adjust for
2598 changes to CLASSTYPE_METHOD_VEC.
2599 (resort_type_method_vec): Likewise.
2600 (finish_struct_methods): Likewise.
2601 (check_for_override): Likewise.
2602 (warn_hidden): Likewise.
2603 (add_implicitly_declared_members): Defer creation of assignment
2604 operators. Adjust call to add_method.
2605 (clone_function_decl): Adjust call to add_method.
2606 (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
2607 (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
2608 * decl.c (grok_special_member_properties): Don't set
2609 TYPE_HAS_ABSTRACT_ASSIGN_REF.
2610 * decl2.c (check_classfn): Adjust for
2611 changes to CLASSTYPE_METHOD_VEC.
2612 * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
2613 (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
2614 (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
2615 (implicitly_declare_fn): Set DECL_SOURCE_LOCATION. Do not call
2616 cp_finish_decl.
2617 * pt.c (check_explicit_specialization): Adjust for
2618 changes to CLASSTYPE_METHOD_VEC.
2619 (instantiate_class_template): Do not set
2620 TYPE_HAS_ABSTRACT_ASSIGN_REF.
2621 * ptree.c (cxx_print_type): Don't try to print
2622 CLASSTYPE_METHOD_VEC.
2623 * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
2624 * search.c (lookup_field_r): Adjust for
2625 changes to CLASSTYPE_METHOD_VEC.
2626 (lookup_fnfields): Likewise.
2627 (lookup_conversion_operator): Likewise.
2628 (lookup_fnfields_1): Likewise. Create assignment operators
2629 lazily.
2630 (look_for_overrides_here): Adjust for
2631 changes to CLASSTYPE_METHOD_VEC.
2632 (add_conversions): Likewise.
2633 * semantics.c (finish_member_declaration): Adjust call to add_method.
2634
2635 2004-07-15 Jason Merrill <jason@redhat.com>
2636
2637 * cp-lang.c (cxx_types_compatible_p): To the middle-end,
2638 references and pointers are compatible.
2639
2640 2004-07-15 Nathan Sidwell <nathan@codesourcery.com>
2641
2642 * decl.c (xref_basetypes): Refactor.
2643 * tree.c (copy_base_binfos): Replace with ...
2644 (copy_binfo): ... this. Deep copy the given binfo, (not the just
2645 bases of the given base).
2646 * cp-tree.h (copy_base_binfo): Remove.
2647 (copy_binfo): Declare.
2648
2649 2004-07-15 Mark Mitchell <mark@codesourcery.com>
2650
2651 * name-lookup.c (set_inherited_value_binding_p): Add class_type
2652 parameter.
2653 (get_class_binding): Adjust.
2654 (push_class_level_binding): Don't use set_inherited_value_binding_p.
2655
2656 2004-07-15 Nathan Sidwell <nathan@codesourcery.com>
2657
2658 * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
2659 * decl.c (xref_basetypes): Set it here.
2660
2661 * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here.
2662 Don't check for incomplete base.
2663 (get_vfield_name): Simplify while loop.
2664 * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here.
2665
2666 2004-07-14 Mark Mitchell <mark@codesourcery.com>
2667
2668 * lex.c (cxx_make_type): Remove call to get_pointer_type.
2669
2670 * cp-tree.h (IDENTIFIER_VALUE): Remove.
2671 (BINFO_PUSHDECLS_MARKED): Likewise.
2672 (maybe_inject_for_scope_var): Likewise.
2673 (push_class_decls): Likewise.
2674 * name-lookup.h (push_class_binding): Remove.
2675 (innermost_non_namespace_value): New function.
2676 (outer_binding): Likewise.
2677 * class.c (add_method): Push bindings before adding to
2678 TYPE_METHODS.
2679 (restore_class_cache): Do not restore class_shadowed.
2680 (pushclass): Do not add USING_DECLs. Do not call
2681 push_class_decls.
2682 * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c.
2683 * decl.c (pushdecl): Use outer_binding.
2684 (poplevel): Set the scope for an out-of-scope for-loop declaration
2685 appropriately.
2686 (cp_finish_decl): Don't call maybe_inject_for_scope_var.
2687 * name-lookup.c (new_class_binding): New function.
2688 (push_binding): Use it.
2689 (pushdecl): Use innermost_non_namespace_value.
2690 (maybe_inject_for_scope_var): Remove.
2691 (push_class_binding): Remove.
2692 (set_inherited_value_binding_p): New function.
2693 (get_class_binding): New function.
2694 (push_class_level_binding): Assert that the current_class_type is
2695 being defined.
2696 (outer_binding): New function.
2697 (innermost_non_namespace_value): Likewise.
2698 (lookup_name_real): Use outer_binding.
2699 (lookup_name_current_level): Ignore out-of-scope variables.
2700 * pt.c (check_template_shadow): Use innermost_non_namespace_value.
2701 (lookup_template_class): Likewise.
2702 * search.c (dfs_push_type_decls): Remove.
2703 (dfs_push_decls): Likewise.
2704 (setup_class_bindings): Likewise.
2705 (lookup_field_1): Handle USING_DECLs from dependent scopes.
2706 (marked_pushdecls_p): Remove.
2707 (unmarked_pushdecls_p): Remove.
2708 (marked_identifiers): Remove.
2709 (setup_class_bindings): Remove.
2710 (dfs_push_type_decls): Remove.
2711 (dfs_push_decls): Remove.
2712 (push_class_decls): Remove.
2713
2714 2004-07-13 Mark Mitchell <mark@codesourcery.com>
2715
2716 PR c++/16518
2717 PR c++/16337
2718 * decl.c (grokvardecl): Make declspecs parameter const.
2719 (grokdeclarator): Likewise. Adjust accordingly.
2720 * decl.h (grokdeclarator): Adjust declaration.
2721 * parser.c (cp_parser_init_declarator): Do not clear
2722 decl_specifiers->attributes.
2723
2724 * cp-tree.h (lang_identifier): Remove class_value.
2725 (IDENTIFIER_CLASS_VALUE): Remove.
2726 (pop_class_decls): Likewise.
2727 (init_search_processing): Likewise.
2728 * class.c (handle_using_decl): Use lookup_member, not
2729 IDENTIFIER_CLASS_VALUE.
2730 (restore_class_cache): New function, split out from ...
2731 (pushclass): ... here. Do not call clear_identifier_class_values.
2732 (invalidate_class_lookup_cache): Do not clear
2733 IDENTIFIER_CLASS_VALUE.
2734 (popclass): Do not call pop_class_decls.
2735 (maybe_note_name_used_in_class): Do not save names looked up after
2736 the class is complete. Use lookup_member, not
2737 IDENTIFIER_CLASS_VALUE.
2738 * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c.
2739 * decl.c (cxx_init_decl_processing): Do not call
2740 init_search_processing.
2741 * method.c (do_build_copy_constructor): Remove unnecessary code.
2742 (do_build_assign_ref): Likewise.
2743 * name-lookup.c (pushdecl): Use lookup_member, not
2744 IDENTIFIER_CLASS_VALUE.
2745 (set_identifier_type_value_with_scope): Set TREE_TYPE on the
2746 type_shadowed list.
2747 (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE.
2748 (push_class_binding): Do not set it.
2749 (clear_identifier_class_values): Remove.
2750 (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE.
2751 (store_binding): Do not save it.
2752 (pop_from_top_level): Do not restore it.
2753 * name-lookup.h (cxx_saved_binding): Remove class_value.
2754 (clear_identifier_class_values): Remove.
2755 * ptree.c (cxx_print_identifier): Do not print
2756 IDENTIFIER_CLASS_VALUE.
2757 * search.c (search_obstack): Remove.
2758 (push_stack_level): Remove.
2759 (pop_stack_level): Remove.
2760 (search_level): Remove.
2761 (search_stack): Remove.
2762 (lookup_member): Don't check IDENTIFIER_CLASS_VALUE.
2763 (setup_class_bindings): Use IDENTIFIER_MARKED, not
2764 IDENTIFIER_CLASS_VALUE.
2765 (marked_identifiers): New variable.
2766 (push_class_decls): Clear IDENTIFIER_MARKED.
2767 (pop_class_decls): Don't call pop_search_level.
2768 (init_search_processing): Remove.
2769
2770 2004-07-12 Mark Mitchell <mark@codesourcery.com>
2771
2772 * cp-tree.h (get_aggr_typedef): Remove.
2773 * init.c (get_aggr_typedef): Likewise.
2774
2775 * name-lookup.c (push_class_level_binding): Simplify.
2776
2777 2004-07-12 Andrew Pinski <apinski@apple.com>
2778
2779 PR c++/16475
2780 Revert:
2781 2004-07-07 H.J. Lu <hongjiu.lu@intel.com>
2782 PR c++/16276
2783 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
2784 is not public.
2785
2786 2004-07-12 Eric Christopher <echristo@redhat.com>
2787
2788 * parser.c (cp_parser_class_head): Remove unused variable.
2789
2790 2004-07-12 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2791
2792 * decl.c (grok_op_properties): Reject [de-]allocation functions
2793 declared in a namespace, or declared as static.
2794
2795 2004-07-12 Nathan Sidwell <nathan@codesourcery.com>
2796
2797 * cp-tree.h (make_binfo): Remove.
2798 * decl.c (xref_basetypes): Use make_tree_binfo directly.
2799 * tree.h (copy_base_binfos): Likewise.
2800 (make_binfo): Remove.
2801
2802 * call.c (build_user_type_conversion_1, build_new_op,
2803 check_constructor_callable, build_temp,
2804 perform_direct_initialization_of_possible): Pass type directly to
2805 lookup_fnfields & build_special_member_call.
2806 (build_special_member_call): Accept a type, and complete it.
2807 * class.c (finish_stuct_bits): Copy the BINFOs here.
2808 * cvt.c (ocp_convert): Pass type directly to
2809 build_special_member_call.
2810 * decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
2811 (xref_basetypes): Allocate the binfo here. Adjust.
2812 * init.c (build_init, build_new_1): Pass type directly to
2813 build_special_member_call.
2814 * lex.c (cxx_make_type): Do not allocate binfo here.
2815 * name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
2816 * parser.c (cp_parser_class_head): Always call xref_basetypes.
2817 * pt.c (instantiate_class_template): Likewise. Inhibit access
2818 checking for template friends.
2819 * ptree.c (cxx_print_type): Adjust record printing.
2820 * search.c (lookup_base): When taking a type, complete it before
2821 looking for a binfo.
2822 (lookup_member): Delay completing a type.
2823 (push_class_decls): Don't walk an incomplete type.
2824 (lookup_conversions): Likewise.
2825 * semantics.c (finish_stmt_expr_expr): Pass type directly to
2826 build_special_member_call.
2827 * tree.c (copy_base_binfos): Adjust.
2828 (make_binfo): Likewise.
2829 * typeck.c (build_modify_expr): Pass type directly to
2830 build_special_member_call.
2831 * typeck2.c (process_init_constructor): Check a binfo exists.
2832 (build_m_component_ref): Allow accessing an incomplete type.
2833 (build_functional_cast): Pass type directly to
2834 build_special_member_call.
2835
2836 2004-07-12 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2837
2838 PR c++/2204
2839 * config-lang.in (gtfiles): Add typeck2.c.
2840 * Make-lang.in: Tweak typeck2.c dependencies, and add rule for
2841 gt-cp-typeck2.h.
2842 * cp-tree.h: Declare complete_type_check_abstract.
2843 * typeck2.c (pat_calc_hash, pat_compare,
2844 complete_type_check_abstract): New functions.
2845 (abstract_virtuals_error): If the type is abstract, register the
2846 declaration within abstract_pending_vars for further checks.
2847 Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
2848 * decl.c (cp_finish_decl): Do not strip array types.
2849 (create_array_type_for_decl): Check for abstractness of the element
2850 type.
2851 (complete_vars): Call complete_type_check_abstract.
2852 * class.c (finish_struct): Prepare a list of virtual functions for
2853 template types, and call complete_vars on it to check for abstractness.
2854
2855 2004-07-12 Paolo Bonzini <bonzini@gnu.org>
2856
2857 PR tree-optimization/14107
2858 * decl.c (finish_function): Remove temporary band-aid.
2859
2860 2004-07-11 Mark Mitchell <mark@codesourcery.com>
2861
2862 * call.c (build_operator_new_call): Avoid using push_to_top_level.
2863 (build_new_op): Adjust call to lookup_function_nonclass.
2864 * name-lookup.c (identifier_type_value): Adjust call to
2865 lookup_name_real.
2866 (lookup_name_real): Add block_p parameter.
2867 (lookup_name_nonclass): Adjust call to lookup_name_real.
2868 (lookup_function_nonclass): Likewise.
2869 (lookup_name): Likewise.
2870 * name-lookup.h (lookup_name_real): Change prototype.
2871 (lookup_name_nonclass): Likewise.
2872 * parser.c (cp_parser_lookup_name): Likewise.
2873
2874 * cp-tree.h (saved_scope): Make old_bindings a vector.
2875 (unuse_fields): Remove.
2876 * name-lookup.h (cxx_saved_binding): Define it.
2877 * class.c (pushclass): Don't use unuse_fields.
2878 * name-lookup.c (cxx_saved_binding_make): Remove.
2879 (store_binding): Add new bindings to a vector, using an
2880 accumulator style, rather than adding them to a list.
2881 (store_bindings): Adjust accordingly.
2882 (store_class_bindings): Likewise.
2883 (push_to_top_level): Likewise.
2884 (pop_from_top_level): Likewise.
2885 * optimize.c (maybe_clone_body): Must push_to_top_level and
2886 pop_from_top_level calls outside of loop.
2887 * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope
2888 calls here from cp_parser_late_parsing_default_args.
2889 (cp_parser_save_default_args): Record the class type in which the
2890 function is declared.
2891 (cp_parser_late_parsing_default_args): Do not call
2892 push_nested_class/pop_nested_class.
2893 * search.c (dfs_unuse_fields): Remove.
2894 (unuse_fields): Remove.
2895
2896 2004-07-11 Joseph S. Myers <jsm@polyomino.org.uk>
2897
2898 * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
2899 LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
2900 * cp-tree.h (poplevel): Declare.
2901 (set_block): Remove.
2902 * decl.c (set_block): Remove.
2903
2904 2004-07-10 Mike Stump <mrs@apple.com>
2905
2906 * decl2.c (import_export_class): Never export/import vtables
2907 with inline key functions.
2908
2909 2004-07-09 Steven Bosscher <stevenb@suse.de>
2910
2911 * typeck.c (c_expand_asm_operands): Remove.
2912
2913 2004-07-09 Mike Stump <mrs@apple.com>
2914
2915 * typeck.c (build_class_member_access_expr): Skip null deref
2916 warning when we don't dereference it.
2917
2918 2004-07-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2919
2920 PR c++/8211
2921 PR c++/16165
2922 * class.c (check_field_decls): Improve -Weffc++ warning: do not
2923 warn for pointers to functions/members, or for classes without
2924 destructors.
2925
2926 2004-07-08 Mark Mitchell <mark@codesourcery.com>
2927
2928 * name-lookup.h (struct cp_binding_level): Update documentation
2929 for class_shadowed.
2930
2931 2004-07-08 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2932
2933 PR c++/16169
2934 * typeck.c (check_return_expr): Improve -Weffc++ warning: handle
2935 returning CALL_EXPR, and non-reference return type.
2936
2937 2004-07-08 Nathan Sidwell <nathan@codesourcery.com>
2938
2939 * name-lookup.c (push_binding): Use VEC_reserve.
2940
2941 2004-07-08 Richard Henderson <rth@redhat.com>
2942
2943 * cp-tree.h (expand_eh_spec_block): Remove.
2944
2945 2004-07-07 Mark Mitchell <mark@codesourcery.com>
2946
2947 * cp-tree.h (saved_scope): Remove x_previous_class_type and
2948 x_previous_class_values; add x_previous_class_level.
2949 (previous_class_type): Remove.
2950 (previous_class_values): Remove.
2951 (previous_class_level): New macro.
2952 * class.c (pushclass): Restore the identifier cache more
2953 expeditiously.
2954 (invalidate_class_lookup_cache): Use vector for class_shadowed and
2955 previous_class_values.
2956 * decl.c (poplevel): Likewise.
2957 * name-lookup.c (cxx_binding_init): New function.
2958 (cxx_binding_make): Use it.
2959 (push_binding): For a binding in a class level, use a vector of
2960 cp_class_binding nodes.
2961 (push_binding_level): New function.
2962 (begin_scope): Use it.
2963 (leave_scope): Do not put class binding levels on the free list.
2964 (print_binding_level): Adjust for the fact that class_shadowed is
2965 a vector.
2966 (poplevel_class): Likewise.
2967 (clear_identifier_class_values): Likewise.
2968 (push_class_level_binding): Likewise.
2969 (set_class_shadows): Remove.
2970 (store_binding): New function.
2971 (store_class_bindings): New function.
2972 (push_to_top_level): Use store_class_bindings as appropriate.
2973 (pop_from_top_level): Use previous_class_level, not
2974 previous_class_type.
2975 * name-lookup.h (cp_class_binding): New type.
2976 (cp_binding_level): Use a vector object for class_shadowed.
2977 (push_binding_level): Declare.
2978 (set_class_shadows): Remove.
2979
2980 2004-07-07 Andrew Pinski <apinski@apple.com>
2981
2982 * class.c (instantiate_type): BUFFER_REF is dead.
2983 * lex.c (init_operators): IN_EXPR is dead.
2984
2985 2004-07-07 Jason Merrill <jason@redhat.com>
2986
2987 PR c++/16334
2988 * call.c (build_new_op): Give overload warnings for built-in
2989 candidates.
2990
2991 2004-07-07 H.J. Lu <hongjiu.lu@intel.com>
2992
2993 PR c++/16276
2994 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
2995 is not public.
2996
2997 2004-07-07 Nathan Sidwell <nathan@codesourcery.com>
2998
2999 * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
3000 * class.c (build_primary_vtable, check_bases,
3001 determine_primary_base, finish_struct_bits,
3002 maybe_warn_about_overly_private_class, dfs_find_final_overrider_q,
3003 get_basefndecls, warn_hidden, walk_subobject_offsets,
3004 build_base_fields, create_vtable_ptr, propagate_binfo_offsets,
3005 layout_virtual_bases, end_of_class, warn_about_ambiguous_bases,
3006 finish_struct_1, get_vfield_name, contains_empty_class_p,
3007 dump_class_hierarchy_r, finish_vtbls, build_vtt_inits,
3008 dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits,
3009 add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust
3010 BINFO macros.
3011 * decl.c (xref_basetypes): Likewise.
3012 * dump.c (cp_dump_tree): Likewise.
3013 * error.c (dump_expr): Likewise.
3014 * init.c (sort_mem_initializers, expand_member_init,
3015 push_base_cleanups): Likewise.
3016 * method.c (do_build_copy_constructor, do_build_assign_reg,
3017 synthesize_exception_spec): Likewise.
3018 * name-lookup.c (arg_assoc_class): Likewise.
3019 * pt.c (instantiate_class_template, tsubst,
3020 get_template_base_recursive): Likewise.
3021 * ptree.c (cxx_print_type): Likewise.
3022 * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
3023 * search.c (lookup_base_r, dynamic_cast_base_recurse,
3024 dfs_access_in_type, access_in_type, lookup_field_queue_p,
3025 bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp,
3026 marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp,
3027 dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet,
3028 binfo_for_vtable, copied_binfo, original_binfo): Likewise
3029 * tree.c (copy_base_binfos, make_binfo): Likewise.
3030 * typeck.c (commmon_base_type): Likewise
3031 * typeck2.c (process_init_constructor): Likewise
3032
3033 2004-07-06 Joseph S. Myers <jsm@polyomino.org.uk>
3034
3035 * decl.c (check_tag_decl): Name redeclared type in diagnostic.
3036
3037 2004-07-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3038
3039 PR c++/3671
3040 * pt.c (convert_nontype_argument): Disallow conversions between
3041 different enumeration types.
3042
3043 2004-07-06 Nathan Sidwell <nathan@codesourcery.com>
3044
3045 * cp-tree.h (BINFO_MARKED): Remove.
3046 (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED,
3047 BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P,
3048 BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n.
3049 (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P.
3050 * class.c (build_base_path): Use BINFO_VIRTUAL_P.
3051 (mark_primary_bases, determine_primary_base, base_derived_from,
3052 dfs_find_final_overrider, dfs_find_final_overrider_q,
3053 dfs_find_inal_overrider_post, update_vtable_entry_for_fn,
3054 dfs_modify_vtables, walk_subobject_offsets,
3055 layout_nonempty_base_or_field, build_base_field,
3056 build_base_fields, propagate_binfo_offsets, layout_virtual_bases,
3057 end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable,
3058 finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits,
3059 build_ctor_vtbl_group, accumulate_vtble_inits,
3060 dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries,
3061 build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r,
3062 add_vcall_offset_vtbl_entries_1): Likewise.
3063 * decl.c (xref_basetypes): Incomming virtual base indicated by
3064 TREE_TYPE. Adjust.
3065 * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P.
3066 * init.c (finish_init_stmts, sort_mem_initializers,
3067 emit_mem_initializers, build_vtble_address, expand_member_init,
3068 push_base_cleanups): Likewise.
3069 * method.c (do_build_copy_constructor): Likewise.
3070 * pt.c (instantiate_class_template,
3071 get_template_base_recursive): Likewise.
3072 * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init,
3073 get_pseudo_ti_desc): Likewise.
3074 * search.c (lookup_base_r, dynamic_cast_base_recurse,
3075 binfo_from_vbase, binfo_via_virtual, copied_binfo,
3076 original_binfo): Likewise.
3077 * semantics.c (finish_base_specifier): Virtualness is indicated
3078 by TREE_TYPE.
3079 * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P.
3080
3081 2004-07-06 Mark Mitchell <mark@codesourcery.com>
3082
3083 Revert:
3084 2004-06-24 Jason Merrill <jason@redhat.com>
3085 PR c++/16115
3086 * decl.c (grokparms): Give the PARM_DECL reference type if the
3087 parameter is passed by invisible reference.
3088
3089 2004-07-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3090
3091 * cp-lang.c (cp_var_mod_type_p): Add extra arg.
3092 * decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
3093 * pt.c (check_instantiated_args, unify): Likewise.
3094
3095 2004-07-05 Phil Edwards <phil@codesourcery.com>
3096
3097 * Make-lang.in (check-c++, lang_checks): Add some comments.
3098
3099 2004-07-05 Zack Weinberg <zack@codesourcery.com>
3100
3101 * cp-mudflap.c: Delete file.
3102 * Makefile.in: Remove all references to cp-mudflap.o.
3103
3104 2004-07-05 Zack Weinberg <zack@codesourcery.com>
3105
3106 * decl.c (cxx_init_decl_processing): Call
3107 build_common_tree_nodes before creating the global NAMESPACE_DECL.
3108
3109 2004-07-05 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3110
3111 PR c++/2518
3112 * call.c (build_operator_new_call): Look only at global scope.
3113
3114 2004-07-05 Nathan Sidwell <nathan@codesourcery.com>
3115
3116 * call.c (enforce_access): Expect TREE_BINFO.
3117 * class.c (binfo_ctor_vtable): Check TREE_BINFO.
3118 * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
3119 (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
3120 Adjust.
3121 (BINFO_LANG_ELTS): Remove.
3122 (BINFO_LANG_SLOTS): New.
3123 (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
3124 (CLASSTYPE_TEMPLATE_INFO): Adjust.
3125 * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
3126 * search.c (lookup_member): Check TREE_BINFO.
3127 * semantics.c (perform_or_defer_access_check): Likewise.
3128 (check_accessibility_of_qualified_id): Check
3129 deferred_access_no_check.
3130 * tree.c (make_binfo): Use make_tree_binfo.
3131
3132 2004-07-04 Mark Mitchell <mark@codesourcery.com>
3133
3134 * method.c (implicitly_declare_fn): Set linkage of generated
3135 functions.
3136
3137 2004-07-04 Richard Henderson <rth@redhat.com>
3138
3139 * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
3140
3141 2004-07-03 Scott Brumbaugh <scottb.lists@verizon.net>
3142
3143 PR c++/3761
3144 * name-lookup.c (push_class_level_binding): Don't pass a
3145 TREE_LIST of ambiguous names to check_template_shadow as it
3146 only handles declarations. Instead, pull the declaration
3147 out and pass that.
3148
3149 2004-07-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3150
3151 PR c++/14971
3152 * pt.c (check_explicit_specialization): Clarify error message.
3153
3154 2004-07-02 Richard Henderson <rth@redhat.com>
3155
3156 * tree.c (cp_unsave_r): Update remap_save_expr call.
3157
3158 2004-07-02 Mark Mitchell <mark@codesourcery.com>
3159
3160 PR c++/16240
3161 * mangle.c (write_template_arg): Correct mangling.
3162
3163 PR c++/16297
3164 * decl.c (grokdeclarator): Robustify.
3165
3166 2004-07-01 Richard Henderson <rth@redhat.com>
3167
3168 * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
3169 * method.c (synthesize_method): Don't clear_last_expr.
3170 * name-lookup.c (maybe_push_cleanup_level): Likewise.
3171
3172 2004-07-01 Nick Clifton <nickc@redhat.com>
3173
3174 * decl2.c (import_export_class): Invoke the
3175 import_export_class field in the gcc_target structure if it is not
3176 empty.
3177
3178 2004-06-30 Richard Henderson (rth@redhat.com>
3179
3180 * decl.c (start_preparsed_function): Don't set immediate_size_expand.
3181 * method.c (use_thunk): Likewise.
3182
3183 2004-06-30 Joseph S. Myers <jsm@polyomino.org.uk>
3184
3185 * call.c (build_over_call), typeck.c (build_function_call): Call
3186 check_function_arguments instead of check_function_format.
3187
3188 2004-06-30 Joseph S. Myers <jsm@polyomino.org.uk>
3189
3190 * call.c (build_over_call), typeck.c (build_function_call): Update
3191 calls to check_function_format.
3192
3193 2004-06-30 Richard Henderson <rth@redhat.com>
3194
3195 * call.c (build_over_call): Use __builtin_memcpy for copying
3196 CLASS_AS_BASE rather than funny casting.
3197
3198 2004-06-30 Richard Henderson <rth@redhat.com>
3199
3200 * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and
3201 TYPE_SIZE_UNIT of full_type.
3202
3203 2004-06-30 Per Bothner <per@bothner.com>
3204
3205 Conditionally compile support for --enable-mapped_location.
3206 * decl.c (pop_label): Handle (imperfectly) USE_MAPPED_LOCATION case.
3207 * decl2.c: If USE_MAPPED_LOCATION, don't do some line number
3208 adjustments - which I don't understand.
3209 * error.c (dump_decl): Rename "<interrnal>" to "<built-in>".
3210 * error.c: Use LOCATION_FILE and EXPR_LOCATION macros.
3211 (print_instantiation_partial_context): Use expand_location.
3212 * decl.c (duplicate_decl): Use new DECL_IS_BUILTIN macro.
3213 * name-lookup.c: Likewise.
3214 * lex.c (cxx_init): Likewise. Also use BUILTINS_LOCATION.
3215 * name-lookup.c: Use input_line macro.
3216 * parser.c (cp_lexer_get_preprocessor_token): Use UNKNOWN_LOCATION.
3217 (cp_parser_statement): Rename locaal variable statement_locus to
3218 statement_location and use SET_EXPR_LOCATION macro.
3219 * pt.c: Handle USE_MAPPED_LOCATION case. Use new macros.
3220 * tree.c (cp_walk_subtrees): Likewise.
3221
3222 2004-06-29 Per Bothner <per@bothner.com>
3223
3224 * tree.c (build_min_nt, build_min, build_min_non_dep):
3225 Don't set TREE_COMPLEXITY from input_line.
3226
3227 2004-06-29 Paul Brook <paul@codesourcery.com>
3228
3229 * init.c: Include target.h.
3230 (get_cookie_size): Remove and replace with target hook.
3231 Update callers.
3232 (build_new_1): Store the element size in the cookie.
3233
3234 2004-06-29 Nathan Sidwell <nathan@codesourcery.com>
3235
3236 PR c++/16260
3237 * parser.c (cp_parser_template_declaration_after_export): Disable
3238 access checks here ...
3239 (cp_parser_class_specifier): ... not here.
3240
3241 2004-06-28 Nathan Sidwell <nathan@codesourcery.com>
3242
3243 * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
3244 VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
3245 BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate
3246 TREE_CHECK macro.
3247
3248 2004-06-28 Nathan Sidwell <nathan@codesourcery.com>
3249
3250 * cp-tree.h (struct deferred_access): Move to ...
3251 * semantics.c (struct deferred_access): ... here. Adjust.
3252 (deferred_access_stack): Make a VEC(deferred_access),
3253 (deferred_access_free_list): Remove.
3254 (deferred_access_no_check): New.
3255 (push_deferring_access_checks, resume_deferring_access_checks,
3256 stop_deferring_access_checks, pop_deferring_access_checks,
3257 get_deferred_access_checks, pop_to_parent_deferring_access_checks,
3258 perform_deferred_access_checks, perform_or_defer_access_check): Adjust.
3259
3260 2004-06-28 Nathan Sidwell <nathan@codesourcery.com>
3261
3262 PR c++/16174
3263 * call.c (build_temp): Declare.
3264 (check_constructor_callable): New.
3265 (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
3266 CONSTRUCTOR_CALLABLE.
3267 (convert_like_real, initialize_reference): Use
3268 check_constructor_callable.
3269 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
3270 (LOOKUP_*): Renumber.
3271
3272 2004-06-28 Nathan Sidwell <nathan@codesourcery.com>
3273
3274 * friend.c (add_friend): Only perform access checks when context
3275 is a class.
3276 * lex.c (cxx_make_type): Only create a binfo for aggregate types.
3277 * parser.c (cp_parser_class_specifier): Disable access checks here
3278 when parsing the body of a templated class.
3279 * semantics.c (perform_or_defer_access_checks): Reorder to allow
3280 NULL binfos when not checking access.
3281
3282 2004-06-28 Nathan Sidwell <nathan@codesourcery.com>
3283
3284 Use vector API for vbase list.
3285 * cp-tree.h: Include vec.h
3286 (DEF_VEC_P (tree)): New type.
3287 (struct lang_type_class): Change vbase's member type.
3288 (binfo_for_vbase): Declare.
3289 * class.c (determine_primary_base, base_derived_from,
3290 update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
3291 warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
3292 build_vtbl_initializer): Adjust.
3293 * decl.c (xref_basetypes): Adjust, accumulate upper bound of
3294 vbases.
3295 * init.c (sort_mem_initializers, expand_member_init,
3296 push_base_cleanups): Adjust.
3297 * method.c (do_build_copy_constructor): Adjust.
3298 * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
3299 (binfo_for_vbase): New.
3300 * tree.c (copy_base_binfos): Adjust.
3301
3302 2004-06-28 Mark Mitchell <mark@codesourcery.com>
3303
3304 * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
3305
3306 2004-06-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
3307
3308 PR c++/14123
3309 * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
3310 paranthesis in case of pointers to array members.
3311 * error.c (dump_type_prefix): Likewise.
3312 (dump_type_suffix): Maybe issue a whitespace when printing
3313 ARRAY_TYPE.
3314
3315 2004-06-27 Mark Mitchell <mark@codesourcery.com>
3316
3317 PR c++/16193
3318 * parser.c (cp_parser_set_decl_spec_type): Refine test for
3319 redefinition of built-in types.
3320
3321 2004-06-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
3322
3323 * error.c (pp_template_argument_list_start): Remove.
3324 (pp_template_argument_list_end): Likewise.
3325 (pp_separate_with_comma): Use pp_cxx_separate_with.
3326 (reinit_global_formatting_buffer): Remove.
3327 (pp_non_consecutive_character): Likewise.
3328 (dump_scope): Use pp_cxx_colon_colon.
3329 (dump_template_parameter): Use pp_cxx_identifier,
3330 pp_cxx_tree_identifier and pp_cxx_whitespace.
3331 (dump_templat_bindings): Replace use of pp_string with sequence
3332 of pp_cxx_whitespace and pp_equal.
3333 (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
3334 pp_cxx_colon_colon, pp_cxx_whitespace throughout. Don't set
3335 padding here.
3336 (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
3337 (dump_type_prefix): Don't set padding. Use pp_cxx_whitespace,
3338 pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
3339 (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
3340 pp_cxx_right_bracket, pp_cxx_identifier throughout,
3341 (dump_decl): Likewise.
3342 (dump_template_decl): Likewise.
3343 (dump_function_decl): Likewise. Set padding as appropriate.
3344 (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
3345 pp_cxx_right_paren.
3346 (dump_exception_spec): Likewise.
3347 (dump_function_name): Use pp_cxx_tree_identifier and
3348 pp_cxx_identifier.
3349 (dump_template_parms): Use pp_cxx_begin_template_argument_list and
3350 pp_cxx_end_template_argument_list.
3351 (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
3352 pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
3353 pp_cxx_whitespace throughout.
3354 (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
3355 pp_cxx_right_paren.
3356 (dump_unary_op): Likewise.
3357 (reinit_cxx_pp): New function.
3358 (type_as_string); Use it.
3359 (expr_as_string): Likewise.
3360 (decl_as_string); Likewise.
3361 (context_as_string): Likewise.
3362 (lang_decl_name): Likewise.
3363 (decl_to_string): Likewise.
3364 (expr_to_string): Likewise.
3365 (parm_to_string): Likewise.
3366 (type_to_string): Likewise.
3367 (args_to_string): Likewise.
3368 (cv_to_string): Likewise.
3369
3370 2004-06-26 Mark Mitchell <mark@codesourcery.com>
3371
3372 * cp-tree.h (cp_cv_quals): New type.
3373 (cp_declarator): Use it instead of "tree" as appropriate.
3374 (grok_method_quals): Adjust prototype.
3375 (grokclassfn): Likewise.
3376 (do_friend): Likewise.
3377 * decl.c (grokfndecl): Use cp_cv_quals, not tree.
3378 (grokdeclarator): Likewise.
3379 * decl2.c (grok_method_quals): Likewise.
3380 (grokclassfn): Likewise.
3381 * friend.c (do_friend): Likewise.
3382 * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
3383 * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
3384 (make_pointer_declarator): Likewise.
3385 (make_reference_declarator): Likewise.
3386 (make_ptrmem_declarator): Likewise.
3387 (cp_parser_ptr_operator): Likewise.
3388 (cp_parser_cv_qualifier_seq_opt): Likewise.
3389 (cp_parser_cv_qualifier_opt): Remove.
3390 (cp_parser_new_declarator_opt): Adjust call to
3391 cp_parser_ptr_operator.
3392 (cp_parser_conversion_declaration_opt): Likewise.
3393 (cp_parser_declarator): Use cp_cv_quals, not tree.
3394 (cp_parser_direct_declarator): Likewise.
3395
3396 2004-06-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3397
3398 * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
3399 Rename DECL_STMT to DECL_EXPR.
3400 * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
3401 * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
3402 * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
3403
3404 2004-06-26 Jan Hubicka <jh@suse.cz>
3405
3406 PR C++/14865
3407 * decl2.c (maybe_emit_vtables): Always import_export_vtable for the
3408 reachability analysis.
3409
3410 2004-06-25 Mark Mitchell <mark@codesourcery.com>
3411
3412 * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
3413 2004-06-23 change.
3414
3415 2004-06-25 Paul Brook <paul@codesourcery.com>
3416
3417 * decl2.c (get_guard): Call targetm.cxx.guard_type.
3418 (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
3419
3420 2004-06-24 Mark Mitchell <mark@codesourcery.com>
3421
3422 * decl.c (grokdeclarator): Restore error messages about __thread.
3423 * parser.c (cp_parser_decl_specifier_seq): Likewise.
3424
3425 2004-06-24 Jason Merrill <jason@redhat.com>
3426
3427 PR c++/16115
3428 * decl.c (grokparms): Give the PARM_DECL reference type if the
3429 parameter is passed by invisible reference.
3430
3431 2004-06-24 Andreas Schwab <schwab@suse.de>
3432
3433 * cp-tree.h (enum cp_storage_class): Remove trailing comma.
3434
3435 2004-06-23 Mark Mitchell <mark@codesourcery.com>
3436
3437 * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
3438 (cp/decl.o): Likewise.
3439 (cp/decl2.o): Likewise.
3440 (cp/pt.o): Likewise.
3441 (cp/semantics.o): Likewise.
3442 * config-lang.in (gtfiles): Do not reference cp/lex.h.
3443 * class.c: Do not include lex.h.
3444 (add_implicitly_declared_members): Do not use
3445 adding_implicit_members.
3446 (check_bases_and_members): Do not talk about grok_x_components.
3447 * cp/cp-tree.h (adding_implicit_members): Remove.
3448 (cp_storage_class): New type.
3449 (cp_decl_spec): Likewise.
3450 (cp_decl_specifier_seq): Likewise.
3451 (cp_parameter_declarator): Use it for the decl_specifiers field.
3452 (check_tag_decl): Adjust prototype.
3453 (shadow_tag): Likewise.
3454 (groktypename): Likewise.
3455 (start_decl): Likewise.
3456 (start_function): Likewise.
3457 (start_method): Likewise.
3458 (grok_x_components): Remove.
3459 (grokfield): Adjust prototype.
3460 (grokbitfield): Likewise.
3461 (finish_member_class_template): Remove.
3462 * decl.c: Do not include lex.h.
3463 (adding_implicit_members): Do not define.
3464 (check_tag_decl): Do not use trees to represent decl-specifiers.
3465 (shadow_tag): Likewise.
3466 (groktypename): Likewise.
3467 (start_decl): Likewise.
3468 (grokvardecl): Likewise.
3469 (grokdeclarator): Likewise.
3470 (grokparms): Likewise.
3471 (start_function): Likewise.
3472 (start_method): Likewise.
3473 * decl.h (grokdeclarator): Adjust prototype.
3474 * decl2.c: Do not include lex.h.
3475 (grok_x_components): Remove.
3476 (grokfield): Do not use trees to represent decl-specifiers.
3477 (grokbitfield): Likewise.
3478 * lex.c: Do not include lex.h.
3479 * lex.h: Remove.
3480 * parser.c: Include target.h.
3481 (clear_decl_specs): New function.
3482 (cp_parser_translation_unit): Do not use trees to represent
3483 decl-specifiers.
3484 (cp_parser_postfix_expression): Likewise.
3485 (cp_parser_new_type_id): Likewise.
3486 (cp_parser_condition): Likewise.
3487 (cp_parser_simple_declaration): Likewise.
3488 (cp_parser_decl_specifier_seq): Likewise.
3489 (cp_parser_function_specifier_opt): Likewise.
3490 (cp_parser_conversion_type_id): Likewise.
3491 (cp_parser_template_parameter): Likewise.
3492 (cp_parser_explicit_instantiation): Likewise.
3493 (cp_parser_type_specifier): Likewise.
3494 (cp_parser_simple_type_specifier): Likewise.
3495 (cp_parser_init_declarator): Likewise.
3496 (cp_parser_type_id): Likewise.
3497 (cp_parser_type_specifier_seq): Likewise.
3498 (cp_parser_parameter_declaration): Likewise.
3499 (cp_parser_member_declaration): Likewise.
3500 (cp_parser_exception_declaration): Likewise.
3501 (cp_parser_function_definition_from_specifiers_and_declarator):
3502 Likewise.
3503 (cp_parser_single_declaration): Likewise.
3504 (cp_parser_save_member_function_body): Likewise.
3505 (cp_parser_friend_p): Likewise.
3506 (cp_parser_set_storage_class): New function.
3507 (cp_parser_set_decl_spec_type): Likewise.
3508 * pt.c: Do not include lex.h.
3509 * semantics.c: Likewise.
3510 (finish_member_class_template): Remove.
3511
3512 2004-06-23 Roger Sayle <roger@eyesopen.com>
3513
3514 * call.c (build_cxx_call): Don't call expand_tree_builtin. No
3515 longer take both "args" and "convert_args" as arguments.
3516 (build_op_delete_call): Update call to build_cxx_call.
3517 (build_over_call): Likewise, update call to build_cxx_call.
3518 * cp-tree.h (build_cxx_call): Update funtion prototype.
3519 * typeck.c (build_function_call): Don't call expand_tree_builtin.
3520 * rtti.c (throw_bad_cast): Update call to build_cxx_call.
3521 (throw_bad_typeid): Likewise.
3522 (build_dynamic_cast_1): Likewise.
3523
3524 2004-06-22 Richard Henderson <rth@redhat.com>
3525
3526 * class.c (build_vfn_ref): Take a pointer not object. Build
3527 an OBJ_TYPE_REF.
3528 (cp_fold_obj_type_ref): New.
3529 * call.c (build_over_call): Update build_vfn_ref call.
3530 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
3531 * cp-tree.h (cp_fold_obj_type_ref): Declare.
3532
3533 2004-06-21 Jason Merrill <jason@redhat.com>
3534
3535 PR c++/16112
3536 * cp-gimplify.c (cp_gimplify_init_expr): Look through
3537 CLEANUP_POINT_EXPR.
3538
3539 2004-06-21 Mark Mitchell <mark@codesourcery.com>
3540
3541 * cp-tree.def (NEW_EXPR): Add a fourth slot.
3542 * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
3543 (TREE_PARMLIST): Likewise.
3544 (CALL_DECLARATOR_PARMS): Likewise.
3545 (CALL_DECLARATOR_QUALS): Likewise.
3546 (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
3547 (cp_declarator_kind): New type.
3548 (cp_parameter_declarator): Likewise.
3549 (cp_declarator): Likewise.
3550 (cp_error_declarator): Likewise.
3551 (no_parameters): Likewise.
3552 (groktypename): Change prototype.
3553 (start_decl): Likewise.
3554 (start_handler_parms): Likewise.
3555 (get_scope_of_declarator): Likewise.
3556 (start_function): Likewise.
3557 (start_preparsed_function): New function.
3558 (start_function): Change prototype.
3559 (start_method): Likewise.
3560 (grokfield): Likewise.
3561 (grokbitfield): Likewise.
3562 (build_new): Likewise.
3563 (make_pointer_declarator): Remove.
3564 (make_reference_declarator): Likewise.
3565 (make_call_declarator): Likewise.
3566 (set_quals_and_spec): Likewise.
3567 (process_template_parm): Change prototype.
3568 (begin_function_definition): Remove.
3569 (finish_parmlist): Remove.
3570 * decl.c (groktypename): Do not use trees to represent
3571 declarators.
3572 (start_decl): Likewise.
3573 (start_handler_parms): Remove.
3574 (get_scope_of_declarator): Reimplement.
3575 (grokdeclarator): Do not use trees to represent declarators.
3576 (grokparms): Likewise.
3577 (start_function): Likewise.
3578 (start_method): Likewise.
3579 (build_void_list_mode): Do not use TREE_PARMLIST.
3580 * decl.h (grokdeclarator): Change prototype.
3581 * decl2.c (grok_method_quals): Robustify.
3582 (grok_x_components): Do not use trees to represent declarators.
3583 (grokfield): Likewise.
3584 (grokbitfield): Likewise.
3585 (start_objects): Build FUNCTION_DECLs, not declarators.
3586 (start_static_storage_duration_function): Likewise.
3587 * init.c (build_new): Simplify.
3588 * lex.c (make_pointer_declarator): Remove.
3589 (make_reference_declarator): Likewise.
3590 (make_call_declarator): Likewise.
3591 (set_quals_and_spec): Likewise.
3592 * method.c (use_thunk): Use start_preparsed_function.
3593 (synthesize_method): Likewise.
3594 (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
3595 * optimize.c (maybe_clone_body): Use start_preparsed_function.
3596 * parser.c (cp_error_declarator): New variable.
3597 (declarator_obstack): Likewise.
3598 (alloc_declarator): New function.
3599 (make_declarator): Likewise.
3600 (make_id_declarator): Likewise.
3601 (make_pointer_declarator): Likewise.
3602 (make_reference_declarator): Likewise.
3603 (make_ptrmem_declarator): Likewise.
3604 (make_call_declarator): Likewise.
3605 (make_array_declarator): Likewise.
3606 (no_parameters): New variable.
3607 (make_parameter_declarator): Likewise.
3608 (cp_parser_check_for_definition_in_return_type): Do not use trees
3609 to represent declarators.
3610 (cp_parser_translation_unit): Likewise.
3611 (cp_parser_new_expression): Likewise.
3612 (cp_parser_new_type_id): Likewise.
3613 (cp_parser_new_declarator_opt): Likewise.
3614 (cp_parser_direct_new_declarator): Likewise.
3615 (cp_parser_condition): Likewise.
3616 (cp_parser_declaration_statement): Likewise.
3617 (cp_parser_declaration): Likewise.
3618 (cp_parser_conversion_type_id): Likewise.
3619 (cp_parser_conversion_declarator_opt): Likewise.
3620 (cp_parser_template_parameter_list): Likewise.
3621 (cp_parser_template_parameter): Likewise.
3622 (cp_parser_explicit_instantiation): Likewise.
3623 (cp_parser_init_declarator): Likewise.
3624 (cp_parser_declarator): Likewise.
3625 (cp_parser_direct_declarator): Likewise.
3626 (cp_parser_type_id): Likewise.
3627 (cp_parser_parameter_declaration_clause): Likewise.
3628 (cp_parser_parameter_declaration_list): Likewise.
3629 (cp_parser_parameter_declaration): Likewise.
3630 (cp_parser_member_declaration): Likewise.
3631 (cp_parser_exception_declaration): Likewise.
3632 (cp_parser_check_declarator_template_parameters): Likewise.
3633 (cp_parser_function_definition_from_specifiers_and_declarator):
3634 Likewise.
3635 (cp_parser_save_member_function_body): Likewise.
3636 * pt.c (process_template_parm): Add is_non_type parameter.
3637 (convert_template_argument): Adjust call to groktypename.
3638 (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
3639 (tsubst): Do not expect declarators.
3640 (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
3641 argument.
3642 (instantiate_decl): Use start_preparsed_function.
3643 * semantics.c (begin_function_definition): Remove.
3644 (finish_parmlist): Remove.
3645 * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
3646 declarators.
3647
3648 2004-06-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3649
3650 * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
3651 (build_new_method_call): Likewise.
3652 * decl.c (local_variable_p_walkfn): Don't walk into types.
3653 * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
3654 (build_anon_union_vars): Add new operand for COMPONENT_REF.
3655 * init.c (buld_new): Add new operand for ARRAY_REF.
3656 * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
3657 (do_build_assign_ref): Likewise.
3658 * parser.c (cp_parser_direct_new_declarator): Add new operands
3659 for ARRAY_REF.
3660 (cp_parser_direct_declarator): Likewise.
3661 * pt.c (tsubst): Likewise.
3662 (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
3663 for COMPONENT_REF.
3664 * semantics.c (finish_non_static_data_member): Add new operand
3665 for COMPONENT_REF.
3666 * typeck.c (build_class_member_access_expr): Likewise.
3667 (build_class_member_access_expr, finish_class_member_access_expr):
3668 Likewise.
3669 (build_ptrmemfunc_access_expr): Likewise.
3670 (build_array_ref): Add new operands for ARRAY_REF.
3671 * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
3672 * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
3673
3674 2004-06-21 Richard Henderson <rth@redhat.com>
3675
3676 * dump.c (cp_dump_tree): Don't use dump_next_stmt.
3677 * parser.c (cp_parser_jump_statement): Update commentary.
3678 * pt.c (tsubst_expr): Use RETURN_EXPR.
3679 * semantics.c (finish_return_stmt): Likewise.
3680 (finalize_nrv_r): Likewise.
3681 * typeck.c, typeck2.c: Update file start commentary.
3682
3683 2004-06-21 Richard Henderson <rth@redhat.com>
3684
3685 * semantics.c (finish_expr_stmt): Call verify_sequence_points.
3686
3687 2004-06-20 Richard Henderson <rth@redhat.com>
3688
3689 * cp-tree.h (add_decl_stmt): Declare.
3690 * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
3691 * semantics.c (maybe_cleanup_point_expr): New.
3692 (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
3693 finish_for_expr, finish_switch_cond): Use it.
3694 (finalize_nrv_r): Don't build an EXPR_STMT. Don't frob TREE_CHAIN.
3695
3696 2004-06-20 Richard Henderson <rth@redhat.com>
3697
3698 * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
3699 * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
3700 (cp_gimplify_expr): Call it.
3701 (gimplify_cleanup_stmt): Move from c-gimplify.c.
3702 (cp_genericize): New.
3703 * decl.c (finish_function): Call it.
3704 * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
3705 (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
3706 (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
3707 (cp_genericize): Declare.
3708 * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
3709 * dump.c (cp_dump_tree): Likewise.
3710 * semantics.c (push_cleanup): Move from c-semantics.c.
3711
3712 2004-06-20 Zack Weinberg <zack@codesourcery.com>
3713
3714 * cp-lang.c (has_c_linkage): Implement.
3715
3716 * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
3717 * decl.c (duplicate_decls): Use COPY_DECL_RTL.
3718 (builtin_function_1): Don't call make_decl_rtl.
3719 (build_cp_library_fn): Don't call set_mangled_name_for_decl.
3720 (grokvardecl): Don't call mangle_decl.
3721 * except.c (nothrow_libfn_p): Look at DECL_NAME, not
3722 DECL_ASSEMBLER_NAME.
3723 * method.c (set_mangled_name_for_decl): Delete.
3724 * name-lookup.c (pushdecl): When a local extern shadows a
3725 file-scope declaration of the same object, give both DECLs the
3726 same DECL_UID.
3727 * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
3728 on DECL_ASSEMBLER_NAME.
3729
3730 2004-06-19 Richard Henderson <rth@redhat.com>
3731
3732 * cp-gimplify.c: Remove unnecessary prototypes.
3733 (cp_gimplify_stmt): Merge into ...
3734 (cp_gimplify_expr): ... here. Move to end of file. Handle
3735 stmts_are_full_exprs_p frobbing.
3736 * cp-tree.h (cp_gimplify_stmt): Remove.
3737 * pt.c (tsubst_expr): Merge prep_stmt and unify.
3738 * tree.c (init_tree): Don't set lang_gimplify_stmt.
3739
3740 2004-06-18 Richard Henderson <rth@redhat.com>
3741
3742 PR c++/16034
3743 * semantics.c (begin_cond): New.
3744 (finish_cond): Rewrite to handle template DECL_STMTs specially.
3745 Assume that non-template decls go land before the conditional.
3746 (simplify_loop_decl_cond): Likewise.
3747 (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
3748 finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
3749 begin_switch_stmt, finish_switch_cond): Update to match.
3750
3751 2004-06-17 Jason Merrill <jason@redhat.com>
3752
3753 PR c++/16015
3754 * semantics.c (simplify_aggr_init_expr): Don't return the slot.
3755 (finish_stmt_expr_expr): Update type after conversions.
3756 (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
3757 Handle void initializer.
3758 * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
3759
3760 2004-06-17 Geoffrey Keating <geoffk@apple.com>
3761
3762 * class.c (build_clone): Don't call defer_fn, let mark_used do it.
3763 * cp-tree.h (defer_fn): Delete.
3764 * decl2.c (defer_fn): Delete.
3765 (finish_file): Simplify deferred_fns loops; check that
3766 only used inline functions get into deferred_fns.
3767 (mark_used): Inline previous contents of defer_fn.
3768
3769 2004-06-16 Richard Henderson <rth@redhat.com>
3770
3771 * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
3772 (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
3773 * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
3774 of CTOR_INITIALIZER ...
3775 (pp_cxx_statement): ... here.
3776 * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
3777 (finish_function): Use alloc_stmt_list to zap entire function.
3778 * parser.c (cp_parser_compound_statement): Update commentary.
3779 * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
3780 * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
3781 (finish_stmt_expr): Don't look through COMPOUND_STMT.
3782
3783 2004-06-16 Geoffrey Keating <geoffk@apple.com>
3784
3785 * pt.c (mark_decl_instantiated): Don't call defer_fn.
3786
3787 2004-06-16 Richard Henderson <rth@redhat.com>
3788
3789 * parser.c (cp_parser_labeled_statement): Update commentary.
3790 * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
3791 * tree.c (mark_local_for_remap_r): Likewise.
3792
3793 2004-06-16 Richard Henderson <rth@redhat.com>
3794
3795 * parser.c (cp_parser_asm_definition): Update commentary.
3796 * pt.c (tsubst_expr): Use ASM_EXPR.
3797 * semantics.c (finish_asm_stmt): Likewise.
3798
3799 2004-06-16 Richard Henderson <rth@redhat.com>
3800
3801 * decl.c (finish_destructor_body): Use LABEL_EXPR.
3802 * parser.c (cp_parser_statement): Update commentary.
3803 * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
3804 * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
3805 * tree.c (mark_local_for_remap_r): Likewise.
3806
3807 2004-06-16 Richard Henderson <rth@redhat.com>
3808
3809 PR c++/16012
3810 * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
3811 statement in FOR_INIT_STMT for templates.
3812
3813 2004-06-15 Richard Henderson <rth@redhat.com>
3814
3815 * call.c (initialize_reference): Don't build CLEANUP_STMT here.
3816 * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
3817 (genericize_try_block): Use gimplify_stmt.
3818 (genericize_catch_block, genericize_eh_spec_block): Likewise.
3819 (cp_gimplify_init_expr): Remove STMT_EXPR special case.
3820 (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
3821 * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
3822 (cp_tree_chain_matters_p): Remove.
3823 * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
3824 (COMPOUND_STMT_BODY_BLOCK): New.
3825 (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
3826 (EXPR_STMT_STMT_EXPR_RESULT): New.
3827 (building_stmt_tree): Check cur_stmt_list.
3828 (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
3829 (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
3830 * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
3831 (cp_finish_decl): Use push_cleanup.
3832 (start_function, finish_function): Use statement lists.
3833 (finish_stmt): Do nothing.
3834 * except.c (begin_eh_spec_block): Use statement lists.
3835 (check_handlers_1, check_handlers): Likewise.
3836 * init.c (construct_virtual_base): Don't add extra compound stmts.
3837 (build_vec_init): Likewise.
3838 * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
3839 * name-lookup.h (struct cp_binding_level): Add statement_list.
3840 * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
3841 (cp_parser_labeled_statement, cp_parser_expression_statement,
3842 cp_parser_statement_seq_opt): Likewise.
3843 (cp_parser_compound_statement): Likewise. Take bool for try block.
3844 (cp_parser_selection_statement): Tidy if processing.
3845 (cp_parser_already_scoped_statement): Rewrite to do what it says.
3846 * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
3847 (tsubst_expr): Rewrite STMT_EXPR processing. Handle STATEMENT_LIST.
3848 Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
3849 * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
3850 (finish_cond): New, rewritten from FINISH_COND.
3851 (simplify_loop_decl_cond): New.
3852 (finish_expr_stmt): Avoid nested EXPR_STMTs.
3853 (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
3854 begin_else_clause, finish_else_clause, finish_if_stmt,
3855 begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
3856 begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
3857 finish_for_cond, finish_for_stmt, begin_switch_stmt,
3858 finish_switch_cond, finish_switch_stmt, begin_try_block,
3859 finish_try_block, finish_cleanup_try_block, finish_function_try_block,
3860 finish_handler_sequence, finish_function_handler_sequence,
3861 begin_handler, finish_handler_parms, finish_handler,
3862 begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
3863 using statement lists.
3864 (begin_compound_stmt): Replace has_no_scope argument with flags.
3865 Update all callers. Use statement lists.
3866 (finish_compound_stmt): Likewise.
3867 (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
3868 (current_scope_stmt_stack): Remove.
3869 (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
3870 * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
3871 Rewrite with statement lists.
3872
3873 2004-06-15 Alexandre Oliva <aoliva@redhat.com>
3874
3875 * parser.c: Change all assignments of c_lex_string_translate
3876 to true and false to 1 and 0.
3877 (cp_lexer_read_token): Convert type of the translated string.
3878 (cp_parser_skip_to_closing_parentheses): Preserve original
3879 value of c_lex_string_translate, and set it to -1 while
3880 running.
3881 (cp_parser_cache_group): Likewise.
3882 (cp_parser_cache_group_1): Renamed.
3883 (cp_parser_asm_operand_list): Remove redundant setting of
3884 c_lex_string_translate.
3885 (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
3886 Handle chained strings.
3887
3888 2004-06-12 Andrew Pinski <apinski@apple.com>
3889
3890 PR c++/14639
3891 Revert:
3892 2004-06-02 Andrew Pinski <pinskia@physics.uc.edu>
3893
3894 * cp-tree.h: Fix typo.
3895
3896 * cp-tree.h: Include cgraph.h
3897 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
3898 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
3899
3900 2004-06-12 Jason Merrill <jason@redhat.com>
3901
3902 PR tree-optimization/14107
3903 * decl.c (finish_function): Warn about no return in all functions.
3904
3905 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
3906
3907 * cp-tree.h (struct language_function): Remove cannot_inline.
3908 * decl.c (save_function_data): cannot_inline is no more.
3909 (cxx_push_function_context): Likewise.
3910 * decl2.c (start_objects, start_static_storage_duration_function):
3911 Reset DECL_INLINE, set DECL_UNINLINABLE.
3912
3913 2004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3914
3915 PR c++/15967
3916 * search.c (lookup_field): Propagate the ambiguity list.
3917 (lookup_fnfields): Likewise.
3918
3919 2004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3920
3921 PR c++/15947
3922 * parser.c (cp_parser_template_name): Ctors/dtors never need a
3923 template keyword to disambiguate.
3924
3925 2004-06-14 Mark Mitchell <mark@codesourcery.com>
3926
3927 PR c++/15096
3928 * decl.c (grokdeclarator): Ignore pointer-to-members when
3929 computing template depth.
3930
3931 PR c++/14930
3932 * name-lookup.c (pushtag): Do not try to put class declarations in
3933 explicit specialization scopes.
3934
3935 2004-06-11 Andrew Pinski <pinskia@physics.uc.edu>
3936
3937 * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
3938
3939 2004-06-11 Mark Mitchell <mark@codesourcery.com>
3940
3941 PR c++/15862
3942 * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
3943 bindings for undeclared built-ins.
3944
3945 2004-06-11 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3946
3947 * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
3948 appear at the correct location.
3949
3950 2004-06-10 Jason Merrill <jason@redhat.com>
3951
3952 PR c++/15875
3953 Revert:
3954 2004-06-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
3955 * init.c (build_offset_ref): Build SCOPE_REF with non-null
3956 TREE_TYPE for non-dependent names.
3957 * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
3958 unknown_type_node as its TREE_TYPE.
3959 * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
3960 * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
3961 (dump_expr) <SCOPE_REF case>: Likewise.
3962
3963 2004-06-10 Mark Mitchell <mark@codesourcery.com>
3964
3965 PR c++/15227
3966 * parser.c (cp_parser_direct_declarator): Robustify.
3967
3968 PR c++/15877
3969 * pt.c (tsubst_copy): Use decl_constant_value on enumeration
3970 constants in non-dependent contexts.
3971
3972 PR c++/14211
3973 PR c++/15076
3974 * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
3975 necessary.
3976
3977 2004-06-10 Jakub Jelinek <jakub@redhat.com>
3978
3979 PR c++/14791
3980 * decl.c (duplicate_decls): Handle fileptr_type_node arguments
3981 specially.
3982
3983 2004-06-09 Mark Mitchell <mark@codesourcery.com>
3984
3985 Revert:
3986 PR c++/15815
3987 2004-06-07 Mark Mitchell <mark@codesourcery.com>
3988 * lex.c (handle_pragma_interface): Deprecate.
3989 (handle_pragma_implementation): Likewise.
3990
3991 2004-06-09 Andrew Pinski <pinskia@physics.uc.edu>
3992
3993 * g++spec.c (lang_specific_driver): Remove check for -lm
3994 and -lmath when check it see if it was the math library.
3995
3996 2004-06-08 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3997
3998 PR c++/7841
3999 * parser.c (cp_parser_direct_declarator): Reject constructor named
4000 as qualified template-id.
4001
4002 2004-06-07 Mark Mitchell <mark@codesourcery.com>
4003
4004 PR c++/15815
4005 * lex.c (handle_pragma_interface): Deprecate.
4006 (handle_pragma_implementation): Likewise.
4007
4008 2004-06-07 Mark Mitchell <mark@codesourcery.com>
4009
4010 PR c++/15766
4011 * parser.c (cp_parser_iteration_statement): Fix typo in error
4012 message.
4013
4014 PR c++/14777
4015 * pt.c (tsubst_default_argument): Do not defer access checks
4016 while substituting into the default argument.
4017
4018 PR c++/15554
4019 * pt.c (tsubst_copy): Do not try to substitute for an enumeration
4020 constant in a non-dependent context.
4021
4022 PR c++/15057
4023 * except.c (build_throw): Ensure that temp_expr has been
4024 initialized.
4025
4026 2004-06-06 Roger Sayle <roger@eyesopen.com>
4027
4028 * cp/cp-tree.h (lvalue_or_else): Add function prototype.
4029
4030 2004-06-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4031
4032 PR c++/15503
4033 * parser.c (cp_parser_mem_initializer_id): Gracefully reject
4034 'typename', and accept 'template'.
4035
4036 2004-06-03 Andrew Pinski <pinskia@physics.uc.edu>
4037 Jan Hubicka <jh@suse.cz>
4038
4039 PR c++/14639
4040 * method.c (use_think): Do not mark thunk as referenced.
4041
4042 2004-06-03 Matt Austern <austern@apple.com>
4043
4044 PR c++/15428
4045 * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
4046 is nonzero, and if we see a noninline definition of a key method,
4047 make the vtables nonweak.
4048
4049 2004-06-02 Matt Austern <austern@apple.com>
4050
4051 * cp-tree.h (instantiate_decl): new boolean parameter,
4052 undefined_ok. Current behavior is equivalent to its being 0.
4053 * decl2.c (mark_used): Add new argument when calling instantiate_decl
4054 * pt.c (mark_decl_instantiated): Unconditionally make
4055 instantiations explicit unconditionally
4056 (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
4057 since mark_decl_instantiated now does it.
4058 (instantiate_class_member): New. Instantiate a member of an
4059 explicitly instantiated class template.
4060 (do_type_instantiation): Explicitly instantiate members of an
4061 explicitly instantiated class template.
4062 (instantiate_decl): if undefined_ok is nonzero, and if we're
4063 trying to explicitly instantiated a template with no definition,
4064 change it to an implicit instantiation.
4065 (instantiate_pending_templates): Add new argument to instantiate_decl.
4066 * tree.c (cp_cannot_inline_tree_fn): Likewise.
4067
4068 2004-06-02 Andrew Pinski <pinskia@physics.uc.edu>
4069
4070 * cp-tree.h: Fix typo.
4071
4072 * cp-tree.h: Include cgraph.h
4073 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
4074 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
4075
4076 2004-06-01 Jason Merrill <jason@redhat.com>
4077
4078 PR c++/15142
4079 * call.c (call_builtin_trap): Remove type parm.
4080 (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
4081 (build_x_va_arg): Dereference a null pointer for a non-POD argument.
4082
4083 2004-06-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
4084
4085 PR c++/13092
4086 * init.c (build_offset_ref): Build SCOPE_REF with non-null
4087 TREE_TYPE for non-dependent names.
4088 * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
4089 unknown_type_node as its TREE_TYPE.
4090 * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
4091 * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
4092 (dump_expr) <SCOPE_REF case>: Likewise.
4093
4094 2004-06-01 Richard Henderson <rth@redhat.com>
4095 Andrew Pinski <pinskia@physics.uc.edu>
4096
4097 * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
4098 * parser.c (struct cp_parser): Remove in_offsetof.
4099 (cp_parser_new): Don't set it.
4100 (cp_parser_unary_expression): Don't check it.
4101 (cp_parser_postfix_open_square_expression): Split out from ...
4102 (cp_parser_postfix_expression): ... here.
4103 (cp_parser_postfix_dot_deref_expression): Likewise.
4104 (cp_parser_builtin_offsetof): New.
4105 (cp_parser_primary_expression): Use it.
4106
4107 2004-06-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4108
4109 PR c++/14932
4110 * parser.c (cp_parser_postfix_expression): Allow subscript
4111 operator in offsetof.
4112
4113 2004-05-31 Mark Mitchell <mark@codesourcery.com>
4114
4115 PR c++/15701
4116 * friend.c (add_friend): Do not try to perform access checks for
4117 functions from dependent classes.
4118
4119 2004-05-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
4120
4121 * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
4122 (pp_cxx_begin_template_argument_list): Turn into a function.
4123 (pp_cxx_end_template_argument_list): Likewise.
4124 (pp_cxx_separate_with): Define.
4125 (pp_cxx_unqualified_id): Tidy.
4126 (pp_cxx_primary_expression): Likewise.
4127 (pp_cxx_postfix_expression): Likewise.
4128 (pp_cxx_expression): Likewise.
4129 (pp_cxx_simple_type_specifier): Likewise.
4130 (pp_cxx_type_specifier_seq): Likewise.
4131 (pp_cxx_parameter_declaration_clause): Likewise.
4132 (pp_cxx_exception_specification): Likewise.
4133 (pp_cxx_direct_declarator): Likewise.
4134 (pp_cxx_type_id): Likewise.
4135 * cxx-pretty-print.h (pp_cxx_whitespace): Export from
4136 cxx-pretty-print.c.
4137 (pp_cxx_left_paren): Likewise.
4138 (pp_cxx_right_paren): Likewise.
4139 (pp_cxx_left_brace): Likewise.
4140 (pp_cxx_right_brace): Likewise.
4141 (pp_cxx_left_bracket): Likewise.
4142 (pp_cxx_right_bracket): Likewise.
4143 (pp_cxx_dot): Likewise.
4144 (pp_cxx_identifier): Likewise.
4145 (pp_cxx_tree_identifier): Likewise.
4146 (pp_cxx_ampersand): New macro.
4147 (pp_cxx_star): Likewise.
4148 (pp_cxx_arrow): Likewise.
4149 (pp_cxx_semicolon): Likewise.
4150 (pp_cxx_complement): Likewise.
4151 (pp_cxx_begin_template_argument_list): Declaree.
4152 (pp_cxx_end_template_argument_list): Likewise.
4153 (pp_cxx_colon_colon): likewise.
4154
4155 2004-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
4156
4157 * parser.c (cp_parser_simple_type_specifier): Explicitly test
4158 against NULL_TREE.
4159
4160 2004-05-31 Kazu Hirata <kazu@cs.umass.edu>
4161
4162 * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
4163 typeck.c: Fix comment formatting.
4164
4165 2004-05-30 Andrew Pinski <pinskia@physics.uc.edu>
4166
4167 * cp-lang.c (cp_expand_decl): Remove.
4168 (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
4169
4170 2004-05-30 Andreas Jaeger <aj@suse.de>
4171
4172 * lang-specs.h: Add missing initializers for .ii.
4173
4174 2004-05-28 Aldy Hernandez <aldyh@redhat.com>
4175
4176 * decl.c (cp_make_fname_decl): Free return value from
4177 fname_as_string.
4178
4179 2004-05-28 Mark Mitchell <mark@codesourcery.com>
4180
4181 PR c++/15083
4182 * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
4183 even in a templat.e
4184 * init.c (build_new): Likewise.
4185
4186 PR c++/15640
4187 * name-lookup.c (arg_assoc): Robustify.
4188
4189 PR c++/15471
4190 * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
4191 when determining the scope to use for a pointer to member.
4192 (lookup_anon_field): Give it external linkage.
4193 * cp-tree.h (lookup_anon_field): Declare it.
4194 * expr.c (cplus_expand_constant): Use it.
4195
4196 2004-05-28 Mark Mitchell <mark@codesourcery.com>
4197
4198 PR c++/14668
4199 * parser.c (cp_parser_simple_type_specifier): Call
4200 maybe_note_name_used_in_class.
4201
4202 2004-05-28 Tom Marshall <tmarshall@real.com>
4203
4204 PR c++/15214
4205 * class.c (finish_struct_1): Warn only if the dtor is non-private or
4206 the class has friends.
4207
4208 2004-05-27 Adam Nemet <anemet@lnxw.com>
4209
4210 PR c++/12883
4211 * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
4212 TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
4213
4214 2004-05-24 Geoffrey Keating <geoffk@apple.com>
4215
4216 * method.c (implicitly_declare_fn): Don't call defer_fn; abort
4217 if it might be needed.
4218 * pt.c (mark_decl_instantiated): Only call defer_fn if
4219 the function actually needs processing in finish_file.
4220 * decl2.c (finish_file): Add check that elements in
4221 deferred_fns_used are really needed there. Remove unnecessary
4222 test of DECL_SAVED_TREE.
4223
4224 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
4225
4226 * Make-lang.in: No need to specify $(LIBCPP).
4227
4228 2004-05-23 Mark Mitchell <mark@codesourcery.com>
4229
4230 PR c++/15044
4231 * parser.c (cp_parser_class_head): Robustify.
4232
4233 PR c++/15317
4234 * parser.c (cp_parser_decl_specifier_seq): Correct error in
4235 comment.
4236 (cp_parser_constructor_declarator_p): Treat attributes
4237 as decl-specifiers.
4238
4239 PR c++/15329
4240 * typeck.c (build_unary_op): Do not attempt to resolve casts to
4241 base classes in templates.
4242
4243 2004-05-23 Mark Mitchell <mark@codesourcery.com>
4244
4245 PR c++/15165
4246 * pt.c (instantiate_template): Robustify.
4247
4248 2004-05-23 Mark Mitchell <mark@codesourcery.com>
4249
4250 PR c++/15025
4251 * decl.c (xref_tag): Issue errors about redeclaring template
4252 classes as non-template classes.
4253
4254 2004-05-23 Mark Mitchell <mark@codesourcery.com>
4255
4256 PR c++/14821
4257 * name-lookup.c (supplement_binding): Allow redefinitions of
4258 namespace aliases.
4259
4260 PR c++/14883
4261 * parser.c (cp_parser_template_argument): Robustify.
4262
4263 2004-05-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
4264
4265 * class.c (alter_access): Use %E format specifier to print an
4266 identifier node. Avoid looking at the IDENTIFIER_POINTER.
4267 (push_lang_context): Likewise.
4268 * decl.c (lookup_label): Likewise.
4269 (grokdeclarator): Likewise.
4270 * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
4271 * pt.c (do_type_instantiation): Likewise.
4272 * tree.c (handle_java_interface_attribute): Likewise.
4273 (handle_com_interface_attribute): Likewise.
4274 (handle_init_priority_attribute): Likewise.
4275
4276 2004-05-22 Mark Mitchell <mark@codesourcery.com>
4277
4278 PR c++/15285
4279 PR c++/15299
4280 * pt.c (build_non_dependent_expr): Expand the set of tree nodes
4281 recognized as overloaded functions.
4282
4283 2004-05-22 Mark Mitchell <mark@codesourcery.com>
4284
4285 PR c++/15507
4286 * class.c (layout_nonempty_base_or_field): Do not try to avoid
4287 layout conflicts for unions.
4288
4289 PR c++/15542
4290 * typeck.c (build_x_unary_op): Instantiate template class
4291 specializations before looking for "operator &".
4292
4293 PR c++/15427
4294 * typeck.c (complete_type): Layout non-dependent array types, even
4295 in templates.
4296
4297 PR c++/15287
4298 * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
4299 template.
4300
4301 2004-05-22 Roger Sayle <roger@eyesopen.com>
4302
4303 * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
4304 returning when TREE_TYPE is error_mark_node.
4305 * typeck.c (require_complete_type): Return error_mark_node if
4306 value's type is an error_mark_node.
4307
4308 2004-05-20 Andrew Pinski <pinskia@physics.uc.edu>
4309
4310 * optimize.c (calls_setjmp_r): Remove.
4311 (calls_setjmp_p): Remove.
4312 * cp-tree.c (calls_setjmp_p): Remove.
4313 * decl.c (finish_function): Do not call calls_setjmp_p.
4314
4315 2004-05-18 Zack Weinberg <zack@codesourcery.com>
4316
4317 * decl.c (cp_finish_decl): Use mark_decl_referenced.
4318 * decl2.c (maybe_make_one_only): Likewise.
4319 * method.c (use_thunk): Likewise.
4320
4321 2004-05-18 Jason Merrill <jason@redhat.com>
4322
4323 * class.c (build_base_path): Tidy a bit.
4324
4325 2004-05-14 Geoffrey Keating <geoffk@apple.com>
4326
4327 * name-lookup.c (struct scope_binding): New.
4328 (EMPTY_SCOPE_BINDING): New.
4329 (lookup_using_namespace): Take a scope_binding instead of a
4330 cxx_binding.
4331 (qualified_lookup_using_namespace): Likewise.
4332 (cxx_binding_clear): Delete.
4333 (do_nonmember_using_decl): Use a scope_binding instead of a
4334 cxx_binding.
4335 (lookup_tag): Don't call select_decl.
4336 (ambiguous_decl): Don't return anything (and change callers to match).
4337 Take a scope_binding as the second parameter.
4338 (lookup_namespace_name): Use a scope_binding instead of a
4339 cxx_binding.
4340 (unqualified_namespace_lookup): Likewise.
4341 (lookup_qualified_name): Likewise.
4342 (select_decl): Take a scope_binding instead of a cxx_binding.
4343 Use macros rather than hand-coding tests for type-ness.
4344
4345 2004-05-13 Diego Novillo <dnovillo@redhat.com>
4346
4347 * cp-gimplify.c: Rename from cp-simplify.c.
4348 * Make-lang.in, optimize.c: Update.
4349
4350 2004-05-13 Diego Novillo <dnovillo@redhat.com>
4351
4352 Merge from tree-ssa-20020619-branch. See
4353 ChangeLog.tree-ssa for details.
4354
4355 * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
4356 cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
4357 expr.c, init.c, name-lookup.h, optimize.c, parser.c,
4358 pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
4359 Merged.
4360 * cp-mudflap.c: New file.
4361 * cp-simplify.c:: New file.
4362
4363 2004-05-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4364
4365 PR c++/14389
4366 * decl2.c (check_classfn): For member templates, compare also the
4367 template parameters to match the declaration.
4368 * cp-tree.h: Adjust declaration of check_classfn.
4369 * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
4370 * friend.c (do_friend): Likewise.
4371 * pt.c (tsubst_friend_function): Likewise.
4372
4373 2004-05-01 Zack Weinberg <zack@codesourcery.com>
4374
4375 * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
4376 Instead, dig into the representation type to find the array bound.
4377
4378 2004-04-30 Jason Merrill <jason@redhat.com>
4379
4380 Refer to base members using COMPONENT_REFs where possible.
4381 * class.c (build_simple_base_path): New fn.
4382 (build_base_path): Use it for non-virtual base references.
4383 (layout_class_type): Change base fields to their real type
4384 after layout is done.
4385 * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
4386 * cp-lang.c (cxx_get_alias_set): Use it.
4387
4388 2004-04-30 Kazu Hirata <kazu@cs.umass.edu>
4389
4390 * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
4391 comment typos.
4392
4393 2004-04-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4394
4395 PR c++/15064
4396 * parser.c (cp_parser_postfix_expression): typeid operator cannot be
4397 used in integral constant expressions.
4398
4399 2004-04-22 Mark Mitchell <mark@codesourcery.com>
4400
4401 * init.c (build_aggr_init): Fix accidental use of C99 construct in
4402 previous change.
4403
4404 * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
4405 braced initializer.
4406 * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
4407 * decl.c (reshape_init): Use it.
4408 * init.c (perform_member_init): Remove redundant condition.
4409 (build_aggr_init): Adjust to handle brace-enclosed initializers
4410 correctly.
4411 (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
4412
4413 * parser.c (cp_parser_initializer_clause): Do not set
4414 TREE_HAS_CONSTRUCTOR on the initializer.
4415 * rtti.c (tinfo_base_init): Likewise.
4416 (generic_initializer): Likewise.
4417 (ptr_initializer): Likewise.
4418 (ptm_initializer): Likewise.
4419 (class_initializer): Likewise.
4420 (get_pseudo_ti_init): Likewise.
4421 * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
4422
4423 2004-04-22 Alan Modra <amodra@bigpond.net.au>
4424
4425 * name-lookup.c (anonymous_namespace_name): Make static.
4426
4427 2004-04-19 Roger Sayle <roger@eyesopen.com>
4428
4429 PR middle-end/14531
4430 * class.c (build_base_path): Call fold whilst building the NULL
4431 pointer check expression trees.
4432
4433 2004-04-15 Bryce McKinlay <mckinlay@redhat.com>
4434
4435 * init.c (build_new_1): Don't use type size argument for Java
4436 _Jv_AllocObject call.
4437
4438 2004-04-09 Danny Smith <dannysmith@users.sourceforge.net>
4439
4440 * method.c (make_alias_for_thunk): Remove preprocessor guard on
4441 declaration and definition.
4442
4443 2004-04-08 Danny Smith <dannysmith@users.sourceforge.net>
4444
4445 PR c++/14808
4446 * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
4447 than ASM_OUTPUT_DEF.
4448
4449 2004-04-08 Jakub Jelinek <jakub@redhat.com>
4450
4451 * decl2.c (mark_used): Don't segfault if cfun != NULL but
4452 current_function_decl == NULL.
4453
4454 2004-04-05 Nathan Sidwell <nathan@codesourcery.com>
4455
4456 PR c++/3518
4457 * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
4458 level.
4459
4460 2004-04-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4461
4462 * init.c (decl_constant_value): Don't look at DECL_INITIAL
4463 of PARM_DECL.
4464 * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
4465 or TREE_SIDE_EFFECTS of a type.
4466
4467 2004-04-02 Nathan Sidwell <nathan@codesourcery.com>
4468
4469 PR c++/14007
4470 * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
4471 cv-qualifier unification.
4472 * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
4473
4474 2004-04-02 Jan Hubicka <jh@suse.cz>
4475
4476 * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
4477 * cp-tree.h (cp_update_decl_after_saving): Declare.
4478 * tree.c (cp_update_decl_after_saving): Define.
4479
4480 2004-04-01 Mark Mitchell <mark@codesourcery.com>
4481
4482 PR c++/14803
4483 * typeck.c (get_delta_difference): Call fold before returning the
4484 value.
4485
4486 2004-04-01 Richard Henderson <rth@redhat.com>
4487
4488 PR c++/14804
4489 * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
4490 * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
4491
4492 2004-04-01 Mark Mitchell <mark@codesourcery.com>
4493
4494 PR c++/14810
4495 * name-lookup.c (maybe_push_cleanup_level): Robustify.
4496
4497 2004-04-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4498
4499 * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
4500
4501 2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4502
4503 * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
4504 * class.c (check_bitfield_decl): Likewise.
4505 * cvt.c (type_promotes_to): Likewise.
4506 * decl.c (finish_enum): Likewise.
4507 * mangle.c (write_builtin_type): Likewise.
4508 * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
4509 * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
4510 (build_binary_op): Likewise.
4511
4512 2004-03-31 Jan Hubicka <jh@suse.cz>
4513
4514 * tree.h (optimize_function): Kill prototype.
4515 * optimize.c (dump_function, optimize_function, dump_finction): Kill.
4516 * semantics.c (expand_body): Kill.
4517
4518 2004-03-30 Mark Mitchell <mark@codesourcery.com>
4519
4520 PR c++/14724
4521 * decl.c (start_decl_1): Do not decide whether or not to create a
4522 new cleanup level until after the type has been completed.
4523
4524 PR c++/14763
4525 * pt.c (tsubst_default_argument): Clear current_function_decl.
4526
4527 2004-03-30 Zack Weinberg <zack@codesourcery.com>
4528
4529 * name-lookup.c, parser.c: Use new shorter form of GTY markers.
4530
4531 2004-03-29 Zack Weinberg <zack@codesourcery.com>
4532
4533 * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
4534 is null, just print the literal name and return.
4535
4536 2004-03-25 Kazu Hirata <kazu@cs.umass.edu>
4537
4538 * cxx-pretty-print.c: Fix comment typos.
4539
4540 2004-03-24 Kazu Hirata <kazu@cs.umass.edu>
4541
4542 * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
4543 Update copyright.
4544
4545 2004-03-23 Ziemowit Laski <zlaski@apple.com>
4546
4547 * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
4548 * mangle.c (write_type): Add call to 'mangle_fundamental_type'
4549 target hook.
4550
4551 2004-03-23 Zack Weinberg <zack@codesourcery.com>
4552
4553 PR 12267, 12391, 12560, 13129, 14114, 14133
4554 * cp-lang.c (c_reset_state): Delete.
4555 (push_file_scope, pop_file_scope): New stubs.
4556 * parser.c (c_parse_file): Call sorry() here if called more than once.
4557
4558 2004-03-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4559
4560 * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
4561 for INTEGER_CST.
4562
4563 2004-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
4564
4565 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
4566
4567 2004-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
4568
4569 * error.c (enum pad): Remove.
4570 (dump_qualifiers): Likewise.
4571 (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
4572 (dump_aggr_type): Likewise.
4573 (dump_type_suffix): Likewise.
4574 (dump_simple_decl): Likewise.
4575 (dump_function_decl): Likewise.
4576 (cv_to_string): Likewise.
4577 (dump_type_prefix): Likewise. Adjust return void.
4578 * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
4579 cxx_pretty_print.h.
4580 (pp_cxx_template_keyword_if_needed): Document.
4581 (pp_cxx_qualified_id): Document case FUNCTION_DECL. Tidy.
4582 (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
4583 MUST_NOT_THROW_EXPR.
4584
4585 2004-03-21 Mark Mitchell <mark@codesourcery.com>
4586
4587 PR c++/14616
4588 * decl.c (cp_finish_decl): Compute the size of arrays declared in
4589 templates, if their type is non-dependent.
4590
4591 2004-03-19 Mark Mitchell <mark@codesourcery.com>
4592
4593 * call.c (build_op_delete_call): Do not forget the placement
4594 arguments when iterating through mutiple delete operators.
4595
4596 * cp-tree.h (svaed_scope): Remove last_parms.
4597 (NEW_DELETE_OPNAME_P): New macro.
4598 (last_function_parms): Remove.
4599 (do_friend): Adjust prototype.
4600 * decl.c (grokparms): Return the PARM_DECLs directly, rather than
4601 using last_function_parms.
4602 (grokfndecl): Take the PARM_DECLs as an argument, rather than
4603 using last_function_parms.
4604 (grokdeclarator): Adjust accordingly. Do not form METHOD_TYPEs
4605 for class-specific operator new and operator delete.
4606 (grok_op_properties): Do not look for allocation functions with
4607 METHOD_TYPEs.
4608 (start_function): Use DECL_ARGUMENTS instead of
4609 last_function_parms.
4610 * decl.h (last_function_parms): Do not declare.
4611 * decl2.c (grokclassfn): Do not use last_function_parms.
4612 * friend.c (do_friend): Remove parmdecls parameter.
4613 * name-lookup.c (push_to_top_level): Do not save last_function_parms.
4614 (pop_from_top_level): Do not restore it.
4615 * pt.c (check_explicit_specialization): Do not adjust
4616 last_function_parms.
4617
4618 * name-lookup.c (do_local_using_decl): Create a local binding for
4619 types brought in via using declarations.
4620
4621 * name-lookup.c (lookup_arg_dependent): Handle block-scope
4622 function declarations correctly.
4623
4624 * semantics.c (finish_id_expression): Correct handling of
4625 conversion operators to dependent types.
4626
4627 * typeck.c (lookup_destructor): Allow the use of destructors from
4628 base classes.
4629
4630 2004-03-19 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4631
4632 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
4633 TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
4634 * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
4635 the field is named TEMPLATE_TYPE_PARM_INDEX.
4636
4637 2004-03-19 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4638
4639 PR c++/14545
4640 * parser.c (cp_parser_functional_cast): A cast to anything
4641 but integral or enumaration type is not an integral constant
4642 expression.
4643 * pt.c (value_dependent_expression_p): Handle cast expressions
4644 without operands (such as "int()").
4645
4646 2004-03-18 Mark Mitchell <mark@codesourcery.com>
4647
4648 * semantics.c (finish_pseudo_destructor_expr): Allow differing
4649 cv-qualification between the type named by the
4650 pseudo-destructor-name and the object-type.
4651
4652 * search.c (accessible_base_p): Handle non-proper bases.
4653
4654 * name-lookup.c (do_nonmember_using_decl): If a using declaration
4655 refers to a single overloaded function, set the type of the
4656 function.
4657 * tree.c (lvalue_type): Simplify.
4658 * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
4659 unknown type.
4660 (build_unary_op): Handle OVERLOADs with known types.
4661
4662 * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
4663 function templates.
4664
4665 * parser.c (cp_parser_postfix_expression): Handle the use of
4666 "typename" in non-dependent contexts. Convert appropriately when
4667 when using a qualified name after "->" or ".".
4668
4669 * call.c (conditional_conversion): Honor the requirement that some
4670 conversions refer to the original object.
4671
4672 2004-03-18 Mark Mitchell <mark@codesourcery.com>
4673
4674 * call.c (build_conditional_expr): Do not call force_rvalue for
4675 operands of void_type when the conditional expression itself has
4676 void type.
4677 * name-lookup.c (pushdecl): Don't consider a declaration of a
4678 function named "main" to be an overload of a type named "main".
4679 * parser.c (cp_parser_template_name): Perform name lookup when the
4680 template name is proceeded by "template" if the qualifying scope
4681 is non-dependent.
4682 * typeck.c (composite_pointer_type_r): Correctly handle
4683 pointer-to-member types.
4684 (build_const_cast): Likewise.
4685
4686 2004-03-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4687
4688 * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
4689 * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
4690 (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
4691 (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
4692 (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
4693 (TYPEOF_TYPE_EXPR): New macro.
4694 * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
4695 * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
4696 * pt.c (tsubst): Likewise.
4697 * semantics.c (finish_typeof): Likewise.
4698 * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
4699 and TEMPLATE_TYPE_PARM.
4700 * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
4701 (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
4702
4703 2004-03-16 Mark Mitchell <mark@codesourcery.com>
4704
4705 PR c++/14586
4706 * cp-tree.h (build_new_op): Change prototype.
4707 (build_x_binary_op): Likewise.
4708 * call.c (build_new_op): Add overloaded_p parameter.
4709 * decl2.c (grok_array_decl): Adjust call to build_new_op.
4710 * parser.c (cp_parser_binary_expression): Note that uses of
4711 overloaded operators prevents an expression from being considered
4712 an integral constant.
4713 * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
4714 build_x_binary_op.
4715 * semantics.c (finish_call_expr): Likewise.
4716 * typeck.c (rationalize_conditional_expr): Likewise.
4717 (build_x_indirect_ref): Likewise.
4718 (build_x_binary_op): Likewise.
4719 (build_x_unary_op): Likewise.
4720 (build_x_compound_expr): Likewise.
4721 (build_modify_expr): Likewise.
4722 * typeck2.c (build_x_arrow): Likewise.
4723
4724 2004-03-15 Kazu Hirata <kazu@cs.umass.edu>
4725
4726 * cp-lang.c, ptree.c: Update copyright.
4727
4728 2004-03-13 Mark Mitchell <mark@codesourcery.com>
4729
4730 PR c++/14550
4731 * parser.c (cp_parser_non_integral_constant_expression): Encode
4732 more of the idiom that surrounded calls to this function within
4733 the function itself
4734 (cp_parser_primary_expression): Adjust accordingly.
4735 (cp_parser_postfix_expression): Likewise.
4736 (cp_parser_unary_expression): Likewise.
4737 (cp_parser_cast_expression): Likewise.
4738 (cp_parser_assignment_expression): Likewise.
4739 (cp_parser_expression): Likewise.
4740 (cp_parser_new_expression): Note that new-expressions are not
4741 allowed in integral constant expressions.
4742 (cp_parser_delete_expression): Likewise.
4743
4744 2004-03-12 Matt Austern <austern@apple.com>
4745
4746 * decl2.c (maybe_make_one_only): Look at
4747 TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
4748 to make an explicit instantiation weak.
4749 * method.c (use_thunk): Make sure we call comdat_linkage
4750 when appropriate.
4751 * pt.c (do_type_instantiation): On systems where weak symbols
4752 don't go in a static archive's TOC, explicit instantiation of a
4753 class must imply *explicit* instantiation of its memeber.
4754
4755 2004-03-11 Kazu Hirata <kazu@cs.umass.edu>
4756
4757 * call.c, cp-tree.h, pt.c: Fix comment typos.
4758
4759 2004-03-10 Mark Mitchell <mark@codesourcery.com>
4760
4761 PR c++/14510
4762 * decl.c (xref_tag): Disregard non-type declarations when
4763 looking up a tagged type.
4764
4765 2004-03-09 Nathan Sidwell <nathan@codesourcery.com>
4766
4767 PR c++/14397
4768 * call.c (convert_like_real): Build a const qualified temporary,
4769 when testing ctor access.
4770
4771 2004-03-09 Mark Mitchell <mark@codesourcery.com>
4772
4773 * call.c (initialize_reference): Fix typo.
4774
4775 2004-03-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4776
4777 PR c++/14409
4778 * pt.c (determine_specialization): For member templates, match also
4779 constness.
4780
4781 PR c++/14448
4782 * parser.c (cp_parser_initializer_clause): Fold initializer if it is
4783 non-dependent.
4784 * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
4785
4786 2004-03-09 Mark Mitchell <mark@codesourcery.com>
4787
4788 PR c++/14230
4789 * call.c (initialize_reference): Handle initializers that are
4790 class-member access expressions applies to rvalues.
4791
4792 2004-03-09 Mark Mitchell <mark@codesourcery.com>
4793
4794 PR c++/14432
4795 * name-lookup.c (supplement_binding): Ignore functions that are
4796 marked DECL_ANTICIPATED.
4797
4798 2004-03-08 Mark Mitchell <mark@codesourcery.com>
4799
4800 PR c++/14401
4801 * class.c (check_field_decls): Complain about non-static data
4802 members of reference type in unions. Propagate
4803 CLASSTYPE_REF_FIELDS_NEED_INIT and
4804 CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
4805 data members.
4806 * init.c (perform_member_init): Complain about mbmers with const
4807 type that are not explicitly initialized.
4808
4809 2004-03-08 Mark Mitchell <mark@codesourcery.com>
4810
4811 * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
4812 * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
4813 (lang_identifier): Remove implicit_decl and error_locus.
4814 (IDENTIFIER_IMPLICIT_DECL): Remove.
4815 (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
4816 (IDENTIFIER_ERROR_LOCUS): Likewise.
4817 (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
4818 (TYPE_ASSEMBLER_NAME_STRING): Likewise.
4819 (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
4820 (implicitly_declare): Remove.
4821 * decl.c (warn_extern_redeclared_static): Remove check of
4822 IDENTIFIER_IMPLICIT_DECL.
4823 (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
4824 (implicitly_declare): Remove.
4825 (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
4826 (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
4827 (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
4828 * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
4829 in the innermost scope, rather than at namespace scope.
4830 * name-lookup.c (push_local_binding): Give it external linkage.
4831 (pushdecl): Remove dead code.
4832 * name-lookup.h (push_local_binding): Declare it.
4833 * ptree.c (cxx_print_identifier): Don't print
4834 IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
4835 * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
4836 not IDENTIFIER_ERROR_LOCUS.
4837 * typeck.c (build_function_call): Remove dead code.
4838
4839 2004-03-08 Jason Merrill <jason@redhat.com>
4840
4841 PR c++/13170
4842 * decl.c (xref_tag): Remove attribute handling.
4843 * cp-tree.h: Adjust prototype.
4844 * decl.c, parser.c, rtti.c: Adjust callers.
4845 * parser.c (cp_parser_class_head): Pass back attributes in the
4846 class head.
4847 (cp_parser_class_specifier): Adjust.
4848
4849 2004-03-08 Matt Austern <austern@apple.com>
4850
4851 PR debug/14079
4852 * name-lookup.c (add_decl_to_level): Add extern variables, as well
4853 as static, to static_decls array.
4854
4855 2004-03-05 Jason Merrill <jason@redhat.com>
4856
4857 * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
4858
4859 2004-03-04 Geoffrey Keating <geoffk@apple.com>
4860
4861 * decl.c (grokfndecl): Update old incorrect comment.
4862 (grokvardecl): Diagnose C++ variables of type with no linkage.
4863
4864 2004-03-01 Mark Mitchell <mark@codesourcery.com>
4865
4866 PR c++/14369
4867 * pt.c (build_non_dependent_expr): Do not create a
4868 NON_DEPENDENT_EXPR for a THROW_EXPR.
4869
4870 2004-03-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
4871
4872 PR c++/14369
4873 * error.c (dump_expr): Handle THROW_EXPR.
4874
4875 2004-03-01 Mark Mitchell <mark@codesourcery.com>
4876
4877 PR c++/14360
4878 * parser.c (cp_parser_postfix_expression): Do not perform Koenig
4879 lookup if ordinary name-lookup finds a non-function.
4880 * pt.c (tsubst_copy_and_build): Likewise.
4881
4882 PR c++/14361
4883 * parser.c (cp_parser_late_parsing_default_args): Check that there
4884 are no extra tokens after the end of the default-argument
4885 expression.
4886
4887 2004-03-01 Mark Mitchell <mark@codesourcery.com>
4888
4889 PR c++/14324
4890 * lex.c (retrofit_lang_decl): Treat entities with no linkage as
4891 having C++ linkage for name-mangling purposes.
4892
4893 PR c++/14260
4894 * parser.c (cp_parser_direct_declarator): Recognize constructor
4895 declarators that use a template-id to name the class being
4896 constructed.
4897
4898 PR c++/14337
4899 * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
4900 (tsubst_expr): Do not call tsubst_copy, even when
4901 processing_template_decl.
4902
4903 2004-03-01 Jeff Law <law@redhat.com>
4904
4905 * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
4906 the proper type.
4907
4908 2004-02-29 Mark Mitchell <mark@codesourcery.com>
4909
4910 PR c++/14138
4911 * name-lookup.h (push_scope): Change prototype.
4912 * name-lookup.c (push_scope): Do not reenter the current class
4913 scope.
4914 * decl.c (grokfndecl): Check return code from push_scope before
4915 calling pop_scope.
4916 * decl2.c (check_classfn): Likewise.
4917 * parser.c (cp_parser_conversion_function_id): Likewise.
4918 (cp_parser_init_declarator): Likewise.
4919 (cp_parser_direct_declarator): Likewise.
4920 (cp_parser_class_specifier): Likewise.
4921 (cp_parser_class_head): Likewise.
4922 (cp_parser_lookup_name): Likewise.
4923 (cp_parser_constructor_declarator_p): Likewise.
4924 * pt.c (instantiate_class_template): Likewise.
4925 (resolve_typename_type): Likewise.
4926
4927 2004-02-29 Mark Mitchell <mark@codesourcery.com>
4928
4929 PR c++/14267
4930 * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
4931 extension.
4932
4933 PR debug/12103
4934 * class.c (update_vtable_entry_for_fn): Do not go through
4935 covariance machinery if the type returned by an overrider is the
4936 same as the original.
4937
4938 2004-02-29 Kazu Hirata <kazu@cs.umass.edu>
4939
4940 * call.c: Fix a comment typo.
4941
4942 2004-02-27 Ziemowit Laski <zlaski@apple.com>
4943
4944 * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
4945
4946 2004-02-26 Mark Mitchell <mark@codesourcery.com>
4947
4948 PR c++/14278
4949 * parser.c (cp_parser_parameter_declaration_list): Commit
4950 to fewer tentative parses.
4951
4952 2004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4953
4954 PR c++/14284
4955 * pt.c (dependent_type_p_r): A template template parameter is a
4956 dependent type.
4957
4958 2004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4959
4960 PR c++/14246
4961 * mangle.c (write_template_arg_literal): Don't rely on identity for
4962 boolean constants.
4963
4964 2004-02-24 Jason Merrill <jason@redhat.com>
4965
4966 * tree.c (build_exception_variant): Use check_qualified_type.
4967
4968 2004-02-23 Zack Weinberg <zack@codesourcery.com>
4969 Kazu Hirata <kazu@cs.umass.edu>
4970
4971 * decl.c (cxx_init_decl_processing): Don't check
4972 flag_writable_strings.
4973
4974 2004-02-23 Andrew Pinski <pinskia@physics.uc.edu>
4975
4976 PR c++/14156
4977 * typeck.c (maybe_warn_about_returning_address_of_location):
4978 Change check for VAR_DECL to use DECL_P instead.
4979
4980 2004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4981
4982 PR c++/14250
4983 * cvt.c (build_expr_type_conversion): Type must be complete before
4984 looking up for conversions.
4985
4986 2004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4987
4988 PR c++/14143
4989 * name-lookup.c (arg_assoc_class): Don't look into template
4990 arguments if it is not a primary template.
4991
4992 2004-02-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
4993
4994 PR c++/12007
4995 * method.c (use_thunk): Always clone function argument tree.
4996
4997 2004-02-20 Mark Mitchell <mark@codesourcery.com>
4998
4999 PR c++/14199
5000 * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
5001
5002 PR c++/14173
5003 * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
5004 for all type variants.
5005
5006 2004-02-19 Mark Mitchell <mark@codesourcery.com>
5007
5008 PR c++/13927
5009 * decl.c (duplicate_decls): Return error_mark_node for invalid
5010 redeclarations.
5011 * name-lookup.c (push_namespace): Ignore the return value from
5012 pushdecl.
5013 * pt.c (push_template_decl_real): Robustify.
5014
5015 PR c++/14186
5016 * name-lookup.c (push_class_level_binding): Do not complain about
5017 adding a binding for a member whose name is the same as the
5018 enclosing class if the member is located in a base class of the
5019 current class.
5020
5021 2004-02-19 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5022
5023 PR c++/14181
5024 * parser.c (cp_parser_new_expression): Parse an ill-formed
5025 direct-new-declarator after a parenthesized type-id to emit good
5026 diagnostic.
5027
5028 2004-02-18 Kazu Hirata <kazu@cs.umass.edu>
5029
5030 * cp-tree.def, cvt.c: Update copyright.
5031
5032 2004-02-17 Mark Mitchell <mark@codesourcery.com>
5033
5034 PR c++/11326
5035 * cp-tree.h (abi_version_at_least): Remove.
5036 * mangle.c: Include flags.h.
5037
5038 2004-02-15 Mark Mitchell <mark@codesourcery.com>
5039
5040 PR c++/13971
5041 * call.c (build_conditional_expr): Handle conversions between
5042 class types which result in differently cv-qualified type
5043 variants.
5044
5045 PR c++/14086
5046 * class.c (delete_duplicate_fields_1): Remove.
5047 (delete_duplicate_fields): Likewise.
5048 (finish_struct_anon): Remove check for members with the same name
5049 as their enclosing class.
5050 (check_field_decls): Do not call duplicate_fields.
5051 * decl.c (grokdeclarator): Remove check for static data members
5052 with the same name as their enclosing class.
5053 * name-lookup.c (push_class_level_binding): Check for members with
5054 the same name as their enclosing class.
5055
5056 2004-02-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
5057
5058 PR c++/14085
5059 * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
5060
5061 2004-02-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
5062
5063 PR c++/13635
5064 * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
5065 has full set of arguments.
5066
5067 2004-02-13 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5068
5069 PR c++/13927
5070 * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
5071
5072 2004-02-13 Mark Mitchell <mark@codesourcery.com>
5073
5074 PR c++/14122
5075 * cp-tree.h (delete_sanity): Change prototype.
5076 * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
5077 Remove dead code. Adjust code to warn about deleting an array.
5078 * typekc.c (decay_conversion): Use build_address and build_nop.
5079
5080 PR c++/14108
5081 * search.c (accessible_p): Do not check access in thunks.
5082
5083 PR c++/14083
5084 * call.c (build_conditional_expr): Call force_rvalue on the
5085 non-void operand in the case that one result is a throw-expression
5086 and the other is not.
5087
5088 2004-02-13 Ian Lance Taylor <ian@wasabisystems.com>
5089
5090 PR c++/9851
5091 * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
5092 the type name and look ahead for ::~, and bail out early with a
5093 better error message if the parse is going to fail.
5094
5095 2004-02-12 Mark Mitchell <mark@codesourcery.com>
5096
5097 * call.c (conversion_kind): New type.
5098 (conversion_rank): Likewise.
5099 (conversion): Likewise.
5100 (CONVERSION_RANK): New macro.
5101 (conversion_obstack): New variable.
5102 (obstack_initialized): Likewise.
5103 (z_candidate): Change type of convs and second_conv.
5104 (candidate_warning): New type.
5105 (IDENTITY_RANK): Remove.
5106 (EXACT_RANK): Likewise.
5107 (PROMO_RANK): Likewise.
5108 (STD_RANK): Likewise.
5109 (PBOOL_RANK): Likewise.
5110 (USER_RANK): Likewise.
5111 (ELLIPSIS_RANK): Likewise.
5112 (BAD_RANK): Likewise.
5113 (ICS_RANK): Likewise.
5114 (ICS_STD_RANK): Likewise.
5115 (ICS_USER_FLAG): Likewise.
5116 (ICS_ELLIPSIS_FLAG): Likewise.
5117 (ICS_THIS_FLAG): Likewise.
5118 (ICS_BAD_FLAG): Likewise.
5119 (NEED_TEMPORARY_P): Likewise.
5120 (CHECK_COPY_CONSTRUCTOR_P): Likewise.
5121 (USER_CONV_CAND): Likewise.
5122 (USER_CONV_FN): Likewise.
5123 (conversion_obstack_alloc): New function.
5124 (alloc_conversion): Likewise.
5125 (validate_conversion_obstack): Likewise.
5126 (alloc_conversions): Likewise.
5127 (build_conv): Adjust to deal with new conversion data structures.
5128 (build_identity_conv): New function.
5129 (build_ambiguous_conv): Likewise.
5130 (standard_conversion): Adjust to deal with new conversion data
5131 structures.
5132 (convert_class_to_reference): Likewise.
5133 (direct_reference_binding): Likewise.
5134 (reference_binding): Likewise.
5135 (implicit_conversion): Likewise.
5136 (add_candidate): Likewise.
5137 (add_function_candidate): Likewise.
5138 (add_conv_candidate): Likewise.
5139 (build_builtin_candidate): Likewise.
5140 (print_z_candidate): Likewise.
5141 (merge_conversion_sequences): Likewise.
5142 (build_user_type_conversion_1): Likewise.
5143 (build_user_type_conversion): Likewise.
5144 (build_new_function_call): Likewise.
5145 (build_object_call): Likewise.
5146 (conditional_conversion): Likewise.
5147 (build_conditional_expr): Likewise.
5148 (build_new_op): Likewise.
5149 (build_op_delete_call): Likewise.
5150 (convert_like_real): Likewise.
5151 (build_over_call): Likewise.
5152 (build_new_method_call): Likewise.
5153 (is_subseq): Likewise.
5154 (maybe_handle_implicit_object): Likewise.
5155 (maybe_handle_ref_bind): Likewise.
5156 (compare_ics): Likewise.
5157 (source_type): Likewise.
5158 (add_warning): Likewise.
5159 (joust): Likewise.
5160 (can_convert_arg): Likewise.
5161 (can_convert_arg_bad): Likewise.
5162 (perform_implicit_conversion): Likewise.
5163 (perform_direct_initialization_if_possible): Likewise.
5164 (initialize_reference): Likewise.
5165 * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
5166 * cp-tree.def (WRAPPER): Likewise.
5167 (IDENTITY_CONV): Remove.
5168 (LVALUE_CONV): Likewise.
5169 (QUAL_CONV): Likewise.
5170 (STD_CONV): Likewise.
5171 (PTR_CONV): Likewise.
5172 (PMEM_CONV): Likewise.
5173 (BASE_CONV): Likewise.
5174 (REF_BIND): Likewise.
5175 (USER_CONV): Likewise.
5176 (AMBIG_CONV): Likewise.
5177 (RVALUE_CONV): Likewise.
5178 * cp-tree.h (tree_wrapper): Remove.
5179 (WRAPPER_ZC): Remove.
5180 (lang_tree_node): Remove wrapper.
5181 (LOOKUP_SPECULATIVELY): Remove.
5182 (build_op_delete_call): Adjust prototype.
5183 (validate_conversion_obstack): Declare.
5184 (build_zc_wrapper): Remove.
5185 * cvt.c (convert_to_reference): Remove dead code.
5186 (ocp_convert): Likewise.
5187 * decl.c (redeclaration_error_message): Correct handling of
5188 templates.
5189 (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
5190 (cp_tree_node_structure): Remove WRAPPER case.
5191 * decl2.c (finish_file): Call validate_conversion_obstack.
5192 * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
5193 (build_op_delete_call): Likewise.
5194 (build_x_delete): Likewise.
5195 (build_delete): Adjust call to build_op_delete_call.
5196 * pt.c (tsubst_friend_declaration): Adjust code to determine
5197 whether or not a friend template is a definition.
5198 (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
5199 * tree.c (build_zc_wrapper): Remove.
5200
5201 2004-02-12 Zack Weinberg <zack@codesourcery.com>
5202
5203 * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
5204 * cp-tree.h: Don't declare cxx_builtin_type_decls.
5205 * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
5206 (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
5207
5208 2004-02-10 Mark Mitchell <mark@codesourcery.com>
5209
5210 * typeck.c (lookup_destructor): Fix typo in error message.
5211
5212 2004-02-09 Kazu Hirata <kazu@cs.umass.edu>
5213
5214 * call.c, parser.c, tree.c: Fix comment typos.
5215
5216 2004-02-07 Zack Weinberg <zack@codesourcery.com>
5217
5218 Bug 13856
5219 * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
5220 * decl.c (duplicate_decls, start_function): Likewise.
5221
5222 2004-02-07 Zack Weinberg <zack@codesourcery.com>
5223
5224 * name-lookup.c (pushdecl): Issue shadow warnings directly.
5225 * parser.c (free_parser_stacks): Delete.
5226
5227 2004-02-07 Kazu Hirata <kazu@cs.umass.edu>
5228
5229 * rtti.c: Update copyright.
5230
5231 2004-02-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5232
5233 PR c++/14033
5234 * decl.c (require_complete_types_for_parms): Do not insert
5235 error_mark_node in the parameter list.
5236
5237 2004-02-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5238
5239 PR c++/14028
5240 * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
5241 error when terminator can not be found.
5242
5243 2004-02-05 Kelley Cook <kcook@gcc.gnu.org>
5244
5245 Make-lang.in (po-generated): Delete.
5246
5247 2004-02-05 Kazu Hirata <kazu@cs.umass.edu>
5248
5249 * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
5250 targetm.calls.promote_prototypes.
5251
5252 2004-02-05 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
5253
5254 PR middle-end/13750
5255 Revert:
5256 2004-01-15 Geoffrey Keating <geoffk@apple.com>
5257 PR pch/13361
5258 * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
5259 (handle_pragma_implementation): Likewise.
5260
5261 2004-02-05 Mark Mitchell <mark@codesourcery.com>
5262
5263 PR c++/13714
5264 * typeck.c (lookup_destructor): Tweak error message.
5265
5266 2004-02-05 Jan Hubicka <jh@suse.cz>
5267
5268 * tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat
5269 functions.
5270
5271 2004-02-05 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5272
5273 PR c++/14008
5274 * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
5275 code, only emits the diagnostic now. Added lookup of the identifier
5276 and support for qualified ids.
5277 (cp_parser_parse_and_diagnose_invalid_type_name): New function.
5278 Parse an (invalid) type name as id-expression within a declarator.
5279 (cp_parser_simple_declaration): Use it.
5280 (cp_parser_member_declaration): Likewise.
5281 (cp_parser_make_typename_type): New function. Handle errors through
5282 cp_parser_diagnose_invalid_typename.
5283 (cp_parser_elaborated_type_specifier): Use it.
5284
5285 2004-02-04 Mark Mitchell <mark@codesourcery.com>
5286
5287 PR c++/13932
5288 * call.c (convert_like_real): Use "converting" rather than
5289 "argument" as the descriptive keyword to
5290 dubious_conversion_warnings.
5291 * typeck.c (convert_for_assignment): Do not call
5292 dubious_conversion_warnings.
5293
5294 2004-02-04 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5295
5296 PR c++/13086
5297 * init.c (build_delete): Emit a more informative error message in
5298 case of an incomplete type, and on the correct source line.
5299
5300 2004-02-04 Kazu Hirata <kazu@cs.umass.edu>
5301
5302 * error.c, search.c: Update copyright.
5303
5304 2004-02-04 Mark Mitchell <mark@codesourcery.com>
5305
5306 PR c++/9941
5307 * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
5308 linkage for the typeinfo name string.
5309
5310 2004-02-04 Mark Mitchell <mark@codesourcery.com>
5311
5312 PR c++/13969
5313 * cp-tree.h (fold_non_dependent_expr): New function.
5314 * parser.c (cp_parser_fold_non_dependent_expr): Remove.
5315 (cp_parser_template_argument): Use fold_non_dependent_expr.
5316 (cp_parser_direct_declarator): Likewise.
5317 * pt.c (fold_non_dependent_expr): New function.
5318 (convert_nontype_argument): Use it.
5319 (tsubst_qualified_id): Simplify.
5320 (tsubst_copy_and_build): Likewise.
5321
5322 2004-02-04 Mark Mitchell <mark@codesourcery.com>
5323
5324 * decl.c (cxx_push_function_context): Do not set
5325 current_function_is_thunk.
5326 * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
5327 actual function.
5328
5329 2004-02-04 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5330
5331 PR c++/13997
5332 * pt.c (more_specialized_class): Increase processing_template_decl
5333 while partial ordering.
5334
5335 2004-02-03 Mark Mitchell <mark@codesourcery.com>
5336
5337 PR c++/13925
5338 * decl.c (start_function): Do not call pushdecl for any
5339 instantiation or specialization of a primary template.
5340
5341 2004-02-03 Mark Mitchell <mark@codesourcery.com>
5342
5343 PR c++/13950
5344 * parser.c (cp_parser_class_name): Robustify.
5345
5346 PR c++/13970
5347 * parser.c (cp_parser_cache_group): Do not consume the EOF token.
5348
5349 PR c++/14002
5350 * semantics.c (finish_id_expression): Do not return an
5351 IDENTIFIER_NODE when lookup finds a PARM_DECL.
5352
5353 2004-02-03 Mark Mitchell <mark@codesourcery.com>
5354
5355 PR c++/13978
5356 * pt.c (build_non_dependent_expr): Do not build
5357 NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
5358
5359 PR c++/13968
5360 * semantics.c (finish_id_expression): Do not return an
5361 IDENTIFIER_NODE when lookup finds a VAR_DECL.
5362
5363 PR c++/13975
5364 * parser.c (cp_parser_simple_declaration): When skipping to the
5365 end of the statement swallow the terminating semicolon.
5366
5367 2004-02-02 Mark Mitchell <mark@codesourcery.com>
5368
5369 PR c++/13113
5370 * init.c (build_offset_ref): Improve error recovery for invalid
5371 uses of non-static member functions.
5372
5373 PR c++/13854
5374 * cp-tree.h (cp_build_type_attribute_variant): New function.
5375 * class.c (build_clone): Use cp_build_type_attribute_variant.
5376 * decl.c (duplicate_decls): Likewise.
5377 * pt.c (copy_default_args_to_explicit_spec): Likewise.
5378 (tsubst_function_type): Likewise.
5379 * tree.c (build_exception_variant): Check attributes before
5380 concluding that two types are the same.
5381 (cp_build_type-attribute_variant): New method.
5382 * typeck.c (merge_types): Use cp_build_type_attribute_variant.
5383
5384 PR c++/13907
5385 * call.c (convert_class_to_reference): Keep better track of
5386 pedantically invalid user-defined conversions.
5387
5388 2004-02-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5389
5390 PR c++/13957
5391 * pt.c (tsubst_qualified_id): Improved error message when a type
5392 is expected but not found.
5393
5394 2004-01-31 Kazu Hirata <kazu@cs.umass.edu>
5395
5396 * class.c: Fix comment typos.
5397 * decl.c: Likewise.
5398 * error.c: Likewise.
5399 * parser.c: Likewise.
5400 * pt.c: Likewise.
5401 * search.c: Likewise.
5402 * typeck.c: Likewise.
5403
5404 2004-01-30 Richard Henderson <rth@redhat.com>
5405
5406 PR c++/13693
5407 * method.c (use_thunk): Don't force_target_expr for void thunks.
5408 * tree.c (build_target_expr_with_type): Assert non-void type.
5409 (force_target_expr): Likewise.
5410
5411 2004-01-30 Michael Matz <matz@suse.de>
5412
5413 * parser.c (cp_parser_labeled_statement): Accept case ranges.
5414
5415 2004-01-30 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5416
5417 DR206
5418 PR c++/13813
5419 * decl.c (grokdeclarator): Check immediatly type completeness for
5420 non-dependent types.
5421
5422 2004-01-30 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5423
5424 PR c++/13683
5425 * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
5426 a sizeof expression.block
5427
5428 2004-01-29 Mark Mitchell <mark@codesourcery.com>
5429
5430 PR c++/13883
5431 * mangle.c (write_encoding): Correct encoding of member template
5432 constructors.
5433
5434 2004-01-28 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5435
5436 * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
5437 template name as it was `<::' (digraph typo).
5438 (cp_parser_nth_token_starts_template_argument_list_p): New function.
5439 (cp_parser_id_expression): Use it.
5440 (cp_parser_nested_name_specifier_opt): Likewise.
5441 (cp_parser_template_name): Likewise.
5442 (cp_parser_class_name): Likewise.
5443 (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
5444
5445 2004-01-28 Mark Mitchell <mark@codesourcery.com>
5446
5447 PR c++/13791
5448 * typeck.c (merge_types): Do not merge attributes into
5449 TYPENAME_TYPEs.
5450
5451 PR c++/13736
5452 * parser.c (cp_parser_direct_declarator): Do not prevent
5453 backtracking inside a parenthesized declarator.
5454 (cp_parser_parameter_declaration): Fix typo in comment.
5455
5456 2004-01-28 Jan Hubicka <jh@suse.cz>
5457
5458 * semantics.c (expand_body) Do emit_associated_thunks before
5459 expansion.
5460
5461 2004-01-27 Devang Patel <dpatel@apple.com>
5462
5463 * name-lookup.c: Include "debug.h"
5464 (do_namespace_alias): Invoke debug_hooks to emit debug info
5465 for namespace alias.
5466 (do_local_using_decl): Invoke debug_hooks to emit debug info
5467 for using decl.
5468 (do_class_using_decl): Same.
5469 (do_toplevel_using_decl): Same.
5470 (do_using_directive): Same.
5471 (cp_emit_debug_info_for_using): New function.
5472 * Make-lang.in (cp/parser.o): Depend on debug.h
5473 (cp/name-lookup.o): Same.
5474
5475 2004-01-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5476
5477 * cp-tree.h (language_function, lang_type_header): Use
5478 BOOL_BITFIELD.
5479 * name-lookup.h (cp_binding_level): Likewise.
5480
5481 2004-01-26 Mark Mitchell <mark@codesourcery.com>
5482
5483 PR c++/13663
5484 * semantics.c (finish_for_expr): Check for unresolved overloaded
5485 functions.
5486
5487 * class.c (add_method): Just check processing_template_decl to
5488 determine whether or not we are within a template.
5489 * decl2.c (maybe_retrofit_in_chrg): Likewise.
5490 * init.c (decl_constant_value): Check the type of the declaration,
5491 not TREE_READONLY.
5492 * name-lookup.c (maybe_push_to_top_level): Rename to ...
5493 (push_to_top_level): ... this.
5494 * name-lookup.h (maybe_push_to_top_level): Do not declare it.
5495 * pt.c (push_template_decl_real): Reorder condition for speed.
5496 (convert_template_argument): Use dependency-checking functions in
5497 place of uses_template_parms.
5498 (lookup_template_class): Avoid calling uses_template_parms more
5499 than once.
5500 (uses_template_parms): Reimplement, using dependency-checking
5501 functions.
5502 (instantiate_class_template): Use push_to_top_level, not
5503 maybe_push_to_top_level.
5504 (type_unification_real): Simplify.
5505 (type_dependent_expression_p): Handle OFFSET_REFs and
5506 TEMPLATE_DECLs.
5507 (any_dependent_template_arguments_p): Handle multiple levels of
5508 template argument.
5509 * semantics.c (expand_or_defer_fn): Do not check
5510 uses_template_parms for template instantiations.
5511 * typeck.c (comptypes): Avoid calling cp_type_quals.
5512
5513 2004-01-25 Mark Mitchell <mark@codesourcery.com>
5514
5515 PR c++/13833
5516 * call.c (build_over_call): Do not convert arguments when
5517 processing a template.
5518 * pt.c (build_non_dependent_expr): Do not build a
5519 NON_DEPENDENT_EXPR for arithmetic constants.
5520
5521 2004-01-25 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5522
5523 PR c++/13810
5524 * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
5525 returns a TYPE_DECL. no further lookup is required.
5526 * semantics.c (check_template_template_default_arg): A TYPE_DECL
5527 is invalid. Rework to give better diagnostics.
5528
5529 2004-01-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
5530
5531 PR c++/13797
5532 * pt.c (instantiate_class_template): Add an error_mark_node
5533 check.
5534 (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
5535
5536 2004-01-23 Andrew Pinski <pinskia@physics.uc.edu>
5537
5538 PR c++/13701
5539 * decl.c (finish_function): Move the call to
5540 finish_fname_decls below the call to
5541 finish_eh_spec_block.
5542
5543 2004-01-21 Kazu Hirata <kazu@cs.umass.edu>
5544
5545 * optimize.c, typeck2.c: Update copyright.
5546
5547 2004-01-21 Kazu Hirata <kazu@cs.umass.edu>
5548
5549 * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
5550 init.c, mangle.c, typeck.c: Update copyright.
5551
5552 2004-01-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
5553
5554 * parser.c (cp_parser_class_specifier): Prevent garbage collection.
5555
5556 2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
5557
5558 * Make-lang.in: Replace $(docdir) with doc.
5559 (c++.info, c++.srcinfo): Dummy entry.
5560 (c++.man, c++.srcman): New rules.
5561 (c++.install-man): Revamp rule.
5562
5563 2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
5564
5565 * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
5566 CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
5567 immediate $(shell) instead of deferred backquote.
5568
5569 2004-01-19 Mark Mitchell <mark@codesourcery.com>
5570
5571 PR c++/13651
5572 * parser.c (cp_parser_postfix_expression): When encountering
5573 incomplete type on left-hand side of "->" or ".", treat the entire
5574 expression as erroneous.
5575
5576 PR c++/13592
5577 * call.c (build_field_call): Remove.
5578 (n_build_method_call): Likewise.
5579 (build_method_call): Likewise.
5580 (build_new_method_call): Do not call build_field_call.
5581 * class.c (n_build_method_call): Remove.
5582 (print_class_statistics): Do not print it.
5583 * cp-tree.h (build_method_call): Remove declaration.
5584 (finish_object_call_expr): Likewise.
5585 (build_new_1): Do not use build_method_call.
5586 * parser.c (cp_parser_postfix_expression): Use finish_call_expr
5587 when the function appearing on the right-hand-side of "." or "->"
5588 is not actually a function.
5589 * pt.c (tsubst_copy_and_build): Likewise.
5590 * semantics.c (finish_object_call_expr): Remove.
5591
5592 2004-01-18 Mark Mitchell <mark@codesourcery.com>
5593
5594 PR c++/13710
5595 * pt.c (tsubst): Use finish_typeof.
5596
5597 2004-01-18 Jason Merrill <jason@redhat.com>
5598
5599 PR c++/11725
5600 * except.c (build_throw): In a template, set
5601 current_function_returns_abnormally.
5602
5603 2004-01-17 Fred Fish <fnf@intrinsity.com>
5604
5605 PR c++/11895
5606 * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
5607 except don't call array_type_nelts() with a VECTOR_TYPE.
5608
5609 2004-01-16 Jan Hubicka <jh@suse.cz>
5610
5611 * mangle.c (write_mangled_name): Remove inline modifier.
5612
5613 2004-01-16 Mark Mitchell <mark@codesourcery.com>
5614
5615 PR c++/13574
5616 * decl.c (compute_array_index_type): Fix grammar in comment.
5617 * init.c (build_zero_init): Handle zero-sized arrays correctly.
5618
5619 PR c++/13178
5620 * call.c (name_as_c_string): Print conversion operator names
5621 correctly.
5622
5623 PR c++/13478
5624 * call.c (initialize_reference): Pass -1 for inner parameter to
5625 convert_like_real.
5626
5627 2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5628
5629 PR c++/13407
5630 * parser.c (cp_parser_base_specifier): Check for an invalid
5631 keyword `typename' and emit an user-friendly error message.
5632
5633 2004-01-15 Geoffrey Keating <geoffk@apple.com>
5634
5635 PR pch/13361
5636 * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
5637 (handle_pragma_implementation): Likewise.
5638
5639 2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5640
5641 PR c++/9259
5642 * typeck.c (build_class_member_access_expr): Allow to access members
5643 of the currently open class.
5644 (finish_class_member_access_expr): Likewise.
5645
5646 2004-01-15 Alexandre Oliva <aoliva@redhat.com>
5647
5648 PR c++/13659
5649 * name-lookup.c (validate_nonmember_using_decl): Take scope and
5650 name by value, instead of computing them.
5651 (do_local_using_decl, do_toplevel_using_decl): Add scope and name
5652 arguments. Pass them to validate_nonmember_using_decl.
5653 * name-lookup.h (do_local_using_decl): Adjust.
5654 (do_toplevel_using_decl): Likewise.
5655 * parser.c (cp_parser_using_declaration): Likewise.
5656 * pt.c (tsubst_expr): Likewise.
5657
5658 2004-01-15 Alexandre Oliva <aoliva@redhat.com>
5659
5660 PR c++/13594
5661 PR c++/13658
5662 * name-lookup.c (qualified_lookup_using_namespace): Search
5663 strongly-associated namespaces first, and only then try other
5664 namespaces.
5665
5666 2004-01-15 Kelley Cook <kcook@gcc.gnu.org>
5667
5668 * Make-lang.in (c++.srcextra): Dummy entry.
5669
5670 2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5671
5672 PR c++/8856
5673 * parser.c (cp_parser_template_name): Don't try to parse a
5674 conversion-function-id, as it cannot be a template-name.
5675 (cp_parser_simple_type_specifier): Check for invalid template-ids
5676 even after a built-in type.
5677
5678 2004-01-14 Jan Hubicka <jh@suse.cz>
5679
5680 PR c++/12850
5681 * pt.c (instantiate_decl): Do not increase function_depth.
5682
5683 2004-01-14 Danny Smith <dannysmith@users,sourceforge.net>
5684
5685 PR c++/9021
5686 PR c++/11005
5687 * parser.c (cp_parser_elaborated_type_specifier): Warn about
5688 attributes and discard.
5689 * decl.c (xref_tag): Don't overwite existing attributes with
5690 NULL_TREE.
5691
5692 2004-01-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5693
5694 PR c++/12335
5695 * parser.c (cp_parser_lookup_name): Return error_mark_node if there
5696 is no destructor while looking up a BIT_NOT_EXPR.
5697
5698 2004-01-13 Ian Lance Taylor <ian@wasabisystems.com>
5699
5700 * cxxfilt.c: Remove unused file.
5701
5702 2004-01-14 Jan Hubicka <jh@suse.cz>
5703
5704 Partial fix to PR c++/12850
5705 * decl2.c (mark_used): Do not proactively instantiate templates
5706 when compiling in unit-at-a-time or not optimizing.
5707 * optimize.c (maybe_clone_body): Do not increase function depth.
5708
5709 2004-01-13 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5710
5711 PR c++/13474
5712 * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
5713
5714 2004-01-12 Steven Bosscher <stevenb@suse.de>
5715
5716 PR c++/13558
5717 * parser.c (cp_parser_member_declaration): Any non-type is also
5718 not a class or a function.
5719
5720 2004-01-12 Jason Merrill <jason@redhat.com>
5721
5722 PR c++/12815
5723 * class.c (build_base_path): Do not mark vtable references as
5724 TREE_CONSTANT.
5725 (build_vtbl_ref_1): Likewise.
5726
5727 2004-01-12 Richard Henderson <rth@redhat.com>
5728
5729 PR opt/10776
5730 * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
5731 (store_init_value): Use it.
5732 * decl.c (check_initializer): Expect full initialization code
5733 from store_init_value.
5734 * init.c (expand_aggr_init_1): Likewise.
5735 * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
5736
5737 2004-01-12 Mark Mitchell <mark@codesourcery.com>
5738
5739 * class.c (layout_class_type): For non-POD class types, also copy
5740 the DECL_SIZE and DECL_MODE of fields to the base class type.
5741
5742 2004-01-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
5743
5744 PR c++/13289
5745 * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
5746 calling regenerate_decl_from_template.
5747
5748 2004-01-12 Scott Brumbaugh <scottb.lists@verizon.net>
5749
5750 PR c++/4100
5751 * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
5752 decl-specifier occurring along with a class definition.
5753
5754 2004-01-12 Ian Lance Taylor <ian@wasabisystems.com>
5755
5756 * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
5757 clauses to comments describing declares_class_or_enum.
5758 (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
5759 false.
5760
5761 2004-01-12 Jan Hubicka <jh@suse.cz>
5762
5763 * pt.c (for_each_template_parm): Do not check for duplicates.
5764 (for_each_template_parm): Use walk_tree duplicate checking code.
5765
5766 2004-01-11 Ian Lance Taylor <ian@wasabisystems.com>
5767
5768 PR c++/3478
5769 * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
5770 is error_mark_node, don't add any more decl_specs.
5771 (cp_parser_init_declarator): After committing to a declaration, if
5772 the decl_specifiers start with error_mark_node, issue an error and
5773 change the type to "int".
5774
5775 2004-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
5776
5777 PR bootstrap/7817
5778 * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
5779
5780 2004-01-10 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5781
5782 DR 337
5783 PR c++/9256
5784 * pt.c (tsubst): Substitution must fail if we are attempting to
5785 create an array with element type that is an abstract class type.
5786 * decl.c (cp_finish_decl): Strip pointers and array types recursively
5787 before calling abstract_virtuals_error.
5788
5789 2004-01-09 Alexandre Oliva <aoliva@redhat.com>
5790
5791 * name-lookup.c (qualified_lookup_using_namespace): Consider
5792 strong using directives even if we've already found a binding.
5793
5794 2004-01-09 Mark Mitchell <mark@codesourcery.com>
5795
5796 * cp-tree.h (cxx_expand_expr): Change prototype.
5797 * expr.c (cxx_expand_expr): Add alt_rtl parameter.
5798
5799 2004-01-08 Giovanni Bajo <giovannibajo@gcc.gnu.org>
5800
5801 PR c++/12573
5802 * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
5803 looking into them recursively. They can be there because of the
5804 new __offsetof__ extension.
5805
5806 2004-01-07 Zack Weinberg <zack@codesourcery.com>
5807
5808 * parser.c (cp_parser_save_member_function_body): Mark the
5809 definition static.
5810
5811 2004-01-05 Mark Mitchell <mark@codesourcery.com>
5812
5813 PR c++/13057
5814 * class.c (build_clone): Copy type attributes from the original
5815 function to the clone.
5816
5817 PR c++/12815
5818 * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
5819 references as constant.
5820
5821 PR c++/12132
5822 * parser.c (cp_parser_explicit_instantiation): Improve error
5823 recovery.
5824 (cp_parser_require): Improve indication of the error location.
5825
5826 PR c++/13451
5827 * parser.c (cp_parser_class_head): Reorder logic to check for
5828 invalid qualification.
5829
5830 2004-01-04 Mark Mitchell <mark@codesourcery.com>
5831
5832 PR c++/13157
5833 * name-lookup.c (lookup_using_namespace): Remove spacesp
5834 parameter.
5835 (unqualified_namespace_lookup): Likewise.
5836 (lookup_qualified_name): Adjust accordingly.
5837 (lookup_name_real): Likewise.
5838 (lookup_arg_dependent): Do not eliminate the namespace of the
5839 functions found by unqualified name lookup unless that is the
5840 current namespace.
5841
5842 2004-01-04 Andrew Pinski <pinskia@physics.uc.edu>
5843
5844 * semantics.c (push_deferring_access_checks): Fix format.
5845 (resume_deferring_access_checks): Likewise.
5846 (stop_deferring_access_checks): Likewise.
5847 (pop_deferring_access_checks): Likewise.
5848 (get_deferred_access_checks): Likewise.
5849 (pop_to_parent_deferring_access_checks): Likewise.
5850 (perform_deferred_access_checks): Likewise.
5851 (perform_or_defer_access_check): Likewise.
5852
5853 2004-01-04 Richard Henderson <rth@redhat.com>
5854
5855 * call.c (build_over_call): Don't create a save_expr of an
5856 aggregate, but rather its address.
5857
5858 2004-01-04 Mark Mitchell <mark@codesourcery.com>
5859
5860 PR c++/13529
5861 * parser.c (cp_parser_postfix_expression): Allow "." to appear in
5862 an offsetof expression.
5863
5864 * parser.c (cp_parser_parameter_declaration): Fix comment.
5865
5866 PR c++/12226
5867 * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
5868 (reference_binding): Set it when appropriate.
5869 (build_temp): New function, split out from ...
5870 (convert_like_real): ... here. Honor CHECK_COPY_CONSTRUCTOR_P.
5871 (initialize_reference): Likewise.
5872
5873 PR c++/13536
5874 * parser.c (cp_parser): Add in_type_id_in_expr_p.
5875 (cp_parser_new): Initialize it.
5876 (cp_parser_postfix_expression): Set it.
5877 (cp_parser_sizeof_operand): Likewise.
5878 (cp_parser_parameteR_declaration): Do not commit early to tenative
5879 parsers when in_type_id_in_expr_p is set.
5880
5881 2004-01-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
5882
5883 PR c++/13094
5884 * parser.c (cp_parser_template_argument): Don't call
5885 make_unbound_class_template directly.
5886 (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
5887 UNBOUND_CLASS_TEMPLATE tree node.
5888
5889 2004-01-02 Richard Sandiford <rsandifo@redhat.com>
5890
5891 PR target/12729
5892 * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
5893
5894 2004-01-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
5895
5896 PR c++/13520
5897 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
5898 (DECL_FUNCTION_TEMPLATE_P): Use it.
5899 (DECL_CLASS_TEMPLATE_P): Likewise.
5900 * parser.c (cp_parser_lookup_name): Add is_template parameter.
5901 (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
5902 (cp_parser_template_name): Likewise.
5903 (cp_parser_elaborated_type_specifier): Likewise.
5904 (cp_parser_namespace_name): Likewise.
5905 (cp_parser_class_name): Likewise.
5906 (cp_parser_lookup_name_simple): Likewise.
5907
5908 See ChangeLog.3 for earlier changes.