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