OSDN Git Service

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