OSDN Git Service

* decl.c (get_atexit_fn_ptr_type): New function.
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
2
3         * decl.c (get_atexit_fn_ptr_type): New function.
4         (get_atexit_node): Use it.
5         (start_cleanup_fn): Likewise.
6         (register_dtor_fn): Use the object's destructor, instead of a
7         separate cleanup function, where possible.
8         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
9         (atexit_fn_ptr_type_node): New macro.
10         * decl2.c (build_cleanup): Use build_address.
11
12 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
13
14         * typeck.c (build_binary_op): Include types in error.
15
16 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
17
18         PR c++/31806
19         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
20         needs runtime initialization.
21
22 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
23
24         PR c++/32158
25         * semantics.c (finish_trait_expr): Complete the types.
26
27 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
28             Douglas Gregor <doug.gregor@gmail.com>
29             Pedro Lamarao <pedro.lamarao@mndfck.org>
30             Howard Hinnant <howard.hinnant@gmail.com>
31
32         PR c++/7412
33         PR c++/29939
34         * typeck.c (comptypes): Don't consider rvalue and lvalue
35         reference types to be equivalent.
36         (check_return_expr): Move from certain lvalues when returning
37         them.
38         * decl.c (grokdeclarator): Implement reference collapsing.
39         (copy_fn_p): Don't consider constructors taking rvalue references
40         to be copy constructors.
41         (move_fn_p): New.
42         * call.c (conversion): New "rvaluedness_matches_p" member.
43         (convert_class_to_reference): Require reference type as first
44         parameter instead of base type.
45         (reference_binding): Add logic to handle rvalue references.
46         (implicit_conversion): Update inaccurate comment.
47         (convert_like_real): Disable creation of temporaries that are
48         impossible to initialize for types with move constructors.
49         (build_over_call): Elide move constructors when possible.
50         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
51         (maybe_handle_ref_bind): Return conversion instead of type node.
52         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
53         determine preferred conversion sequences.
54         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
55         (LOOKUP_PREFER_RVALUE): New.
56         (DECL_MOVE_CONSTRUCTOR_P): New.
57         (struct cp_declarator): Add "reference" member for reference
58         types, with new "rvalue_ref" flag.
59         (cp_build_reference_type): Declare.
60         (move_fn_p): Declare.
61         * error.c (dump_type_prefix): Format rvalue reference types
62         correctly in error messages.
63         * except.c (build_throw): Move from certain lvalues when
64         throwing.
65         * mangle.c (write_type): Mangle rvalue references differently
66         than regular references.
67         * parser.c (make_reference_declarator): Add boolean parameter for
68         rvalue references.
69         (cp_parser_make_indirect_declarator): New.
70         (cp_parser_new_declarator_opt): Call
71         cp_parser_make_indirect_declarator. 
72         (cp_parser_conversion_declarator_opt): Ditto.
73         (cp_parser_declarator): Ditto.
74         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
75         declarators.
76         * pt.c (tsubst): Implement reference collapsing.
77         (maybe_adjust_types_for_deduction): Implement special template
78         parameter deduction rule for rvalue references.
79         (type_unification_real): Update calls to
80         maybe_adjust_types_for_deduction.
81         (try_one_overload): Ditto.
82         (unify_pack_expansion): Ditto.
83         * tree.c (lvalue_p_1): Handle rvalue reference types.
84         (cp_build_reference_type): New.
85
86 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
87
88         PR c++/31809
89         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
90         variables that need runtime initialization.
91
92 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
93
94         PR c++/31339
95         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
96         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
97         case POSTDECREMENT_EXPR>): Return the error_mark_node
98         if either the real or imaginary parts would an
99         error_mark_node.
100         
101 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
102             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
103
104         PR c++/31745
105         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
106         token is a closing brace, false if there are no tokens left.
107         (cp_parser_namespace_alias_definition): Only consume the next token if
108         it is a closing brace.
109
110         * parser.c (cp_parser_class_specifier): Likewise.
111
112 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
113
114         * semantics.c (finish_member_declaration): Fix a typo in the
115         last checkin.
116
117 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
118
119         PR c++/31431
120         PR c++/31432
121         PR c++/31434
122         PR c++/31435
123         PR c++/31437
124         PR c++/31438
125         PR c++/31442
126         PR c++/31443
127         PR c++/31444
128         PR c++/31445
129         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
130         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
131         * pt.c (check_for_bare_parameter_packs): Return bool indicated
132         whether everything was okay. Fix indentation.
133         (push_template_decl_real): Check for bare parameter packs in
134         function parameters; where errors occur, mark the parameter types
135         with ERROR_MARK_NODEs to avert ICEs.
136         (coerce_template_parameter_pack): New.
137         (coerce_template_parms): Moved parameter pack coercion into
138         coerce_template_parameter_pack, and permit it anywhere in the
139         template parameter list (not just at the end). Parameter and
140         argument indices can vary (somewhat) separately now, so add
141         PARM_IDX and ARG_IDX.
142         (fn_type_unification): Don't set an argument pack as incomplete if
143         no argument pack was deduced.
144         (type_unification_real): If a type parameter is a parameter pack
145         and has not otherwise been deduced, it will be deduced to an empty
146         parameter pack.
147         (more_specialized_fn): Use the actual lengths of the argument
148         lists when comparing against expansions.
149         * semantics.c (finish_member_declaration): If a field's type has
150         bare parameter packs, error and set its type to ERROR_MARK_NODE.
151
152 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
153
154         PR target/27067
155         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
156
157 2007-05-22  Ollie Wild  <aaw@google.com>
158
159         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
160         (unqualified_namespace_lookup): Adds check for hidden types.
161
162 2007-05-22  Ollie Wild  <aaw@google.com>
163
164         * decl.c (duplicate_decls): Verify namespace names are unique.
165
166 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
167
168         * decl.c (cxx_maybe_build_cleanup): Handle
169         __attribute__((cleanup)).
170
171 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
172
173         * cvt.c (cp_convert_and_check): Don't check warnings if the
174         conversion failed.
175
176 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
177
178         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
179
180 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
181
182         PR c++/29928
183         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
184         type only if is a class type (5.2.8/4).
185
186 2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
187
188         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
189         * decl.c (grokdeclarator): Use unsigned_type_for instead of
190         c_common_unsigned_type.
191
192 2007-05-11  Silvius Rus  <rus@google.com>
193
194         * cp/typeck.c (build_indirect_ref): Add call to
195         strict_aliasing_warning.
196         (build_reinterpret_cast_1): Condition call to
197         strict_aliasing_warning. 
198
199 2007-05-11  Jan Hubicka  <jh@suse.cz>
200
201         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
202         * decl2.c (start_objects): ctors and dtors are no longer public.
203         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
204         
205 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
206
207         * typeck.c (build_unary_op): Remove code that used to
208         handle non lvalue increments/decrements.
209
210 2007-05-07  Mike Stump  <mrs@apple.com>
211
212         * parser.c (check_empty_body): Add.
213         (cp_parser_iteration_statement): Add call to check_empty_body.
214
215 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
216
217         PR 31775
218         * mangle.c (write_mangled_name): Mangle static variable names.
219         (write_unqualified_name): Use local-source-name for
220         namespace-scope static variables.
221
222 2007-05-04  Dirk Mueller  <dmueller@suse.de>
223
224         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
225         not in effect.
226
227 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
228
229         PR c++/31663
230         * decl2.c (constrain_class_visibility): 
231         Use strip_pointer_or_array_types instead of strip_array_types.
232
233 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
234
235         PR C++/30221
236         * decl.c (reshape_init_r): Don't reshape the first element if it
237         is a pointer to member function.
238
239 2007-04-27  Simon Baldwin  <simonb@google.com>
240
241         * decl.c (grokparms): Changed message format from %qD to %qE.
242
243 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
244
245         * error.c (maybe_warn_variadic_templates): Variadic templates are
246        now in C++0x, so only warn about them in C++98 mode.
247         
248 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
249
250         PR C++/30016
251         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
252         integeral types from vectors types.
253
254 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
255
256         PR c++/31598
257         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
258         for type dependent OMP_CLAUSE_DECLs.
259
260 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
261
262         PR c++/31338
263         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
264         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
265         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
266         * init.c (build_zero_init): Adjust, as
267         COMPLEX_TYPE is now a SCALAR_TYPE.
268         * typeck2.c (digest_init): Allow brace-enclosed initializers for
269         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
270
271 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
272
273         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
274         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
275         (trait_expr_value): Adjust.
276
277 2007-04-23  Simon Baldwin  <simonb@google.com>
278
279         * decl.c (grokparms): Added new error for duplicate function
280         parameters names in function prototypes, to match gcc behavior.
281
282 2007-04-23  Jan Hubicka  <jh@suse.cz>
283
284         * cp/decl2.c (finish_objects): Do not call target constructor/destructor
285         bits dirrectly.
286
287 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
288
289         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
290         instead of checking GIMPLE_STMT_P in chain_next.
291
292 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
293
294         PR c++/31513
295         * call.c (convert_for_arg_passing): Convert bitfields to their
296         declared types.
297
298 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
299
300         PR c++/31517
301         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
302
303 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
304
305         PR c++/29365
306
307         * cp/decl2.c (constrain_class_visibility):
308         Do not warn about the use of anonymous namespace in the main input file.
309
310 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
311
312         * cp-tree.h (current_template_parms): Fix typo in comment.
313
314 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
315
316         * cp-tree.h, error.c: Fix comment typos.
317
318 2007-04-13  Jason Merrill  <jason@redhat.com>
319
320         PR c++/31074
321         * call.c (reference_binding): Add c_cast_p parm.  If true,
322         add quals to TO as needed to make it reference-compatible.
323
324 2007-04-11  Jan Hubicka  <jh@suse.cz>
325
326         * cp/class.c (convert_to_base_statically): Fold produced tree; verify
327         that we are not processing template_decl.
328
329 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
330
331         PR c++/31449
332         * class.c (build_base_path): Ensure that the converted pointer has
333         the same cv-qualification as the input.
334
335 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
336
337         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
338
339 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
340
341         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
342         Do not set it.
343         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
344         * tree.c (cp_add_pending_fn_decls): Remove.
345         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
346
347 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
348
349         Revert change removing staticp.
350
351 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
352
353         * cp-objcp-common.c (cxx_staticp): Remove.
354         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
355         * cp-tree.h (cxx_staticp):      
356
357 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
358
359         * class.c (check_for_override): Don't remove dllmport attribute
360         of virtual methods.
361
362 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
363
364         PR c++/30847
365         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
366         type issue error and return early.
367
368 2007-03-30  Jason Merrill  <jason@redhat.com>
369
370         PR c++/31187
371         * typeck.c (cp_type_readonly): New fn.
372         * cp-tree.h: Declare it.
373         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
374         (cp_finish_decl): Not here.
375
376 2007-03-31  Richard Guenther  <rguenther@suse.de>
377
378         * optimize.c (maybe_clone_body): Replace splay-tree usage by
379         pointer-map.
380
381 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
382
383         PR c++/31138
384         PR c++/31140
385         PR c++/31141
386         * parser.c (declarator_can_be_parameter_pack): New.
387         (cp_parser_template_parameter): Only parse the `...' if the
388         declarator can be a parameter pack.
389         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
390         is NULL.
391         * pt.c (find_parameter_packs_r): Look into the bounds on integer
392         types (they could be used as array bounds). 
393         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
394         (tsubst_pack_expansion): Handle failure to expand parameter
395         packs.
396         
397 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
398
399         PR c++/26099
400         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
401         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
402         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
403         (CLASS_TYPE_NON_UNION_P): Add.
404         (struct lang_type_class): Add has_complex_dflt.
405         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
406         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
407         * cp-tree.def: Add TRAIT_EXPR.
408         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
409         * lex.c (struct resword): Add __has_nothrow_assign,
410         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
411         __has_trivial_constructor, __has_trivial_copy,
412         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
413         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
414         __is_pod, __is_polymorphic, __is_union.
415         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
416         (cp_parser_trait_expr): New.
417         * semantics.c (finish_trait_expr, trait_expr_value
418         classtype_has_nothrow_copy_or_assign_p): New.
419         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
420         as static.
421         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
422         * class.c (check_bases, check_field_decl, check_bases_and_members):
423         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
424         * pt.c (uses_template_parms, tsubst_copy_and_build,
425         value_dependent_expression_p, type_dependent_expression_p): Deal with
426         TRAIT_EXPR.
427         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
428
429 2007-03-29  Richard Guenther  <rguenther@suse.de>
430
431         * tree.c (cp_walk_subtrees): Do not set input_location.
432
433 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
434
435         PR c++/29077
436         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
437         destructor.
438
439 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
440
441         * parser.c (struct cp_parser): Update comment for
442         greater_than_is_operator_p.
443         (cp_parser_primary_expression): In C++0x mode, a cast operator can
444         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
445         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
446         !GREATER_THAN_IS_OPERATOR_P.
447         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
448         `>>' operators that will become two `>' tokens in C++0x.
449         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
450         mode, allowing it to terminate default arguments.
451         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
452         `>>' like two consecutive `>' tokens.
453         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
454         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
455         ends a template argument.
456
457 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
458
459         * decl.c (redeclaration_error_message): Complain when redeclaring
460         a friend function with default template arguments (C++0x mode only).
461         * cp-tree.h (check_default_tmpl_args): Declare.
462         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
463         template arguments in function templates. Add support for checking
464         the default template arguments of friend templates.
465         (push_template_decl_real): Fix call to check_default_tmpl_args.
466         (type_unification_real): If a template parameter has not been
467         deduced but provides a default template argument, substitute into
468         that default template argument.
469         * parser.c (cp_parser_init_declarator): When declaring (but not
470         defining!) a function template in C++0x mode, check for default
471         template arguments.
472
473 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
474
475         PR c++/29993
476         * decl.c (grokdeclarator): Deal with cv-qualified function type
477         typedefs in the same way for member and non-member functions.
478
479 2007-03-26  Dirk Mueller  <dmueller@suse.de>
480
481         * parser.c (cp_parser_member_declaration): Pedwarn
482         about stray semicolons after member declarations.
483
484 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
485
486         PR c++/30500
487         * pt.c (instantiate_decl): Set in_system_header.
488
489 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
490
491         * cp-tree.h (current_tempalte_parms): Improve documentation.
492         * pt.c (current_template_args): Likewise.
493
494         PR c++/30863
495         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
496         not consume tokens when failing.
497
498 2007-03-22  Jim Wilson  <wilson@specifix.com>
499             Mark Mitchell  <mark@codesourcery.com>
500
501         PR c++/31273
502         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
503         consistent with FROM.
504
505 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
506
507         * error.c (dump_expr): Handle dependent names that designate types.
508         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
509
510 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
511
512         * cp-tree.def, parser.c, pt.c: Fix comment typos.
513
514 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
515
516         * cvt.c (cp_convert_and_check) : Define.
517         * cp-tree.h (cp_convert_and_check): Declare.
518         * call.c (convert_conversion_warnings): Rename to
519         conversion_null_warnings.  The warning for floating-point to
520         integer is handled by convert_and_check in convert_like_real.
521         (convert_like_real): convert_conversion_warnings was renamed as
522         conversion_null_warnings.
523         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
524         overflow and changes of value during conversion.
525
526 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
527
528         PR c++/30891
529         * parser.c (cp_parser_statement): If 'namespace' is found, this
530         only can be a namespace alias definition, so parse it now.
531         (cp_parser_namespace_alias_definition): if we find an open brace
532         instead of '=', then this is actually a misplaced namespace
533         definition.
534         
535 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
536
537         PR c++/24924
538         * decl.c (cxx_init_decl_processing): Move command-line options
539         processing to c-opts.c.
540         
541 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
542
543         * ptree.c (cxx_print_type): Use formatting markup for integers
544         when printing template parameter index/level/orig level.
545         (cxx_print_xnode): Ditto.
546         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
547         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
548         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
549         HOST_WIDE_INTs.
550         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
551         rather than a HOST_WIDE_INT.
552         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
553         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
554         better bit-packing.
555         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
556         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
557         IN_BASE_INITIALIZER bool bitfields.
558         (struct cp_declarator): Make KIND a 4-bit field. Make
559         PARAMETER_PACK_P a bool bitfield just after KIND.
560         * pt.c (uses_parameter_packs): Destroy the pointer set.
561         (make_pack_expansion): Ditto.
562         (check_for_bare_parameter_packs): Ditto.
563         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
564         
565 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
566
567         PR c++/31165
568         * call.c  (convert_default_arg): Instead of copying the node,
569         unshare it.
570
571 2007-03-15  Dirk Mueller  <dmueller@suse.de>
572
573         PR c++/30860
574         * call.c (convert_conversion_warnings): New..
575         (convert_like_real): .. factored out from here.
576         (convert_conversion_warnings): Add warning about
577         false being converted to NULL in argument passing.
578
579 2007-03-14  Dirk Mueller  <dmueller@suse.de>
580
581         * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
582         (finish_do_body): Warn about empty body in do/while statement.
583
584 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
585
586         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
587         
588 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
589
590         PR c/21438
591         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
592         warning.
593         
594 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
595
596         * cp/repo.c (init_repo): Initialize random_seed saved options.
597         (finish_repo): Adjust.
598
599 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
600
601         PR bootstrap/30899
602         * Make-lang.in (doc/g++.1): Use $< to specify the location from
603         which to copy.
604
605 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
606
607         * decl.c (compute_array_index_type): New warning flag warn_vla.
608
609 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
610
611         PR c++/30108
612         * call.c (convert_default_arg): Copy non-constant arguments.
613
614 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
615
616         PR c++/31038
617         * parser.c (cp_parser_postfix_expression): Disallow compound
618         literals in constant expressions.
619
620         PR c++/30328
621         * semantics.c (finish_typeof): Use unlowered_expr_type.
622         
623 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
624
625         PR c++/30274
626         * cp-tree.h (unlowered_expr_type): New function.
627         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
628         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
629         (unlowered_expr_type): New function.
630         (build_unary_op): Disallow predecrements of bool bitfields.
631         * call.c (build_conditional_expr): Use unlowered_expr_type.
632         * pt.c (type_unification_real): Likewise.
633
634 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
635
636         PR c++/20599
637         * typeck.c (check_return_expr): Check for bare parameter packs.
638         (comptypes): Compare template parameter packs and
639         type pack expansions.
640         * decl.c (grokdeclarator): Deal with the declaration of function
641         parameter packs.
642         (grokparms): Verify that the (optional) function parameter pack is
643         at the end of the parameter list.
644         (xref_basetypes): Handle pack expansions in the base class.
645         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
646         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
647         (NONTYPE_ARGUMENT_PACK): New.
648         (TYPE_PACK_EXPANSION): New.
649         (EXPR_PACK_EXPANSION): New.
650         (ARGUMENT_PACK_SELECT): New.
651         * cp-objcp-common.c (cp_tree_size): Compute size of
652         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
653         ARGUMENT_PACK_SELECT.
654         * error.c (dump_template_argument): Print template argument packs.
655         (dump_template_argument_list): Ditto.
656         (dump_template_parameter): Dump `...' for template type parameter
657         packs.
658         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
659         (dump_parameters): Print function parameter packs.
660         (dump_template_parms): Print template argument packs.
661         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
662         (maybe_warn_variadic_templates): New.
663         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
664         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
665         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
666         CAST_EXPR. 
667         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
668         (write_template_arg): Write argument packs as separate arguments.
669         * cp-tree.h (struct template_parm_index_s): Add flag that
670         indicates that the template parameter is actually a parameter
671         pack.
672         (struct tree_argument_pack_select): New.
673         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
674         (union lang_tree_node): Add argument_pack_select.
675         (FUNCTION_PARAMETER_PACK_P): New.
676         (PACK_EXPANSION_P): New.
677         (PACK_EXPANSION_PATTERN): New.
678         (SET_PACK_EXPANSION_PATTERN): New.
679         (PACK_EXPANSION_PARAMETER_PACKS): New.
680         (ARGUMENT_PACK_P): New.
681         (ARGUMENT_PACK_ARGS): New.
682         (SET_ARGUMENT_PACK_ARGS): New.
683         (ARGUMENT_PACK_INCOMPLETE_P): New.
684         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
685         (TEMPLATE_PARM_PARAMETER_PACK): New.
686         (TEMPLATE_TYPE_PARAMETER_PACK): New.
687         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
688         (ARGUMENT_PACK_SELECT_INDEX): New.
689         (ARGUMENT_PACK_SELECT_ARG): New.
690         (struct cp_declarator): Add parameter_pack_p flag.
691         (maybe_warn_variadic_templates): Declare.
692         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
693         indicate a template parameter pack. 
694         (uses_parameter_packs): Declare.
695         (template_parameter_pack_p): Declare.
696         (template_parms_variadic_p): Declare.
697         (make_pack_expansion): Declare.
698         (check_for_bare_parameter_packs): Declare.
699         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
700         sizeof... expressions. 
701         (pp_cxx_expression): Print pack expansions and non-type argument
702         packs.
703         (pp_cxx_exception_specification): Print pack expansions. 
704         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
705         (pp_cxx_ctor_initializer): Print pack expansions.
706         (pp_cxx_type_id): Print pack expansions.
707         (pp_cxx_template_argument_list): Print argument packs.
708         (pp_cxx_template_parameter): Print ellipsis for template parameter
709         packs.
710         * pt.c (comp_template_parms): Compare template parameter packs.
711         (template_parameter_pack_p): New.
712         (template_parms_variadic_p): New.
713         (template_args_variadic_p): New.
714         (make_ith_pack_parameter_name): New.
715         (struct find_parameter_pack_data): New.
716         (find_parameter_packs_r): New.
717         (uses_parameter_packs): New.
718         (make_pack_expansion): New.
719         (check_for_bare_parameter_packs): New.
720         (expand_template_argument_pack): New.
721         (reduce_template_parm_level): Propagate parameter pack flag.
722         (process_template_parm): Add is_parameter_pack parameter to state
723         when the parameter is actually a parameter pack. Create template
724         parameter packs when is_parameter_pack is true.
725         (current_template_args): The argument for a template parameter
726         pack is an argument pack containing a single pack expansion.
727         (process_partial_specialization): When checking that non-type
728         argument expressions do not involve template parameters, loop over
729         the arguments in argument packs separately.
730         (push_template_decl_real): Check that the type of the declaration
731         does not have any bare parameter packs. Check that primary
732         templates have no more than one parameter pack, and that it comes
733         at the end of the template parameter list.
734         (convert_template_argument): Handle coercions for pack expansion
735         expressions by coercing the pattern then rebuilding the expansion.
736         (coerce_template_parms): When coercing the arguments for a
737         variadic template, pack "extra" arguments into an argument pack.
738         (coerce_template_template_parms): Cannot coerce between parameter
739         packs and non-pack parameters.
740         (template_args_equal): Compare PACK_EXPANSION_P expressions.
741         (comp_template_args): Expand all template arguments packs before
742         comparing template argument lists.
743         (mangle_class_name_for_template): Make argument packs as separate
744         template arguments.
745         (for_each_template_parm_r): No need to handle BASELINK. 
746         (instantiate_class_template): Handle pack expansions in the base
747         class list.
748         (tsubst_pack_expansion): New.
749         (tsubst_template_args): Handle substitutions of argument packs and
750         pack expansion into template argument lists.
751         (tsubst_decl): Expand function parameter packs into separate
752         function parameters.
753         (tsubst_arg_types): Expand a type pack expansion into separate
754         argument types.
755         (tsubst_exception_specification): Handle pack expansions in
756         exception specifiers.
757         (tsubst): See through ARGUMENT_PACK_SELECT arguments when 
758         replacing a template parameter with its argument. If we encounter
759         a substitution for an argument pack, just return the parameter
760         itself. 
761         (tsubst_copy): sizeof(X...) returns the number of elements in
762         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
763         PARM_DECL is a parameter pack.
764         (tsubst_expr): Expression pack expansions and argument packs
765         cannot show up here; they will all be handled through function
766         calls, sizeof, and template argument lists.
767         (tsubst_copy_and_build): sizeof(X...) returns the number of
768         elements in parameter pack X.  Handle pack expansions in TREE_LIST
769         and CONSTRUCTOR nodes.
770         (fn_type_unification): Handle "incomplete" explicit template
771         argument lists that specify some of the arguments for a template
772         parameter pack.
773         (type_unification_real): Unify arguments against pack expansions.
774         (template_parm_level_and_index): New, helper function.
775         (unify_pack_expansion): New.
776         (unify): Unify argument packs on an argument-by-argument basis,
777         handling variadic argument packs as well.
778         (more_specialized_fn): Handle unification of function parameter
779         packs. All things being equal, prefer non-variadic function
780         templates to variadic function templates.
781         (more_specialized_class): Prefer the variadic class template
782         partial specialization that binds fewer arguments to a parameter
783         pack.
784         (regenerate_decl_from_template): Expand function parameter packs
785         into separate parameters.
786         (instantiate_decl): Ditto.
787         (tsubst_initializer_list): Handle pack expansions for base-class
788         initializers.
789         (dependent_type_p_r): Determine dependent types in argument packs
790         and pack expansions.
791         (value_dependent_expression_p): Determine value-dependence of
792         non-type argument packs.
793         (dependent_template_arg_p): Handle argument packs.
794         * semantics.c (finish_cond): Check for bare parameter packs.
795         (finish_expr_stmt): Ditto.
796         (finish_for_expr): Ditto.
797         (finish_switch_cond): Ditto.
798         (finish_mem_initializers): Ditto.
799         * name-lookup.c (arg_assoc_type): Handle pack expansions and
800         argument packs.
801         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
802         * parser.c (make_declarator): Declarator is not an expansion.
803         (make_pointer_declarator): Transfer parameter pack flag to outer
804         declarator.
805         (make_reference_declarator): Ditto.
806         (make_ptrmem_declarator): Ditto.
807         (make_call_declarator): Ditto.
808         (make_array_declarator): Ditto.
809         (cp_parser_postfix_expression): Allow pack expansion expressions
810         in the argument list for a call expression.
811         (cp_parser_parenthesized_expression_list): Add new parameter
812         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
813         into separate arguments."
814         (cp_parser_new_placement): Allow pack expansion expressions.
815         (cp_parser_new_initializer): Ditto.
816         (cp_parser_mem_initializer_list): Allow ellipsis to create a
817         base-class initializer expansion.
818         (cp_parser_mem_initializer): Ditto.
819         (cp_parser_template_parameter_list): Keep track of whether the
820         template parameter is a template parameter pack.
821         (cp_parser_template_parameter): Parse the ellipsis to indicate a
822         template parameter pack.
823         (cp_parser_type_parameter): Ditto.
824         (cp_parser_template_argument_list): Parse the ellipsis to indicate
825         a pack expansion.
826         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
827         this declarator is a parameter pack.
828         (cp_parser_parameter_declaration): The ellipsis does not end the
829         parameter declaration, because it might be a parameter pack. Parse
830         the ellipsis to indicate a parameter pack.
831         (cp_parser_initializer): Allow pack expansions.
832         (cp_parser_initializer_list): Allow ellipsis to create an
833         initializer expansion.
834         (cp_parser_base_clause): Allow ellipsis to create a base specifier
835         expansion.
836         (cp_parser_type_id_list): Allow ellipsis to create an exception
837         specifier expansion.
838         (cp_parser_attribute_list): Don't allow pack expansions.
839         (cp_parser_functional_cast): Allow pack expansions.
840         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
841         compute the length of a parameter pack.
842         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
843         end a template argument.
844         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
845         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
846         CAST_EXPR. 
847
848 2007-03-09  Dirk Mueller  <dmueller@suse.de>
849
850         * cp/call.c (build_new_op): Call warn_logical_operator.
851
852 2007-03-08  Volker Reichelt  <reichelt@netcologne.de>
853
854         PR c++/30852
855         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
856
857         PR c++/30534
858         * pt.c (any_template_arguments_need_structural_equality_p):
859         Robustify.
860
861 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
862
863         * decl.c (grokdeclarator): Disable warnings for anonymous
864         bitfields.
865
866 2007-03-05  Volker Reichelt  <reichelt@netcologne.de>
867
868         * typeck2.c (readonly_error): Always emit a hard error.
869         Remove last argument.
870         * cp-tree.h (readonly_error): Adjust prototype.
871         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
872         * typeck.c (build_unary_op): Likewise.
873         (build_modify_expr): Likewise.
874
875 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
876
877         PR c++/30895
878         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
879
880 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
881
882         PR c++/15787
883         * parser.c (struct cp_parser): New IN_IF_STMT.
884         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
885         returning if parsing the body of an 'if' statement or issuing an
886         error and continuing.
887         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
888         body of 'if'.
889         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
890         
891 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
892
893         PR c++/28253
894         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
895         for thunks.
896
897 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
898
899         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
900         Objective-C++.  Don't exit early if -shared-libgcc needs to be
901         added.
902
903 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
904
905         * typeck.c (common_base_type): Delete unused function.
906         
907 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
908
909         * Make-lang.in: Add dummy lang.install-pdf target.
910
911 2007-03-01  Simon Baldwin <simonb@google.com>
912
913         PR c++/23689
914         * decl.c (check_tag_decl): Added new warning for typedef ignored
915         when it precedes an otherwise valid non-typedef declaration.
916
917 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
918
919         * typeck.c (build_function_call): Store converted arguments
920         in a stack-allocated array instead of building a list.
921         (convert_arguments): Store arguments in the array passed in as an
922         argument, and return the actual number of arguments.
923         * call.c (build_call): Delete, and replace with...
924         (build_call_n, build_call_a): New.
925         (build_op_delete_call): Rewrite to avoid constructing argument lists.
926         (build_over_call): Store converted arguments in a stack-allocated
927         array instead of building a list.
928         (build_cxx_call): Pass arguments in an array instead of as a list.
929         (build_java_interface_fn_ref): Rewrite to avoid constructing
930         argument lists.
931         * tree.h: Update declarations to reflect above changes.
932         * method.c (use_thunk): Use a stack-allocated array to hold
933         the arguments instead of a list.
934         * rtti.c (throw_bad_cast): Update call to cxx_call.
935         (throw_bad_typeid): Likewise.
936         (build_dynamic_cast_1): Likewise.
937         * init.c (build_builtin_delete_call): Use build_call_n.
938         * decl.c (expand_static_init): Likewise.
939         * except.c (cp_protect_cleanup_actions): Likewise.
940         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
941         (gimplify_must_not_throw_expr): Likewise.
942         (cxx_omp_apply_fn): Use build_call_a.
943
944 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
945
946         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
947         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
948
949 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
950
951         * cp-tree.h (static_ctors): Remove.
952         * cp-tree.h (static_dtors): Likewise.
953         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
954         refactoring of tree_map hierarchy.
955         (decl_shadowed_for_var_insert): Likewise.
956         * semantics.c (expand_body): Use c_expand_body.
957         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
958         * decl2.c (static_ctors): Remove.
959         (static_dtors): Likewise.
960         (generate_ctor_or_dtor_function): Pass NULL_TREE to
961         objc_generate_static_init_call.  Do not call static_[cd]tors.
962         (generate_ctor_and_dtor_functions_for_priority): Do not check for
963         static_[cd]tors.
964         (cp_write_global_declarations): Likewise.
965
966 2007-02-23  Richard Guenther  <rguenther@suse.de>
967
968         * class.c (note_name_declared_in_class): Make declaration
969         changes meaning a pedwarn.
970
971 2007-02-22  Michael Matz  <matz@suse.de>
972
973         PR c++/29433
974         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
975         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
976         dump_function_decl): Guard emitting outer scopes by new flag.
977         * cp-lang.c (cxx_dwarf_name): New function.
978         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
979         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
980         Remove functions.
981         (push_template_decl_real, lookup_template_class): Remove calls
982         to above functions.
983
984 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
985
986         * call.c (build_new_method_call): Ensure that explicit calls of
987         destructors have type "void".
988
989 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
990
991         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
992         and -Walways-true with -Waddress.
993         * cvt.c (convert_to_void): Replace unconditional warning with
994         -Waddress.
995
996 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
997
998         * decl.c, tree.c: Fix comment typos.
999
1000 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1001
1002         PR C++/30158
1003         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the 
1004         statement expression if we had an error mark node.
1005                 
1006 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
1007             Brooks Moses  <brooks.moses@codesourcery.com>
1008             Lee Millward  <lee.millward@codesourcery.com>
1009
1010         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1011         Change class to tcc_vl_exp.
1012
1013         * call.c (build_call): Use build_call_list instead 
1014         of build3. 
1015         (build_over_call): Likewise.
1016         (build_new_method_call): Use build_min_non_dep_call_list 
1017         instead of build_min_non_dep.
1018
1019         * error.c (dump_call_expr_args): New function.
1020         (dump_aggr_init_expr_args): New function.
1021         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
1022         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1023
1024         * cvt.c (convert_to_void): Use build_call_array instead
1025         of build3; use new AGGR_INIT_EXPR accessor macros.
1026
1027         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1028         instead of TREE_CODE_LENGTH.
1029
1030         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1031         AGGR_INIT_EXPR accessor macros.
1032
1033         * cp-gimplify.c (cp_gimplify_init_expr): Use 
1034         AGGR_INIT_EXPR_SLOT to set the slot operand.
1035
1036         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1037         (AGGR_INIT_EXPR_SLOT): New macro.
1038         (AGGR_INIT_EXPR_ARG): New macro.
1039         (aggr_init_expr_nargs): New macro.
1040         (AGGR_INIT_EXPR_ARGP): New macro.
1041         (aggr_init_expr_arg_iterator): New.
1042         (init_aggr_init_expr_arg_iterator): New.
1043         (next_aggr_init_expr_arg): New.
1044         (first_aggr_init_expr_arg): New.
1045         (more_aggr_init_expr_args_p): New.
1046         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1047         (stabilize_aggr_init): New declaration.
1048         (build_min_non_dep_call_list): Likewise.
1049
1050         * tree.c (process_aggr_init_operands): New function.
1051         (build_aggr_init_array) New function.
1052         (build_cplus_new): Update to use new CALL_EXPR and
1053         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1054         build_aggr_init_array.
1055         (build_min_non_dep_call_list) New function.
1056         (build_min_nt): Assert input code parameter is not a variable
1057         length expression class.
1058         (build_min, build_min_non_dep): Likewise.
1059         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1060         to check for equality instead of recursing. Handle tcc_vl_exp
1061         tree code classes.
1062         (stabilize_call): Update to only handle CALL_EXPRs, not 
1063         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1064         (stabilize_aggr_init): New function.
1065         (stabilize_init): Use it.
1066
1067         * cxx-pretty-print.c (pp_cxx_postfix_expression)
1068         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1069         AGGR_INIT_EXPR accessor macros and argument iterators.
1070         
1071         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1072         build_vl_exp. Iterate through the operands, recursively 
1073         processing each one.
1074         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1075         CALL_EXPR accessor macros.
1076         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1077         tree code classes. Use TREE_OPERAND_LENGTH instead of 
1078         TREE_CODE_LENGTH.
1079
1080         * semantics.c (finish_call_expr): Use build_nt_call_list
1081         instead of build_nt.
1082         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
1083         accessor macros. Use build_call_array to construct the 
1084         CALL_EXPR node instead of build3
1085         
1086         * decl2.c (build_offset_ref_call_from_tree): Use 
1087         build_nt_call_list and build_min_non_dep_call_list instead
1088         of build_min_nt and build_min_non_dep.
1089
1090         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1091         Use build_nt_call_list instead of build_min_nt.
1092
1093 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1094
1095         PR c++/28943
1096         * call.c (build_conditional_expr): Improve error message.
1097         
1098 2007-02-13  Dirk Mueller  <dmueller@suse.de>
1099
1100         * friend.c (do_friend): Annotate warning about friend
1101         declarations in templates with OPT_Wnon_template_friend.
1102         Convert informal message from warning() to inform().
1103
1104 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
1105             Mark Mitchell  <mark@codesourcery.com>
1106
1107         PR c++/14622
1108         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1109         instantiations for variables.
1110
1111 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1112
1113         PR middle-end/7651
1114         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1115         Check warn_unused_value just once.
1116
1117 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
1118
1119         PR c++/26988
1120         * pt.c (determine_specialization): Use skip_artificial_parms_for.
1121         (fn_type_unificiation): Likewise.
1122         (get_bindings): Likewise.
1123
1124 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
1125
1126         PR target/29487
1127         * decl.c (finish_function): Use DECL_REPLACEABLE.
1128         * tree.c (cp_cannot_inline_tree_fn): Likewise.
1129
1130 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1131
1132         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1133
1134 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
1135
1136         * decl.c (grokvardecl): Don't error if !have_tls.
1137         (grokdeclarator): Likewise.
1138         * parser.c (cp_parser_omp_threadprivate): Likewise.
1139
1140 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
1141
1142         PR c++/30703
1143         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1144         parameters and result decls in omp clauses.
1145         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1146         by reference.
1147
1148 2007-02-05  Dirk Mueller  <dmueller@suse.de>
1149
1150         PR bootstrap/30510
1151         * parser.c (cp_parser_class_specifier): Always initialize bases.
1152
1153 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
1154
1155         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1156         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1157         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1158         expressions.
1159         * semantics.c (finish_omp_atomic): Store a whole expression node
1160         in operand 1, and integer_zero_node in operand 0, for dependent
1161         OMP_ATOMIC.  Rewrite to make flow easier to understand.
1162
1163 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1164
1165         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1166
1167 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
1168
1169         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1170         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1171
1172 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
1173
1174        * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1175        keyword warning to -Wc++0x-compat.
1176         
1177 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1178
1179         * decl.c (grokdeclarator): Update documentation.
1180
1181 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
1182
1183         PR c++/30536
1184         * decl.c (grokdeclarator): If __thread is used together with
1185         a storage class other than extern and static, clear thread_p
1186         after issuing diagnostics and fall through to checking the
1187         storage class.
1188
1189 2007-01-30  Roger Sayle  <roger@eyesopen.com>
1190
1191         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1192         calculating the size of an array (to avoid recursive errors).
1193
1194 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1195
1196         PR c++/24745
1197         * typeck.c (build_binary_op): Fix logic for warning. Move warning
1198         to -Wpointer-arith.
1199         * call.c (convert_like_real): Don't warn when converting to
1200         boolean type.
1201         
1202 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1203
1204         * decl.c (pop_label): Replace warning with call to
1205         warn_for_unused_label.
1206
1207 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
1208
1209         PR C++/28988
1210         * semantics.c (finish_pseudo_destructor_expr): Check the
1211         destrutor name by calling check_dtor_name.
1212
1213 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
1214
1215         * lex.c (D_CPP0X): Rename.
1216         (D_CXX0X): To this.
1217         (reswords): D_CPP0X -> D_CXX0X.
1218         (init_reswords): Ditto.
1219         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1220         of C++0x keywords as identifiers.
1221
1222 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
1223
1224         PR c++/27492
1225         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1226         function decls.
1227
1228 2007-01-23  Ian Lance Taylor  <iant@google.com>
1229
1230         * typeck.c (convert_for_assignment): Only warn about a = b = c
1231         when converting to bool.
1232
1233 2007-01-23  Roger Sayle  <roger@eyesopen.com>
1234
1235         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1236         TREE_OVERFLOW.
1237         * typeck.c (ignore_overflows): Remove the remaining uses of
1238         TREE_CONSTANT_OVERFLOW.
1239
1240 2007-01-20  Jan Hubicka  <jh@suse.cz>
1241
1242         * decl2.c (start_objects, start_static_storage_duration_function):
1243         Do not make the functions uninlinable.
1244
1245 2007-01-17  Ian Lance Taylor  <iant@google.com>
1246
1247         * class.c (add_method): Call VEC_reserve_exact rather than passing
1248         a negative size to VEC_reserve.
1249
1250 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
1251
1252         PR c++/29573
1253         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1254
1255 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
1256
1257         PR c++/28999
1258         * decl.c (make_typename_type): If the qualified name is not a
1259         type, issue an error.
1260         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1261         formatting.
1262
1263 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
1264
1265         * rtti.c: Include target.h.
1266         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1267         don't emit typeinfo for fundamental types as weak.
1268         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1269
1270 2007-01-08  Richard Guenther  <rguenther@suse.de>
1271
1272         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1273
1274 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
1275
1276         * call.c (standard_conversion): Pass flag to
1277         vector_types_convertible_p to disallow emission of note.
1278         * typeck.c (convert_for_assignment): Pass flag to
1279         vector_types_convertible_p to allow emission of note.
1280         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1281         to disallow emission of note.
1282
1283 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1284
1285         PR c++/28986
1286         * typeck.c (build_binary_op): Call overflow_warning if
1287         TREE_OVERFLOW_P is true for the result and not for any of the
1288         operands.
1289         
1290 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
1291
1292        PR c++/19439
1293        * class.c (add_method): Don't wait until template
1294        instantiation time to complain about duplicate methods.
1295         
1296 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1297
1298         PR c/19978
1299         * semantics.c (finish_unary_op_expr): Warn only if result
1300         overflowed and operands did not.
1301
1302 2007-01-05  Ian Lance Taylor  <iant@google.com>
1303
1304         * typeck.c (build_binary_op): Warn about comparing a non-weak
1305         address to NULL.
1306
1307 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
1308
1309         * pt.c (tsubst): Propagate the need for structural equality checks
1310         when reducing the level of template parameters.
1311
1312 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
1313
1314         * pt.c: Fix a comment typo.
1315
1316 2007-01-02  Ian Lance Taylor  <iant@google.com>
1317
1318         * semantics.c (maybe_convert_cond): Optionally warn when using an
1319         assignment as a condition.
1320         * typeck.c (convert_for_assignment): Optionally warn about
1321         assigning the result of an assignment to a bool.
1322
1323 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
1324
1325         * pt.c (canonical_template_parms): Correct typo in comment.
1326         
1327 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
1328
1329         * typeck.c (structural_comptypes): Renamed from "comptypes".
1330         (comptypes): Use canonical type information to perform fast type
1331         comparison. When VERIFY_CANONICAL_TYPES, verify that the
1332         canonical type comparison returns the same results as we would see
1333         from the current, structural check. Support COMPARE_STRUCTURAL
1334         when we need structural checks.
1335         * decl.c (typename_compare): Fix comment.
1336         (build_typename_type): TYPENAME_TYPE nodes require structural
1337         equality checks, because they resolve different based on the
1338         current class type.
1339         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1340         require structural equality checks (for now).
1341         (build_ptrmemfunc_type): Build the canonical pointer to member
1342         function type.
1343         (compute_array_index_type): Whenever we build a new index type
1344         to represent the size of an array in a template, we need to mark
1345         this index type as requiring structural equality. This goes for
1346         arrays with value-dependent sizes with the current ABI, or all
1347         arrays with ABI-1.
1348         * tree.c (cplus_array_hash): New.
1349         (struct cplus_array_info): New.
1350         (cplus_array_compare): New.
1351         (cplus_array_htab): New.
1352         (build_cplus_array_type_1): Use a hash table to cache the array
1353         types we build. Build the canonical array type for each array
1354         type.
1355         (cp_build_qualified_type_real): When building a cv-qualified array
1356         type, use the hash table of array types and build canonical array
1357         types as necessary.
1358         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1359         use structural equality (for now).
1360         * cp-tree.h (COMPARE_STRUCTURAL): New.
1361         * pt.c (canonical_template_parms): New.
1362         (canonical_type_parameter): New.
1363         (process_template_parm): Find the canonical type parameter.
1364         (lookup_template_class): When we have named the primary template
1365         type, set the canonical type for our template class to the primary
1366         template type. If any of the template arguments need structural
1367         equality checks, the template class needs structural equality
1368         checks.
1369         (tsubst): When reducing the level of a template template
1370         parameter, we require structural equality tests for the resulting
1371         parameter because its template parameters have not had their types
1372         canonicalized. When reducing a template type parameter, find the
1373         canonical reduced type parameter.
1374         (any_template_arguments_need_structural_equality_p): New.
1375