OSDN Git Service

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