OSDN Git Service

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