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