OSDN Git Service

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