OSDN Git Service

C++ support for -Wunused-but-set-variable
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2010-04-22  Jakub Jelinek <jakub@redhat.com>
2             Dodji Seketeli <dodji@redhat.com>
3
4         PR c/18624
5         * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
6         Declare ...
7         * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
8         * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
9         (decay_conversion, perform_integral_promotions): Call rvalue_use.
10         (cp_build_unary_op): Call lvalue_use.
11         * decl.c (unused_but_set_errorcount): New variable.
12         (poplevel): Issue -Wunused-but-set-variable diagnostics.
13         (duplicate_decls): Merge DECL_READ_P flags.
14         (start_cleanup_fn): Set DECL_READ_P flag.
15         (finish_function): Issue -Wunused-but-set-parameter diagnostics.
16         * tree.c (rvalue): Call rvalue_use.
17         * pt.c (convert_nontype_argument): Likewise.
18         * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
19         finish_decltype_type): Likewise.
20         * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
21         (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
22         or rvalue_use depending on the expr.
23         * init.c (build_new, build_delete): Likewise.
24         * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
25
26 2010-05-05  Jason Merrill  <jason@redhat.com>
27
28         PR c++/43787
29         * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
30         * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
31
32 2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
33
34         PR c++/43028
35         * pt.c (unify): Check each elt for error_mark_node.
36
37 2010-05-04  Jason Merrill  <jason@redhat.com>
38
39         PR c++/38064
40         * typeck.c (cp_build_binary_op): Allow enums for <> as well.
41
42 2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
43
44         PR c++/43705
45         * call.c (build_new_method_call): Return error_mark_node if fns is
46         NULL_TREE.
47
48 2010-05-03  Dodji Seketeli  <dodji@redhat.com>
49
50         PR c++/43953
51         * pt.c (most_specialized_class): Pretend we are processing
52         a template decl during the call to coerce_template_parms.
53
54 2010-05-03  Jason Merrill  <jason@redhat.com>
55
56         PR c++/42810
57         PR c++/43680
58         * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
59         from the selected underlying type unless -fstrict-enums.  Set
60         ENUM_UNDERLYING_TYPE to have the restricted range.
61         * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
62         * class.c (check_bitfield_decl): Likewise.
63
64 2010-05-01  H.J. Lu  <hongjiu.lu@intel.com>
65
66         PR c++/43951
67         * init.c (build_new_1): Revert the accidental checkin in
68         revision 158918.
69
70 2010-04-30  Jason Merrill  <jason@redhat.com>
71
72         PR c++/43868
73         * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
74         (pp_cxx_type_specifier_seq): ...here.
75
76 2010-04-30  Steven Bosscher  <steven@gcc.gnu.org>
77
78         * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
79         * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
80
81 2010-04-30  Shujing Zhao  <pearly.zhao@oracle.com>
82
83         PR c++/43779
84         * typeck.c (warn_args_num): New function.
85         (convert_arguments): Use warn_args_num to print the diagnostic
86         messages. 
87
88 2010-04-29  Fabien Chêne  <fabien.chene@gmail.com>
89
90         PR c++/43890
91         * init.c (diagnose_uninitialized_cst_or_ref_member): check for
92         user-provided constructor while recursing.
93
94 2010-04-28  Manuel López-Ibáñez  <manu@gcc.gnu.org>
95
96         PR c++/9335
97         * error.c (print_instantiation_partial_context_line): Handle
98         recursive instantiation.
99         (print_instantiation_partial_context): Likewise.
100
101 2010-04-27  Jason Merrill  <jason@redhat.com>
102
103         * init.c (perform_member_init): Check CLASS_TYPE_P.
104
105 2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
106
107         PR c++/29043
108         * init.c (perform_member_init): check for uninitialized const or
109         reference members, including array types.
110
111 2010-04-24  Jason Merrill  <jason@redhat.com>
112
113         * tree.c (get_fns): Split out from get_first_fn.
114         * cp-tree.h: Declare it.
115         * search.c (shared_member_p): Use it.
116         * semantics.c (finish_qualified_id_expr): Simplify.
117         (finish_id_expression): Simplify.
118
119         * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
120         whenever object is NULL_TREE.  Don't do 'this' capture here.
121         (finish_qualified_id_expr): Pass NULL_TREE.
122         (finish_id_expression): Likewise.
123         (lambda_expr_this_capture): Likewise.
124
125         * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
126         rather than checking current_class_ref directly.
127         (finish_call_expr): Likewise.
128
129         PR c++/43856
130         * name-lookup.c (qualify_lookup): Disqualify lambda op().
131         * class.c (current_nonlambda_class_type): New fn.
132         * semantics.c (nonlambda_method_basetype): New.
133         * cp-tree.h: Declare them.
134         * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
135
136         * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
137
138         PR c++/43875
139         * semantics.c (lambda_return_type): Complain about
140         braced-init-list.
141
142         PR c++/43790
143         * tree.c (cv_unqualified): Handle error_mark_node.
144
145         PR c++/41468
146         * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
147         if we don't want errors.
148
149         PR c++/41468
150         * class.c (convert_to_base): Add complain parameter.  Pass
151         ba_quiet to lookup_base if we don't want errors.
152         (build_vfield_ref): Pass complain to convert_to_base.
153         * call.c (convert_like_real): Likewise.
154         (initialize_reference): Likewise.
155         (perform_direct_initialization_if_possible): Pass complain to
156         convert_like_real.
157         * cp-tree.h: Adjust.
158
159 2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
160             Jason Merrill  <jason@redhat.com>
161
162         PR c++/42844
163         * decl.c (check_for_uninitialized_const_var): Handle classes that need
164         constructing, too.
165         (check_initializer): Call it for classes that need constructing, too.
166         * class.c (in_class_defaulted_default_constructor): New.
167         * cp-tree.h: Declare it.
168
169 2010-04-20  Jason Merrill  <jason@redhat.com>
170
171         PR c++/9335
172         * init.c (constant_value_1): Treat error_mark_node as a constant
173         if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
174         * cvt.c (ocp_convert): Handle getting error_mark_node from
175         integral_constant_value.
176         * decl.c (compute_array_index_type): Likewise.
177
178 2010-04-20  Dodji Seketeli  <dodji@redhat.com>
179
180         PR c++/43800
181         PR c++/43704
182         * typeck.c (incompatible_dependent_types_p): If one of the
183         compared types if not a typedef then honour their main variant
184         equivalence.
185
186 2010-04-20  Jakub Jelinek  <jakub@redhat.com>
187
188         * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
189
190 2010-04-19  Dodji Seketeli  <dodji@redhat.com>
191
192         PR c++/43704
193         * typeck.c (structural_comptypes): Test dependent typedefs
194         incompatibility before testing for their main variant based
195         equivalence.
196
197 2010-04-19  Jakub Jelinek  <jakub@redhat.com>
198
199         * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
200         ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
201
202 2010-04-18  Eric Botcazou  <ebotcazou@adacore.com>
203
204         * decl.c (cxx_init_decl_processing): Remove second argument in call to
205         build_common_tree_nodes.
206
207 2010-04-14  Jason Merrill  <jason@redhat.com>
208
209         PR c++/36625
210         * parser.c (cp_parser_parenthesized_expression_list): Change
211         is_attribute_list parm to int to indicate whether or not to
212         handle initial identifier specially.
213         (cp_parser_attribute_list): Use attribute_takes_identifier_p.
214
215 2010-04-13  Jason Merrill  <jason@redhat.com>
216
217         * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
218         CLASS_TYPE_P.
219         * parser.c (cp_parser_lambda_expression): Complain about lambda in
220         unevaluated context.
221         * pt.c (iterative_hash_template_arg): Don't crash on lambda.
222
223 2010-04-12  Jason Merrill  <jason@redhat.com>
224
225         PR c++/43641
226         * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
227         return value directly.
228
229         * call.c (type_decays_to): Call cv_unqualified for non-class type.
230
231 2010-04-12  Fabien Chene  <fabien.chene@gmail.com>
232
233         PR c++/25811
234         * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
235         * init.c (build_new_1): Check for uninitialized const members and
236         uninitialized reference members, when using new without
237         new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
238         (diagnose_uninitialized_cst_or_ref_member): Define, call
239         diagnose_uninitialized_cst_or_ref_member_1.
240         (diagnose_uninitialized_cst_or_ref_member_1): New function.
241
242 2010-04-12  Richard Guenther  <rguenther@suse.de>
243
244         PR c++/43611
245         * semantics.c (expand_or_defer_fn_1): Do not keep extern
246         template inline functions.
247
248 2010-04-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
249
250         PR c++/28584
251         * typeck.c (cp_build_c_cast): Warn for casting integer to larger
252         pointer type.
253
254 2010-04-07  Jason Merrill  <jason@redhat.com>
255
256         PR c++/43016
257         * decl.c (start_preparsed_function): Do defer nested functions.
258
259         PR c++/11094, DR 408
260         * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
261         * decl2.c (finish_static_data_member_decl): Set it.
262         * decl.c (duplicate_decls): Propagate it.
263         * pt.c (tsubst_decl): Don't substitute the domain of an array
264         VAR_DECL if it's set.
265         (regenerate_decl_from_template): Substitute it here.
266         (type_dependent_expression_p): Return true if it's set.
267         * semantics.c (finish_decltype_type): Instantiate such a variable.
268         * typeck.c (cxx_sizeof_expr): Likewise.
269         (strip_array_domain): New.
270
271         PR c++/43145
272         * name-lookup.c (current_decl_namespace): Non-static.
273         (pop_nested_namespace): Sanity check.
274         * cp-tree.h: Declare current_decl_namespace.
275         * decl.c (grokvardecl): Use it instead of current_namespace.
276         (grokfndecl): Likewise.
277
278         PR c++/38392
279         * pt.c (tsubst_friend_function): Instatiate a friend that has already
280         been used.
281
282         * pt.c (print_template_statistics): New.
283         * cp-tree.h: Declare it.
284         * tree.c (cxx_print_statistics): Call it.
285
286         PR c++/41970
287         * decl.c (grokvardecl): Tweak warning message.
288         (grokfndecl): Likewise.
289
290 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
291
292         PR c++/42697
293         *pt.c (tsubst_decl): Get the arguments of a specialization from
294         the specialization template, not from the most general template.
295
296 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
297
298         PR c++/40239
299         * typeck2.c (process_init_constructor_record):
300         value-initialize members that are are not explicitely
301         initialized.
302
303 2010-04-07  Jie Zhang  <jie@codesourcery.com>
304
305         PR c++/42556
306         * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
307         when all of its elements are non-constant and have been split out.
308
309 2010-04-06  Taras Glek  <taras@mozilla.com>
310             Jason Merrill  <jason@redhat.com>
311
312         * parser.c (cp_parser_class_specifier): Set class location to that
313         of IDENTIFIER_NODE instead of '{' when possible.
314         * semantics.c (begin_class_definition): Do not overide locations
315         with less precise ones.
316
317 2010-04-06  Jason Merrill  <jason@redhat.com>
318
319         PR c++/43648
320         * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
321
322         PR c++/43621
323         * pt.c (maybe_update_decl_type): Check the return value from
324         push_scope.
325
326 2010-04-01  Jason Merrill  <jason@redhat.com>
327
328         * decl.c (next_initializable_field): No longer static.
329         * cp-tree.h: Declare it.
330         * call.c (build_aggr_conv): Fail if there are more initializers
331         than initializable fields.
332
333         * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
334         instead of void_zero_node.
335
336 2010-03-31  Dodji Seketeli  <dodji@redhat.com>
337
338         PR c++/43558
339         * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
340         * pt.c (end_template_parm_list): Store sibling template parms of
341         each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
342         (push_template_decl_real): Don't store the containing template decl
343         into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
344         * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
345         of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
346         Simplify the logic.
347
348 2010-03-30  Jason Merrill  <jason@redhat.com>
349
350         PR c++/43076
351         * pt.c (push_template_decl_real): Deal better with running out of
352         scopes before running out of template parms.
353
354         PR c++/41185
355         PR c++/41786
356         * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
357         function parameter context.  Don't print an error if parsing
358         tentatively.
359
360         PR c++/43559
361         * pt.c (more_specialized_fn): Don't control cv-qualifier check
362         with same_type_p.
363
364 2010-03-26  Jason Merrill  <jason@redhat.com>
365
366         PR c++/43509
367         * parser.c (cp_parser_qualifying_entity): Do accept enum names in
368         c++0x mode, but not other type-names.
369
370 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
371
372         PR c++/43327
373         * pt.c (add_to_template_args): Support NULL ARGS;
374         (most_specialized_class): call coerce_template_parms on
375         template arguments passed to get_class_bindings. Use
376         add_to_template_args.
377         (unify): Handle VAR_DECLs.
378
379 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
380
381         * cp-tree.h (get_template_parms_at_level): Change unsigned parm
382         into int.
383         * pt.c (get_template_parms_at_level): Adjust.
384
385 2010-03-25  Dodji Seketeli  <dodji@redhat.com>
386
387         PR c++/43206
388         * cp-tree.h (get_template_parms_at_level): Declare ...
389         * pt.c (get_template_parms_at_level): ... new function.
390         * typeck.c (get_template_parms_of_dependent_type): If a template
391         type parm's DECL_CONTEXT isn't yet set, get its siblings from
392         current_template_parms. Use get_template_parms_at_level. Remove
393         useless test.
394         (incompatible_dependent_types_p): If we get empty parms from just one
395         of the template type parms we are comparing then the template parms are
396         incompatible.
397
398 2010-03-24  Jason Merrill  <jason@redhat.com>
399
400         PR c++/43502
401         * parser.c (make_declarator): Initialize id_loc.
402         (cp_parser_lambda_declarator_opt): And set it.
403
404 2010-03-23  Jason Merrill  <jason@redhat.com>
405
406         Make lambda conversion op and op() non-static.
407         * semantics.c (maybe_add_lambda_conv_op): Make non-static.
408         Also add the thunk function returned by the conversion op.
409         Mark the conversion deleted if the op() is variadic.
410         * decl2.c (mark_used): Give helpful message about deleted conversion.
411         * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
412         * semantics.c (finish_this_expr): Adjust.
413         * mangle.c (write_closure_type_name): Adjust.
414         * decl.c (grok_op_properties): Don't allow it.
415         * call.c (build_user_type_conversion_1): No static conversion ops.
416         (build_op_call): Or op().
417
418         * decl2.c (change_return_type): Fix 'this' quals.
419
420 2010-03-22  Jason Merrill  <jason@redhat.com>
421
422         PR c++/43333
423         * tree.c (pod_type_p): Use old meaning in C++98 mode.
424
425         PR c++/43281
426         * pt.c (contains_auto_r): New fn.
427         (do_auto_deduction): Use it.
428         (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
429
430 2010-03-20  Simon Martin  <simartin@users.sourceforge.net>
431
432         PR c++/43081:
433         * decl2.c (grokfield): Handle invalid initializers for member
434         functions.
435
436 2010-03-20  Dodji Seketeli  <dodji@redhat.com>
437
438         PR c++/43375
439         * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
440         is NULL.
441         * decl2.c (vague_linkage_p): Likewise.
442
443 2010-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
444
445         PR c++/43418
446         * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
447         false, in the cp_parser_expression_statement call.
448
449 2010-03-05  Jason Merrill  <jason@redhat.com>
450
451         * mangle.c (mangle_decl): Give name collision error even without
452         ASM_OUTPUT_DEF.
453
454 2010-03-04  Marco Poletti  <poletti.marco@gmail.com>
455
456         * pt.c (process_partial_specialization): Use error_n instead of
457         error.
458
459 2010-03-03  Jason Merrill  <jason@redhat.com>
460
461         PR c++/12909
462         * mangle.c (mangle_decl): Handle VAR_DECL, too.
463
464 2010-03-03  Jason Merrill  <jason@redhat.com>
465
466         PR c++/12909
467         * mangle.c: Include cgraph.h.
468         (mangle_decl): If the mangled name will change in a later
469         ABI version, make the later mangled name an alias.
470         * method.c (make_alias_for): Copy DECL_ARGUMENTS.
471         * Make-lang.in (mangle.o): Depend on cgraph.h.
472         * method.c (make_alias_for): Handle VAR_DECL, too.
473         * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
474         * tree.c (no_linkage_check): Adjust.
475         * decl.c (maybe_commonize_var): Adjust.
476         * cp-tree.h: Adjust.
477
478 2010-03-01  Marco Poletti  <poletti.marco@gmail.com>
479
480         * pt.c (redeclare_class_template): Use error_n and inform_n.
481
482 2010-02-27  Mark Mitchell  <mark@codesourcery.com>
483
484         PR c++/42748
485         * cp-tree.h (push_tinst_level): Declare.
486         (pop_tinst_level): Likewise.
487         * pt.c (push_tinst_level): Give it external linkage.
488         (pop_tinst_level): Likewise.
489         * mangle.c (mangle_decl_string): Set the source location to that
490         of the decl while mangling.
491
492 2010-02-27  Simon Martin  <simartin@users.sourceforge.net>
493
494         PR c++/42054
495         * pt.c (redeclare_class_template): Return false if there are erroneous
496         template parameters.
497
498 2010-02-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
499
500         * pt.c (push_tinst_level): Replace -ftemplate-depth- with 
501         -ftemplate-depth=.
502
503 2010-02-24  Jason Merrill  <jason@redhat.com>
504
505         PR c++/12909
506         * mangle.c (write_type): Give -Wabi warning for old vector mangling.
507
508         * class.c (layout_class_type): Don't give -Wabi warning for a bug
509         in a previous ABI version.
510
511 2010-02-23  Jason Merrill  <jason@redhat.com>
512
513         PR c++/43143
514         * typeck2.c (digest_init_r): Accept value init of array.
515
516 2010-02-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>
517
518         PR c++/43126
519         * typeck.c (convert_arguments): Update error message.
520
521 2010-02-22  Mike Stump  <mikestump@comcast.net>
522
523         PR c++/43125
524         * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
525
526 2010-02-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
527
528         PR c++/23510
529         * error.c (print_instantiation_partial_context_line): New.
530         (print_instantiation_partial_context): Print at most 12 contexts,
531         skip the rest with a message.
532
533 2010-02-21  Dodji Seketeli  <dodji@redhat.com>
534
535         PR c++/42824
536         * pt.c (lookup_template_class): Better support of specialization
537         of member of class template implicit instantiation.
538
539 2010-02-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
540
541         PR c++/35669
542         * call.c (conversion_null_warnings): Replace -Wconversion with
543         -Wconversion-null.
544         * cvt.c (build_expr_type_conversion): Likewise.
545
546 2010-02-18  Jason Merrill  <jason@redhat.com>
547
548         PR c++/42837
549         * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
550
551         PR c++/43108
552         * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
553         C build_binary_op.
554         * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
555         * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
556
557         PR c++/43070
558         * semantics.c (finish_goto_stmt): Don't call decay_conversion.
559
560         PR c++/26261
561         PR c++/43101
562         * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
563         (maybe_update_decl_type): New fn.
564         * parser.c (cp_parser_init_declarator): Use it.
565
566         PR c++/43109
567         * semantics.c (begin_class_definition): Don't crash on unnamed ns.
568
569 2010-02-17  Jason Merrill  <jason@redhat.com>
570
571         PR c++/43075
572         * call.c (build_over_call): Don't create zero-sized assignments.
573         * cp-gimplify.c (cp_genericize_r): Don't remove them here.
574         * cp-objcp-common.c (cp_expr_size): Remove.
575         * cp-tree.h: Remove prototype.
576
577         PR c++/43069
578         * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
579         decl we looked up doesn't match.
580
581         PR c++/43093
582         * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
583         have an INIT_EXPR anymore.
584
585         PR c++/43079
586         * pt.c (convert_nontype_argument): Change assert to test.
587
588 2010-02-16  Jason Merrill  <jason@redhat.com>
589
590         * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
591
592         PR c++/43031
593         * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
594         VIEW_CONVERT_EXPR for conversions between structural equality types
595         that the back end can't tell are the same.
596
597         PR c++/43036
598         * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
599         cv-quals from element here.
600         (cp_build_qualified_type_real): Not here.  Preserve typedef name.
601
602 2010-02-14  Jason Merrill  <jason@redhat.com>
603
604         PR c++/41997
605         * semantics.c (finish_compound_literal): Use
606         cp_apply_type_quals_to_decl when creating a static variable.
607
608 2010-02-12  Jason Merrill  <jason@redhat.com>
609
610         PR c++/43024
611         * name-lookup.h (current_binding_level): Check for null
612         cp_function_chain.
613
614 2010-02-12  Jason Merrill  <jason@redhat.com>
615
616         PR c++/43054
617         * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
618
619 2010-02-12  Jakub Jelinek  <jakub@redhat.com>
620
621         PR c++/43033
622         * name-lookup.c (pushdecl_maybe_friend): Check default args of t
623         instead of x.
624
625 2010-02-10  Jason Merrill  <jason@redhat.com>
626
627         PR c++/41896
628         * semantics.c (outer_lambda_capture_p): Revert.
629         (add_capture): Only finish_member_declaration if
630         we're in the lambda class.
631         (register_capture_members): New.
632         * cp-tree.h: Declare it.
633         * parser.c (cp_parser_lambda_expression): Call it.
634
635 2010-02-10  Jason Merrill  <jason@redhat.com>
636
637         PR c++/41896
638         * semantics.c (outer_lambda_capture_p): Use current_function_decl
639         instead of current_class_type.
640
641 2010-02-10  Jason Merrill  <jason@redhat.com>
642
643         PR c++/42983, core issue 906
644         * method.c (defaultable_fn_check): Check virtualness.
645
646 2010-02-10  Jason Merrill  <jason@redhat.com>
647
648         PR c++/43016
649         * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
650
651 2010-02-10  Shujing Zhao  <pearly.zhao@oracle.com>
652
653         * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
654         * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
655         translation.
656         * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
657         (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
658         (cp_parser_parameter_declaration)
659         (cp_parser_exception_specification_opt)
660         (cp_parser_exception_declaration): Likewise.
661         * pt.c (check_default_tmpl_args): Likewise.
662         * search.c (lookup_field_r): Likewise.
663
664 2010-02-09  Jason Merrill  <jason@redhat.com>
665
666         PR c++/42399
667         * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
668
669 2010-02-09  Jason Merrill  <jason@redhat.com>
670
671         PR c++/42370
672         * decl2.c (change_return_type): New fn.
673         * semantics.c (apply_lambda_return_type): Use it.
674         * cp-tree.h: Declare it.
675
676 2010-02-05  Richard Guenther  <rguenther@suse.de>
677
678         * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
679         * cp-lang.c: Include gt-cp-cp-lang.h.
680         * config-lang.in (gtfiles): Add cp/cp-lang.c.
681
682 2010-02-05  Dodji Seketeli  <dodji@redhat.com>
683
684         PR c++/42915
685         * typeck.c (get_template_parms_of_dependent_type): Try getting
686         the template parameters fromt the type itself first.
687
688 2010-02-03  Jason Merrill  <jason@redhat.com>
689
690         PR c++/4926
691         PR c++/38600
692         * mangle.c (write_unqualified_id): Split out from write_expression.
693         (write_unqualified_name): Call it.
694         (write_member_name): Likewise.
695         (write_expression): Support TEMPLATE_ID_EXPR.
696         Disambiguate operator names.
697
698         PR c++/12909
699         * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
700         -fabi-version=4.
701
702 2010-02-02  Jason Merrill  <jason@redhat.com>
703
704         PR c++/41090
705         * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
706         * optimize.c (clone_body): Remap their initializers when making base
707         variants.
708         (maybe_clone_body): Complain if multiple clones aren't safe.
709
710 2010-01-29  Dodji Seketeli  <dodji@redhat.com>
711
712         PR c++/42758
713         PR c++/42634
714         PR c++/42336
715         PR c++/42797
716         PR c++/42880
717         * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
718         SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
719         GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
720         * pt.c (coerce_template_parms, type_unification_real,
721         expand_template_argument_pack, coerce_template_parameter_pack):
722         Set the non default template args count.
723         (current_template_args): Always set non defaulted
724         template args count when compiled with --enable-checking
725         (tsubst_template_args, type_unification_real): Propagate the non
726         defaulted template args count.
727         * error.c (get_non_default_template_args_count): Renamed
728         count_non_default_template_args into this. Don't calculate the
729         non default template argument count anymore. Use the new
730         accessor macros above to get it.
731         (dump_template_argument_list, dump_type, dump_decl,
732         dump_template_parms): Adjust.
733         * parser.c (cp_parser_template_argument_list): Always set defaulted
734         template args count when compiled with --enable-checking.
735
736 2010-01-29  Shujing Zhao  <pearly.zhao@oracle.com>
737
738         * decl.c (redeclaration_error_message): Wrap the return messages into
739         G_() for easy translation.
740
741 2010-01-28  Jason Merrill  <jason@redhat.com>
742
743         PR c++/42880
744         * semantics.c (begin_class_definition): Don't use type_as_string.
745
746 2010-01-28  Dodji Seketeli  <dodji@redhat.com>
747
748         PR c++/42713
749         PR c++/42820
750         * typeck.c (get_template_parms_of_dependent_type): Factorized
751         this out of incompatible_template_type_parms_p
752         (incompatible_dependent_types_p): Renamed
753         incompatible_template_type_parms_p into this. Make it detect
754         two incompatible dependent typedefs too.
755         (structural_comptypes): Use incompatible_dependent_types_p.
756         * pt.c (get_template_info):
757         Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
758
759 2010-01-20  Janis Johnson  <janis187@us.ibm.com>
760             Jason Merrill  <jason@redhat.com>
761
762         * mangle.c (write_type): Mangle transparent record as member type.
763         * semantics.c (begin_class_definition): Recognize decimal classes
764         and set TYPE_TRANSPARENT_AGGR.
765
766 2010-01-20  Jason Merrill  <jason@redhat.com>
767
768         PR c++/42338
769         * mangle.c (write_expression): Handle tree codes that have extra
770         arguments in the middle-end.
771
772 2010-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
773
774         PR c++/42038
775         * except.c (expand_start_catch_block): Deal correctly with
776         do_begin_catch returning error_mark_node.
777
778 2010-01-20  Jason Merrill  <jason@redhat.com>
779
780         PR c++/41788
781         * class.c (layout_class_type): Set packed_maybe_necessary for packed
782         non-PODs.
783
784         PR c++/41920
785         * semantics.c (build_lambda_object): Call mark_used on captured
786         variables.
787
788         PR c++/40750
789         * decl.c (grokdeclarator): Clear type_quals for a member function
790         declared using a typedef.  Don't complain about adding cv-quals
791         to a function typedef in C++0x mode.
792
793 2010-01-20  Jakub Jelinek  <jakub@redhat.com>
794
795         * decl.c (create_array_type_for_decl): Remove set but not used
796         variable error_msg.  Remove break stmts after return stmts.
797
798 2010-01-19  Dodji Seketeli  <dodji@redhat.com>
799
800         * error.c (dump_template_parms, count_non_default_template_args):
801         Revert fix of PR c++/42634.
802
803 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
804
805         PR c++/42634
806         * error.c (dump_template_parms): Use innermost template
807         arguments before calling count_non_default_template_args.
808         (count_non_default_template_args): We are being called with
809         template innermost arguments now. There is no need to ensure
810         that again.
811
812 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
813
814         PR c++/42766
815         * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
816
817 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
818
819         PR c++/42697
820         *pt.c (tsubst_decl):  Revert commit for PR c++/42697.
821
822 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
823
824         PR c++/42697
825         *pt.c (tsubst_decl): Get the arguments of a specialization from
826         the specialization template, not from the most general template.
827
828 2010-01-16  Jason Merrill  <jason@redhat.com>
829
830         PR c++/42761
831         * semantics.c (finish_decltype_type): Within a template, treat
832         unresolved CALL_EXPR as dependent.
833
834 2010-01-15  Dodji Seketeli  <dodji@redhat.com>
835
836         * error.c (dump_template_parms,count_non_default_template_args):
837         Revert changes of PR c++/42634.
838
839 2010-01-14  Jakub Jelinek  <jakub@redhat.com>
840
841         PR middle-end/42674
842         * decl.c (finish_function): Don't emit -Wreturn-type warnings in
843         functions with noreturn attribute.
844
845 2010-01-14  Jason Merrill  <jason@redhat.com>
846
847         PR c++/42701
848         * call.c (build_new_method_call): Don't free the vec here.
849
850         PR c++/42655
851         * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
852
853 2010-01-13  Dodji Seketeli  <dodji@redhat.com>
854
855         PR c++/42634
856         * error.c (dump_template_parms): Use innermost template
857         arguments before calling count_non_default_template_args.
858         (count_non_default_template_args): We are being called with
859         template innermost arguments now. There is no need to ensure
860         that again.
861
862 2010-01-07  Dodji Seketeli  <dodji@redhat.com>
863
864         c++/40155
865         * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
866         arguments that were previously deduced.
867
868 2010-01-05  Jason Merrill  <jason@redhat.com>
869
870         * pt.c (unify_pack_expansion): Handle deduction from init-list.
871         * call.c (build_over_call): Don't complain about it.
872
873 2010-01-04  Jason Merrill  <jason@redhat.com>
874
875         PR c++/42555
876         * pt.c (tsubst_decl): Don't apply type attributes in place.
877
878         PR c++/42567
879         * semantics.c (describable_type): Remove decltype comment and
880         semantics.
881
882
883 \f
884 Copyright (C) 2010 Free Software Foundation, Inc.
885
886 Copying and distribution of this file, with or without modification,
887 are permitted in any medium without royalty provided the copyright
888 notice and this notice are preserved.