re PR c++/16174 (deducing top-level consts)
[gcc.git] / gcc / cp / ChangeLog
1 2004-06-28 Nathan Sidwell <nathan@codesourcery.com>
2
3 PR C++/16174
4 * call.c (build_temp): Declare.
5 (check_constructor_callable): New.
6 (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
7 CONSTRUCTOR_CALLABLE.
8 (convert_like_real, initialize_reference): Use
9 check_constructor_callable.
10 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
11 (LOOKUP_*): Renumber.
12
13 * friend.c (add_friend): Only perform access checks when context
14 is a class.
15 * lex.c (cxx_make_type): Only create a binfo for aggregate types.
16 * parser.c (cp_parser_class_specifier): Disable access checks here
17 when parsing the body of a templated class.
18 * semantics.c (perform_or_defer_access_checks): Reorder to allow
19 NULL binfos when not checking access.
20
21 2004-06-28 Nathan Sidwell <nathan@codesourcery.com>
22
23 Use vector API for vbase list.
24 * cp-tree.h: Include vec.h
25 (DEF_VEC_P (tree)): New type.
26 (struct lang_type_class): Change vbase's member type.
27 (binfo_for_vbase): Declare.
28 * class.c (determine_primary_base, base_derived_from,
29 update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
30 warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
31 build_vtbl_initializer): Adjust.
32 * decl.c (xref_basetypes): Adjust, accumulate upper bound of
33 vbases.
34 * init.c (sort_mem_initializers, expand_member_init,
35 push_base_cleanups): Adjust.
36 * method.c (do_build_copy_constructor): Adjust.
37 * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
38 (binfo_for_vbase): New.
39 * tree.c (copy_base_binfos): Adjust.
40
41 2004-06-28 Mark Mitchell <mark@codesourcery.com>
42
43 * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
44
45 2004-06-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
46
47 PR c++/14123
48 * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
49 paranthesis in case of pointers to array members.
50 * error.c (dump_type_prefix): Likewise.
51 (dump_type_suffix): Maybe issue a whitespace when printing
52 ARRAY_TYPE.
53
54 2004-06-27 Mark Mitchell <mark@codesourcery.com>
55
56 PR c++/16193
57 * parser.c (cp_parser_set_decl_spec_type): Refine test for
58 redefinition of built-in types.
59
60 2004-06-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
61
62 * error.c (pp_template_argument_list_start): Remove.
63 (pp_template_argument_list_end): Likewise.
64 (pp_separate_with_comma): Use pp_cxx_separate_with.
65 (reinit_global_formatting_buffer): Remove.
66 (pp_non_consecutive_character): Likewise.
67 (dump_scope): Use pp_cxx_colon_colon.
68 (dump_template_parameter): Use pp_cxx_identifier,
69 pp_cxx_tree_identifier and pp_cxx_whitespace.
70 (dump_templat_bindings): Replace use of pp_string with sequence
71 of pp_cxx_whitespace and pp_equal.
72 (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
73 pp_cxx_colon_colon, pp_cxx_whitespace throughout. Don't set
74 padding here.
75 (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
76 (dump_type_prefix): Don't set padding. Use pp_cxx_whitespace,
77 pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
78 (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
79 pp_cxx_right_bracket, pp_cxx_identifier throughout,
80 (dump_decl): Likewise.
81 (dump_template_decl): Likewise.
82 (dump_function_decl): Likewise. Set padding as appropriate.
83 (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
84 pp_cxx_right_paren.
85 (dump_exception_spec): Likewise.
86 (dump_function_name): Use pp_cxx_tree_identifier and
87 pp_cxx_identifier.
88 (dump_template_parms): Use pp_cxx_begin_template_argument_list and
89 pp_cxx_end_template_argument_list.
90 (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
91 pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
92 pp_cxx_whitespace throughout.
93 (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
94 pp_cxx_right_paren.
95 (dump_unary_op): Likewise.
96 (reinit_cxx_pp): New function.
97 (type_as_string); Use it.
98 (expr_as_string): Likewise.
99 (decl_as_string); Likewise.
100 (context_as_string): Likewise.
101 (lang_decl_name): Likewise.
102 (decl_to_string): Likewise.
103 (expr_to_string): Likewise.
104 (parm_to_string): Likewise.
105 (type_to_string): Likewise.
106 (args_to_string): Likewise.
107 (cv_to_string): Likewise.
108
109 2004-06-26 Mark Mitchell <mark@codesourcery.com>
110
111 * cp-tree.h (cp_cv_quals): New type.
112 (cp_declarator): Use it instead of "tree" as appropriate.
113 (grok_method_quals): Adjust prototype.
114 (grokclassfn): Likewise.
115 (do_friend): Likewise.
116 * decl.c (grokfndecl): Use cp_cv_quals, not tree.
117 (grokdeclarator): Likewise.
118 * decl2.c (grok_method_quals): Likewise.
119 (grokclassfn): Likewise.
120 * friend.c (do_friend): Likewise.
121 * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
122 * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
123 (make_pointer_declarator): Likewise.
124 (make_reference_declarator): Likewise.
125 (make_ptrmem_declarator): Likewise.
126 (cp_parser_ptr_operator): Likewise.
127 (cp_parser_cv_qualifier_seq_opt): Likewise.
128 (cp_parser_cv_qualifier_opt): Remove.
129 (cp_parser_new_declarator_opt): Adjust call to
130 cp_parser_ptr_operator.
131 (cp_parser_conversion_declaration_opt): Likewise.
132 (cp_parser_declarator): Use cp_cv_quals, not tree.
133 (cp_parser_direct_declarator): Likewise.
134
135 2004-06-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
136
137 * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
138 Rename DECL_STMT to DECL_EXPR.
139 * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
140 * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
141 * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
142
143 2004-06-26 Jan Hubicka <jh@suse.cz>
144
145 PR C++/14865
146 * decl2.c (maybe_emit_vtables): Always import_export_vtable for the
147 reachability analysis.
148
149 2004-06-25 Mark Mitchell <mark@codesourcery.com>
150
151 * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
152 2004-06-23 change.
153
154 2004-06-25 Paul Brook <paul@codesourcery.com>
155
156 * decl2.c (get_guard): Call targetm.cxx.guard_type.
157 (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
158
159 2004-06-24 Mark Mitchell <mark@codesourcery.com>
160
161 * decl.c (grokdeclarator): Restore error messages about __thread.
162 * parser.c (cp_parser_decl_specifier_seq): Likewise.
163
164 2004-06-24 Jason Merrill <jason@redhat.com>
165
166 PR c++/16115
167 * decl.c (grokparms): Give the PARM_DECL reference type if the
168 parameter is passed by invisible reference.
169
170 2004-06-24 Andreas Schwab <schwab@suse.de>
171
172 * cp-tree.h (enum cp_storage_class): Remove trailing comma.
173
174 2004-06-23 Mark Mitchell <mark@codesourcery.com>
175
176 * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
177 (cp/decl.o): Likewise.
178 (cp/decl2.o): Likewise.
179 (cp/pt.o): Likewise.
180 (cp/semantics.o): Likewise.
181 * config-lang.in (gtfiles): Do not reference cp/lex.h.
182 * class.c: Do not include lex.h.
183 (add_implicitly_declared_members): Do not use
184 adding_implicit_members.
185 (check_bases_and_members): Do not talk about grok_x_components.
186 * cp/cp-tree.h (adding_implicit_members): Remove.
187 (cp_storage_class): New type.
188 (cp_decl_spec): Likewise.
189 (cp_decl_specifier_seq): Likewise.
190 (cp_parameter_declarator): Use it for the decl_specifiers field.
191 (check_tag_decl): Adjust prototype.
192 (shadow_tag): Likewise.
193 (groktypename): Likewise.
194 (start_decl): Likewise.
195 (start_function): Likewise.
196 (start_method): Likewise.
197 (grok_x_components): Remove.
198 (grokfield): Adjust prototype.
199 (grokbitfield): Likewise.
200 (finish_member_class_template): Remove.
201 * decl.c: Do not include lex.h.
202 (adding_implicit_members): Do not define.
203 (check_tag_decl): Do not use trees to represent decl-specifiers.
204 (shadow_tag): Likewise.
205 (groktypename): Likewise.
206 (start_decl): Likewise.
207 (grokvardecl): Likewise.
208 (grokdeclarator): Likewise.
209 (grokparms): Likewise.
210 (start_function): Likewise.
211 (start_method): Likewise.
212 * decl.h (grokdeclarator): Adjust prototype.
213 * decl2.c: Do not include lex.h.
214 (grok_x_components): Remove.
215 (grokfield): Do not use trees to represent decl-specifiers.
216 (grokbitfield): Likewise.
217 * lex.c: Do not include lex.h.
218 * lex.h: Remove.
219 * parser.c: Include target.h.
220 (clear_decl_specs): New function.
221 (cp_parser_translation_unit): Do not use trees to represent
222 decl-specifiers.
223 (cp_parser_postfix_expression): Likewise.
224 (cp_parser_new_type_id): Likewise.
225 (cp_parser_condition): Likewise.
226 (cp_parser_simple_declaration): Likewise.
227 (cp_parser_decl_specifier_seq): Likewise.
228 (cp_parser_function_specifier_opt): Likewise.
229 (cp_parser_conversion_type_id): Likewise.
230 (cp_parser_template_parameter): Likewise.
231 (cp_parser_explicit_instantiation): Likewise.
232 (cp_parser_type_specifier): Likewise.
233 (cp_parser_simple_type_specifier): Likewise.
234 (cp_parser_init_declarator): Likewise.
235 (cp_parser_type_id): Likewise.
236 (cp_parser_type_specifier_seq): Likewise.
237 (cp_parser_parameter_declaration): Likewise.
238 (cp_parser_member_declaration): Likewise.
239 (cp_parser_exception_declaration): Likewise.
240 (cp_parser_function_definition_from_specifiers_and_declarator):
241 Likewise.
242 (cp_parser_single_declaration): Likewise.
243 (cp_parser_save_member_function_body): Likewise.
244 (cp_parser_friend_p): Likewise.
245 (cp_parser_set_storage_class): New function.
246 (cp_parser_set_decl_spec_type): Likewise.
247 * pt.c: Do not include lex.h.
248 * semantics.c: Likewise.
249 (finish_member_class_template): Remove.
250
251 2004-06-23 Roger Sayle <roger@eyesopen.com>
252
253 * call.c (build_cxx_call): Don't call expand_tree_builtin. No
254 longer take both "args" and "convert_args" as arguments.
255 (build_op_delete_call): Update call to build_cxx_call.
256 (build_over_call): Likewise, update call to build_cxx_call.
257 * cp-tree.h (build_cxx_call): Update funtion prototype.
258 * typeck.c (build_function_call): Don't call expand_tree_builtin.
259 * rtti.c (throw_bad_cast): Update call to build_cxx_call.
260 (throw_bad_typeid): Likewise.
261 (build_dynamic_cast_1): Likewise.
262
263 2004-06-22 Richard Henderson <rth@redhat.com>
264
265 * class.c (build_vfn_ref): Take a pointer not object. Build
266 an OBJ_TYPE_REF.
267 (cp_fold_obj_type_ref): New.
268 * call.c (build_over_call): Update build_vfn_ref call.
269 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
270 * cp-tree.h (cp_fold_obj_type_ref): Declare.
271
272 2004-06-21 Jason Merrill <jason@redhat.com>
273
274 PR c++/16112
275 * cp-gimplify.c (cp_gimplify_init_expr): Look through
276 CLEANUP_POINT_EXPR.
277
278 2004-06-21 Mark Mitchell <mark@codesourcery.com>
279
280 * cp-tree.def (NEW_EXPR): Add a fourth slot.
281 * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
282 (TREE_PARMLIST): Likewise.
283 (CALL_DECLARATOR_PARMS): Likewise.
284 (CALL_DECLARATOR_QUALS): Likewise.
285 (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
286 (cp_declarator_kind): New type.
287 (cp_parameter_declarator): Likewise.
288 (cp_declarator): Likewise.
289 (cp_error_declarator): Likewise.
290 (no_parameters): Likewise.
291 (groktypename): Change prototype.
292 (start_decl): Likewise.
293 (start_handler_parms): Likewise.
294 (get_scope_of_declarator): Likewise.
295 (start_function): Likewise.
296 (start_preparsed_function): New function.
297 (start_function): Change prototype.
298 (start_method): Likewise.
299 (grokfield): Likewise.
300 (grokbitfield): Likewise.
301 (build_new): Likewise.
302 (make_pointer_declarator): Remove.
303 (make_reference_declarator): Likewise.
304 (make_call_declarator): Likewise.
305 (set_quals_and_spec): Likewise.
306 (process_template_parm): Change prototype.
307 (begin_function_definition): Remove.
308 (finish_parmlist): Remove.
309 * decl.c (groktypename): Do not use trees to represent
310 declarators.
311 (start_decl): Likewise.
312 (start_handler_parms): Remove.
313 (get_scope_of_declarator): Reimplement.
314 (grokdeclarator): Do not use trees to represent declarators.
315 (grokparms): Likewise.
316 (start_function): Likewise.
317 (start_method): Likewise.
318 (build_void_list_mode): Do not use TREE_PARMLIST.
319 * decl.h (grokdeclarator): Change prototype.
320 * decl2.c (grok_method_quals): Robustify.
321 (grok_x_components): Do not use trees to represent declarators.
322 (grokfield): Likewise.
323 (grokbitfield): Likewise.
324 (start_objects): Build FUNCTION_DECLs, not declarators.
325 (start_static_storage_duration_function): Likewise.
326 * init.c (build_new): Simplify.
327 * lex.c (make_pointer_declarator): Remove.
328 (make_reference_declarator): Likewise.
329 (make_call_declarator): Likewise.
330 (set_quals_and_spec): Likewise.
331 * method.c (use_thunk): Use start_preparsed_function.
332 (synthesize_method): Likewise.
333 (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
334 * optimize.c (maybe_clone_body): Use start_preparsed_function.
335 * parser.c (cp_error_declarator): New variable.
336 (declarator_obstack): Likewise.
337 (alloc_declarator): New function.
338 (make_declarator): Likewise.
339 (make_id_declarator): Likewise.
340 (make_pointer_declarator): Likewise.
341 (make_reference_declarator): Likewise.
342 (make_ptrmem_declarator): Likewise.
343 (make_call_declarator): Likewise.
344 (make_array_declarator): Likewise.
345 (no_parameters): New variable.
346 (make_parameter_declarator): Likewise.
347 (cp_parser_check_for_definition_in_return_type): Do not use trees
348 to represent declarators.
349 (cp_parser_translation_unit): Likewise.
350 (cp_parser_new_expression): Likewise.
351 (cp_parser_new_type_id): Likewise.
352 (cp_parser_new_declarator_opt): Likewise.
353 (cp_parser_direct_new_declarator): Likewise.
354 (cp_parser_condition): Likewise.
355 (cp_parser_declaration_statement): Likewise.
356 (cp_parser_declaration): Likewise.
357 (cp_parser_conversion_type_id): Likewise.
358 (cp_parser_conversion_declarator_opt): Likewise.
359 (cp_parser_template_parameter_list): Likewise.
360 (cp_parser_template_parameter): Likewise.
361 (cp_parser_explicit_instantiation): Likewise.
362 (cp_parser_init_declarator): Likewise.
363 (cp_parser_declarator): Likewise.
364 (cp_parser_direct_declarator): Likewise.
365 (cp_parser_type_id): Likewise.
366 (cp_parser_parameter_declaration_clause): Likewise.
367 (cp_parser_parameter_declaration_list): Likewise.
368 (cp_parser_parameter_declaration): Likewise.
369 (cp_parser_member_declaration): Likewise.
370 (cp_parser_exception_declaration): Likewise.
371 (cp_parser_check_declarator_template_parameters): Likewise.
372 (cp_parser_function_definition_from_specifiers_and_declarator):
373 Likewise.
374 (cp_parser_save_member_function_body): Likewise.
375 * pt.c (process_template_parm): Add is_non_type parameter.
376 (convert_template_argument): Adjust call to groktypename.
377 (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
378 (tsubst): Do not expect declarators.
379 (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
380 argument.
381 (instantiate_decl): Use start_preparsed_function.
382 * semantics.c (begin_function_definition): Remove.
383 (finish_parmlist): Remove.
384 * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
385 declarators.
386
387 2004-06-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
388
389 * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
390 (build_new_method_call): Likewise.
391 * decl.c (local_variable_p_walkfn): Don't walk into types.
392 * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
393 (build_anon_union_vars): Add new operand for COMPONENT_REF.
394 * init.c (buld_new): Add new operand for ARRAY_REF.
395 * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
396 (do_build_assign_ref): Likewise.
397 * parser.c (cp_parser_direct_new_declarator): Add new operands
398 for ARRAY_REF.
399 (cp_parser_direct_declarator): Likewise.
400 * pt.c (tsubst): Likewise.
401 (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
402 for COMPONENT_REF.
403 * semantics.c (finish_non_static_data_member): Add new operand
404 for COMPONENT_REF.
405 * typeck.c (build_class_member_access_expr): Likewise.
406 (build_class_member_access_expr, finish_class_member_access_expr):
407 Likewise.
408 (build_ptrmemfunc_access_expr): Likewise.
409 (build_array_ref): Add new operands for ARRAY_REF.
410 * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
411 * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
412
413 2004-06-21 Richard Henderson <rth@redhat.com>
414
415 * dump.c (cp_dump_tree): Don't use dump_next_stmt.
416 * parser.c (cp_parser_jump_statement): Update commentary.
417 * pt.c (tsubst_expr): Use RETURN_EXPR.
418 * semantics.c (finish_return_stmt): Likewise.
419 (finalize_nrv_r): Likewise.
420 * typeck.c, typeck2.c: Update file start commentary.
421
422 2004-06-21 Richard Henderson <rth@redhat.com>
423
424 * semantics.c (finish_expr_stmt): Call verify_sequence_points.
425
426 2004-06-20 Richard Henderson <rth@redhat.com>
427
428 * cp-tree.h (add_decl_stmt): Declare.
429 * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
430 * semantics.c (maybe_cleanup_point_expr): New.
431 (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
432 finish_for_expr, finish_switch_cond): Use it.
433 (finalize_nrv_r): Don't build an EXPR_STMT. Don't frob TREE_CHAIN.
434
435 2004-06-20 Richard Henderson <rth@redhat.com>
436
437 * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
438 * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
439 (cp_gimplify_expr): Call it.
440 (gimplify_cleanup_stmt): Move from c-gimplify.c.
441 (cp_genericize): New.
442 * decl.c (finish_function): Call it.
443 * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
444 (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
445 (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
446 (cp_genericize): Declare.
447 * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
448 * dump.c (cp_dump_tree): Likewise.
449 * semantics.c (push_cleanup): Move from c-semantics.c.
450
451 2004-06-20 Zack Weinberg <zack@codesourcery.com>
452
453 * cp-lang.c (has_c_linkage): Implement.
454
455 * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
456 * decl.c (duplicate_decls): Use COPY_DECL_RTL.
457 (builtin_function_1): Don't call make_decl_rtl.
458 (build_cp_library_fn): Don't call set_mangled_name_for_decl.
459 (grokvardecl): Don't call mangle_decl.
460 * except.c (nothrow_libfn_p): Look at DECL_NAME, not
461 DECL_ASSEMBLER_NAME.
462 * method.c (set_mangled_name_for_decl): Delete.
463 * name-lookup.c (pushdecl): When a local extern shadows a
464 file-scope declaration of the same object, give both DECLs the
465 same DECL_UID.
466 * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
467 on DECL_ASSEMBLER_NAME.
468
469 2004-06-19 Richard Henderson <rth@redhat.com>
470
471 * cp-gimplify.c: Remove unnecessary prototypes.
472 (cp_gimplify_stmt): Merge into ...
473 (cp_gimplify_expr): ... here. Move to end of file. Handle
474 stmts_are_full_exprs_p frobbing.
475 * cp-tree.h (cp_gimplify_stmt): Remove.
476 * pt.c (tsubst_expr): Merge prep_stmt and unify.
477 * tree.c (init_tree): Don't set lang_gimplify_stmt.
478
479 2004-06-18 Richard Henderson <rth@redhat.com>
480
481 PR c++/16034
482 * semantics.c (begin_cond): New.
483 (finish_cond): Rewrite to handle template DECL_STMTs specially.
484 Assume that non-template decls go land before the conditional.
485 (simplify_loop_decl_cond): Likewise.
486 (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
487 finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
488 begin_switch_stmt, finish_switch_cond): Update to match.
489
490 2004-06-17 Jason Merrill <jason@redhat.com>
491
492 PR c++/16015
493 * semantics.c (simplify_aggr_init_expr): Don't return the slot.
494 (finish_stmt_expr_expr): Update type after conversions.
495 (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
496 Handle void initializer.
497 * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
498
499 2004-06-17 Geoffrey Keating <geoffk@apple.com>
500
501 * class.c (build_clone): Don't call defer_fn, let mark_used do it.
502 * cp-tree.h (defer_fn): Delete.
503 * decl2.c (defer_fn): Delete.
504 (finish_file): Simplify deferred_fns loops; check that
505 only used inline functions get into deferred_fns.
506 (mark_used): Inline previous contents of defer_fn.
507
508 2004-06-16 Richard Henderson <rth@redhat.com>
509
510 * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
511 (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
512 * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
513 of CTOR_INITIALIZER ...
514 (pp_cxx_statement): ... here.
515 * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
516 (finish_function): Use alloc_stmt_list to zap entire function.
517 * parser.c (cp_parser_compound_statement): Update commentary.
518 * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
519 * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
520 (finish_stmt_expr): Don't look through COMPOUND_STMT.
521
522 2004-06-16 Geoffrey Keating <geoffk@apple.com>
523
524 * pt.c (mark_decl_instantiated): Don't call defer_fn.
525
526 2004-06-16 Richard Henderson <rth@redhat.com>
527
528 * parser.c (cp_parser_labeled_statement): Update commentary.
529 * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
530 * tree.c (mark_local_for_remap_r): Likewise.
531
532 2004-06-16 Richard Henderson <rth@redhat.com>
533
534 * parser.c (cp_parser_asm_definition): Update commentary.
535 * pt.c (tsubst_expr): Use ASM_EXPR.
536 * semantics.c (finish_asm_stmt): Likewise.
537
538 2004-06-16 Richard Henderson <rth@redhat.com>
539
540 * decl.c (finish_destructor_body): Use LABEL_EXPR.
541 * parser.c (cp_parser_statement): Update commentary.
542 * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
543 * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
544 * tree.c (mark_local_for_remap_r): Likewise.
545
546 2004-06-16 Richard Henderson <rth@redhat.com>
547
548 PR c++/16012
549 * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
550 statement in FOR_INIT_STMT for templates.
551
552 2004-06-15 Richard Henderson <rth@redhat.com>
553
554 * call.c (initialize_reference): Don't build CLEANUP_STMT here.
555 * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
556 (genericize_try_block): Use gimplify_stmt.
557 (genericize_catch_block, genericize_eh_spec_block): Likewise.
558 (cp_gimplify_init_expr): Remove STMT_EXPR special case.
559 (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
560 * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
561 (cp_tree_chain_matters_p): Remove.
562 * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
563 (COMPOUND_STMT_BODY_BLOCK): New.
564 (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
565 (EXPR_STMT_STMT_EXPR_RESULT): New.
566 (building_stmt_tree): Check cur_stmt_list.
567 (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
568 (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
569 * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
570 (cp_finish_decl): Use push_cleanup.
571 (start_function, finish_function): Use statement lists.
572 (finish_stmt): Do nothing.
573 * except.c (begin_eh_spec_block): Use statement lists.
574 (check_handlers_1, check_handlers): Likewise.
575 * init.c (construct_virtual_base): Don't add extra compound stmts.
576 (build_vec_init): Likewise.
577 * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
578 * name-lookup.h (struct cp_binding_level): Add statement_list.
579 * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
580 (cp_parser_labeled_statement, cp_parser_expression_statement,
581 cp_parser_statement_seq_opt): Likewise.
582 (cp_parser_compound_statement): Likewise. Take bool for try block.
583 (cp_parser_selection_statement): Tidy if processing.
584 (cp_parser_already_scoped_statement): Rewrite to do what it says.
585 * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
586 (tsubst_expr): Rewrite STMT_EXPR processing. Handle STATEMENT_LIST.
587 Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
588 * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
589 (finish_cond): New, rewritten from FINISH_COND.
590 (simplify_loop_decl_cond): New.
591 (finish_expr_stmt): Avoid nested EXPR_STMTs.
592 (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
593 begin_else_clause, finish_else_clause, finish_if_stmt,
594 begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
595 begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
596 finish_for_cond, finish_for_stmt, begin_switch_stmt,
597 finish_switch_cond, finish_switch_stmt, begin_try_block,
598 finish_try_block, finish_cleanup_try_block, finish_function_try_block,
599 finish_handler_sequence, finish_function_handler_sequence,
600 begin_handler, finish_handler_parms, finish_handler,
601 begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
602 using statement lists.
603 (begin_compound_stmt): Replace has_no_scope argument with flags.
604 Update all callers. Use statement lists.
605 (finish_compound_stmt): Likewise.
606 (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
607 (current_scope_stmt_stack): Remove.
608 (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
609 * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
610 Rewrite with statement lists.
611
612 2004-06-15 Alexandre Oliva <aoliva@redhat.com>
613
614 * parser.c: Change all assignments of c_lex_string_translate
615 to true and false to 1 and 0.
616 (cp_lexer_read_token): Convert type of the translated string.
617 (cp_parser_skip_to_closing_parentheses): Preserve original
618 value of c_lex_string_translate, and set it to -1 while
619 running.
620 (cp_parser_cache_group): Likewise.
621 (cp_parser_cache_group_1): Renamed.
622 (cp_parser_asm_operand_list): Remove redundant setting of
623 c_lex_string_translate.
624 (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
625 Handle chained strings.
626
627 2004-06-12 Andrew Pinski <apinski@apple.com>
628
629 PR c++/14639
630 Revert:
631 2004-06-02 Andrew Pinski <pinskia@physics.uc.edu>
632
633 * cp-tree.h: Fix typo.
634
635 * cp-tree.h: Include cgraph.h
636 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
637 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
638
639 2004-06-12 Jason Merrill <jason@redhat.com>
640
641 PR tree-optimization/14107
642 * decl.c (finish_function): Warn about no return in all functions.
643
644 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
645
646 * cp-tree.h (struct language_function): Remove cannot_inline.
647 * decl.c (save_function_data): cannot_inline is no more.
648 (cxx_push_function_context): Likewise.
649 * decl2.c (start_objects, start_static_storage_duration_function):
650 Reset DECL_INLINE, set DECL_UNINLINABLE.
651
652 2004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
653
654 PR c++/15967
655 * search.c (lookup_field): Propagate the ambiguity list.
656 (lookup_fnfields): Likewise.
657
658 2004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
659
660 PR c++/15947
661 * parser.c (cp_parser_template_name): Ctors/dtors never need a
662 template keyword to disambiguate.
663
664 2004-06-14 Mark Mitchell <mark@codesourcery.com>
665
666 PR c++/15096
667 * decl.c (grokdeclarator): Ignore pointer-to-members when
668 computing template depth.
669
670 PR c++/14930
671 * name-lookup.c (pushtag): Do not try to put class declarations in
672 explicit specialization scopes.
673
674 2004-06-11 Andrew Pinski <pinskia@physics.uc.edu>
675
676 * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
677
678 2004-06-11 Mark Mitchell <mark@codesourcery.com>
679
680 PR c++/15862
681 * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
682 bindings for undeclared built-ins.
683
684 2004-06-11 Giovanni Bajo <giovannibajo@gcc.gnu.org>
685
686 * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
687 appear at the correct location.
688
689 2004-06-10 Jason Merrill <jason@redhat.com>
690
691 PR c++/15875
692 Revert:
693 2004-06-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
694 * init.c (build_offset_ref): Build SCOPE_REF with non-null
695 TREE_TYPE for non-dependent names.
696 * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
697 unknown_type_node as its TREE_TYPE.
698 * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
699 * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
700 (dump_expr) <SCOPE_REF case>: Likewise.
701
702 2004-06-10 Mark Mitchell <mark@codesourcery.com>
703
704 PR c++/15227
705 * parser.c (cp_parser_direct_declarator): Robustify.
706
707 PR c++/15877
708 * pt.c (tsubst_copy): Use decl_constant_value on enumeration
709 constants in non-dependent contexts.
710
711 PR c++/14211
712 PR c++/15076
713 * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
714 necessary.
715
716 2004-06-10 Jakub Jelinek <jakub@redhat.com>
717
718 PR c++/14791
719 * decl.c (duplicate_decls): Handle fileptr_type_node arguments
720 specially.
721
722 2004-06-09 Mark Mitchell <mark@codesourcery.com>
723
724 Revert:
725 PR c++/15815
726 2004-06-07 Mark Mitchell <mark@codesourcery.com>
727 * lex.c (handle_pragma_interface): Deprecate.
728 (handle_pragma_implementation): Likewise.
729
730 2004-06-09 Andrew Pinski <pinskia@physics.uc.edu>
731
732 * g++spec.c (lang_specific_driver): Remove check for -lm
733 and -lmath when check it see if it was the math library.
734
735 2004-06-08 Giovanni Bajo <giovannibajo@gcc.gnu.org>
736
737 PR c++/7841
738 * parser.c (cp_parser_direct_declarator): Reject constructor named
739 as qualified template-id.
740
741 2004-06-07 Mark Mitchell <mark@codesourcery.com>
742
743 PR c++/15815
744 * lex.c (handle_pragma_interface): Deprecate.
745 (handle_pragma_implementation): Likewise.
746
747 2004-06-07 Mark Mitchell <mark@codesourcery.com>
748
749 PR c++/15766
750 * parser.c (cp_parser_iteration_statement): Fix typo in error
751 message.
752
753 PR c++/14777
754 * pt.c (tsubst_default_argument): Do not defer access checks
755 while substituting into the default argument.
756
757 PR c++/15554
758 * pt.c (tsubst_copy): Do not try to substitute for an enumeration
759 constant in a non-dependent context.
760
761 PR c++/15057
762 * except.c (build_throw): Ensure that temp_expr has been
763 initialized.
764
765 2004-06-06 Roger Sayle <roger@eyesopen.com>
766
767 * cp/cp-tree.h (lvalue_or_else): Add function prototype.
768
769 2004-06-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
770
771 PR c++/15503
772 * parser.c (cp_parser_mem_initializer_id): Gracefully reject
773 'typename', and accept 'template'.
774
775 2004-06-03 Andrew Pinski <pinskia@physics.uc.edu>
776 Jan Hubicka <jh@suse.cz>
777
778 PR c++/14639
779 * method.c (use_think): Do not mark thunk as referenced.
780
781 2004-06-03 Matt Austern <austern@apple.com>
782
783 PR c++/15428
784 * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
785 is nonzero, and if we see a noninline definition of a key method,
786 make the vtables nonweak.
787
788 2004-06-02 Matt Austern <austern@apple.com>
789
790 * cp-tree.h (instantiate_decl): new boolean parameter,
791 undefined_ok. Current behavior is equivalent to its being 0.
792 * decl2.c (mark_used): Add new argument when calling instantiate_decl
793 * pt.c (mark_decl_instantiated): Unconditionally make
794 instantiations explicit unconditionally
795 (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
796 since mark_decl_instantiated now does it.
797 (instantiate_class_member): New. Instantiate a member of an
798 explicitly instantiated class template.
799 (do_type_instantiation): Explicitly instantiate members of an
800 explicitly instantiated class template.
801 (instantiate_decl): if undefined_ok is nonzero, and if we're
802 trying to explicitly instantiated a template with no definition,
803 change it to an implicit instantiation.
804 (instantiate_pending_templates): Add new argument to instantiate_decl.
805 * tree.c (cp_cannot_inline_tree_fn): Likewise.
806
807 2004-06-02 Andrew Pinski <pinskia@physics.uc.edu>
808
809 * cp-tree.h: Fix typo.
810
811 * cp-tree.h: Include cgraph.h
812 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
813 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
814
815 2004-06-01 Jason Merrill <jason@redhat.com>
816
817 PR c++/15142
818 * call.c (call_builtin_trap): Remove type parm.
819 (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
820 (build_x_va_arg): Dereference a null pointer for a non-POD argument.
821
822 2004-06-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
823
824 PR c++/13092
825 * init.c (build_offset_ref): Build SCOPE_REF with non-null
826 TREE_TYPE for non-dependent names.
827 * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
828 unknown_type_node as its TREE_TYPE.
829 * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
830 * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
831 (dump_expr) <SCOPE_REF case>: Likewise.
832
833 2004-06-01 Richard Henderson <rth@redhat.com>
834 Andrew Pinski <pinskia@physics.uc.edu>
835
836 * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
837 * parser.c (struct cp_parser): Remove in_offsetof.
838 (cp_parser_new): Don't set it.
839 (cp_parser_unary_expression): Don't check it.
840 (cp_parser_postfix_open_square_expression): Split out from ...
841 (cp_parser_postfix_expression): ... here.
842 (cp_parser_postfix_dot_deref_expression): Likewise.
843 (cp_parser_builtin_offsetof): New.
844 (cp_parser_primary_expression): Use it.
845
846 2004-06-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
847
848 PR c++/14932
849 * parser.c (cp_parser_postfix_expression): Allow subscript
850 operator in offsetof.
851
852 2004-05-31 Mark Mitchell <mark@codesourcery.com>
853
854 PR c++/15701
855 * friend.c (add_friend): Do not try to perform access checks for
856 functions from dependent classes.
857
858 2004-05-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
859
860 * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
861 (pp_cxx_begin_template_argument_list): Turn into a function.
862 (pp_cxx_end_template_argument_list): Likewise.
863 (pp_cxx_separate_with): Define.
864 (pp_cxx_unqualified_id): Tidy.
865 (pp_cxx_primary_expression): Likewise.
866 (pp_cxx_postfix_expression): Likewise.
867 (pp_cxx_expression): Likewise.
868 (pp_cxx_simple_type_specifier): Likewise.
869 (pp_cxx_type_specifier_seq): Likewise.
870 (pp_cxx_parameter_declaration_clause): Likewise.
871 (pp_cxx_exception_specification): Likewise.
872 (pp_cxx_direct_declarator): Likewise.
873 (pp_cxx_type_id): Likewise.
874 * cxx-pretty-print.h (pp_cxx_whitespace): Export from
875 cxx-pretty-print.c.
876 (pp_cxx_left_paren): Likewise.
877 (pp_cxx_right_paren): Likewise.
878 (pp_cxx_left_brace): Likewise.
879 (pp_cxx_right_brace): Likewise.
880 (pp_cxx_left_bracket): Likewise.
881 (pp_cxx_right_bracket): Likewise.
882 (pp_cxx_dot): Likewise.
883 (pp_cxx_identifier): Likewise.
884 (pp_cxx_tree_identifier): Likewise.
885 (pp_cxx_ampersand): New macro.
886 (pp_cxx_star): Likewise.
887 (pp_cxx_arrow): Likewise.
888 (pp_cxx_semicolon): Likewise.
889 (pp_cxx_complement): Likewise.
890 (pp_cxx_begin_template_argument_list): Declaree.
891 (pp_cxx_end_template_argument_list): Likewise.
892 (pp_cxx_colon_colon): likewise.
893
894 2004-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
895
896 * parser.c (cp_parser_simple_type_specifier): Explicitly test
897 against NULL_TREE.
898
899 2004-05-31 Kazu Hirata <kazu@cs.umass.edu>
900
901 * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
902 typeck.c: Fix comment formatting.
903
904 2004-05-30 Andrew Pinski <pinskia@physics.uc.edu>
905
906 * cp-lang.c (cp_expand_decl): Remove.
907 (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
908
909 2004-05-30 Andreas Jaeger <aj@suse.de>
910
911 * lang-specs.h: Add missing initializers for .ii.
912
913 2004-05-28 Aldy Hernandez <aldyh@redhat.com>
914
915 * decl.c (cp_make_fname_decl): Free return value from
916 fname_as_string.
917
918 2004-05-28 Mark Mitchell <mark@codesourcery.com>
919
920 PR c++/15083
921 * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
922 even in a templat.e
923 * init.c (build_new): Likewise.
924
925 PR c++/15640
926 * name-lookup.c (arg_assoc): Robustify.
927
928 PR c++/15471
929 * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
930 when determining the scope to use for a pointer to member.
931 (lookup_anon_field): Give it external linkage.
932 * cp-tree.h (lookup_anon_field): Declare it.
933 * expr.c (cplus_expand_constant): Use it.
934
935 2004-05-28 Mark Mitchell <mark@codesourcery.com>
936
937 PR c++/14668
938 * parser.c (cp_parser_simple_type_specifier): Call
939 maybe_note_name_used_in_class.
940
941 2004-05-28 Tom Marshall <tmarshall@real.com>
942
943 PR c++/15214
944 * class.c (finish_struct_1): Warn only if the dtor is non-private or
945 the class has friends.
946
947 2004-05-27 Adam Nemet <anemet@lnxw.com>
948
949 PR c++/12883
950 * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
951 TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
952
953 2004-05-24 Geoffrey Keating <geoffk@apple.com>
954
955 * method.c (implicitly_declare_fn): Don't call defer_fn; abort
956 if it might be needed.
957 * pt.c (mark_decl_instantiated): Only call defer_fn if
958 the function actually needs processing in finish_file.
959 * decl2.c (finish_file): Add check that elements in
960 deferred_fns_used are really needed there. Remove unnecessary
961 test of DECL_SAVED_TREE.
962
963 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
964
965 * Make-lang.in: No need to specify $(LIBCPP).
966
967 2004-05-23 Mark Mitchell <mark@codesourcery.com>
968
969 PR c++/15044
970 * parser.c (cp_parser_class_head): Robustify.
971
972 PR c++/15317
973 * parser.c (cp_parser_decl_specifier_seq): Correct error in
974 comment.
975 (cp_parser_constructor_declarator_p): Treat attributes
976 as decl-specifiers.
977
978 PR c++/15329
979 * typeck.c (build_unary_op): Do not attempt to resolve casts to
980 base classes in templates.
981
982 2004-05-23 Mark Mitchell <mark@codesourcery.com>
983
984 PR c++/15165
985 * pt.c (instantiate_template): Robustify.
986
987 2004-05-23 Mark Mitchell <mark@codesourcery.com>
988
989 PR c++/15025
990 * decl.c (xref_tag): Issue errors about redeclaring template
991 classes as non-template classes.
992
993 2004-05-23 Mark Mitchell <mark@codesourcery.com>
994
995 PR c++/14821
996 * name-lookup.c (supplement_binding): Allow redefinitions of
997 namespace aliases.
998
999 PR c++/14883
1000 * parser.c (cp_parser_template_argument): Robustify.
1001
1002 2004-05-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
1003
1004 * class.c (alter_access): Use %E format specifier to print an
1005 identifier node. Avoid looking at the IDENTIFIER_POINTER.
1006 (push_lang_context): Likewise.
1007 * decl.c (lookup_label): Likewise.
1008 (grokdeclarator): Likewise.
1009 * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
1010 * pt.c (do_type_instantiation): Likewise.
1011 * tree.c (handle_java_interface_attribute): Likewise.
1012 (handle_com_interface_attribute): Likewise.
1013 (handle_init_priority_attribute): Likewise.
1014
1015 2004-05-22 Mark Mitchell <mark@codesourcery.com>
1016
1017 PR c++/15285
1018 PR c++/15299
1019 * pt.c (build_non_dependent_expr): Expand the set of tree nodes
1020 recognized as overloaded functions.
1021
1022 2004-05-22 Mark Mitchell <mark@codesourcery.com>
1023
1024 PR c++/15507
1025 * class.c (layout_nonempty_base_or_field): Do not try to avoid
1026 layout conflicts for unions.
1027
1028 PR c++/15542
1029 * typeck.c (build_x_unary_op): Instantiate template class
1030 specializations before looking for "operator &".
1031
1032 PR c++/15427
1033 * typeck.c (complete_type): Layout non-dependent array types, even
1034 in templates.
1035
1036 PR c++/15287
1037 * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
1038 template.
1039
1040 2004-05-22 Roger Sayle <roger@eyesopen.com>
1041
1042 * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
1043 returning when TREE_TYPE is error_mark_node.
1044 * typeck.c (require_complete_type): Return error_mark_node if
1045 value's type is an error_mark_node.
1046
1047 2004-05-20 Andrew Pinski <pinskia@physics.uc.edu>
1048
1049 * optimize.c (calls_setjmp_r): Remove.
1050 (calls_setjmp_p): Remove.
1051 * cp-tree.c (calls_setjmp_p): Remove.
1052 * decl.c (finish_function): Do not call calls_setjmp_p.
1053
1054 2004-05-18 Zack Weinberg <zack@codesourcery.com>
1055
1056 * decl.c (cp_finish_decl): Use mark_decl_referenced.
1057 * decl2.c (maybe_make_one_only): Likewise.
1058 * method.c (use_thunk): Likewise.
1059
1060 2004-05-18 Jason Merrill <jason@redhat.com>
1061
1062 * class.c (build_base_path): Tidy a bit.
1063
1064 2004-05-14 Geoffrey Keating <geoffk@apple.com>
1065
1066 * name-lookup.c (struct scope_binding): New.
1067 (EMPTY_SCOPE_BINDING): New.
1068 (lookup_using_namespace): Take a scope_binding instead of a
1069 cxx_binding.
1070 (qualified_lookup_using_namespace): Likewise.
1071 (cxx_binding_clear): Delete.
1072 (do_nonmember_using_decl): Use a scope_binding instead of a
1073 cxx_binding.
1074 (lookup_tag): Don't call select_decl.
1075 (ambiguous_decl): Don't return anything (and change callers to match).
1076 Take a scope_binding as the second parameter.
1077 (lookup_namespace_name): Use a scope_binding instead of a
1078 cxx_binding.
1079 (unqualified_namespace_lookup): Likewise.
1080 (lookup_qualified_name): Likewise.
1081 (select_decl): Take a scope_binding instead of a cxx_binding.
1082 Use macros rather than hand-coding tests for type-ness.
1083
1084 2004-05-13 Diego Novillo <dnovillo@redhat.com>
1085
1086 * cp-gimplify.c: Rename from cp-simplify.c.
1087 * Make-lang.in, optimize.c: Update.
1088
1089 2004-05-13 Diego Novillo <dnovillo@redhat.com>
1090
1091 Merge from tree-ssa-20020619-branch. See
1092 ChangeLog.tree-ssa for details.
1093
1094 * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
1095 cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
1096 expr.c, init.c, name-lookup.h, optimize.c, parser.c,
1097 pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
1098 Merged.
1099 * cp-mudflap.c: New file.
1100 * cp-simplify.c:: New file.
1101
1102 2004-05-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1103
1104 PR c++/14389
1105 * decl2.c (check_classfn): For member templates, compare also the
1106 template parameters to match the declaration.
1107 * cp-tree.h: Adjust declaration of check_classfn.
1108 * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
1109 * friend.c (do_friend): Likewise.
1110 * pt.c (tsubst_friend_function): Likewise.
1111
1112 2004-05-01 Zack Weinberg <zack@codesourcery.com>
1113
1114 * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
1115 Instead, dig into the representation type to find the array bound.
1116
1117 2004-04-30 Jason Merrill <jason@redhat.com>
1118
1119 Refer to base members using COMPONENT_REFs where possible.
1120 * class.c (build_simple_base_path): New fn.
1121 (build_base_path): Use it for non-virtual base references.
1122 (layout_class_type): Change base fields to their real type
1123 after layout is done.
1124 * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
1125 * cp-lang.c (cxx_get_alias_set): Use it.
1126
1127 2004-04-30 Kazu Hirata <kazu@cs.umass.edu>
1128
1129 * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
1130 comment typos.
1131
1132 2004-04-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1133
1134 PR c++/15064
1135 * parser.c (cp_parser_postfix_expression): typeid operator cannot be
1136 used in integral constant expressions.
1137
1138 2004-04-22 Mark Mitchell <mark@codesourcery.com>
1139
1140 * init.c (build_aggr_init): Fix accidental use of C99 construct in
1141 previous change.
1142
1143 * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
1144 braced initializer.
1145 * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
1146 * decl.c (reshape_init): Use it.
1147 * init.c (perform_member_init): Remove redundant condition.
1148 (build_aggr_init): Adjust to handle brace-enclosed initializers
1149 correctly.
1150 (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
1151
1152 * parser.c (cp_parser_initializer_clause): Do not set
1153 TREE_HAS_CONSTRUCTOR on the initializer.
1154 * rtti.c (tinfo_base_init): Likewise.
1155 (generic_initializer): Likewise.
1156 (ptr_initializer): Likewise.
1157 (ptm_initializer): Likewise.
1158 (class_initializer): Likewise.
1159 (get_pseudo_ti_init): Likewise.
1160 * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
1161
1162 2004-04-22 Alan Modra <amodra@bigpond.net.au>
1163
1164 * name-lookup.c (anonymous_namespace_name): Make static.
1165
1166 2004-04-19 Roger Sayle <roger@eyesopen.com>
1167
1168 PR middle-end/14531
1169 * class.c (build_base_path): Call fold whilst building the NULL
1170 pointer check expression trees.
1171
1172 2004-04-15 Bryce McKinlay <mckinlay@redhat.com>
1173
1174 * init.c (build_new_1): Don't use type size argument for Java
1175 _Jv_AllocObject call.
1176
1177 2004-04-09 Danny Smith <dannysmith@users.sourceforge.net>
1178
1179 * method.c (make_alias_for_thunk): Remove preprocessor guard on
1180 declaration and definition.
1181
1182 2004-04-08 Danny Smith <dannysmith@users.sourceforge.net>
1183
1184 PR c++/14808
1185 * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
1186 than ASM_OUTPUT_DEF.
1187
1188 2004-04-08 Jakub Jelinek <jakub@redhat.com>
1189
1190 * decl2.c (mark_used): Don't segfault if cfun != NULL but
1191 current_function_decl == NULL.
1192
1193 2004-04-05 Nathan Sidwell <nathan@codesourcery.com>
1194
1195 PR c++/3518
1196 * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
1197 level.
1198
1199 2004-04-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1200
1201 * init.c (decl_constant_value): Don't look at DECL_INITIAL
1202 of PARM_DECL.
1203 * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
1204 or TREE_SIDE_EFFECTS of a type.
1205
1206 2004-04-02 Nathan Sidwell <nathan@codesourcery.com>
1207
1208 PR c++/14007
1209 * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
1210 cv-qualifier unification.
1211 * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
1212
1213 2004-04-02 Jan Hubicka <jh@suse.cz>
1214
1215 * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
1216 * cp-tree.h (cp_update_decl_after_saving): Declare.
1217 * tree.c (cp_update_decl_after_saving): Define.
1218
1219 2004-04-01 Mark Mitchell <mark@codesourcery.com>
1220
1221 PR c++/14803
1222 * typeck.c (get_delta_difference): Call fold before returning the
1223 value.
1224
1225 2004-04-01 Richard Henderson <rth@redhat.com>
1226
1227 PR c++/14804
1228 * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
1229 * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
1230
1231 2004-04-01 Mark Mitchell <mark@codesourcery.com>
1232
1233 PR c++/14810
1234 * name-lookup.c (maybe_push_cleanup_level): Robustify.
1235
1236 2004-04-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1237
1238 * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
1239
1240 2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1241
1242 * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
1243 * class.c (check_bitfield_decl): Likewise.
1244 * cvt.c (type_promotes_to): Likewise.
1245 * decl.c (finish_enum): Likewise.
1246 * mangle.c (write_builtin_type): Likewise.
1247 * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
1248 * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
1249 (build_binary_op): Likewise.
1250
1251 2004-03-31 Jan Hubicka <jh@suse.cz>
1252
1253 * tree.h (optimize_function): Kill prototype.
1254 * optimize.c (dump_function, optimize_function, dump_finction): Kill.
1255 * semantics.c (expand_body): Kill.
1256
1257 2004-03-30 Mark Mitchell <mark@codesourcery.com>
1258
1259 PR c++/14724
1260 * decl.c (start_decl_1): Do not decide whether or not to create a
1261 new cleanup level until after the type has been completed.
1262
1263 PR c++/14763
1264 * pt.c (tsubst_default_argument): Clear current_function_decl.
1265
1266 2004-03-30 Zack Weinberg <zack@codesourcery.com>
1267
1268 * name-lookup.c, parser.c: Use new shorter form of GTY markers.
1269
1270 2004-03-29 Zack Weinberg <zack@codesourcery.com>
1271
1272 * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
1273 is null, just print the literal name and return.
1274
1275 2004-03-25 Kazu Hirata <kazu@cs.umass.edu>
1276
1277 * cxx-pretty-print.c: Fix comment typos.
1278
1279 2004-03-24 Kazu Hirata <kazu@cs.umass.edu>
1280
1281 * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
1282 Update copyright.
1283
1284 2004-03-23 Ziemowit Laski <zlaski@apple.com>
1285
1286 * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
1287 * mangle.c (write_type): Add call to 'mangle_fundamental_type'
1288 target hook.
1289
1290 2004-03-23 Zack Weinberg <zack@codesourcery.com>
1291
1292 PR 12267, 12391, 12560, 13129, 14114, 14133
1293 * cp-lang.c (c_reset_state): Delete.
1294 (push_file_scope, pop_file_scope): New stubs.
1295 * parser.c (c_parse_file): Call sorry() here if called more than once.
1296
1297 2004-03-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1298
1299 * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
1300 for INTEGER_CST.
1301
1302 2004-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1303
1304 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
1305
1306 2004-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
1307
1308 * error.c (enum pad): Remove.
1309 (dump_qualifiers): Likewise.
1310 (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
1311 (dump_aggr_type): Likewise.
1312 (dump_type_suffix): Likewise.
1313 (dump_simple_decl): Likewise.
1314 (dump_function_decl): Likewise.
1315 (cv_to_string): Likewise.
1316 (dump_type_prefix): Likewise. Adjust return void.
1317 * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
1318 cxx_pretty_print.h.
1319 (pp_cxx_template_keyword_if_needed): Document.
1320 (pp_cxx_qualified_id): Document case FUNCTION_DECL. Tidy.
1321 (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
1322 MUST_NOT_THROW_EXPR.
1323
1324 2004-03-21 Mark Mitchell <mark@codesourcery.com>
1325
1326 PR c++/14616
1327 * decl.c (cp_finish_decl): Compute the size of arrays declared in
1328 templates, if their type is non-dependent.
1329
1330 2004-03-19 Mark Mitchell <mark@codesourcery.com>
1331
1332 * call.c (build_op_delete_call): Do not forget the placement
1333 arguments when iterating through mutiple delete operators.
1334
1335 * cp-tree.h (svaed_scope): Remove last_parms.
1336 (NEW_DELETE_OPNAME_P): New macro.
1337 (last_function_parms): Remove.
1338 (do_friend): Adjust prototype.
1339 * decl.c (grokparms): Return the PARM_DECLs directly, rather than
1340 using last_function_parms.
1341 (grokfndecl): Take the PARM_DECLs as an argument, rather than
1342 using last_function_parms.
1343 (grokdeclarator): Adjust accordingly. Do not form METHOD_TYPEs
1344 for class-specific operator new and operator delete.
1345 (grok_op_properties): Do not look for allocation functions with
1346 METHOD_TYPEs.
1347 (start_function): Use DECL_ARGUMENTS instead of
1348 last_function_parms.
1349 * decl.h (last_function_parms): Do not declare.
1350 * decl2.c (grokclassfn): Do not use last_function_parms.
1351 * friend.c (do_friend): Remove parmdecls parameter.
1352 * name-lookup.c (push_to_top_level): Do not save last_function_parms.
1353 (pop_from_top_level): Do not restore it.
1354 * pt.c (check_explicit_specialization): Do not adjust
1355 last_function_parms.
1356
1357 * name-lookup.c (do_local_using_decl): Create a local binding for
1358 types brought in via using declarations.
1359
1360 * name-lookup.c (lookup_arg_dependent): Handle block-scope
1361 function declarations correctly.
1362
1363 * semantics.c (finish_id_expression): Correct handling of
1364 conversion operators to dependent types.
1365
1366 * typeck.c (lookup_destructor): Allow the use of destructors from
1367 base classes.
1368
1369 2004-03-19 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1370
1371 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
1372 TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
1373 * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
1374 the field is named TEMPLATE_TYPE_PARM_INDEX.
1375
1376 2004-03-19 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1377
1378 PR c++/14545
1379 * parser.c (cp_parser_functional_cast): A cast to anything
1380 but integral or enumaration type is not an integral constant
1381 expression.
1382 * pt.c (value_dependent_expression_p): Handle cast expressions
1383 without operands (such as "int()").
1384
1385 2004-03-18 Mark Mitchell <mark@codesourcery.com>
1386
1387 * semantics.c (finish_pseudo_destructor_expr): Allow differing
1388 cv-qualification between the type named by the
1389 pseudo-destructor-name and the object-type.
1390
1391 * search.c (accessible_base_p): Handle non-proper bases.
1392
1393 * name-lookup.c (do_nonmember_using_decl): If a using declaration
1394 refers to a single overloaded function, set the type of the
1395 function.
1396 * tree.c (lvalue_type): Simplify.
1397 * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
1398 unknown type.
1399 (build_unary_op): Handle OVERLOADs with known types.
1400
1401 * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
1402 function templates.
1403
1404 * parser.c (cp_parser_postfix_expression): Handle the use of
1405 "typename" in non-dependent contexts. Convert appropriately when
1406 when using a qualified name after "->" or ".".
1407
1408 * call.c (conditional_conversion): Honor the requirement that some
1409 conversions refer to the original object.
1410
1411 2004-03-18 Mark Mitchell <mark@codesourcery.com>
1412
1413 * call.c (build_conditional_expr): Do not call force_rvalue for
1414 operands of void_type when the conditional expression itself has
1415 void type.
1416 * name-lookup.c (pushdecl): Don't consider a declaration of a
1417 function named "main" to be an overload of a type named "main".
1418 * parser.c (cp_parser_template_name): Perform name lookup when the
1419 template name is proceeded by "template" if the qualifying scope
1420 is non-dependent.
1421 * typeck.c (composite_pointer_type_r): Correctly handle
1422 pointer-to-member types.
1423 (build_const_cast): Likewise.
1424
1425 2004-03-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1426
1427 * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
1428 * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
1429 (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
1430 (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
1431 (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
1432 (TYPEOF_TYPE_EXPR): New macro.
1433 * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
1434 * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
1435 * pt.c (tsubst): Likewise.
1436 * semantics.c (finish_typeof): Likewise.
1437 * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
1438 and TEMPLATE_TYPE_PARM.
1439 * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
1440 (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
1441
1442 2004-03-16 Mark Mitchell <mark@codesourcery.com>
1443
1444 PR c++/14586
1445 * cp-tree.h (build_new_op): Change prototype.
1446 (build_x_binary_op): Likewise.
1447 * call.c (build_new_op): Add overloaded_p parameter.
1448 * decl2.c (grok_array_decl): Adjust call to build_new_op.
1449 * parser.c (cp_parser_binary_expression): Note that uses of
1450 overloaded operators prevents an expression from being considered
1451 an integral constant.
1452 * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
1453 build_x_binary_op.
1454 * semantics.c (finish_call_expr): Likewise.
1455 * typeck.c (rationalize_conditional_expr): Likewise.
1456 (build_x_indirect_ref): Likewise.
1457 (build_x_binary_op): Likewise.
1458 (build_x_unary_op): Likewise.
1459 (build_x_compound_expr): Likewise.
1460 (build_modify_expr): Likewise.
1461 * typeck2.c (build_x_arrow): Likewise.
1462
1463 2004-03-15 Kazu Hirata <kazu@cs.umass.edu>
1464
1465 * cp-lang.c, ptree.c: Update copyright.
1466
1467 2004-03-13 Mark Mitchell <mark@codesourcery.com>
1468
1469 PR c++/14550
1470 * parser.c (cp_parser_non_integral_constant_expression): Encode
1471 more of the idiom that surrounded calls to this function within
1472 the function itself
1473 (cp_parser_primary_expression): Adjust accordingly.
1474 (cp_parser_postfix_expression): Likewise.
1475 (cp_parser_unary_expression): Likewise.
1476 (cp_parser_cast_expression): Likewise.
1477 (cp_parser_assignment_expression): Likewise.
1478 (cp_parser_expression): Likewise.
1479 (cp_parser_new_expression): Note that new-expressions are not
1480 allowed in integral constant expressions.
1481 (cp_parser_delete_expression): Likewise.
1482
1483 2004-03-12 Matt Austern <austern@apple.com>
1484
1485 * decl2.c (maybe_make_one_only): Look at
1486 TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
1487 to make an explicit instantiation weak.
1488 * method.c (use_thunk): Make sure we call comdat_linkage
1489 when appropriate.
1490 * pt.c (do_type_instantiation): On systems where weak symbols
1491 don't go in a static archive's TOC, explicit instantiation of a
1492 class must imply *explicit* instantiation of its memeber.
1493
1494 2004-03-11 Kazu Hirata <kazu@cs.umass.edu>
1495
1496 * call.c, cp-tree.h, pt.c: Fix comment typos.
1497
1498 2004-03-10 Mark Mitchell <mark@codesourcery.com>
1499
1500 PR c++/14510
1501 * decl.c (xref_tag): Disregard non-type declarations when
1502 looking up a tagged type.
1503
1504 2004-03-09 Nathan Sidwell <nathan@codesourcery.com>
1505
1506 PR c++/14397
1507 * call.c (convert_like_real): Build a const qualified temporary,
1508 when testing ctor access.
1509
1510 2004-03-09 Mark Mitchell <mark@codesourcery.com>
1511
1512 * call.c (initialize_reference): Fix typo.
1513
1514 2004-03-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1515
1516 PR c++/14409
1517 * pt.c (determine_specialization): For member templates, match also
1518 constness.
1519
1520 PR c++/14448
1521 * parser.c (cp_parser_initializer_clause): Fold initializer if it is
1522 non-dependent.
1523 * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
1524
1525 2004-03-09 Mark Mitchell <mark@codesourcery.com>
1526
1527 PR c++/14230
1528 * call.c (initialize_reference): Handle initializers that are
1529 class-member access expressions applies to rvalues.
1530
1531 2004-03-09 Mark Mitchell <mark@codesourcery.com>
1532
1533 PR c++/14432
1534 * name-lookup.c (supplement_binding): Ignore functions that are
1535 marked DECL_ANTICIPATED.
1536
1537 2004-03-08 Mark Mitchell <mark@codesourcery.com>
1538
1539 PR c++/14401
1540 * class.c (check_field_decls): Complain about non-static data
1541 members of reference type in unions. Propagate
1542 CLASSTYPE_REF_FIELDS_NEED_INIT and
1543 CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
1544 data members.
1545 * init.c (perform_member_init): Complain about mbmers with const
1546 type that are not explicitly initialized.
1547
1548 2004-03-08 Mark Mitchell <mark@codesourcery.com>
1549
1550 * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
1551 * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
1552 (lang_identifier): Remove implicit_decl and error_locus.
1553 (IDENTIFIER_IMPLICIT_DECL): Remove.
1554 (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
1555 (IDENTIFIER_ERROR_LOCUS): Likewise.
1556 (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
1557 (TYPE_ASSEMBLER_NAME_STRING): Likewise.
1558 (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
1559 (implicitly_declare): Remove.
1560 * decl.c (warn_extern_redeclared_static): Remove check of
1561 IDENTIFIER_IMPLICIT_DECL.
1562 (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
1563 (implicitly_declare): Remove.
1564 (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
1565 (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
1566 (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
1567 * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
1568 in the innermost scope, rather than at namespace scope.
1569 * name-lookup.c (push_local_binding): Give it external linkage.
1570 (pushdecl): Remove dead code.
1571 * name-lookup.h (push_local_binding): Declare it.
1572 * ptree.c (cxx_print_identifier): Don't print
1573 IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
1574 * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
1575 not IDENTIFIER_ERROR_LOCUS.
1576 * typeck.c (build_function_call): Remove dead code.
1577
1578 2004-03-08 Jason Merrill <jason@redhat.com>
1579
1580 PR c++/13170
1581 * decl.c (xref_tag): Remove attribute handling.
1582 * cp-tree.h: Adjust prototype.
1583 * decl.c, parser.c, rtti.c: Adjust callers.
1584 * parser.c (cp_parser_class_head): Pass back attributes in the
1585 class head.
1586 (cp_parser_class_specifier): Adjust.
1587
1588 2004-03-08 Matt Austern <austern@apple.com>
1589
1590 PR debug/14079
1591 * name-lookup.c (add_decl_to_level): Add extern variables, as well
1592 as static, to static_decls array.
1593
1594 2004-03-05 Jason Merrill <jason@redhat.com>
1595
1596 * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
1597
1598 2004-03-04 Geoffrey Keating <geoffk@apple.com>
1599
1600 * decl.c (grokfndecl): Update old incorrect comment.
1601 (grokvardecl): Diagnose C++ variables of type with no linkage.
1602
1603 2004-03-01 Mark Mitchell <mark@codesourcery.com>
1604
1605 PR c++/14369
1606 * pt.c (build_non_dependent_expr): Do not create a
1607 NON_DEPENDENT_EXPR for a THROW_EXPR.
1608
1609 2004-03-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
1610
1611 PR c++/14369
1612 * error.c (dump_expr): Handle THROW_EXPR.
1613
1614 2004-03-01 Mark Mitchell <mark@codesourcery.com>
1615
1616 PR c++/14360
1617 * parser.c (cp_parser_postfix_expression): Do not perform Koenig
1618 lookup if ordinary name-lookup finds a non-function.
1619 * pt.c (tsubst_copy_and_build): Likewise.
1620
1621 PR c++/14361
1622 * parser.c (cp_parser_late_parsing_default_args): Check that there
1623 are no extra tokens after the end of the default-argument
1624 expression.
1625
1626 2004-03-01 Mark Mitchell <mark@codesourcery.com>
1627
1628 PR c++/14324
1629 * lex.c (retrofit_lang_decl): Treat entities with no linkage as
1630 having C++ linkage for name-mangling purposes.
1631
1632 PR c++/14260
1633 * parser.c (cp_parser_direct_declarator): Recognize constructor
1634 declarators that use a template-id to name the class being
1635 constructed.
1636
1637 PR c++/14337
1638 * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
1639 (tsubst_expr): Do not call tsubst_copy, even when
1640 processing_template_decl.
1641
1642 2004-03-01 Jeff Law <law@redhat.com>
1643
1644 * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
1645 the proper type.
1646
1647 2004-02-29 Mark Mitchell <mark@codesourcery.com>
1648
1649 PR c++/14138
1650 * name-lookup.h (push_scope): Change prototype.
1651 * name-lookup.c (push_scope): Do not reenter the current class
1652 scope.
1653 * decl.c (grokfndecl): Check return code from push_scope before
1654 calling pop_scope.
1655 * decl2.c (check_classfn): Likewise.
1656 * parser.c (cp_parser_conversion_function_id): Likewise.
1657 (cp_parser_init_declarator): Likewise.
1658 (cp_parser_direct_declarator): Likewise.
1659 (cp_parser_class_specifier): Likewise.
1660 (cp_parser_class_head): Likewise.
1661 (cp_parser_lookup_name): Likewise.
1662 (cp_parser_constructor_declarator_p): Likewise.
1663 * pt.c (instantiate_class_template): Likewise.
1664 (resolve_typename_type): Likewise.
1665
1666 2004-02-29 Mark Mitchell <mark@codesourcery.com>
1667
1668 PR c++/14267
1669 * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
1670 extension.
1671
1672 PR debug/12103
1673 * class.c (update_vtable_entry_for_fn): Do not go through
1674 covariance machinery if the type returned by an overrider is the
1675 same as the original.
1676
1677 2004-02-29 Kazu Hirata <kazu@cs.umass.edu>
1678
1679 * call.c: Fix a comment typo.
1680
1681 2004-02-27 Ziemowit Laski <zlaski@apple.com>
1682
1683 * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
1684
1685 2004-02-26 Mark Mitchell <mark@codesourcery.com>
1686
1687 PR c++/14278
1688 * parser.c (cp_parser_parameter_declaration_list): Commit
1689 to fewer tentative parses.
1690
1691 2004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1692
1693 PR c++/14284
1694 * pt.c (dependent_type_p_r): A template template parameter is a
1695 dependent type.
1696
1697 2004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1698
1699 PR c++/14246
1700 * mangle.c (write_template_arg_literal): Don't rely on identity for
1701 boolean constants.
1702
1703 2004-02-24 Jason Merrill <jason@redhat.com>
1704
1705 * tree.c (build_exception_variant): Use check_qualified_type.
1706
1707 2004-02-23 Zack Weinberg <zack@codesourcery.com>
1708 Kazu Hirata <kazu@cs.umass.edu>
1709
1710 * decl.c (cxx_init_decl_processing): Don't check
1711 flag_writable_strings.
1712
1713 2004-02-23 Andrew Pinski <pinskia@physics.uc.edu>
1714
1715 PR c++/14156
1716 * typeck.c (maybe_warn_about_returning_address_of_location):
1717 Change check for VAR_DECL to use DECL_P instead.
1718
1719 2004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1720
1721 PR c++/14250
1722 * cvt.c (build_expr_type_conversion): Type must be complete before
1723 looking up for conversions.
1724
1725 2004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1726
1727 PR c++/14143
1728 * name-lookup.c (arg_assoc_class): Don't look into template
1729 arguments if it is not a primary template.
1730
1731 2004-02-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1732
1733 PR c++/12007
1734 * method.c (use_thunk): Always clone function argument tree.
1735
1736 2004-02-20 Mark Mitchell <mark@codesourcery.com>
1737
1738 PR c++/14199
1739 * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
1740
1741 PR c++/14173
1742 * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
1743 for all type variants.
1744
1745 2004-02-19 Mark Mitchell <mark@codesourcery.com>
1746
1747 PR c++/13927
1748 * decl.c (duplicate_decls): Return error_mark_node for invalid
1749 redeclarations.
1750 * name-lookup.c (push_namespace): Ignore the return value from
1751 pushdecl.
1752 * pt.c (push_template_decl_real): Robustify.
1753
1754 PR c++/14186
1755 * name-lookup.c (push_class_level_binding): Do not complain about
1756 adding a binding for a member whose name is the same as the
1757 enclosing class if the member is located in a base class of the
1758 current class.
1759
1760 2004-02-19 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1761
1762 PR c++/14181
1763 * parser.c (cp_parser_new_expression): Parse an ill-formed
1764 direct-new-declarator after a parenthesized type-id to emit good
1765 diagnostic.
1766
1767 2004-02-18 Kazu Hirata <kazu@cs.umass.edu>
1768
1769 * cp-tree.def, cvt.c: Update copyright.
1770
1771 2004-02-17 Mark Mitchell <mark@codesourcery.com>
1772
1773 PR c++/11326
1774 * cp-tree.h (abi_version_at_least): Remove.
1775 * mangle.c: Include flags.h.
1776
1777 2004-02-15 Mark Mitchell <mark@codesourcery.com>
1778
1779 PR c++/13971
1780 * call.c (build_conditional_expr): Handle conversions between
1781 class types which result in differently cv-qualified type
1782 variants.
1783
1784 PR c++/14086
1785 * class.c (delete_duplicate_fields_1): Remove.
1786 (delete_duplicate_fields): Likewise.
1787 (finish_struct_anon): Remove check for members with the same name
1788 as their enclosing class.
1789 (check_field_decls): Do not call duplicate_fields.
1790 * decl.c (grokdeclarator): Remove check for static data members
1791 with the same name as their enclosing class.
1792 * name-lookup.c (push_class_level_binding): Check for members with
1793 the same name as their enclosing class.
1794
1795 2004-02-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
1796
1797 PR c++/14085
1798 * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
1799
1800 2004-02-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1801
1802 PR c++/13635
1803 * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
1804 has full set of arguments.
1805
1806 2004-02-13 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1807
1808 PR c++/13927
1809 * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
1810
1811 2004-02-13 Mark Mitchell <mark@codesourcery.com>
1812
1813 PR c++/14122
1814 * cp-tree.h (delete_sanity): Change prototype.
1815 * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
1816 Remove dead code. Adjust code to warn about deleting an array.
1817 * typekc.c (decay_conversion): Use build_address and build_nop.
1818
1819 PR c++/14108
1820 * search.c (accessible_p): Do not check access in thunks.
1821
1822 PR c++/14083
1823 * call.c (build_conditional_expr): Call force_rvalue on the
1824 non-void operand in the case that one result is a throw-expression
1825 and the other is not.
1826
1827 2004-02-13 Ian Lance Taylor <ian@wasabisystems.com>
1828
1829 PR c++/9851
1830 * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
1831 the type name and look ahead for ::~, and bail out early with a
1832 better error message if the parse is going to fail.
1833
1834 2004-02-12 Mark Mitchell <mark@codesourcery.com>
1835
1836 * call.c (conversion_kind): New type.
1837 (conversion_rank): Likewise.
1838 (conversion): Likewise.
1839 (CONVERSION_RANK): New macro.
1840 (conversion_obstack): New variable.
1841 (obstack_initialized): Likewise.
1842 (z_candidate): Change type of convs and second_conv.
1843 (candidate_warning): New type.
1844 (IDENTITY_RANK): Remove.
1845 (EXACT_RANK): Likewise.
1846 (PROMO_RANK): Likewise.
1847 (STD_RANK): Likewise.
1848 (PBOOL_RANK): Likewise.
1849 (USER_RANK): Likewise.
1850 (ELLIPSIS_RANK): Likewise.
1851 (BAD_RANK): Likewise.
1852 (ICS_RANK): Likewise.
1853 (ICS_STD_RANK): Likewise.
1854 (ICS_USER_FLAG): Likewise.
1855 (ICS_ELLIPSIS_FLAG): Likewise.
1856 (ICS_THIS_FLAG): Likewise.
1857 (ICS_BAD_FLAG): Likewise.
1858 (NEED_TEMPORARY_P): Likewise.
1859 (CHECK_COPY_CONSTRUCTOR_P): Likewise.
1860 (USER_CONV_CAND): Likewise.
1861 (USER_CONV_FN): Likewise.
1862 (conversion_obstack_alloc): New function.
1863 (alloc_conversion): Likewise.
1864 (validate_conversion_obstack): Likewise.
1865 (alloc_conversions): Likewise.
1866 (build_conv): Adjust to deal with new conversion data structures.
1867 (build_identity_conv): New function.
1868 (build_ambiguous_conv): Likewise.
1869 (standard_conversion): Adjust to deal with new conversion data
1870 structures.
1871 (convert_class_to_reference): Likewise.
1872 (direct_reference_binding): Likewise.
1873 (reference_binding): Likewise.
1874 (implicit_conversion): Likewise.
1875 (add_candidate): Likewise.
1876 (add_function_candidate): Likewise.
1877 (add_conv_candidate): Likewise.
1878 (build_builtin_candidate): Likewise.
1879 (print_z_candidate): Likewise.
1880 (merge_conversion_sequences): Likewise.
1881 (build_user_type_conversion_1): Likewise.
1882 (build_user_type_conversion): Likewise.
1883 (build_new_function_call): Likewise.
1884 (build_object_call): Likewise.
1885 (conditional_conversion): Likewise.
1886 (build_conditional_expr): Likewise.
1887 (build_new_op): Likewise.
1888 (build_op_delete_call): Likewise.
1889 (convert_like_real): Likewise.
1890 (build_over_call): Likewise.
1891 (build_new_method_call): Likewise.
1892 (is_subseq): Likewise.
1893 (maybe_handle_implicit_object): Likewise.
1894 (maybe_handle_ref_bind): Likewise.
1895 (compare_ics): Likewise.
1896 (source_type): Likewise.
1897 (add_warning): Likewise.
1898 (joust): Likewise.
1899 (can_convert_arg): Likewise.
1900 (can_convert_arg_bad): Likewise.
1901 (perform_implicit_conversion): Likewise.
1902 (perform_direct_initialization_if_possible): Likewise.
1903 (initialize_reference): Likewise.
1904 * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
1905 * cp-tree.def (WRAPPER): Likewise.
1906 (IDENTITY_CONV): Remove.
1907 (LVALUE_CONV): Likewise.
1908 (QUAL_CONV): Likewise.
1909 (STD_CONV): Likewise.
1910 (PTR_CONV): Likewise.
1911 (PMEM_CONV): Likewise.
1912 (BASE_CONV): Likewise.
1913 (REF_BIND): Likewise.
1914 (USER_CONV): Likewise.
1915 (AMBIG_CONV): Likewise.
1916 (RVALUE_CONV): Likewise.
1917 * cp-tree.h (tree_wrapper): Remove.
1918 (WRAPPER_ZC): Remove.
1919 (lang_tree_node): Remove wrapper.
1920 (LOOKUP_SPECULATIVELY): Remove.
1921 (build_op_delete_call): Adjust prototype.
1922 (validate_conversion_obstack): Declare.
1923 (build_zc_wrapper): Remove.
1924 * cvt.c (convert_to_reference): Remove dead code.
1925 (ocp_convert): Likewise.
1926 * decl.c (redeclaration_error_message): Correct handling of
1927 templates.
1928 (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
1929 (cp_tree_node_structure): Remove WRAPPER case.
1930 * decl2.c (finish_file): Call validate_conversion_obstack.
1931 * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
1932 (build_op_delete_call): Likewise.
1933 (build_x_delete): Likewise.
1934 (build_delete): Adjust call to build_op_delete_call.
1935 * pt.c (tsubst_friend_declaration): Adjust code to determine
1936 whether or not a friend template is a definition.
1937 (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
1938 * tree.c (build_zc_wrapper): Remove.
1939
1940 2004-02-12 Zack Weinberg <zack@codesourcery.com>
1941
1942 * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
1943 * cp-tree.h: Don't declare cxx_builtin_type_decls.
1944 * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
1945 (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
1946
1947 2004-02-10 Mark Mitchell <mark@codesourcery.com>
1948
1949 * typeck.c (lookup_destructor): Fix typo in error message.
1950
1951 2004-02-09 Kazu Hirata <kazu@cs.umass.edu>
1952
1953 * call.c, parser.c, tree.c: Fix comment typos.
1954
1955 2004-02-07 Zack Weinberg <zack@codesourcery.com>
1956
1957 Bug 13856
1958 * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
1959 * decl.c (duplicate_decls, start_function): Likewise.
1960
1961 2004-02-07 Zack Weinberg <zack@codesourcery.com>
1962
1963 * name-lookup.c (pushdecl): Issue shadow warnings directly.
1964 * parser.c (free_parser_stacks): Delete.
1965
1966 2004-02-07 Kazu Hirata <kazu@cs.umass.edu>
1967
1968 * rtti.c: Update copyright.
1969
1970 2004-02-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1971
1972 PR c++/14033
1973 * decl.c (require_complete_types_for_parms): Do not insert
1974 error_mark_node in the parameter list.
1975
1976 2004-02-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1977
1978 PR c++/14028
1979 * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
1980 error when terminator can not be found.
1981
1982 2004-02-05 Kelley Cook <kcook@gcc.gnu.org>
1983
1984 Make-lang.in (po-generated): Delete.
1985
1986 2004-02-05 Kazu Hirata <kazu@cs.umass.edu>
1987
1988 * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
1989 targetm.calls.promote_prototypes.
1990
1991 2004-02-05 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1992
1993 PR middle-end/13750
1994 Revert:
1995 2004-01-15 Geoffrey Keating <geoffk@apple.com>
1996 PR pch/13361
1997 * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
1998 (handle_pragma_implementation): Likewise.
1999
2000 2004-02-05 Mark Mitchell <mark@codesourcery.com>
2001
2002 PR c++/13714
2003 * typeck.c (lookup_destructor): Tweak error message.
2004
2005 2004-02-05 Jan Hubicka <jh@suse.cz>
2006
2007 * tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat
2008 functions.
2009
2010 2004-02-05 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2011
2012 PR c++/14008
2013 * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
2014 code, only emits the diagnostic now. Added lookup of the identifier
2015 and support for qualified ids.
2016 (cp_parser_parse_and_diagnose_invalid_type_name): New function.
2017 Parse an (invalid) type name as id-expression within a declarator.
2018 (cp_parser_simple_declaration): Use it.
2019 (cp_parser_member_declaration): Likewise.
2020 (cp_parser_make_typename_type): New function. Handle errors through
2021 cp_parser_diagnose_invalid_typename.
2022 (cp_parser_elaborated_type_specifier): Use it.
2023
2024 2004-02-04 Mark Mitchell <mark@codesourcery.com>
2025
2026 PR c++/13932
2027 * call.c (convert_like_real): Use "converting" rather than
2028 "argument" as the descriptive keyword to
2029 dubious_conversion_warnings.
2030 * typeck.c (convert_for_assignment): Do not call
2031 dubious_conversion_warnings.
2032
2033 2004-02-04 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2034
2035 PR c++/13086
2036 * init.c (build_delete): Emit a more informative error message in
2037 case of an incomplete type, and on the correct source line.
2038
2039 2004-02-04 Kazu Hirata <kazu@cs.umass.edu>
2040
2041 * error.c, search.c: Update copyright.
2042
2043 2004-02-04 Mark Mitchell <mark@codesourcery.com>
2044
2045 PR c++/9941
2046 * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
2047 linkage for the typeinfo name string.
2048
2049 2004-02-04 Mark Mitchell <mark@codesourcery.com>
2050
2051 PR c++/13969
2052 * cp-tree.h (fold_non_dependent_expr): New function.
2053 * parser.c (cp_parser_fold_non_dependent_expr): Remove.
2054 (cp_parser_template_argument): Use fold_non_dependent_expr.
2055 (cp_parser_direct_declarator): Likewise.
2056 * pt.c (fold_non_dependent_expr): New function.
2057 (convert_nontype_argument): Use it.
2058 (tsubst_qualified_id): Simplify.
2059 (tsubst_copy_and_build): Likewise.
2060
2061 2004-02-04 Mark Mitchell <mark@codesourcery.com>
2062
2063 * decl.c (cxx_push_function_context): Do not set
2064 current_function_is_thunk.
2065 * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
2066 actual function.
2067
2068 2004-02-04 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2069
2070 PR c++/13997
2071 * pt.c (more_specialized_class): Increase processing_template_decl
2072 while partial ordering.
2073
2074 2004-02-03 Mark Mitchell <mark@codesourcery.com>
2075
2076 PR c++/13925
2077 * decl.c (start_function): Do not call pushdecl for any
2078 instantiation or specialization of a primary template.
2079
2080 2004-02-03 Mark Mitchell <mark@codesourcery.com>
2081
2082 PR c++/13950
2083 * parser.c (cp_parser_class_name): Robustify.
2084
2085 PR c++/13970
2086 * parser.c (cp_parser_cache_group): Do not consume the EOF token.
2087
2088 PR c++/14002
2089 * semantics.c (finish_id_expression): Do not return an
2090 IDENTIFIER_NODE when lookup finds a PARM_DECL.
2091
2092 2004-02-03 Mark Mitchell <mark@codesourcery.com>
2093
2094 PR c++/13978
2095 * pt.c (build_non_dependent_expr): Do not build
2096 NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
2097
2098 PR c++/13968
2099 * semantics.c (finish_id_expression): Do not return an
2100 IDENTIFIER_NODE when lookup finds a VAR_DECL.
2101
2102 PR c++/13975
2103 * parser.c (cp_parser_simple_declaration): When skipping to the
2104 end of the statement swallow the terminating semicolon.
2105
2106 2004-02-02 Mark Mitchell <mark@codesourcery.com>
2107
2108 PR c++/13113
2109 * init.c (build_offset_ref): Improve error recovery for invalid
2110 uses of non-static member functions.
2111
2112 PR c++/13854
2113 * cp-tree.h (cp_build_type_attribute_variant): New function.
2114 * class.c (build_clone): Use cp_build_type_attribute_variant.
2115 * decl.c (duplicate_decls): Likewise.
2116 * pt.c (copy_default_args_to_explicit_spec): Likewise.
2117 (tsubst_function_type): Likewise.
2118 * tree.c (build_exception_variant): Check attributes before
2119 concluding that two types are the same.
2120 (cp_build_type-attribute_variant): New method.
2121 * typeck.c (merge_types): Use cp_build_type_attribute_variant.
2122
2123 PR c++/13907
2124 * call.c (convert_class_to_reference): Keep better track of
2125 pedantically invalid user-defined conversions.
2126
2127 2004-02-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2128
2129 PR c++/13957
2130 * pt.c (tsubst_qualified_id): Improved error message when a type
2131 is expected but not found.
2132
2133 2004-01-31 Kazu Hirata <kazu@cs.umass.edu>
2134
2135 * class.c: Fix comment typos.
2136 * decl.c: Likewise.
2137 * error.c: Likewise.
2138 * parser.c: Likewise.
2139 * pt.c: Likewise.
2140 * search.c: Likewise.
2141 * typeck.c: Likewise.
2142
2143 2004-01-30 Richard Henderson <rth@redhat.com>
2144
2145 PR c++/13693
2146 * method.c (use_thunk): Don't force_target_expr for void thunks.
2147 * tree.c (build_target_expr_with_type): Assert non-void type.
2148 (force_target_expr): Likewise.
2149
2150 2004-01-30 Michael Matz <matz@suse.de>
2151
2152 * parser.c (cp_parser_labeled_statement): Accept case ranges.
2153
2154 2004-01-30 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2155
2156 DR206
2157 PR c++/13813
2158 * decl.c (grokdeclarator): Check immediatly type completeness for
2159 non-dependent types.
2160
2161 2004-01-30 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2162
2163 PR c++/13683
2164 * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
2165 a sizeof expression.block
2166
2167 2004-01-29 Mark Mitchell <mark@codesourcery.com>
2168
2169 PR c++/13883
2170 * mangle.c (write_encoding): Correct encoding of member template
2171 constructors.
2172
2173 2004-01-28 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2174
2175 * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
2176 template name as it was `<::' (digraph typo).
2177 (cp_parser_nth_token_starts_template_argument_list_p): New function.
2178 (cp_parser_id_expression): Use it.
2179 (cp_parser_nested_name_specifier_opt): Likewise.
2180 (cp_parser_template_name): Likewise.
2181 (cp_parser_class_name): Likewise.
2182 (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
2183
2184 2004-01-28 Mark Mitchell <mark@codesourcery.com>
2185
2186 PR c++/13791
2187 * typeck.c (merge_types): Do not merge attributes into
2188 TYPENAME_TYPEs.
2189
2190 PR c++/13736
2191 * parser.c (cp_parser_direct_declarator): Do not prevent
2192 backtracking inside a parenthesized declarator.
2193 (cp_parser_parameter_declaration): Fix typo in comment.
2194
2195 2004-01-28 Jan Hubicka <jh@suse.cz>
2196
2197 * semantics.c (expand_body) Do emit_associated_thunks before
2198 expansion.
2199
2200 2004-01-27 Devang Patel <dpatel@apple.com>
2201
2202 * name-lookup.c: Include "debug.h"
2203 (do_namespace_alias): Invoke debug_hooks to emit debug info
2204 for namespace alias.
2205 (do_local_using_decl): Invoke debug_hooks to emit debug info
2206 for using decl.
2207 (do_class_using_decl): Same.
2208 (do_toplevel_using_decl): Same.
2209 (do_using_directive): Same.
2210 (cp_emit_debug_info_for_using): New function.
2211 * Make-lang.in (cp/parser.o): Depend on debug.h
2212 (cp/name-lookup.o): Same.
2213
2214 2004-01-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2215
2216 * cp-tree.h (language_function, lang_type_header): Use
2217 BOOL_BITFIELD.
2218 * name-lookup.h (cp_binding_level): Likewise.
2219
2220 2004-01-26 Mark Mitchell <mark@codesourcery.com>
2221
2222 PR c++/13663
2223 * semantics.c (finish_for_expr): Check for unresolved overloaded
2224 functions.
2225
2226 * class.c (add_method): Just check processing_template_decl to
2227 determine whether or not we are within a template.
2228 * decl2.c (maybe_retrofit_in_chrg): Likewise.
2229 * init.c (decl_constant_value): Check the type of the declaration,
2230 not TREE_READONLY.
2231 * name-lookup.c (maybe_push_to_top_level): Rename to ...
2232 (push_to_top_level): ... this.
2233 * name-lookup.h (maybe_push_to_top_level): Do not declare it.
2234 * pt.c (push_template_decl_real): Reorder condition for speed.
2235 (convert_template_argument): Use dependency-checking functions in
2236 place of uses_template_parms.
2237 (lookup_template_class): Avoid calling uses_template_parms more
2238 than once.
2239 (uses_template_parms): Reimplement, using dependency-checking
2240 functions.
2241 (instantiate_class_template): Use push_to_top_level, not
2242 maybe_push_to_top_level.
2243 (type_unification_real): Simplify.
2244 (type_dependent_expression_p): Handle OFFSET_REFs and
2245 TEMPLATE_DECLs.
2246 (any_dependent_template_arguments_p): Handle multiple levels of
2247 template argument.
2248 * semantics.c (expand_or_defer_fn): Do not check
2249 uses_template_parms for template instantiations.
2250 * typeck.c (comptypes): Avoid calling cp_type_quals.
2251
2252 2004-01-25 Mark Mitchell <mark@codesourcery.com>
2253
2254 PR c++/13833
2255 * call.c (build_over_call): Do not convert arguments when
2256 processing a template.
2257 * pt.c (build_non_dependent_expr): Do not build a
2258 NON_DEPENDENT_EXPR for arithmetic constants.
2259
2260 2004-01-25 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2261
2262 PR c++/13810
2263 * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
2264 returns a TYPE_DECL. no further lookup is required.
2265 * semantics.c (check_template_template_default_arg): A TYPE_DECL
2266 is invalid. Rework to give better diagnostics.
2267
2268 2004-01-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2269
2270 PR c++/13797
2271 * pt.c (instantiate_class_template): Add an error_mark_node
2272 check.
2273 (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
2274
2275 2004-01-23 Andrew Pinski <pinskia@physics.uc.edu>
2276
2277 PR c++/13701
2278 * decl.c (finish_function): Move the call to
2279 finish_fname_decls below the call to
2280 finish_eh_spec_block.
2281
2282 2004-01-21 Kazu Hirata <kazu@cs.umass.edu>
2283
2284 * optimize.c, typeck2.c: Update copyright.
2285
2286 2004-01-21 Kazu Hirata <kazu@cs.umass.edu>
2287
2288 * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
2289 init.c, mangle.c, typeck.c: Update copyright.
2290
2291 2004-01-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
2292
2293 * parser.c (cp_parser_class_specifier): Prevent garbage collection.
2294
2295 2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
2296
2297 * Make-lang.in: Replace $(docdir) with doc.
2298 (c++.info, c++.srcinfo): Dummy entry.
2299 (c++.man, c++.srcman): New rules.
2300 (c++.install-man): Revamp rule.
2301
2302 2004-01-20 Kelley Cook <kcook@gcc.gnu.org>
2303
2304 * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
2305 CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
2306 immediate $(shell) instead of deferred backquote.
2307
2308 2004-01-19 Mark Mitchell <mark@codesourcery.com>
2309
2310 PR c++/13651
2311 * parser.c (cp_parser_postfix_expression): When encountering
2312 incomplete type on left-hand side of "->" or ".", treat the entire
2313 expression as erroneous.
2314
2315 PR c++/13592
2316 * call.c (build_field_call): Remove.
2317 (n_build_method_call): Likewise.
2318 (build_method_call): Likewise.
2319 (build_new_method_call): Do not call build_field_call.
2320 * class.c (n_build_method_call): Remove.
2321 (print_class_statistics): Do not print it.
2322 * cp-tree.h (build_method_call): Remove declaration.
2323 (finish_object_call_expr): Likewise.
2324 (build_new_1): Do not use build_method_call.
2325 * parser.c (cp_parser_postfix_expression): Use finish_call_expr
2326 when the function appearing on the right-hand-side of "." or "->"
2327 is not actually a function.
2328 * pt.c (tsubst_copy_and_build): Likewise.
2329 * semantics.c (finish_object_call_expr): Remove.
2330
2331 2004-01-18 Mark Mitchell <mark@codesourcery.com>
2332
2333 PR c++/13710
2334 * pt.c (tsubst): Use finish_typeof.
2335
2336 2004-01-18 Jason Merrill <jason@redhat.com>
2337
2338 PR c++/11725
2339 * except.c (build_throw): In a template, set
2340 current_function_returns_abnormally.
2341
2342 2004-01-17 Fred Fish <fnf@intrinsity.com>
2343
2344 PR c++/11895
2345 * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
2346 except don't call array_type_nelts() with a VECTOR_TYPE.
2347
2348 2004-01-16 Jan Hubicka <jh@suse.cz>
2349
2350 * mangle.c (write_mangled_name): Remove inline modifier.
2351
2352 2004-01-16 Mark Mitchell <mark@codesourcery.com>
2353
2354 PR c++/13574
2355 * decl.c (compute_array_index_type): Fix grammar in comment.
2356 * init.c (build_zero_init): Handle zero-sized arrays correctly.
2357
2358 PR c++/13178
2359 * call.c (name_as_c_string): Print conversion operator names
2360 correctly.
2361
2362 PR c++/13478
2363 * call.c (initialize_reference): Pass -1 for inner parameter to
2364 convert_like_real.
2365
2366 2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2367
2368 PR c++/13407
2369 * parser.c (cp_parser_base_specifier): Check for an invalid
2370 keyword `typename' and emit an user-friendly error message.
2371
2372 2004-01-15 Geoffrey Keating <geoffk@apple.com>
2373
2374 PR pch/13361
2375 * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
2376 (handle_pragma_implementation): Likewise.
2377
2378 2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2379
2380 PR c++/9259
2381 * typeck.c (build_class_member_access_expr): Allow to access members
2382 of the currently open class.
2383 (finish_class_member_access_expr): Likewise.
2384
2385 2004-01-15 Alexandre Oliva <aoliva@redhat.com>
2386
2387 PR c++/13659
2388 * name-lookup.c (validate_nonmember_using_decl): Take scope and
2389 name by value, instead of computing them.
2390 (do_local_using_decl, do_toplevel_using_decl): Add scope and name
2391 arguments. Pass them to validate_nonmember_using_decl.
2392 * name-lookup.h (do_local_using_decl): Adjust.
2393 (do_toplevel_using_decl): Likewise.
2394 * parser.c (cp_parser_using_declaration): Likewise.
2395 * pt.c (tsubst_expr): Likewise.
2396
2397 2004-01-15 Alexandre Oliva <aoliva@redhat.com>
2398
2399 PR c++/13594
2400 PR c++/13658
2401 * name-lookup.c (qualified_lookup_using_namespace): Search
2402 strongly-associated namespaces first, and only then try other
2403 namespaces.
2404
2405 2004-01-15 Kelley Cook <kcook@gcc.gnu.org>
2406
2407 * Make-lang.in (c++.srcextra): Dummy entry.
2408
2409 2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2410
2411 PR c++/8856
2412 * parser.c (cp_parser_template_name): Don't try to parse a
2413 conversion-function-id, as it cannot be a template-name.
2414 (cp_parser_simple_type_specifier): Check for invalid template-ids
2415 even after a built-in type.
2416
2417 2004-01-14 Jan Hubicka <jh@suse.cz>
2418
2419 PR c++/12850
2420 * pt.c (instantiate_decl): Do not increase function_depth.
2421
2422 2004-01-14 Danny Smith <dannysmith@users,sourceforge.net>
2423
2424 PR c++/9021
2425 PR c++/11005
2426 * parser.c (cp_parser_elaborated_type_specifier): Warn about
2427 attributes and discard.
2428 * decl.c (xref_tag): Don't overwite existing attributes with
2429 NULL_TREE.
2430
2431 2004-01-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2432
2433 PR c++/12335
2434 * parser.c (cp_parser_lookup_name): Return error_mark_node if there
2435 is no destructor while looking up a BIT_NOT_EXPR.
2436
2437 2004-01-13 Ian Lance Taylor <ian@wasabisystems.com>
2438
2439 * cxxfilt.c: Remove unused file.
2440
2441 2004-01-14 Jan Hubicka <jh@suse.cz>
2442
2443 Partial fix to PR c++/12850
2444 * decl2.c (mark_used): Do not proactively instantiate templates
2445 when compiling in unit-at-a-time or not optimizing.
2446 * optimize.c (maybe_clone_body): Do not increase function depth.
2447
2448 2004-01-13 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2449
2450 PR c++/13474
2451 * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
2452
2453 2004-01-12 Steven Bosscher <stevenb@suse.de>
2454
2455 PR c++/13558
2456 * parser.c (cp_parser_member_declaration): Any non-type is also
2457 not a class or a function.
2458
2459 2004-01-12 Jason Merrill <jason@redhat.com>
2460
2461 PR c++/12815
2462 * class.c (build_base_path): Do not mark vtable references as
2463 TREE_CONSTANT.
2464 (build_vtbl_ref_1): Likewise.
2465
2466 2004-01-12 Richard Henderson <rth@redhat.com>
2467
2468 PR opt/10776
2469 * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
2470 (store_init_value): Use it.
2471 * decl.c (check_initializer): Expect full initialization code
2472 from store_init_value.
2473 * init.c (expand_aggr_init_1): Likewise.
2474 * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
2475
2476 2004-01-12 Mark Mitchell <mark@codesourcery.com>
2477
2478 * class.c (layout_class_type): For non-POD class types, also copy
2479 the DECL_SIZE and DECL_MODE of fields to the base class type.
2480
2481 2004-01-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2482
2483 PR c++/13289
2484 * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
2485 calling regenerate_decl_from_template.
2486
2487 2004-01-12 Scott Brumbaugh <scottb.lists@verizon.net>
2488
2489 PR c++/4100
2490 * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
2491 decl-specifier occurring along with a class definition.
2492
2493 2004-01-12 Ian Lance Taylor <ian@wasabisystems.com>
2494
2495 * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
2496 clauses to comments describing declares_class_or_enum.
2497 (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
2498 false.
2499
2500 2004-01-12 Jan Hubicka <jh@suse.cz>
2501
2502 * pt.c (for_each_template_parm): Do not check for duplicates.
2503 (for_each_template_parm): Use walk_tree duplicate checking code.
2504
2505 2004-01-11 Ian Lance Taylor <ian@wasabisystems.com>
2506
2507 PR c++/3478
2508 * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
2509 is error_mark_node, don't add any more decl_specs.
2510 (cp_parser_init_declarator): After committing to a declaration, if
2511 the decl_specifiers start with error_mark_node, issue an error and
2512 change the type to "int".
2513
2514 2004-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
2515
2516 PR bootstrap/7817
2517 * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
2518
2519 2004-01-10 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2520
2521 DR 337
2522 PR c++/9256
2523 * pt.c (tsubst): Substitution must fail if we are attempting to
2524 create an array with element type that is an abstract class type.
2525 * decl.c (cp_finish_decl): Strip pointers and array types recursively
2526 before calling abstract_virtuals_error.
2527
2528 2004-01-09 Alexandre Oliva <aoliva@redhat.com>
2529
2530 * name-lookup.c (qualified_lookup_using_namespace): Consider
2531 strong using directives even if we've already found a binding.
2532
2533 2004-01-09 Mark Mitchell <mark@codesourcery.com>
2534
2535 * cp-tree.h (cxx_expand_expr): Change prototype.
2536 * expr.c (cxx_expand_expr): Add alt_rtl parameter.
2537
2538 2004-01-08 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2539
2540 PR c++/12573
2541 * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
2542 looking into them recursively. They can be there because of the
2543 new __offsetof__ extension.
2544
2545 2004-01-07 Zack Weinberg <zack@codesourcery.com>
2546
2547 * parser.c (cp_parser_save_member_function_body): Mark the
2548 definition static.
2549
2550 2004-01-05 Mark Mitchell <mark@codesourcery.com>
2551
2552 PR c++/13057
2553 * class.c (build_clone): Copy type attributes from the original
2554 function to the clone.
2555
2556 PR c++/12815
2557 * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
2558 references as constant.
2559
2560 PR c++/12132
2561 * parser.c (cp_parser_explicit_instantiation): Improve error
2562 recovery.
2563 (cp_parser_require): Improve indication of the error location.
2564
2565 PR c++/13451
2566 * parser.c (cp_parser_class_head): Reorder logic to check for
2567 invalid qualification.
2568
2569 2004-01-04 Mark Mitchell <mark@codesourcery.com>
2570
2571 PR c++/13157
2572 * name-lookup.c (lookup_using_namespace): Remove spacesp
2573 parameter.
2574 (unqualified_namespace_lookup): Likewise.
2575 (lookup_qualified_name): Adjust accordingly.
2576 (lookup_name_real): Likewise.
2577 (lookup_arg_dependent): Do not eliminate the namespace of the
2578 functions found by unqualified name lookup unless that is the
2579 current namespace.
2580
2581 2004-01-04 Andrew Pinski <pinskia@physics.uc.edu>
2582
2583 * semantics.c (push_deferring_access_checks): Fix format.
2584 (resume_deferring_access_checks): Likewise.
2585 (stop_deferring_access_checks): Likewise.
2586 (pop_deferring_access_checks): Likewise.
2587 (get_deferred_access_checks): Likewise.
2588 (pop_to_parent_deferring_access_checks): Likewise.
2589 (perform_deferred_access_checks): Likewise.
2590 (perform_or_defer_access_check): Likewise.
2591
2592 2004-01-04 Richard Henderson <rth@redhat.com>
2593
2594 * call.c (build_over_call): Don't create a save_expr of an
2595 aggregate, but rather its address.
2596
2597 2004-01-04 Mark Mitchell <mark@codesourcery.com>
2598
2599 PR c++/13529
2600 * parser.c (cp_parser_postfix_expression): Allow "." to appear in
2601 an offsetof expression.
2602
2603 * parser.c (cp_parser_parameter_declaration): Fix comment.
2604
2605 PR c++/12226
2606 * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
2607 (reference_binding): Set it when appropriate.
2608 (build_temp): New function, split out from ...
2609 (convert_like_real): ... here. Honor CHECK_COPY_CONSTRUCTOR_P.
2610 (initialize_reference): Likewise.
2611
2612 PR c++/13536
2613 * parser.c (cp_parser): Add in_type_id_in_expr_p.
2614 (cp_parser_new): Initialize it.
2615 (cp_parser_postfix_expression): Set it.
2616 (cp_parser_sizeof_operand): Likewise.
2617 (cp_parser_parameteR_declaration): Do not commit early to tenative
2618 parsers when in_type_id_in_expr_p is set.
2619
2620 2004-01-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2621
2622 PR c++/13094
2623 * parser.c (cp_parser_template_argument): Don't call
2624 make_unbound_class_template directly.
2625 (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
2626 UNBOUND_CLASS_TEMPLATE tree node.
2627
2628 2004-01-02 Richard Sandiford <rsandifo@redhat.com>
2629
2630 PR target/12729
2631 * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
2632
2633 2004-01-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2634
2635 PR c++/13520
2636 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
2637 (DECL_FUNCTION_TEMPLATE_P): Use it.
2638 (DECL_CLASS_TEMPLATE_P): Likewise.
2639 * parser.c (cp_parser_lookup_name): Add is_template parameter.
2640 (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
2641 (cp_parser_template_name): Likewise.
2642 (cp_parser_elaborated_type_specifier): Likewise.
2643 (cp_parser_namespace_name): Likewise.
2644 (cp_parser_class_name): Likewise.
2645 (cp_parser_lookup_name_simple): Likewise.
2646
2647 See ChangeLog.3 for earlier changes.