OSDN Git Service

a27488a7936bb68b482436a198143dd7979d73f6
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2014-02-21  Jason Merrill  <jason@redhat.com>
2
3         PR c++/60248
4         * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
5
6 2014-02-20  Kai Tietz  <ktietz@redhat.com>
7
8         PR c++/58873
9         * parser.c (cp_parser_functional_cast): Treat NULL_TREE
10         valued type argument as error_mark_node.
11
12         PR c++/58835
13         * semantics.c (finish_fname): Handle error_mark_node.
14
15 2014-02-19  Jason Merrill  <jason@redhat.com>
16
17         PR c++/60046
18         * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
19         spec from template context.
20
21 2014-01-31  Jason Merrill  <jason@redhat.com>
22
23         PR c++/57043
24         * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
25         during partial ordering.
26
27 2014-01-27  Jason Merrill  <jason@redhat.com>
28
29         PR c++/54652
30         * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
31
32         PR c++/58639
33         * call.c (build_aggr_conv): Reject value-initialization of reference.
34
35 2013-10-25  Tom de Vries  <tom@codesourcery.com>
36
37         PR c++/58282
38         * except.c (build_must_not_throw_expr): Handle
39         flag_exceptions.
40
41 2013-10-16  Paolo Carlini  <paolo.carlini@oracle.com>
42
43         PR c++/58633
44         * parser.c (cp_parser_pseudo_destructor_name): Revert r174385 changes.
45
46 2013-09-13  Jason Merrill  <jason@redhat.com>
47
48         PR c++/58273
49         * pt.c (any_type_dependent_elements_p): Actually check for
50         type-dependence, not value-dependence.
51
52 2013-08-20  Jason Merrill  <jason@redhat.com>
53
54         PR c++/58119
55         * cp-tree.h (WILDCARD_TYPE_P): Split out from...
56         (MAYBE_CLASS_TYPE_P): ...here.
57         * cvt.c (build_expr_type_conversion): Don't complain about a
58         template that can't match the desired type category.
59
60 2012-12-03  Paolo Carlini  <paolo.carlini@oracle.com>
61
62         PR c++/54170
63         * cvt.c (cp_convert_to_pointer): Don't discard side-effects from
64         expressions of nullptr_t.
65         * typeck.c (build_ptrmemfunc): Likewise.
66
67 2013-07-09  Jason Merrill  <jason@redhat.com>
68
69         PR c++/57437
70         * typeck.c (check_return_expr): Lambda proxies aren't eligible
71         for nrv or return by move.
72
73         PR c++/57545
74         * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
75         argument to have the exact type of the parameter.
76
77         PR c++/57551
78         * semantics.c (cxx_eval_indirect_ref): Don't try to look through
79         a POINTER_PLUS_EXPR for type punning diagnostic.
80
81         PR c++/57831
82         * pt.c (tsubst_copy): Handle USING_DECL.
83
84 2013-05-20  Jason Merrill  <jason@redhat.com>
85
86         PR c++/57325
87         * tree.c (build_cplus_array_type): Copy layout info if element
88         type is complete.
89
90 2013-05-09  Jason Merrill  <jason@redhat.com>
91
92         PR c++/57047
93         * semantics.c (cxx_fold_indirect_ref): Fix thinko.
94
95 2013-04-21  Eric Botcazou  <ebotcazou@adacore.com>
96
97         * parser.c (cp_parser_late_return_type_opt): Fix C++ism.
98
99 2013-04-15  Jason Merrill  <jason@redhat.com>
100
101         PR c++/56388
102         * semantics.c (insert_capture_proxy): Just use index 1 in the
103         stmt_list_stack.
104
105 2013-04-11  Release Manager
106
107         * GCC 4.7.3 released.
108
109 2013-04-03  Jakub Jelinek  <jakub@redhat.com>
110
111         PR debug/56819
112         * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
113         from args to new_args.
114         (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
115         r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
116
117 2013-04-01  Jason Merrill  <jason@redhat.com>
118
119         PR c++/56794
120         * parser.c (cp_parser_range_for): Don't try to do auto deduction
121         in a template if the type of the range is incomplete.
122
123 2013-03-29  Jason Merrill  <jason@redhat.com>
124
125         PR c++/56774
126         PR c++/35722
127         * pt.c (unify_pack_expansion): Fix indexing.
128
129 2013-03-23  Jason Merrill  <jason@redhat.com>
130
131         PR c++/54277
132         * semantics.c (lambda_capture_field_type): Don't build a
133         magic decltype for pointer types.
134         (lambda_proxy_type): Likewise.
135         (finish_non_static_data_member): Get the quals from
136         the object.
137
138 2013-03-20  Jason Merrill  <jason@redhat.com>
139
140         PR c++/56646
141         * parser.c (cp_parser_late_return_type_opt): Save and restore
142         current_class_ptr/ref.
143
144 2013-03-14  Jason Merrill  <jason@redhat.com>
145
146         PR c++/56614
147         * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
148
149 2013-03-14  Jakub Jelinek  <jakub@redhat.com>
150
151         PR c++/56403
152         * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
153         of CLASS_TYPE_P.
154
155 2013-03-09  Paolo Carlini  <paolo.carlini@oracle.com>
156
157         PR c++/56534
158         * parser.c (cp_parser_elaborated_type_specifier): Don't call
159         check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
160         * decl.c (check_elaborated_type_specifier): Tidy.
161
162 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
163
164         PR c++/56543
165         * tree.c (strip_typedefs): Don't copy args if they are NULL.
166
167 2013-02-22  Jason Merrill  <jason@redhat.com>
168
169         PR c++/40405
170         * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
171         if we got the wrong number of template parms.
172
173         PR c++/56395
174         * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
175         args.
176
177 2013-02-19  Jakub Jelinek  <jakub@redhat.com>
178
179         Backported from mainline
180         2013-02-07  Jakub Jelinek  <jakub@redhat.com>
181
182         PR c++/56241
183         * init.c (build_vec_init): Don't append NULL values into new_vec.
184         (build_zero_init_1): Don't push anything into v if recursive call
185         returned NULL_TREE.
186         (build_value_init_noctor): Don't push anything into v if
187         build_value_init call returned NULL_TREE.
188
189         PR c++/56239
190         * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
191         (cp_parser_tokens_start_cast_expression): ... this.  Change parameter
192         to cp_parser *, call cp_lexer_peek_token first.  For CPP_OPEN_PAREN,
193         return true only if 2nd token isn't CPP_CLOSE_PAREN.
194         (cp_parser_cast_expression): Adjust caller.
195
196         PR c++/56237
197         * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
198         only if DECL_DISCRIMINATOR_SET_P (t) rather than just
199         DECL_LANG_SPECIFIC (t).
200
201 2013-02-15  Jason Merrill  <jason@redhat.com>
202
203         PR c++/54276
204         * semantics.c (finish_id_expression): Also return the identifier
205         for an outer local static.
206
207         PR c++/52026
208         * semantics.c (finish_id_expression): In a template, return
209         the identifier for a constant variable.
210
211         PR c++/55710
212         * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
213         TREE_USED.
214
215         PR c++/56135
216         * pt.c (tsubst_copy_and_build): Don't forget any new
217         captures that arose from use of dependent names.
218
219 2013-02-12  Jason Merrill  <jason@redhat.com>
220
221         PR c++/56291
222         * semantics.c (sort_constexpr_mem_initializers): Handle
223         vptr out of order.
224
225 2013-02-11  Jason Merrill  <jason@redhat.com>
226
227         PR c++/56268
228         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
229         maybe_instantiate_noexcept.
230
231 2013-02-09  Jason Merrill  <jason@redhat.com>
232
233         PR c++/56247
234         * pt.c (eq_specializations): Set comparing_specializations.
235         * tree.c (cp_tree_equal): Check it.
236         * cp-tree.h: Declare it.
237
238 2013-02-05  Jason Merrill  <jason@redhat.com>
239
240         PR c++/54122
241         * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
242         METHOD_TYPE.
243
244 2013-02-01  Jakub Jelinek  <jakub@redhat.com>
245
246         Backported from mainline
247         2012-12-13  Jakub Jelinek  <jakub@redhat.com>
248
249         PR c++/55652
250         * typeck2.c (merge_exception_specifiers): Don't call operand_equal_p
251         if noex is NULL.
252
253         2012-12-06  Jakub Jelinek  <jakub@redhat.com>
254
255         PR c++/54207
256         * except.c (build_noexcept_spec): Avoid direct comparison
257         with boolean_true_node or boolean_false_node, instead use
258         operand_equal_p and/or INTEGER_CST check.
259         * pt.c (tsubst_exception_specification): Likewise.
260         * typeck2.c (merge_exception_specifiers): Likewise.
261
262         2012-12-01  Jakub Jelinek  <jakub@redhat.com>
263
264         PR c++/55542
265         * pt.c (make_ith_pack_parameter_name): Return NULL if
266         name is NULL.
267         (tsubst_decl): Call make_ith_pack_parameter_name even if
268         DECL_NAME is NULL.
269
270         2012-11-23  Jakub Jelinek  <jakub@redhat.com>
271
272         PR c++/54046
273         * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine.
274         * cp-objcp-common.c (cxx_block_may_fallthru): New function.
275         * cp-tree.h (cxx_block_may_fallthru): New prototype.
276
277 2013-01-25  Jason Merrill  <jason@redhat.com>
278
279         PR c++/56104
280         * typeck.c (get_member_function_from_ptrfunc): Don't fold
281         POINTER_PLUS_EXPR.
282
283 2013-01-22  Jason Merrill  <jason@redhat.com>
284
285         * call.c (type_has_extended_temps): Fix C++ism.
286
287         PR c++/53650
288         * call.c (type_has_extended_temps): New.
289         * cp-tree.h: Declare it.
290         * decl.c (check_initializer): Use build_aggr_init for arrays
291         if it is false.
292         * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
293
294         PR c++/56071
295         * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
296
297 2013-01-21  Jason Merrill  <jason@redhat.com>
298
299         PR c++/56059
300         * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
301         template args count.
302
303 2013-01-09  Jason Merrill  <jason@redhat.com>
304
305         PR c++/55893
306         * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
307         needs destruction.
308
309 2013-01-08  Joel Brobecker  <brobecker@adacore.com>
310
311         * parser.c (cp_parser_initializer_list): Move declaration
312         of variable non_const to start of lexical block.
313
314 2013-01-04  Jason Merrill  <jason@redhat.com>
315
316         PR c++/55877
317         * decl.c (reset_type_linkage, bt_reset_linkage): New.
318         (grokdeclarator): Use reset_type_linkage.
319         * name-lookup.c (binding_table_foreach): Handle null table.
320         * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
321
322 2013-01-03  Jason Merrill  <jason@redhat.com>
323
324         PR c++/55419
325         PR c++/55753
326         * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
327         TREE_CONSTANT.
328
329         PR c++/55842
330         * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
331
332         PR c++/55856
333         * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
334
335 2013-01-02  Jason Merrill  <jason@redhat.com>
336
337         PR c++/54325
338         * call.c (build_new_method_call_1): Don't use build_value_init for
339         user-provided default constructors.
340
341         PR c++/55032
342         PR c++/55245
343         * tree.c (build_cplus_array_type): Copy layout information
344         to main variant if necessary.
345
346 2012-12-19  Jason Merrill  <jason@redhat.com>
347
348         PR c++/55724
349         * pt.c (type_unification_real): Re-combine post-deduction loops.
350
351 2012-12-11  Jason Merrill  <jason@redhat.com>
352
353         PR c++/54883
354         * decl2.c (min_vis_r): Handle anon visibility for enums.
355
356 2012-12-11  Jakub Jelinek  <jakub@redhat.com>
357
358         PR c++/55643
359         * expr.c (mark_exp_read): Handle FLOAT_EXPR similarly to NOP_EXPR.
360
361 2012-12-07  Jason Merrill  <jason@redhat.com>
362
363         PR c++/55419
364         * tree.c (build_target_expr): Don't set TREE_CONSTANT.
365
366 2012-12-07  Matthias Klose  <doko@ubuntu.com>
367
368         * tree.c (build_aggr_init_expr): Add parameter name, mark as unused.
369
370 2012-12-06  Jason Merrill  <jason@redhat.com>
371
372         PR c++/54325
373         * tree.c (build_aggr_init_expr): Don't check for abstract class.
374         (build_cplus_new): Check here instead.
375
376         PR c++/55058
377         * pt.c (tsubst): Keep the quals when looking through a typedef.
378
379         PR c++/55249
380         * tree.c (build_vec_init_elt): Use the type of the initializer.
381
382         PR c++/54744
383         * pt.c (resolve_typename_type): Check TYPENAME_IS_RESOLVING_P on scope.
384
385         PR c++/54947
386         * parser.c (cp_parser_initializer_list): Don't require an
387         expression in [] to be constant until we know it's a C99
388         designator.
389
390         PR c++/55015
391         PR c++/53821
392         * semantics.c (maybe_add_lambda_conv_op): Revert earlier change.
393         * decl.c (start_preparsed_function): Make local class methods comdat
394         in templates, too.
395
396 2012-11-29  Jason Merrill  <jason@redhat.com>
397
398         PR c++/53137
399         * pt.c (tsubst_expr) [DECL_EXPR]: Set LAMBDA_EXPR_THIS_CAPTURE here.
400         (tsubst_copy_and_build) [LAMBDA_EXPR]: And clear it here.
401         (instantiate_class_template_1): Not here.
402
403         PR c++/53862
404         * pt.c (tsubst_arg_types): Add "end" parameter.
405         (check_undeduced_parms): Use it.
406
407         PR c++/53039
408         * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
409         cp_tree_equal.
410
411         * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
412         (struct template_parm_index_s): Remove num_siblings.
413         * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
414         (fixup_template_type_parm_type): Remove.
415         (build_template_parm_index): Remove num_siblings parm.
416         (process_template_parm): Likewise.
417         * parser.c (cp_parser_template_parameter_list): Adjust.
418         * tree.c (cp_tree_equal): Don't compare num_siblings.
419         * typeck.c (comp_template_parms_position): Likewise.
420
421         PR c++/50852
422         PR c++/53039
423         * tree.c (strip_typedefs_expr): New.
424         * cp-tree.h: Declare it.
425         * pt.c (convert_template_argument, unify): Use it.
426         * parser.c (cp_parser_template_declaration_after_export): Don't call
427         fixup_template_parms.
428
429 2012-11-29  Kai Tietz  <ktietz@redhat.com>
430
431         PR target/53912
432         * class.c (dump_class_hierarchy_r): Cast from pointer via uintptr_t.
433         (dump_vtable): Likewise.
434
435 2012-11-24  Paolo Carlini  <paolo.carlini@oracle.com>
436
437         PR c++/55446
438         * init.c (build_vec_init): Do not early return error_mark_mode
439         when integer_all_onesp (maxindex).
440
441 2012-11-05  Jakub Jelinek  <jakub@redhat.com>
442
443         Backported from mainline
444         2012-10-23  Jakub Jelinek  <jakub@redhat.com>
445
446         PR c++/54988
447         * decl2.c (cplus_decl_attributes): Don't return early
448         if attributes is NULL.
449
450 2012-10-26  Paolo Carlini  <paolo.carlini@oracle.com>
451
452         PR c++/54984
453         * init.c (build_new): Don't turn a null *init into a pointer to
454         empty vector orig_init.
455
456 2012-10-08  Jakub Jelinek  <jakub@redhat.com>
457
458         PR c++/54858
459         * tree.c (cp_tree_equal): Handle FIELD_DECL.
460
461 2012-10-03  Jakub Jelinek  <jakub@redhat.com>
462
463         PR c++/54777
464         * semantics.c (cxx_eval_constant_expression) <case COMPOUND_EXPR>: If
465         not ignoring the second operand, pass the original second operand
466         and not one with stripped nops to cxx_eval_constant_expression.
467
468 2012-09-20  Release Manager
469
470         * GCC 4.7.2 released.
471
472 2012-09-14  Jason Merrill  <jason@redhat.com>
473
474         PR c++/53661
475         * typeck2.c (check_narrowing): Avoid false positives on conversion
476         from enumeral type.
477
478 2012-09-13  Jason Merrill  <jason@redhat.com>
479
480         PR c++/53839
481         * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
482         address, make sure the value is constant.
483
484 2012-09-13  Jason Merrill  <jason@redhat.com>
485
486         PR c++/54511
487         * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
488
489 2012-09-13  Jason Merrill  <jason@redhat.com>
490
491         PR c++/53836
492         * pt.c (value_dependent_expression_p): A TREE_LIST initializer must
493         be dependent.
494
495 2012-09-10  Jason Merrill  <jason@redhat.com>
496
497         PR c++/54506
498         * decl.c (move_signature_fn_p): Split out from move_fn_p.
499         * method.c (process_subob_fn): Use it.
500         * cp-tree.h: Declare it.
501
502         PR c++/54341
503         PR c++/54253
504         * semantics.c (sort_constexpr_mem_initializers): New.
505         (build_constexpr_constructor_member_initializers): Use it.
506         (cx_check_missing_mem_inits): Skip artificial fields.
507         * init.c (expand_aggr_init_1): Don't zero out a class
508         with no data.
509
510         PR c++/54086
511         * decl.c (grokdeclarator): Allow const and constexpr together.
512
513 2012-08-31  Ollie Wild  <aaw@google.com>
514
515         PR c++/54197
516         * call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
517
518 2012-07-20  Jason Merrill  <jason@redhat.com>
519
520         PR c++/54038
521         * tree.c (build_cplus_array_type): Use build_cplus_array_type to build
522         canonical array type rather than mess with its TYPE_*_VARIANT.
523
524 2012-07-19  Jason Merrill  <jason@redhat.com>
525
526         PR c++/54026
527         * typeck.c (cp_apply_type_quals_to_decl): Check COMPLETE_TYPE_P.
528
529 2012-07-18  Jason Merrill  <jason@redhat.com>
530
531         * method.c (process_subob_fn): Make sure no_implicit_p is non-null
532         before trying to store through it.
533
534 2012-07-17  Jason Merrill  <jason@redhat.com>
535
536         PR c++/53995
537         * decl.c (finish_enum_value_list): Only call
538         insert_late_enum_def_into_classtype_sorted_fields in class scope.
539
540 2012-07-17  Jason Merrill  <jason@redhat.com>
541
542         PR c++/53989
543         * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
544         to the list of variants.
545
546 2012-07-17  Jason Merrill  <jason@redhat.com>
547
548         PR c++/53549
549         * parser.c (cp_parser_class_head): Call xref_basetypes here.
550         (cp_parser_class_specifier_1): Not here.
551         * pt.c (tsubst_decl) [USING_DECL]: Check uses_template_parms
552         as well as DECL_DEPENDENT_P.
553
554 2012-07-13  Jason Merrill  <jason@redhat.com>
555
556         PR c++/53953
557         * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
558
559 2012-07-10  Jason Merrill  <jason@redhat.com>
560
561         DR 1402
562         PR c++/53733
563         * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
564         (struct lang_decl_fn): Add suppress_implicit_decl field.
565         * method.c (implicitly_declare_fn): Check it.
566         (process_subob_fn): Add no_implicit_p parm.
567         (walk_field_subobs, synthesized_method_walk): Likewise.
568         (maybe_explain_implicit_delete): Adjust.
569         (explain_implicit_non_constexpr): Adjust.
570
571         * method.c (synthesized_method_walk): Cleanups don't affect the EH
572         spec either.
573
574 2012-07-02  Jason Merrill  <jason@redhat.com>
575
576         PR c++/53816
577         * class.c (resolves_to_fixed_type_p): Check uses_template_parms
578         (current_function_decl) instead of processing_template_decl.
579
580         PR c++/53821
581         * semantics.c (maybe_add_lambda_conv_op): Don't set
582         DECL_INTERFACE_KNOWN.
583
584 2012-06-27  Fabien ChĂȘne  <fabien@gcc.gnu.org>
585
586         PR c++/51214
587         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
588         Declare.
589         * class.c (insert_into_classtype_sorted_fields): New.
590         (add_enum_fields_to_record_type): New.
591         (count_fields): Adjust the comment.
592         (add_fields_to_record_type): Likewise.
593         (finish_struct_1): Move the code that inserts the fields for the
594         sorted case, into insert_into_classtype_sorted_fields, and call
595         it.
596         (insert_late_enum_def_into_classtype_sorted_fields): Define.
597         * decl.c (finish_enum_value_list): Call
598         insert_late_enum_def_into_classtype_sorted_fields if a late enum
599         definition is encountered.
600
601 2012-06-25  Jason Merrill  <jason@redhat.com>
602
603         PR c++/53498
604         PR c++/53305
605         * pt.c (tsubst_pack_expansion): Copy before dummy tsubst.
606
607         PR c++/52988
608         * typeck.c (decay_conversion): Don't discard side-effects from
609         expressions of nullptr_t.
610
611         PR c++/53202
612         * semantics.c (build_data_member_initialization): Always keep
613         initializer for empty base.
614         (cxx_eval_bare_aggregate): Discard it here.
615
616 2012-06-25  Jakub Jelinek  <jakub@redhat.com>
617
618         PR c++/53594
619         * class.c (check_bases_and_members): Avoid -Wuninitialized
620         diagnostics for non-static const members or references if they
621         use NSDMI.
622
623 2012-06-19  Jason Merrill  <jason@redhat.com>
624
625         PR c++/53651
626         * name-lookup.c (constructor_name_p): Don't try to look at the
627         name of a DECLTYPE_TYPE.
628
629         Reapply:
630         PR c++/53137
631         * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
632         (instantiate_decl): Don't push_to_top_level for local class methods.
633         (instantiate_class_template_1): Or for local classes.
634
635         PR c++/53599
636         * pt.c (lookup_template_class_1): Use ts_global.
637
638 2012-06-14  Richard Guenther  <rguenther@suse.de>
639
640         Backport from mainline
641         2012-06-11  Richard Guenther  <rguenther@suse.de>
642
643         PR c++/53616
644         * mangle.c (write_array_type): Use double-ints for array domain
645         arithmetic.
646
647 2012-06-14  Richard Guenther  <rguenther@suse.de>
648
649         Backport from mainline
650         2012-06-06  Fabien ChĂȘne  <fabien@gcc.gnu.org>
651
652         PR c++/52841
653         * parser.c (cp_parser_alias_declaration): Return earlier
654         if an error occured.
655
656 2012-06-14  Release Manager
657
658         * GCC 4.7.1 released.
659
660 2012-06-12  Jason Merrill  <jason@redhat.com>
661
662         PR c++/53599
663         Revert:
664         PR c++/53137
665         * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
666         (instantiate_decl): Don't push_to_top_level for local class methods.
667         (instantiate_class_template_1): Or for local classes.
668
669 2012-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
670
671         PR c++/53524
672         * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
673         to control enumeral mismatch in conditional expression too.
674
675 2012-06-01  Jason Merrill  <jason@redhat.com>
676
677         PR c++/52973
678         * parser.c (cp_parser_class_head): Apply attributes here.
679         * semantics.c (begin_class_definition): Not here.
680         * cp-tree.h: Adjust.
681
682         PR c++/52725
683         * parser.c (cp_parser_binary_expression): Bail early if we're parsing
684         tentatively and the LHS has a parse error.
685
686 2012-06-01  Jason Merrill  <jason@redhat.com>
687
688         PR c++/53137
689         * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
690         (instantiate_decl): Don't push_to_top_level for local class methods.
691         (instantiate_class_template_1): Or for local classes.
692
693         PR c++/53484
694         * pt.c (do_auto_deduction): Don't try to deduce from a
695         type-dependent initializer.
696
697 2012-05-31  Jason Merrill  <jason@redhat.com>
698
699         PR c++/53500
700         PR c++/52905
701         * call.c (joust): Handle comparing list and non-list ctors.
702
703 2012-05-30  Jason Merrill  <jason@redhat.com>
704
705         PR c++/53356
706         * tree.c (stabilize_init): Side effects make the init unstable.
707
708 2012-05-30  Jason Merrill  <jason@redhat.com>
709
710         PR c++/53220
711         * call.c (convert_like_real) [ck_list]: Take array address directly.
712         * typeck.c (decay_conversion): Reject decay of an array compound
713         literal.
714
715 2012-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
716
717         PR c++/53491
718         * tree.c (stabilize_expr): Handle exp of void type.
719
720 2012-05-28  Paolo Carlini  <paolo.carlini@oracle.com>
721
722         PR c++/53503
723         * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
724
725 2012-05-15  Alexandre Oliva  <aoliva@redhat.com>
726
727         PR c++/53209
728         * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
729
730 2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
731
732         PR c++/53301
733         * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
734         instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
735
736 2012-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
737
738         PR c++/53186
739         * call.c (build_over_call): Handle final member functions
740         and class types.
741         (build_new_method_call_1): Do not handle here.
742
743 2012-04-17  Paolo Carlini  <paolo.carlini@oracle.com>
744
745         PR c++/53003
746         * parser.c (cp_parser_member_declaration): Check that
747         initializer_token_start is non null before dereferencing it.
748
749 2012-04-16  Jason Merrill  <jason@redhat.com>
750
751         PR c++/38543
752         * pt.c (determine_specialization): Instead of comparing the number
753         of parms, check that tsubst gives the right answer.
754
755         PR c++/50830
756         * pt.c (convert_template_argument): Handle template template
757         argument packs.
758
759         PR c++/50303
760         * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
761         template parameters.
762
763 2012-04-15  Jason Merrill  <jason@redhat.com>
764
765         PR c++/52292
766         PR c++/52380
767         * pt.c (coerce_template_parms): Even if we aren't converting we
768         want to expand argument packs.
769
770 2012-04-15  Fabien ChĂȘne  <fabien@gcc.gnu.org>
771
772         PR c++/52465
773         * parser.c (cp_parser_class_name): Call strip_using_decl and
774         return the target decl.
775         * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
776         to be stripped is NULL_TREE.
777         (qualify_lookup): Call strip_using_decl and perform some checks on
778         the target decl.
779
780 2012-04-13  Jason Merrill  <jason@redhat.com>
781
782         PR c++/52824
783         * pt.c (any_pack_expanson_args_p): New.
784         (coerce_template_parms): Use it.
785
786 2012-04-11  Jason Merrill  <jason@redhat.com>
787
788         PR c++/52906
789         * decl.c (check_tag_decl): Don't complain about attributes if we
790         don't even have a type.
791
792 2012-04-05  Jason Merrill  <jason@redhat.com>
793
794         PR c++/52596
795         * tree.c (lvalue_kind): Treat a deferred access control SCOPE_REF
796         as an lvalue.
797
798 2012-04-03  Jason Merrill  <jason@redhat.com>
799
800         PR c++/52796
801         * pt.c (tsubst_initializer_list): A pack expansion with no elements
802         means value-initialization.
803
804 2012-03-29  Meador Inge  <meadori@codesourcery.com>
805
806         PR c++/52672
807         * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
808         stripped child trees that are not pointer types.
809
810 2012-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
811
812         PR c++/52718
813         * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
814         warn for a zero as null pointer constant default argument.
815
816 2012-03-29  Jason Merrill  <jason@redhat.com>
817
818         PR c++/52685
819         * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
820
821 2012-03-29  Jakub Jelinek  <jakub@redhat.com>
822
823         PR c++/52759
824         * decl.c (start_decl): Don't call maybe_apply_pragma_weak
825         if processing_template_decl.
826
827 2012-03-29  Jason Merrill  <jason@redhat.com>
828
829         PR c++/52743
830         * call.c (compare_ics): Handle ck_aggr like ck_list.
831
832 2012-03-28  Jason Merrill  <jason@redhat.com>
833
834         PR c++/52746
835         * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
836         we didn't get an explicit scope.
837         * pt.c (tsubst_baselink): Likewise.
838
839 2012-03-22  Paolo Carlini  <paolo.carlini@oracle.com>
840
841         PR c++/52487
842         * class.c (check_field_decls): Call literal_type_p only
843         on complete types.
844
845 2012-03-22  Jakub Jelinek  <jakub@redhat.com>
846
847         PR c++/52671
848         * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
849         on CLASS_TYPE_P types.
850
851 2012-03-22  Jason Merrill  <jason@redhat.com>
852
853         PR c++/52582
854         * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
855
856 2012-03-22  Jakub Jelinek  <jakub@redhat.com>
857
858         Backported from mainline
859         2012-03-14  Jakub Jelinek  <jakub@redhat.com>
860
861         PR c++/52521
862         * parser.c (lookup_literal_operator): Return fn only if
863         processed all arguments from args vector and argtypes is
864         void_list_node.
865
866 2012-03-22  Release Manager
867
868         * GCC 4.7.0 released.
869
870 2012-03-20  Jason Merrill  <jason@redhat.com>
871
872         * mangle.c (write_type): Handle 'auto'.
873         * init.c (build_new): Don't do auto deduction where it might
874         affect template mangling.
875
876 2012-03-07  Jason Merrill  <jason@redhat.com>
877
878         PR c++/52521
879         * mangle.c (write_literal_operator_name): The length comes after the
880         operator prefix.
881
882 2012-02-29  Jason Merrill  <jason@redhat.com>
883
884         PR c++/51930
885         * decl.c (check_tag_decl): Move warning for misplaced attributes here.
886         (shadow_tag): From here.
887         * parser.c (cp_parser_explicit_instantiation): Don't warn here.
888
889 2012-02-21  Jakub Jelinek  <jakub@redhat.com>
890
891         PR c++/52312
892         * typeck.c (check_literal_operator_args): Initialize *long_double_p
893         and *long_long_unsigned_p even if processing_template_decl.
894
895 2012-02-16  Jason Merrill  <jason@redhat.com>
896
897         PR c++/52248
898         * decl.c (define_label): Use timevar_cond_start/stop.
899
900 2012-02-16  Fabien ChĂȘne  <fabien@gcc.gnu.org>
901
902         PR c++/52126
903         * decl.c (xref_basetypes): call dependent_scope_p instead of
904         dependent_type_p.
905
906 2012-02-16  Jason Merrill  <jason@redhat.com>
907
908         PR c++/51415
909         * error.c (dump_expr): Handle lambda closures specifically.
910
911 2012-02-14  Jason Merrill  <jason@redhat.com>
912
913         * parser.c (cp_parser_explicit_instantiation): Give a warning
914         for ignored attributes on explicit class instantiation.
915
916 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
917
918         PR c++/52247
919         * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
920         lookup_label on label's name and set TREE_USED.
921
922 2012-02-14  Jason Merrill  <jason@redhat.com>
923
924         PR c++/39055
925         * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
926
927 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
928
929         PR c/52181
930         * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
931         newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
932
933 2012-02-07  Jason Merrill  <jason@redhat.com>
934
935         PR c++/51675
936         * semantics.c (cx_check_missing_mem_inits): Handle unions.
937         Fix constexpr default constructor logic.
938
939         PR c++/52035
940         * pt.c (tsubst): Strip uninstantiated typedef.
941
942 2012-02-06  Jason Merrill  <jason@redhat.com>
943
944         PR c++/52088
945         * cvt.c (build_expr_type_conversion): Check for template conversion.
946
947 2012-01-31  Jason Merrill  <jason@redhat.com>
948
949         PR c++/52043
950         * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
951         * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
952         (tsubst_pack_expansion): Check it.
953
954 2012-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
955
956         PR c++/51327
957         * class.c (explain_non_literal_class): Correctly handle implicitly
958         deleted constructors.
959
960 2012-01-27  Jakub Jelinek  <jakub@redhat.com>
961
962         PR c++/51852
963         * pt.c (tsubst_pack_expansion): Delete and restore
964         local_specialization whenever need_local_specialization, not just
965         when saved_local_specializations is non-NULL.
966
967 2012-01-26  Paolo Carlini  <paolo.carlini@oracle.com>
968
969         PR c++/51370
970         * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
971         as TREE_OPERAND (t, 1).
972
973 2012-01-24  Jason Merrill  <jason@redhat.com>
974
975         PR c++/51917
976         * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
977
978         PR c++/51973
979         * tree.c (called_fns_equal): Check template args.
980         (cp_tree_equal): Call it.
981
982 2012-01-24  Aldy Hernandez  <aldyh@redhat.com>
983             Patrick Marlier  <patrick.marlier@gmail.com>
984
985         PR c++/51928
986         * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
987         thunk for set_one_vmethod_tm_attributes.
988
989 2012-01-24  Paolo Carlini  <paolo.carlini@oracle.com>
990
991         PR c++/51223
992         * call.c (build_over_call): Check for error_mark_node as
993         TREE_VALUE when default arguments are processed.
994
995 2012-01-23  Jason Merrill  <jason@redhat.com>
996
997         PR c++/51930
998         * decl2.c (determine_visibility): Check for visibility attribute
999         on template specialization.
1000
1001 2012-01-23  Paolo Carlini  <paolo.carlini@oracle.com>
1002
1003         PR c++/51398
1004         * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
1005
1006 2012-01-23  Jason Merrill  <jason@redhat.com>
1007
1008         PR c++/51925
1009         * class.c (add_method): Set OVL_USED for using-decls.
1010         * tree.c (ovl_scope): New.
1011         * cp-tree.h: Declare it.
1012         * parser.c (cp_parser_template_name): Use it.
1013         * semantics.c (baselink_for_fns): Likewise.
1014         * name-lookup.c (set_inherited_value_binding_p): Likewise.
1015
1016 2012-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
1017
1018         PR c++/51402
1019         * pt.c (lookup_template_class_1): Check context returned by
1020         tsubst for error_mark_node.
1021
1022 2012-01-19  Kai Tietz  <ktietz@redhat.com>
1023
1024         PR c++/51344
1025         * decl2.c (save_template_attributes): Use merge_attributes
1026         instead of chaining up via TREE_CHAIN.
1027
1028 2012-01-19  Jason Merrill  <jason@redhat.com>
1029
1030         PR c++/51889
1031         * class.c (finish_struct): Call add_method here for function usings.
1032         * semantics.c (finish_member_declaration): Not here.
1033
1034 2012-01-18  Paolo Carlini  <paolo.carlini@oracle.com>
1035
1036         PR c++/51225
1037         * typeck2.c (store_init_value): Within a template guard
1038         cxx_constant_value with require_potential_constant_expression.
1039         * pt.c (convert_nontype_argument): Likewise.
1040
1041 2012-01-16  Jakub Jelinek  <jakub@redhat.com>
1042
1043         PR c++/51854
1044         * mangle.c (write_template_arg_literal): Handle complex.
1045
1046 2012-01-16  Jason Merrill  <jason@redhat.com>
1047
1048         PR c++/51827
1049         * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
1050
1051         PR c++/51868
1052         * typeck.c (build_static_cast_1): Handle bit-fields properly.
1053
1054 2012-01-13  Ian Lance Taylor  <iant@google.com>
1055
1056         PR c++/50012
1057         * typeck.c (enum_cast_to_int): New static function.
1058         (cp_build_binary_op): When handling warn_sign_compare, don't test
1059         for TREE_NO_WARNING.  Do call enum_cast_to_int.
1060         * call.c (avoid_sign_compare_warnings): Remove static function.
1061         (build_new_op_1): Don't call avoid_sign_compare_warnings.
1062
1063 2012-01-13  Steven Bosscher  <steven@gcc.gnu.org>
1064
1065         * decl2.c: Do not include tree-mudflap.h
1066         * semantics.c: Likewise.
1067
1068 2012-01-13  Jason Merrill  <jason@redhat.com>
1069
1070         PR c++/20681
1071         * semantics.c (finish_break_stmt): Avoid adding an unreachable
1072         BREAK_STMT.
1073
1074         PR c++/51813
1075         * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
1076         when reducing the visibility.
1077
1078         PR c++/51620
1079         * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
1080
1081 2012-01-12  Jason Merrill  <jason@redhat.com>
1082
1083         PR c++/51714
1084         * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
1085         value-dependent.
1086
1087 2012-01-13  Dodji Seketeli  <dodji@redhat.com>
1088
1089         PR c++/51633
1090         * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
1091         Set the pointer to the last block of the constructor to the
1092         current statement.
1093         (build_constexpr_constructor_member_initializers): Get
1094         build_data_member_initialization a chance to deal with more
1095         statements before we choke.
1096
1097 2012-01-12  Jason Merrill  <jason@redhat.com>
1098
1099         PR c++/48051
1100         * mangle.c (write_expression): Mangle BASELINK scope if
1101         BASELINK_QUALIFIED_P.
1102         * search.c (adjust_result_of_qualified_name_lookup): Set
1103         BASELINK_QUALIFIED_P.
1104         * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
1105         * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
1106         adjust_result_of_qualified_name_lookup for non-qualified names.
1107
1108         PR c++/51403
1109         * pt.c (unify): Handle error_mark_node.
1110
1111 2012-01-11  Jason Merrill  <jason@redhat.com>
1112
1113         PR c++/51565
1114         * call.c (standard_conversion): For ptrmemfuncs, compare the
1115         static_fn_types.
1116
1117         PR c++/51818
1118         * mangle.c (find_substitution): A type is only a substitution
1119         match if we're looking for a type.
1120         (write_nested_name): Use decl_mangling_context.
1121
1122         * decl.c (decls_match): Assert that the arguments are decls.
1123
1124         PR c++/51613
1125         * pt.c (resolve_overloaded_unification): Compare types with
1126         same_type_p, not decls_match.
1127
1128 2012-01-10  Jason Merrill  <jason@redhat.com>
1129
1130         PR c++/51614
1131         * class.c (build_base_path): Diagnose ambiguous base.
1132
1133         PR c++/51433
1134         * semantics.c (cxx_eval_call_expression): Always retry previously
1135         non-constant expressions.
1136
1137 2012-01-06  Jason Merrill  <jason@redhat.com>
1138
1139         DR 686
1140         PR c++/47450
1141         * parser.c (cp_parser_new_expression): Set
1142         type_definition_forbidden_message.
1143
1144         PR c++/6057
1145         PR c++/48051
1146         PR c++/50855
1147         PR c++/51322
1148         * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
1149         THROW_EXPR, CONSTRUCTOR, OVERLOAD.  Fix PREINCREMENT_EXPR and
1150         PREDECREMENT_EXPR.
1151         (write_template_arg): Fix mangling of class-scope functions and
1152         argument packs.
1153         (mangle_decl): Update suggested -fabi-version argument.
1154         * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
1155         DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
1156         * tree.c (dependent_name): No longer static.
1157         * cp-tree.h: Declare it.
1158         * pt.c (unify): Defer handling of unconverted functions.
1159
1160         * mangle.c (mangle_decl): Don't generate mangling aliases
1161         for maybe-in-charge [cd]tors.
1162
1163         * error.c (dump_expr): Print type of CONSTRUCTOR.
1164
1165 2012-01-05  Dodji Seketeli  <dodji@redhat.com>
1166
1167         PR c++/51541
1168         * parser.c (cp_parser_alias_declaration): Get out early upon
1169         errors in the identifier or the attributes.
1170
1171 2012-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
1172
1173         PR c++/51064
1174         * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
1175         the tree returned by build_x_binary_op.
1176
1177 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
1178
1179         PR c++/51738
1180         * parser.c (cp_parser_postfix_open_square_expression): Handle
1181         postfix-expression [ braced-init-list ].
1182
1183 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
1184
1185         PR c++/29273
1186         * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
1187         call decay_conversion on v.
1188
1189 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
1190
1191         PR c++/15867
1192         * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
1193         declaration followed by specialization.
1194
1195 2012-01-03  Jakub Jelinek  <jakub@redhat.com>
1196
1197         PR c++/51669
1198         * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
1199         on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
1200
1201 2012-01-02  Jason Merrill  <jason@redhat.com>
1202
1203         DR 1359
1204         PR c++/51675
1205         * method.c (walk_field_subobs): Don't check for uninitialized
1206         fields in a union.
1207         (synthesized_method_walk): Check here.
1208
1209         DR 325
1210         PR c++/51666
1211         * parser.c (cp_parser_cache_defarg): Split out...
1212         (cp_parser_parameter_declaration): ...from here.
1213         (cp_parser_save_nsdmi): Use it.
1214         (cp_parser_cache_group): Remove CPP_COMMA support.
1215
1216 2012-01-02  Dodji Seketeli  <dodji@redhat.com>
1217
1218         PR c++/51462
1219         * semantics.c (cx_check_missing_mem_inits): Don't assert in case
1220         of error.
1221
1222 2012-01-02  Paolo Carlini  <paolo.carlini@oracle.com>
1223
1224         PR c++/20140
1225         * typeck2.c (digest_init_r): Use copy_init when initializing
1226         an array of chars.
1227
1228 2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>
1229
1230         PR c++/16603
1231         * decl.c (build_enumerator): Don't call perform_integral_promotions
1232         on the value.
1233
1234 2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>
1235
1236         PR c++/51379
1237         * typeck.c (build_reinterpret_cast_1): Implement resolution of
1238         DR 799.
1239
1240 2012-01-01  Fabien ChĂȘne  <fabien@gcc.gnu.org>
1241
1242         * parser.c (cp_parser_using_declaration): Add a warning about
1243         deprecated access declarations when no errors were encountered
1244         while parsing the access declaration. Save the first token in
1245         order to emit the warning at the right place.
1246 \f
1247 Copyright (C) 2012 Free Software Foundation, Inc.
1248
1249 Copying and distribution of this file, with or without modification,
1250 are permitted in any medium without royalty provided the copyright
1251 notice and this notice are preserved.