Update ChangeLog and version files for release
[official-gcc.git] / gcc / cp / ChangeLog
blob7b13865233b84ccb869714380372effc735ced5b
1 2017-10-10  Release Manager
3         * GCC 5.5.0 released.
5 2017-09-18  Jason Merrill  <jason@redhat.com>
7         PR c++/80294 - ICE with constexpr and inheritance.
8         * constexpr.c (reduced_constant_expression_p):
9         A null constructor element is non-constant.
10         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
11         returning an empty base.
13         PR c++/79607 - ICE with T{} initializer
14         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
16         PR c++/72457
17         * init.c (expand_aggr_init_1): Only handle value-init of bases.
18         * constexpr.c (build_data_member_initialization): Handle multiple
19         initializers for the same field.
21         PR c++/55922
22         PR c++/63151
23         * init.c (expand_aggr_init_1): Handle list-initialization from {}.
25 2017-09-16  Jakub Jelinek  <jakub@redhat.com>
27         Backported from mainline
28         2017-06-21  Jakub Jelinek  <jakub@redhat.com>
30         PR c++/81154
31         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
32         Complain about t not being a variable if t is OVERLOAD even
33         when processing_template_decl.
35         2017-06-13  Jakub Jelinek  <jakub@redhat.com>
37         PR c++/80984
38         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
39         BLOCK_VARS (outer) chain.
40         (cxx_omp_const_qual_no_mutable): Likewise.
42 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
44         PR c/81006
45         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
46         to sizetype before size_binop.
48 2017-05-30  Jakub Jelinek  <jakub@redhat.com>
50         Backported from mainline
51         2017-04-11  Jakub Jelinek  <jakub@redhat.com>
53         PR c++/80363
54         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
56         2017-04-10  Jakub Jelinek  <jakub@redhat.com>
58         PR c++/80176
59         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
60         operand, if it is a static member function, recurse on the
61         BASELINK.
63         2017-03-22  Jakub Jelinek  <jakub@redhat.com>
65         PR c++/80141
66         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
67         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
68         processing_template_decl.
70         2017-03-10  Jakub Jelinek  <jakub@redhat.com>
72         PR c++/79896
73         * decl.c (finish_enum_value_list): If value is error_mark_node,
74         don't copy it and change its type.
75         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
76         of CONST_DECL is error_mark_node.
78         2017-02-22  Jakub Jelinek  <jakub@redhat.com>
80         PR c++/79664
81         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
82         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
83         * constexpr.c (potential_constant_expression_1): Handle
84         OMP_*, OACC_* and CILK_* trees.
86         2017-02-16  Jakub Jelinek  <jakub@redhat.com>
88         PR c++/79512
89         * parser.c (cp_parser_omp_target): For -fopenmp-simd
90         ignore #pragma omp target even when not followed by identifier.
92         2017-01-11  Jakub Jelinek  <jakub@redhat.com>
94         PR c++/78341
95         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
96         assertion.  Formatting fix.
98         2017-01-04  Jakub Jelinek  <jakub@redhat.com>
100         PR c++/78949
101         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
102         vector type.
104         2016-12-02  Jakub Jelinek  <jakub@redhat.com>
106         PR c++/78649
107         * pt.c (tsubst_init): Don't call build_value_init if decl's type
108         is error_mark_node.
110         2016-11-23  Jakub Jelinek  <jakub@redhat.com>
112         PR c++/77739
113         * cp-gimplify.c (cp_gimplify_tree) <case VEC_INIT_EXPR>: Pass
114         false as handle_invisiref_parm_p to cp_genericize_tree.
115         (struct cp_genericize_data): Add handle_invisiref_parm_p field.
116         (cp_genericize_r): Don't wrap is_invisiref_parm into references
117         if !wtd->handle_invisiref_parm_p.
118         (cp_genericize_tree): Add handle_invisiref_parm_p argument,
119         set wtd.handle_invisiref_parm_p to it.
120         (cp_genericize): Pass true as handle_invisiref_parm_p to
121         cp_genericize_tree.  Formatting fix.
123         2016-11-18  Jakub Jelinek  <jakub@redhat.com>
125         PR c++/77285
126         * mangle.c (mangle_tls_init_fn, mangle_tls_wrapper_fn): Call
127         check_abi_tags.
129         2016-10-31  Jakub Jelinek  <jakub@redhat.com>
131         PR c++/78089
132         * parser.c (cp_parser_postfix_expression): Replace return statement in
133         the first switch with setting postfix_expression to the return
134         expression and break;.
136         2016-09-28  Jakub Jelinek  <jakub@redhat.com>
138         PR c++/77467
139         * constexpr.c (enum constexpr_switch_state): New.
140         (struct constexpr_ctx): Add css_state field.
141         (label_matches): Add CTX and STMT arguments, remove I and
142         DEFAULT_LABEL.  For CASE_LABEL_EXPR assert ctx->css_state != NULL,
143         handle default labels according to css_state.
144         (cxx_eval_statement_list): Remove statement skipping, label_matches
145         and default_label handling code.
146         (cxx_eval_loop_expr): Exit after first iteration even if
147         switches (jump_target).
148         (cxx_eval_switch_expr): Set up css_state field in ctx, if default
149         label has been seen in the body, but no cases matched, evaluate
150         the body second time.
151         (cxx_eval_constant_expression): Handle stmt skipping and label_matches
152         here.  Handle PREDICT_EXPR.  For MODIFY_EXPR or INIT_EXPR, assert
153         statement is not skipped.  For COND_EXPR during skipping, don't
154         evaluate condition, just the then block and if still skipping at the
155         end also the else block.
156         (cxx_eval_outermost_constant_expr): Adjust constexpr_ctx initializer.
157         (is_sub_constant_expr): Likewise.
159         2016-09-27  Jakub Jelinek  <jakub@redhat.com>
161         PR c++/77722
162         * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Instrument also
163         functions that have just a STATEMENT_LIST instead of BIND_EXPR, or
164         BIND_EXPR with some statement rather than STATEMENT_LIST as body.
166         2016-09-20  Jakub Jelinek  <jakub@redhat.com>
168         PR c++/77637
169         * parser.c (cp_parser_std_attribute_list): Reject ... without
170         preceding attribute.
172         2016-09-16  Jakub Jelinek  <jakub@redhat.com>
174         PR c++/77375
175         * class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any
176         TYPE_HAS_MUTABLE_P for any bases.
178         2016-08-11  Jakub Jelinek  <jakub@redhat.com>
180         PR c++/72868
181         * constexpr.c (label_matches): Handle case range expressions.
183 2017-01-12  Nathan Sidwell  <nathan@acm.org>
185         PR c++/77812
186         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
187         is a new overload.
189 2016-12-08  Nathan Sidwell  <nathan@acm.org>
191         PR c++/78551
192         * constexpr.c (extract_string_elt): New.  Broken out of ...
193         (cxx_eval_array_reference): ... here.  Call it.
194         (cxx_eval_store_expression): Convert init by STRING_CST into
195         CONSTRUCTOR, if needed.
197 2016-08-05  Nathan Sidwell  <nathan@acm.org>
199         PR c++/68724
200         * pt.c (unify): TRAIT_EXPR is an expr.
202 2016-07-25  Jason Merrill  <jason@redhat.com>
204         PR c++/71833
205         * pt.c (coerce_template_parameter_pack): Fix logic for
206         pack index.
208 2016-07-21  Jason Merrill  <jason@redhat.com>
210         PR c++/69223
211         * semantics.c (apply_deduced_return_type): Call
212         complete_type_or_else before building the new RESULT_DECL.
214         PR c++/71630
215         * pt.c (instantiate_decl): Fix pattern_defined for namespace scope
216         variable templates.
218         PR c++/71913
219         * call.c (unsafe_copy_elision_p): It's OK to elide when
220         initializing an unknown object.
222 2016-07-20  Jakub Jelinek  <jakub@redhat.com>
224         PR c++/71909
225         * parser.c (cp_parser_save_member_function_body): Consume
226         __transaction_relaxed or __transaction_atomic with optional
227         attribute.  Only skip catch with block if try keyword is seen.
229 2016-07-19  Jakub Jelinek  <jakub@redhat.com>
231         Backported from mainline
232         2016-07-18  Jakub Jelinek  <jakub@redhat.com>
234         PR c++/71871
235         * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
237 2016-07-07  Jakub Jelinek  <jakub@redhat.com>
239         Backported from mainline
240         2016-06-14  Jakub Jelinek  <jakub@redhat.com>
242         PR c++/71528
243         * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
244         olddecl vars, preserve their TREE_READONLY bit.
246         PR c++/71516
247         * decl.c (complete_vars): Handle gracefully type == error_mark_node.
249 2016-06-08  Jakub Jelinek  <jakub@redhat.com>
251         PR c++/71442
252         * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
254 2016-06-03  Release Manager
256         * GCC 5.4.0 released.
258 2016-05-23  Richard Biener  <rguenther@suse.de>
260         Backport from mainline
261         2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
263         PR c++/70347
264         * typeck.c (process_init_constructor_union): If the initializer
265         is empty, use the union's NSDMI if it has one.
267 2016-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
269         PR c++/70466
270         * call.c (convert_like_real): Check that we are actually converting
271         from an init list.
273 2016-05-18  Jason Merrill  <jason@redhat.com>
275         PR c++/70505
276         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
277         unknown_type_node, too.
279         PR c++/70494
280         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
281         * typeck2.c (split_nonconstant_init_1): Use it.
283         PR c++/70648
284         * constexpr.c (cxx_eval_store_expression): Also copy
285         CONSTRUCTOR_NO_IMPLICIT_ZERO.
287         PR c++/70353
288         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
289         in constexpr functions.
291         PR c++/70095
292         * pt.c (instantiate_decl): Fix call to variable_template_p.
294 2016-05-18  Jason Merrill  <jason@redhat.com>
295             Jakub Jelinek  <jakub@redhat.com>
297         PR c++/70135
298         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
299         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
300         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
301         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
303 2016-05-18  Jason Merrill  <jason@redhat.com>
305         * method.c (synthesized_method_walk): operator= can also be constexpr.
307 2016-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
309         PR c++/70635
310         * pt.c (resolve_typename_type): Fix typos in infinite recursion
311         avoidance mechanism.
313 2016-04-18  Marek Polacek  <polacek@redhat.com>
315         Backport from mainline
316         2016-03-31  Marek Polacek  <polacek@redhat.com>
318         PR c/70297
319         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
321 2016-04-18  Marek Polacek  <polacek@redhat.com>
323         Backport from mainline
324         2015-11-11  Jason Merrill  <jason@redhat.com>
326         * decl.c (duplicate_decls): When combining typedefs, remove the
327         new type from the variants list.
329 2016-04-15  Jason Merrill  <jason@redhat.com>
331         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
332         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
334         PR c++/67164
335         * pt.c (copy_template_args): New.
336         (tsubst_pack_expansion): Use it.
338 2016-04-13  Alan Modra  <amodra@gmail.com>
340         Backport from mainline
341         2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
342         PR target/70107
343         PR c++/70096
344         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
346 2016-04-06  Richard Biener  <rguenther@suse.de>
348         Backport from mainline
349         2016-03-31  Richard Biener  <rguenther@suse.de>
351         PR c++/70430
352         * typeck.c (cp_build_binary_op): Fix operand order of vector
353         conditional in truth op handling.
355 2016-03-31  Nathan Sidwell  <nathan@acm.org>
357         PR c++/70393
358         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
359         elements in field order.
361 2016-03-30  Jakub Jelinek  <jakub@redhat.com>
363         Backported from mainline
364         2016-03-17  Jakub Jelinek  <jakub@redhat.com>
366         PR c++/70272
367         * decl.c (begin_destructor_body): Don't insert clobber if
368         is_empty_class (current_class_type).
370         2016-02-19  Jakub Jelinek  <jakub@redhat.com>
372         PR c++/67767
373         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
374         attr_spec is always single element chain, chain all the attributes
375         properly together in the right order.
377 2016-03-21  Marek Polacek  <polacek@redhat.com>
379         Backported from mainline
380         2016-03-15  Marek Polacek  <polacek@redhat.com>
382         PR c++/70209
383         * tree.c (strip_typedefs): Call strip_typedefs again on the
384         DECL_ORIGINAL_TYPE result.
386 2016-03-18  Jason Merrill  <jason@redhat.com>
388         PR c++/70139
389         * constexpr.c (cxx_eval_call_expression): Don't shortcut trivial copy.
391 2016-03-05  Jason Merrill  <jason@redhat.com>
393         PR c++/67364
394         * constexpr.c (cxx_eval_store_expression): Replace
395         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
397 2016-03-04  Jason Merrill  <jason@redhat.com>
399         PR c++/67364
400         * constexpr.c (cxx_eval_component_reference): Further tweak.
402         PR c++/70067
403         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
404         same type.
406 2016-03-03  Jason Merrill  <jason@redhat.com>
408         * call.c (build_aggr_conv): Use get_nsdmi.
410         PR c++/51406
411         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
413         PR c++/67364
414         * constexpr.c (cxx_eval_component_reference): Just return an empty
415         CONSTRUCTOR for an empty class.
417 2016-03-01  Paolo Carlini  <paolo.carlini@oracle.com>
419         * call.c (build_op_delete_call, build_over_call): Check mark_used
420         return value.
421         * class.c (resolve_address_of_overloaded_function): Likewise.
422         * decl.c (cxx_maybe_build_cleanup): Likewise.
423         * pt.c (gen_elem_of_pack_expansion_instantiation, tsubst_baselink,
424         tsubst_qualified_id, tsubst_copy, tsubst_copy_and_build): Likewise.
425         * rtti.c (build_dynamic_cast_1): Likewise.
426         * semantics.c (process_outer_var_ref): Likewise.
427         * typeck.c (build_class_member_access_expr,
428         cp_build_function_call_vec, cp_build_addr_expr_1): Likewise.
430 2016-03-01  Jason Merrill  <jason@redhat.com>
432         PR c++/69261
433         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
435 2016-03-01  Markus Trippelsdorf  <markus@trippelsdorf.de>
436             Paolo Carlini  <paolo.carlini@oracle.com>
438         PR c++/68087
439         * constexpr.c (cxx_eval_array_reference): Use tree_fits_shwi_p before
440         tree_to_shwi to avoid ICEs.
442 2016-03-01  Jason Merrill  <jason@redhat.com>
444         PR c++/67104
445         * constexpr.c (array_index_cmp, find_array_ctor_elt): New.
446         (cxx_eval_array_reference, cxx_eval_store_expression): Use them.
448         PR c++/51489
449         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
450         the operands.
452         PR c++/69995
453         * constexpr.c (cxx_eval_call_expression): Unshare arg.
454         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
455         [TARGET_EXPR]: Unshare init.
457 2016-02-29  Jason Merrill  <jason@redhat.com>
459         PR c++/69995
460         * constexpr.c (cxx_eval_store_expression): Unshare init.
462         PR c++/65985
463         * constexpr.c (build_constexpr_constructor_member_initializers):
464         Handle an additional STATEMENT_LIST.
466 2016-02-25  Bernd Edlinger  <bernd.edlinger@hotmail.de>
468         Backported from mainline
469         2016-02-19  Jakub Jelinek  <jakub@redhat.com>
470                     Bernd Edlinger  <bernd.edlinger@hotmail.de>
472         * Make-lang.in: Invoke gperf with -L C++.
473         * cfns.gperf: Remove prototypes for hash and libc_name_p
474         inlines.
475         * cfns.h: Regenerated.
476         * except.c (nothrow_libfn_p): Adjust.
478 2016-02-25  Jason Merrill  <jason@redhat.com>
480         PR c++/67364
481         * constexpr.c (cxx_eval_component_reference): Don't complain about
482         unevaluated empty classes.
484         PR c++/68049
485         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
487 2016-02-24  Jason Merrill  <jason@redhat.com>
489         PR c++/69323
490         * pt.c (instantiate_class_template_1): Set
491         processing_template_decl before substituting friend_type.
493 2016-02-19  Jason Merrill  <jason@redhat.com>
495         PR c++/69743
496         * call.c (remaining_arguments): No longer static.
497         * cp-tree.h: Declare it.
498         * pt.c (more_specialized_fn): Use it.
500 2016-02-17  Jason Merrill  <jason@redhat.com>
502         PR c++/68585
503         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
505         PR c++/68679
506         * decl2.c (reset_type_linkage_2): Look through member templates.
508 2016-02-15  Jason Merrill  <jason@redhat.com>
510         PR c++/68890
511         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
513 2016-02-10  Jason Merrill  <jason@redhat.com>
515         PR c++/68926
516         * pt.c (resolve_nondeduced_context): Add complain parm.
517         (do_auto_deduction): Pass it.
518         * cvt.c (convert_to_void): Likewise.
519         * decl.c (cp_finish_decl): Likewise.
520         * init.c (build_new): Likewise.
521         * rtti.c (get_tinfo_decl_dynamic): Likewise.
522         * semantics.c (finish_decltype_type): Likewise.
523         * typeck.c (decay_conversion): Likewise.
524         * cp-tree.h: Adjust declaration.
525         * call.c (standard_conversion): Add complain parm, pass it along.
526         (implicit_conversion): Pass it.
528 2016-02-10  Jakub Jelinek  <jakub@redhat.com>
530         Backported from mainline
531         2016-02-08  Jakub Jelinek  <jakub@redhat.com>
533         PR c++/59627
534         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
535         of the DECL_OMP_DECLARE_REDUCTION_P decls.
537 2016-01-31  Jason Merrill  <jason@redhat.com>
539         PR c++/69009
540         * pt.c (partial_specialization_p, impartial_args): New.
541         (instantiate_decl): Call impartial_args.
543 2016-01-27  Marek Polacek  <polacek@redhat.com>
545         Backport from mainline
546         2016-01-27  Marek Polacek  <polacek@redhat.com>
548         PR c/68062
549         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
550         needed.  Add -Wsign-compare warning.
552 2016-01-27  Jason Merrill  <jason@redhat.com>
554         PR c++/68949
555         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
556         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
557         maybe-in-charge *tor.
559         PR c++/69131
560         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
561         (process_subob_fn): Likewise.  Don't consider triviality if true.
562         (synthesize_method_walk): Pass it.
564 2016-01-19  Marek Polacek  <polacek@redhat.com>
566         Backported from mainline
567         2016-01-19  Marek Polacek  <polacek@redhat.com>
569         PR c++/68965
570         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
572 2016-01-08  Marek Polacek  <polacek@redhat.com>
574         PR c++/68449
575         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
577 2016-01-07  Jason Merrill  <jason@redhat.com>
579         PR c++/68983
580         PR c++/67557
581         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
583 2015-12-22  Jason Merrill  <jason@redhat.com>
585         PR c++/66921
586         * decl.c (cp_complete_array_type): Allow an initializer that
587         already has array type.
589         PR c++/67339
590         * parser.c (cp_parser_elaborated_type_specifier): Use CLASS_TYPE_P
591         rather than check for RECORD_TYPE.
593 2015-12-20  Jason Merrill  <jason@redhat.com>
595         PR c++/67411
596         * decl2.c (decl_maybe_constant_var_p): Use DECL_HAS_VALUE_EXPR_P.
598         PR c++/67411
599         * decl2.c (decl_maybe_constant_var_p): A proxy isn't constant.
601 2015-12-17  Jason Merrill  <jason@redhat.com>
603         PR c++/67550
604         * init.c (constant_value_1): Don't return a CONSTRUCTOR missing
605         non-constant elements.
607         PR c++/67576
608         PR c++/25466
609         * rtti.c (build_typeid): Use save_expr, not stabilize_reference.
611 2015-12-16  Joseph Myers  <joseph@codesourcery.com>
613         PR c/68162
614         * tree.c (c_build_qualified_type): Add extra arguments.
616 2015-12-16  Jason Merrill  <jason@redhat.com>
618         PR c++/63628
619         * pt.c (tsubst_pack_expansion): Also make dummy decls if
620         retrieve_local_specialization fails.
622 2015-12-04  Markus Trippelsdorf  <markus@trippelsdorf.de>
624         PR c++/67337
625         * mangle.c (write_template_prefix): Guard against context==NULL.
627 2015-12-04  Release Manager
629         * GCC 5.3.0 released.
631 2015-11-26  Jakub Jelinek  <jakub@redhat.com>
633         PR c++/68508
634         * cp-tree.h (cp_ubsan_maybe_instrument_downcast): Add INTYPE argument.
635         * cp-ubsan.c (cp_ubsan_maybe_instrument_downcast): Likewise.  Use
636         it instead of or in addition to TREE_TYPE (op).  Use
637         is_properly_derived_from, return NULL_TREE if TREE_TYPE (intype) and
638         TREE_TYPE (type) are the same type minus qualifiers.
639         * typeck.c (build_static_cast_1): Adjust callers.
641 2015-11-25  Jakub Jelinek  <jakub@redhat.com>
643         Backported from mainline
644         2015-11-20  Jakub Jelinek  <jakub@redhat.com>
646         PR c++/67354
647         * cp-tree.h (defer_mangling_aliases): Declare.
648         (generate_mangling_aliases): New prototype.
649         * decl2.c (defer_mangling_aliases): New variable.
650         (note_mangling_alias): Use !defer_mangling_aliases
651         instead of at_eof.
652         (generate_mangling_aliases): No longer static. Clear
653         defer_mangling_aliases.
654         * optimize.c (maybe_thunk_body): Defer emitting mangling aliases
655         if !defer_mangling_aliases until the fns are put into the same
656         comdat group.
658         2015-05-09  Aldy Hernandez  <aldyh@redhat.com>
660         PR bootstrap/66085
661         * decl2.c (note_mangling_alias): Declare arguments as unused.
663         2015-05-08  Jason Merrill  <jason@redhat.com>
665         * decl2.c (mangling_aliases): New variable.
666         (note_mangling_alias, generate_mangling_aliases): New.
667         (cp_write_global_declarations): Call generate_mangling_aliases.
668         (generate_mangling_alias): Split out from...
669         * mangle.c (mangle_decl): ...here.
670         * cp-tree.h: Declare note_mangling_alias.
672 2015-11-25  Jason Merrill  <jason@redhat.com>
674         PR c++/67941
675         * lambda.c (maybe_add_lambda_conv_op): Mark _FUN as
676         no_sanitize_undefined.
678         PR c++/68422
679         * cp-tree.h (PACK_EXPANSION_SIZEOF_P): New.
680         * parser.c (cp_parser_sizeof_pack): Set it.
681         * pt.c  (tsubst_copy) [SIZEOF_EXPR]: Likewise.
682         (tsubst_pack_expansion): Improve T... shortcut when set.
684         PR c++/67813
685         * constexpr.c (cxx_eval_store_expression): Always use *valp if
686         set.
688 2015-11-25  Markus Trippelsdorf  <markus@trippelsdorf.de>
689             Paolo Carlini  <paolo.carlini@oracle.com>
691         PR c++/68087
692         * constexpr.c (cxx_eval_array_reference): Use tree_fits_shwi_p before
693         tree_to_shwi to avoid ICEs.
695 2015-11-19  Jakub Jelinek  <jakub@redhat.com>
696             Manuel López-Ibáñez  <manu@gcc.gnu.org>
698         PR c++/67409
699         * decl.c (identify_goto): Add LOC and DIAG_KIND arguments, call
700         emit_diagnostic instead of permerror.
701         (check_previous_goto_1): Adjust identify_goto callers, treat all
702         cases but crossing initialization and entering scope of decl with
703         non-trivial dtor as unconditional hard errors.
704         (check_goto): Use identify_goto.  Treat all cases but crossing
705         initialization and entering scope of decl with non-trivial dtor
706         as unconditional hard errors.
708 2015-10-20  Jason Merrill  <jason@redhat.com>
710         PR c++/66583
711         * init.c (innermost_aggr_scope): New.
712         (sort_mem_initializers): Use it.
714         PR c++/67557
715         * call.c (is_base_field_ref): New.
716         (unsafe_copy_elision_p): New.
717         (build_over_call): Use it.
719 2015-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
721         Backport from mainline
722         2015-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
724         PR c++/51048
725         * decl2.c (no_linkage_error): Do not issue a permerror if the DECL
726         using a local type is pure virtual.
728 2015-09-10  Jakub Jelinek  <jakub@redhat.com>
730         PR c++/67522
731         * semantics.c (handle_omp_array_sections_1): Only run
732         type_dependent_expression_p on VAR_DECL/PARM_DECLs.
733         (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Likewise.
734         Don't adjust OMP_CLAUSE_LINEAR_STEP if OMP_CLAUSE_DECL
735         is not a VAR_DECL/PARM_DECL.
737         PR c++/67511
738         * semantics.c (handle_omp_for_class_iterator): Don't wrap
739         error_mark_node into a NOP_EXPR to void_type_node.
741 2015-09-09  Jakub Jelinek  <jakub@redhat.com>
743         PR c++/67504
744         * parser.c (cp_parser_omp_clause_collapse): Test tree_fits_shwi_p
745         before INTEGRAL_TYPE_P test.
747 2015-09-08  Paolo Carlini  <paolo.carlini@oracle.com>
749         PR c++/67369
750         * pt.c (tsubst_copy, [case FUNCTION_DECL]): Do not call tsubst
751         if the first argument isn't a template.
753 2015-08-17  Jason Merrill  <jason@redhat.com>
755         PR c++/66957
756         * search.c (protected_accessible_p): Revert fix for 38579.
758 2015-08-17  Paolo Carlini  <paolo.carlini@oracle.com>
760         PR c++/66919
761         * pt.c (tsubst_copy): Pass complain to mark_used, check return value.
763 2015-08-17  Jason Merrill  <jason@redhat.com>
765         PR c++/67244
766         * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies.
768         PR c++/65734
769         * class.c (fixup_attribute_variants): Respect TYPE_USER_ALIGN.
771         PR c++/67104
772         * constexpr.c (cxx_eval_array_reference): Handle sparse
773         CONSTRUCTORs.
775 2015-08-14  Jason Merrill  <jason@redhat.com>
777         PR c++/65974
778         * decl2.c (mark_vtable_entries): Suppress -Wdeprecated.
780 2015-08-14  Patrick Palka  <ppalka@gcc.gnu.org>
782         PR c++/66857
783         * cvt.c (ocp_convert): Don't call scalar_constant_value when
784         converting to a class type.
786 2015-08-12  Jason Merrill  <jason@redhat.com>
788         PR c++/67161
789         * error.c (dump_decl) [TEMPLATE_ID_EXPR]: Pass
790         TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS.
792 2015-08-06  Jason Merrill  <jason@redhat.com>
794         PR c++/66533
795         * parser.c (cp_parser_primary_expression): Don't skip to the end
796         of the statement if we're parsing tentatively.
798         PR c++/67130
799         PR c++/67131
800         PR c++/66260
801         * mangle.c (write_expression) [TEMPLATE_ID_EXPR]: Handle variable
802         templates.
803         * pt.c (tsubst_copy_and_build): Check for argument substitution
804         failure.
806 2015-08-05  Jason Merrill  <jason@redhat.com>
808         PR c++/66260
809         PR c++/66596
810         PR c++/66649
811         PR c++/66923
812         * pt.c (lookup_template_variable): Use NULL_TREE for type.
813         (instantiate_template_1): Also set DECL_TI_ARGS based on
814         the immediate parent.
815         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle variable templates.
816         (finish_template_variable): Add complain parm.
817         * cp-tree.h: Adjust.
819         PR c++/65195
820         PR c++/66619
821         * semantics.c (finish_id_expression): Call convert_from_reference
822         for variable template.
824         PR c++/66336
825         * pt.c (find_parameter_packs_r): Handle variable templates.
826         (variable_template_specialization_p): New.
827         * cp-tree.h: Declare it.
829 2015-07-30  Jason Merrill  <jason@redhat.com>
831         DR 1558
832         PR c++/67021
833         * pt.c (tsubst_decl) [TYPE_DECL]: Clear TYPE_DEPENDENT_P_VALID.
835 2015-07-16  Marek Polacek  <polacek@redhat.com>
837         Backported from mainline
838         2015-07-08  Marek Polacek  <polacek@redhat.com>
840         PR c++/66748
841         * tree.c (handle_abi_tag_attribute): Check for CLASS_TYPE_P before
842         accessing TYPE_LANG_SPECIFIC node.
844 2015-07-16  Release Manager
846         * GCC 5.2.0 released.
848 2015-07-10  Jakub Jelinek  <jakub@redhat.com>
850         Backported from mainline
851         2015-07-08  Jakub Jelinek  <jakub@redhat.com>
853         * decl.c (grokfndecl): Handle flag_openmp_simd like flag_openmp.
854         * pt.c (apply_late_template_attributes): Likewise.
856 2015-07-02  Jason Merrill  <jason@redhat.com>
858         PR c++/66743
859         * pt.c (for_each_template_parm_r) [UNDERLYING_TYPE]: Use
860         TYPE_VALUES_RAW rather than TYPE_FIELDS.
862 2015-06-30  Jason Merrill  <jason@redhat.com>
864         PR c++/65945
865         * decl.c (cxx_init_decl_processing): Set TYPE_ALIGN of nullptr_t.
866         * class.c (layout_nonempty_base_or_field): Warn if that affects
867         the offset of a field.
869 2015-06-29  Adam Butcher  <adam@jessamine.co.uk>
871         PR c++/65750
872         * parser.c (cp_parser_simple_type_specifier): Don't synthesize
873         implicit template parm if 'auto' is a placeholder for trailing
874         return type.
876 2015-06-26  Jason Merrill  <jason@redhat.com>
878         PR c++/66216
879         * class.c (finish_struct): Call fixup_attribute_variants.
881         PR c++/66067
882         * mangle.c (write_template_args): Handle 0 length TREE_VEC.
884 2015-06-24  Jason Merrill  <jason@redhat.com>
886         PR c++/65919
887         * mangle.c (mangle_decl): Always SET_IDENTIFIER_GLOBAL_VALUE.
888         (decl_implicit_alias_p): Split out from maybe_remove_implicit_alias.
889         * cp-tree.h (DECL_REALLY_EXTERN): Handle null DECL_LANG_SPECIFIC.
891         PR c++/66647
892         * pt.c (dependent_type_p_r): Check for dependent alias template
893         specialization sooner.
895         PR c++/66501
896         * init.c (vec_copy_assign_is_trivial): New.
897         (build_vec_init): Use it.
899 2015-06-24  Mikhail Maltsev  <maltsevm@gmail.com>
901         Backport from mainline:
902         2015-06-20  Mikhail Maltsev  <maltsevm@gmail.com>
904         PR c++/65882
905         * call.c (build_new_op_1): Check tf_warning flag in all cases.
907 2015-06-23  Jason Merrill  <jason@redhat.com>
909         PR c++/65879
910         * tree.c (no_linkage_check): Skip the 'this' pointer.
912 2015-06-19  Jason Merrill  <jason@redhat.com>
914         PR c++/66515
915         * call.c (implicit_conversion): Call reshape_init here, early.
916         (build_aggr_conv): Not here.
918         PR c++/66585
919         * pt.c (instantiate_class_template_1): Clear
920         cp_unevaluated_operand and c_inhibit_evaluation_warnings.
922         PR c++/65880
923         * decl.c (build_ptrmemfunc_type): Check TYPE_GET_PTRMEMFUNC_TYPE after
924         cv-qualifiers.
926         PR c++/65973
927         * constexpr.c (build_constexpr_constructor_member_initializers):
928         Handle an empty STATEMENT_LIST.
930         PR c++/65843
931         * pt.c (tsubst_copy_and_build): Register a capture proxy in
932         local_specializations.
934 2015-06-17  Jason Merrill  <jason@redhat.com>
936         PR c++/66001
937         * constexpr.c (cxx_eval_constant_expression): Handle TRY_BLOCK and
938         TRY_FINALLY_EXPR.
939         (potential_constant_expression_1): Likewise.
941 2015-06-17  Jakub Jelinek  <jakub@redhat.com>
943         PR c++/66571
944         * pt.c (tsubst_omp_clause_decl): New function.
945         (tsubst_omp_clauses): Use it or tsubst_copy instead of
946         tsubst_expr on OMP_CLAUSE_DECL.
948 2015-06-17  Jason Merrill  <jason@redhat.com>
950         PR c++/66536
951         * tree.c (replace_placeholders_r) [CONSTRUCTOR]: Handle type
952         mismatch.
954         PR c++/58063
955         * tree.c (bot_manip): Remap SAVE_EXPR.
957         PR c++/66387
958         * pt.c (tsubst_copy) [VAR_DECL]: Use process_outer_var_ref.
960         PR c++/66450
961         * constexpr.c (cxx_eval_store_expression): Avoid messing up outer
962         ctx->ctor.
964         PR c++/66289
965         * cp-tree.h (TEMPLATE_DECL_COMPLEX_ALIAS_P): New.
966         * pt.c (push_template_decl_real): Set it.
967         (dependent_alias_template_spec_p): Use it.
968         (dependent_type_p_r): Use dependent_alias_template_spec_p.
969         (uses_all_template_parms_data, uses_all_template_parms_r)
970         (complex_alias_template_p): New.
971         (get_template_parm_index): Handle BOUND_TEMPLATE_TEMPLATE_PARM.
973 2015-06-12  Jason Merrill  <jason@redhat.com>
975         PR c++/65719
976         * pt.c (tsubst_decl) [VAR_DECL]: Mark namespace-scope
977         variables as DECL_NOT_REALLY_EXTERN.
979 2015-06-11  Jason Merrill  <jason@redhat.com>
981         PR c++/66445
982         * constexpr.c (potential_constant_expression_1): Handle a
983         DECL_EXPR of TYPE_DECL.
985 2015-06-11  Pierre-Marie de Rodat  <derodat@adacore.com>
987         * decl.c (cxx_init_decl_processing): Register the main
988         translation unit through the new debug hook.
990 2015-06-09  Jason Merrill  <jason@redhat.com>
992         PR c++/66387
993         * semantics.c (process_outer_var_ref): Make sure the value is
994         actually constant before returning it.
995         * typeck.c (cp_build_array_ref): Allow subscripting non-lvalue
996         array.
998         PR c++/66383
999         * tree.c (replace_placeholders_r): Handle placeholders for an
1000         outer object.
1001         * typeck2.c (store_init_value): Only replace_placeholders for
1002         objects of class type.
1004 2015-06-05  Jason Merrill  <jason@redhat.com>
1006         PR c++/66405
1007         * pt.c (argument_pack_element_is_expansion_p): Return 2 if
1008         the expansion has extra args.
1009         (use_pack_expansion_extra_args_p): Return true in that case.
1011         PR c++/66405
1012         * pt.c (type_dependent_expression_p): EXPR_PACK_EXPANSION is
1013         dependent even if it has a type.
1015 2015-06-05  Jason Merrill  <jason@redhat.com>
1017         PR c++/65942
1018         * decl2.c (mark_used): Don't always instantiate constexpr fns.
1019         * constexpr.c (cxx_eval_call_expression): Instantiate them here.
1021 2015-06-04  Marek Polacek  <polacek@redhat.com>
1023         Backported from mainline
1024         2015-06-03  Marek Polacek  <polacek@redhat.com>
1026         PR sanitizer/66190
1027         * cp-gimplify.c (struct cp_genericize_data): Add no_sanitize_p.
1028         (cp_genericize_r): Don't instrument static initializers.
1029         (cp_genericize_tree): Initialize wtd.no_sanitize_p.
1031 2015-05-31  Jason Merrill  <jason@redhat.com>
1033         PR c++/66320
1034         * constexpr.c (cxx_eval_constant_expression): Treat a placeholder
1035         with the wrong type as non-constant.
1037         * pt.c (tsubst_decl) [VAR_DECL]: SET_DECL_IMPLICIT_INSTANTIATION
1038         before register_specialization.
1040 2015-05-22  Jakub Jelinek  <jakub@redhat.com>
1042         Backported from mainline
1043         2015-05-19  Jakub Jelinek  <jakub@redhat.com>
1045         PR middle-end/66199
1046         * parser.c (cp_parser_omp_for_loop): Don't add
1047         OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
1048         OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
1049         (cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
1050         constructs.
1052 2015-05-18  Jason Merrill  <jason@redhat.com>
1054         * pt.c (tsubst_decl) [VAR_DECL]: Call coerce_innermost_template_parms.
1055         (determine_specialization): Call coerce_template_parms.
1057         * tree.c (strip_typedefs_expr) [TRAIT_EXPR]: Fix typo.
1058         (strip_typedefs) [DECLTYPE_TYPE]: Fix typedef of decltype.
1059         [TREE_LIST]: Fix no-change case.
1061 2015-05-07  Jason Merrill  <jason@redhat.com>
1063         PR c++/59012
1064         * parser.c (cp_parser_std_attribute_list): Handle attribute expansion.
1065         (cp_parser_std_attribute_spec): Handle alignas pack expansion.
1066         * decl2.c (is_late_template_attribute): An attribute exp is dependent.
1067         * pt.c (make_pack_expansion): Allow TREE_LIST for attribute expansion.
1068         (apply_late_template_attributes): Handle attribute pack expansion.
1070         DR 1467
1071         PR c++/51747
1072         * typeck2.c (digest_init_r): Fix single element list.
1074 2015-05-05  Jason Merrill  <jason@redhat.com>
1076         * decl.c (start_decl): Don't push the plain VAR_DECL for a
1077         variable template.
1079 2015-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
1080             Jakub Jelinek  <jakub@redhat.com>
1082         PR c++/66007
1083         * typeck2.c (check_narrowing): Check by-hand that the pedwarn didn't
1084         result in an actual error.
1086 2015-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
1087             Prathamesh Kulharni  <prathamesh.kulkarni@linaro.org>
1089         PR c++/65858
1090         * typeck2.c (check_narrowing): Set ok = true when pedwarn returns
1091         false.
1093 2015-04-30  Paolo Carlini  <paolo.carlini@oracle.com>
1095         PR c++/65801
1096         * typeck2.c (check_narrowing): In C++11 mode too, -Wno-narrowing
1097         suppresses the diagnostic.
1099 2015-04-30  Jason Merrill  <jason@redhat.com>
1101         PR c++/65876
1102         * constexpr.c (cxx_eval_call_expression): Fail gracefully if cgraph
1103         threw away DECL_SAVED_TREE.
1105 2015-04-29  Thomas Schwinge  <thomas@codesourcery.com>
1107         Backport from trunk r222564:
1109         2015-04-29  Thomas Schwinge  <thomas@codesourcery.com>
1111         * pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use
1112         OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES.
1114 2015-04-28  Jason Merrill  <jason@redhat.com>
1116         PR c++/65896
1117         * constexpr.c (cxx_eval_store_expression): Don't try to actually
1118         store an empty class.
1120 2015-04-22  Marek Polacek  <polacek@redhat.com>
1122         PR c++/65727
1123         * lambda.c (maybe_resolve_dummy): Handle null return.
1125 2015-04-22  Jason Merrill  <jason@redhat.com>
1127         PR c++/65695
1128         * cvt.c (cp_fold_convert): Avoid wrapping PTRMEM_CST in NOP_EXPR.
1130         PR c++/65721
1131         * name-lookup.c (do_class_using_decl): Complain about specifying
1132         the current class even if there are dependent bases.
1134 2015-04-22  David Krauss  <david_work@me.com>
1136         PR c++/59766
1137         * decl.c (grokdeclarator): Do not flag friends with deduced return.
1139 2015-04-22  Release Manager
1141         * GCC 5.1.0 released.
1143 2015-04-20  Ilya Verbin  <ilya.verbin@intel.com>
1145         * parser.c (cp_parser_omp_target_update): Add missed %> to error_at ().
1147 2015-04-12  Jakub Jelinek  <jakub@redhat.com>
1149         PR c++/65736
1150         * constexpr.c (cxx_eval_pointer_plus_expression): Don't fold for VLAs,
1151         don't fold if op01 isn't divisible by TYPE_SIZE_UNIT.  Convert
1152         the expression to the original type at the end.
1154 2015-04-09  Jakub Jelinek  <jakub@redhat.com>
1156         PR c++/65690
1157         * tree.c (cp_build_qualified_type_real): Copy TYPE_ALIGN and
1158         TYPE_USER_ALIGN.
1160         PR c++/65690
1161         * tree.c (build_cplus_array_type): Layout type before variants are
1162         set, but copy over TYPE_SIZE and TYPE_SIZE_UNIT from the main
1163         variant.
1165 2015-04-03  Paolo Carlini  <paolo.carlini@oracle.com>
1167         PR c++/64085
1168         * lambda.c (add_capture): Use dependent_type_p for capture by
1169         reference too.
1171 2015-04-02  Marek Polacek  <polacek@redhat.com>
1173         PR c++/65642
1174         * constexpr.c (cxx_eval_pointer_plus_expression): Call
1175         cxx_eval_constant_expression on the first operand.
1177 2015-04-01  Jason Merrill  <jason@redhat.com>
1179         PR c++/65625
1180         * decl.c (make_typename_type): Handle seeing a variable template.
1182 2015-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
1184         PR c++/56100
1185         * pt.c (instantiating_current_function_p): New.
1186         * name-lookup.c (pushdecl_maybe_friend_1): Use it.
1187         * cp-tree.h (instantiating_current_function_p): Declare.
1189 2015-04-01  Jason Merrill  <jason@redhat.com>
1191         PR c++/65646
1192         * decl.c (grokvardecl): Don't call check_explicit_specialization
1193         for non-template members of a class template.
1195 2015-04-01  Marek Polacek  <polacek@redhat.com>
1197         PR c++/65554
1198         * class.c (finish_struct): Require that the second field of a
1199         user-defined initializer_list be of size type.
1201 2015-03-31  Marek Polacek  <polacek@redhat.com>
1203         PR c++/65390
1204         * tree.c (build_cplus_array_type): Use dependent_type_p rather than
1205         checking for constness.
1207 2015-03-30  Marek Polacek  <polacek@redhat.com>
1209         PR c++/65398
1210         * constexpr.c (cxx_fold_indirect_ref): Don't perform the
1211          *(&A[i] p+ j) => A[i + j] transformation here.
1212         (cxx_eval_pointer_plus_expression): New function.
1213         (cxx_eval_constant_expression): Use it here.
1215 2015-03-27  Tobias Burnus  <burnus@net-b.de>
1217         PR c/65586
1218         * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
1219         cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
1220         cp_parser_omp_declare): Don't show error for skipped omp pragmas with
1221         -fopenmp-simd.
1223 2015-03-27  Marek Polacek  <polacek@redhat.com>
1225         PR c++/65556
1226         * semantics.c (finish_switch_cond): If the unlowered type is not an
1227         enum, use the type of the condition.
1229 2015-03-27  Jason Merrill  <jason@redhat.com>
1231         PR c++/65509
1232         * decl.c (make_rtl_for_nonlocal_decl): Don't defer static
1233         constants.
1235 2015-03-26  Mikhail Maltsev  <maltsevm@gmail.com>
1237         PR c++/65154
1238         * init.c (build_vec_init): Fix initializing aggregates
1239         with empty init list.
1241 2015-03-26  Jason Merrill  <jason@redhat.com>
1243         PR c++/65525
1244         * constexpr.c (potential_constant_expression_1): Handle MEM_REF.
1246 2015-03-25  Marek Polacek  <polacek@redhat.com>
1248         PR c++/65558
1249         * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
1250         on an anonymous namespace.
1252 2015-03-25  Marek Polacek  <polacek@redhat.com>
1254         PR c++/61670
1255         * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
1257 2015-03-24  Jason Merrill  <jason@redhat.com>
1259         PR c++/65046
1260         * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
1261         * parser.c (cp_parser_namespace_definition): Don't set it.
1262         * name-lookup.c (handle_namespace_attrs): Check
1263         DECL_NAMESPACE_ASSOCIATIONS instead.
1265         PR c++/65498
1266         * pt.c (get_mostly_instantiated_function_type): Just return the
1267         type of the partially instantiated template in DECL_TI_TEMPLATE.
1269 2015-03-20  Marek Polacek  <polacek@redhat.com>
1271         PR c++/65398
1272         * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
1273         A[i + j].
1275 2015-03-20  Marek Polacek  <polacek@redhat.com>
1277         PR c++/65072
1278         * typeck.c (lookup_anon_field): Make sure we're dealing with the main
1279         variant.
1281 2015-03-19  Jason Merrill  <jason@redhat.com>
1283         PR c++/65046
1284         Automatically propagate ABI tags to variables and functions
1285         from their (return) type.
1286         * class.c (check_tag): Handle variables and functions.
1287         (mark_or_check_attr_tags): Split out from find_abi_tags_r.
1288         (mark_or_check_tags): Likewise.
1289         (mark_abi_tags): Use it.  Rename from mark_type_abi_tags.
1290         (check_abi_tags): Add single argument overload for decls.
1291         Handle inheriting tags for decls.
1292         * mangle.c (write_mangled_name): Call it.
1293         (mangle_return_type_p): Split out from write_encoding.
1294         (unmangled_name_p): Split out from write_mangled_name.
1295         (write_mangled_name): Ignore abi_tag on namespace.
1296         * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
1297         * parser.c (cp_parser_namespace_definition): Set it.
1298         * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
1299         about abi_tag attribute on non-inline namespace.
1300         * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
1301         (handle_abi_tag_attribute): Allow tags on variables.
1303 2015-03-19  Jakub Jelinek  <jakub@redhat.com>
1305         * decl2.c (cplus_decl_attributes): Also add "omp declare target"
1306         attribute for DECL_EXTERNAL VAR_DECLs.
1308 2015-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
1310         PR c++/65340
1311         * call.c (build_over_call): Pass the tsubst_flags_t argument to
1312         mark_used.
1313         * decl2.c (mark_used): Inline the require_deduced_type call and
1314         guard the error call.
1316 2015-03-16  Jason Merrill  <jason@redhat.com>
1318         PR c++/65061
1319         * parser.c (cp_parser_template_name): Call strip_using_decl.
1321 2015-03-16  Marek Polacek  <polacek@redhat.com>
1323         DR 1688
1324         PR c++/65327
1325         * decl.c (grokdeclarator): Allow volatile and constexpr together.
1327 2015-03-12  Paolo Carlini  <paolo.carlini@oracle.com>
1329         PR c++/65323
1330         * decl.c (check_default_argument): Don't call
1331         maybe_warn_zero_as_null_pointer_constant.
1333 2015-03-11  Aldy Hernandez  <aldyh@redhat.com>
1335         * cp-gimplify.c (simple_empty_class_p): New.
1336         * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR.  Abstract
1337         the code for empty class copies into simple_empty_class_p, and
1338         adapt it to handle COMPOUND_EXPRs.
1340 2015-03-10  Paolo Carlini  <paolo.carlini@oracle.com>
1342         PR c++/65370
1343         * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
1344         only if the location of newdecl doesn't match the location of olddecl.
1346 2015-03-10  Jakub Jelinek  <jakub@redhat.com>
1348         PR c++/65127
1349         * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
1350         is not a PARM_DECL.
1352 2015-03-10  Jason Merrill  <jason@redhat.com>
1354         PR c++/65333
1355         DR 1558
1356         * pt.c (dependent_type_p_r): Check both class and alias template args.
1358 2015-03-10  Jakub Jelinek  <jakub@redhat.com>
1360         PR c/65120
1361         * parser.c (cp_parser_binary_expression): Check for tcc_comparison
1362         before preparing arguments to warn_logical_not_parentheses.
1363         Use maybe_constant_value on rhs.
1365 2015-03-09  Jason Merrill  <jason@redhat.com>
1367         PR c++/65339
1368         * call.c: Don't call maybe_resolve_dummy when calling a constructor.
1370 2015-03-09  Jakub Jelinek  <jakub@redhat.com>
1372         PR c/65120
1373         * parser.c (cp_parser_binary_expression): Don't warn for
1374         !!x == y or !b == y where b is bool.
1376 2015-03-06  Aldy Hernandez  <aldyh@redhat.com>
1378         * ptree.c (cxx_print_lambda_node): New.
1379         (cxx_print_xnode): Handle LAMBDA_EXPR.
1381 2015-03-03  Aldy Hernandez  <aldyh@redhat.com>
1383         PR c++/65295
1384         * constexpr.c (cxx_eval_constant_expression): Remove assert in
1385         RESULT_DECL handling.
1387 2015-02-26  Marek Polacek  <polacek@redhat.com>
1389         PR c++/65202
1390         * constexpr.c (cxx_eval_constant_expression): Don't evaluate
1391         a RETURN_EXPR if its operand is null.
1393 2015-02-25  Jason Merrill  <jason@redhat.com>
1395         PR c++/65209
1396         * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
1397         DECL_COMDAT.
1398         (constrain_visibility_for_template): Handle reference arguments.
1400         PR debug/58315
1401         * decl.c (start_preparsed_function): Use create_artificial_label
1402         for cdtor_label.
1404 2015-02-17  Paolo Carlini  <paolo.carlini@oracle.com>
1405             Jakub Jelinek  <jakub@redhat.com>
1407         PR c++/65075
1408         * constexpr.c (check_constexpr_bind_expr_vars): Allow
1409         implicit typedefs for lambda types.
1411 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
1413         PR c++/60894
1414         * decl.c (lookup_and_check_tag): Use strip_using_decl.
1416 2015-02-13  Jason Merrill  <jason@redhat.com>
1418         PR c++/65054
1419         * pt.c (template_args_equal): Look through conversions here.
1420         * tree.c (cp_tree_equal): Not here.
1422 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
1424         PR c++/60211
1425         * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
1426         pragma_external context.
1428 2015-02-13  Jason Merrill  <jason@redhat.com>
1430         PR c++/65051
1431         * call.c (reference_binding): Don't look for bad conversion
1432         if TO is incomplete.
1434 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
1436         PR c++/64970
1437         * decl.c (make_typename_type): Pass tsubst_flags_t argument
1438         to lookup_template_class.
1440 2015-02-13  Jakub Jelinek  <jakub@redhat.com>
1442         PR ipa/65034
1443         * decl.c (start_preparsed_function): Use void_type_node instead
1444         of NULL_TREE as LABEL_DECL type.
1446 2015-02-12  Jason Merrill  <jason@redhat.com>
1448         PR c++/64898
1449         * mangle.c (write_mangled_name): Fix test for variable template
1450         instantiation.
1452         * decl.c (begin_destructor_body): Condition clobber on
1453         -flifetime-dse.
1455 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
1457         PR c++/64959
1458         * parser.c (lookup_literal_operator): Return all candidates.
1459         (cp_parser_userdef_char_literal): Simplify error handling.
1460         (cp_parser_userdef_numeric_literal):  Pass tf_warning_or_error.
1461         (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
1462         Also give higher priority to standard string UDL operator.
1464 2015-02-12  Jakub Jelinek  <jakub@redhat.com>
1466         PR debug/55541
1467         * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
1468         * decl.c (poplevel): If functionbody, try not to create an extra
1469         BLOCK for function body and use subblocks as that, if it is non-NULL
1470         and doesn't have siblings.  Set BLOCK_OUTER_CURLY_BRACE_P flag.
1471         (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
1473         PR sanitizer/64984
1474         * except.c (check_noexcept_r): Return NULL for internal
1475         calls.
1477 2015-02-10  Jason Merrill  <jason@redhat.com>
1479         PR c++/64994
1480         * constexpr.c (cxx_eval_call_expression): Walk the clone list.
1482 2015-02-10  Jan Hubicka  <hubicka@ucw.cz>
1484         PR ipa/64982
1485         * method.c (use_thunk): Do not check for stdarg thunks.
1487 2015-02-06  Jason Merrill  <jason@redhat.com>
1489         PR c++/64899
1490         * init.c (build_vec_init): Handle default-initialized array with
1491         constexpr default constructor.
1493 2015-02-04  Jakub Jelinek  <jakub@redhat.com>
1495         PR c/64824
1496         PR c/64868
1497         * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
1499 2015-02-03  Paolo Carlini  <paolo.carlini@oracle.com>
1501         PR c++/64877
1502         * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
1503         for generated expressions.
1505 2015-02-02  Ville Voutilainen  <ville.voutilainen@gmail.com>
1507         PR c++/64901
1508         * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
1509         DECL_OVERRIDE_P.
1511 2015-02-02  Jason Merrill  <jason@redhat.com>
1513         * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
1515 2015-01-30  Joseph Myers  <joseph@codesourcery.com>
1517         * class.c, except.c, parser.c, pt.c: All callers of fatal_error
1518         changed to pass input_location as first argument.
1520 2015-01-29  Jakub Jelinek  <jakub@redhat.com>
1522         PR c++/64717
1523         * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
1524         into SAVE_EXPR.
1526 2015-01-29  Jason Merrill  <jason@redhat.com>
1528         PR c++/49508
1529         * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
1530         erroneous return statement.
1532         PR c++/64521
1533         * repo.c (repo_emit_p): It's OK for a clone to be extern at this
1534         point.
1536 2015-01-27  Caroline Tice  <cmtice@google.com>
1538         Committing VTV Cywin/Ming patch for Patrick Wollgast
1539         * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
1540         check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
1542 2015-01-27  Jason Merrill  <jason@redhat.com>
1544         PR c++/58597
1545         * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
1546         current_function_decl.
1548         PR c++/63889
1549         * pt.c (finish_template_variable): Move from semantics.c.
1550         Handle multiple template arg levels.  Handle coercion here.
1551         (lookup_template_variable): Not here.
1553 2015-01-23  Jason Merrill  <jason@redhat.com>
1555         PR c++/64314
1556         PR c++/57510
1557         * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
1558         that has been completely split out.
1560         PR c++/64701
1561         * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
1562         statement codes.
1564         PR c++/64727
1565         * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
1566         of CONST_DECL.
1568 2015-01-21  Jason Merrill  <jason@redhat.com>
1570         PR c++/64603
1571         * constexpr.c (cxx_eval_constant_expression): Only shortcut
1572         constant CONSTRUCTORs.
1574         PR c++/64647
1575         * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
1576         give a hard error in a template instantiation.
1578 2015-01-21  Richard Biener  <rguenther@suse.de>
1580         PR middle-end/64313
1581         * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
1582         for builtins the user declared correctly.
1584 2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
1586         PR c++/58614
1587         * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
1588         TREE_TYPE (elt) == error_mark_node.
1590 2015-01-15  Jan Hubicka  <hubicka@ucw.cz>
1592         PR tree-optimization/62053
1593         * tree.c (build_cplus_array_type): Layout type after variants are set.
1595 2015-01-15  Jakub Jelinek  <jakub@redhat.com>
1597         * cp-gimplify.c (cp_genericize_r): Call
1598         cp_ubsan_maybe_instrument_member_call for member calls.
1599         (cp_ubsan_check_member_access_r): New function.
1600         (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
1601         * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
1602         cp_ubsan_instrument_member_accesses,
1603         cp_ubsan_maybe_instrument_downcast,
1604         cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
1605         * cp-ubsan.c: New file.
1606         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
1607         * constexpr.c (cxx_eval_call_expression): Return void_node
1608         for IFN_UBSAN_VPTR.
1609         (potential_constant_expression_1): Return true for
1610         UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
1611         * typeck.c (build_class_member_access_expr): Provide locus
1612         for COMPONENT_REFs.
1613         (build_static_cast_1): Instrument downcasts.
1614         * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
1615         add ubsan instrumentation for virtual_access.
1616         * call.c: Include internal-fn.h.
1617         (set_flags_from_callee): Handle internal calls.
1619 2015-01-15  Momchil Velikov  <momchil.velikov@gmail.com>
1621         PR c++/59366
1622         * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
1623         and function templates, declared only in the class.
1624         * decl.c (duplicate_decls): Reveal hidden friend functions or
1625         function templates, if they are redeclared outside the class.
1627 2015-01-15  Jason Merrill  <jason@redhat.com>
1629         PR c++/64356
1630         * constexpr.c (cxx_eval_binary_expression): Fix pasto.
1632         PR c++/63283
1633         * constexpr.c (potential_constant_expression_1): Handle reference
1634         args in templates.
1636 2015-01-15  Thomas Schwinge  <thomas@codesourcery.com>
1637             James Norris  <jnorris@codesourcery.com>
1638             Cesar Philippidis  <cesar@codesourcery.com>
1639             Ilmir Usmanov  <i.usmanov@samsung.com>
1640             Jakub Jelinek  <jakub@redhat.com>
1642         * parser.c: Include "gomp-constants.h".
1643         (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
1644         omp_clause_map_kind.  Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
1645         Use OMP_CLAUSE_SET_MAP_KIND.
1646         (cp_parser_omp_construct, cp_parser_pragma): Handle
1647         PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
1648         PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
1649         PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
1650         (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
1651         "create", "delete", "deviceptr", "host", "num_gangs",
1652         "num_workers", "present", "present_or_copy", "pcopy",
1653         "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
1654         "present_or_create", "pcreate", "vector_length", "wait".
1655         (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
1656         (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
1657         (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
1658         (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
1659         (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
1660         (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
1661         (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
1662         (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
1663         (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
1664         (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
1665         (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
1666         (cp_parser_oacc_kernels, cp_parser_oacc_loop)
1667         (cp_parser_oacc_parallel, cp_parser_oacc_update)
1668         (cp_parser_oacc_wait): New functions.
1669         * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
1670         (finish_oacc_parallel): New prototypes.
1671         * semantics.c: Include "gomp-constants.h".
1672         (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR.  Use
1673         GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.  Use
1674         OMP_CLAUSE_SET_MAP_KIND.
1675         (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
1676         OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
1677         Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
1678         (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
1679         functions.
1681 2015-01-14  Paolo Carlini  <paolo.carlini@oracle.com>
1683         PR c++/58671
1684         * decl2.c (var_defined_without_dynamic_init): Handle gracefully
1685         self-initialization.
1687 2015-01-13  Jason Merrill  <jason@redhat.com>
1689         PR c++/64356
1690         PR libstdc++/58777
1691         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1692         pointer expressions.
1693         (cxx_eval_increment_expression): Likewise.
1695         PR c++/64514
1696         * pt.c (coerce_template_parameter_pack): Return NULL for a
1697         zero-length fixed parameter pack with a pack expansion arg.
1699         PR c++/64520
1700         * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
1702 2015-01-12  Jason Merrill  <jason@redhat.com>
1704         PR c++/64547
1705         * constexpr.c (cxx_eval_call_expression): A call to a void
1706         function doesn't need to return a value.
1708 2015-01-09  Michael Collison  <michael.collison@linaro.org>
1710         * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
1711         input.h, alias.h, symtab.h, options.h, fold-const.h,
1712         wide-int.h, and inchash.h due to flattening of tree.h.
1713         * class.c: Ditto.
1714         * constexpr.c: Ditto.
1715         * cp-array-notation.c: Ditto.
1716         * cp-gimplify.c: Ditto.
1717         * cp-lang.c: Ditto.
1718         * cp-objcp-common.c: Ditto.
1719         * cvt.c: Ditto.
1720         * decl2.c: Ditto.
1721         * decl.c: Ditto.
1722         * dump.c: Ditto.
1723         * error.c: Ditto.
1724         * except.c: Ditto.
1725         * expr.c: Ditto.
1726         * friend.c: Ditto.
1727         * init.c: Ditto.
1728         * lambda.c: Ditto.
1729         * lex.c: Ditto.
1730         * mangle.c: Ditto.
1731         * name-lookup.c: Ditto.
1732         * optimize.c: Ditto.
1733         * parser.c: Ditto.
1734         * pt.c: Ditto.
1735         * ptree.c: Ditto.
1736         * repo.c: Ditto.
1737         * rtti.c: Ditto.
1738         * search.c: Ditto.
1739         * semantics.c: Ditto.
1740         * tree.c: Ditto.
1741         * typeck2.c: Ditto.
1742         * typeck.c: Ditto.
1744 2015-01-08  Jason Merrill  <jason@redhat.com>
1746         * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
1747         * decl.c (compute_array_index_type): Likewise.
1748         * init.c (build_vec_init): Likewise.
1749         * typeck.c (cp_build_binary_op): Likewise.
1751 2015-01-08  Jason Merrill  <jason@redhat.com>
1753         * init.c (build_vec_init): Call ubsan_instrument_bounds to check
1754         whether an initializer-list is too big for a VLA.
1755         (throw_bad_array_length): Remove.
1756         * cp-tree.h: Remove prototype.
1758 2015-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
1760         PR c++/60753
1761         * decl.c (grokfndecl): Add bool parameter.
1762         (grokdeclarator): Adjust calls.
1763         (start_decl): Don't set DECL_DELETED_FN here.
1765 2015-01-06  Jason Merrill  <jason@redhat.com>
1767         * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
1768         template-ids.
1770         PR c++/64455
1771         * pt.c (type_dependent_expression_p): Handle variable templates.
1772         * constexpr.c (potential_constant_expression_1): Use it.
1774         PR c++/64487
1775         * semantics.c (finish_offsetof): Handle templates here.
1776         * parser.c (cp_parser_builtin_offsetof): Not here.
1778         PR c++/64496
1779         * semantics.c (process_outer_var_ref): Diagnose lambda in local
1780         class NSDMI.
1782 2015-01-06  Ville Voutilainen  <ville.voutilainen@gmail.com>
1784         PR c++/64489
1785         * class.c (check_field_decls): Make copy assignment operators
1786         complex only in c++98 mode.
1788 2015-01-05  Trevor Saunders  <tsaunders@mozilla.com>
1790         PR c++/31397
1791         * class.c (check_for_override): Warn when a virtual function is an
1792         override not marked override.
1794 2015-01-05  Trevor Saunders  <tsaunders@mozilla.com>
1796         * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
1797         hold base_fndecls.
1798         (get_basefndecls): Adjust.
1800 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1802         Update copyright years.
1804 2015-01-05  Marek Polacek  <polacek@redhat.com>
1806         PR c/64423
1807         * typeck.c (cp_build_array_ref): Pass loc down to
1808         warn_array_subscript_with_type_char.
1811 Copyright (C) 2015 Free Software Foundation, Inc.
1813 Copying and distribution of this file, with or without modification,
1814 are permitted in any medium without royalty provided the copyright
1815 notice and this notice are preserved.