]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
* configure.ac: Check for COMDAT support. Robustify check for
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
537cd941 12004-09-15 Mark Mitchell <mark@codesourcery.com>
2
3 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
4 * cp-tree.h (cxx_comdat_group): Declare.
5 * decl.c (cxx_comdat_group): New function.
6
0937382c 72004-09-15 Nathan Sidwell <nathan@codesourcery.com>
8
bef27a4e 9 * search.c (get_pure_virtuals): Remove unused variables.
10
0937382c 11 * cp-tree.h (struct lang_decl_flags): Remove
12 needs_final_overrider.
13 (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
14 * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
15 * class.c (finish_struct_bits): Correct comment about
16 CLASSTYPE_PURE_VIRTUALS.
17 * search.c (get_pure_virtuals): Remove useless loop.
18
1eff44ec 192004-09-14 Mark Mitchell <mark@codesourcery.com>
20
21 PR c++/17324
22 * mangle.c (partially_mangled_name): New variable.
23 (partially_mangled_name_len): Likewise.
24 (save_partially_mangled_name): New function.
25 (restore_partially_mangled_name): Likewise.
26 (write_encoding): Save and restore partially mangled names around
27 calls to get_mostly_instantiated_function_type.
28 (write_unqualified_name): Likewise.
29
0262ceed 302004-09-14 Nathan Sidwell <nathan@codesourcery.com>
31
32 * pt.c (unify): Replace gcc_unreachable with gcc_assert.
33
a837f55e 342004-09-13 Mark Mitchell <mark@codesourcery.com>
35
0078a5e8 36 PR c++/16162
37 * parser.c (cp_parser_id_expression): Correct value for
38 is_declarator.
39 (cp_parser_nested_name_specifier_opt): Look through typenames as
40 necessary.
41 (cp_parser_template_name): Honor check_dependency_p.
42
a837f55e 43 PR c++/16716
44 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
45 Robustify.
46
47 PR c++/17327
48 * pt.c (unify): Add ENUMERAL_TYPE case. Replace sorry with
49 gcc_unreacable.
50
3602d821 512004-09-12 Richard Henderson <rth@redhat.com>
52
53 PR c++/16254
54 * semantics.c (maybe_cleanup_point_expr): Don't call fold.
55 * typeck.c (condition_conversion): Likewise.
56
0d42c4e1 572004-09-11 Richard Henderson <rth@redhat.com>
58
59 PR c++/17404
60 * pt.c (cur_stmt_expr): Move from tsubst_expr.
61 (tsubst_expr) <case STMT_EXPR>: Move ...
62 (tsubst_copy_and_build): ... here.
63
62bf98ad 642004-09-10 Zack Weinberg <zack@codesourcery.com>
65
66 * cp-tree.h (interface_only, interface_unknown): Delete declarations;
67 comment explaining them moved to c-common.h.
68 * lex.c (interface_only, interface_unknown, extract_interface_info):
69 Delete definitions.
70 (cxx_finish): Don't reset interface_unknown.
71 (handle_pragma_interface): Don't set interface_only and
72 interface_unknown; just the like-named fields in finfo.
73 (handle_pragma_implementation): Adjust comment.
74 * decl2.c (cp_finish_file): Don't reset interface_only and
75 interface_unknown.
76 * method.c (synthesize_method): Don't reset interface_unknown or
77 call extract_interface_info.
78 * pt.c (pop_tinst_level): Don't call extract_interface_info.
79 * decl.c (start_cleanup_fn): Don't save or restore interface_only
80 and interface_unknown.
81 (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
82 and use the result instead of the interface_only/interface_unknown
83 globals.
84 (start_preparsed_function): Likewise.
85 * lex.c (cxx_make_type): Likewise.
86 * semantics.c (begin_class_definition): Likewise.
87 (expand_body): Don't call extract_interface_info.
88
ed904873 892004-09-10 Ziemowit Laski <zlaski@apple.com>
90
62bf98ad 91 * decl.c (objc_mark_locals_volatile): Make description of
ed904873 92 routine more descriptive; only mark VAR_DECLs at each
93 binding level.
94
4ebee924 952004-09-10 Richard Henderson <rth@redhat.com>
96
97 PR c++/17386
98 * call.c (build_vfield_ref): Move...
99 * class.c (build_vfield_ref): ... here. Convert datum to the
100 primary base containing the vptr.
101 (make_new_vtable): Simplify build_primary_vtable arguments.
102 (finish_struct_1): Do not duplicate TYPE_VFIELD.
103 * typeck.c (build_class_member_access_expr): Don't warn for
104 null object access to base fields.
105
abf1c5d5 1062004-09-10 Ziemowit Laski <zlaski@apple.com>
107
108 * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
109 New functions, to be called from ObjC++.
110
4a44ba29 1112004-09-10 Kazu Hirata <kazu@cs.umass.edu>
112
113 * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
114 name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
115 comment typos.
116
10928a2b 1172004-09-09 Ziemowit Laski <zlaski@apple.com>
118
119 * typeck.c (build_c_cast): Preserve the cast if casting
120 to and from an Objective-C type.
121
3a390b41 1222004-09-09 Ziemowit Laski <zlaski@apple.com>
123
124 * Make-lang.in (cp/typeck.o): Depend on c-common.h.
125 * typeck.c: Include c-common.h.
126 (comptypes): For RECORD_TYPEs, call objc_comptypes() and
127 return the result if nonnegative.
128
197e583a 1292004-09-09 Zack Weinberg <zack@codesourcery.com>
130
131 * decl2.c (import_export_class)
132 * lex.c (handle_pragma_interface):
133 Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
134
b2341f36 1352004-09-08 Ziemowit Laski <zlaski@apple.com>
136
137 * Make-lang.in (cp/semantics.o): Depend on c-common.h.
138 * semantics.c: Include c-common.h.
139 (finish_compound_stmt): Call objc_clear_super_receiver().
140
196bfa93 1412004-09-08 Ziemowit Laski <zlaski@apple.com>
142
143 * cp-tree.h (do_poplevel): New prototype.
144 * semantics.c (do_poplevel): Make externally visible.
145
b77a16ed 1462004-09-08 Nathan Sidwell <nathan@codesourcery.com>
147
148 * cp-tree.h (tree_pair_s): Define a GC'd vector.
149 * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
150 * semantics.c (deferred_access): Likewise.
151
53629ffa 1522004-09-06 Daniel Jacobowitz <dan@debian.org>
153
154 * semantics.c (expand_body): Assert that we are not nested.
155
637fdc50 1562004-09-06 Zack Weinberg <zack@codesourcery.com>
157
158 * decl.c (build_enumerator): Use add_double and int_fits_type_p
159 instead of cp_build_binary_op, to avoid creating short-lived trees.
160 * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
161 lookahead instead of backtracking. Move some code to avoid a
162 conditional branch.
163 (cp_parser_enum_specifier): Avoid duplication of effort with caller.
164 Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
165 (cp_parser_enumerator_list, cp_parser_enumerator_definition):
166 Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
167
fb871e92 1682004-09-04 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
169
170 * decl.c (grok_declarator): Remove a redundant semicolon.
171
172 * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
173 Correct comments describing function parameters.
174
1752004-09-03 Matt Austern <austern@apple.com>
2fcca275 176 Compile speed improvement.
177 * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
178 Otherwise define a stub macro that expands to nothing.
179 (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set. Otherwise
180 define a stub macro that expands to 0.
181 (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
182 (cp_lexer_stop_debugging): Likewise.
183 (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set. Otherwise
184 define a stub macro that expands to NULL.
185 (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
186 (cp_lexer_new_from_tokens): Likewise.
637fdc50 187
667fed2f 1882004-09-03 Jan Hubicka <jh@suse.cz>
189
190 * decl.c (finish_function): Clean out pointers we no longer need.
191
634f7a13 1922004-09-03 Jan Beulich <jbeulich@novell.com>
193
194 * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
195 than "-lm".
196
36feed0f 1972004-09-02 Paul Brook <paul@codesourcery.com>
198
199 * decl2.c (determine_visibility): Only check data visibility
200 for VAR_DECLS.
201
219626ad 2022004-08-31 Mark Mitchell <mark@codesourcery.com>
203
4fc9a8ec 204 * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
205 * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
637fdc50 206 * decl2.c (determine_visibility): Honor
4fc9a8ec 207 TARGET_CXX_EXPORT_CLASS_DATA.
208
36feed0f 209 * class.c (key_method): Rename to ...
219626ad 210 (determine_key_method): ... this.
211 (finish_struct_1): Adjust accordingly.
212 * cp-tree.h (key_method): Declare.
213 * decl2.c (maybe_emit_vtables): Determine the key method here if
214 it has not already been done.
215
5dd72fac 2162004-08-31 Ziemowit Laski <zlaski@apple.com>
217
218 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
219 (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
220 (cp/cp-decl.c): Do not depend on gtype-cp.h.
221 (cp/cp-objcp-common.o): New target.
222 * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
223 (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
224 cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
225 prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
226 respectively.
227 (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
228 LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
229 LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
230 LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
231 LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
232 LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
233 LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
234 LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
235 LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
236 LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
237 LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
238 LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
239 LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
240 LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
241 LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
242 LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
243 LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
244 LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
245 LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
637fdc50 246 LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
5dd72fac 247 LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
248 LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
249 LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
250 LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
251 LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
252 LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
253 LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
254 LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
255 LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
256 LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
257 LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
258 hooks to cp-objcp-common.h.
259 (finish_file): New function.
260 * cp-objcp-common.c: New file.
261 * cp-objcp-common.h: New file.
262 * cp-tree.h (cp_finish_file): New prototype.
263 * decl.c: Do not include gtype-cp.h.
264 * decl2.c (finish_file): Rename to cp_finish_file.
637fdc50 265
0f248b08 2662004-08-31 Richard Henderson <rth@redhat.com>
267
268 PR c++/17221
269 * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
270 (tsubst_copy_and_build): ... here.
271
aff47ac3 2722004-08-30 Mark Mitchell <mark@codesourcery.com>
273
274 * cp-tree.h (initialize_artificial_var): Declare.
275 * decl.c (initialize_artifical_var): New function.
276 * class.c (initialize_array): Remove.
277 (initialize_vtable): Use initialize_artificial_var.
278 (build_vtt): Likewise.
279 (build_ctor_vtbl_group): Likewise.
280
b867d8aa 2812004-08-30 Richard Henderson <rth@redhat.com>
282
283 * class.c (build_base_path): Use build_address directly.
284 * typeck.c (build_unary_op): Don't lower &a.b to pointer
285 arithmetic directly.
286 * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
287 means !initializer_constant_valid_p.
288
3d1c55e6 2892004-08-30 Richard Henderson <rth@redhat.com>
290
291 * class.c (fixed_type_or_null): Use get_base_address before
292 assuming an ADDR_EXPR is non-null.
293
2e3e31d2 2942004-08-30 Nathan Sidwell <nathan@codesourcery.com>
295
296 * name-lookup.c (pop_binding, pushdecl,
297 set_identifier_type_value_with_scope, push_overloaded_decl,
298 arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
299 * parser.c (cp_parser_diagnose_invalid_type_name,
300 cp_parser_postfix_expression, cp_parser_unary_expression,
301 cp_parser_check_declarator_template_para): Likewise.
302 * pt.c (push_inline_template_parms_recursive,
303 check_explicit_specialization, convert_nontype_argument,
304 coerce_template_template_parms, uses_template_parms,
305 instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
306 tsubst_expr, instantiate_template,
307 maybe_adjust_types_for_deduction, type_unification_real,
308 resolve_overloaded_unification, template_decl_level,
309 type_dependent_expression_p): Likewise.
310 * search.c (lookup_base_r): Likewise.
311 * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
312 * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
313 verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
314 * typeck.c (common_type, get_member_function_from_ptrfunc,
315 build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
316 * typeck2.c (cxx_incomplete_type_diagnostic,
317 split_nonconstant_init_1, store_init_value,
318 process_init_constructor): Likewise.
319
092b1d6f 3202004-08-30 Nathan Sidwell <nathan@codesourcery.com>
321
322 * call.c (check_dtor_name): Replace abort with gcc_assert or
323 gcc_unreachable.
324 (build_call, add_builtin_candidate, build_new_op,
325 convert_like_real, build_over_call, in_charge_arg_for_name,
326 source_type, joust): Likewise.
327 * class.c (build_simple_base_path, get_vcall_index,
328 finish_struct_1, instantiate_type, get_enclosing_class,
329 add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
330 * cp-gimplify.c (cp_genericize): Likewise.
331 * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
332 * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
333 * decl.c (poplevel, make_unbound_class_template, reshape_init,
334 check_special_function_return_type, grokdeclarator,
335 grok_op_properties, tag_name, xref_tag, start_preparsed_function,
336 finish_function): Likewise.
337 * decl2.c (grokfield, maybe_emit_vtables):Likewise.
338 * error.c (dump_global_iord, dump_decl, dump_template_decl,
339 language_to_string): Likewise.
340 * except.c (choose_personality_routine): Likewise.
341 * friend.c (do_friend): Likewise.
342 * g++spec.c (lang_specific_driver): Likewise.
343 * init.c (build_zero_init, expand_default_init, build_new_1,
344 build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
345 * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
346 * mangle.c (add_substitution, write_unscoped_name,
347 write_template_prefix, write_identifier,
348 write_special_name_destructor, write_type, write_builtin_type,
349 write_expression, write_template_param,
350 write_java_integer_type_codes): Likewise.
351 * method.c (implicitly_declare_fn): Likewise.
352
1d8fc210 3532004-08-30 Nathan Sidwell <nathan@codesourcery.com>
354
eea75c62 355 * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
356 (BINFO_INDIRECT_PRIMARY_P): Remove.
357 * class.c (determine_primary_base): Rename to ...
358 (determine_primary_bases): ... here. Set all primary bases.
359 (set_primary_base): Remove.
360 (mark_primary_bases): Remove.
361 (build_simple_base_path, walk_subobject_offsets,
362 propagate_binfo_offsets, end_of_class): Adjust.
363 (layout_class_type): Rename determine_primary_base call.
364 (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
365 to type_as_string.
366 (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
367 build_rtti_vtbl_entries): Adjust.
368 * init.c (build_vtbl_address): Adjust.
369
1d8fc210 370 * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
371
11a35d8f 3722004-08-28 Ziemowit Laski <zlaski@apple.com>
373
374 * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
375 CXX_AND_OBJCXX_OBJS.
376 (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
377 separately on the link line.
378
218e09bc 3792004-08-28 Jason Merrill <jason@redhat.com>
380
381 * decl.c (expand_static_init): Avoid bogus warnings.
382
4813f5af 3832004-08-27 Jason Merrill <jason@redhat.com>
384
ab506405 385 PR c++/16851
386 * tree.c (stabilize_init): See through a COMPOUND_EXPR.
387
4813f5af 388 PR c++/13684
389 * decl.c (expand_static_init): Use thread-safety API.
390 (register_dtor_fn): Return the call, don't expand it.
391 * tree.c (add_stmt_to_compound): New fn.
392 (stabilize_call): Use it.
393
11106b1c 3942004-08-27 Richard Henderson <rth@redhat.com>
395
396 * cp-tree.def (OFFSETOF_EXPR): New.
397 * parser.c (cp_parser_builtin_offsetof): Either built an
398 OFFSETOF_EXPR, or call fold_offsetof immediately.
399 * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
400
b4df430b 4012004-08-27 Nathan Sidwell <nathan@codesourcery.com>
402
403 * call.c (validate_conversion_obstack): Replace
404 my_friendly_assert with gcc_assert or gcc_unreachable.
405 (direct_reference_binding, merge_conversion_sequences,
406 build_user_type_conversion_1, perform_overload_resolution,
407 build_op_delete_call, enforce_access, call_builtin_trap,
408 build_over_call, build_special_member_call, build_new_method_call,
409 initialize_reference): Likewise.
410 * class.c (build_base_path, build_primary_vtable, alter_access,
411 check_bases, update_vtable_entry_for_fn, layout_empty_base,
412 clone_function_decl, adjust_clone_args,
413 type_requires_array_cookie, include_empty_classes,
414 finish_struct_1, resolve_address_of_overloaded_function,
415 instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
416 dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
417 accumulate_vtbl_inits, build_vtbl_initializer,
418 build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
419 * cvt.c (build_up_reference, convert_to_reference): Likewise.
420 * decl.c (poplevel, duplicate_decls, make_typename_type,
421 cxx_init_decl_processing, reshape_init, check_initializer,
422 make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
423 expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
424 grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
425 xref_basetypes, start_preparsed_function, save_function_data,
426 finish_function, finish_method, maybe_register_incomplete_var,
427 complete_vars): Likewise.
428 * decl2.c (grok_array_decl, check_member_template,
429 check_classfn, finish_static_data_member_decl, coerce_new_type,
430 coerce_delete_type, import_export_class, decl_needed_p,
431 determine_visibility, import_export_decl, build_cleanup,
432 start_static_initialization_or_destructi, do_static_destruction,
433 prune_vars_needing_no_initialization,
434 build_offset_ref_call_from_tree): Likewise.
435 * error.c (dump_decl, dump_expr): Likewise.
436 * init.c (finish_init_stmts, build_zero_init,
437 expand_virtual_init, expand_default_init, expand_aggr_init_1,
438 build_offset_ref, build_new_1, build_delete, build_vbase_delete):
439 Likewise.
440 * mangle.c (write_method_parms, write_template_args,
441 write_expression, write_template_arg): Likewise.
442 * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
443 * name-lookup.c (pop_binding, begin_scope, leave_scope,
444 resume_scope, push_using_decl, validate_nonmember_using_decl,
445 is_ancestor, poplevel_class, set_inherited_value_binding_p,
446 push_class_level_binding, do_class_using_decl, push_namespace,
447 pop_namespace, add_using_namespace, ambiguous_decl,
448 lookup_namespace_name, lookup_type_current_level,
449 maybe_process_template_type_declaration): Likewise.
450 * parser.c (cp_lexer_peek_nth_token,
451 cp_parser_parse_and_diagnose_invalid_typ,
452 cp_parser_translation_unit, cp_parser_template_id,
453 cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
454 * pt.c (push_access_scope, finish_member_template_decl,
455 push_inline_template_parms_recursive, add_outermost_template_args,
456 get_innermost_template_args, begin_explicit_instantiation,
457 end_explicit_instantiation, retrieve_specialization,
458 is_specialization_of, is_specialization_of_friend,
459 register_specialization, check_explicit_specialization,
460 comp_template_parms, process_template_parm,
461 process_partial_specialization, convert_nontype_argument,
462 coerce_template_template_parms, coerce_template_parms,
463 mangle_class_name_for_template, lookup_template_function,
464 lookup_template_class, instantiate_class_template, tsubst_decl,
465 tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
466 instantiate_template, fn_type_unification, type_unification_real,
467 get_template_base, regenerate_decl_from_template,
468 template_for_substitution, instantiate_decl,
469 get_mostly_instantiated_function_type, dependent_scope_ref_p,
470 value_dependent_expression_p, resolve_typename_type): Likewise.
471 * repo.c (repo_emit_p): Likewise.
472 * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
473 create_tinfo_types, emit_tinfo_decl): Likewise.
474 * search.c (lookup_base_r, lookup_base, lookup_field_1,
475 dfs_access_in_type, build_baselink, lookup_member,
476 adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
477 * semantics.c (perform_or_defer_access_check,
478 finish_non_static_data_member, finish_stmt_expr_expr,
479 finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
480 finish_template_template_parm, finish_member_declaration,
481 emit_associated_thunks): Likewise.
482 * tree.c (build_target_expr_with_type, force_target_expr,
483 copy_binfo, get_first_fn, cp_tree_equal): Likewise.
484 * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
485 cxx_sizeof_or_alignof_type, perform_integral_promotions,
486 build_class_member_access_expr, finish_class_member_access_expr,
487 build_ptrmemfunc_access_expr, build_unary_op,
488 unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
489 build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
490 * typeck2.c (complete_type_check_abstract,
491 abstract_virtuals_error, process_init_constructor,
492 add_exception_specifier): Likewise.
493
85390276 4942004-08-27 Nathan Sidwell <nathan@codesourcery.com>
495
496 * class.c (build_vtbl_initializer): Use ssize_int.
497 * decl.c (complete_array_type): Likewise.
498 * method.c (finish_thunk): Likewise.
499 * search.c (get_dynamic_base_type): Likewise.
500
6078f68f 5012004-08-26 Richard Henderson <rth@redhat.com>
502
503 * cp-tree.h (DECL_FIELD_IS_BASE): New.
504 * class.c (build_base_field): Set it.
505 (build_simple_base_path): Use it.
506 (fixed_type_or_null): Don't consider base fields definitive.
507
30fa03f2 5082004-08-25 Roger Sayle <roger@eyesopen.com>
509
510 PR middle-end/16693
511 PR tree-optimization/16372
512 * decl.c (finish_enum): Make the precision of the enumerated type
513 the same width as the underlying integer type.
514
f13b585c 5152004-08-25 Mark Mitchell <mark@codesourcery.com>
516
e4652fbf 517 PR c++/17155
518 * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
519 functions.
520
f07f4968 521 * mangle.c (get_identifier_nocopy): Add cast.
522
f13b585c 523 * cp-tree.h (mangle_type): Remove.
524 * mangle.c (globals): GTY it.
525 (mangle_obstack): New variable.
526 (name_obstack): Likewise.
527 (name_base): Likewise.
528 (write_char): Adjust accordingly.
529 (write_chars): Likewise.
530 (write_string): Likewise.
531 (start_mangling): Initialize G.substitutions only one. Add
532 ident_p parameter.
533 (finish_mangling): Use VARRAY_CLEAR to reclaim
534 storage in G.substitutions. Use obstack_finish.
535 (init_mangle): Adjust for changes to variable names above.
536 Initialize G.substitutions.
537 (mangle_decl_string): Adjust call to start_mangling.
538 (get_identifier_nocopy): New function.
539 (mangle_decl): Use it.
540 (mangle_type_string): Adjust call to start_mangling.
541 (mangle_special_for_type): Likewise.
542 (mangle_vtt_for_type): Likewise.
543 (mangle_ctor_vtbl_for_type): Likewise.
544 (mangle_thunk): Likewise.
545 (mangle_guard_variable): Likewise.
546 (mangle_ref_init_variable): Likewise.
547
fcbecc82 5482004-08-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
549
550 PR c++/14428
551 * pt.c (redeclare_class_template): Check the type of non-type and
552 template template parameter.
553
7016c612 5542004-08-25 Nathan Sidwell <nathan@codesourcery.com>
555
7016c612 556 * call.c (convert_class_to_reference): Adjust build_int_cst calls.
557 (build_user_type_conversion_1, convert_like_real,
558 build_java_interface_fn_ref, build_special_member_call): Likewise.
559 * class.c (finish_struct_1, build_vtbl_initializer): Likewise.
560 * cp-gimplify.c (cp_gimplify_expr): Likewise.
561 * cvt.c (cp_convert_to_pointer): Likewise.
562 * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
563 * decl2.c (start_static_initialization_or_destruction,
564 generate_ctor_or_dtor_function): Likewise.
565 * except.c (build_throw): Likewise.
566 * mangle.c (write_integer_cst): Likewise.
567 * method.c (finish_thunk): Likewise.
568 * rtti.c (build_headof, get_tinfo_decl_dynamic,
569 build_dynamic_cast_1, ptr_initializer, ptm_initializer,
570 get_pseudo_ti_init): Likewise.
571 * search.c (get_dynamic_cast_base_type): Likewise.
637fdc50 572
346e0763 5732004-08-25 Zack Weinberg <zack@codesourcery.com>
574
575 * class.c, search.c: Remove references to DWARF_DEBUG.
576
4840a255 5772004-08-25 Adam Nemet <anemet@lnxw.com>
578
579 * repo.c (extract_string): Reset backquote after one character.
580 (get_base_filename): Fix indentation.
0262ceed 581
1561d3cd 5822004-08-24 Nathan Sidwell <nathan@codesourcery.com>
583
7016c612 584 * decl.c (cxx_init_decl_processing): Adjust
1561d3cd 585 build_common_tree_nodes call.
586
90b0d910 5872004-08-24 Nathan Sidwell <nathan@codesourcery.com>
588
589 PR c++/16889
590 * (is_subobject_of_p): Resurrect & optimize.
591 (lookup_field_r): Use it.
592
c79946ec 5932004-08-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
594
595 PR c++/16706
596 * search.c (friend_accessible_p): Increment processing_template_decl
597 when deal with TEMPLATE_DECL of SCOPE.
598
044e2a62 5992004-08-24 Nathan Sidwell <nathan@codesourcery.com>
600
601 PR c++/17149
602 * semantics.c (check_accessibility_of_qualified_id): Defer check
603 if qualifying_type is a template parameter.
604
837f1ad9 6052004-08-23 Mark Mitchell <mark@codesourcery.com>
606
607 PR c++/17163
608 * pt.c (instantiate_decl): Do not try to apply
609 DECL_DECLARED_INLINED_P to a VAR_DECL.
610
611 * search.c (build_baselink): Fix typo in comment.
612
4975972a 6132004-08-22 Andrew Pinski <apinski@apple.com>
614
615 Revert:
616 2004-08-22 Andrew Pinski <apinski@apple.com>
617 PR c++/14029
044e2a62 618 * typeck.c (build_unary_op): Use &a.b if the folded lowered
4975972a 619 expression is not constant.
620
e086912e 6212004-08-23 Nathan Sidwell <nathan@codesourcery.com>
622
623 * name-lookup.c (pushdecl): Rename build_type_copy call.
624 * tree.c (cp_build_qualified_type_real,
625 build_exception_variant, handle_java_interface_attribute): Likewise.
626
db79c9b4 6272004-08-22 Andrew Pinski <apinski@apple.com>
628
629 PR c++/14029
044e2a62 630 * typeck.c (build_unary_op): Use &a.b if the folded lowered
db79c9b4 631 expression is not constant.
632
c0731520 6332004-08-20 Mark Mitchell <mark@codesourcery.com>
634
635 PR c++/17121
636 * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P.
637
35ca1541 6382004-08-21 Joseph S. Myers <jsm@polyomino.org.uk>
639
640 PR c++/17120
641 * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for
642 MODOP_EXPR.
643
2c797764 6442004-08-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
645
646 * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION
647 before calling comp_template_args.
648
34399e1a 6492004-08-20 Nathan Sidwell <nathan@codesourcery.com>
650
651 * class.c (build_vtbl_initializer): Use build_int_cst for
652 negative size types.
653 * decl.c (complete_array_type): Likewise.
654 * method.c (finish_thunk): Likewise.
655
d10a792a 6562004-08-20 Andreas Tobler <a.tobler@schweiz.ch>
657
658 * tree.c: Remove unused mark_local_for_remap_r.
659
ac13e8d9 6602004-08-19 Eric Christopher <echristo@redhat.com>
661
662 * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
663 * tree.c (cxx_unsave_expr_now): Delete.
664 (cp_unsave_r): Ditto.
665
e8dd671e 6662004-08-19 Mark Mitchell <mark@codesourcery.com>
667
668 PR c++/15890
669 * pt.c (push_template_decl_real): Disallow template allocation
670 functions with fewer than two parameters.
671
57142570 6722004-08-19 Nathan Sidwell <nathan@codesourcery.com>
673
674 * cp-tree.h (build_shared_int_cst): Remove.
675 * tree.c (shared_int_cache): Remove.
676 (build_shared_int_cst): Remove.
677 * class.c (finish_struct_1): Use build_int_cst.
678
00b76131 6792004-08-19 Nathan Sidwell <nathan@codesourcery.com>
680
681 * decl.c (finish_enum): Do not copy value node early, copy
682 later.
683 * lex.c (cxx_init): Force null_node to be unique.
ac13e8d9 684
ef1a5b81 6852004-08-19 Joseph S. Myers <jsm@polyomino.org.uk>
686
687 PR c++/17041
688 * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
689 from input for MODOP_EXPR.
690
7322c29e 6912004-08-18 Mark Mitchell <mark@codesourcery.com>
692
85633df2 693 * pt.c (dependent_template_p): Fix typo in commment.
694
7322c29e 695 PR c++/17068
696 * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
697 dependent.
698
2cdbcd51 6992004-08-17 Mark Mitchell <mark@codesourcery.com>
700
cb47f9e7 701 PR c++/16246
702 * pt.c (unify): Tidy ARRAY_TYPE handling. Make sure that non-type
703 arguments have the same type as the corresponding parameter.
704
30aea172 705 PR c++/16215
706 * parser.c (cp_parser_name_lookup_error): If parser->object_scope
707 is set use it for diagnostic purposes.
708 (cp_parser_pseudo_destructor_name): Remove special-case error
709 message.
710
aa255322 711 PR c++/15871
712 * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions.
713
2cdbcd51 714 PR c++/16965
715 * cp-tree.h (qualified_name_lookup_error): Add parameter.
716 * name-lookup.c (do_class_using_decl): Restrict set of entities
717 passed to cp_emit_debug_info_for_using more carefully.
718 (lookup_qualified_name): Allow lookup_member to return sets of
719 ambiguous entries.
720 * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter.
721 (cp_parser_primary_expression): Handle ambiguous lookups.
722 (cp_parser_template_name): Adjust use of cp_parser_lookup_name.
723 (cp_parser_template_argument): Likewise.
724 (cp_parser_elaborate_type_specifier): Likewise.
725 (cp_parser_namespace_name): Likewise.
726 (cp_parser_class_name): Likewise.
727 (cp_parser_lookup_name_simple): Likewise.
728 * pt.c (tsubst_qualified_id): Handle ambiguous results.
729 (tsubst_expr): Likewise.
730 * semantics.c (qualified_name_lookup_error): Add decl paramter.
731 For ambiguous lookups, print candidates.
732
68efb5b8 7332004-08-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
734
735 PR c++/6749
736 * pt.c (instantiate_pending_templates): Add int parameter. Don't
737 return anything.
738 * cp-tree.h (instantiate_pending_templates): Adjust prototype.
739 * decl2.c (finish_file): Adjust call to
740 instantiate_pending_templates.
741
831d52a2 7422004-08-15 Roger Sayle <roger@eyesopen.com>
743
744 * call.c (build_vfield_ref, build_call, build_conditional_expr,
745 convert_arg_to_ellipsis, build_x_va_arg, build_over_call,
746 build_java_interface_fn_ref, build_special_member_call,
747 build_new_method_call, initialize_reference): Replace calls to
748 build with calls to buildN.
749 * class.c (build_base_path, convert_to_base_statically,
750 build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits,
751 build_vtbl_initializer): Likewise.
752 * cp-gimplify.c (genericize_try_block, genericize_catch_block,
753 gimplify_if_stmt, cp_genericize_r): Likewise.
754 * cvt.c (convert_to_void): Likewise.
755 * decl.c (check_initializer, finish_constructor_body,
756 finish_destructor_body): Likewise.
757 * error.c (dump_expr): Likewise.
758 * except.c (build_exc_ptr, expand_start_catch_block, build_throw):
759 Likewise.
760 * init.c (perform_member_init, expand_virtual_init,
761 expand_cleanup_for_base, build_init, expand_default_init,
762 build_offset_ref, decl_constant_value, build_new, build_new_1,
763 build_vec_delete_1, build_vec_init, build_delete,
764 push_base_cleanups, build_vec_delete): Likewise.
765 * mangle.c (write_integer_cst): Likewise.
766 * method.c (thunk_adjust, do_build_copy_constructor,
767 do_build_assign_ref): Likewise.
768 * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build,
769 unify, build_non_dependent_expr): Likewise.
770 * rtti.c (build_headof, build_typeid, ifnonnull,
771 build_dyanmic_cast_1, tinfo_base_init): Likewise.
772 * semantics.c (begin_compound_stmt, finish_call_expr,
773 finish_pseudo_destructor_expr, finish_id_expression,
774 simplify_aggr_init_expr, finalize_nrv_r): Likewise.
775 * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top,
776 array_type_nelts_total, stabilize_call): Likewise.
777 * typeck.c (decay_conversion, build_class_member_access_expr,
778 lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref,
779 get_member_function_from_ptrfunc, build_binary_op, pointer_diff,
780 build_x_unary_op, build_unary_op, unary_complex_lvalue,
781 build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst,
782 check_return_expr): Likewise.
783 * typeck2.c (split_nonconstant_1, split_nonconstant_init_1,
784 split_nonconstant_init, store_init_value, build_m_component_ref):
785 Likewise.
786
7c446c95 7872004-08-15 Nathan Sidwell <nathan@codesourcery.com>
788
789 * call.c (convert_class_to_reference,
790 build_user_type_conversion_1, convert_like_real,
791 build_java_interface_fn_ref, build_special_member_call): Use
792 build_int_cst.
793 * class.c (build_vtbl_initializer): Likewise.
794 * cp-gimplify.c (cp_gimplify_expr): Likewise.
795 * cvt.c (cp_convert_to_pointer): Likewise.
796 * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
797 * decl2.c (start_static_initialization_or_destruction,
798 generate_ctor_or_dtor_function): Likewise.
799 * except.c (build_throw): Likewise.
800 * lex.c (cxx_init): Likewise.
801 * mangle.c (write_integer_cst): Likewise.
802 * rtti.c (build_headof, get_tinfo_decl_dynamic,
803 build_dynamic_cast_1, ptr_initializer, ptm_initializer,
804 get_pseudo_ti_init): Likewise.
805 * search.c (get_dynamic_cast_base_type): Likewise.
806 * tree.c (build_shared_int_cst): Likewise.
807
5e0f4fd3 8082004-08-12 Mark Mitchell <mark@codesourcery.com>
809
810 PR c++/16273
811 * class.c (count_depth_data): New type.
812 (dfs_depth_post): New function.
813 (dfs_depth_q): Likewise.
814 (find_final_overrider_data_s): Change type of vpath.
815 Add vpath_list.
816 (dfs_find_final_overrider_1): New function.
817 (dfs_find_final_overrider): Use it.
818 (dfs_find_final_overrider_q): Adjust use of vpath.
819 (dfs_find_final_overrider_post): Likewise.
820 (find_final_overrider): Use dfs_depth. Allocate and deallocate
821 vpath_list.
822
8f26d225 8232004-08-12 Jan Beulich <jbeulich@novell.com>
824
825 * parser.c (cp_parser_asm_definition): Properly consume scope operator
826 tokens preceding the clobbers. Don't check for scope operator
827 following inputs. Simplify inputs handling to match that now used for
828 clobbers.
829
af59b531 8302004-08-11 Mark Mitchell <mark@codesourcery.com>
831
3b50f8cb 832 PR c++/16698
833 * except.c (build_throw): Allocate cleanup_type and the function
834 for __cxa_throw separately.
835
af59b531 836 PR c++/16853
837 * call.c (standard_conversion): Do not accept conversions between
838 pointers to members if the class types are unrelated.
839
840 PR c++/16618
841 * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile
842 char &" instead of just "char &".
843
844 PR c++/16870
845 * pt.c (tsubst): Just return the unknown_type_node.
846
534d03ee 8472004-08-11 Mark Mitchell <mark@codesourcery.com>
848
849 PR c++/16964
850 * parser.c (cp_parser_class_specifier): Robustify.
851
852 PR c++/16904
853 * pt.c (tsubst_copy_and_build): Complain about invalid
854 qualification.
855
856 PR c++/16929
857 * pt.c (tsubst_default_argument): Clear out current_class_ptr and
858 current_class_ref while tsubsting.
ac13e8d9 859
d1cd2603 8602004-08-10 Mark Mitchell <mark@codesourcery.com>
861
862 PR c++/16971
863 * parser.c (cp_parser_init_declarator): Robustify.
864
3304fb1c 8652004-08-06 Richard Sandiford <rsandifo@redhat.com>
866
867 * typeck2.c (process_init_constructor): Guard the missing field warning
868 with warn_missing_field_initializers rather than extra_warnings.
869
7d4e610d 8702004-08-06 Paolo Bonzini <bonzini@gnu.org>
871
872 * class.c (instantiate_type) <ENTRY_VALUE_EXPR>: Do not handle.
873
3aa0c315 8742004-08-05 Mark Mitchell <mark@codesourcery.com>
875
876 * decl.c (start_preparsed_function): Move determine_visibility
877 call.
878 * decl2.c (determine_visibility): Incorporate dllexport testing.
879
4cea1d71 8802004-08-05 Geoffrey Keating <geoffk@apple.com>
881
882 * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option
883 means that libstdc++ is needed.
884
4d28c5d1 8852004-08-05 Nathan Sidwell <nathan@codesourcery.com>
886
887 * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call.
888
b2c4af5e 8892004-08-04 Geoffrey Keating <geoffk@apple.com>
890
891 * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
892 than passing it as a parameter to rest_of_decl_compilation.
893 * decl2.c (grokfield): Use set_user_assembler_name.
894
fe1745b9 8952004-08-04 Nathan Sidwell <nathan@codesourcery.com>
896
897 * decl.c (complete_array_type): Don't gratuitously copy
898 maxindex. Its type is always set.
899
853b7640 9002004-08-04 Paul Brook <paul@codesourcery.com>
901
902 * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H.
903 * cp-tree.h (struct language_function): Rename x_dtor_label to
904 x_cdtor_label.
905 (dtor_label): Rename ...
906 (cdtor_label): ... to this.
907 * decl.c (begin_constructor_body): Remove.
908 (check_special_function_return_type): Maybe change the return type.
909 (grokdeclarator): Pass the class type.
910 (start_preparsed_function): Constructors may need a return label.
911 (finish_constructor_body, finish_destructor_body): Set the return
912 value.
913 (begin_function_body): Don't call begin_constructor_body.
914 (finish_function): Don't warn for constructors or destructors.
915 (implicitly_declare_fn): Maybe change the return type.
916 * optimize.c: Include target.h.
917 (maybe_clone_body): Remap the function result.
918 * semantics.c: Include target.h.
919 (finish_return_stmt): Maybe jump to return label for constructors.
920
91caa6ca 9212004-08-03 Mark Mitchell <mark@codesourcery.com>
922
923 * class.c (build_vtable): Do not set DECL_VISIBILITY here.
924 (check_field_decls): Or here.
925 (check_methods): Or here.
926 (initialize_array): Don't mess with DECL_CONTEXT.
927 * cp-tree.h (start_decl): Adjust prototype.
928 (determine_visibility): New function.
929 * decl.c (duplicate_decls): Remove checks for hidden "operator
930 new".
931 (build_library_fn_1): Give all library functions default
932 visibility.
933 (start_decl): Add pop_scope_p parameter. Tidy.
934 (cp_finish_decl): Do not pop scopes here. Call
935 determine_visibility for variable definitions.
936 (start_preparsed_function): Call determine_visibility.
937 * decl2.c (determine_visibility): New function.
938 * method.c (use_thunk): Fix formatting.
939 * parser.c (cp_parser_condition): Adjust calls to start_decl.
940 (cp_parser_init_declarator): Likewise.
941 * pt.c (instantiate_decl): Always call pop_nested_class.
942 * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY.
943 (tinfo_base_init): Likewise.
944
2b217005 9452004-08-02 Mark Mitchell <mark@codesourcery.com>
946
947 PR c++/16707
948 * name-lookup.c (validate_nonmember_using_decl): Robustify.
949
5575ae2d 9502004-08-01 Mark Mitchell <mark@codesourcery.com>
951
e4e8c884 952 PR c++/16224
953 * name-lookup.c (decl_namespace): Remove.
954 (current_decl_namespace): Use decl_namespace_context instead of
955 decl_namespace.
956 (push_decl_namespace): Likewise.
957 (arg_assoc_class): Likewise.
958 (arg_assoc_type): Likewise.
959 * pt.c (check_specialization_namespace): New function.
960 (maybe_process_partial_specialization): Use it.
961 (register_specialization): Likewise.
962
796ace0d 963 PR c++/16489
5575ae2d 964 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro.
965 * call.c (null_ptr_cst_p): Handle variables with constant
966 initializers.
967 * pt.c (convert_nontype_argument): Use
968 DECL_INTEGRAL_CONSTANT_VAR_P.
969 * semantics.c (finish_id_expression): Likewise.
970
796ace0d 971 PR c++/16529
5575ae2d 972 * decl.c (duplicate_decls): Reject duplicate namespace
973 declarations.
974
975 PR c++/16810
976 * typeck.c (build_ptrmemfunc): Loosen assertion.
977
12e22044 9782004-08-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
979
980 * call.c (z_candidate::template_decl): Rename from template.
981 (add_template_candidate_real): Adjust member reference.
982 (joust): Likewise.
983
caa6fdce 9842004-07-29 Mark Mitchell <mark@codesourcery.com>
985
986 * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
987 (lang_decl_flags): Narrow the width of "languages". Add
988 repo_available_p.
989 (DECL_NEEDED_P): Remove.
990 (FOR_EACH_CLONE): New macro.
991 (DECL_REPO_AVAILABLE_P): Likewise.
992 (DECL_TINFO_P): Likewise.
993 (set_linkage_according_to_type): Declare.
994 (import_export_vtable): Remove.
995 (import_export_tinfo): Likewise.
996 (mark_needed): New function.
997 (decl_needed_p): Likewise.
998 (note_vauge_linkage_fn): Likewise.
999 (init_repo): Change prototype.
1000 (repo_template_used): Remove.
1001 (repo_template_instantiated): Likewise.
1002 (repo_emit_p): New function.
1003 (repo_export_class_p): Likewise.
1004 (no_linkage_check): Change prototype.
1005 * class.c (set_linkage_according_to_type): New function.
1006 (build_vtable): Use it. Do not call import_export_vtable. Set
1007 DECL_IGNORED_P if appropriate.
1008 * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
1009 (make_rtL_for_nonlocal_decls): Check for template instantiations
1010 explicitly.
1011 (grokfndecl): Adjust call to no_linkage_check.
1012 (set_linkage_for_static_data_member): New function.
1013 (grokvardecl): Use it. Adjust call to no_linkage_check.
1014 (grokdeclarator): Use set_linkage_for_static_data_member.
1015 * decl2.c (note_vague_linkage_fn): New function.
1016 (note_vague_linkage_var): Likewise.
1017 (finish_static_data_member_decl): Use it.
1018 (import_export_vtable): Remove.
1019 (import_export_class): Use repo_export_class_p.
1020 (var_finalized_p): Simplify.
1021 (maybe_emit_vtables): Simplify.
1022 (mark_needed): New function.
1023 (decl_needed_p): Likewise.
1024 (import_export_decl): Add documentation and consistency checks.
1025 Use repo_emit_p. Handle virtual tables and RTTI information
1026 here.
1027 (import_export_tinfo): Remove.
1028 (write_out_vars): Call import_export_decl.
1029 (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
1030 whenever one is.
1031 (finish_file): Use decl_needed_p. Do not call import_export_decl
1032 for undefined static data members. Do not warn about undefined
1033 inlines when using a repository.
1034 (mark_used): Use note_vague_linkage_fn. Always defer template
1035 instantiations.
1036 * lex.c (cxx_init): Adjust call to init_repo. Always set
1037 flag_unit_at_a-time.
1038 * method.c (synthesize_method): Remove unncessary
1039 import_export_decl call.
1040 (implicitly_declare_fn): Use set_linkage_according_to_type.
1041 * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
1042 * pt.c (instantiate_class_template): Don't redundantly add classes
1043 to keyed_classes. Don't call repo_template_used.
1044 (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
1045 templates with internal linkage.
1046 (check_instantiated_args): Adjust call to no_linkage_check.
1047 (instantiate_template): Use FOR_EACH_CLONE.
1048 (mark_definable): New function.
1049 (mark_decl_instantiated): Use it.
1050 (do_decl_instantiation): Adjust tests for explicit instantiation
1051 after "extern template".
1052 (instantiate_class_member): Do not use repo_template_instantiated.
1053 (do_type_instantiation): Simplify.
1054 (instantiate_decl): Use mark_definable. Check repo_emit_p.
1055 Simplify.
1056 * repo.c (repo_get_id): Remove.
1057 (original_repo): Remove.
1058 (IDENTIFIER_REPO_USED): Remove.
1059 (IDENTIFIER_REPO_CHOSEN): Remove.
1060 Remove all #if 0'd code.
1061 (repo_template_used): Remove.
1062 (repo_template_instantiated): Remove.
1063 (temporary_obstack_initialized_p): New variable.
1064 (init_repo): Register with lang_post_pch_load. Avoid creating
1065 identifiers unnecessarily. Don't use original_repo. Close the
1066 file here.
1067 (reopen_repo_file_for_write): Not here.
1068 (finish_repo): Always write out a new repository file.
1069 (repo_emit_p): New function.
1070 (repo_export_class_p): Likewise.
1071 * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
1072 (involves_incomplete_p): New function.
1073 (tinfo_base_init): Use it.
1074 (ptr_initializer): Remove non_public_ptr parameter.
1075 (ptm_initializer): Likewise.
1076 (get_pseudo_ti_init): Likewise.
1077 (unemitted_tinfo_decl_p): Remove.
1078 (emit_tinfo_decl): Use import_export_decl.
1079 * semantics.c (expand_body): Move updates of static_ctors and
1080 static_dtors to ...
1081 (expand_or_defer_fn): ... here.
1082 * tree.c (no_linkage_check): Add relaxed_p parameter.
ac13e8d9 1083
b27ac6b5 10842004-07-28 Eric Christopher <echristo@redhat.com>
1085
1086 * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
1087
26cbb959 10882004-07-28 Nathan Sidwell <nathan@codesourcery.com>
1089
1090 * cp-tree.h (struct tree_pair_s): New.
1091 (typedef tree_pair_p): New.
1092 (DEF_VEC_O(tree_pair_s)): New.
1093 (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s).
1094 (CLASSTYPE_VCALL_INDICES): Update documentation.
1095 * class.c (get_vcall_index): Adjust.
1096 (add_vcall_offset): Adjust.
1097
e78103d9 10982004-07-27 Kelley Cook <kcook@gcc.gnu.org>
1099
1100 * pt.c, typeck.c: Remove spurious carriage returns.
1101
eafc7979 11022004-07-27 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1103
1104 PR c++/14429
1105 * pt.c (coerce_template_template_parms) <PARM_DECL case>: Only check
1106 when the type of ARG is not dependent.
1107
9dc89308 11082004-07-26 Geoffrey Keating <geoffk@apple.com>
1109
1110 * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
1111 (lang_specific_driver): If the C++ or math library options don't
1112 start with '-l', don't count them as added libraries.
1113
db77fe17 11142004-07-26 Nathan Sidwell <nathan@codesourcery.com>
1115
1116 * decl.c (xref_basetypes): Adjust base access vector creation.
1117 * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
1118 access accesses.
1119 * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.
1120
06ccb39d 11212004-07-26 Niall Douglas <s_fsfeurope2@nedprod.com>
1122 Brian Ryner <bryner@brianryner.com>
1123
1124 PR c++/15000
1125 PR c++/9283
1126 * class.c (check_field_decls): Apply hidden visibility if
1127 -fvisibility-inlines-hidden and inlined unless otherwise specified
1128 (build_vtable): Set vtable visibility to class visibility.
1129 (check_field_decls): Default static member visibility to class
1130 visibility.
1131 (check_methods): Default method visibility to class visibility.
1132 * cp-tree.h: Added CLASSTYPE_VISIBILITY and
1133 CLASSTYPE_VISIBILITY_SPECIFIED macro.
1134 * decl.c (duplicate_decls): New logic for merging definition decls
1135 with declaration decls. Added ignore & warning when non default
1136 applied to global operator new or delete.
1137 * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
1138 wherever VISIBILITY was changed
1139 * rtti.c (get_tinfo_decl): Set typeinfo visibility to class
1140 visibility.
1141 (tinfo_base_init): Set typeinfo name visibility to class visibility.
b212f378 1142
4dee9c0e 11432004-07-25 Bernardo Innocenti <bernie@develer.com>
1144
1145 * decl.c: Rename all identifiers named `class' to `cl'.
1146 * cp-tree.h: Likewise.
1147
a33db04a 11482004-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1149
1150 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
1151 * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
1152 * name-lookup.c (binding_entry_make): Use GGC_NEW.
1153 (binding_table_construct): Use GGC_CNEWVEC.
1154 (binding_table_new): Use GGC_NEW.
1155 (cxx_binding_make): Likewise.
1156 (begin_scope): Likewise.
1157 (push_to_top_level): Use GCC_CNEW.
1158 * parser.c (cp_token_cache_new): Likewise.
1159 (cp_token_cache_push_token): Likewise.
1160 (cp_lexer_new_main): Likewise.
1161 (cp_lexer_new_from_tokens): Likewise.
1162 (cp_parser_context_new): Likewise.
1163 (cp_parser_new): Likewise.
1164 (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
1165 * lex.c (cxx_make_type): Use GGC_CNEW.
1166 (retrofit_lang_decl): Use GGC_NEWVAR.
1167 (cxx_dup_lang_specific_decl): Likewise.
1168 (copy_lang_type): Likewise.
1169 * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
1170 (save_function_data): Likewise.
1171 (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
1172 (cxx_push_function_context): Likewise.
1173
540edea7 11742004-07-25 Richard Henderson <rth@redhat.com>
1175
1176 * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
1177 DECL_IGNORED_P on RESULT_DECL.
1178 * semantics.c (finalize_nrv): Copy them too.
1179
b66d575b 11802004-07-23 Nathan Sidwell <nathan@codesourcery.com>
1181
1182 * search.c (lookup_conversion_operator): Avoid two loops.
1183 (add_conversions): Remove.
1184 (check_hidden_convs, split_conversions,
1185 lookup_conversions_r): New.
1186 (lookup_conversions): Use lookup_conversions_r.
1187
6435a844 11882004-07-22 Nathan Sidwell <nathan@codesourcery.com>
1189
1190 * pt.c (get_template_base): Check type is completable.
1191
491e04ef 11922004-07-21 Eric Christopher <echristo@redhat.com>
1193
1194 * decl.c (poplevel): Inline unused variable checking.
1195 Change formatting.
1196
4418a1d4 11972004-07-21 Paolo Bonzini <bonzini@gnu.org>
1198
1199 * typeck.c (build_binary_op): Do not use RDIV_EXPR for
1200 integer vectors.
1201
a312d54f 12022004-07-21 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1203
1204 PR c++/14497
1205 * pt.c (check_explicit_specialization): Remove extension to accept
1206 specializations without template headers. Fall-through to normal
1207 processing.
1208
05a677c7 12092004-07-21 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1210
1211 PR c++/509
1212 * pt.c (determine_specialization): New parameter template_count.
1213 Disambiguate between member templates and member functions counting
1214 the template headers.
1215 (check_explicit_specialization): Update caller.
1216 (tsubst_friend_function): Likewise.
1217
018c1ab0 12182004-07-20 Steven Bosscher <stevenb@suse.de>
1219
1220 * cp-tree.def (TINST_LEVEL): Make it an 'x' node.
1221 * cp-tree.h (tinst_level_t): New tree type.
1222 (union lang_tree_node): Handle it.
1223 (TINST_LOCATION): New accessor macro.
1224 (make_tinst_level): New prototype.
1225 * cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
1226 * decl.c (cp_tree_node_structure): Likewise.
1227 * error.c (print_instantiation_full_context): Use TINST_LOCATION.
1228 (print_instantiation_partial_context): Likewise.
1229 * pt.c (pop_tinst_level): Likewise.
1230 (push_tinst_level): Use make_tinst_level.
1231 * tree.c (make_tinst_level): New function.
1232 (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.
1233
b446079d 12342004-07-20 Mark Mitchell <mark@codesourcery.com>
1235
a619017d 1236 * parser.c (cp_parser_simple_type_specifier): Fix typo.
1237
b446079d 1238 PR c++/16637
1239 * parser.c (cp_parser_simple_type_specifier): Do not record usage
1240 of globally-qualified names.
1241
b1af6b0b 12422004-07-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1243
1244 PR c++/16175
1245 * error.c (dump_type) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Output
1246 cv qualifier.
1247
2967f654 12482004-07-19 Mark Mitchell <mark@codesourcery.com>
1249
1250 PR c++/16623
1251 * cp-tree.h (lang_type_class): Add lazy_assignment_op.
1252 (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
1253 * class.c (add_implicitly_declared_members): Use
1254 CLASSTYPE_LAZY_ASSIGNMENT_OP.
1255 * method.c (lazily_declare_fn): Clear
1256 CLASSTYPE_LAZY_ASSIGNMENT_OP.
1257 * search.c (lookup_fnfields_1): Check it.
1258
4e88b09a 12592004-07-20 Nathan Sidwell <nathan@codesourcery.com>
1260
a26a5b2b 1261 * cp-tree.h (vec_binfo_member): Remove.
1262 * tree.c (vec_binfo_member): Remove.
1263
4e88b09a 1264 * cp-tree.h (struct lang_type_class): Remove vfields field.
1265 (CLASSTYPE_VFIELDS): Remove.
1266 (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
1267 * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
1268 handling.
1269 (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
1270 (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
1271 * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
1272
f6cc6a08 12732004-07-20 Nathan Sidwell <nathan@codesourcery.com>
1274
1275 * cp-tree.h (DEF_VEC_P(tree)): Remove here.
1276 (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
1277 Moved to common.
1278 (BINFO_LANG_SLOTS): Remove.
1279 * tree.c (copy_binfo): Adjust BINFO creation and accessors.
1280 * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
1281 * class.c (check_bases): Adjust BINFO accessors.
1282 (determine_primary_base, finish_struct_bits,
1283 maybe_warn_about_overly_private_class, warn_hidden,
1284 walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
1285 warn_about_ambiguous_bases, get_vfield_name,
1286 dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
1287 add_vcall_offset_vtbl_entries_r): Likewise.
1288 * dump.c (cp_dump_tree): Likewise.
1289 * init.c (sort_mem_initializers, expand_member_init, build_delete,
1290 push_base_cleanups): Likewise.
1291 * method.c (do_build_copy_constructor, do_build_assign_ref,
1292 synthesize_exception_spec): Likewise.
1293 name-lookup.c (arg_assoc_class): Likewise.
1294 * pt.c (instantiate_class_template,
1295 get_template_base_recursive): Likewise.
1296 * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
1297 * typeck2.c (process_init_constructor): Likewise.
1298 * search.c (lookup_base_r, dynamic_cast_base_recurse,
1299 dfs_access_in_type, dfs_walk_real, look_for_overrides,
1300 types_overlap_p, copied_binfo, original_binfo): Likewise.
1301 (binfo_for_vtable): Remove
1302
2ca392fd 13032004-07-20 Steven Bosscher <stevenb@suse.de>
1304
1305 * cp-tree.h (struct lang_decl_flags): Unify the template_info and
1306 thunk_alias, and the access and virtual_offset fields.
1307 (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
1308 * decl.c (finish_case_label): Update c_add_case_node call.
1309
9d47a7f1 13102004-07-19 Mark Mitchell <mark@codesourcery.com>
1311
1312 Revert patch for PR c++/16623.
491e04ef 1313
a9435373 13142004-07-19 Kelley Cook <kcook@gcc.gnu.org>
1315
1316 * except.c: Remove two spurious carriage returns.
1317
d5f9dab3 13182004-07-19 Mark Mitchell <mark@codesourcery.com>
1319
1320 PR c++/16623
1321 * cp-tree.h (lang_type_class): Add lazy_assignment_op.
1322 (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
1323 * class.c (add_implicitly_declared_members): Use
1324 CLASSTYPE_LAZY_ASSIGNMENT_OP.
1325 * method.c (lazily_declare_fn): Clear
1326 CLASSTYPE_LAZY_ASSIGNMENT_OP.
1327 * search.c (lookup_fnfields_1): Check it.
1328
930bdacf 13292004-07-19 Nathan Sidwell <nathan@codesourcery.com>
1330
1331 * class.c (add_method): Delay adding the slot until the end.
1332 (determine_primary_base): Adjust VEC_iterate invokation.
1333 (resort_type_method_vec, finish_struct_methods, warn_hidden,
1334 walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
1335 build_vtbl_initializer): Likewise.
1336 * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
1337 build_vbase_delete): Likewise.
1338 * method.c (do_build_copy_constructor): Likewise.
1339 * name-lookup.c (new_class_binding, print_binding_level,
1340 poplevel_class, store_class_bindings, push_to_top_level,
1341 pop_from_top_level): Likewise.
1342 * pt.c (check_explicit_specialization): Likewise.
1343 * search.c (lookup_conversion_operator, lookup_fnfields_1,
1344 get_pure_virtuals, add_conversions, dfs_check_overlap,
1345 binfo_for_vbase): Likewise.
1346
7c0f0641 13472004-07-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1348
1349 PR c++/12170
1350 * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
1351 innermost set of template arguments during deduction. Simplify.
1352
066f26bf 13532004-07-19 Joseph S. Myers <jsm@polyomino.org.uk>
1354
1355 * typeck.c (build_modify_expr, build_x_modify_expr): Set
1356 TREE_NO_WARNING on assignments with an operator other than '='.
1357
6cec67d6 13582004-07-10 Steven Bosscher <stevenb@suse.de>
1359 Joseph S. Myers <jsm@polyomino.org.uk>
1360
1361 * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
1362 * decl2.c (grokfield): Don't check current_class_depth via
1363 unused TREE_COMPLEXITY.
1364 * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
1365 to avoid the missing parentheses warning.
1366 Don't set C_SET_EXP_ORIGINAL_CODE.
1367
d6828f49 13682004-07-18 Mark Mitchell <mark@codesourcery.com>
1369
57564d52 1370 * tree.c (no_linkage_helper): Remove.
1371 (no_linkage_check): Don't use walk_tree_without_duplicates.
1372
d6828f49 1373 * mangle.c (write_expression): Issue a sorry for zero-operand
1374 functional casts.
1375
c3c0139b 13762004-07-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1377
1378 PR c++/13092
1379 * init.c (build_offset_ref): Build SCOPE_REF with non-null
1380 TREE_TYPE for non-dependent names.
1381 * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
1382 * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
1383 unknown_type_node as its TREE_TYPE.
1384 * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
1385 * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
1386 (dump_expr) <SCOPE_REF case>: Likewise.
1387
dddcebdc 13882004-07-17 Jason Merrill <jason@redhat.com>
1389
1390 PR c++/16115
1391 * call.c (type_passed_as): Make the invisible reference type
1392 __restrict.
1393 * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
1394 cp_genericize_r. Handle invisible reference lowering.
1395 (is_invisiref_parm): New fn.
1396 (cp_genericize): Adjust the types of invisible reference parms.
1397 Don't repeat the walk for clones.
1398 * decl.c (store_parm_decls): Don't generate any code for clones.
1399
e60d3615 14002004-07-17 Joseph S. Myers <jsm@polyomino.org.uk>
1401
1402 * cp-tree.h (builtin_function): Declare.
1403
1827796b 14042004-07-16 Mark Mitchell <mark@codesourcery.com>
1405
1406 * class.c (finish_struct_methods): Remove unncessary code.
1407 (add_implicitly_declared_members): Create declarations for default
1408 constructors and copy constructors lazily.
1409 * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
1410 lazy_copy_ctor.
1411 (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
1412 (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
1413 * decl2.c (check_classfn): Robustify.
1414 (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
1415 (locate_ctor): Handle lazy default constructors.
1416 (locate_copy): Handle lazy copy constructors.
1417 (implicitly_declare_fn): Make sure we're looking at the
1418 TYPE_MAIN_VARIANT for a class before creating functions. Don't
1419 set TYPE_HAS_CONSTRUCTOR.
1420 (lazily_declare_fn): New function.
1421 * name-lookup.c (constructor_name_full): Simplify.
1422 * search.c (lookup_fnfields_1): Lazily create methods, as
1423 necessary.
1424 (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
1425
873f1e89 14262004-07-16 Steven Bosscher <stevenb@suse.de>
1427
1428 * cp-tree.h (struct lang_type): Don't have three GTY options on a
1429 single bit GTY desc.
1430
8e7912a5 14312004-07-16 Richard Henderson <rth@redhat.com>
1432
1433 * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
1434 * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
1435 * tree.c (cp_copy_res_decl_for_inlining): Remove.
1436
5e008ac7 14372004-07-16 Nathan Sidwell <nathan@codesourcery.com>
1438
28c6e5cc 1439 * class.c (finish_struct_bits): Use for loop.
1440 (propagate_binfo_offsets): Do primary binfo outside of loop.
1441
8a176c0b 1442 PR c++/16583
1443 * dump.c (cp_dump_tree): Don't dump the bases if there's no
1444 binfo.
1445
5e008ac7 1446 * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
1447
de5ab3f1 14482004-07-15 Mark Mitchell <mark@codesourcery.com>
1449
1450 * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
1451 has_abstract_assign_ref. Make methods a VEC(tree) *.
1452 (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
1453 (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
1454 (CLASSTYPE_DESTRUCTORS): Likewise.
1455 (TYPE_HAS_REAL_ASSIGN_REF): Remove.
1456 (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
1457 (add_method): Change prototoype.
1458 * class.c (add_method): Remove error_p parameter. Adjust for
1459 changes to CLASSTYPE_METHOD_VEC.
1460 (handle_using_decl): Adjust call to add_method.
1461 (maybe_warn_about_overly_private_class): Adjust for
1462 changes to CLASSTYPE_METHOD_VEC.
1463 (resort_type_method_vec): Likewise.
1464 (finish_struct_methods): Likewise.
1465 (check_for_override): Likewise.
1466 (warn_hidden): Likewise.
1467 (add_implicitly_declared_members): Defer creation of assignment
1468 operators. Adjust call to add_method.
1469 (clone_function_decl): Adjust call to add_method.
1470 (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
1471 (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
1472 * decl.c (grok_special_member_properties): Don't set
1473 TYPE_HAS_ABSTRACT_ASSIGN_REF.
1474 * decl2.c (check_classfn): Adjust for
1475 changes to CLASSTYPE_METHOD_VEC.
1476 * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
1477 (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
1478 (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
1479 (implicitly_declare_fn): Set DECL_SOURCE_LOCATION. Do not call
1480 cp_finish_decl.
1481 * pt.c (check_explicit_specialization): Adjust for
1482 changes to CLASSTYPE_METHOD_VEC.
1483 (instantiate_class_template): Do not set
1484 TYPE_HAS_ABSTRACT_ASSIGN_REF.
1485 * ptree.c (cxx_print_type): Don't try to print
1486 CLASSTYPE_METHOD_VEC.
1487 * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
1488 * search.c (lookup_field_r): Adjust for
1489 changes to CLASSTYPE_METHOD_VEC.
1490 (lookup_fnfields): Likewise.
1491 (lookup_conversion_operator): Likewise.
1492 (lookup_fnfields_1): Likewise. Create assignment operators
1493 lazily.
1494 (look_for_overrides_here): Adjust for
1495 changes to CLASSTYPE_METHOD_VEC.
1496 (add_conversions): Likewise.
1497 * semantics.c (finish_member_declaration): Adjust call to add_method.
1498
97558244 14992004-07-15 Jason Merrill <jason@redhat.com>
1500
1501 * cp-lang.c (cxx_types_compatible_p): To the middle-end,
1502 references and pointers are compatible.
1503
168db9a4 15042004-07-15 Nathan Sidwell <nathan@codesourcery.com>
1505
1506 * decl.c (xref_basetypes): Refactor.
1507 * tree.c (copy_base_binfos): Replace with ...
1508 (copy_binfo): ... this. Deep copy the given binfo, (not the just
1509 bases of the given base).
1510 * cp-tree.h (copy_base_binfo): Remove.
1511 (copy_binfo): Declare.
1512
37b8cd7c 15132004-07-15 Mark Mitchell <mark@codesourcery.com>
491e04ef 1514
1515 * name-lookup.c (set_inherited_value_binding_p): Add class_type
37b8cd7c 1516 parameter.
1517 (get_class_binding): Adjust.
1518 (push_class_level_binding): Don't use set_inherited_value_binding_p.
1519
d9a369a2 15202004-07-15 Nathan Sidwell <nathan@codesourcery.com>
1521
cc6a30ae 1522 * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
b4a0d48d 1523 * decl.c (xref_basetypes): Set it here.
1524
d9a369a2 1525 * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here.
1526 Don't check for incomplete base.
1527 (get_vfield_name): Simplify while loop.
1528 * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here.
1529
d09ae6d5 15302004-07-14 Mark Mitchell <mark@codesourcery.com>
1531
7a252450 1532 * lex.c (cxx_make_type): Remove call to get_pointer_type.
7a252450 1533
d09ae6d5 1534 * cp-tree.h (IDENTIFIER_VALUE): Remove.
1535 (BINFO_PUSHDECLS_MARKED): Likewise.
1536 (maybe_inject_for_scope_var): Likewise.
1537 (push_class_decls): Likewise.
1538 * name-lookup.h (push_class_binding): Remove.
1539 (innermost_non_namespace_value): New function.
1540 (outer_binding): Likewise.
1541 * class.c (add_method): Push bindings before adding to
1542 TYPE_METHODS.
1543 (restore_class_cache): Do not restore class_shadowed.
1544 (pushclass): Do not add USING_DECLs. Do not call
1545 push_class_decls.
1546 * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c.
1547 * decl.c (pushdecl): Use outer_binding.
1548 (poplevel): Set the scope for an out-of-scope for-loop declaration
1549 appropriately.
1550 (cp_finish_decl): Don't call maybe_inject_for_scope_var.
1551 * name-lookup.c (new_class_binding): New function.
1552 (push_binding): Use it.
1553 (pushdecl): Use innermost_non_namespace_value.
1554 (maybe_inject_for_scope_var): Remove.
1555 (push_class_binding): Remove.
1556 (set_inherited_value_binding_p): New function.
1557 (get_class_binding): New function.
1558 (push_class_level_binding): Assert that the current_class_type is
1559 being defined.
1560 (outer_binding): New function.
1561 (innermost_non_namespace_value): Likewise.
1562 (lookup_name_real): Use outer_binding.
1563 (lookup_name_current_level): Ignore out-of-scope variables.
1564 * pt.c (check_template_shadow): Use innermost_non_namespace_value.
1565 (lookup_template_class): Likewise.
1566 * search.c (dfs_push_type_decls): Remove.
1567 (dfs_push_decls): Likewise.
1568 (setup_class_bindings): Likewise.
1569 (lookup_field_1): Handle USING_DECLs from dependent scopes.
1570 (marked_pushdecls_p): Remove.
1571 (unmarked_pushdecls_p): Remove.
1572 (marked_identifiers): Remove.
1573 (setup_class_bindings): Remove.
1574 (dfs_push_type_decls): Remove.
1575 (dfs_push_decls): Remove.
1576 (push_class_decls): Remove.
491e04ef 1577
fa26c7a9 15782004-07-13 Mark Mitchell <mark@codesourcery.com>
1579
6493c502 1580 PR c++/16518
1581 PR c++/16337
1582 * decl.c (grokvardecl): Make declspecs parameter const.
1583 (grokdeclarator): Likewise. Adjust accordingly.
1584 * decl.h (grokdeclarator): Adjust declaration.
1585 * parser.c (cp_parser_init_declarator): Do not clear
1586 decl_specifiers->attributes.
1587
fa26c7a9 1588 * cp-tree.h (lang_identifier): Remove class_value.
1589 (IDENTIFIER_CLASS_VALUE): Remove.
1590 (pop_class_decls): Likewise.
1591 (init_search_processing): Likewise.
1592 * class.c (handle_using_decl): Use lookup_member, not
1593 IDENTIFIER_CLASS_VALUE.
1594 (restore_class_cache): New function, split out from ...
1595 (pushclass): ... here. Do not call clear_identifier_class_values.
1596 (invalidate_class_lookup_cache): Do not clear
1597 IDENTIFIER_CLASS_VALUE.
1598 (popclass): Do not call pop_class_decls.
1599 (maybe_note_name_used_in_class): Do not save names looked up after
1600 the class is complete. Use lookup_member, not
1601 IDENTIFIER_CLASS_VALUE.
1602 * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c.
1603 * decl.c (cxx_init_decl_processing): Do not call
1604 init_search_processing.
1605 * method.c (do_build_copy_constructor): Remove unnecessary code.
1606 (do_build_assign_ref): Likewise.
1607 * name-lookup.c (pushdecl): Use lookup_member, not
1608 IDENTIFIER_CLASS_VALUE.
1609 (set_identifier_type_value_with_scope): Set TREE_TYPE on the
1610 type_shadowed list.
1611 (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE.
1612 (push_class_binding): Do not set it.
1613 (clear_identifier_class_values): Remove.
1614 (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE.
1615 (store_binding): Do not save it.
1616 (pop_from_top_level): Do not restore it.
1617 * name-lookup.h (cxx_saved_binding): Remove class_value.
1618 (clear_identifier_class_values): Remove.
1619 * ptree.c (cxx_print_identifier): Do not print
1620 IDENTIFIER_CLASS_VALUE.
1621 * search.c (search_obstack): Remove.
1622 (push_stack_level): Remove.
1623 (pop_stack_level): Remove.
1624 (search_level): Remove.
1625 (search_stack): Remove.
1626 (lookup_member): Don't check IDENTIFIER_CLASS_VALUE.
1627 (setup_class_bindings): Use IDENTIFIER_MARKED, not
1628 IDENTIFIER_CLASS_VALUE.
1629 (marked_identifiers): New variable.
1630 (push_class_decls): Clear IDENTIFIER_MARKED.
1631 (pop_class_decls): Don't call pop_search_level.
1632 (init_search_processing): Remove.
1633
f75ee12a 16342004-07-12 Mark Mitchell <mark@codesourcery.com>
1635
a144bdb2 1636 * cp-tree.h (get_aggr_typedef): Remove.
1637 * init.c (get_aggr_typedef): Likewise.
1638
f75ee12a 1639 * name-lookup.c (push_class_level_binding): Simplify.
1640
23b84540 16412004-07-12 Andrew Pinski <apinski@apple.com>
1642
1643 PR c++/16475
1644 Revert:
1645 2004-07-07 H.J. Lu <hongjiu.lu@intel.com>
1646 PR c++/16276
1647 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
1648 is not public.
1649
207355ad 16502004-07-12 Eric Christopher <echristo@redhat.com>
1651
1652 * parser.c (cp_parser_class_head): Remove unused variable.
1653
c62b41e8 16542004-07-12 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1655
1656 * decl.c (grok_op_properties): Reject [de-]allocation functions
1657 declared in a namespace, or declared as static.
1658
a6460bf1 16592004-07-12 Nathan Sidwell <nathan@codesourcery.com>
1660
fdd46078 1661 * cp-tree.h (make_binfo): Remove.
1662 * decl.c (xref_basetypes): Use make_tree_binfo directly.
1663 * tree.h (copy_base_binfos): Likewise.
1664 (make_binfo): Remove.
207355ad 1665
a6460bf1 1666 * call.c (build_user_type_conversion_1, build_new_op,
1667 check_constructor_callable, build_temp,
1668 perform_direct_initialization_of_possible): Pass type directly to
1669 lookup_fnfields & build_special_member_call.
1670 (build_special_member_call): Accept a type, and complete it.
1671 * class.c (finish_stuct_bits): Copy the BINFOs here.
1672 * cvt.c (ocp_convert): Pass type directly to
1673 build_special_member_call.
1674 * decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
1675 (xref_basetypes): Allocate the binfo here. Adjust.
1676 * init.c (build_init, build_new_1): Pass type directly to
1677 build_special_member_call.
1678 * lex.c (cxx_make_type): Do not allocate binfo here.
1679 * name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
1680 * parser.c (cp_parser_class_head): Always call xref_basetypes.
1681 * pt.c (instantiate_class_template): Likewise. Inhibit access
1682 checking for template friends.
1683 * ptree.c (cxx_print_type): Adjust record printing.
1684 * search.c (lookup_base): When taking a type, complete it before
1685 looking for a binfo.
1686 (lookup_member): Delay completing a type.
1687 (push_class_decls): Don't walk an incomplete type.
1688 (lookup_conversions): Likewise.
1689 * semantics.c (finish_stmt_expr_expr): Pass type directly to
1690 build_special_member_call.
1691 * tree.c (copy_base_binfos): Adjust.
1692 (make_binfo): Likewise.
1693 * typeck.c (build_modify_expr): Pass type directly to
1694 build_special_member_call.
1695 * typeck2.c (process_init_constructor): Check a binfo exists.
1696 (build_m_component_ref): Allow accessing an incomplete type.
1697 (build_functional_cast): Pass type directly to
1698 build_special_member_call.
1699
d97a7640 17002004-07-12 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1701
1702 PR c++/2204
1703 * config-lang.in (gtfiles): Add typeck2.c.
1704 * Make-lang.in: Tweak typeck2.c dependencies, and add rule for
1705 gt-cp-typeck2.h.
1706 * cp-tree.h: Declare complete_type_check_abstract.
1707 * typeck2.c (pat_calc_hash, pat_compare,
1708 complete_type_check_abstract): New functions.
1709 (abstract_virtuals_error): If the type is abstract, register the
1710 declaration within abstract_pending_vars for further checks.
1711 Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
1712 * decl.c (cp_finish_decl): Do not strip array types.
1713 (create_array_type_for_decl): Check for abstractness of the element
1714 type.
1715 (complete_vars): Call complete_type_check_abstract.
1716 * class.c (finish_struct): Prepare a list of virtual functions for
1717 template types, and call complete_vars on it to check for abstractness.
1718
86752479 17192004-07-12 Paolo Bonzini <bonzini@gnu.org>
1720
1721 PR tree-optimization/14107
1722 * decl.c (finish_function): Remove temporary band-aid.
1723
93c149df 17242004-07-11 Mark Mitchell <mark@codesourcery.com>
1725
614697c5 1726 * call.c (build_operator_new_call): Avoid using push_to_top_level.
1727 (build_new_op): Adjust call to lookup_function_nonclass.
1728 * name-lookup.c (identifier_type_value): Adjust call to
1729 lookup_name_real.
1730 (lookup_name_real): Add block_p parameter.
1731 (lookup_name_nonclass): Adjust call to lookup_name_real.
1732 (lookup_function_nonclass): Likewise.
1733 (lookup_name): Likewise.
1734 * name-lookup.h (lookup_name_real): Change prototype.
1735 (lookup_name_nonclass): Likewise.
1736 * parser.c (cp_parser_lookup_name): Likewise.
1737
93c149df 1738 * cp-tree.h (saved_scope): Make old_bindings a vector.
1739 (unuse_fields): Remove.
1740 * name-lookup.h (cxx_saved_binding): Define it.
1741 * class.c (pushclass): Don't use unuse_fields.
1742 * name-lookup.c (cxx_saved_binding_make): Remove.
1743 (store_binding): Add new bindings to a vector, using an
1744 accumulator style, rather than adding them to a list.
1745 (store_bindings): Adjust accordingly.
1746 (store_class_bindings): Likewise.
1747 (push_to_top_level): Likewise.
1748 (pop_from_top_level): Likewise.
1749 * optimize.c (maybe_clone_body): Must push_to_top_level and
1750 pop_from_top_level calls outside of loop.
1751 * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope
1752 calls here from cp_parser_late_parsing_default_args.
1753 (cp_parser_save_default_args): Record the class type in which the
1754 function is declared.
1755 (cp_parser_late_parsing_default_args): Do not call
1756 push_nested_class/pop_nested_class.
1757 * search.c (dfs_unuse_fields): Remove.
1758 (unuse_fields): Remove.
1759
d458bdd7 17602004-07-11 Joseph S. Myers <jsm@polyomino.org.uk>
1761
1762 * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
1763 LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
1764 * cp-tree.h (poplevel): Declare.
1765 (set_block): Remove.
1766 * decl.c (set_block): Remove.
1767
958b8ee9 17682004-07-10 Mike Stump <mrs@apple.com>
1769
1770 * decl2.c (import_export_class): Never export/import vtables
1771 with inline key functions.
1772
9ac39089 17732004-07-09 Steven Bosscher <stevenb@suse.de>
1774
1775 * typeck.c (c_expand_asm_operands): Remove.
1776
3b7e867a 17772004-07-09 Mike Stump <mrs@apple.com>
1778
1779 * typeck.c (build_class_member_access_expr): Skip null deref
1780 warning when we don't dereference it.
1781
bd04d3e4 17822004-07-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1783
1784 PR c++/8211
1785 PR c++/16165
1786 * class.c (check_field_decls): Improve -Weffc++ warning: do not
1787 warn for pointers to functions/members, or for classes without
1788 destructors.
1789
c028850e 17902004-07-08 Mark Mitchell <mark@codesourcery.com>
1791
1792 * name-lookup.h (struct cp_binding_level): Update documentation
1793 for class_shadowed.
1794
cd752d0f 17952004-07-08 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1796
1797 PR c++/16169
1798 * typeck.c (check_return_expr): Improve -Weffc++ warning: handle
1799 returning CALL_EXPR, and non-reference return type.
1800
78eb3a28 18012004-07-08 Nathan Sidwell <nathan@codesourcery.com>
1802
1803 * name-lookup.c (push_binding): Use VEC_reserve.
1804
6388f9f7 18052004-07-08 Richard Henderson <rth@redhat.com>
1806
1807 * cp-tree.h (expand_eh_spec_block): Remove.
1808
598057ec 18092004-07-07 Mark Mitchell <mark@codesourcery.com>
1810
1811 * cp-tree.h (saved_scope): Remove x_previous_class_type and
1812 x_previous_class_values; add x_previous_class_level.
1813 (previous_class_type): Remove.
1814 (previous_class_values): Remove.
1815 (previous_class_level): New macro.
1816 * class.c (pushclass): Restore the identifier cache more
1817 expeditiously.
1818 (invalidate_class_lookup_cache): Use vector for class_shadowed and
1819 previous_class_values.
1820 * decl.c (poplevel): Likewise.
1821 * name-lookup.c (cxx_binding_init): New function.
1822 (cxx_binding_make): Use it.
1823 (push_binding): For a binding in a class level, use a vector of
1824 cp_class_binding nodes.
1825 (push_binding_level): New function.
1826 (begin_scope): Use it.
1827 (leave_scope): Do not put class binding levels on the free list.
1828 (print_binding_level): Adjust for the fact that class_shadowed is
1829 a vector.
1830 (poplevel_class): Likewise.
1831 (clear_identifier_class_values): Likewise.
1832 (push_class_level_binding): Likewise.
1833 (set_class_shadows): Remove.
1834 (store_binding): New function.
1835 (store_class_bindings): New function.
1836 (push_to_top_level): Use store_class_bindings as appropriate.
1837 (pop_from_top_level): Use previous_class_level, not
1838 previous_class_type.
1839 * name-lookup.h (cp_class_binding): New type.
1840 (cp_binding_level): Use a vector object for class_shadowed.
1841 (push_binding_level): Declare.
1842 (set_class_shadows): Remove.
1843
5d9306d9 18442004-07-07 Andrew Pinski <apinski@apple.com>
1845
1846 * class.c (instantiate_type): BUFFER_REF is dead.
1847 * lex.c (init_operators): IN_EXPR is dead.
1848
6c3aae46 18492004-07-07 Jason Merrill <jason@redhat.com>
1850
1851 PR c++/16334
1852 * call.c (build_new_op): Give overload warnings for built-in
1853 candidates.
1854
89c44bf0 18552004-07-07 H.J. Lu <hongjiu.lu@intel.com>
1856
1857 PR c++/16276
1858 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
1859 is not public.
1860
2cfde4f3 18612004-07-07 Nathan Sidwell <nathan@codesourcery.com>
1862
1863 * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
1864 * class.c (build_primary_vtable, check_bases,
1865 determine_primary_base, finish_struct_bits,
1866 maybe_warn_about_overly_private_class, dfs_find_final_overrider_q,
1867 get_basefndecls, warn_hidden, walk_subobject_offsets,
1868 build_base_fields, create_vtable_ptr, propagate_binfo_offsets,
1869 layout_virtual_bases, end_of_class, warn_about_ambiguous_bases,
1870 finish_struct_1, get_vfield_name, contains_empty_class_p,
1871 dump_class_hierarchy_r, finish_vtbls, build_vtt_inits,
1872 dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits,
1873 add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust
1874 BINFO macros.
1875 * decl.c (xref_basetypes): Likewise.
1876 * dump.c (cp_dump_tree): Likewise.
1877 * error.c (dump_expr): Likewise.
1878 * init.c (sort_mem_initializers, expand_member_init,
1879 push_base_cleanups): Likewise.
1880 * method.c (do_build_copy_constructor, do_build_assign_reg,
1881 synthesize_exception_spec): Likewise.
5e008ac7 1882 * name-lookup.c (arg_assoc_class): Likewise.
2cfde4f3 1883 * pt.c (instantiate_class_template, tsubst,
5e008ac7 1884 get_template_base_recursive): Likewise.
1885 * ptree.c (cxx_print_type): Likewise.
2cfde4f3 1886 * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
1887 * search.c (lookup_base_r, dynamic_cast_base_recurse,
1888 dfs_access_in_type, access_in_type, lookup_field_queue_p,
1889 bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp,
1890 marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp,
1891 dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet,
1892 binfo_for_vtable, copied_binfo, original_binfo): Likewise
1893 * tree.c (copy_base_binfos, make_binfo): Likewise.
1894 * typeck.c (commmon_base_type): Likewise
1895 * typeck2.c (process_init_constructor): Likewise
1896
036dda9d 18972004-07-06 Joseph S. Myers <jsm@polyomino.org.uk>
1898
1899 * decl.c (check_tag_decl): Name redeclared type in diagnostic.
1900
f551ed05 19012004-07-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1902
1903 PR c++/3671
1904 * pt.c (convert_nontype_argument): Disallow conversions between
1905 different enumeration types.
1906
57c28194 19072004-07-06 Nathan Sidwell <nathan@codesourcery.com>
1908
1909 * cp-tree.h (BINFO_MARKED): Remove.
1910 (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED,
1911 BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P,
1912 BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n.
1913 (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P.
1914 * class.c (build_base_path): Use BINFO_VIRTUAL_P.
1915 (mark_primary_bases, determine_primary_base, base_derived_from,
1916 dfs_find_final_overrider, dfs_find_final_overrider_q,
1917 dfs_find_inal_overrider_post, update_vtable_entry_for_fn,
1918 dfs_modify_vtables, walk_subobject_offsets,
1919 layout_nonempty_base_or_field, build_base_field,
1920 build_base_fields, propagate_binfo_offsets, layout_virtual_bases,
1921 end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable,
1922 finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits,
1923 build_ctor_vtbl_group, accumulate_vtble_inits,
1924 dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries,
1925 build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r,
1926 add_vcall_offset_vtbl_entries_1): Likewise.
1927 * decl.c (xref_basetypes): Incomming virtual base indicated by
1928 TREE_TYPE. Adjust.
1929 * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P.
1930 * init.c (finish_init_stmts, sort_mem_initializers,
1931 emit_mem_initializers, build_vtble_address, expand_member_init,
1932 push_base_cleanups): Likewise.
1933 * method.c (do_build_copy_constructor): Likewise.
1934 * pt.c (instantiate_class_template,
1935 get_template_base_recursive): Likewise.
1936 * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init,
1937 get_pseudo_ti_desc): Likewise.
1938 * search.c (lookup_base_r, dynamic_cast_base_recurse,
1939 binfo_from_vbase, binfo_via_virtual, copied_binfo,
1940 original_binfo): Likewise.
1941 * semantics.c (finish_base_specifier): Virtualness is indicated
1942 by TREE_TYPE.
1943 * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P.
1944
43895b7f 19452004-07-06 Mark Mitchell <mark@codesourcery.com>
1946
1947 Revert:
1948 2004-06-24 Jason Merrill <jason@redhat.com>
1949 PR c++/16115
1950 * decl.c (grokparms): Give the PARM_DECL reference type if the
1951 parameter is passed by invisible reference.
1952
1f8a6ff8 19532004-07-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
1954
1955 * cp-lang.c (cp_var_mod_type_p): Add extra arg.
1956 * decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
1957 * pt.c (check_instantiated_args, unify): Likewise.
1958
a00dec3b 19592004-07-05 Phil Edwards <phil@codesourcery.com>
1960
1961 * Make-lang.in (check-c++, lang_checks): Add some comments.
1962
b55af61c 19632004-07-05 Zack Weinberg <zack@codesourcery.com>
1964
1965 * cp-mudflap.c: Delete file.
1966 * Makefile.in: Remove all references to cp-mudflap.o.
1967
0366834b 19682004-07-05 Zack Weinberg <zack@codesourcery.com>
1969
1970 * decl.c (cxx_init_decl_processing): Call
1971 build_common_tree_nodes before creating the global NAMESPACE_DECL.
1972
d9ea5003 19732004-07-05 Giovanni Bajo <giovannibajo@gcc.gnu.org>
1974
1975 PR c++/2518
1976 * call.c (build_operator_new_call): Look only at global scope.
1977
3cb98335 19782004-07-05 Nathan Sidwell <nathan@codesourcery.com>
1979
1980 * call.c (enforce_access): Expect TREE_BINFO.
1981 * class.c (binfo_ctor_vtable): Check TREE_BINFO.
1982 * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
1983 (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
1984 Adjust.
1985 (BINFO_LANG_ELTS): Remove.
1986 (BINFO_LANG_SLOTS): New.
1987 (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1988 (CLASSTYPE_TEMPLATE_INFO): Adjust.
1989 * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
1990 * search.c (lookup_member): Check TREE_BINFO.
1991 * semantics.c (perform_or_defer_access_check): Likewise.
1992 (check_accessibility_of_qualified_id): Check
1993 deferred_access_no_check.
1994 * tree.c (make_binfo): Use make_tree_binfo.
1995
e844c6fe 19962004-07-04 Mark Mitchell <mark@codesourcery.com>
1997
1998 * method.c (implicitly_declare_fn): Set linkage of generated
1999 functions.
2000
e8825bb0 20012004-07-04 Richard Henderson <rth@redhat.com>
2002
2003 * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
2004
20052004-07-03 Scott Brumbaugh <scottb.lists@verizon.net>
2006
2007 PR c++/3761
2008 * name-lookup.c (push_class_level_binding): Don't pass a
2009 TREE_LIST of ambiguous names to check_template_shadow as it
2010 only handles declarations. Instead, pull the declaration
2011 out and pass that.
93ceb69b 2012
58cf9bfa 20132004-07-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2014
2015 PR c++/14971
2016 * pt.c (check_explicit_specialization): Clarify error message.
2017
67c155cb 20182004-07-02 Richard Henderson <rth@redhat.com>
2019
2020 * tree.c (cp_unsave_r): Update remap_save_expr call.
2021
d92cdb26 20222004-07-02 Mark Mitchell <mark@codesourcery.com>
2023
f10ff0e0 2024 PR c++/16240
2025 * mangle.c (write_template_arg): Correct mangling.
2026
7644948e 2027 PR c++/16297
d92cdb26 2028 * decl.c (grokdeclarator): Robustify.
2029
735f4358 20302004-07-01 Richard Henderson <rth@redhat.com>
2031
2032 * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
2033 * method.c (synthesize_method): Don't clear_last_expr.
2034 * name-lookup.c (maybe_push_cleanup_level): Likewise.
2035
52d6bee4 20362004-07-01 Nick Clifton <nickc@redhat.com>
2037
2038 * decl2.c (import_export_class): Invoke the
2039 import_export_class field in the gcc_target structure if it is not
2040 empty.
2041
cfa4c52f 20422004-06-30 Richard Henderson (rth@redhat.com>
2043
2044 * decl.c (start_preparsed_function): Don't set immediate_size_expand.
2045 * method.c (use_thunk): Likewise.
2046
8f9758e6 20472004-06-30 Joseph S. Myers <jsm@polyomino.org.uk>
2048
2049 * call.c (build_over_call), typeck.c (build_function_call): Call
2050 check_function_arguments instead of check_function_format.
2051
1b1f2444 20522004-06-30 Joseph S. Myers <jsm@polyomino.org.uk>
2053
2054 * call.c (build_over_call), typeck.c (build_function_call): Update
2055 calls to check_function_format.
2056
30284d7a 20572004-06-30 Richard Henderson <rth@redhat.com>
2058
2059 * call.c (build_over_call): Use __builtin_memcpy for copying
2060 CLASS_AS_BASE rather than funny casting.
2061
5ef071a3 20622004-06-30 Richard Henderson <rth@redhat.com>
2063
2064 * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and
2065 TYPE_SIZE_UNIT of full_type.
2066
357f7efa 20672004-06-30 Per Bothner <per@bothner.com>
2068
2069 Conditionally compile support for --enable-mapped_location.
2070 * decl.c (pop_label): Handle (imperfectly) USE_MAPPED_LOCATION case.
2071 * decl2.c: If USE_MAPPED_LOCATION, don't do some line number
2072 adjustments - which I don't understand.
2073 * error.c (dump_decl): Rename "<interrnal>" to "<built-in>".
2074 * error.c: Use LOCATION_FILE and EXPR_LOCATION macros.
2075 (print_instantiation_partial_context): Use expand_location.
2076 * decl.c (duplicate_decl): Use new DECL_IS_BUILTIN macro.
2077 * name-lookup.c: Likewise.
2078 * lex.c (cxx_init): Likewise. Also use BUILTINS_LOCATION.
2079 * name-lookup.c: Use input_line macro.
2080 * parser.c (cp_lexer_get_preprocessor_token): Use UNKNOWN_LOCATION.
2081 (cp_parser_statement): Rename locaal variable statement_locus to
2082 statement_location and use SET_EXPR_LOCATION macro.
2083 * pt.c: Handle USE_MAPPED_LOCATION case. Use new macros.
2084 * tree.c (cp_walk_subtrees): Likewise.
2085
c7f01ad5 20862004-06-29 Per Bothner <per@bothner.com>
2087
2088 * tree.c (build_min_nt, build_min, build_min_non_dep):
2089 Don't set TREE_COMPLEXITY from input_line.
2090
600f4be7 20912004-06-29 Paul Brook <paul@codesourcery.com>
2092
2093 * init.c: Include target.h.
2094 (get_cookie_size): Remove and replace with target hook.
2095 Update callers.
2096 (build_new_1): Store the element size in the cookie.
2097
a8ff8672 20982004-06-29 Nathan Sidwell <nathan@codesourcery.com>
2099
2100 PR c++/16260
2101 * parser.c (cp_parser_template_declaration_after_export): Disable
2102 access checks here ...
2103 (cp_parser_class_specifier): ... not here.
2104
36066e37 21052004-06-28 Nathan Sidwell <nathan@codesourcery.com>
2106
2107 * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
2108 VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
2109 BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate
2110 TREE_CHECK macro.
2111
fc40d314 21122004-06-28 Nathan Sidwell <nathan@codesourcery.com>
2113
2114 * cp-tree.h (struct deferred_access): Move to ...
2115 * semantics.c (struct deferred_access): ... here. Adjust.
2116 (deferred_access_stack): Make a VEC(deferred_access),
2117 (deferred_access_free_list): Remove.
2118 (deferred_access_no_check): New.
2119 (push_deferring_access_checks, resume_deferring_access_checks,
2120 stop_deferring_access_checks, pop_deferring_access_checks,
2121 get_deferred_access_checks, pop_to_parent_deferring_access_checks,
2122 perform_deferred_access_checks, perform_or_defer_access_check): Adjust.
2123
c344b0fe 21242004-06-28 Nathan Sidwell <nathan@codesourcery.com>
2125
a8ff8672 2126 PR c++/16174
bb560c37 2127 * call.c (build_temp): Declare.
2128 (check_constructor_callable): New.
2129 (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
2130 CONSTRUCTOR_CALLABLE.
2131 (convert_like_real, initialize_reference): Use
2132 check_constructor_callable.
2133 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
2134 (LOOKUP_*): Renumber.
2135
fc40d314 21362004-06-28 Nathan Sidwell <nathan@codesourcery.com>
2137
c344b0fe 2138 * friend.c (add_friend): Only perform access checks when context
2139 is a class.
2140 * lex.c (cxx_make_type): Only create a binfo for aggregate types.
2141 * parser.c (cp_parser_class_specifier): Disable access checks here
2142 when parsing the body of a templated class.
2143 * semantics.c (perform_or_defer_access_checks): Reorder to allow
2144 NULL binfos when not checking access.
2145
97c118b9 21462004-06-28 Nathan Sidwell <nathan@codesourcery.com>
2147
2148 Use vector API for vbase list.
2149 * cp-tree.h: Include vec.h
2150 (DEF_VEC_P (tree)): New type.
2151 (struct lang_type_class): Change vbase's member type.
2152 (binfo_for_vbase): Declare.
2153 * class.c (determine_primary_base, base_derived_from,
2154 update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
2155 warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
2156 build_vtbl_initializer): Adjust.
2157 * decl.c (xref_basetypes): Adjust, accumulate upper bound of
2158 vbases.
2159 * init.c (sort_mem_initializers, expand_member_init,
2160 push_base_cleanups): Adjust.
2161 * method.c (do_build_copy_constructor): Adjust.
2162 * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
2163 (binfo_for_vbase): New.
2164 * tree.c (copy_base_binfos): Adjust.
2165
fc1ad922 21662004-06-28 Mark Mitchell <mark@codesourcery.com>
2167
2168 * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
2169
32ce9847 21702004-06-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
2171
0366834b 2172 PR c++/14123
32ce9847 2173 * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
2174 paranthesis in case of pointers to array members.
2175 * error.c (dump_type_prefix): Likewise.
2176 (dump_type_suffix): Maybe issue a whitespace when printing
0366834b 2177 ARRAY_TYPE.
32ce9847 2178
dd9b4af4 21792004-06-27 Mark Mitchell <mark@codesourcery.com>
2180
2181 PR c++/16193
2182 * parser.c (cp_parser_set_decl_spec_type): Refine test for
2183 redefinition of built-in types.
2184
573c13ef 21852004-06-27 Gabriel Dos Reis <gdr@integrable-solutions.net>
2186
2187 * error.c (pp_template_argument_list_start): Remove.
2188 (pp_template_argument_list_end): Likewise.
2189 (pp_separate_with_comma): Use pp_cxx_separate_with.
2190 (reinit_global_formatting_buffer): Remove.
2191 (pp_non_consecutive_character): Likewise.
2192 (dump_scope): Use pp_cxx_colon_colon.
2193 (dump_template_parameter): Use pp_cxx_identifier,
0366834b 2194 pp_cxx_tree_identifier and pp_cxx_whitespace.
573c13ef 2195 (dump_templat_bindings): Replace use of pp_string with sequence
2196 of pp_cxx_whitespace and pp_equal.
2197 (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
2198 pp_cxx_colon_colon, pp_cxx_whitespace throughout. Don't set
0366834b 2199 padding here.
573c13ef 2200 (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
2201 (dump_type_prefix): Don't set padding. Use pp_cxx_whitespace,
2202 pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
2203 (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
2204 pp_cxx_right_bracket, pp_cxx_identifier throughout,
2205 (dump_decl): Likewise.
2206 (dump_template_decl): Likewise.
2207 (dump_function_decl): Likewise. Set padding as appropriate.
2208 (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
0366834b 2209 pp_cxx_right_paren.
573c13ef 2210 (dump_exception_spec): Likewise.
2211 (dump_function_name): Use pp_cxx_tree_identifier and
0366834b 2212 pp_cxx_identifier.
573c13ef 2213 (dump_template_parms): Use pp_cxx_begin_template_argument_list and
2214 pp_cxx_end_template_argument_list.
2215 (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
2216 pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
0366834b 2217 pp_cxx_whitespace throughout.
573c13ef 2218 (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
0366834b 2219 pp_cxx_right_paren.
573c13ef 2220 (dump_unary_op): Likewise.
2221 (reinit_cxx_pp): New function.
2222 (type_as_string); Use it.
2223 (expr_as_string): Likewise.
2224 (decl_as_string); Likewise.
2225 (context_as_string): Likewise.
2226 (lang_decl_name): Likewise.
2227 (decl_to_string): Likewise.
2228 (expr_to_string): Likewise.
2229 (parm_to_string): Likewise.
2230 (type_to_string): Likewise.
2231 (args_to_string): Likewise.
2232 (cv_to_string): Likewise.
2233
2cfb6cde 22342004-06-26 Mark Mitchell <mark@codesourcery.com>
2235
2236 * cp-tree.h (cp_cv_quals): New type.
2237 (cp_declarator): Use it instead of "tree" as appropriate.
2238 (grok_method_quals): Adjust prototype.
2239 (grokclassfn): Likewise.
2240 (do_friend): Likewise.
2241 * decl.c (grokfndecl): Use cp_cv_quals, not tree.
2242 (grokdeclarator): Likewise.
2243 * decl2.c (grok_method_quals): Likewise.
2244 (grokclassfn): Likewise.
2245 * friend.c (do_friend): Likewise.
2246 * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
2247 * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
2248 (make_pointer_declarator): Likewise.
2249 (make_reference_declarator): Likewise.
2250 (make_ptrmem_declarator): Likewise.
2251 (cp_parser_ptr_operator): Likewise.
2252 (cp_parser_cv_qualifier_seq_opt): Likewise.
2253 (cp_parser_cv_qualifier_opt): Remove.
2254 (cp_parser_new_declarator_opt): Adjust call to
2255 cp_parser_ptr_operator.
2256 (cp_parser_conversion_declaration_opt): Likewise.
2257 (cp_parser_declarator): Use cp_cv_quals, not tree.
2258 (cp_parser_direct_declarator): Likewise.
2259
7dd37241 22602004-06-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2261
2262 * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
2263 Rename DECL_STMT to DECL_EXPR.
2264 * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
2265 * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
2266 * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
2267
1fec0e58 22682004-06-26 Jan Hubicka <jh@suse.cz>
2269
2270 PR C++/14865
2271 * decl2.c (maybe_emit_vtables): Always import_export_vtable for the
2272 reachability analysis.
2273
d373b82f 22742004-06-25 Mark Mitchell <mark@codesourcery.com>
2275
2276 * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
2277 2004-06-23 change.
2278
c1dc02de 22792004-06-25 Paul Brook <paul@codesourcery.com>
2280
2281 * decl2.c (get_guard): Call targetm.cxx.guard_type.
2282 (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
2283
c802bb91 22842004-06-24 Mark Mitchell <mark@codesourcery.com>
2285
2286 * decl.c (grokdeclarator): Restore error messages about __thread.
2287 * parser.c (cp_parser_decl_specifier_seq): Likewise.
2288
b58cfaa6 22892004-06-24 Jason Merrill <jason@redhat.com>
2290
2291 PR c++/16115
2292 * decl.c (grokparms): Give the PARM_DECL reference type if the
2293 parameter is passed by invisible reference.
2294
3fb4d428 22952004-06-24 Andreas Schwab <schwab@suse.de>
2296
2297 * cp-tree.h (enum cp_storage_class): Remove trailing comma.
2298
4b9b2871 22992004-06-23 Mark Mitchell <mark@codesourcery.com>
2300
2301 * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
2302 (cp/decl.o): Likewise.
2303 (cp/decl2.o): Likewise.
2304 (cp/pt.o): Likewise.
2305 (cp/semantics.o): Likewise.
2306 * config-lang.in (gtfiles): Do not reference cp/lex.h.
2307 * class.c: Do not include lex.h.
2308 (add_implicitly_declared_members): Do not use
2309 adding_implicit_members.
2310 (check_bases_and_members): Do not talk about grok_x_components.
2311 * cp/cp-tree.h (adding_implicit_members): Remove.
2312 (cp_storage_class): New type.
2313 (cp_decl_spec): Likewise.
2314 (cp_decl_specifier_seq): Likewise.
2315 (cp_parameter_declarator): Use it for the decl_specifiers field.
2316 (check_tag_decl): Adjust prototype.
2317 (shadow_tag): Likewise.
2318 (groktypename): Likewise.
2319 (start_decl): Likewise.
2320 (start_function): Likewise.
2321 (start_method): Likewise.
2322 (grok_x_components): Remove.
2323 (grokfield): Adjust prototype.
2324 (grokbitfield): Likewise.
2325 (finish_member_class_template): Remove.
2326 * decl.c: Do not include lex.h.
2327 (adding_implicit_members): Do not define.
2328 (check_tag_decl): Do not use trees to represent decl-specifiers.
2329 (shadow_tag): Likewise.
2330 (groktypename): Likewise.
2331 (start_decl): Likewise.
2332 (grokvardecl): Likewise.
2333 (grokdeclarator): Likewise.
2334 (grokparms): Likewise.
2335 (start_function): Likewise.
2336 (start_method): Likewise.
2337 * decl.h (grokdeclarator): Adjust prototype.
2338 * decl2.c: Do not include lex.h.
2339 (grok_x_components): Remove.
2340 (grokfield): Do not use trees to represent decl-specifiers.
2341 (grokbitfield): Likewise.
2342 * lex.c: Do not include lex.h.
2343 * lex.h: Remove.
2344 * parser.c: Include target.h.
2345 (clear_decl_specs): New function.
2346 (cp_parser_translation_unit): Do not use trees to represent
2347 decl-specifiers.
2348 (cp_parser_postfix_expression): Likewise.
2349 (cp_parser_new_type_id): Likewise.
2350 (cp_parser_condition): Likewise.
2351 (cp_parser_simple_declaration): Likewise.
2352 (cp_parser_decl_specifier_seq): Likewise.
2353 (cp_parser_function_specifier_opt): Likewise.
2354 (cp_parser_conversion_type_id): Likewise.
2355 (cp_parser_template_parameter): Likewise.
2356 (cp_parser_explicit_instantiation): Likewise.
2357 (cp_parser_type_specifier): Likewise.
2358 (cp_parser_simple_type_specifier): Likewise.
2359 (cp_parser_init_declarator): Likewise.
2360 (cp_parser_type_id): Likewise.
2361 (cp_parser_type_specifier_seq): Likewise.
2362 (cp_parser_parameter_declaration): Likewise.
2363 (cp_parser_member_declaration): Likewise.
2364 (cp_parser_exception_declaration): Likewise.
2365 (cp_parser_function_definition_from_specifiers_and_declarator):
2366 Likewise.
2367 (cp_parser_single_declaration): Likewise.
2368 (cp_parser_save_member_function_body): Likewise.
2369 (cp_parser_friend_p): Likewise.
2370 (cp_parser_set_storage_class): New function.
2371 (cp_parser_set_decl_spec_type): Likewise.
2372 * pt.c: Do not include lex.h.
2373 * semantics.c: Likewise.
0366834b 2374 (finish_member_class_template): Remove.
2375
c98c59df 23762004-06-23 Roger Sayle <roger@eyesopen.com>
2377
2378 * call.c (build_cxx_call): Don't call expand_tree_builtin. No
2379 longer take both "args" and "convert_args" as arguments.
2380 (build_op_delete_call): Update call to build_cxx_call.
2381 (build_over_call): Likewise, update call to build_cxx_call.
2382 * cp-tree.h (build_cxx_call): Update funtion prototype.
2383 * typeck.c (build_function_call): Don't call expand_tree_builtin.
2384 * rtti.c (throw_bad_cast): Update call to build_cxx_call.
2385 (throw_bad_typeid): Likewise.
2386 (build_dynamic_cast_1): Likewise.
2387
215e2f1d 23882004-06-22 Richard Henderson <rth@redhat.com>
2389
2390 * class.c (build_vfn_ref): Take a pointer not object. Build
2391 an OBJ_TYPE_REF.
2392 (cp_fold_obj_type_ref): New.
2393 * call.c (build_over_call): Update build_vfn_ref call.
2394 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
2395 * cp-tree.h (cp_fold_obj_type_ref): Declare.
2396
acd40879 23972004-06-21 Jason Merrill <jason@redhat.com>
2398
27dd3aae 2399 PR c++/16112
2400 * cp-gimplify.c (cp_gimplify_init_expr): Look through
2401 CLEANUP_POINT_EXPR.
acd40879 2402
3046c0a3 24032004-06-21 Mark Mitchell <mark@codesourcery.com>
2404
2405 * cp-tree.def (NEW_EXPR): Add a fourth slot.
2406 * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
2407 (TREE_PARMLIST): Likewise.
2408 (CALL_DECLARATOR_PARMS): Likewise.
2409 (CALL_DECLARATOR_QUALS): Likewise.
2410 (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
2411 (cp_declarator_kind): New type.
2412 (cp_parameter_declarator): Likewise.
2413 (cp_declarator): Likewise.
2414 (cp_error_declarator): Likewise.
2415 (no_parameters): Likewise.
2416 (groktypename): Change prototype.
2417 (start_decl): Likewise.
2418 (start_handler_parms): Likewise.
2419 (get_scope_of_declarator): Likewise.
2420 (start_function): Likewise.
2421 (start_preparsed_function): New function.
2422 (start_function): Change prototype.
2423 (start_method): Likewise.
2424 (grokfield): Likewise.
2425 (grokbitfield): Likewise.
2426 (build_new): Likewise.
2427 (make_pointer_declarator): Remove.
2428 (make_reference_declarator): Likewise.
2429 (make_call_declarator): Likewise.
2430 (set_quals_and_spec): Likewise.
2431 (process_template_parm): Change prototype.
2432 (begin_function_definition): Remove.
2433 (finish_parmlist): Remove.
2434 * decl.c (groktypename): Do not use trees to represent
2435 declarators.
2436 (start_decl): Likewise.
2437 (start_handler_parms): Remove.
2438 (get_scope_of_declarator): Reimplement.
2439 (grokdeclarator): Do not use trees to represent declarators.
2440 (grokparms): Likewise.
2441 (start_function): Likewise.
2442 (start_method): Likewise.
2443 (build_void_list_mode): Do not use TREE_PARMLIST.
2444 * decl.h (grokdeclarator): Change prototype.
2445 * decl2.c (grok_method_quals): Robustify.
2446 (grok_x_components): Do not use trees to represent declarators.
2447 (grokfield): Likewise.
2448 (grokbitfield): Likewise.
2449 (start_objects): Build FUNCTION_DECLs, not declarators.
2450 (start_static_storage_duration_function): Likewise.
2451 * init.c (build_new): Simplify.
2452 * lex.c (make_pointer_declarator): Remove.
2453 (make_reference_declarator): Likewise.
2454 (make_call_declarator): Likewise.
2455 (set_quals_and_spec): Likewise.
2456 * method.c (use_thunk): Use start_preparsed_function.
2457 (synthesize_method): Likewise.
2458 (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
2459 * optimize.c (maybe_clone_body): Use start_preparsed_function.
2460 * parser.c (cp_error_declarator): New variable.
2461 (declarator_obstack): Likewise.
2462 (alloc_declarator): New function.
2463 (make_declarator): Likewise.
2464 (make_id_declarator): Likewise.
2465 (make_pointer_declarator): Likewise.
2466 (make_reference_declarator): Likewise.
2467 (make_ptrmem_declarator): Likewise.
2468 (make_call_declarator): Likewise.
2469 (make_array_declarator): Likewise.
2470 (no_parameters): New variable.
2471 (make_parameter_declarator): Likewise.
2472 (cp_parser_check_for_definition_in_return_type): Do not use trees
2473 to represent declarators.
2474 (cp_parser_translation_unit): Likewise.
2475 (cp_parser_new_expression): Likewise.
2476 (cp_parser_new_type_id): Likewise.
2477 (cp_parser_new_declarator_opt): Likewise.
2478 (cp_parser_direct_new_declarator): Likewise.
2479 (cp_parser_condition): Likewise.
2480 (cp_parser_declaration_statement): Likewise.
2481 (cp_parser_declaration): Likewise.
2482 (cp_parser_conversion_type_id): Likewise.
2483 (cp_parser_conversion_declarator_opt): Likewise.
2484 (cp_parser_template_parameter_list): Likewise.
2485 (cp_parser_template_parameter): Likewise.
2486 (cp_parser_explicit_instantiation): Likewise.
2487 (cp_parser_init_declarator): Likewise.
2488 (cp_parser_declarator): Likewise.
2489 (cp_parser_direct_declarator): Likewise.
2490 (cp_parser_type_id): Likewise.
2491 (cp_parser_parameter_declaration_clause): Likewise.
2492 (cp_parser_parameter_declaration_list): Likewise.
2493 (cp_parser_parameter_declaration): Likewise.
2494 (cp_parser_member_declaration): Likewise.
2495 (cp_parser_exception_declaration): Likewise.
2496 (cp_parser_check_declarator_template_parameters): Likewise.
2497 (cp_parser_function_definition_from_specifiers_and_declarator):
2498 Likewise.
2499 (cp_parser_save_member_function_body): Likewise.
2500 * pt.c (process_template_parm): Add is_non_type parameter.
2501 (convert_template_argument): Adjust call to groktypename.
2502 (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
2503 (tsubst): Do not expect declarators.
2504 (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
2505 argument.
2506 (instantiate_decl): Use start_preparsed_function.
2507 * semantics.c (begin_function_definition): Remove.
2508 (finish_parmlist): Remove.
2509 * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
2510 declarators.
2511
6374121b 25122004-06-21 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2513
2514 * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
2515 (build_new_method_call): Likewise.
2516 * decl.c (local_variable_p_walkfn): Don't walk into types.
2517 * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
2518 (build_anon_union_vars): Add new operand for COMPONENT_REF.
2519 * init.c (buld_new): Add new operand for ARRAY_REF.
2520 * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
2521 (do_build_assign_ref): Likewise.
2522 * parser.c (cp_parser_direct_new_declarator): Add new operands
2523 for ARRAY_REF.
2524 (cp_parser_direct_declarator): Likewise.
2525 * pt.c (tsubst): Likewise.
2526 (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
2527 for COMPONENT_REF.
2528 * semantics.c (finish_non_static_data_member): Add new operand
2529 for COMPONENT_REF.
2530 * typeck.c (build_class_member_access_expr): Likewise.
2531 (build_class_member_access_expr, finish_class_member_access_expr):
2532 Likewise.
2533 (build_ptrmemfunc_access_expr): Likewise.
2534 (build_array_ref): Add new operands for ARRAY_REF.
2535 * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
2536 * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
2537
c857cd60 25382004-06-21 Richard Henderson <rth@redhat.com>
2539
2540 * dump.c (cp_dump_tree): Don't use dump_next_stmt.
2541 * parser.c (cp_parser_jump_statement): Update commentary.
2542 * pt.c (tsubst_expr): Use RETURN_EXPR.
2543 * semantics.c (finish_return_stmt): Likewise.
2544 (finalize_nrv_r): Likewise.
2545 * typeck.c, typeck2.c: Update file start commentary.
2546
2569a1be 25472004-06-21 Richard Henderson <rth@redhat.com>
2548
2549 * semantics.c (finish_expr_stmt): Call verify_sequence_points.
2550
73d4090e 25512004-06-20 Richard Henderson <rth@redhat.com>
2552
2553 * cp-tree.h (add_decl_stmt): Declare.
2554 * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
2555 * semantics.c (maybe_cleanup_point_expr): New.
2556 (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
2557 finish_for_expr, finish_switch_cond): Use it.
2558 (finalize_nrv_r): Don't build an EXPR_STMT. Don't frob TREE_CHAIN.
2559
dddab69e 25602004-06-20 Richard Henderson <rth@redhat.com>
2561
2562 * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
2563 * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
2564 (cp_gimplify_expr): Call it.
2565 (gimplify_cleanup_stmt): Move from c-gimplify.c.
2566 (cp_genericize): New.
2567 * decl.c (finish_function): Call it.
2568 * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
2569 (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
2570 (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
2571 (cp_genericize): Declare.
2572 * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
2573 * dump.c (cp_dump_tree): Likewise.
2574 * semantics.c (push_cleanup): Move from c-semantics.c.
2575
146c1b4f 25762004-06-20 Zack Weinberg <zack@codesourcery.com>
2577
2578 * cp-lang.c (has_c_linkage): Implement.
2579
2580 * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
2581 * decl.c (duplicate_decls): Use COPY_DECL_RTL.
2582 (builtin_function_1): Don't call make_decl_rtl.
2583 (build_cp_library_fn): Don't call set_mangled_name_for_decl.
2584 (grokvardecl): Don't call mangle_decl.
2585 * except.c (nothrow_libfn_p): Look at DECL_NAME, not
2586 DECL_ASSEMBLER_NAME.
2587 * method.c (set_mangled_name_for_decl): Delete.
2588 * name-lookup.c (pushdecl): When a local extern shadows a
2589 file-scope declaration of the same object, give both DECLs the
2590 same DECL_UID.
2591 * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
2592 on DECL_ASSEMBLER_NAME.
2593
8495c0ca 25942004-06-19 Richard Henderson <rth@redhat.com>
2595
2596 * cp-gimplify.c: Remove unnecessary prototypes.
2597 (cp_gimplify_stmt): Merge into ...
2598 (cp_gimplify_expr): ... here. Move to end of file. Handle
2599 stmts_are_full_exprs_p frobbing.
2600 * cp-tree.h (cp_gimplify_stmt): Remove.
2601 * pt.c (tsubst_expr): Merge prep_stmt and unify.
2602 * tree.c (init_tree): Don't set lang_gimplify_stmt.
2603
2b4cffe7 26042004-06-18 Richard Henderson <rth@redhat.com>
2605
2606 PR c++/16034
2607 * semantics.c (begin_cond): New.
2608 (finish_cond): Rewrite to handle template DECL_STMTs specially.
2609 Assume that non-template decls go land before the conditional.
2610 (simplify_loop_decl_cond): Likewise.
146c1b4f 2611 (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
2b4cffe7 2612 finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
2613 begin_switch_stmt, finish_switch_cond): Update to match.
2614
bbdcc797 26152004-06-17 Jason Merrill <jason@redhat.com>
2616
2617 PR c++/16015
2618 * semantics.c (simplify_aggr_init_expr): Don't return the slot.
2619 (finish_stmt_expr_expr): Update type after conversions.
2620 (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
2621 Handle void initializer.
2622 * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
2623
31da194e 26242004-06-17 Geoffrey Keating <geoffk@apple.com>
2625
2626 * class.c (build_clone): Don't call defer_fn, let mark_used do it.
2627 * cp-tree.h (defer_fn): Delete.
2628 * decl2.c (defer_fn): Delete.
2629 (finish_file): Simplify deferred_fns loops; check that
2630 only used inline functions get into deferred_fns.
2631 (mark_used): Inline previous contents of defer_fn.
2632
632f8185 26332004-06-16 Richard Henderson <rth@redhat.com>
2634
2635 * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
2636 (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
2637 * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
2638 of CTOR_INITIALIZER ...
2639 (pp_cxx_statement): ... here.
2640 * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
2641 (finish_function): Use alloc_stmt_list to zap entire function.
2642 * parser.c (cp_parser_compound_statement): Update commentary.
2643 * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
2644 * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
2645 (finish_stmt_expr): Don't look through COMPOUND_STMT.
2646
9afabe90 26472004-06-16 Geoffrey Keating <geoffk@apple.com>
2648
2649 * pt.c (mark_decl_instantiated): Don't call defer_fn.
2650
eaae3b75 26512004-06-16 Richard Henderson <rth@redhat.com>
2652
2653 * parser.c (cp_parser_labeled_statement): Update commentary.
2654 * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
2655 * tree.c (mark_local_for_remap_r): Likewise.
2656
226c2452 26572004-06-16 Richard Henderson <rth@redhat.com>
2658
2659 * parser.c (cp_parser_asm_definition): Update commentary.
2660 * pt.c (tsubst_expr): Use ASM_EXPR.
2661 * semantics.c (finish_asm_stmt): Likewise.
2662
daf6dff5 26632004-06-16 Richard Henderson <rth@redhat.com>
2664
2665 * decl.c (finish_destructor_body): Use LABEL_EXPR.
2666 * parser.c (cp_parser_statement): Update commentary.
2667 * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
2668 * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
2669 * tree.c (mark_local_for_remap_r): Likewise.
2670
5250373a 26712004-06-16 Richard Henderson <rth@redhat.com>
2672
2673 PR c++/16012
2674 * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
2675 statement in FOR_INIT_STMT for templates.
2676
2363ef00 26772004-06-15 Richard Henderson <rth@redhat.com>
2678
2679 * call.c (initialize_reference): Don't build CLEANUP_STMT here.
2680 * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
2681 (genericize_try_block): Use gimplify_stmt.
2682 (genericize_catch_block, genericize_eh_spec_block): Likewise.
2683 (cp_gimplify_init_expr): Remove STMT_EXPR special case.
2684 (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
2685 * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
2686 (cp_tree_chain_matters_p): Remove.
2687 * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
2688 (COMPOUND_STMT_BODY_BLOCK): New.
2689 (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
2690 (EXPR_STMT_STMT_EXPR_RESULT): New.
2691 (building_stmt_tree): Check cur_stmt_list.
2692 (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
2693 (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
2694 * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
2695 (cp_finish_decl): Use push_cleanup.
2696 (start_function, finish_function): Use statement lists.
2697 (finish_stmt): Do nothing.
2698 * except.c (begin_eh_spec_block): Use statement lists.
2699 (check_handlers_1, check_handlers): Likewise.
2700 * init.c (construct_virtual_base): Don't add extra compound stmts.
2701 (build_vec_init): Likewise.
2702 * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
2703 * name-lookup.h (struct cp_binding_level): Add statement_list.
2704 * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
2705 (cp_parser_labeled_statement, cp_parser_expression_statement,
2706 cp_parser_statement_seq_opt): Likewise.
2707 (cp_parser_compound_statement): Likewise. Take bool for try block.
2708 (cp_parser_selection_statement): Tidy if processing.
2709 (cp_parser_already_scoped_statement): Rewrite to do what it says.
2710 * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
2711 (tsubst_expr): Rewrite STMT_EXPR processing. Handle STATEMENT_LIST.
2712 Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
2713 * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
2714 (finish_cond): New, rewritten from FINISH_COND.
2715 (simplify_loop_decl_cond): New.
2716 (finish_expr_stmt): Avoid nested EXPR_STMTs.
2717 (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
2718 begin_else_clause, finish_else_clause, finish_if_stmt,
2719 begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
2720 begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
2721 finish_for_cond, finish_for_stmt, begin_switch_stmt,
2722 finish_switch_cond, finish_switch_stmt, begin_try_block,
2723 finish_try_block, finish_cleanup_try_block, finish_function_try_block,
2724 finish_handler_sequence, finish_function_handler_sequence,
2725 begin_handler, finish_handler_parms, finish_handler,
2726 begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
2727 using statement lists.
2728 (begin_compound_stmt): Replace has_no_scope argument with flags.
2729 Update all callers. Use statement lists.
2730 (finish_compound_stmt): Likewise.
2731 (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
2732 (current_scope_stmt_stack): Remove.
2733 (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
2734 * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
2735 Rewrite with statement lists.
2736
3fe7c943 27372004-06-15 Alexandre Oliva <aoliva@redhat.com>
2738
2739 * parser.c: Change all assignments of c_lex_string_translate
2740 to true and false to 1 and 0.
2741 (cp_lexer_read_token): Convert type of the translated string.
2742 (cp_parser_skip_to_closing_parentheses): Preserve original
2743 value of c_lex_string_translate, and set it to -1 while
2744 running.
2745 (cp_parser_cache_group): Likewise.
2746 (cp_parser_cache_group_1): Renamed.
2747 (cp_parser_asm_operand_list): Remove redundant setting of
2748 c_lex_string_translate.
2749 (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
2750 Handle chained strings.
2751
25615648 27522004-06-12 Andrew Pinski <apinski@apple.com>
2753
2754 PR c++/14639
2755 Revert:
2756 2004-06-02 Andrew Pinski <pinskia@physics.uc.edu>
2757
2758 * cp-tree.h: Fix typo.
2759
2760 * cp-tree.h: Include cgraph.h
146c1b4f 2761 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
25615648 2762 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
2763
15899e2f 27642004-06-12 Jason Merrill <jason@redhat.com>
2765
2766 PR tree-optimization/14107
2767 * decl.c (finish_function): Warn about no return in all functions.
2768
d2010b04 27692004-06-15 Paolo Bonzini <bonzini@gnu.org>
2770
2771 * cp-tree.h (struct language_function): Remove cannot_inline.
2772 * decl.c (save_function_data): cannot_inline is no more.
2773 (cxx_push_function_context): Likewise.
2774 * decl2.c (start_objects, start_static_storage_duration_function):
2775 Reset DECL_INLINE, set DECL_UNINLINABLE.
2776
5bf15077 27772004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2778
2779 PR c++/15967
2780 * search.c (lookup_field): Propagate the ambiguity list.
2781 (lookup_fnfields): Likewise.
2782
9ed82c65 27832004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2784
2785 PR c++/15947
2786 * parser.c (cp_parser_template_name): Ctors/dtors never need a
2787 template keyword to disambiguate.
2788
2efe4daf 27892004-06-14 Mark Mitchell <mark@codesourcery.com>
2790
2791 PR c++/15096
2792 * decl.c (grokdeclarator): Ignore pointer-to-members when
2793 computing template depth.
2794
2795 PR c++/14930
2796 * name-lookup.c (pushtag): Do not try to put class declarations in
2797 explicit specialization scopes.
2798
9ae4175e 27992004-06-11 Andrew Pinski <pinskia@physics.uc.edu>
2800
2801 * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
2802
93dbdf3c 28032004-06-11 Mark Mitchell <mark@codesourcery.com>
2804
2805 PR c++/15862
2806 * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
2807 bindings for undeclared built-ins.
2808
8837568f 28092004-06-11 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2810
2811 * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
2812 appear at the correct location.
2813
d1842279 28142004-06-10 Jason Merrill <jason@redhat.com>
2815
2816 PR c++/15875
2817 Revert:
2818 2004-06-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2819 * init.c (build_offset_ref): Build SCOPE_REF with non-null
2820 TREE_TYPE for non-dependent names.
2821 * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
2822 unknown_type_node as its TREE_TYPE.
2823 * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
2824 * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
2825 (dump_expr) <SCOPE_REF case>: Likewise.
2826
bcac70f4 28272004-06-10 Mark Mitchell <mark@codesourcery.com>
2828
2829 PR c++/15227
2830 * parser.c (cp_parser_direct_declarator): Robustify.
2831
2832 PR c++/15877
2833 * pt.c (tsubst_copy): Use decl_constant_value on enumeration
2834 constants in non-dependent contexts.
2835
2836 PR c++/14211
2837 PR c++/15076
2838 * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
2839 necessary.
2840
2fb474e1 28412004-06-10 Jakub Jelinek <jakub@redhat.com>
2842
2843 PR c++/14791
2844 * decl.c (duplicate_decls): Handle fileptr_type_node arguments
2845 specially.
2846
4a6a3ec7 28472004-06-09 Mark Mitchell <mark@codesourcery.com>
2848
2849 Revert:
2850 PR c++/15815
2851 2004-06-07 Mark Mitchell <mark@codesourcery.com>
2852 * lex.c (handle_pragma_interface): Deprecate.
2853 (handle_pragma_implementation): Likewise.
2854
500ff740 28552004-06-09 Andrew Pinski <pinskia@physics.uc.edu>
2856
2857 * g++spec.c (lang_specific_driver): Remove check for -lm
2858 and -lmath when check it see if it was the math library.
2859
29deadac 28602004-06-08 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2861
2862 PR c++/7841
2863 * parser.c (cp_parser_direct_declarator): Reject constructor named
2864 as qualified template-id.
2865
85e17605 28662004-06-07 Mark Mitchell <mark@codesourcery.com>
2867
2868 PR c++/15815
2869 * lex.c (handle_pragma_interface): Deprecate.
2870 (handle_pragma_implementation): Likewise.
2871
3ad0e8cc 28722004-06-07 Mark Mitchell <mark@codesourcery.com>
2873
2874 PR c++/15766
2875 * parser.c (cp_parser_iteration_statement): Fix typo in error
2876 message.
2877
2878 PR c++/14777
2879 * pt.c (tsubst_default_argument): Do not defer access checks
2880 while substituting into the default argument.
2881
2882 PR c++/15554
2883 * pt.c (tsubst_copy): Do not try to substitute for an enumeration
146c1b4f 2884 constant in a non-dependent context.
2885
3ad0e8cc 2886 PR c++/15057
2887 * except.c (build_throw): Ensure that temp_expr has been
2888 initialized.
2889
32d8eb78 28902004-06-06 Roger Sayle <roger@eyesopen.com>
2891
2892 * cp/cp-tree.h (lvalue_or_else): Add function prototype.
2893
0b1957b6 28942004-06-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2895
2896 PR c++/15503
2897 * parser.c (cp_parser_mem_initializer_id): Gracefully reject
2898 'typename', and accept 'template'.
2899
248668f5 29002004-06-03 Andrew Pinski <pinskia@physics.uc.edu>
2901 Jan Hubicka <jh@suse.cz>
2902
2903 PR c++/14639
2904 * method.c (use_think): Do not mark thunk as referenced.
2905
9bb1c6fd 29062004-06-03 Matt Austern <austern@apple.com>
2907
2908 PR c++/15428
2909 * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
2910 is nonzero, and if we see a noninline definition of a key method,
2911 make the vtables nonweak.
146c1b4f 2912
e4959831 29132004-06-02 Matt Austern <austern@apple.com>
2914
2915 * cp-tree.h (instantiate_decl): new boolean parameter,
2916 undefined_ok. Current behavior is equivalent to its being 0.
2917 * decl2.c (mark_used): Add new argument when calling instantiate_decl
2918 * pt.c (mark_decl_instantiated): Unconditionally make
2919 instantiations explicit unconditionally
2920 (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
2921 since mark_decl_instantiated now does it.
2922 (instantiate_class_member): New. Instantiate a member of an
2923 explicitly instantiated class template.
2924 (do_type_instantiation): Explicitly instantiate members of an
2925 explicitly instantiated class template.
2926 (instantiate_decl): if undefined_ok is nonzero, and if we're
2927 trying to explicitly instantiated a template with no definition,
2928 change it to an implicit instantiation.
2929 (instantiate_pending_templates): Add new argument to instantiate_decl.
2930 * tree.c (cp_cannot_inline_tree_fn): Likewise.
146c1b4f 2931
73344ab8 29322004-06-02 Andrew Pinski <pinskia@physics.uc.edu>
2933
32141c6a 2934 * cp-tree.h: Fix typo.
2935
73344ab8 2936 * cp-tree.h: Include cgraph.h
2937 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
2938 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
2939
1bb7b924 29402004-06-01 Jason Merrill <jason@redhat.com>
2941
2942 PR c++/15142
2943 * call.c (call_builtin_trap): Remove type parm.
2944 (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
2945 (build_x_va_arg): Dereference a null pointer for a non-POD argument.
2946
ffa23556 29472004-06-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2948
2949 PR c++/13092
2950 * init.c (build_offset_ref): Build SCOPE_REF with non-null
2951 TREE_TYPE for non-dependent names.
2952 * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
2953 unknown_type_node as its TREE_TYPE.
2954 * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
2955 * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
2956 (dump_expr) <SCOPE_REF case>: Likewise.
2957
43bf5d72 29582004-06-01 Richard Henderson <rth@redhat.com>
2959 Andrew Pinski <pinskia@physics.uc.edu>
2960
2961 * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
2962 * parser.c (struct cp_parser): Remove in_offsetof.
2963 (cp_parser_new): Don't set it.
2964 (cp_parser_unary_expression): Don't check it.
2965 (cp_parser_postfix_open_square_expression): Split out from ...
2966 (cp_parser_postfix_expression): ... here.
2967 (cp_parser_postfix_dot_deref_expression): Likewise.
2968 (cp_parser_builtin_offsetof): New.
2969 (cp_parser_primary_expression): Use it.
2970
ee8d5ba5 29712004-06-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
2972
2973 PR c++/14932
2974 * parser.c (cp_parser_postfix_expression): Allow subscript
2975 operator in offsetof.
2976
7fede5dc 29772004-05-31 Mark Mitchell <mark@codesourcery.com>
2978
2979 PR c++/15701
2980 * friend.c (add_friend): Do not try to perform access checks for
2981 functions from dependent classes.
2982
f97c44fd 29832004-05-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
2984
2985 * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
2986 (pp_cxx_begin_template_argument_list): Turn into a function.
2987 (pp_cxx_end_template_argument_list): Likewise.
2988 (pp_cxx_separate_with): Define.
2989 (pp_cxx_unqualified_id): Tidy.
2990 (pp_cxx_primary_expression): Likewise.
2991 (pp_cxx_postfix_expression): Likewise.
2992 (pp_cxx_expression): Likewise.
2993 (pp_cxx_simple_type_specifier): Likewise.
2994 (pp_cxx_type_specifier_seq): Likewise.
2995 (pp_cxx_parameter_declaration_clause): Likewise.
2996 (pp_cxx_exception_specification): Likewise.
2997 (pp_cxx_direct_declarator): Likewise.
2998 (pp_cxx_type_id): Likewise.
2999 * cxx-pretty-print.h (pp_cxx_whitespace): Export from
3000 cxx-pretty-print.c.
3001 (pp_cxx_left_paren): Likewise.
3002 (pp_cxx_right_paren): Likewise.
3003 (pp_cxx_left_brace): Likewise.
3004 (pp_cxx_right_brace): Likewise.
3005 (pp_cxx_left_bracket): Likewise.
3006 (pp_cxx_right_bracket): Likewise.
3007 (pp_cxx_dot): Likewise.
3008 (pp_cxx_identifier): Likewise.
3009 (pp_cxx_tree_identifier): Likewise.
3010 (pp_cxx_ampersand): New macro.
3011 (pp_cxx_star): Likewise.
3012 (pp_cxx_arrow): Likewise.
3013 (pp_cxx_semicolon): Likewise.
3014 (pp_cxx_complement): Likewise.
3015 (pp_cxx_begin_template_argument_list): Declaree.
3016 (pp_cxx_end_template_argument_list): Likewise.
3017 (pp_cxx_colon_colon): likewise.
3018
382fbf3d 30192004-05-31 Eric Botcazou <ebotcazou@libertysurf.fr>
3020
3021 * parser.c (cp_parser_simple_type_specifier): Explicitly test
3022 against NULL_TREE.
3023
7677ebb9 30242004-05-31 Kazu Hirata <kazu@cs.umass.edu>
3025
3026 * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
3027 typeck.c: Fix comment formatting.
3028
05f9ea78 30292004-05-30 Andrew Pinski <pinskia@physics.uc.edu>
3030
3031 * cp-lang.c (cp_expand_decl): Remove.
3032 (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
3033
9fcbf115 30342004-05-30 Andreas Jaeger <aj@suse.de>
3035
3036 * lang-specs.h: Add missing initializers for .ii.
3037
15c4b973 30382004-05-28 Aldy Hernandez <aldyh@redhat.com>
3039
3040 * decl.c (cp_make_fname_decl): Free return value from
3041 fname_as_string.
3042
a133b234 30432004-05-28 Mark Mitchell <mark@codesourcery.com>
3044
3045 PR c++/15083
3046 * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
3047 even in a templat.e
3048 * init.c (build_new): Likewise.
3049
3050 PR c++/15640
3051 * name-lookup.c (arg_assoc): Robustify.
3052
3053 PR c++/15471
3054 * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
3055 when determining the scope to use for a pointer to member.
962f99f9 3056 (lookup_anon_field): Give it external linkage.
3057 * cp-tree.h (lookup_anon_field): Declare it.
3058 * expr.c (cplus_expand_constant): Use it.
a133b234 3059
a116ab20 30602004-05-28 Mark Mitchell <mark@codesourcery.com>
3061
3062 PR c++/14668
3063 * parser.c (cp_parser_simple_type_specifier): Call
3064 maybe_note_name_used_in_class.
3065
66e891c6 30662004-05-28 Tom Marshall <tmarshall@real.com>
c49006bc 3067
3068 PR c++/15214
3069 * class.c (finish_struct_1): Warn only if the dtor is non-private or
3070 the class has friends.
3071
e945eb2d 30722004-05-27 Adam Nemet <anemet@lnxw.com>
3073
3074 PR c++/12883
3075 * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
3076 TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
3077
67ff2e85 30782004-05-24 Geoffrey Keating <geoffk@apple.com>
3079
3080 * method.c (implicitly_declare_fn): Don't call defer_fn; abort
3081 if it might be needed.
3082 * pt.c (mark_decl_instantiated): Only call defer_fn if
3083 the function actually needs processing in finish_file.
3084 * decl2.c (finish_file): Add check that elements in
3085 deferred_fns_used are really needed there. Remove unnecessary
3086 test of DECL_SAVED_TREE.
3087
d856c8a6 30882004-05-23 Paolo Bonzini <bonzini@gnu.org>
3089
3090 * Make-lang.in: No need to specify $(LIBCPP).
3091
e67a67ea 30922004-05-23 Mark Mitchell <mark@codesourcery.com>
3093
3094 PR c++/15044
3095 * parser.c (cp_parser_class_head): Robustify.
3096
3097 PR c++/15317
3098 * parser.c (cp_parser_decl_specifier_seq): Correct error in
3099 comment.
3100 (cp_parser_constructor_declarator_p): Treat attributes
3101 as decl-specifiers.
3102
3103 PR c++/15329
3104 * typeck.c (build_unary_op): Do not attempt to resolve casts to
3105 base classes in templates.
3106
028e46e7 31072004-05-23 Mark Mitchell <mark@codesourcery.com>
3108
3109 PR c++/15165
3110 * pt.c (instantiate_template): Robustify.
3111
86b92c8e 31122004-05-23 Mark Mitchell <mark@codesourcery.com>
3113
3114 PR c++/15025
3115 * decl.c (xref_tag): Issue errors about redeclaring template
3116 classes as non-template classes.
3117
4ec378b6 31182004-05-23 Mark Mitchell <mark@codesourcery.com>
3119
3120 PR c++/14821
3121 * name-lookup.c (supplement_binding): Allow redefinitions of
3122 namespace aliases.
3123
3124 PR c++/14883
3125 * parser.c (cp_parser_template_argument): Robustify.
3126
286daa79 31272004-05-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
3128
3129 * class.c (alter_access): Use %E format specifier to print an
3130 identifier node. Avoid looking at the IDENTIFIER_POINTER.
3131 (push_lang_context): Likewise.
3132 * decl.c (lookup_label): Likewise.
3133 (grokdeclarator): Likewise.
3134 * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
3135 * pt.c (do_type_instantiation): Likewise.
3136 * tree.c (handle_java_interface_attribute): Likewise.
3137 (handle_com_interface_attribute): Likewise.
3138 (handle_init_priority_attribute): Likewise.
3139
df6f8740 31402004-05-22 Mark Mitchell <mark@codesourcery.com>
3141
3142 PR c++/15285
3143 PR c++/15299
3144 * pt.c (build_non_dependent_expr): Expand the set of tree nodes
3145 recognized as overloaded functions.
3146
550bbfa8 31472004-05-22 Mark Mitchell <mark@codesourcery.com>
3148
3149 PR c++/15507
3150 * class.c (layout_nonempty_base_or_field): Do not try to avoid
3151 layout conflicts for unions.
3152
3153 PR c++/15542
3154 * typeck.c (build_x_unary_op): Instantiate template class
3155 specializations before looking for "operator &".
3156
3157 PR c++/15427
3158 * typeck.c (complete_type): Layout non-dependent array types, even
3159 in templates.
3160
3161 PR c++/15287
3162 * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
3163 template.
3164
8db6f235 31652004-05-22 Roger Sayle <roger@eyesopen.com>
3166
3167 * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
3168 returning when TREE_TYPE is error_mark_node.
3169 * typeck.c (require_complete_type): Return error_mark_node if
3170 value's type is an error_mark_node.
3171
4889e098 31722004-05-20 Andrew Pinski <pinskia@physics.uc.edu>
cc69bcd0 3173
3174 * optimize.c (calls_setjmp_r): Remove.
3175 (calls_setjmp_p): Remove.
3176 * cp-tree.c (calls_setjmp_p): Remove.
3177 * decl.c (finish_function): Do not call calls_setjmp_p.
3178
4490a821 31792004-05-18 Zack Weinberg <zack@codesourcery.com>
3180
3181 * decl.c (cp_finish_decl): Use mark_decl_referenced.
3182 * decl2.c (maybe_make_one_only): Likewise.
3183 * method.c (use_thunk): Likewise.
3184
9c582899 31852004-05-18 Jason Merrill <jason@redhat.com>
3186
3187 * class.c (build_base_path): Tidy a bit.
3188
7d6057da 31892004-05-14 Geoffrey Keating <geoffk@apple.com>
3190
3191 * name-lookup.c (struct scope_binding): New.
3192 (EMPTY_SCOPE_BINDING): New.
3193 (lookup_using_namespace): Take a scope_binding instead of a
3194 cxx_binding.
3195 (qualified_lookup_using_namespace): Likewise.
3196 (cxx_binding_clear): Delete.
3197 (do_nonmember_using_decl): Use a scope_binding instead of a
3198 cxx_binding.
3199 (lookup_tag): Don't call select_decl.
3200 (ambiguous_decl): Don't return anything (and change callers to match).
3201 Take a scope_binding as the second parameter.
3202 (lookup_namespace_name): Use a scope_binding instead of a
3203 cxx_binding.
3204 (unqualified_namespace_lookup): Likewise.
3205 (lookup_qualified_name): Likewise.
3206 (select_decl): Take a scope_binding instead of a cxx_binding.
3207 Use macros rather than hand-coding tests for type-ness.
3208
88bce636 32092004-05-13 Diego Novillo <dnovillo@redhat.com>
3210
3211 * cp-gimplify.c: Rename from cp-simplify.c.
3212 * Make-lang.in, optimize.c: Update.
3213
4ee9c684 32142004-05-13 Diego Novillo <dnovillo@redhat.com>
3215
3216 Merge from tree-ssa-20020619-branch. See
3217 ChangeLog.tree-ssa for details.
3218
3219 * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
3220 cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
3221 expr.c, init.c, name-lookup.h, optimize.c, parser.c,
3222 pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
3223 Merged.
3224 * cp-mudflap.c: New file.
3225 * cp-simplify.c:: New file.
3226
72346848 32272004-05-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3228
3229 PR c++/14389
3230 * decl2.c (check_classfn): For member templates, compare also the
3231 template parameters to match the declaration.
3232 * cp-tree.h: Adjust declaration of check_classfn.
3233 * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
3234 * friend.c (do_friend): Likewise.
3235 * pt.c (tsubst_friend_function): Likewise.
3236
d76f7d08 32372004-05-01 Zack Weinberg <zack@codesourcery.com>
3238
3239 * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
3240 Instead, dig into the representation type to find the array bound.
3241
da7e5851 32422004-04-30 Jason Merrill <jason@redhat.com>
3243
3244 Refer to base members using COMPONENT_REFs where possible.
3245 * class.c (build_simple_base_path): New fn.
3246 (build_base_path): Use it for non-virtual base references.
3247 (layout_class_type): Change base fields to their real type
3248 after layout is done.
3249 * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
3250 * cp-lang.c (cxx_get_alias_set): Use it.
3251
f5f73833 32522004-04-30 Kazu Hirata <kazu@cs.umass.edu>
3253
3254 * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
3255 comment typos.
3256
368ad4b9 32572004-04-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3258
3259 PR c++/15064
3260 * parser.c (cp_parser_postfix_expression): typeid operator cannot be
3261 used in integral constant expressions.
3262
e6517de8 32632004-04-22 Mark Mitchell <mark@codesourcery.com>
3264
edbb6c80 3265 * init.c (build_aggr_init): Fix accidental use of C99 construct in
3266 previous change.
d76f7d08 3267
e6517de8 3268 * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
3269 braced initializer.
3270 * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
3271 * decl.c (reshape_init): Use it.
3272 * init.c (perform_member_init): Remove redundant condition.
3273 (build_aggr_init): Adjust to handle brace-enclosed initializers
3274 correctly.
3275 (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
edbb6c80 3276
e6517de8 3277 * parser.c (cp_parser_initializer_clause): Do not set
3278 TREE_HAS_CONSTRUCTOR on the initializer.
3279 * rtti.c (tinfo_base_init): Likewise.
3280 (generic_initializer): Likewise.
3281 (ptr_initializer): Likewise.
3282 (ptm_initializer): Likewise.
3283 (class_initializer): Likewise.
3284 (get_pseudo_ti_init): Likewise.
3285 * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
d76f7d08 3286
141efd27 32872004-04-22 Alan Modra <amodra@bigpond.net.au>
3288
3289 * name-lookup.c (anonymous_namespace_name): Make static.
3290
cd849cb3 32912004-04-19 Roger Sayle <roger@eyesopen.com>
3292
3293 PR middle-end/14531
3294 * class.c (build_base_path): Call fold whilst building the NULL
3295 pointer check expression trees.
3296
d8fff3ca 32972004-04-15 Bryce McKinlay <mckinlay@redhat.com>
3298
3299 * init.c (build_new_1): Don't use type size argument for Java
3300 _Jv_AllocObject call.
3301
89ccf8b2 33022004-04-09 Danny Smith <dannysmith@users.sourceforge.net>
3303
3304 * method.c (make_alias_for_thunk): Remove preprocessor guard on
3305 declaration and definition.
3306
5c0b8490 33072004-04-08 Danny Smith <dannysmith@users.sourceforge.net>
3308
3309 PR c++/14808
3310 * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
3311 than ASM_OUTPUT_DEF.
3312
5a9896f4 33132004-04-08 Jakub Jelinek <jakub@redhat.com>
3314
3315 * decl2.c (mark_used): Don't segfault if cfun != NULL but
3316 current_function_decl == NULL.
3317
f8e3bda1 33182004-04-05 Nathan Sidwell <nathan@codesourcery.com>
3319
3320 PR c++/3518
3321 * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
3322 level.
3323
66d12a6c 33242004-04-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3325
3326 * init.c (decl_constant_value): Don't look at DECL_INITIAL
3327 of PARM_DECL.
3328 * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
3329 or TREE_SIDE_EFFECTS of a type.
3330
57561691 33312004-04-02 Nathan Sidwell <nathan@codesourcery.com>
3332
3333 PR c++/14007
3334 * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
3335 cv-qualifier unification.
3336 * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
3337
b0cdf642 33382004-04-02 Jan Hubicka <jh@suse.cz>
3339
3340 * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
3341 * cp-tree.h (cp_update_decl_after_saving): Declare.
3342 * tree.c (cp_update_decl_after_saving): Define.
3343
a7169c34 33442004-04-01 Mark Mitchell <mark@codesourcery.com>
3345
3346 PR c++/14803
3347 * typeck.c (get_delta_difference): Call fold before returning the
3348 value.
3349
09742c66 33502004-04-01 Richard Henderson <rth@redhat.com>
3351
3352 PR c++/14804
3353 * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
3354 * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
3355
93850d73 33562004-04-01 Mark Mitchell <mark@codesourcery.com>
3357
3358 PR c++/14810
3359 * name-lookup.c (maybe_push_cleanup_level): Robustify.
3360
86ae60fd 33612004-04-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3362
3363 * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
3364
78a8ed03 33652004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3366
3367 * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
3368 * class.c (check_bitfield_decl): Likewise.
3369 * cvt.c (type_promotes_to): Likewise.
3370 * decl.c (finish_enum): Likewise.
3371 * mangle.c (write_builtin_type): Likewise.
3372 * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
3373 * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
3374 (build_binary_op): Likewise.
3375
c40bf9e4 33762004-03-31 Jan Hubicka <jh@suse.cz>
3377
3378 * tree.h (optimize_function): Kill prototype.
3379 * optimize.c (dump_function, optimize_function, dump_finction): Kill.
3380 * semantics.c (expand_body): Kill.
3381
6f46e702 33822004-03-30 Mark Mitchell <mark@codesourcery.com>
3383
3384 PR c++/14724
3385 * decl.c (start_decl_1): Do not decide whether or not to create a
3386 new cleanup level until after the type has been completed.
3387
3388 PR c++/14763
3389 * pt.c (tsubst_default_argument): Clear current_function_decl.
3390
7035b2ab 33912004-03-30 Zack Weinberg <zack@codesourcery.com>
3392
3393 * name-lookup.c, parser.c: Use new shorter form of GTY markers.
3394
a5a1f3a2 33952004-03-29 Zack Weinberg <zack@codesourcery.com>
3396
3397 * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
3398 is null, just print the literal name and return.
3399
af6ed417 34002004-03-25 Kazu Hirata <kazu@cs.umass.edu>
3401
3402 * cxx-pretty-print.c: Fix comment typos.
3403
292fdb55 34042004-03-24 Kazu Hirata <kazu@cs.umass.edu>
3405
3406 * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
3407 Update copyright.
3408
333715c2 34092004-03-23 Ziemowit Laski <zlaski@apple.com>
3410
3411 * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
3412 * mangle.c (write_type): Add call to 'mangle_fundamental_type'
3413 target hook.
3414
393b349a 34152004-03-23 Zack Weinberg <zack@codesourcery.com>
3416
bca692fd 3417 PR 12267, 12391, 12560, 13129, 14114, 14133
393b349a 3418 * cp-lang.c (c_reset_state): Delete.
3419 (push_file_scope, pop_file_scope): New stubs.
3420 * parser.c (c_parse_file): Call sorry() here if called more than once.
3421
b24423db 34222004-03-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3423
3424 * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
3425 for INTEGER_CST.
3426
66866e06 34272004-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
3428
3429 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
3430
69cb846f 34312004-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
3432
3433 * error.c (enum pad): Remove.
3434 (dump_qualifiers): Likewise.
3435 (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
3436 (dump_aggr_type): Likewise.
3437 (dump_type_suffix): Likewise.
3438 (dump_simple_decl): Likewise.
3439 (dump_function_decl): Likewise.
3440 (cv_to_string): Likewise.
393b349a 3441 (dump_type_prefix): Likewise. Adjust return void.
69cb846f 3442 * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
3443 cxx_pretty_print.h.
3444 (pp_cxx_template_keyword_if_needed): Document.
3445 (pp_cxx_qualified_id): Document case FUNCTION_DECL. Tidy.
3446 (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
393b349a 3447 MUST_NOT_THROW_EXPR.
69cb846f 3448
e6d8a6d5 34492004-03-21 Mark Mitchell <mark@codesourcery.com>
3450
3451 PR c++/14616
3452 * decl.c (cp_finish_decl): Compute the size of arrays declared in
3453 templates, if their type is non-dependent.
3454
7ef14399 34552004-03-19 Mark Mitchell <mark@codesourcery.com>
3456
3457 * call.c (build_op_delete_call): Do not forget the placement
3458 arguments when iterating through mutiple delete operators.
3459
3460 * cp-tree.h (svaed_scope): Remove last_parms.
3461 (NEW_DELETE_OPNAME_P): New macro.
3462 (last_function_parms): Remove.
3463 (do_friend): Adjust prototype.
3464 * decl.c (grokparms): Return the PARM_DECLs directly, rather than
3465 using last_function_parms.
3466 (grokfndecl): Take the PARM_DECLs as an argument, rather than
3467 using last_function_parms.
3468 (grokdeclarator): Adjust accordingly. Do not form METHOD_TYPEs
3469 for class-specific operator new and operator delete.
3470 (grok_op_properties): Do not look for allocation functions with
3471 METHOD_TYPEs.
3472 (start_function): Use DECL_ARGUMENTS instead of
3473 last_function_parms.
3474 * decl.h (last_function_parms): Do not declare.
3475 * decl2.c (grokclassfn): Do not use last_function_parms.
3476 * friend.c (do_friend): Remove parmdecls parameter.
3477 * name-lookup.c (push_to_top_level): Do not save last_function_parms.
3478 (pop_from_top_level): Do not restore it.
3479 * pt.c (check_explicit_specialization): Do not adjust
3480 last_function_parms.
3481
3482 * name-lookup.c (do_local_using_decl): Create a local binding for
3483 types brought in via using declarations.
3484
3485 * name-lookup.c (lookup_arg_dependent): Handle block-scope
3486 function declarations correctly.
3487
3488 * semantics.c (finish_id_expression): Correct handling of
3489 conversion operators to dependent types.
3490
3491 * typeck.c (lookup_destructor): Allow the use of destructors from
3492 base classes.
393b349a 3493
9256465d 34942004-03-19 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3495
3496 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
3497 TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
3498 * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
3499 the field is named TEMPLATE_TYPE_PARM_INDEX.
3500
9ee4e816 35012004-03-19 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3502
3503 PR c++/14545
3504 * parser.c (cp_parser_functional_cast): A cast to anything
3505 but integral or enumaration type is not an integral constant
3506 expression.
3507 * pt.c (value_dependent_expression_p): Handle cast expressions
3508 without operands (such as "int()").
3509
d45cef9b 35102004-03-18 Mark Mitchell <mark@codesourcery.com>
3511
3512 * semantics.c (finish_pseudo_destructor_expr): Allow differing
3513 cv-qualification between the type named by the
3514 pseudo-destructor-name and the object-type.
3515
3516 * search.c (accessible_base_p): Handle non-proper bases.
3517
3518 * name-lookup.c (do_nonmember_using_decl): If a using declaration
3519 refers to a single overloaded function, set the type of the
3520 function.
3521 * tree.c (lvalue_type): Simplify.
3522 * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
3523 unknown type.
3524 (build_unary_op): Handle OVERLOADs with known types.
3525
3526 * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
3527 function templates.
3528
3529 * parser.c (cp_parser_postfix_expression): Handle the use of
3530 "typename" in non-dependent contexts. Convert appropriately when
3531 when using a qualified name after "->" or ".".
3532
3533 * call.c (conditional_conversion): Honor the requirement that some
3534 conversions refer to the original object.
3535
3180c04a 35362004-03-18 Mark Mitchell <mark@codesourcery.com>
3537
3538 * call.c (build_conditional_expr): Do not call force_rvalue for
3539 operands of void_type when the conditional expression itself has
3540 void type.
3541 * name-lookup.c (pushdecl): Don't consider a declaration of a
3542 function named "main" to be an overload of a type named "main".
3543 * parser.c (cp_parser_template_name): Perform name lookup when the
3544 template name is proceeded by "template" if the qualifying scope
3545 is non-dependent.
3546 * typeck.c (composite_pointer_type_r): Correctly handle
3547 pointer-to-member types.
3548 (build_const_cast): Likewise.
3549
82bb2115 35502004-03-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
3551
75e26b19 3552 * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
3553 * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
3554 (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
3555 (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
3556 (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
3557 (TYPEOF_TYPE_EXPR): New macro.
82bb2115 3558 * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
3559 * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
3560 * pt.c (tsubst): Likewise.
3561 * semantics.c (finish_typeof): Likewise.
3562 * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
3563 and TEMPLATE_TYPE_PARM.
3564 * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
3565 (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
3566
6ee6550d 35672004-03-16 Mark Mitchell <mark@codesourcery.com>
3568
3569 PR c++/14586
3570 * cp-tree.h (build_new_op): Change prototype.
3571 (build_x_binary_op): Likewise.
3572 * call.c (build_new_op): Add overloaded_p parameter.
3573 * decl2.c (grok_array_decl): Adjust call to build_new_op.
3574 * parser.c (cp_parser_binary_expression): Note that uses of
3575 overloaded operators prevents an expression from being considered
3576 an integral constant.
3577 * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
3578 build_x_binary_op.
3579 * semantics.c (finish_call_expr): Likewise.
3580 * typeck.c (rationalize_conditional_expr): Likewise.
3581 (build_x_indirect_ref): Likewise.
3582 (build_x_binary_op): Likewise.
3583 (build_x_unary_op): Likewise.
3584 (build_x_compound_expr): Likewise.
3585 (build_modify_expr): Likewise.
3586 * typeck2.c (build_x_arrow): Likewise.
3587
a62ddad6 35882004-03-15 Kazu Hirata <kazu@cs.umass.edu>
3589
3590 * cp-lang.c, ptree.c: Update copyright.
3591
3938e0c2 35922004-03-13 Mark Mitchell <mark@codesourcery.com>
3593
3594 PR c++/14550
3595 * parser.c (cp_parser_non_integral_constant_expression): Encode
3596 more of the idiom that surrounded calls to this function within
3597 the function itself
3598 (cp_parser_primary_expression): Adjust accordingly.
3599 (cp_parser_postfix_expression): Likewise.
3600 (cp_parser_unary_expression): Likewise.
3601 (cp_parser_cast_expression): Likewise.
3602 (cp_parser_assignment_expression): Likewise.
3603 (cp_parser_expression): Likewise.
3604 (cp_parser_new_expression): Note that new-expressions are not
3605 allowed in integral constant expressions.
3606 (cp_parser_delete_expression): Likewise.
3607
2f9fc8ef 36082004-03-12 Matt Austern <austern@apple.com>
3609
3610 * decl2.c (maybe_make_one_only): Look at
3611 TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
3612 to make an explicit instantiation weak.
3613 * method.c (use_thunk): Make sure we call comdat_linkage
3614 when appropriate.
3615 * pt.c (do_type_instantiation): On systems where weak symbols
3616 don't go in a static archive's TOC, explicit instantiation of a
3617 class must imply *explicit* instantiation of its memeber.
393b349a 3618
415bd54e 36192004-03-11 Kazu Hirata <kazu@cs.umass.edu>
3620
3621 * call.c, cp-tree.h, pt.c: Fix comment typos.
3622
d48f6141 36232004-03-10 Mark Mitchell <mark@codesourcery.com>
3624
3625 PR c++/14510
3626 * decl.c (xref_tag): Disregard non-type declarations when
393b349a 3627 looking up a tagged type.
d48f6141 3628
ad2320c4 36292004-03-09 Nathan Sidwell <nathan@codesourcery.com>
3630
3631 PR c++/14397
3632 * call.c (convert_like_real): Build a const qualified temporary,
3633 when testing ctor access.
3634
c4cc9e8c 36352004-03-09 Mark Mitchell <mark@codesourcery.com>
3636
3637 * call.c (initialize_reference): Fix typo.
3638
f352cc1d 36392004-03-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3640
3641 PR c++/14409
3642 * pt.c (determine_specialization): For member templates, match also
3643 constness.
3644
3645 PR c++/14448
3646 * parser.c (cp_parser_initializer_clause): Fold initializer if it is
3647 non-dependent.
3648 * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
3649
0fd3a2c7 36502004-03-09 Mark Mitchell <mark@codesourcery.com>
3651
3652 PR c++/14230
3653 * call.c (initialize_reference): Handle initializers that are
3654 class-member access expressions applies to rvalues.
3655
9dcbf64e 36562004-03-09 Mark Mitchell <mark@codesourcery.com>
3657
3658 PR c++/14432
3659 * name-lookup.c (supplement_binding): Ignore functions that are
3660 marked DECL_ANTICIPATED.
3661
28bbd27a 36622004-03-08 Mark Mitchell <mark@codesourcery.com>
3663
3664 PR c++/14401
3665 * class.c (check_field_decls): Complain about non-static data
3666 members of reference type in unions. Propagate
3667 CLASSTYPE_REF_FIELDS_NEED_INIT and
3668 CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
3669 data members.
3670 * init.c (perform_member_init): Complain about mbmers with const
3671 type that are not explicitly initialized.
3672
36732004-03-08 Mark Mitchell <mark@codesourcery.com>
3674
3675 * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
3676 * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
3677 (lang_identifier): Remove implicit_decl and error_locus.
3678 (IDENTIFIER_IMPLICIT_DECL): Remove.
3679 (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
3680 (IDENTIFIER_ERROR_LOCUS): Likewise.
3681 (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
3682 (TYPE_ASSEMBLER_NAME_STRING): Likewise.
3683 (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
3684 (implicitly_declare): Remove.
3685 * decl.c (warn_extern_redeclared_static): Remove check of
3686 IDENTIFIER_IMPLICIT_DECL.
3687 (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
3688 (implicitly_declare): Remove.
3689 (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
3690 (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
3691 (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
3692 * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
3693 in the innermost scope, rather than at namespace scope.
3694 * name-lookup.c (push_local_binding): Give it external linkage.
3695 (pushdecl): Remove dead code.
3696 * name-lookup.h (push_local_binding): Declare it.
3697 * ptree.c (cxx_print_identifier): Don't print
3698 IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
3699 * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
3700 not IDENTIFIER_ERROR_LOCUS.
3701 * typeck.c (build_function_call): Remove dead code.
3702
fb3e3237 37032004-03-08 Jason Merrill <jason@redhat.com>
3704
3705 PR c++/13170
3706 * decl.c (xref_tag): Remove attribute handling.
3707 * cp-tree.h: Adjust prototype.
3708 * decl.c, parser.c, rtti.c: Adjust callers.
3709 * parser.c (cp_parser_class_head): Pass back attributes in the
3710 class head.
3711 (cp_parser_class_specifier): Adjust.
3712
a567ba1e 37132004-03-08 Matt Austern <austern@apple.com>
3714
3715 PR debug/14079
3716 * name-lookup.c (add_decl_to_level): Add extern variables, as well
3717 as static, to static_decls array.
393b349a 3718
908e5f41 37192004-03-05 Jason Merrill <jason@redhat.com>
3720
3721 * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
3722
1112ccbc 37232004-03-04 Geoffrey Keating <geoffk@apple.com>
3724
3725 * decl.c (grokfndecl): Update old incorrect comment.
3726 (grokvardecl): Diagnose C++ variables of type with no linkage.
3727
0b1ece0b 37282004-03-01 Mark Mitchell <mark@codesourcery.com>
3729
3730 PR c++/14369
3731 * pt.c (build_non_dependent_expr): Do not create a
3732 NON_DEPENDENT_EXPR for a THROW_EXPR.
3733
891f08be 37342004-03-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
3735
3736 PR c++/14369
3737 * error.c (dump_expr): Handle THROW_EXPR.
3738
3ed12242 37392004-03-01 Mark Mitchell <mark@codesourcery.com>
3740
3741 PR c++/14360
3742 * parser.c (cp_parser_postfix_expression): Do not perform Koenig
3743 lookup if ordinary name-lookup finds a non-function.
3744 * pt.c (tsubst_copy_and_build): Likewise.
3745
3746 PR c++/14361
3747 * parser.c (cp_parser_late_parsing_default_args): Check that there
3748 are no extra tokens after the end of the default-argument
3749 expression.
393b349a 3750
a8f49272 37512004-03-01 Mark Mitchell <mark@codesourcery.com>
3752
3753 PR c++/14324
3754 * lex.c (retrofit_lang_decl): Treat entities with no linkage as
3755 having C++ linkage for name-mangling purposes.
3756
3757 PR c++/14260
3758 * parser.c (cp_parser_direct_declarator): Recognize constructor
3759 declarators that use a template-id to name the class being
3760 constructed.
3761
3762 PR c++/14337
3763 * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
3764 (tsubst_expr): Do not call tsubst_copy, even when
393b349a 3765 processing_template_decl.
a8f49272 3766
4a755ae7 37672004-03-01 Jeff Law <law@redhat.com>
3768
3769 * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
3770 the proper type.
3771
1cbda81f 37722004-02-29 Mark Mitchell <mark@codesourcery.com>
3773
3774 PR c++/14138
3775 * name-lookup.h (push_scope): Change prototype.
3776 * name-lookup.c (push_scope): Do not reenter the current class
3777 scope.
3778 * decl.c (grokfndecl): Check return code from push_scope before
3779 calling pop_scope.
3780 * decl2.c (check_classfn): Likewise.
3781 * parser.c (cp_parser_conversion_function_id): Likewise.
3782 (cp_parser_init_declarator): Likewise.
3783 (cp_parser_direct_declarator): Likewise.
3784 (cp_parser_class_specifier): Likewise.
3785 (cp_parser_class_head): Likewise.
3786 (cp_parser_lookup_name): Likewise.
3787 (cp_parser_constructor_declarator_p): Likewise.
3788 * pt.c (instantiate_class_template): Likewise.
3789 (resolve_typename_type): Likewise.
3790
b2353ac4 37912004-02-29 Mark Mitchell <mark@codesourcery.com>
3792
16bd3ffe 3793 PR c++/14267
3794 * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
3795 extension.
3796
b2353ac4 3797 PR debug/12103
3798 * class.c (update_vtable_entry_for_fn): Do not go through
3799 covariance machinery if the type returned by an overrider is the
3800 same as the original.
3801
0aee14a5 38022004-02-29 Kazu Hirata <kazu@cs.umass.edu>
3803
3804 * call.c: Fix a comment typo.
3805
e752fecc 38062004-02-27 Ziemowit Laski <zlaski@apple.com>
3807
3808 * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
3809
6006bfb6 38102004-02-26 Mark Mitchell <mark@codesourcery.com>
3811
3812 PR c++/14278
3813 * parser.c (cp_parser_parameter_declaration_list): Commit
3814 to fewer tentative parses.
3815
fefedfd1 38162004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3817
3818 PR c++/14284
3819 * pt.c (dependent_type_p_r): A template template parameter is a
3820 dependent type.
3821
aa693fae 38222004-02-26 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3823
3824 PR c++/14246
3825 * mangle.c (write_template_arg_literal): Don't rely on identity for
3826 boolean constants.
3827
7b77c173 38282004-02-24 Jason Merrill <jason@redhat.com>
3829
3830 * tree.c (build_exception_variant): Use check_qualified_type.
3831
a814bad5 38322004-02-23 Zack Weinberg <zack@codesourcery.com>
3833 Kazu Hirata <kazu@cs.umass.edu>
3834
3835 * decl.c (cxx_init_decl_processing): Don't check
3836 flag_writable_strings.
3837
aaadf915 38382004-02-23 Andrew Pinski <pinskia@physics.uc.edu>
3839
3840 PR c++/14156
3841 * typeck.c (maybe_warn_about_returning_address_of_location):
3842 Change check for VAR_DECL to use DECL_P instead.
3843
f8182e08 38442004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3845
3846 PR c++/14250
3847 * cvt.c (build_expr_type_conversion): Type must be complete before
3848 looking up for conversions.
3849
af7d81e3 38502004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3851
3852 PR c++/14143
393b349a 3853 * name-lookup.c (arg_assoc_class): Don't look into template
af7d81e3 3854 arguments if it is not a primary template.
3855
043dbdf4 38562004-02-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3857
af7d81e3 3858 PR c++/12007
043dbdf4 3859 * method.c (use_thunk): Always clone function argument tree.
3860
1940f978 38612004-02-20 Mark Mitchell <mark@codesourcery.com>
3862
3863 PR c++/14199
3864 * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
3865
3866 PR c++/14173
3867 * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
3868 for all type variants.
3869
2c21a1c3 38702004-02-19 Mark Mitchell <mark@codesourcery.com>
3871
1940f978 3872 PR c++/13927
3873 * decl.c (duplicate_decls): Return error_mark_node for invalid
3874 redeclarations.
3875 * name-lookup.c (push_namespace): Ignore the return value from
3876 pushdecl.
3877 * pt.c (push_template_decl_real): Robustify.
3878
2c21a1c3 3879 PR c++/14186
3880 * name-lookup.c (push_class_level_binding): Do not complain about
3881 adding a binding for a member whose name is the same as the
3882 enclosing class if the member is located in a base class of the
3883 current class.
3884
383da0a4 38852004-02-19 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3886
3887 PR c++/14181
393b349a 3888 * parser.c (cp_parser_new_expression): Parse an ill-formed
383da0a4 3889 direct-new-declarator after a parenthesized type-id to emit good
3890 diagnostic.
3891
3eccc2db 38922004-02-18 Kazu Hirata <kazu@cs.umass.edu>
3893
3894 * cp-tree.def, cvt.c: Update copyright.
3895
e100aadc 38962004-02-17 Mark Mitchell <mark@codesourcery.com>
3897
3898 PR c++/11326
3899 * cp-tree.h (abi_version_at_least): Remove.
3900 * mangle.c: Include flags.h.
3901
49babdb3 39022004-02-15 Mark Mitchell <mark@codesourcery.com>
3903
3904 PR c++/13971
3905 * call.c (build_conditional_expr): Handle conversions between
3906 class types which result in differently cv-qualified type
3907 variants.
3908
3909 PR c++/14086
3910 * class.c (delete_duplicate_fields_1): Remove.
3911 (delete_duplicate_fields): Likewise.
3912 (finish_struct_anon): Remove check for members with the same name
3913 as their enclosing class.
3914 (check_field_decls): Do not call duplicate_fields.
3915 * decl.c (grokdeclarator): Remove check for static data members
3916 with the same name as their enclosing class.
3917 * name-lookup.c (push_class_level_binding): Check for members with
3918 the same name as their enclosing class.
3919
7dddebd7 39202004-02-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
3921
3922 PR c++/14085
3923 * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
3924
a2a5f9d8 39252004-02-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
3926
3927 PR c++/13635
3928 * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
3929 has full set of arguments.
3930
d44c682d 39312004-02-13 Giovanni Bajo <giovannibajo@gcc.gnu.org>
3932
3933 PR c++/13927
3934 * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
3935
5f6b377f 39362004-02-13 Mark Mitchell <mark@codesourcery.com>
3937
b4ce9ded 3938 PR c++/14122
3939 * cp-tree.h (delete_sanity): Change prototype.
3940 * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
3941 Remove dead code. Adjust code to warn about deleting an array.
3942 * typekc.c (decay_conversion): Use build_address and build_nop.
3943
3944 PR c++/14108
3945 * search.c (accessible_p): Do not check access in thunks.
3946
5f6b377f 3947 PR c++/14083
3948 * call.c (build_conditional_expr): Call force_rvalue on the
3949 non-void operand in the case that one result is a throw-expression
3950 and the other is not.
3951
60c6ea84 39522004-02-13 Ian Lance Taylor <ian@wasabisystems.com>
3953
3954 PR c++/9851
3955 * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
3956 the type name and look ahead for ::~, and bail out early with a
3957 better error message if the parse is going to fail.
3958
1611df57 39592004-02-12 Mark Mitchell <mark@codesourcery.com>
3960
3961 * call.c (conversion_kind): New type.
3962 (conversion_rank): Likewise.
3963 (conversion): Likewise.
3964 (CONVERSION_RANK): New macro.
3965 (conversion_obstack): New variable.
3966 (obstack_initialized): Likewise.
3967 (z_candidate): Change type of convs and second_conv.
3968 (candidate_warning): New type.
3969 (IDENTITY_RANK): Remove.
3970 (EXACT_RANK): Likewise.
3971 (PROMO_RANK): Likewise.
3972 (STD_RANK): Likewise.
3973 (PBOOL_RANK): Likewise.
3974 (USER_RANK): Likewise.
3975 (ELLIPSIS_RANK): Likewise.
3976 (BAD_RANK): Likewise.
3977 (ICS_RANK): Likewise.
3978 (ICS_STD_RANK): Likewise.
3979 (ICS_USER_FLAG): Likewise.
3980 (ICS_ELLIPSIS_FLAG): Likewise.
3981 (ICS_THIS_FLAG): Likewise.
3982 (ICS_BAD_FLAG): Likewise.
3983 (NEED_TEMPORARY_P): Likewise.
3984 (CHECK_COPY_CONSTRUCTOR_P): Likewise.
3985 (USER_CONV_CAND): Likewise.
3986 (USER_CONV_FN): Likewise.
3987 (conversion_obstack_alloc): New function.
3988 (alloc_conversion): Likewise.
3989 (validate_conversion_obstack): Likewise.
3990 (alloc_conversions): Likewise.
3991 (build_conv): Adjust to deal with new conversion data structures.
3992 (build_identity_conv): New function.
3993 (build_ambiguous_conv): Likewise.
3994 (standard_conversion): Adjust to deal with new conversion data
3995 structures.
3996 (convert_class_to_reference): Likewise.
3997 (direct_reference_binding): Likewise.
3998 (reference_binding): Likewise.
3999 (implicit_conversion): Likewise.
4000 (add_candidate): Likewise.
4001 (add_function_candidate): Likewise.
4002 (add_conv_candidate): Likewise.
4003 (build_builtin_candidate): Likewise.
4004 (print_z_candidate): Likewise.
4005 (merge_conversion_sequences): Likewise.
4006 (build_user_type_conversion_1): Likewise.
4007 (build_user_type_conversion): Likewise.
4008 (build_new_function_call): Likewise.
4009 (build_object_call): Likewise.
4010 (conditional_conversion): Likewise.
4011 (build_conditional_expr): Likewise.
4012 (build_new_op): Likewise.
4013 (build_op_delete_call): Likewise.
4014 (convert_like_real): Likewise.
4015 (build_over_call): Likewise.
4016 (build_new_method_call): Likewise.
4017 (is_subseq): Likewise.
4018 (maybe_handle_implicit_object): Likewise.
4019 (maybe_handle_ref_bind): Likewise.
4020 (compare_ics): Likewise.
4021 (source_type): Likewise.
4022 (add_warning): Likewise.
4023 (joust): Likewise.
4024 (can_convert_arg): Likewise.
4025 (can_convert_arg_bad): Likewise.
4026 (perform_implicit_conversion): Likewise.
4027 (perform_direct_initialization_if_possible): Likewise.
4028 (initialize_reference): Likewise.
4029 * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
4030 * cp-tree.def (WRAPPER): Likewise.
4031 (IDENTITY_CONV): Remove.
4032 (LVALUE_CONV): Likewise.
4033 (QUAL_CONV): Likewise.
4034 (STD_CONV): Likewise.
4035 (PTR_CONV): Likewise.
4036 (PMEM_CONV): Likewise.
4037 (BASE_CONV): Likewise.
4038 (REF_BIND): Likewise.
4039 (USER_CONV): Likewise.
4040 (AMBIG_CONV): Likewise.
4041 (RVALUE_CONV): Likewise.
4042 * cp-tree.h (tree_wrapper): Remove.
4043 (WRAPPER_ZC): Remove.
4044 (lang_tree_node): Remove wrapper.
4045 (LOOKUP_SPECULATIVELY): Remove.
4046 (build_op_delete_call): Adjust prototype.
4047 (validate_conversion_obstack): Declare.
4048 (build_zc_wrapper): Remove.
4049 * cvt.c (convert_to_reference): Remove dead code.
4050 (ocp_convert): Likewise.
4051 * decl.c (redeclaration_error_message): Correct handling of
4052 templates.
4053 (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
4054 (cp_tree_node_structure): Remove WRAPPER case.
4055 * decl2.c (finish_file): Call validate_conversion_obstack.
4056 * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
4057 (build_op_delete_call): Likewise.
4058 (build_x_delete): Likewise.
4059 (build_delete): Adjust call to build_op_delete_call.
4060 * pt.c (tsubst_friend_declaration): Adjust code to determine
4061 whether or not a friend template is a definition.
4062 (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
4063 * tree.c (build_zc_wrapper): Remove.
393b349a 4064
73ae3ef7 40652004-02-12 Zack Weinberg <zack@codesourcery.com>
4066
4067 * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
4068 * cp-tree.h: Don't declare cxx_builtin_type_decls.
4069 * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
4070 (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
4071
52e52341 40722004-02-10 Mark Mitchell <mark@codesourcery.com>
4073
4074 * typeck.c (lookup_destructor): Fix typo in error message.
4075
e24657db 40762004-02-09 Kazu Hirata <kazu@cs.umass.edu>
4077
4078 * call.c, parser.c, tree.c: Fix comment typos.
4079
a3ad3e27 40802004-02-07 Zack Weinberg <zack@codesourcery.com>
4081
4082 Bug 13856
4083 * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
4084 * decl.c (duplicate_decls, start_function): Likewise.
4085
40862004-02-07 Zack Weinberg <zack@codesourcery.com>
4087
4088 * name-lookup.c (pushdecl): Issue shadow warnings directly.
4089 * parser.c (free_parser_stacks): Delete.
4090
093936a9 40912004-02-07 Kazu Hirata <kazu@cs.umass.edu>
4092
4093 * rtti.c: Update copyright.
4094
4889e098 40952004-02-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
caaf4cd0 4096
4097 PR c++/14033
4098 * decl.c (require_complete_types_for_parms): Do not insert
4099 error_mark_node in the parameter list.
4100
4889e098 41012004-02-06 Giovanni Bajo <giovannibajo@gcc.gnu.org>
bb93aad0 4102
4103 PR c++/14028
4104 * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
4105 error when terminator can not be found.
4106
6bc11008 41072004-02-05 Kelley Cook <kcook@gcc.gnu.org>
4108
4109 Make-lang.in (po-generated): Delete.
4110
82ac3699 41112004-02-05 Kazu Hirata <kazu@cs.umass.edu>
4112
4113 * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
4114 targetm.calls.promote_prototypes.
4115
cbe4c3a5 41162004-02-05 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
4117
4118 PR middle-end/13750
4119 Revert:
4120 2004-01-15 Geoffrey Keating <geoffk@apple.com>
4121 PR pch/13361
4122 * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
4123 (handle_pragma_implementation): Likewise.
4124
40969701 41252004-02-05 Mark Mitchell <mark@codesourcery.com>
4126
4127 PR c++/13714
4128 * typeck.c (lookup_destructor): Tweak error message.
4129
8f214cb2 41302004-02-05 Jan Hubicka <jh@suse.cz>
4131
4132 * tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat
4133 functions.
4134
4889e098 41352004-02-05 Giovanni Bajo <giovannibajo@gcc.gnu.org>
e00c3963 4136
4137 PR c++/14008
a3ad3e27 4138 * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
e00c3963 4139 code, only emits the diagnostic now. Added lookup of the identifier
4140 and support for qualified ids.
4141 (cp_parser_parse_and_diagnose_invalid_type_name): New function.
4142 Parse an (invalid) type name as id-expression within a declarator.
4143 (cp_parser_simple_declaration): Use it.
4144 (cp_parser_member_declaration): Likewise.
4145 (cp_parser_make_typename_type): New function. Handle errors through
4146 cp_parser_diagnose_invalid_typename.
4147 (cp_parser_elaborated_type_specifier): Use it.
4148
f1b31729 41492004-02-04 Mark Mitchell <mark@codesourcery.com>
4150
4151 PR c++/13932
4152 * call.c (convert_like_real): Use "converting" rather than
4153 "argument" as the descriptive keyword to
4154 dubious_conversion_warnings.
4155 * typeck.c (convert_for_assignment): Do not call
4156 dubious_conversion_warnings.
4157
8a0fd506 41582004-02-04 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4159
4160 PR c++/13086
4161 * init.c (build_delete): Emit a more informative error message in
4162 case of an incomplete type, and on the correct source line.
4163
0364c2b4 41642004-02-04 Kazu Hirata <kazu@cs.umass.edu>
4165
4166 * error.c, search.c: Update copyright.
4167
32b1f4c2 41682004-02-04 Mark Mitchell <mark@codesourcery.com>
4169
4170 PR c++/9941
4171 * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
4172 linkage for the typeinfo name string.
4173
2250d32c 41742004-02-04 Mark Mitchell <mark@codesourcery.com>
4175
4176 PR c++/13969
4177 * cp-tree.h (fold_non_dependent_expr): New function.
4178 * parser.c (cp_parser_fold_non_dependent_expr): Remove.
4179 (cp_parser_template_argument): Use fold_non_dependent_expr.
4180 (cp_parser_direct_declarator): Likewise.
4181 * pt.c (fold_non_dependent_expr): New function.
4182 (convert_nontype_argument): Use it.
4183 (tsubst_qualified_id): Simplify.
4184 (tsubst_copy_and_build): Likewise.
4185
eaa112a0 41862004-02-04 Mark Mitchell <mark@codesourcery.com>
4187
4188 * decl.c (cxx_push_function_context): Do not set
4189 current_function_is_thunk.
4190 * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
4191 actual function.
4192
4889e098 41932004-02-04 Giovanni Bajo <giovannibajo@gcc.gnu.org>
94affa87 4194
78325258 4195 PR c++/13997
94affa87 4196 * pt.c (more_specialized_class): Increase processing_template_decl
4197 while partial ordering.
4198
f99f0e9c 41992004-02-03 Mark Mitchell <mark@codesourcery.com>
4200
4201 PR c++/13925
4202 * decl.c (start_function): Do not call pushdecl for any
4203 instantiation or specialization of a primary template.
4204
29ac02b7 42052004-02-03 Mark Mitchell <mark@codesourcery.com>
4206
50dad21f 4207 PR c++/13950
4208 * parser.c (cp_parser_class_name): Robustify.
4209
4210 PR c++/13970
4211 * parser.c (cp_parser_cache_group): Do not consume the EOF token.
4212
29ac02b7 4213 PR c++/14002
4214 * semantics.c (finish_id_expression): Do not return an
4215 IDENTIFIER_NODE when lookup finds a PARM_DECL.
4216
2c584053 42172004-02-03 Mark Mitchell <mark@codesourcery.com>
4218
4219 PR c++/13978
4220 * pt.c (build_non_dependent_expr): Do not build
4221 NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
4222
4223 PR c++/13968
4224 * semantics.c (finish_id_expression): Do not return an
4225 IDENTIFIER_NODE when lookup finds a VAR_DECL.
4226
4227 PR c++/13975
4228 * parser.c (cp_parser_simple_declaration): When skipping to the
4229 end of the statement swallow the terminating semicolon.
4230
b3beaf30 42312004-02-02 Mark Mitchell <mark@codesourcery.com>
4232
4233 PR c++/13113
4234 * init.c (build_offset_ref): Improve error recovery for invalid
4235 uses of non-static member functions.
4236
4237 PR c++/13854
4238 * cp-tree.h (cp_build_type_attribute_variant): New function.
4239 * class.c (build_clone): Use cp_build_type_attribute_variant.
4240 * decl.c (duplicate_decls): Likewise.
4241 * pt.c (copy_default_args_to_explicit_spec): Likewise.
4242 (tsubst_function_type): Likewise.
4243 * tree.c (build_exception_variant): Check attributes before
4244 concluding that two types are the same.
4245 (cp_build_type-attribute_variant): New method.
4246 * typeck.c (merge_types): Use cp_build_type_attribute_variant.
4247
4248 PR c++/13907
4249 * call.c (convert_class_to_reference): Keep better track of
4250 pedantically invalid user-defined conversions.
4251
f8a46a88 42522004-02-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4253
4254 PR c++/13957
4255 * pt.c (tsubst_qualified_id): Improved error message when a type
4256 is expected but not found.
4257
0f3ccaa3 42582004-01-31 Kazu Hirata <kazu@cs.umass.edu>
4259
4260 * class.c: Fix comment typos.
4261 * decl.c: Likewise.
4262 * error.c: Likewise.
4263 * parser.c: Likewise.
4264 * pt.c: Likewise.
4265 * search.c: Likewise.
4266 * typeck.c: Likewise.
4267
af920739 42682004-01-30 Richard Henderson <rth@redhat.com>
4269
a3ad3e27 4270 PR c++/13693
4271 * method.c (use_thunk): Don't force_target_expr for void thunks.
4272 * tree.c (build_target_expr_with_type): Assert non-void type.
4273 (force_target_expr): Likewise.
af920739 4274
260cf17d 42752004-01-30 Michael Matz <matz@suse.de>
4276
4277 * parser.c (cp_parser_labeled_statement): Accept case ranges.
4278
d2b38b0e 42792004-01-30 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4280
4281 DR206
4282 PR c++/13813
4283 * decl.c (grokdeclarator): Check immediatly type completeness for
4284 non-dependent types.
4285
5eab6dd3 42862004-01-30 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4287
4288 PR c++/13683
4289 * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
4290 a sizeof expression.block
4291
d5460724 42922004-01-29 Mark Mitchell <mark@codesourcery.com>
4293
4294 PR c++/13883
4295 * mangle.c (write_encoding): Correct encoding of member template
4296 constructors.
4297
c8d5ab79 42982004-01-28 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4299
a3ad3e27 4300 * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
c8d5ab79 4301 template name as it was `<::' (digraph typo).
4302 (cp_parser_nth_token_starts_template_argument_list_p): New function.
4303 (cp_parser_id_expression): Use it.
4304 (cp_parser_nested_name_specifier_opt): Likewise.
4305 (cp_parser_template_name): Likewise.
4306 (cp_parser_class_name): Likewise.
4307 (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
4308
91f31809 43092004-01-28 Mark Mitchell <mark@codesourcery.com>
4310
4a4215bd 4311 PR c++/13791
4312 * typeck.c (merge_types): Do not merge attributes into
4313 TYPENAME_TYPEs.
4314
91f31809 4315 PR c++/13736
4316 * parser.c (cp_parser_direct_declarator): Do not prevent
4317 backtracking inside a parenthesized declarator.
4318 (cp_parser_parameter_declaration): Fix typo in comment.
4319
9dcb7175 43202004-01-28 Jan Hubicka <jh@suse.cz>
4321
4322 * semantics.c (expand_body) Do emit_associated_thunks before
4323 expansion.
4324
2b49746a 43252004-01-27 Devang Patel <dpatel@apple.com>
4326
4327 * name-lookup.c: Include "debug.h"
4328 (do_namespace_alias): Invoke debug_hooks to emit debug info
4329 for namespace alias.
a3ad3e27 4330 (do_local_using_decl): Invoke debug_hooks to emit debug info
2b49746a 4331 for using decl.
4332 (do_class_using_decl): Same.
4333 (do_toplevel_using_decl): Same.
4334 (do_using_directive): Same.
4335 (cp_emit_debug_info_for_using): New function.
4336 * Make-lang.in (cp/parser.o): Depend on debug.h
4337 (cp/name-lookup.o): Same.
4338
2ccf1c3a 43392004-01-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4340
4341 * cp-tree.h (language_function, lang_type_header): Use
4342 BOOL_BITFIELD.
4343 * name-lookup.h (cp_binding_level): Likewise.
4344
7f233616 43452004-01-26 Mark Mitchell <mark@codesourcery.com>
4346
a9d1411a 4347 PR c++/13663
4348 * semantics.c (finish_for_expr): Check for unresolved overloaded
4349 functions.
4350
7f233616 4351 * class.c (add_method): Just check processing_template_decl to
4352 determine whether or not we are within a template.
4353 * decl2.c (maybe_retrofit_in_chrg): Likewise.
4354 * init.c (decl_constant_value): Check the type of the declaration,
4355 not TREE_READONLY.
4356 * name-lookup.c (maybe_push_to_top_level): Rename to ...
4357 (push_to_top_level): ... this.
4358 * name-lookup.h (maybe_push_to_top_level): Do not declare it.
4359 * pt.c (push_template_decl_real): Reorder condition for speed.
4360 (convert_template_argument): Use dependency-checking functions in
4361 place of uses_template_parms.
4362 (lookup_template_class): Avoid calling uses_template_parms more
4363 than once.
4364 (uses_template_parms): Reimplement, using dependency-checking
4365 functions.
4366 (instantiate_class_template): Use push_to_top_level, not
4367 maybe_push_to_top_level.
4368 (type_unification_real): Simplify.
4369 (type_dependent_expression_p): Handle OFFSET_REFs and
4370 TEMPLATE_DECLs.
4371 (any_dependent_template_arguments_p): Handle multiple levels of
4372 template argument.
4373 * semantics.c (expand_or_defer_fn): Do not check
4374 uses_template_parms for template instantiations.
4375 * typeck.c (comptypes): Avoid calling cp_type_quals.
4376
cdbcf942 43772004-01-25 Mark Mitchell <mark@codesourcery.com>
4378
4379 PR c++/13833
4380 * call.c (build_over_call): Do not convert arguments when
4381 processing a template.
4382 * pt.c (build_non_dependent_expr): Do not build a
4383 NON_DEPENDENT_EXPR for arithmetic constants.
4384
eae805b4 43852004-01-25 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4386
4387 PR c++/13810
a3ad3e27 4388 * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
eae805b4 4389 returns a TYPE_DECL. no further lookup is required.
4390 * semantics.c (check_template_template_default_arg): A TYPE_DECL
4391 is invalid. Rework to give better diagnostics.
4392
89377c68 43932004-01-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
5d6080a0 4394
4395 PR c++/13797
4396 * pt.c (instantiate_class_template): Add an error_mark_node
4397 check.
4398 (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
4399
80f0bab1 44002004-01-23 Andrew Pinski <pinskia@physics.uc.edu>
4401
4402 PR c++/13701
4403 * decl.c (finish_function): Move the call to
4404 finish_fname_decls below the call to
4405 finish_eh_spec_block.
4406
d29afff0 44072004-01-21 Kazu Hirata <kazu@cs.umass.edu>
4408
4409 * optimize.c, typeck2.c: Update copyright.
4410
3de6f347 44112004-01-21 Kazu Hirata <kazu@cs.umass.edu>
4412
4413 * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
4414 init.c, mangle.c, typeck.c: Update copyright.
4415
3196cc8e 44162004-01-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4417
4418 * parser.c (cp_parser_class_specifier): Prevent garbage collection.
4419
ca6eabd1 44202004-01-20 Kelley Cook <kcook@gcc.gnu.org>
4421
4422 * Make-lang.in: Replace $(docdir) with doc.
4423 (c++.info, c++.srcinfo): Dummy entry.
4424 (c++.man, c++.srcman): New rules.
4425 (c++.install-man): Revamp rule.
4426
88a86c80 44272004-01-20 Kelley Cook <kcook@gcc.gnu.org>
4428
a3ad3e27 4429 * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
88a86c80 4430 CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
4431 immediate $(shell) instead of deferred backquote.
4432
3c33f9f3 44332004-01-19 Mark Mitchell <mark@codesourcery.com>
4434
8c3fd794 4435 PR c++/13651
4436 * parser.c (cp_parser_postfix_expression): When encountering
4437 incomplete type on left-hand side of "->" or ".", treat the entire
4438 expression as erroneous.
4439
3c33f9f3 4440 PR c++/13592
4441 * call.c (build_field_call): Remove.
4442 (n_build_method_call): Likewise.
4443 (build_method_call): Likewise.
4444 (build_new_method_call): Do not call build_field_call.
4445 * class.c (n_build_method_call): Remove.
4446 (print_class_statistics): Do not print it.
4447 * cp-tree.h (build_method_call): Remove declaration.
4448 (finish_object_call_expr): Likewise.
4449 (build_new_1): Do not use build_method_call.
4450 * parser.c (cp_parser_postfix_expression): Use finish_call_expr
4451 when the function appearing on the right-hand-side of "." or "->"
4452 is not actually a function.
4453 * pt.c (tsubst_copy_and_build): Likewise.
4454 * semantics.c (finish_object_call_expr): Remove.
4455
e960d39c 44562004-01-18 Mark Mitchell <mark@codesourcery.com>
4457
da3e0c5e 4458 PR c++/13710
e960d39c 4459 * pt.c (tsubst): Use finish_typeof.
4460
fdb7e2ef 44612004-01-18 Jason Merrill <jason@redhat.com>
35e10c04 4462
4463 PR c++/11725
4464 * except.c (build_throw): In a template, set
4465 current_function_returns_abnormally.
4466
e0a3f3f0 44672004-01-17 Fred Fish <fnf@intrinsity.com>
2ce08864 4468
4469 PR c++/11895
4470 * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
4471 except don't call array_type_nelts() with a VECTOR_TYPE.
4472
89df180d 44732004-01-16 Jan Hubicka <jh@suse.cz>
4474
4475 * mangle.c (write_mangled_name): Remove inline modifier.
4476
18bb9fee 44772004-01-16 Mark Mitchell <mark@codesourcery.com>
4478
8f034d15 4479 PR c++/13574
4480 * decl.c (compute_array_index_type): Fix grammar in comment.
4481 * init.c (build_zero_init): Handle zero-sized arrays correctly.
4482
2c979f61 4483 PR c++/13178
4484 * call.c (name_as_c_string): Print conversion operator names
4485 correctly.
4486
18bb9fee 4487 PR c++/13478
297635f0 4488 * call.c (initialize_reference): Pass -1 for inner parameter to
4489 convert_like_real.
18bb9fee 4490
9591b260 44912004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4492
4493 PR c++/13407
4494 * parser.c (cp_parser_base_specifier): Check for an invalid
4495 keyword `typename' and emit an user-friendly error message.
4496
bff4639d 44972004-01-15 Geoffrey Keating <geoffk@apple.com>
4498
4499 PR pch/13361
4500 * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
4501 (handle_pragma_implementation): Likewise.
4502
26a74898 45032004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4504
4505 PR c++/9259
4506 * typeck.c (build_class_member_access_expr): Allow to access members
4507 of the currently open class.
4508 (finish_class_member_access_expr): Likewise.
4509
2c47ecdb 45102004-01-15 Alexandre Oliva <aoliva@redhat.com>
4511
4512 PR c++/13659
4513 * name-lookup.c (validate_nonmember_using_decl): Take scope and
4514 name by value, instead of computing them.
4515 (do_local_using_decl, do_toplevel_using_decl): Add scope and name
4516 arguments. Pass them to validate_nonmember_using_decl.
4517 * name-lookup.h (do_local_using_decl): Adjust.
4518 (do_toplevel_using_decl): Likewise.
4519 * parser.c (cp_parser_using_declaration): Likewise.
4520 * pt.c (tsubst_expr): Likewise.
4521
f69cc1a1 45222004-01-15 Alexandre Oliva <aoliva@redhat.com>
4523
4524 PR c++/13594
4525 PR c++/13658
4526 * name-lookup.c (qualified_lookup_using_namespace): Search
4527 strongly-associated namespaces first, and only then try other
4528 namespaces.
4529
a6b4c5a9 45302004-01-15 Kelley Cook <kcook@gcc.gnu.org>
4531
4532 * Make-lang.in (c++.srcextra): Dummy entry.
4533
182d094e 45342004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4535
4536 PR c++/8856
a3ad3e27 4537 * parser.c (cp_parser_template_name): Don't try to parse a
182d094e 4538 conversion-function-id, as it cannot be a template-name.
4539 (cp_parser_simple_type_specifier): Check for invalid template-ids
4540 even after a built-in type.
4541
fbaebc0c 45422004-01-14 Jan Hubicka <jh@suse.cz>
4543
4544 PR c++/12850
4545 * pt.c (instantiate_decl): Do not increase function_depth.
4546
c3a5d13a 45472004-01-14 Danny Smith <dannysmith@users,sourceforge.net>
4548
4549 PR c++/9021
9fcbf115 4550 PR c++/11005
c3a5d13a 4551 * parser.c (cp_parser_elaborated_type_specifier): Warn about
4552 attributes and discard.
4553 * decl.c (xref_tag): Don't overwite existing attributes with
4554 NULL_TREE.
4555
2b40dfce 45562004-01-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4557
4558 PR c++/12335
4559 * parser.c (cp_parser_lookup_name): Return error_mark_node if there
4560 is no destructor while looking up a BIT_NOT_EXPR.
4561
bae5bcd2 45622004-01-13 Ian Lance Taylor <ian@wasabisystems.com>
4563
4564 * cxxfilt.c: Remove unused file.
4565
dc721f36 45662004-01-14 Jan Hubicka <jh@suse.cz>
4567
4568 Partial fix to PR c++/12850
4569 * decl2.c (mark_used): Do not proactively instantiate templates
4570 when compiling in unit-at-a-time or not optimizing.
4571 * optimize.c (maybe_clone_body): Do not increase function depth.
4572
bd536ad7 45732004-01-13 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4574
4575 PR c++/13474
4576 * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
4577
4889e098 45782004-01-12 Steven Bosscher <stevenb@suse.de>
069754af 4579
4580 PR c++/13558
4581 * parser.c (cp_parser_member_declaration): Any non-type is also
4582 not a class or a function.
4583
b453256d 45842004-01-12 Jason Merrill <jason@redhat.com>
4585
4586 PR c++/12815
4587 * class.c (build_base_path): Do not mark vtable references as
4588 TREE_CONSTANT.
4589 (build_vtbl_ref_1): Likewise.
4590
3afe9b43 45912004-01-12 Richard Henderson <rth@redhat.com>
4592
4593 PR opt/10776
4594 * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
4595 (store_init_value): Use it.
4596 * decl.c (check_initializer): Expect full initialization code
4597 from store_init_value.
4598 * init.c (expand_aggr_init_1): Likewise.
4599 * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
4600
0db4e267 46012004-01-12 Mark Mitchell <mark@codesourcery.com>
4602
4603 * class.c (layout_class_type): For non-POD class types, also copy
4604 the DECL_SIZE and DECL_MODE of fields to the base class type.
4605
9b08685a 46062004-01-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
4607
4608 PR c++/13289
4609 * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
4610 calling regenerate_decl_from_template.
4611
2822900d 46122004-01-12 Scott Brumbaugh <scottb.lists@verizon.net>
4613
4614 PR c++/4100
4615 * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
4616 decl-specifier occurring along with a class definition.
4617
8e594c09 46182004-01-12 Ian Lance Taylor <ian@wasabisystems.com>
4619
4620 * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
4621 clauses to comments describing declares_class_or_enum.
4622 (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
4623 false.
4624
4131d641 46252004-01-12 Jan Hubicka <jh@suse.cz>
4626
4627 * pt.c (for_each_template_parm): Do not check for duplicates.
4628 (for_each_template_parm): Use walk_tree duplicate checking code.
4629
396d2731 46302004-01-11 Ian Lance Taylor <ian@wasabisystems.com>
4631
4632 PR c++/3478
4633 * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
4634 is error_mark_node, don't add any more decl_specs.
4635 (cp_parser_init_declarator): After committing to a declaration, if
4636 the decl_specifiers start with error_mark_node, issue an error and
4637 change the type to "int".
4638
0182edfd 46392004-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
4640
4641 PR bootstrap/7817
4642 * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
4643
71817734 46442004-01-10 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4645
4646 DR 337
4647 PR c++/9256
a3ad3e27 4648 * pt.c (tsubst): Substitution must fail if we are attempting to
71817734 4649 create an array with element type that is an abstract class type.
4650 * decl.c (cp_finish_decl): Strip pointers and array types recursively
4651 before calling abstract_virtuals_error.
4652
16bf97ca 46532004-01-09 Alexandre Oliva <aoliva@redhat.com>
4654
4655 * name-lookup.c (qualified_lookup_using_namespace): Consider
4656 strong using directives even if we've already found a binding.
4657
60ffaf4d 46582004-01-09 Mark Mitchell <mark@codesourcery.com>
4659
4660 * cp-tree.h (cxx_expand_expr): Change prototype.
4661 * expr.c (cxx_expand_expr): Add alt_rtl parameter.
4662
ee02b987 46632004-01-08 Giovanni Bajo <giovannibajo@gcc.gnu.org>
4664
4665 PR c++/12573
4666 * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
4667 looking into them recursively. They can be there because of the
4668 new __offsetof__ extension.
4669
817adc77 46702004-01-07 Zack Weinberg <zack@codesourcery.com>
4671
4672 * parser.c (cp_parser_save_member_function_body): Mark the
4673 definition static.
4674
600be0e5 46752004-01-05 Mark Mitchell <mark@codesourcery.com>
4676
3167f67d 4677 PR c++/13057
4678 * class.c (build_clone): Copy type attributes from the original
4679 function to the clone.
817adc77 4680
02d35f84 4681 PR c++/12815
d3c2a736 4682 * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
4683 references as constant.
4684
e1a6bbd7 4685 PR c++/12132
4686 * parser.c (cp_parser_explicit_instantiation): Improve error
4687 recovery.
4688 (cp_parser_require): Improve indication of the error location.
4689
600be0e5 4690 PR c++/13451
4691 * parser.c (cp_parser_class_head): Reorder logic to check for
4692 invalid qualification.
4693
f3ccd0ea 46942004-01-04 Mark Mitchell <mark@codesourcery.com>
4695
4696 PR c++/13157
4697 * name-lookup.c (lookup_using_namespace): Remove spacesp
4698 parameter.
4699 (unqualified_namespace_lookup): Likewise.
4700 (lookup_qualified_name): Adjust accordingly.
4701 (lookup_name_real): Likewise.
4702 (lookup_arg_dependent): Do not eliminate the namespace of the
4703 functions found by unqualified name lookup unless that is the
4704 current namespace.
4705
2a0d3beb 47062004-01-04 Andrew Pinski <pinskia@physics.uc.edu>
4707
4708 * semantics.c (push_deferring_access_checks): Fix format.
4709 (resume_deferring_access_checks): Likewise.
4710 (stop_deferring_access_checks): Likewise.
4711 (pop_deferring_access_checks): Likewise.
4712 (get_deferred_access_checks): Likewise.
4713 (pop_to_parent_deferring_access_checks): Likewise.
4714 (perform_deferred_access_checks): Likewise.
4715 (perform_or_defer_access_check): Likewise.
4716
ebaba16c 47172004-01-04 Richard Henderson <rth@redhat.com>
4718
4719 * call.c (build_over_call): Don't create a save_expr of an
4720 aggregate, but rather its address.
4721
41f2d08e 47222004-01-04 Mark Mitchell <mark@codesourcery.com>
4723
fd14da69 4724 PR c++/13529
4725 * parser.c (cp_parser_postfix_expression): Allow "." to appear in
4726 an offsetof expression.
4727
461ec6e9 4728 * parser.c (cp_parser_parameter_declaration): Fix comment.
4729
41f2d08e 4730 PR c++/12226
4731 * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
4732 (reference_binding): Set it when appropriate.
4733 (build_temp): New function, split out from ...
4734 (convert_like_real): ... here. Honor CHECK_COPY_CONSTRUCTOR_P.
4735 (initialize_reference): Likewise.
4736
4737 PR c++/13536
4738 * parser.c (cp_parser): Add in_type_id_in_expr_p.
4739 (cp_parser_new): Initialize it.
4740 (cp_parser_postfix_expression): Set it.
4741 (cp_parser_sizeof_operand): Likewise.
4742 (cp_parser_parameteR_declaration): Do not commit early to tenative
4743 parsers when in_type_id_in_expr_p is set.
4744
11c54989 47452004-01-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
4746
4747 PR c++/13094
4748 * parser.c (cp_parser_template_argument): Don't call
4749 make_unbound_class_template directly.
4750 (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
4751 UNBOUND_CLASS_TEMPLATE tree node.
4752
eb42c808 47532004-01-02 Richard Sandiford <rsandifo@redhat.com>
4754
4755 PR target/12729
4756 * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
4757
c3b9e457 47582004-01-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
4759
4760 PR c++/13520
4761 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
4762 (DECL_FUNCTION_TEMPLATE_P): Use it.
4763 (DECL_CLASS_TEMPLATE_P): Likewise.
4764 * parser.c (cp_parser_lookup_name): Add is_template parameter.
4765 (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
4766 (cp_parser_template_name): Likewise.
4767 (cp_parser_elaborated_type_specifier): Likewise.
4768 (cp_parser_namespace_name): Likewise.
4769 (cp_parser_class_name): Likewise.
4770 (cp_parser_lookup_name_simple): Likewise.
59939326 4771
2eb10302 4772See ChangeLog.3 for earlier changes.