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