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