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