OSDN Git Service

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