OSDN Git Service

2007-10-14 Andrew Pinski <pinskia@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2007-10-14  Andrew Pinski  <pinskia@gmail.com>
2
3         PR c++/30303
4         * decl.c (grokfndecl): Return NULL after the "definition of
5         implicitly-declared" error happened.
6
7 2007-10-12  Simon Martin  <simartin@users.sourceforge.net>
8
9         PR c++/26698
10         * call.c (build_user_type_conversion_1): Do not consider conversion
11         functions to convert a (possibly cv-qualified) object to the (possibly
12         cv-qualified) same object type (or a reference to it), to a (possibly
13         cv-qualified) base class of that type (or a reference to it).
14
15 2007-10-12  Paolo Carlini  <pcarlini@suse.de>
16
17         * pt.c (tsubst): Use template_parm_level_and_index.
18
19 2007-10-12  Jakub Jelinek  <jakub@redhat.com>
20
21         PR c++/32121
22         * parser.c (cp_parser_compound_statement): Handle label-declarations
23         at the beginning of the compound statement.
24         (cp_parser_block_declaration): Issue diagnostics about __label__
25         not at the beginning of a block.
26
27 2007-10-11  Paolo Carlini  <pcarlini@suse.de>
28
29         PR c++/33461
30         * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
31         to convert_template_argument.
32         (coerce_template_parms): Return error_mark_node after fixed-length
33         error.
34         (tsubst_decl): Check for error_mark_node the return value of the
35         first tsubst in 'case VAR_DECL'.
36
37 2007-10-08  Ollie Wild  <aaw@google.com>
38
39         * typeck2.c (digest_init): Call cplus_expand_constant after
40         convert_for_initialization.
41         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
42         * expr.c (cplus_expand_constant): Updated function description.
43
44 2007-10-04  Jason Merrill  <jason@redhat.com>
45
46         PR c++/20416
47         * call.c (initialize_reference): Handle local static reference
48         temps properly.
49
50 2007-10-03  Jason Merrill  <jason@redhat.com>
51
52         PR c++/32470
53         * name-lookup.c (push_namespace_with_attrs): Fold back into...
54         (push_namespace): Here.
55         (handle_namespace_attrs): New fn for the attr code.
56         (leave_scope): Don't pop_visibility.
57         * name-lookup.h (struct cp_binding_level): Remove has_visibility.
58         * parser.c (cp_parser_namespace_definition): Call
59         handle_namespace_attrs and pop_visibility as appropriate. 
60
61         PR c++/11756
62         * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
63
64 2007-10-03  Alexandre Oliva  <aoliva@redhat.com>
65
66         * decl.c (duplicate_decls): Preserve linkage flags for mere
67         redeclarations of gnu_inline definitions.
68
69 2007-10-03  Jason Merrill  <jason@redhat.com>
70
71         PR c++/15764
72         * decl.c (wrap_cleanups_r): New fn.
73         (wrap_temporary_cleanups): New fn.
74         (initialize_local_var): Call it.
75
76 2007-09-29  Jason Merrill  <jason@redhat.com>
77
78         PR c++/33094
79         * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member 
80         constant to not have DECL_EXTERNAL if it's file-local.
81
82 2007-09-28  Ollie Wild  <aaw@google.com>
83
84         Revert
85         2007-09-27  Ollie Wild  <aaw@google.com>
86
87         * typeck2.c (digest_init): Call cplus_expand_constant after
88         convert_for_initialization.
89         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
90         * expr.c (cplus_expand_constant): Updated function description.
91
92 2007-09-28  Jason Merrill  <jason@redhat.com>
93
94         PR c++/10179
95         * class.c (layout_empty_base): Take rli parameter, update
96         rli->record_align if empty base has user-specified alignment.
97         (build_base_field): Pass rli to it.
98
99 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
100
101         PR c++/33213
102         * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
103
104 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
105
106         PR c++/33118
107         * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
108         (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
109         (dump_parameters): Just call dump_type for argument packs too.
110
111 2007-09-28  Jakub Jelinek  <jakub@redhat.com>
112
113         PR c++/31434
114         * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
115         qualification by creating qualified PACK_EXPANSION_PATTERN and
116         then calling make_pack_expansion on it.
117
118 2007-09-27  Ollie Wild  <aaw@google.com>
119
120         * typeck2.c (digest_init): Call cplus_expand_constant after
121         convert_for_initialization.
122         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
123         * expr.c (cplus_expand_constant): Updated function description.
124
125 2007-09-27  Jason Merrill  <jason@redhat.com>
126
127         PR c++/33571
128         * decl2.c (is_late_template_attribute): Don't crash on unknown
129         attribute.
130
131 2007-09-27  Paolo Carlini  <pcarlini@suse.de>
132
133         PR c++/33493
134         * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
135         * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
136         spaces in the formatting.
137         * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
138
139 2007-09-27  Jakub Jelinek  <jakub@redhat.com>
140
141         * error.c (cxx_print_error_function): Add third argument, pass
142         it over to lhd_print_error_function.
143         (cp_print_error_function): If diagnostic->abstract_origin, print
144         virtual backtrace.
145         * cp-tree.h (struct diagnostic_info): New forward decl.
146         (cxx_print_error_function): Add third argument.
147
148 2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
149
150         PR c++/33207
151         * name-lookup.c (pushtag): Do not create an implicit typedef before
152         the associated type declaration is known to be valid.
153
154 2007-09-25  Jakub Jelinek  <jakub@redhat.com>
155
156         * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
157         rather than pointers.
158
159 2007-09-24  Danny Smith  <dannysmith@user.sourceforge.net>
160
161         PR c++/14688
162         * search.c (check_final_overrider): Fail if
163         targetm.comp_type_attributes returns 0.
164
165 2007-09-24  Jason Merrill  <jason@redhat.com>
166
167         PR c++/33239
168         * pt.c (resolve_typename_type): Don't look things up in the original
169         template if it would mean losing template arguments.    
170
171 2007-09-24  Jakub Jelinek  <jakub@redhat.com>
172
173         PR c++/33506
174         * cp-tree.h (cxx_type_hash_eq): New prototype.
175         * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
176         * tree.c (cxx_type_hash_eq): New function.
177
178 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
179
180         PR c++/33185    
181         * tree.c (cp_build_qualified_type_real): Build a canonical
182         ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
183         
184 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
185
186         PR c++/33112
187         PR c++/33185    
188         * tree.c (cplus_array_compare): Compare pointers, not types.
189         (build_cplus_array_type_1): Store new array type into the hash
190         table before building the canonical type; build the canonical type
191         correctly.
192         (cp_build_qualified_type_real): Put all of the array types with
193         cv-qualified element types into the C++ array hash table, built as 
194         variants of the unqualified versions.
195         
196 2007-09-23  Jason Merrill  <jason@redhat.com>
197
198         PR c++/16370
199         * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
200         for deprecation warnings.
201
202 2007-09-22  Jason Merrill  <jason@redhat.com>
203
204         PR c++/15269
205         * call.c (build_over_call): Warn about deprecated virtuals.
206
207         PR c++/19407
208         * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
209         (MAYBE_TAGGED_TYPE_P): Remove.
210         * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
211         instead of calling is_late_template_attribute again.
212         (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
213         (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
214         Don't crash on typedefs from non-template classes.
215         * decl2.c (grokfield): Don't sorry about attrs on template parms.
216         (is_late_template_attribute): All attributes applied to template
217         parms or typename types are dependent.  Static.
218         (splice_template_attributes): Pass decl through.
219         (save_template_attributes): Likewise.
220
221 2007-09-20  Jakub Jelinek  <jakub@redhat.com>
222
223         PR c++/33496
224         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
225         returned from tsubst_pack_expansion.
226         (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
227         (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
228
229 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
230
231         PR c++/33460
232         * semantics.c (finish_id_expression): Use consistently
233         context_for_name_lookup.
234         * decl.c (fixup_anonymous_aggr): Fix error message for
235         anonymous struct (vs union).
236
237 2007-09-19  Jason Merrill  <jason@redhat.com>
238
239         PR c++/7586
240         * pt.c (tsubst): Handle typedefs by looking for the specialization.
241         (retrieve_specialization): Only tagged types use 
242         DECL_TEMPLATE_INSTANTIATIONS.
243         (instantiate_class_template): Push nested classes too.
244         (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
245         tagged types.
246         * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
247         * init.c (is_aggr_type): Remove redundant tests.
248         * class.c (push_nested_class): Use CLASS_TYPE_P.
249
250 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
251
252         PR c++/33459
253         * init.c (build_zero_init): If, recursively, build_zero_init
254         returns a NULL_TREE, do not append it to the VEC of constructors.
255
256 2007-09-18  Jason Merrill  <jason@redhat.com>
257
258         PR c++/17743
259         * pt.c (apply_late_template_attributes): Set processing_template_decl.
260         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
261         ATTR_FLAG_TYPE_IN_PLACE.
262         (tsubst): Do unqualified lookup to find typedefs from current class.
263         [ARRAY_TYPE]: Propagate alignment info.
264         * decl2.c (is_late_template_attribute): Only defer handling of
265         attribute aligned if the expression is dependent.
266         (save_template_attributes): If we're deferring any attributes,
267         make this a naming typedef.
268
269 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
270
271         PR c++/33462 (again)
272         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
273         va_arg instead of __builtin_va_arg.
274
275 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
276
277         PR c++/33462
278         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
279         (pp_cxx_primary_expression): Use it.
280         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
281         * error.c (dump_expr): Use it.
282
283 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
284
285         PR c++/33463
286         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
287         out case TYPEID_EXPR to...
288         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
289         and pp_cxx_right_paren.
290         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
291         * error.c (dump_expr): Use it.
292
293 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
294
295         PR c++/33464
296         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
297         (pp_cxx_primary_expression): Use it.
298         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
299         * error.c (dump_expr): Use it.
300
301 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
302
303         PR c++/33124
304         * init.c (build_new): Remove warning for zero-element
305         allocations.
306
307 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
308
309         PR c++/32756
310         * call.c (maybe_handle_implicit_object): Set this_p, clear
311         rvaluedness_matches_p.
312         (compare_ics): Do not compare rvaluedness matching when one of the
313         operands is an implicit object.
314
315 2007-09-14  Jason Merrill  <jason@redhat.com>
316
317         PR c++/17743, c++/19163
318         * decl2.c (is_late_template_attribute): New fn.
319         (splice_template_attributes, save_template_attributes): New fns.
320         (cplus_decl_attributes): Call save_template_attributes.
321         * pt.c (apply_late_template_attributes): New fn.
322         (instantiate_class_template, tsubst_decl): Use it.
323         * cp-tree.h: Declare is_late_template_attribute.
324
325 2007-09-13  Tom Tromey  <tromey@redhat.com>
326
327         * parser.c (cp_lexer_new_main): Don't use
328         c_lex_return_raw_strings.
329         (cp_lexer_get_preprocessor_token): Update.  Add special case when
330         lexer is NULL.
331
332 2007-09-11  Jan Hubicka <jh@suse.cz>
333
334         * method.c (use_thunk): Use tree_rest_of_compilation
335         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
336         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
337         * cp-tree.h (expand_body): Kill.
338         (emit_associated_thunks): Declare.
339         * semantics.c (emit_associated_thunks): Export.
340         (expand_body): Kill.
341
342 2007-09-09  David Daney  <ddaney@avtrex.com>
343
344         PR c++/33324
345         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
346         to calculate cookie_ptr.
347
348 2007-09-08  Jason Merrill  <jason@redhat.com>
349
350         PR c++/33342
351         * pt.c (most_specialized_class): Set processing_template_decl
352         while tsubsting partial spec args.
353
354 2007-09-06  Jason Merrill  <jason@redhat.com>
355
356         * decl2.c (get_guard): Copy visibility from the guarded variable.
357
358 2007-09-06  Jan Hubicka  <jh@suse.cz>
359
360         * semantics.c (expand_body): Do not mark arguments of clones used.
361
362 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
363
364         PR c++/32674
365         * decl.c (cp_finish_decl): When processing_template_decl,
366         deal correctly with init as TREE_LIST.
367
368 2007-09-06  Tom Tromey  <tromey@redhat.com>
369
370         * decl.c (finish_function): Put return's location on line zero of
371         file.
372
373 2007-09-05  Jason Merrill  <jason@redhat.com>
374
375         PR c++/15745
376         * except.c (prepare_eh_type): Use type_decays_to.
377
378         PR c++/15097
379         * init.c (build_delete): Use build_headof to get the address of the
380         complete object if we aren't using the deleting destructor.
381         * rtti.c (build_headof): No longer static.
382         * cp-tree.h: Declare it.
383
384 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
385
386         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
387         decl if a prototype for XX is provided with throw().
388
389         PR c++/33289
390         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
391         on __*_chk non-__builtin_* decls.
392
393 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
394
395         PR c++/30302
396         * semantics.c (finish_id_expression): Use context_for_name_lookup
397         insted of DECL_CONTEXT, to see through anonymous structs and unions.
398         * class.c (finish_struct_anon): Deal correctly with anonymous
399         structs (vs unions, as GNU extension) in error messages.
400
401 2007-09-05  Jan Hubicka  <jh@suse.cz>
402
403         * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
404         call, DECL_EXTERNAL checks and current_function_decl saving.
405
406 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
407
408         PR c++/29731 (again)
409         * parser.c (cp_parser_primary_expression): Return error_mark_node
410         when a statement-expression is found in a template-argument list.
411
412 2007-09-04  Jason Merrill  <jason@redhat.com>
413
414         * except.c (initialize_handler_parm): Use
415         fold_build_cleanup_point_expr.
416
417         PR c++/31419
418         * call.c (reference_binding): Don't look for user-defined conversions
419         to the same type.
420
421         PR c++/31411
422         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
423         the MUST_NOT_THROW_EXPR.
424
425 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
426
427         * decl.c (cp_finish_decl): Call determine_visibility before
428         make_rtl_for_nonlocal_decl.
429
430 2007-09-04  Jason Merrill  <jason@redhat.com>
431
432         PR c++/14032
433         * pt.c (most_specialized_class): Substitute outer template
434         arguments into the arguments of a member template partial
435         specialization.
436         (strip_innermost_template_args): New fn.
437
438 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
439
440         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
441
442 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
443
444         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
445         * decl.c (cp_make_fname_decl): Likewise,
446         * parser.c (cp_parser_string_literal): Likewise,
447         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
448         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
449         Likewise,
450
451 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
452
453         PR c++/33208
454         * typeck.c (build_unary_op): Fix error message for
455         Boolean expression as operand to operator--.
456
457 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
458
459         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
460         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
461         Likewise.
462
463 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
464
465         PR c++/32597
466         * init.c (build_default_init): Make extern.
467         * cp-tree.h (build_default_init): Declare here.
468         * pt.c (tsubst_expr): When the instantiation of the initializer of
469         a variable results in an empty list, default-initialize the
470         variable.
471         (tsubst_copy_and_build): When the instantiation of the initializer
472         in a new expression results in an empty initializer list,
473         default-initialize it.
474
475 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
476
477         * mangle.c (write_type): Change mangling of rvalue reference from
478         `RR' to `O'. 
479
480 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
481
482         * decl.c (duplicate_decls): Remove duplicated line.
483
484 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
485
486         PR c++/33210
487         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
488         BOUND_TEMPLATE_TEMPLATE_PARM.
489
490 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
491
492         PR c++/32113
493         * search.c (lookup_member): Check the name argument for
494         error_mark_node.
495
496 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
497
498         PR c++/33212
499         * parser.c (cp_parser_trait_expr): Check rerurn value of
500         cp_parser_type_id.
501
502 2007-08-30  Ollie Wild  <aaw@google.com>
503
504         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
505         convert_ptrmem for pointer to member conversions.
506         (convert_to_pointer_force): Update cp_convert_to_pointer call.
507         (ocp_convert): Update cp_convert_to_pointer call.
508         * typeck.c (convert_ptrmem): Add conditional for null pointers to
509         members.
510         (build_static_cast_1): Check can_convert for conversions in either
511         direction.
512         (get_delta_difference_1): New function.
513         (get_delta_difference): Refactor to call get_delta_difference_1.
514
515 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
516
517         * decl.c (start_preparsed_function): Set
518         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
519
520 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
521
522         PR c++/33209
523         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
524         BOUND_TEMPLATE_TEMPLATE_PARM.
525
526 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
527
528         PR c++/32596
529         PR c++/32400
530         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
531         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
532
533 2007-08-27  Jason Merrill  <jason@redhat.com>
534
535         PR c++/29000
536         * pt.c (build_non_dependent_expr, type_dependent_expression_p): 
537         Look inside STMT_EXPR.
538         * semantics.c (stmt_expr_value_expr): New fn.
539         * cp-tree.h: Declare it.
540
541         PR c++/28558
542         * decl.c (groktypename): Ignore attributes applied to class type.
543
544 2007-08-28  Richard Guenther  <rguenther@suse.de>
545
546         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
547
548 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
549         
550         * error.c (dump_expr): Handle COMPLEX_CST.
551         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
552         (pp_cxx_expression): Likewise.
553
554 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
555
556         * decl.c (GNU_INLINE_P): New.
557         (duplicate_decls): Handle gnu_inline.  Merge attributes and
558         some flags in overriding definitions.
559         (redeclaration_error_message): Handle gnu_inline.
560         (start_preparsed_function): Likewise.
561
562 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
563
564         * call.c (sufficient_parms_p): Constify.
565         * class.c (same_signature_p): Likewise.
566         * cp-gimplify.c (is_invisiref_parm,
567         cxx_omp_privatize_by_reference): Likewise.
568         * cp-objcp-common.c (has_c_linkage): Likewise.
569         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
570         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
571         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
572         num_artificial_parms_for, comp_template_parms,
573         template_parameter_pack_p, any_dependent_template_arguments_p,
574         any_type_dependent_arguments_p, any_value_dependent_elements_p,
575         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
576         zero_init_p, member_p, cp_lvalue_kind,
577         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
578         varargs_function_p, is_dummy_object, special_function_kind,
579         string_conv_p, type_unknown_p, comp_except_specs, compparms,
580         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
581         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
582         cp_has_mutable_p, at_least_as_qualified_p,
583         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
584         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
585         * except.c (nothrow_libfn_p): Likewise.
586         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
587         Likewise.
588         * pt.c (comp_template_parms, template_parameter_pack_p,
589         any_type_dependent_arguments_p, any_value_dependent_elements_p,
590         any_dependent_template_arguments_p): Likewise.
591         * repo.c (repo_export_class_p): Likewise.
592         * semantics.c (anon_aggr_type_p): Likewise.
593         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
594         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
595         varargs_function_p, member_p, is_dummy_object, pod_type_p,
596         zero_init_p, special_function_p): Likewise.
597         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
598         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
599         compparms, invalid_nonstatic_memfn_p,
600         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
601         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
602         cp_has_mutable_p, lvalue_or_else): Likewise.
603
604 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
605
606         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
607         * cp-objcp-common.c (cp_tree_size): Ditto.
608         * tree.c (cp_walk_subtrees): Ditto
609         * cp-tree.def (TINST_LEVEL): Go away.
610         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
611         move together with other non-tree structs.
612         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
613         (union lang_tree_node): Eliminate tinst_level field.
614         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
615         (current_instantiation, outermost_tinst_level): Return
616         a "struct tinst_level *".
617
618         * error.c (print_instantiation_partial_context): Change second
619         parameter to a "struct tinst_level *".  Replace accessor macros
620         with field access.
621         (print_instantiation_full_context): Likewise.
622         * lex.c (in_main_input_context): Likewise.
623
624         * pt.c (struct pending_templates): New.
625         (pending_templates, last_pending_template): Use it as a type.
626         (current_tinst_level): Change typo to "struct tinst_level *"
627         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
628         (add_pending_template): Construct a "struct pending_template".
629         Replace TINST_LEVEL accessor macros with field access.
630         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
631         (pop_tinst_level): Likewise.
632         (instantiate_pending_templates): Likewise.  Factor common code used
633         when an instantiation has been done.
634         (outermost_tinst_level): Replace tree_last with loop.
635         (current_instantiation): Return a "struct tinst_level *".
636
637 2007-08-24  Ollie Wild  <aaw@google.com>
638
639         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
640         * name-lookup.h (cp_binding_level): Remove vtables member.
641
642 2007-08-24  Richard Guenther  <rguenther@suse.de>
643
644         * tree.c (cp_cannot_inline_tree_fn): Remove.
645         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
646         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
647         Remove define.
648
649 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
650
651         PR c++/32567
652         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
653         error_mark_node right away if build_expr_type_conversion
654         returned it.
655
656         PR c++/32898
657         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
658         is error_mark_node rather than NULL_TREE.
659         * pt.c (check_explicit_specialization): Likewise.
660
661         PR c++/31941
662         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
663         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
664
665 2007-08-22  Jason Merrill  <jason@redhat.com>
666
667         PR c++/29365
668         * pt.c (outermost_tinst_level): New function.
669         * lex.c (in_main_input_context): New function.
670         * cp-tree.h: Declare it.
671         * decl2.c (constrain_class_visibility): Use it to avoid warning
672         about uses of the anonymous namespace in the main input file.
673
674 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
675
676         * init.c (build_new_1): Use get_target_expr instead of save_expr.
677
678 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
679
680         PR c++/7302
681         * class.c (finish_struct_1): Warn when a class has virtual
682         functions and accessible non-virtual destructor.
683
684 2007-08-20  Richard Guenther  <rguenther@suse.de>
685
686         PR c++/22369
687         PR c++/22451
688         * call.c (build_new_method_call): Convert initializer to
689         the basetype.
690         * init.c (build_aggr_init): Do not fiddle with types.
691         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
692         * except.c (build_throw): Do not drop qualifiers for the
693         pointer type.
694         * typeck.c (get_member_function_from_ptrfunc): Do not
695         fiddle with types, instead convert.
696         (build_ptrmemfunc1): Convert to the target type for
697         initialization.
698         (gfc_trans_allocate): Convert result to target type.
699         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
700         pointer-to-member structures shall have alias set zero as well.
701
702 2007-08-20  Richard Guenther  <rguenther@suse.de>
703
704         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
705         Remove.
706         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
707         (nonstatic_local_decl_p): Likewise.
708         * tree.c (cp_auto_var_in_fn_p): Remove.
709         * decl.c (nonstatic_local_decl_p): Remove.
710
711 2007-08-20  Richard Guenther  <rguenther@suse.de>
712
713         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
714         Remove define.
715         * tree.h (cp_walk_tree): New define to walk_tree_1 with
716         cp_walk_subtrees lh parameter.
717         (cp_walk_tree_without_duplicates): New define to
718         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
719         * tree.c (count_trees): Call
720         cp_walk_tree_without_duplicates.
721         (verify_stmt_tree): Call cp_walk_tree.
722         (break_out_target_exprs): Likewise.
723         (WALK_SUBTREE): Likewise.
724         * cp-gimplify.c (cp_genericize): Likewise.
725         * cp-pt.c (find_parameter_packs_r): Likewise.
726         (uses_parameter_packs): Likewise.
727         (make_pack_expansion): Likewise.
728         (check_for_bare_parameter_packs): Likewise.
729         (for_each_template_parm): Likewise.
730         * decl.c (check_default_argument): Call
731         cp_walk_tree_without_duplicates.
732         * except.c (build_throw): Likewise.
733         * decl2.c (type_visibility): Likewise.
734         * semantics.c (expand_or_defer_fn): Likewise.
735         (finalize_nrv): Call cp_walk_tree.
736
737 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
738
739         PR c++/33025
740         * init.c (build_new_1): Rename placement_var variable to placement_expr.
741         Initialize it with save_expr rather than get_temp_regvar.
742
743 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
744
745         PR c++/28989
746         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
747         lvalues.
748
749 2007-08-17  Ollie Wild  <aaw@google.com>
750
751         PR c++/31749
752         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
753         declarations into appropriate slots for comparison.  Fix type
754         comparison.
755
756 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
757
758         PR c++/32112
759         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
760         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
761
762 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
763
764         PR c++/32870
765         * parser.c (cp_parser_class_head): Improve error message.
766
767 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
768
769         * pt.c (instantiate_decl): Set input_location
770         for the function end.
771
772 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
773
774         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
775         Constify.
776         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
777         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
778         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
779         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
780         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
781         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
782         * typeck.c (cp_type_quals): Likewise.
783         * typeck2.c (cxx_incomplete_type_diagnostic,
784         cxx_incomplete_type_error): Likewise.
785
786 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
787
788         PR c++/31132
789         * pt.c (tsubst_friend_function): When check_classfn
790         returns error_mark_node likewise return it.
791
792 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
793
794         PR c++/32992
795         * typeck.c (check_return_expr): Don't NRV optimize vars in
796         anonymous unions.
797         * decl.c (finish_function): Comment fix.
798
799 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
800
801         PR c++/33035
802         * pt.c (push_template_decl_real): Depending on TYPE_P
803         use either TYPE_CONTEXT or DECL_CONTEXT.
804
805 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
806
807         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
808         constructors and destructors return this.
809
810 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
811
812         PR c++/27211
813         * decl2.c (check_classfn): Return error_mark_node in case of error;
814         in that case, do not call add_method.
815         * decl.c (start_decl): Deal with check_classfn returning
816         error_mark_node.
817         (grokfndecl): Likewise.
818         * pt.c (tsubst_friend_function): Likewise.
819
820 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
821
822         PR c++/30428
823         * typeck.c (build_binary_op): Disallow vector float types with
824         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
825
826 2007-08-11  Ian Lance Taylor  <iant@google.com>
827
828         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
829         alias_set_type.
830         * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
831
832 2007-08-10  Ollie Wild  <aaw@google.com>
833
834         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
835         type lookups.
836         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
837         function parameter.
838         (unqualified_namespace_lookup): Fix ambiguous_decl call.
839         (lookup_using_namespace): Fix ambiguous_decl call.
840         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
841
842 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
843
844         * call.c (name_as_c_string): Use CONST_CAST.
845         * decl.c (build_decl): Likewise.
846         * parser.c (cp_parser_string_literal): Likewise.
847
848 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
849
850         PR c++/17763
851         * error.c (dump_expr): Consistently use the *_cxx_*
852         variants of the pretty-print functions.
853
854 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
855
856         PR c++/22256
857         * decl.c (check_special_function_return_type): Just error
858         on return type specified for conversion operator.
859
860 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
861
862         * typeck2.c (readonly_error): Handle general expressions.
863         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
864
865 2007-08-06  Dan Hipschman  <dsh@google.com>
866
867         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
868         access function name.
869
870 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
871
872         PR pch/13676
873         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
874         * g++spec.c (lang_specific_driver): Check them.
875
876 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
877
878         PR c++/19532
879         * pt.c (inline_needs_template_parms): Fix comment; change return type
880         to bool.
881
882 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
883
884         Revert:
885         2007-03-26  Dirk Mueller  <dmueller@suse.de>
886
887         * parser.c (cp_parser_member_declaration): Pedwarn
888         about stray semicolons after member declarations.
889
890 2007-08-02  Lee Millward  <lee.millward@gmail.com>
891
892         PR c++/30849
893         PR c++/30850
894         PR c++/30851
895         * parser.c (cp_parser_asm_definition): Detect and discard asm
896         statements with invalid inputs or outputs.
897         (cp_parser_asm_operand_list): Return error mark node if any
898         of the operands are invalid. Adjust documentation.
899         
900 2007-08-02  Nick Clifton  <nickc@redhat.com>
901
902         * typeck.c: Change copyright header to refer to version 3 of the
903         GNU General Public License and to point readers at the COPYING3
904         file and the FSF's license web page.
905         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
906         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
907         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
908         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
909         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
910         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
911         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
912         name-lookup.h, parser.c: Likewise.
913
914 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
915
916         PR middle-end/32668
917         * call.c (magic_varargs_p): Honor the "type generic" attribute.
918
919 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
920
921         PR c++/32108
922         * semantics.c (finish_label_stmt): Reject the __label__
923         extension outside function scopes.
924
925 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
926
927         * parser.c (eof_token): Un-constify.
928         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
929         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
930         casts.
931
932 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
933
934         * pt.c, tree.c, typeck2.c: Fix comment typos.
935
936 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
937             Mark Mitchell  <mark@codesourcery.com>
938
939         PR c++/30917
940         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
941         hidden due to friend declarations in local classes.
942
943 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
944
945         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
946         * cp-tree.def (DECLTYPE_TYPE): New.
947         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
948         (dump_type_prefix): Ditto.
949         (dump_type_suffix): Ditto.
950         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
951         * mangle.c (write_type): Handle DECLTYPE_TYPE.
952         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
953         types.
954         (DECLTYPE_TYPE_EXPR): New.
955         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
956         (finish_declared_type): Declare.
957         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
958         DECLTYPE_TYPE nodes.
959         (pp_cxx_type_id): Ditto.
960         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
961         (tsubst): Substitute into a DECLTYPE_TYPE node.
962         (tsubst_copy): Ditto.
963         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
964         nodes.
965         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
966         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
967         structural equality (because we can't hash the expressions).
968         (finish_declared_type): New.
969         * lex.c (reswords): Add "decltype" keyword.
970         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
971         (cp_parser_postfix_expression): Add member_access_only_p to
972         restrict postfix expression to member access expressions.
973         (cp_parser_unary_expression): Update call to
974         cp_parser_postfix_expression to reflect new parameter.
975         (cp_parser_declared_type): New.
976         (cp_parser_simple_type_specifier): Parse decltype types.
977
978 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
979
980         PR c++/32346
981         * call.c (convert_for_arg_passing): Only widen bitfields to their
982         declared types if necessary.
983
984 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
985
986         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
987         Constify.
988
989 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
990
991         * decl.c (typename_hash, typename_compare): Constify.
992         * mangle.c (hash_type, compare_type): Likewise.
993         * pt.c (eq_local_specializations, hash_local_specialization):
994         Likewise.
995         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
996         list_hash): Likewise.
997         * typeck2.c (pat_compare): Likewise.
998
999 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
1000
1001         * method.c (implicitly_declare_fn): Increase alignment if member
1002         function pointer format requires it.
1003
1004 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
1005
1006         PR c++/29001
1007         * typeck.c (check_return_expr): Do not pass a null argument
1008         to null_ptr_cst_p.
1009
1010 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
1011
1012         PR c++/32561
1013         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1014         only on VAR_DECL.
1015
1016 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
1017
1018         PR c++/32839
1019         * typeck.c (convert_arguments): Only use default args if we have
1020         a function decl.
1021
1022         PR c++/30818
1023         * typeck.c (structural_comptypes): No need to check
1024         resolve_typename_type return value here.
1025         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1026         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
1027         original type rather than error_mark_node in case of failure.
1028         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1029         resolve_typename_type result check.
1030         (cp_parser_direct_declarator, cp_parser_head,
1031         cp_parser_constructor_declarator_p): Likewise.
1032
1033 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
1034
1035         * pt.c (template_parms_variadic_p): Remove.
1036         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1037
1038 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
1039
1040         PR c++/30854
1041         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1042         argument to dump_aggr_init_expr_args instead of false.
1043
1044 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
1045
1046         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1047         canonical types; otherwise, fall back to structural type
1048         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1049         internal compiler error if the canonical types are wrong.
1050         
1051 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
1052
1053         PR c++/32560
1054         * parser.c (cp_parser_make_indirect_declarator): When the
1055         the code argument is ERROR_MARK return cp_error_declarator.
1056
1057 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
1058
1059         PR 32617
1060         * decl.c (cxx_init_decl_processing): Don't set
1061         force_align_functions_log.
1062         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1063         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1064         FUNCTION_DECL, return its alignment.
1065
1066 2007-07-09  Richard Guenther  <rguenther@suse.de>
1067
1068         * decl.c (start_preparsed_function): Do not promote return type.
1069
1070 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
1071
1072         PR c++/30535
1073         * pt.c (unify): Never pass error_mark_node to template_decl_level.
1074
1075 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
1076
1077         PR c++/32232
1078         * pt.c (resolve_overloaded_unification): Robustify.  Return a
1079         bool, not an int.
1080         (type_unification_real): Adjust accordingly.
1081
1082 2007-07-06  Richard Guenther  <rguenther@suse.de>
1083
1084         * init.c (build_new_1): Use the correct pointer type.
1085         * typeck2.c (build_m_component_ref): Likewise.
1086
1087 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
1088
1089         PR c++/32245
1090         * init.c (build_zero_init): Always build an initializer for
1091         non-static storage.
1092         * typeck2.c (build_functional_cast): Use build_zero_init.
1093
1094         PR c++/32251
1095         * init.c (build_new_1): Always pass the allocation function to
1096         build_op_delete_call.
1097         * call.c (build_op_delete_call): Handle operator delete with a
1098         variable-argument list.  Do not issue an error when no matching
1099         deallocation function is available for a new operator.
1100
1101         PR c++/31992
1102         * cp-tree.h (any_value_dependent_elements_p): Declare it.
1103         * decl.c (value_dependent_init_p): New function.
1104         (cp_finish_decl): Use it.
1105         * pt.c (value_dependent_expression_p): Use
1106         any_value_dependent_elements_p.
1107         * parser.c (cp_parser_primary_expression): Add comment about
1108         treating dependent qualified names as integral
1109         constant-expressions.
1110
1111 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
1112
1113         * decl.c (build_ptrmemfunc_type): Always use structural equality
1114         tests when comparing pointer-to-member-function types, because the
1115         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1116         types.
1117         
1118 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
1119
1120         * init.c (build_new): Tweak comment.
1121
1122 2007-06-29  Dave Brolley  <brolley@redhat.com>
1123
1124         PR c++/31743
1125         * parser.c (cp_parser_new_type_id): Don't reduce a named array
1126         type to its base type and number of elements here.
1127         * init.c (build_new): Call complete_type_or_else to ensure that the
1128         type is complete and to issue a diagnostic if it is not.
1129         (build_new_1): Don't call complete_type_or_else here.
1130
1131 2007-07-03  Richard Guenther  <rguenther@suse.de>
1132
1133         PR c++/32609
1134         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1135         after recursing.
1136
1137 2007-07-02  Simon Baldwin  <simonb@google.com>
1138
1139         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1140         for inner-style nested forward declarations that don't declare
1141         anything useful.
1142
1143 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
1144
1145         PR c++/31748
1146         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1147         DECL_P in not a variable and appears more than once error messages.
1148
1149 2007-07-01  Ollie Wild  <aaw@google.com>
1150
1151         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1152         (select_decl): Remove function.
1153         (unqualified_namespace_lookup): Populate binding by calling
1154         ambiguous_decl.  Remove select_decl call.
1155         (lookup_qualified_name): Remove select_decl call.
1156         * decl.c (lookup_and_check_tag): Check for ambiguous references.
1157         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1158         generation when name lookup is ambiguous.
1159
1160 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
1161
1162         PR c++/31724
1163         * init.c (build_new_1): Use structural equality on the copy of the
1164         array type.
1165
1166 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
1167
1168         * decl2.c (determine_visibility): Implement
1169         flag_visibility_ms_compat effect on type info.
1170         * decl.c (cxx_init_decl_processing): Implement
1171         global effect of flag_visibility_ms_compat.
1172
1173 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
1174
1175         * decl2.c (start_objects): Mark constructor-running function
1176         as artificial.
1177
1178 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
1179
1180         PR c++/32111
1181         * decl.c (grokdeclarator): Reset friendp for member functions declared
1182         friend of their own class.
1183
1184 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
1185
1186         * decl2.c (determine_visibility): Don't look for dllexport here.
1187         (determine_visibility_from_class): Tidy.
1188
1189 2007-06-18  Simon Baldwin <simonb@google.com>
1190
1191         PR c++/31923
1192         * parser.c (cp_parser_single_declaration): Added check for storage
1193         class other than sc_none in parsed declaration, and a flag to indicate
1194         if the call is part of an explicit template specialization parse.
1195         * (cp_parser_explicit_specialization): Specialization check flag added
1196         to call to cp_parser_single_declaration(), set true.
1197         * (cp_parser_template_declaration_after_export): Specialization check
1198         flag added to call to cp_parser_single_declaration(), set false.
1199         * pt.c (check_explicit_specialization): Added code to copy visiblity
1200         and linkage from the templated function to the explicit specialization.
1201
1202 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1203
1204         * typeck.c (build_binary_op): For templates build the
1205         expression in pieces to avoid the assert in build2_stat.
1206         (get_member_function_from_ptrfunc):
1207         Change over to using POINTER_PLUS_EXPR and convert
1208         the second operand to sizetype.
1209         * typeck2.c (build_m_component_ref):  Likewise.
1210         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1211         instead of PLUS_EXPR for pointers.
1212         (build_new_1): Likewise.
1213         (build_vec_delete_1): Likewise.
1214         (build_vec_delete): Likewise.
1215         * class.c (build_base_path): Likewise.
1216         (build_base_path): Likewise.
1217         (convert_to_base_statically): Likewise.
1218         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1219         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1220         instead of PLUS_EXPR.
1221         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1222         instead of PLUS_EXPR for pointers.
1223         * call.c (build_special_member_call): Likewise.
1224         * rtti.c (build_headof): Likewise.
1225         Use sizetype instead of ptrdiff_type_node.
1226         (tinfo_base_init): Create a POINTER_PLUS_EXPR
1227         instead of PLUS_EXPR for pointers.
1228         * except.c (expand_start_catch_block):  Do a
1229         NEGATIVE and then a POINTER_PLUS_EXPR instead
1230         of a MINUS_EXPR.
1231         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1232         PLUS_EXPR on pointer types over to use
1233         POINTER_PLUS_EXPR and remove the conversion
1234         to the pointer types.
1235         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1236         adding to a pointer type. Use size_int instead of
1237         ssize_int. Convert the index to sizetype before
1238         adding it to the pointer.
1239
1240 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
1241
1242         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1243         (DECL_ANON_UNION_VAR_P): New macro.
1244         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
1245         than DECL_VAR_MARKED_P, to keep track of which variables we have
1246         seen.
1247         * decl.c (redeclaration_error_message): Complain about redeclaring
1248         anonymous union members at namespace scope.
1249         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1250
1251 2007-06-14  Geoff Keating  <geoffk@apple.com>
1252
1253         * decl2.c (determine_visibility): Ensure that functions with
1254         hidden types as parameters are hidden.
1255
1256         PR 31093
1257         * decl2.c (determine_visibility): Remove duplicate code for
1258         handling type info.
1259
1260 2007-06-12  Ian Lance Taylor  <iant@google.com>
1261
1262         PR libstdc++/29286
1263         * init.c (avoid_placement_new_aliasing): New static function.
1264         (build_new_1): Call it.
1265
1266 2007-06-11  Rafael Avila de Espindola  <espindola@google.com>
1267
1268         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1269         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1270
1271 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
1272
1273         PR c++/32177
1274         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1275         on init, the non-decl cond operand and increment value.
1276
1277 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
1278
1279         PR c++/30759
1280         * decl.c (check_initializer): Report an error when a brace enclosed
1281         initializer is used for a non-aggregate type in C++98.
1282         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1283         cxx_dialect.
1284         (grokdeclarator): Likewise.
1285         (move_fn_p): Likewise.
1286         * typeck.c (check_return_expr): Likewise.
1287         * call.c (reference_binding): Likewise.
1288         * error.c (cp_cpp_error): Likewise.
1289         * pt.c (check_default_tmpl_args): Likewise.
1290         (tsubst): Likewise.
1291         * lex.c (init_reswords): Likewise.
1292         * parser.c (p_parser_primary_expression): Likewise.
1293         (TOKEN_PRECEDENCE): Likewise.
1294         (cp_parser_init_declarator): Likewise.
1295         (cp_parser_ptr_operator): Likewise.
1296         (cp_parser_parameter_declaration): Likewise.
1297         (cp_parser_enclosed_template_argument_list): Likewise.
1298         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1299         (cp_parser_next_token_ends_template_argument_p): Likewise.
1300
1301 2007-06-04  Simon Baldwin  <simonb@google.com>
1302
1303         * decl.c (grokdeclarator): Readability change.  Moved case labels
1304         into direct switch statement scope.
1305
1306 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
1307
1308         * call.c (convert_like_real): Remove pointless code.
1309
1310 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
1311
1312         * decl.c (get_atexit_fn_ptr_type): New function.
1313         (get_atexit_node): Use it.
1314         (start_cleanup_fn): Likewise.
1315         (register_dtor_fn): Use the object's destructor, instead of a
1316         separate cleanup function, where possible.
1317         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1318         (atexit_fn_ptr_type_node): New macro.
1319         * decl2.c (build_cleanup): Use build_address.
1320
1321 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
1322
1323         * typeck.c (build_binary_op): Include types in error.
1324
1325 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
1326
1327         PR c++/31806
1328         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1329         needs runtime initialization.
1330
1331 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
1332
1333         PR c++/32158
1334         * semantics.c (finish_trait_expr): Complete the types.
1335
1336 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
1337             Douglas Gregor <doug.gregor@gmail.com>
1338             Pedro Lamarao <pedro.lamarao@mndfck.org>
1339             Howard Hinnant <howard.hinnant@gmail.com>
1340
1341         PR c++/7412
1342         PR c++/29939
1343         * typeck.c (comptypes): Don't consider rvalue and lvalue
1344         reference types to be equivalent.
1345         (check_return_expr): Move from certain lvalues when returning
1346         them.
1347         * decl.c (grokdeclarator): Implement reference collapsing.
1348         (copy_fn_p): Don't consider constructors taking rvalue references
1349         to be copy constructors.
1350         (move_fn_p): New.
1351         * call.c (conversion): New "rvaluedness_matches_p" member.
1352         (convert_class_to_reference): Require reference type as first
1353         parameter instead of base type.
1354         (reference_binding): Add logic to handle rvalue references.
1355         (implicit_conversion): Update inaccurate comment.
1356         (convert_like_real): Disable creation of temporaries that are
1357         impossible to initialize for types with move constructors.
1358         (build_over_call): Elide move constructors when possible.
1359         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1360         (maybe_handle_ref_bind): Return conversion instead of type node.
1361         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1362         determine preferred conversion sequences.
1363         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1364         (LOOKUP_PREFER_RVALUE): New.
1365         (DECL_MOVE_CONSTRUCTOR_P): New.
1366         (struct cp_declarator): Add "reference" member for reference
1367         types, with new "rvalue_ref" flag.
1368         (cp_build_reference_type): Declare.
1369         (move_fn_p): Declare.
1370         * error.c (dump_type_prefix): Format rvalue reference types
1371         correctly in error messages.
1372         * except.c (build_throw): Move from certain lvalues when
1373         throwing.
1374         * mangle.c (write_type): Mangle rvalue references differently
1375         than regular references.
1376         * parser.c (make_reference_declarator): Add boolean parameter for
1377         rvalue references.
1378         (cp_parser_make_indirect_declarator): New.
1379         (cp_parser_new_declarator_opt): Call
1380         cp_parser_make_indirect_declarator. 
1381         (cp_parser_conversion_declarator_opt): Ditto.
1382         (cp_parser_declarator): Ditto.
1383         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1384         declarators.
1385         * pt.c (tsubst): Implement reference collapsing.
1386         (maybe_adjust_types_for_deduction): Implement special template
1387         parameter deduction rule for rvalue references.
1388         (type_unification_real): Update calls to
1389         maybe_adjust_types_for_deduction.
1390         (try_one_overload): Ditto.
1391         (unify_pack_expansion): Ditto.
1392         * tree.c (lvalue_p_1): Handle rvalue reference types.
1393         (cp_build_reference_type): New.
1394
1395 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
1396
1397         PR c++/31809
1398         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1399         variables that need runtime initialization.
1400
1401 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
1402
1403         PR c++/31339
1404         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1405         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1406         case POSTDECREMENT_EXPR>): Return the error_mark_node
1407         if either the real or imaginary parts would an
1408         error_mark_node.
1409         
1410 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
1411             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1412
1413         PR c++/31745
1414         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1415         token is a closing brace, false if there are no tokens left.
1416         (cp_parser_namespace_alias_definition): Only consume the next token if
1417         it is a closing brace.
1418
1419         * parser.c (cp_parser_class_specifier): Likewise.
1420
1421 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1422
1423         * semantics.c (finish_member_declaration): Fix a typo in the
1424         last checkin.
1425
1426 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
1427
1428         PR c++/31431
1429         PR c++/31432
1430         PR c++/31434
1431         PR c++/31435
1432         PR c++/31437
1433         PR c++/31438
1434         PR c++/31442
1435         PR c++/31443
1436         PR c++/31444
1437         PR c++/31445
1438         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1439         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1440         * pt.c (check_for_bare_parameter_packs): Return bool indicated
1441         whether everything was okay. Fix indentation.
1442         (push_template_decl_real): Check for bare parameter packs in
1443         function parameters; where errors occur, mark the parameter types
1444         with ERROR_MARK_NODEs to avert ICEs.
1445         (coerce_template_parameter_pack): New.
1446         (coerce_template_parms): Moved parameter pack coercion into
1447         coerce_template_parameter_pack, and permit it anywhere in the
1448         template parameter list (not just at the end). Parameter and
1449         argument indices can vary (somewhat) separately now, so add
1450         PARM_IDX and ARG_IDX.
1451         (fn_type_unification): Don't set an argument pack as incomplete if
1452         no argument pack was deduced.
1453         (type_unification_real): If a type parameter is a parameter pack
1454         and has not otherwise been deduced, it will be deduced to an empty
1455         parameter pack.
1456         (more_specialized_fn): Use the actual lengths of the argument
1457         lists when comparing against expansions.
1458         * semantics.c (finish_member_declaration): If a field's type has
1459         bare parameter packs, error and set its type to ERROR_MARK_NODE.
1460
1461 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
1462
1463         PR target/27067
1464         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1465
1466 2007-05-22  Ollie Wild  <aaw@google.com>
1467
1468         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1469         (unqualified_namespace_lookup): Adds check for hidden types.
1470
1471 2007-05-22  Ollie Wild  <aaw@google.com>
1472
1473         * decl.c (duplicate_decls): Verify namespace names are unique.
1474
1475 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
1476
1477         * decl.c (cxx_maybe_build_cleanup): Handle
1478         __attribute__((cleanup)).
1479
1480 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1481
1482         * cvt.c (cp_convert_and_check): Don't check warnings if the
1483         conversion failed.
1484
1485 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
1486
1487         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1488
1489 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
1490
1491         PR c++/29928
1492         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1493         type only if is a class type (5.2.8/4).
1494
1495 2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
1496
1497         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1498         * decl.c (grokdeclarator): Use unsigned_type_for instead of
1499         c_common_unsigned_type.
1500
1501 2007-05-11  Silvius Rus  <rus@google.com>
1502
1503         * cp/typeck.c (build_indirect_ref): Add call to
1504         strict_aliasing_warning.
1505         (build_reinterpret_cast_1): Condition call to
1506         strict_aliasing_warning. 
1507
1508 2007-05-11  Jan Hubicka  <jh@suse.cz>
1509
1510         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1511         * decl2.c (start_objects): ctors and dtors are no longer public.
1512         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1513         
1514 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1515
1516         * typeck.c (build_unary_op): Remove code that used to
1517         handle non lvalue increments/decrements.
1518
1519 2007-05-07  Mike Stump  <mrs@apple.com>
1520
1521         * parser.c (check_empty_body): Add.
1522         (cp_parser_iteration_statement): Add call to check_empty_body.
1523
1524 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
1525
1526         PR 31775
1527         * mangle.c (write_mangled_name): Mangle static variable names.
1528         (write_unqualified_name): Use local-source-name for
1529         namespace-scope static variables.
1530
1531 2007-05-04  Dirk Mueller  <dmueller@suse.de>
1532
1533         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1534         not in effect.
1535
1536 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
1537
1538         PR c++/31663
1539         * decl2.c (constrain_class_visibility): 
1540         Use strip_pointer_or_array_types instead of strip_array_types.
1541
1542 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1543
1544         PR C++/30221
1545         * decl.c (reshape_init_r): Don't reshape the first element if it
1546         is a pointer to member function.
1547
1548 2007-04-27  Simon Baldwin  <simonb@google.com>
1549
1550         * decl.c (grokparms): Changed message format from %qD to %qE.
1551
1552 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
1553
1554         * error.c (maybe_warn_variadic_templates): Variadic templates are
1555        now in C++0x, so only warn about them in C++98 mode.
1556         
1557 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1558
1559         PR C++/30016
1560         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1561         integeral types from vectors types.
1562
1563 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
1564
1565         PR c++/31598
1566         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1567         for type dependent OMP_CLAUSE_DECLs.
1568
1569 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
1570
1571         PR c++/31338
1572         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1573         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1574         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1575         * init.c (build_zero_init): Adjust, as
1576         COMPLEX_TYPE is now a SCALAR_TYPE.
1577         * typeck2.c (digest_init): Allow brace-enclosed initializers for
1578         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1579
1580 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
1581
1582         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1583         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1584         (trait_expr_value): Adjust.
1585
1586 2007-04-23  Simon Baldwin  <simonb@google.com>
1587
1588         * decl.c (grokparms): Added new error for duplicate function
1589         parameters names in function prototypes, to match gcc behavior.
1590
1591 2007-04-23  Jan Hubicka  <jh@suse.cz>
1592
1593         * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1594         bits dirrectly.
1595
1596 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1597
1598         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1599         instead of checking GIMPLE_STMT_P in chain_next.
1600
1601 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
1602
1603         PR c++/31513
1604         * call.c (convert_for_arg_passing): Convert bitfields to their
1605         declared types.
1606
1607 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
1608
1609         PR c++/31517
1610         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1611
1612 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
1613
1614         PR c++/29365
1615         * cp/decl2.c (constrain_class_visibility):
1616         Do not warn about the use of anonymous namespace in the main input file.
1617
1618 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
1619
1620         * cp-tree.h (current_template_parms): Fix typo in comment.
1621
1622 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
1623
1624         * cp-tree.h, error.c: Fix comment typos.
1625
1626 2007-04-13  Jason Merrill  <jason@redhat.com>
1627
1628         PR c++/31074
1629         * call.c (reference_binding): Add c_cast_p parm.  If true,
1630         add quals to TO as needed to make it reference-compatible.
1631
1632 2007-04-11  Jan Hubicka  <jh@suse.cz>
1633
1634         * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1635         that we are not processing template_decl.
1636
1637 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
1638
1639         PR c++/31449
1640         * class.c (build_base_path): Ensure that the converted pointer has
1641         the same cv-qualification as the input.
1642
1643 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
1644
1645         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1646
1647 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
1648
1649         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1650         Do not set it.
1651         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1652         * tree.c (cp_add_pending_fn_decls): Remove.
1653         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1654
1655 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
1656
1657         Revert change removing staticp.
1658
1659 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
1660
1661         * cp-objcp-common.c (cxx_staticp): Remove.
1662         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1663         * cp-tree.h (cxx_staticp):      
1664
1665 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
1666
1667         * class.c (check_for_override): Don't remove dllmport attribute
1668         of virtual methods.
1669
1670 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
1671
1672         PR c++/30847
1673         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1674         type issue error and return early.
1675
1676 2007-03-30  Jason Merrill  <jason@redhat.com>
1677
1678         PR c++/31187
1679         * typeck.c (cp_type_readonly): New fn.
1680         * cp-tree.h: Declare it.
1681         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1682         (cp_finish_decl): Not here.
1683
1684 2007-03-31  Richard Guenther  <rguenther@suse.de>
1685
1686         * optimize.c (maybe_clone_body): Replace splay-tree usage by
1687         pointer-map.
1688
1689 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
1690
1691         PR c++/31138
1692         PR c++/31140
1693         PR c++/31141
1694         * parser.c (declarator_can_be_parameter_pack): New.
1695         (cp_parser_template_parameter): Only parse the `...' if the
1696         declarator can be a parameter pack.
1697         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1698         is NULL.
1699         * pt.c (find_parameter_packs_r): Look into the bounds on integer
1700         types (they could be used as array bounds). 
1701         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1702         (tsubst_pack_expansion): Handle failure to expand parameter
1703         packs.
1704         
1705 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
1706
1707         PR c++/26099
1708         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1709         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1710         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1711         (CLASS_TYPE_NON_UNION_P): Add.
1712         (struct lang_type_class): Add has_complex_dflt.
1713         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1714         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1715         * cp-tree.def: Add TRAIT_EXPR.
1716         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1717         * lex.c (struct resword): Add __has_nothrow_assign,
1718         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1719         __has_trivial_constructor, __has_trivial_copy,
1720         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1721         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1722         __is_pod, __is_polymorphic, __is_union.
1723         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1724         (cp_parser_trait_expr): New.
1725         * semantics.c (finish_trait_expr, trait_expr_value
1726         classtype_has_nothrow_copy_or_assign_p): New.
1727         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1728         as static.
1729         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1730         * class.c (check_bases, check_field_decl, check_bases_and_members):
1731         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1732         * pt.c (uses_template_parms, tsubst_copy_and_build,
1733         value_dependent_expression_p, type_dependent_expression_p): Deal with
1734         TRAIT_EXPR.
1735         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1736
1737 2007-03-29  Richard Guenther  <rguenther@suse.de>
1738
1739         * tree.c (cp_walk_subtrees): Do not set input_location.
1740
1741 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
1742
1743         PR c++/29077
1744         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1745         destructor.
1746
1747 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1748
1749         * parser.c (struct cp_parser): Update comment for
1750         greater_than_is_operator_p.
1751         (cp_parser_primary_expression): In C++0x mode, a cast operator can
1752         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1753         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1754         !GREATER_THAN_IS_OPERATOR_P.
1755         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1756         `>>' operators that will become two `>' tokens in C++0x.
1757         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1758         mode, allowing it to terminate default arguments.
1759         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1760         `>>' like two consecutive `>' tokens.
1761         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1762         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1763         ends a template argument.
1764
1765 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
1766
1767         * decl.c (redeclaration_error_message): Complain when redeclaring
1768         a friend function with default template arguments (C++0x mode only).
1769         * cp-tree.h (check_default_tmpl_args): Declare.
1770         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1771         template arguments in function templates. Add support for checking
1772         the default template arguments of friend templates.
1773         (push_template_decl_real): Fix call to check_default_tmpl_args.
1774         (type_unification_real): If a template parameter has not been
1775         deduced but provides a default template argument, substitute into
1776         that default template argument.
1777         * parser.c (cp_parser_init_declarator): When declaring (but not
1778         defining!) a function template in C++0x mode, check for default
1779         template arguments.
1780
1781 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1782
1783         PR c++/29993
1784         * decl.c (grokdeclarator): Deal with cv-qualified function type
1785         typedefs in the same way for member and non-member functions.
1786
1787 2007-03-26  Dirk Mueller  <dmueller@suse.de>
1788
1789         * parser.c (cp_parser_member_declaration): Pedwarn
1790         about stray semicolons after member declarations.
1791
1792 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
1793
1794         PR c++/30500
1795         * pt.c (instantiate_decl): Set in_system_header.
1796
1797 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
1798
1799         * cp-tree.h (current_tempalte_parms): Improve documentation.
1800         * pt.c (current_template_args): Likewise.
1801
1802         PR c++/30863
1803         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1804         not consume tokens when failing.
1805
1806 2007-03-22  Jim Wilson  <wilson@specifix.com>
1807             Mark Mitchell  <mark@codesourcery.com>
1808
1809         PR c++/31273
1810         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
1811         consistent with FROM.
1812
1813 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1814
1815         * error.c (dump_expr): Handle dependent names that designate types.
1816         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1817
1818 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
1819
1820         * cp-tree.def, parser.c, pt.c: Fix comment typos.
1821
1822 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1823
1824         * cvt.c (cp_convert_and_check) : Define.
1825         * cp-tree.h (cp_convert_and_check): Declare.
1826         * call.c (convert_conversion_warnings): Rename to
1827         conversion_null_warnings.  The warning for floating-point to
1828         integer is handled by convert_and_check in convert_like_real.
1829         (convert_like_real): convert_conversion_warnings was renamed as
1830         conversion_null_warnings.
1831         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1832         overflow and changes of value during conversion.
1833
1834 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1835
1836         PR c++/30891
1837         * parser.c (cp_parser_statement): If 'namespace' is found, this
1838         only can be a namespace alias definition, so parse it now.
1839         (cp_parser_namespace_alias_definition): if we find an open brace
1840         instead of '=', then this is actually a misplaced namespace
1841         definition.
1842         
1843 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1844
1845         PR c++/24924
1846         * decl.c (cxx_init_decl_processing): Move command-line options
1847         processing to c-opts.c.
1848         
1849 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
1850
1851         * ptree.c (cxx_print_type): Use formatting markup for integers
1852         when printing template parameter index/level/orig level.
1853         (cxx_print_xnode): Ditto.
1854         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1855         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1856         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1857         HOST_WIDE_INTs.
1858         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1859         rather than a HOST_WIDE_INT.
1860         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1861         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1862         better bit-packing.
1863         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1864         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1865         IN_BASE_INITIALIZER bool bitfields.
1866         (struct cp_declarator): Make KIND a 4-bit field. Make
1867         PARAMETER_PACK_P a bool bitfield just after KIND.
1868         * pt.c (uses_parameter_packs): Destroy the pointer set.
1869         (make_pack_expansion): Ditto.
1870         (check_for_bare_parameter_packs): Ditto.
1871         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1872         
1873 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1874
1875         PR c++/31165
1876         * call.c  (convert_default_arg): Instead of copying the node,
1877         unshare it.
1878
1879 2007-03-15  Dirk Mueller  <dmueller@suse.de>
1880
1881         PR c++/30860
1882         * call.c (convert_conversion_warnings): New..
1883         (convert_like_real): .. factored out from here.
1884         (convert_conversion_warnings): Add warning about
1885         false being converted to NULL in argument passing.
1886
1887 2007-03-14  Dirk Mueller  <dmueller@suse.de>
1888
1889         * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1890         (finish_do_body): Warn about empty body in do/while statement.
1891
1892 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1893
1894         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1895         
1896 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1897
1898         PR c/21438
1899         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1900         warning.
1901         
1902 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
1903
1904         * cp/repo.c (init_repo): Initialize random_seed saved options.
1905         (finish_repo): Adjust.
1906
1907 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
1908
1909         PR bootstrap/30899
1910         * Make-lang.in (doc/g++.1): Use $< to specify the location from
1911         which to copy.
1912
1913 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
1914
1915         * decl.c (compute_array_index_type): New warning flag warn_vla.
1916
1917 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
1918
1919         PR c++/30108
1920         * call.c (convert_default_arg): Copy non-constant arguments.
1921
1922 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
1923
1924         PR c++/31038
1925         * parser.c (cp_parser_postfix_expression): Disallow compound
1926         literals in constant expressions.
1927
1928         PR c++/30328
1929         * semantics.c (finish_typeof): Use unlowered_expr_type.
1930         
1931 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
1932
1933         PR c++/30274
1934         * cp-tree.h (unlowered_expr_type): New function.
1935         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1936         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1937         (unlowered_expr_type): New function.
1938         (build_unary_op): Disallow predecrements of bool bitfields.
1939         * call.c (build_conditional_expr): Use unlowered_expr_type.
1940         * pt.c (type_unification_real): Likewise.
1941
1942 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
1943
1944         PR c++/20599
1945         * typeck.c (check_return_expr): Check for bare parameter packs.
1946         (comptypes): Compare template parameter packs and
1947         type pack expansions.
1948         * decl.c (grokdeclarator): Deal with the declaration of function
1949         parameter packs.
1950         (grokparms): Verify that the (optional) function parameter pack is
1951         at the end of the parameter list.
1952         (xref_basetypes): Handle pack expansions in the base class.
1953         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1954         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1955         (NONTYPE_ARGUMENT_PACK): New.
1956         (TYPE_PACK_EXPANSION): New.
1957         (EXPR_PACK_EXPANSION): New.
1958         (ARGUMENT_PACK_SELECT): New.
1959         * cp-objcp-common.c (cp_tree_size): Compute size of
1960         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1961         ARGUMENT_PACK_SELECT.
1962         * error.c (dump_template_argument): Print template argument packs.
1963         (dump_template_argument_list): Ditto.
1964         (dump_template_parameter): Dump `...' for template type parameter
1965         packs.
1966         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1967         (dump_parameters): Print function parameter packs.
1968         (dump_template_parms): Print template argument packs.
1969         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1970         (maybe_warn_variadic_templates): New.
1971         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1972         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1973         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1974         CAST_EXPR. 
1975         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1976         (write_template_arg): Write argument packs as separate arguments.
1977         * cp-tree.h (struct template_parm_index_s): Add flag that
1978         indicates that the template parameter is actually a parameter
1979         pack.
1980         (struct tree_argument_pack_select): New.
1981         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1982         (union lang_tree_node): Add argument_pack_select.
1983         (FUNCTION_PARAMETER_PACK_P): New.
1984         (PACK_EXPANSION_P): New.
1985         (PACK_EXPANSION_PATTERN): New.
1986         (SET_PACK_EXPANSION_PATTERN): New.
1987         (PACK_EXPANSION_PARAMETER_PACKS): New.
1988         (ARGUMENT_PACK_P): New.
1989         (ARGUMENT_PACK_ARGS): New.
1990         (SET_ARGUMENT_PACK_ARGS): New.
1991         (ARGUMENT_PACK_INCOMPLETE_P): New.
1992         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1993         (TEMPLATE_PARM_PARAMETER_PACK): New.
1994         (TEMPLATE_TYPE_PARAMETER_PACK): New.
1995         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1996         (ARGUMENT_PACK_SELECT_INDEX): New.
1997         (ARGUMENT_PACK_SELECT_ARG): New.
1998         (struct cp_declarator): Add parameter_pack_p flag.
1999         (maybe_warn_variadic_templates): Declare.
2000         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2001         indicate a template parameter pack. 
2002         (uses_parameter_packs): Declare.
2003         (template_parameter_pack_p): Declare.
2004         (template_parms_variadic_p): Declare.
2005         (make_pack_expansion): Declare.
2006         (check_for_bare_parameter_packs): Declare.
2007         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2008         sizeof... expressions. 
2009         (pp_cxx_expression): Print pack expansions and non-type argument
2010         packs.
2011         (pp_cxx_exception_specification): Print pack expansions. 
2012         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2013         (pp_cxx_ctor_initializer): Print pack expansions.
2014         (pp_cxx_type_id): Print pack expansions.
2015         (pp_cxx_template_argument_list): Print argument packs.
2016         (pp_cxx_template_parameter): Print ellipsis for template parameter
2017         packs.
2018         * pt.c (comp_template_parms): Compare template parameter packs.
2019         (template_parameter_pack_p): New.
2020         (template_parms_variadic_p): New.
2021         (template_args_variadic_p): New.
2022         (make_ith_pack_parameter_name): New.
2023         (struct find_parameter_pack_data): New.
2024         (find_parameter_packs_r): New.
2025         (uses_parameter_packs): New.
2026         (make_pack_expansion): New.
2027         (check_for_bare_parameter_packs): New.
2028         (expand_template_argument_pack): New.
2029         (reduce_template_parm_level): Propagate parameter pack flag.
2030         (process_template_parm): Add is_parameter_pack parameter to state
2031         when the parameter is actually a parameter pack. Create template
2032         parameter packs when is_parameter_pack is true.
2033         (current_template_args): The argument for a template parameter
2034         pack is an argument pack containing a single pack expansion.
2035         (process_partial_specialization): When checking that non-type
2036         argument expressions do not involve template parameters, loop over
2037         the arguments in argument packs separately.
2038         (push_template_decl_real): Check that the type of the declaration
2039         does not have any bare parameter packs. Check that primary
2040         templates have no more than one parameter pack, and that it comes
2041         at the end of the template parameter list.
2042         (convert_template_argument): Handle coercions for pack expansion
2043         expressions by coercing the pattern then rebuilding the expansion.
2044         (coerce_template_parms): When coercing the arguments for a
2045         variadic template, pack "extra" arguments into an argument pack.
2046         (coerce_template_template_parms): Cannot coerce between parameter
2047         packs and non-pack parameters.
2048         (template_args_equal): Compare PACK_EXPANSION_P expressions.
2049         (comp_template_args): Expand all template arguments packs before
2050         comparing template argument lists.
2051         (mangle_class_name_for_template): Make argument packs as separate
2052         template arguments.
2053         (for_each_template_parm_r): No need to handle BASELINK. 
2054         (instantiate_class_template): Handle pack expansions in the base
2055         class list.
2056         (tsubst_pack_expansion): New.
2057         (tsubst_template_args): Handle substitutions of argument packs and
2058         pack expansion into template argument lists.
2059         (tsubst_decl): Expand function parameter packs into separate
2060         function parameters.
2061         (tsubst_arg_types): Expand a type pack expansion into separate
2062         argument types.
2063         (tsubst_exception_specification): Handle pack expansions in
2064         exception specifiers.
2065         (tsubst): See through ARGUMENT_PACK_SELECT arguments when 
2066         replacing a template parameter with its argument. If we encounter
2067         a substitution for an argument pack, just return the parameter
2068         itself. 
2069         (tsubst_copy): sizeof(X...) returns the number of elements in
2070         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
2071         PARM_DECL is a parameter pack.
2072         (tsubst_expr): Expression pack expansions and argument packs
2073         cannot show up here; they will all be handled through function
2074         calls, sizeof, and template argument lists.
2075         (tsubst_copy_and_build): sizeof(X...) returns the number of
2076         elements in parameter pack X.  Handle pack expansions in TREE_LIST
2077         and CONSTRUCTOR nodes.
2078         (fn_type_unification): Handle "incomplete" explicit template
2079         argument lists that specify some of the arguments for a template
2080         parameter pack.
2081         (type_unification_real): Unify arguments against pack expansions.
2082         (template_parm_level_and_index): New, helper function.
2083         (unify_pack_expansion): New.
2084         (unify): Unify argument packs on an argument-by-argument basis,
2085         handling variadic argument packs as well.
2086         (more_specialized_fn): Handle unification of function parameter
2087         packs. All things being equal, prefer non-variadic function
2088         templates to variadic function templates.
2089         (more_specialized_class): Prefer the variadic class template
2090         partial specialization that binds fewer arguments to a parameter
2091         pack.
2092         (regenerate_decl_from_template): Expand function parameter packs
2093         into separate parameters.
2094         (instantiate_decl): Ditto.
2095         (tsubst_initializer_list): Handle pack expansions for base-class
2096         initializers.
2097         (dependent_type_p_r): Determine dependent types in argument packs
2098         and pack expansions.
2099         (value_dependent_expression_p): Determine value-dependence of
2100         non-type argument packs.
2101         (dependent_template_arg_p): Handle argument packs.
2102         * semantics.c (finish_cond): Check for bare parameter packs.
2103         (finish_expr_stmt): Ditto.
2104         (finish_for_expr): Ditto.
2105         (finish_switch_cond): Ditto.
2106         (finish_mem_initializers): Ditto.
2107         * name-lookup.c (arg_assoc_type): Handle pack expansions and
2108         argument packs.
2109         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2110         * parser.c (make_declarator): Declarator is not an expansion.
2111         (make_pointer_declarator): Transfer parameter pack flag to outer
2112         declarator.
2113         (make_reference_declarator): Ditto.
2114         (make_ptrmem_declarator): Ditto.
2115         (make_call_declarator): Ditto.
2116         (make_array_declarator): Ditto.
2117         (cp_parser_postfix_expression): Allow pack expansion expressions
2118         in the argument list for a call expression.
2119         (cp_parser_parenthesized_expression_list): Add new parameter
2120         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2121         into separate arguments."
2122         (cp_parser_new_placement): Allow pack expansion expressions.
2123         (cp_parser_new_initializer): Ditto.
2124         (cp_parser_mem_initializer_list): Allow ellipsis to create a
2125         base-class initializer expansion.
2126         (cp_parser_mem_initializer): Ditto.
2127         (cp_parser_template_parameter_list): Keep track of whether the
2128         template parameter is a template parameter pack.
2129         (cp_parser_template_parameter): Parse the ellipsis to indicate a
2130         template parameter pack.
2131         (cp_parser_type_parameter): Ditto.
2132         (cp_parser_template_argument_list): Parse the ellipsis to indicate
2133         a pack expansion.
2134         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2135         this declarator is a parameter pack.
2136         (cp_parser_parameter_declaration): The ellipsis does not end the
2137         parameter declaration, because it might be a parameter pack. Parse
2138         the ellipsis to indicate a parameter pack.
2139         (cp_parser_initializer): Allow pack expansions.
2140         (cp_parser_initializer_list): Allow ellipsis to create an
2141         initializer expansion.
2142         (cp_parser_base_clause): Allow ellipsis to create a base specifier
2143         expansion.
2144         (cp_parser_type_id_list): Allow ellipsis to create an exception
2145         specifier expansion.
2146         (cp_parser_attribute_list): Don't allow pack expansions.
2147         (cp_parser_functional_cast): Allow pack expansions.
2148         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2149         compute the length of a parameter pack.
2150         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2151         end a template argument.
2152         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2153         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2154         CAST_EXPR. 
2155
2156 2007-03-09  Dirk Mueller  <dmueller@suse.de>
2157
2158         * cp/call.c (build_new_op): Call warn_logical_operator.
2159
2160 2007-03-08  Volker Reichelt  <reichelt@netcologne.de>
2161
2162         PR c++/30852
2163         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2164
2165         PR c++/30534
2166         * pt.c (any_template_arguments_need_structural_equality_p):
2167         Robustify.
2168
2169 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
2170
2171         * decl.c (grokdeclarator): Disable warnings for anonymous
2172         bitfields.
2173
2174 2007-03-05  Volker Reichelt  <reichelt@netcologne.de>
2175
2176         * typeck2.c (readonly_error): Always emit a hard error.
2177         Remove last argument.
2178         * cp-tree.h (readonly_error): Adjust prototype.
2179         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2180         * typeck.c (build_unary_op): Likewise.
2181         (build_modify_expr): Likewise.
2182
2183 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
2184
2185         PR c++/30895
2186         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2187
2188 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2189
2190         PR c++/15787
2191         * parser.c (struct cp_parser): New IN_IF_STMT.
2192         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2193         returning if parsing the body of an 'if' statement or issuing an
2194         error and continuing.
2195         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2196         body of 'if'.
2197         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2198         
2199 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
2200
2201         PR c++/28253
2202         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2203         for thunks.
2204
2205 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
2206
2207         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2208         Objective-C++.  Don't exit early if -shared-libgcc needs to be
2209         added.
2210
2211 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2212
2213         * typeck.c (common_base_type): Delete unused function.
2214         
2215 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
2216
2217         * Make-lang.in: Add dummy lang.install-pdf target.
2218
2219 2007-03-01  Simon Baldwin <simonb@google.com>
2220
2221         PR c++/23689
2222         * decl.c (check_tag_decl): Added new warning for typedef ignored
2223         when it precedes an otherwise valid non-typedef declaration.
2224
2225 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
2226
2227         * typeck.c (build_function_call): Store converted arguments
2228         in a stack-allocated array instead of building a list.
2229         (convert_arguments): Store arguments in the array passed in as an
2230         argument, and return the actual number of arguments.
2231         * call.c (build_call): Delete, and replace with...
2232         (build_call_n, build_call_a): New.
2233         (build_op_delete_call): Rewrite to avoid constructing argument lists.
2234         (build_over_call): Store converted arguments in a stack-allocated
2235         array instead of building a list.
2236         (build_cxx_call): Pass arguments in an array instead of as a list.
2237         (build_java_interface_fn_ref): Rewrite to avoid constructing
2238         argument lists.
2239         * tree.h: Update declarations to reflect above changes.
2240         * method.c (use_thunk): Use a stack-allocated array to hold
2241         the arguments instead of a list.
2242         * rtti.c (throw_bad_cast): Update call to cxx_call.
2243         (throw_bad_typeid): Likewise.
2244         (build_dynamic_cast_1): Likewise.
2245         * init.c (build_builtin_delete_call): Use build_call_n.
2246         * decl.c (expand_static_init): Likewise.
2247         * except.c (cp_protect_cleanup_actions): Likewise.
2248         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2249         (gimplify_must_not_throw_expr): Likewise.
2250         (cxx_omp_apply_fn): Use build_call_a.
2251
2252 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
2253
2254         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2255         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2256
2257 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
2258
2259         * cp-tree.h (static_ctors): Remove.
2260         * cp-tree.h (static_dtors): Likewise.
2261         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2262         refactoring of tree_map hierarchy.
2263         (decl_shadowed_for_var_insert): Likewise.
2264         * semantics.c (expand_body): Use c_expand_body.
2265         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2266         * decl2.c (static_ctors): Remove.
2267         (static_dtors): Likewise.
2268         (generate_ctor_or_dtor_function): Pass NULL_TREE to
2269         objc_generate_static_init_call.  Do not call static_[cd]tors.
2270         (generate_ctor_and_dtor_functions_for_priority): Do not check for
2271         static_[cd]tors.
2272         (cp_write_global_declarations): Likewise.
2273
2274 2007-02-23  Richard Guenther  <rguenther@suse.de>
2275
2276         * class.c (note_name_declared_in_class): Make declaration
2277         changes meaning a pedwarn.
2278
2279 2007-02-22  Michael Matz  <matz@suse.de>
2280
2281         PR c++/29433
2282         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2283         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2284         dump_function_decl): Guard emitting outer scopes by new flag.
2285         * cp-lang.c (cxx_dwarf_name): New function.
2286         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2287         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2288         Remove functions.
2289         (push_template_decl_real, lookup_template_class): Remove calls
2290         to above functions.
2291
2292 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
2293
2294         * call.c (build_new_method_call): Ensure that explicit calls of
2295         destructors have type "void".
2296
2297 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2298
2299         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2300         and -Walways-true with -Waddress.
2301         * cvt.c (convert_to_void): Replace unconditional warning with
2302         -Waddress.
2303
2304 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
2305
2306         * decl.c, tree.c: Fix comment typos.
2307
2308 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2309
2310         PR C++/30158
2311         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the 
2312         statement expression if we had an error mark node.
2313
2314 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
2315             Brooks Moses  <brooks.moses@codesourcery.com>
2316             Lee Millward  <lee.millward@codesourcery.com>
2317
2318         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2319         Change class to tcc_vl_exp.
2320
2321         * call.c (build_call): Use build_call_list instead 
2322         of build3. 
2323         (build_over_call): Likewise.
2324         (build_new_method_call): Use build_min_non_dep_call_list 
2325         instead of build_min_non_dep.
2326
2327         * error.c (dump_call_expr_args): New function.
2328         (dump_aggr_init_expr_args): New function.
2329         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
2330         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2331
2332         * cvt.c (convert_to_void): Use build_call_array instead
2333         of build3; use new AGGR_INIT_EXPR accessor macros.
2334
2335         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2336         instead of TREE_CODE_LENGTH.
2337
2338         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2339         AGGR_INIT_EXPR accessor macros.
2340
2341         * cp-gimplify.c (cp_gimplify_init_expr): Use 
2342         AGGR_INIT_EXPR_SLOT to set the slot operand.
2343
2344         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2345         (AGGR_INIT_EXPR_SLOT): New macro.
2346         (AGGR_INIT_EXPR_ARG): New macro.
2347         (aggr_init_expr_nargs): New macro.
2348         (AGGR_INIT_EXPR_ARGP): New macro.
2349         (aggr_init_expr_arg_iterator): New.
2350         (init_aggr_init_expr_arg_iterator): New.
2351         (next_aggr_init_expr_arg): New.
2352         (first_aggr_init_expr_arg): New.
2353         (more_aggr_init_expr_args_p): New.
2354         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2355         (stabilize_aggr_init): New declaration.
2356         (build_min_non_dep_call_list): Likewise.
2357
2358         * tree.c (process_aggr_init_operands): New function.
2359         (build_aggr_init_array) New function.
2360         (build_cplus_new): Update to use new CALL_EXPR and
2361         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2362         build_aggr_init_array.
2363         (build_min_non_dep_call_list) New function.
2364         (build_min_nt): Assert input code parameter is not a variable
2365         length expression class.
2366         (build_min, build_min_non_dep): Likewise.
2367         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2368         to check for equality instead of recursing. Handle tcc_vl_exp
2369         tree code classes.
2370         (stabilize_call): Update to only handle CALL_EXPRs, not 
2371         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2372         (stabilize_aggr_init): New function.
2373         (stabilize_init): Use it.
2374
2375         * cxx-pretty-print.c (pp_cxx_postfix_expression)
2376         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2377         AGGR_INIT_EXPR accessor macros and argument iterators.
2378         
2379         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2380         build_vl_exp. Iterate through the operands, recursively 
2381         processing each one.
2382         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2383         CALL_EXPR accessor macros.
2384         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2385         tree code classes. Use TREE_OPERAND_LENGTH instead of 
2386         TREE_CODE_LENGTH.
2387
2388         * semantics.c (finish_call_expr): Use build_nt_call_list
2389         instead of build_nt.
2390         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
2391         accessor macros. Use build_call_array to construct the 
2392         CALL_EXPR node instead of build3
2393         
2394         * decl2.c (build_offset_ref_call_from_tree): Use 
2395         build_nt_call_list and build_min_non_dep_call_list instead
2396         of build_min_nt and build_min_non_dep.
2397
2398         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2399         Use build_nt_call_list instead of build_min_nt.
2400
2401 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2402
2403         PR c++/28943
2404         * call.c (build_conditional_expr): Improve error message.
2405         
2406 2007-02-13  Dirk Mueller  <dmueller@suse.de>
2407
2408         * friend.c (do_friend): Annotate warning about friend
2409         declarations in templates with OPT_Wnon_template_friend.
2410         Convert informal message from warning() to inform().
2411
2412 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
2413             Mark Mitchell  <mark@codesourcery.com>
2414
2415         PR c++/14622
2416         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2417         instantiations for variables.
2418
2419 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2420
2421         PR middle-end/7651
2422         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2423         Check warn_unused_value just once.
2424
2425 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
2426
2427         PR c++/26988
2428         * pt.c (determine_specialization): Use skip_artificial_parms_for.
2429         (fn_type_unificiation): Likewise.
2430         (get_bindings): Likewise.
2431
2432 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
2433
2434         PR target/29487
2435         * decl.c (finish_function): Use DECL_REPLACEABLE.
2436         * tree.c (cp_cannot_inline_tree_fn): Likewise.
2437
2438 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2439
2440         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2441
2442 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
2443
2444         * decl.c (grokvardecl): Don't error if !have_tls.
2445         (grokdeclarator): Likewise.
2446         * parser.c (cp_parser_omp_threadprivate): Likewise.
2447
2448 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
2449
2450         PR c++/30703
2451         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2452         parameters and result decls in omp clauses.
2453         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2454         by reference.
2455
2456 2007-02-05  Dirk Mueller  <dmueller@suse.de>
2457
2458         PR bootstrap/30510
2459         * parser.c (cp_parser_class_specifier): Always initialize bases.
2460
2461 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
2462
2463         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2464         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2465         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2466         expressions.
2467         * semantics.c (finish_omp_atomic): Store a whole expression node
2468         in operand 1, and integer_zero_node in operand 0, for dependent
2469         OMP_ATOMIC.  Rewrite to make flow easier to understand.
2470
2471 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2472
2473         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2474
2475 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
2476
2477         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2478         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2479
2480 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
2481
2482        * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2483        keyword warning to -Wc++0x-compat.
2484         
2485 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2486
2487         * decl.c (grokdeclarator): Update documentation.
2488
2489 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
2490
2491         PR c++/30536
2492         * decl.c (grokdeclarator): If __thread is used together with
2493         a storage class other than extern and static, clear thread_p
2494         after issuing diagnostics and fall through to checking the
2495         storage class.
2496
2497 2007-01-30  Roger Sayle  <roger@eyesopen.com>
2498
2499         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2500         calculating the size of an array (to avoid recursive errors).
2501
2502 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2503
2504         PR c++/24745
2505         * typeck.c (build_binary_op): Fix logic for warning. Move warning
2506         to -Wpointer-arith.
2507         * call.c (convert_like_real): Don't warn when converting to
2508         boolean type.
2509         
2510 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2511
2512         * decl.c (pop_label): Replace warning with call to
2513         warn_for_unused_label.
2514
2515 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
2516
2517         PR C++/28988
2518         * semantics.c (finish_pseudo_destructor_expr): Check the
2519         destrutor name by calling check_dtor_name.
2520
2521 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
2522
2523         * lex.c (D_CPP0X): Rename.
2524         (D_CXX0X): To this.
2525         (reswords): D_CPP0X -> D_CXX0X.
2526         (init_reswords): Ditto.
2527         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2528         of C++0x keywords as identifiers.
2529
2530 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
2531
2532         PR c++/27492
2533         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2534         function decls.
2535
2536 2007-01-23  Ian Lance Taylor  <iant@google.com>
2537
2538         * typeck.c (convert_for_assignment): Only warn about a = b = c
2539         when converting to bool.
2540
2541 2007-01-23  Roger Sayle  <roger@eyesopen.com>
2542
2543         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2544         TREE_OVERFLOW.
2545         * typeck.c (ignore_overflows): Remove the remaining uses of
2546         TREE_CONSTANT_OVERFLOW.
2547
2548 2007-01-20  Jan Hubicka  <jh@suse.cz>
2549
2550         * decl2.c (start_objects, start_static_storage_duration_function):
2551         Do not make the functions uninlinable.
2552
2553 2007-01-17  Ian Lance Taylor  <iant@google.com>
2554
2555         * class.c (add_method): Call VEC_reserve_exact rather than passing
2556         a negative size to VEC_reserve.
2557
2558 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
2559
2560         PR c++/29573
2561         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2562
2563 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
2564
2565         PR c++/28999
2566         * decl.c (make_typename_type): If the qualified name is not a
2567         type, issue an error.
2568         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2569         formatting.
2570
2571 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
2572
2573         * rtti.c: Include target.h.
2574         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2575         don't emit typeinfo for fundamental types as weak.
2576         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2577
2578 2007-01-08  Richard Guenther  <rguenther@suse.de>
2579
2580         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2581
2582 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
2583
2584         * call.c (standard_conversion): Pass flag to
2585         vector_types_convertible_p to disallow emission of note.
2586         * typeck.c (convert_for_assignment): Pass flag to
2587         vector_types_convertible_p to allow emission of note.
2588         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2589         to disallow emission of note.
2590
2591 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2592
2593         PR c++/28986
2594         * typeck.c (build_binary_op): Call overflow_warning if
2595         TREE_OVERFLOW_P is true for the result and not for any of the
2596         operands.
2597         
2598 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
2599
2600        PR c++/19439
2601        * class.c (add_method): Don't wait until template
2602        instantiation time to complain about duplicate methods.
2603         
2604 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2605
2606         PR c/19978
2607         * semantics.c (finish_unary_op_expr): Warn only if result
2608         overflowed and operands did not.
2609
2610 2007-01-05  Ian Lance Taylor  <iant@google.com>
2611
2612         * typeck.c (build_binary_op): Warn about comparing a non-weak
2613         address to NULL.
2614
2615 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
2616
2617         * pt.c (tsubst): Propagate the need for structural equality checks
2618         when reducing the level of template parameters.
2619
2620 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
2621
2622         * pt.c: Fix a comment typo.
2623
2624 2007-01-02  Ian Lance Taylor  <iant@google.com>
2625
2626         * semantics.c (maybe_convert_cond): Optionally warn when using an
2627         assignment as a condition.
2628         * typeck.c (convert_for_assignment): Optionally warn about
2629         assigning the result of an assignment to a bool.
2630
2631 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
2632
2633         * pt.c (canonical_template_parms): Correct typo in comment.
2634         
2635 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
2636
2637         * typeck.c (structural_comptypes): Renamed from "comptypes".
2638         (comptypes): Use canonical type information to perform fast type
2639         comparison. When VERIFY_CANONICAL_TYPES, verify that the
2640         canonical type comparison returns the same results as we would see
2641         from the current, structural check. Support COMPARE_STRUCTURAL
2642         when we need structural checks.
2643         * decl.c (typename_compare): Fix comment.
2644         (build_typename_type): TYPENAME_TYPE nodes require structural
2645         equality checks, because they resolve different based on the
2646         current class type.
2647         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2648         require structural equality checks (for now).
2649         (build_ptrmemfunc_type): Build the canonical pointer to member
2650         function type.
2651         (compute_array_index_type): Whenever we build a new index type
2652         to represent the size of an array in a template, we need to mark
2653         this index type as requiring structural equality. This goes for
2654         arrays with value-dependent sizes with the current ABI, or all
2655         arrays with ABI-1.
2656         * tree.c (cplus_array_hash): New.
2657         (struct cplus_array_info): New.
2658         (cplus_array_compare): New.
2659         (cplus_array_htab): New.
2660         (build_cplus_array_type_1): Use a hash table to cache the array
2661         types we build. Build the canonical array type for each array
2662         type.
2663         (cp_build_qualified_type_real): When building a cv-qualified array
2664         type, use the hash table of array types and build canonical array
2665         types as necessary.
2666         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2667         use structural equality (for now).
2668         * cp-tree.h (COMPARE_STRUCTURAL): New.
2669         * pt.c (canonical_template_parms): New.
2670         (canonical_type_parameter): New.
2671         (process_template_parm): Find the canonical type parameter.
2672         (lookup_template_class): When we have named the primary template
2673         type, set the canonical type for our template class to the primary
2674         template type. If any of the template arguments need structural
2675         equality checks, the template class needs structural equality
2676         checks.
2677         (tsubst): When reducing the level of a template template
2678         parameter, we require structural equality tests for the resulting
2679         parameter because its template parameters have not had their types
2680         canonicalized. When reducing a template type parameter, find the
2681         canonical reduced type parameter.
2682         (any_template_arguments_need_structural_equality_p): New.
2683