OSDN Git Service

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