OSDN Git Service

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