Update ChangeLog and version files for release
[official-gcc.git] / gcc / cp / ChangeLog
blobdc2de7696fba5a7bc24a1a5ec2f5062494863548
1 2016-04-27  Release Manager
3         * GCC 6.1.0 released.
5 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
7         PR bootstrap/70704
8         * pt.c (build_non_dependent_expr): Temporarily disable flag_checking
9         guarded code.
11 2016-04-22  Jason Merrill  <jason@redhat.com>
13         PR c++/68206
14         PR c++/68530
15         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
16         and GOTO_EXPR.
18         PR c++/70522
19         * name-lookup.c (qualified_lookup_using_namespace): Look through
20         hidden names.
22 2016-04-19  Jason Merrill  <jason@redhat.com>
24         PR c++/66543
25         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
26         * pt.c (make_pack_expansion): Call mark_exp_read.
27         * semantics.c (finish_id_expression): Call mark_type_use in
28         unevaluated context.
30 2016-04-18  Jason Merrill  <jason@redhat.com>
32         PR c++/70690
33         PR c++/70528
34         * class.c (type_maybe_constexpr_default_constructor): New.
35         (type_has_constexpr_default_constructor): Revert.
37         PR c++/70505
38         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
39         unknown_type_node, too.
41 2016-04-15  Jason Merrill  <jason@redhat.com>
43         PR c++/70685
44         * constexpr.c (get_fundef_copy): Handle null *slot.
46 2016-04-15  Jason Merrill  <jason@redhat.com>
47             Nathan Sidwell  <nathan@acm.org>
49         PR c++/70594
50         * constexpr.c (constexpr_call_table): Preserve in GC.
51         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
52         (fundef_copies_table): Preserve in GC. Change to pointer to
53         tree->tree hash.
54         (maybe_initialize_fundef_copies_table): Adjust.
55         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
56         (save_fundef_copy): Adjust for a TREE_LIST.
57         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
58         (fini_constexpr): New.
59         * cp-tree.h (fini_constexpr): Declare.
60         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
62 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
64         PR c/70436
65         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
66         where needed.
67         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
68         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
69         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
70         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
71         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
72         cp_parser_statement.
73         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
74         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
75         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
76         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
77         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
78         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
79         cp_parser_omp_taskloop, cp_parser_omp_construct,
80         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
81         Add IF_P argument, pass it down where needed.
82         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
83         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
84         calls.
86 2016-04-14  Jason Merrill  <jason@redhat.com>
88         PR c++/70494
89         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
90         * typeck2.c (split_nonconstant_init_1): Use it.
92         PR c++/70528
93         * class.c (type_has_constexpr_default_constructor): Return true
94         for an implicitly declared constructor.
96         PR c++/70622
97         * parser.c (cp_parser_init_declarator): Add auto_result parm.
98         (cp_parser_simple_declaration): Pass it.
99         (strip_declarator_types): New.
101         PR c++/70543
102         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
103         initializer also makes the variable value-dependent.
105         PR c++/70648
106         * constexpr.c (cxx_eval_store_expression): Also copy
107         CONSTRUCTOR_NO_IMPLICIT_ZERO.
109 2016-04-14  Martin Sebor  <msebor@redhat.com>
111         PR c++/69517
112         PR c++/70019
113         PR c++/70588
114         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
116 2016-04-14  Jason Merrill  <jason@redhat.com>
118         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
119         parameter ABI change.
121 2016-04-13  Martin Sebor  <msebor@redhat.com>
123         PR c++/69517
124         PR c++/70019
125         PR c++/70588
126         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
127         functions.
128         * decl.c (check_initializer, cp_finish_decl): Call them.
129         (reshape_init_r): Reject incompletely braced intializer-lists
130         for VLAs.
131         * init.c (throw_bad_array_length, build_vla_check)
132         (build_vla_size_check, build_vla_init_check): Define new functions.
133         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
134         to detect a VLA.
135         (store_init_value): Same.
137 2016-04-13  Jason Merrill  <jason@redhat.com>
139         Warn about empty parameter ABI with -Wabi=9.
140         * call.c (empty_class_msg, mark_for_abi_warning)
141         (warn_empty_class_abi): New.
142         (build_call_a): Use them.
143         * decl.c (store_parm_decls): Use mark_for_abi_warning.
144         * error.c (pp_format_to_string): New.
146         Pass empty class parameters like C.
147         * call.c (pass_as_empty_struct, empty_class_arg): New.
148         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
149         (build_call_a): Use empty_class_arg.
150         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
151         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
153 2016-04-13  Jason Merrill  <jason@redhat.com>
155         PR c++/70627
156         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
158 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
160         PR c++/70635
161         * pt.c (resolve_typename_type): Fix typos in infinite recursion
162         avoidance mechanism.
164 2016-04-13  Jason Merrill  <jason@redhat.com>
166         PR c++/70634
167         * pt.c (instantiation_dependent_uneval_expression_p): Split out
168         from instantiation_dependent_expression_p.
169         (value_dependent_expression_p): Use it for unevaluated operands.
170         (instantiation_dependent_r): Don't check value-dependence.
171         (instantiation_dependent_expression_p): Check
172         value-dependence of the expression as a whole.
173         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
174         * semantics.c (finish_decltype_type): Use it.
176         * constexpr.c (potential_nondependent_constant_expression): New.
177         (potential_nondependent_static_init_expression): New.
178         (maybe_constant_value_1, fold_non_dependent_expr)
179         (maybe_constant_init): Use them.
180         * pt.c (instantiate_non_dependent_expr_sfinae)
181         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
182         them.
183         * cp-tree.h: Declare them.
185 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
187         PR c++/70594
188         * decl.c (pop_labels_1): Removed.
189         (note_label, sort_labels): New functions.
190         (pop_labels): During named_labels traversal, just push the slot
191         pointers into a vector, then qsort it by DECL_UID and only then
192         call pop_label and chain it into BLOCK_VARS.
194 2016-04-13  Jason Merrill  <jason@redhat.com>
196         PR c++/70615
197         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
198         (cp_gimplify_expr): Not here.
200 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
202         PR c++/70610
203         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
204         recurse into it.
205         * typeck.c (build_x_conditional_expr): Unconditionally remember
206         that the result is an lvalue or xvalue.
208 2016-04-12  Jason Merrill  <jason@redhat.com>
210         * class.c (is_really_empty_class): A zero-length array is empty.
211         An unnamed bit-field doesn't make a class non-empty.
213 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
215         PR c++/68722
216         * parser.c (cp_parser_cache_defarg): When file ends in default
217         argument simply return error_mark_node.
219 2016-04-12  Nathan Sidwell  <nathan@acm.org>
221         PR c++/70501
222         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
223         similarly to PMF.
225 2016-04-11  Jason Merrill  <jason@redhat.com>
227         * mangle.c (decl_is_template_id): The template itself counts as a
228         template-id.
230 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
232         PR c++/70590
233         PR c++/70452
234         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
235         on the result if it's not a CONSTRUCTOR.
237 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
239         PR c++/70452
240         * constexpr.c (find_constructor): New function.
241         (unshare_constructor): New function.
242         (cxx_eval_call_expression): Use unshare_constructor instead of
243         unshare_expr.
244         (find_array_ctor_elt): Likewise.
245         (cxx_eval_vec_init_1): Likewise.
246         (cxx_eval_store_expression): Likewise.
247         (cxx_eval_constant_expression): Likewise.
249 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
251         PR c/70436
252         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
253         potentially generating a future -Wparentheses warning in its
254         callers.
256 2016-04-06  Jason Merrill  <jason@redhat.com>
258         * class.c (check_abi_tags): Fix function template handling.
260 2016-04-05  Nathan Sidwell  <nathan@acm.org>
262         PR c++/70512
263         * class.c (fixup_may_alias): New.
264         (fixup_attribute_variants): Call it.
266 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
268         PR c++/70452
269         * constexpr.c (struct fundef_copy): New struct.
270         (struct fundef_copies_table_t): New struct.
271         (fundef_copies_table): New static variable.
272         (maybe_initialize_fundef_copies_table): New static function.
273         (get_fundef_copy): New static function.
274         (save_fundef_copy): New static function.
275         (cxx_eval_call_expression): Use get_fundef_copy, and
276         save_fundef_copy.
277         (constexpr_call_table): Add "deletable" GTY marker.
279 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
281         PR c++/70452
282         * cp-tree.h (class cache_map): Remove.
283         * constexpr.c (cv_cache): Change type to
284         GTY((deletable)) hash_map<tree, tree> *.
285         (maybe_constant_value): Adjust following the change to cv_cache.
286         (clear_cv_cache): New static function.
287         (clear_cv_and_fold_caches): Use it.
288         * cp-gimplify.c (fold_cache): Change type to
289         GTY((deletable)) hash_map<tree, tree> *.
290         (clear_fold_cache): Adjust following the change to fold_cache.
291         (cp_fold): Likewise.
293 2016-04-02  Martin Sebor  <msebor@redhat.com>
295         PR c++/67376
296         PR c++/70170
297         PR c++/70172
298         PR c++/70228
299         * constexpr.c (diag_array_subscript): New function.
300         (cxx_eval_array_reference): Detect out of bounds array indices.
302 2016-04-01  Jason Merrill  <jason@redhat.com>
304         PR c++/70449
305         PR c++/70344
306         * pt.c (instantiate_decl): A function isn't fully defined if
307         DECL_INITIAL is error_mark_node.
308         * constexpr.c (cxx_eval_call_expression): Likewise.
310 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
311             Marek Polacek  <polacek@redhat.com>
313         PR c++/70488
314         * init.c (warn_placement_new_too_small): Test whether
315         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
317 2016-04-01  Nathan Sidwell  <nathan@acm.org>
319         PR c++/68475
320         * decl.c (check_redeclaration_exception_specification): Check
321         regardless of -fno-exceptions.
322         * typeck2.c (merge_exception_specifiers): Relax assert by checking
323         flag_exceptions too.
325 2016-03-31  Nathan Sidwell  <nathan@acm.org>
327         * decl.c (start_preparsed_function): Remove unnecessary bracing.
328         (finish_destructor_body): Don't emit operator delete here.
330 2016-03-31  Nathan Sidwell  <nathan@acm.org>
332         PR c++/70393
333         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
334         elements in field order.
336 2016-03-31  Marek Polacek  <polacek@redhat.com>
338         PR c/70297
339         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
341 2016-03-31  Richard Biener  <rguenther@suse.de>
343         PR c++/70430
344         * typeck.c (cp_build_binary_op): Fix operand order of vector
345         conditional in truth op handling.
347 2016-03-29  Jason Merrill  <jason@redhat.com>
349         PR c++/70353
350         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
351         in constexpr functions.
353 2016-03-28  Jason Merrill  <jason@redhat.com>
355         PR c++/70422
356         PR c++/64266
357         PR c++/70353
358         * decl.c, pt.c, constexpr.c: Revert last patch.
360 2016-03-25  Jason Merrill  <jason@redhat.com>
361             Martin LiÅ¡ka  <mliska@suse.cz>
363         PR c++/64266
364         PR c++/70353
365         Core issue 1962
366         * decl.c (cp_fname_init): Decay the initializer to pointer.
367         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
368         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
369         Don't call cp_finish_decl.
370         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
371         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
372         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
373         Handle DECL_VALUE_EXPR.
375 2016-03-24  Jason Merrill  <jason@redhat.com>
377         PR c++/70386
378         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
380         PR c++/70323
381         * constexpr.c (cxx_eval_call_expression): Don't cache result if
382         *overflow_p.
384 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
386         PR c++/62212
387         * tree.c (build_cplus_array_type): Determine type-dependentess
388         with uses_template_parms instead of with dependent_type_p.
390 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
392         PR c++/70347
393         * typeck.c (process_init_constructor_union): If the initializer
394         is empty, use the union's NSDMI if it has one.
396 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
398         PR c++/70332
399         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
400         NSDMI that's part of an aggregrate initialization.
402 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
404         PR c++/70001
405         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
406         for 1..max even for multi-dimensional arrays.  Call unshare_expr
407         on it.
409         PR c++/70323
410         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
411         on TREE_OVERFLOW constants.
413         PR c++/70376
414         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
415         for OMP_TASKLOOP here.
416         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
417         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
419 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
420             Jason Merrill  <jason@redhat.com>
421             Jakub Jelinek  <jakub@redhat.com>
423         PR c++/69315
424         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
425         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
426         (finish_function): Don't set or test them.
427         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
429 2016-03-23  Jason Merrill  <jason@redhat.com>
431         PR c++/70344
432         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
434 2016-03-23  Marek Polacek  <polacek@redhat.com>
436         PR c++/69884
437         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
439 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
441         * call.c (build_conditional_expr_1): Always use original
442         condition type for vector type checks and build.
444 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
446         PR c++/70096
447         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
449 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
451         PR c++/70204
452         * constexpr.c (non_const_var_error): Check
453         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
455 2016-03-21  Richard Henderson  <rth@redhat.com>
457         PR c++/70273
458         * decl.c (notice_forced_label_r): New.
459         (cp_finish_decl): Use it.
461 2016-03-21  Jason Merrill  <jason@redhat.com>
463         PR c++/70285
464         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
466 2016-03-18  Jason Merrill  <jason@redhat.com>
468         PR c++/70139
469         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
471         PR c++/70147
472         * class.c (vptr_via_virtual_p): New.
473         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
474         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
475         a vptr from any virtual base in a not-in-charge 'structor.
477         * decl.c (build_clobber_this): Factor out of
478         start_preparsed_function and begin_destructor_body.  Handle
479         virtual bases better.
481         * class.c (build_if_in_charge): Split out from build_base_path.
482         * init.c (expand_virtual_init, expand_default_init): Use it.
483         * call.c (build_special_member_call): Use it.
485 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
487         PR c++/70267
488         * init.c (build_new_1): Complain and return error_mark_node
489         if alloc_fn is not _Jv_AllocObject function returning pointer.
491 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
493         PR c++/70205
494         * search.c (adjust_result_of_qualified_name_lookup): Don't
495         update the BASELINK_BINFO of DECL if the second call
496         to lookup_base fails.
498 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
500         PR c++/70218
501         * parser.c (cp_parser_lambda_expression): Move call to
502         pop_deferring_access_checks ahead of the call to
503         cp_parser_end_tentative_firewall.
505 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
507         PR c++/70144
508         * cp-tree.h (magic_varargs_p): Return int instead of bool.
509         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
510         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
511         varargs.
512         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
513         if magic_varargs_p == 1, call decay_conversion
514         instead of mark_type_use.  Don't store error_mark_node arguments to
515         argarray, instead return error_mark_node.
517         PR c++/70272
518         * decl.c (begin_destructor_body): Don't insert clobber if
519         is_empty_class (current_class_type).
521 2016-03-17  Marek Polacek  <polacek@redhat.com>
523         PR c++/70194
524         * typeck.c (warn_for_null_address): New function.
525         (cp_build_binary_op): Call it.
527 2016-03-16  Jason Merrill  <jason@redhat.com>
529         PR c++/70259
530         * decl.c (start_preparsed_function): Don't clobber an empty base.
532 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
534         PR c++/70147
535         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
536         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
538         PR c++/70147
539         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
540         set in_base_initializer.
542 2016-03-15  Marek Polacek  <polacek@redhat.com>
544         PR c++/70209
545         * tree.c (strip_typedefs): Call strip_typedefs again on the
546         DECL_ORIGINAL_TYPE result.
548 2016-03-15  Jason Merrill  <jason@redhat.com>
550         PR c++/70095
551         * pt.c (instantiate_decl): Fix call to variable_template_p.
553         PR c++/70141
554         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
556 2016-03-14  Casey Carter  <casey@carter.net>
557             Jason Merrill  <jason@redhat.com>
559         P0184R0: Generalizing the Range-Based For Loop
560         * parser.c (cp_convert_range_for): Set the type of __end separately.
561         (cp_parser_perform_range_for_lookup): Allow different begin/end
562         types if they are comparable.
564 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
566         PR c++/70106
567         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
568         processing_template_decl and EXPR is a SCOPE_REF.
570 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
571             Jakub Jelinek  <jakub@redhat.com>
573         PR c++/70001
574         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
575         return value from cxx_eval_constant_expression from earlier
576         elements if it is valid constant initializer requiring no
577         relocations.
579 2016-03-10  Marek Polacek  <polacek@redhat.com>
581         PR c++/70153
582         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
584 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
586         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
587         when calling c_finish_omp_clauses.
589 2016-03-08  Jason Merrill  <jason@redhat.com>
591         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
592         diagnostic for use of "concept".
593         (cp_parser_requires_clause_opt): And "requires".
594         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
595         (cp_parser_explicit_template_declaration): Adjust.
596         * Make-lang.in (check-c++-all): Add "concepts" to std list.
598         P0036R0: Unary Folds and Empty Parameter Packs
599         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
601 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
603         PR c++/70135
604         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
605         even after the last iteration of the loop.
607         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
609 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
611         PR c++/66786
612         * pt.c (get_template_info): Handle PARM_DECL.
613         (template_class_depth): Check DECL_P instead of
614         VAR_OR_FUNCTION_DECL_P.
616 2016-03-05  Jason Merrill  <jason@redhat.com>
618         PR c++/67364
619         * constexpr.c (cxx_eval_store_expression): Replace
620         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
622 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
624         PR c++/66786
625         * pt.c (template_class_depth): Given a lambda type, iterate
626         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
627         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
628         CP_DECL_CONTEXT.
630 2016-03-04  Jason Merrill  <jason@redhat.com>
632         PR c++/69203
633         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
634         * init.c (build_vec_delete_1): Set it.
635         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
637 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
639         * decl.c (start_preparsed_function): Don't emit start clobber at the
640         start of constructor clones.
642         PR c++/70035
643         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
644         * decl.c (start_preparsed_function): Call
645         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
646         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
647         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
649 2016-03-04  Jason Merrill  <jason@redhat.com>
651         PR c++/67364
652         * constexpr.c (cxx_eval_component_reference): Further tweak.
654         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
655         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
656         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
657         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
659         PR c++/70067
660         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
661         same type.
663 2016-03-03  Jason Merrill  <jason@redhat.com>
665         * method.c (synthesized_method_walk): operator= can also be constexpr.
667         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
668         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
670         PR c++/67164
671         * pt.c (copy_template_args): New.
672         (tsubst_pack_expansion): Use it.
674         * call.c (build_aggr_conv): Use get_nsdmi.
676         PR c++/51406
677         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
679         PR c++/67364
680         * constexpr.c (cxx_eval_component_reference): Just return an empty
681         CONSTRUCTOR for an empty class.
683 2016-03-01  Jason Merrill  <jason@redhat.com>
685         PR c++/70036
686         * parser.c (cp_parser_requires_clause): Call
687         check_for_bare_parameter_packs.
689         PR c++/51489
690         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
691         the operands.
693         PR c++/69995
694         * constexpr.c (cxx_eval_call_expression): Unshare arg.
695         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
696         [TARGET_EXPR]: Unshare init.
698 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
700         PR c++/68948
701         PR c++/69961
702         * pt.c (tsubst_baselink): Reinstate the check for an invalid
703         constructor call.
705 2016-02-28  Jason Merrill  <jason@redhat.com>
707         PR c++/69995
708         * constexpr.c (cxx_eval_store_expression): Unshare init.
710 2016-02-26  Jason Merrill  <jason@redhat.com>
712         PR c++/69958
713         * pt.c (make_argument_pack): New.
714         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
715         (tsubst_copy_and_build): Likewise.
717 2016-02-25  Jason Merrill  <jason@redhat.com>
719         PR c++/69889
720         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
721         * tree.c (build_aggr_init_expr): Set it.
722         * semantics.c (simplify_aggr_init_expr): Check it.
723         * cp-gimplify.c (cp_genericize_r): Don't walk into
724         a call/aggr_init from a thunk.
726         PR c++/69842
727         * method.c (forward_parm): Handle parameter packs.
728         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
730         PR c++/67364
731         * constexpr.c (cxx_eval_component_reference): Don't complain about
732         unevaluated empty classes.
734         PR c++/68049
735         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
737 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
739         PR c++/69736
740         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
741         (maybe_undo_parenthesized_ref): Declare.
742         * semantics.c (maybe_undo_parenthesized_ref): Split out from
743         check_return_expr.
744         (finish_call_expr): Use it.
745         * typeck.c (check_return_expr): Use it.
746         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
747         REF_PARENTHESIZED_P flag.
749 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
751         PR c++/69922
752         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
753         Avoid folding it.
754         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
755         tests.
756         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
757         unless they are folded into INTEGER_CST, error_mark_node or some
758         comparison with NULL, avoid folding them and use either the original
759         comparison or non-folded comparison of folded arguments.
760         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
761         comparison, don't fold the comparison right away.
763 2016-02-24  Jason Merrill  <jason@redhat.com>
765         PR c++/69323
766         * friend.c (make_friend_class): Likewise.
767         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
769 2016-02-24  Jason Merrill  <jason@redhat.com>
771         PR c++/69323
772         * pt.c (instantiate_class_template_1): Set
773         processing_template_decl before substituting friend_type.
775 016-02-24  Martin Sebor  <msebor@redhat.com>
777         PR c++/69912
778         * tree.c (build_ctor_subob_ref): Compare types' main variants
779         instead of the types as they are.
781 2016-02-24  Jason Merrill  <jason@redhat.com>
783         * decl.c (start_preparsed_function): Condition ctor clobber on
784         flag_lifetime_dse > 1.
786         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
788 2016-02-19  Jason Merrill  <jason@redhat.com>
790         PR c++/69743
791         * call.c (remaining_arguments): No longer static.
792         * cp-tree.h: Declare it.
793         * pt.c (more_specialized_fn): Use it.
795 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
796             Bernd Edlinger  <bernd.edlinger@hotmail.de>
798         * Make-lang.in: Invoke gperf with -L C++.
799         * cfns.gperf: Remove prototypes for hash and libc_name_p
800         inlines.
801         * cfns.h: Regenerated.
802         * except.c (nothrow_libfn_p): Adjust.
804 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
806         PR c++/69850
807         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
808         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
810 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
812         PR c++/68948
813         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
814         call here.
815         * semantics.c (finish_call_expr): Don't assume a constructor
816         call is dependent if only the "this" pointer is dependent.  When
817         building a constructor call, always use a dummy object.
819 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
821         PR c++/69850
822         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
823         condition.
824         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
825         operators if folding preserved the binop, just with different
826         arguments.
828         PR c++/67767
829         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
830         attr_spec is always single element chain, chain all the attributes
831         properly together in the right order.
833 2016-02-18  Jason Merrill  <jason@redhat.com>
835         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
836         mangle_decl.
837         (mangle_decl): Call maybe_check_abi_tags for function scope.
838         (mangle_guard_variable): Call maybe_check_abi_tags here.
839         (write_guarded_var_name): Not here.
841 2016-02-17  Jason Merrill  <jason@redhat.com>
843         PR c++/65985
844         * constexpr.c (build_constexpr_constructor_member_initializers):
845         Handle an additional STATEMENT_LIST.
847         PR c++/68585
848         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
850         PR c++/68679
851         * decl2.c (reset_type_linkage_2): Look through member templates.
853 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
855         PR c++/69850
856         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
858 2016-02-17  Jason Merrill  <jason@redhat.com>
860         PR c++/69842
861         * method.c (forward_parm): Split out from...
862         (add_one_base_init): ...here.
863         * lambda.c (maybe_add_lambda_conv_op): Use it.
865 2016-02-16  Jason Merrill  <jason@redhat.com>
867         PR c++/10200
868         PR c++/69753
869         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
870         tree.c, typeck2.c: Revert earlier changes.
871         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
872         non-type templates after -> or .
874 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
876         PR c/69835
877         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
879 2016-02-16  Jason Merrill  <jason@redhat.com>
881         PR c++/69657
882         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
883         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
884         * name-lookup.h: Adjust.
886 2016-02-16  James Norris  <jnorris@codesourcery.com>
888         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
889         * semantics.c (finish_omp_clauses): Add deviceptr checking.
891 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
893         PR c++/69658
894         * init.c (expand_default_init): Only call reshape_init
895         in the direct-initialization from an initializer list case.
897 2016-02-15  Jason Merrill  <jason@redhat.com>
899         PR c++/69753
900         * semantics.c (finish_call_expr): Implicit 'this' does not make
901         the call dependent.
902         * search.c (any_dependent_bases_p): Split out...
903         * name-lookup.c (do_class_using_decl): ...from here.
904         * call.c (build_new_method_call_1): Don't complain about missing object
905         if there are dependent bases.  Tweak error.
906         * tree.c (non_static_member_function_p): Remove.
907         * pt.c (type_dependent_expression_p): A member template of a
908         dependent type is dependent.
909         * cp-tree.h: Adjust.
911         PR c++/68890
912         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
914 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
916         PR c++/69098
917         * pt.c (lookup_and_finish_template_variable): New function,
918         extracted from ...
919         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
920         (tsubst_qualified_id): Consider that EXPR might be a variable
921         template.
922         * typeck.c (check_template_keyword): Don't emit an error
923         if DECL is a variable template.
925 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
927         * error.c: Spelling fixes - behaviour -> behavior and
928         neighbour -> neighbor.
929         * decl.c: Likewise.
930         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
931         diagnostics.
932         * init.c (build_delete): Likewise.
934 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
936         PR c/69768
937         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
938         arguments for -Waddress warning.  Fix up formatting.
940 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
942         PR c++/68726
943         * pt.c (lookup_template_class_1): Check tsubst return value for
944         error_mark_node.
946 2016-02-10  Jason Merrill  <jason@redhat.com>
948         PR c++/68926
949         * pt.c (resolve_nondeduced_context): Add complain parm.
950         (do_auto_deduction): Pass it.
951         * cvt.c (convert_to_void): Likewise.
952         * decl.c (cp_finish_decl): Likewise.
953         * init.c (build_new): Likewise.
954         * rtti.c (get_tinfo_decl_dynamic): Likewise.
955         * semantics.c (finish_decltype_type): Likewise.
956         * typeck.c (decay_conversion): Likewise.
957         * cp-tree.h: Adjust declaration.
958         * call.c (standard_conversion): Add complain parm, pass it along.
959         (implicit_conversion): Pass it.
961         PR c++/69657
962         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
963         (lookup_name_real_1): Likewise.
964         (remove_hidden_names): Handle non-functions too.
966         PR c++/10200
967         * parser.c (cp_parser_lookup_name): When looking for a template
968         after . or ->, only consider class templates.
969         (cp_parser_postfix_dot_deref_expression): Handle the current
970         instantiation.  Remember a dependent object expression.
971         * typeck2.c (build_x_arrow): Handle the current instantiation.
973         * ptree.c (debug_tree): Implement for cp_expr.
975 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
977         PR c++/69139
978         * parser.c (cp_parser_simple_type_specifier): Make the check
979         for disambiguating between an 'auto' placeholder and an implicit
980         template parameter more robust.
982 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
984         PR c++/69283
985         PR c++/67835
986         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
987         setting its TREE_USED flag.
989 2016-02-08  Jason Merrill  <jason@redhat.com>
991         PR c++/69657
992         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
993         built-ins alone.
995 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
997         PR c++/59627
998         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
999         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1001 2016-02-08  Marek Polacek  <polacek@redhat.com>
1003         PR c++/69688
1004         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1005         Call clear_fold_cache.
1006         * cp-tree.h: Adjust declaration.
1007         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1008         rather than clear_cv_cache and clear_fold_cache.
1009         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1011 2016-02-08  Jason Merrill  <jason@redhat.com>
1013         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1014         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1015         (ocp_convert): Use *_maybe_fold.
1016         (cp_convert_to_pointer): Add dofold parameter.
1017         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1019 2016-02-05  Martin Sebor  <msebor@redhat.com>
1021         PR c++/69662
1022         * init.c (find_field_init): New function.
1023         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1024         at ends of structures special.
1026 2016-02-05  Jason Merrill  <jason@redhat.com>
1028         PR c++/68948
1029         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1030         make sure we've seen_error().
1032 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1034         PR c++/68948
1035         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1036         if lookup_fnfields returns NULL_TREE and the name being looked
1037         up has the form A::A.
1039 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1041         * constexpr.c (cxx_eval_binary_expression): Fold equality
1042         comparisons involving PTRMEM_CSTs.
1044 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1046         * class.c (find_flexarrays): Don't declare dom variable.
1047         (diagnose_flexarray): Likewise.
1049 2016-02-02  Martain Sebor  <msebor@redhat.com>
1051         PR c++/69251
1052         PR c++/69253
1053         PR c++/69290
1054         PR c++/69277
1055         PR c++/69349
1056         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1057         of a flexible array member for equality to null.
1058         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1059         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1060         (check_flexarrays): Same.
1061         * decl.c (compute_array_index_type): Avoid special case for flexible
1062         array members.
1063         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1064         array members.
1065         * error.c (dump_type_suffix): Revert changes introduced in r231665
1066         and rendered unnecessary by the changes above.
1067         * pt.c (tsubst):  Same.
1068         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1069         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1070         (process_init_constructor_array): Same.
1071         (process_init_constructor_record): Same.
1073 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1075         PR c++/69056
1076         * pt.c (try_one_overload): Handle comparing argument packs so
1077         that there is no conflict if we deduced more arguments of an
1078         argument pack than were explicitly specified.
1080 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1081             Jason Merrill  <jason@redhat.com>
1083         PR c++/68763
1084         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1085         function type if nothing is changing.
1087 2016-01-31  Jason Merrill  <jason@redhat.com>
1089         PR c++/69009
1090         * pt.c (partial_specialization_p, impartial_args): New.
1091         (instantiate_decl): Call impartial_args.
1093         * mangle.c (maybe_check_abi_tags): New.
1094         (write_guarded_var_name): Call it.
1095         (mangle_ref_init_variable): Call check_abi_tags.
1097         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1098         between template and instantiation.
1100 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1102         PR debug/66869
1103         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1104         function declarations.
1106 2016-01-29  Marek Polacek  <polacek@redhat.com>
1108         PR c++/69509
1109         PR c++/69516
1110         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1111         out of bound" error earlier.
1112         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1113         commentary.
1115 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1117         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1118         structure, update free_binding_level before the structure's
1119         level_chain field gets cleared, not after.
1121 2016-01-28  Jason Merrill  <jason@redhat.com>
1123         PR c++/67407
1124         * search.c (dfs_walk_once, dfs_walk_once_r)
1125         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1126         hash_set instead of BINFO_MARKED.
1127         (dfs_unmark_r): Remove.
1129 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1131         PR c++/24208
1132         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1133         (cp_lexer_debugging_p): Use it.
1134         (cp_lexer_start_debugging): Likewise.
1135         (cp_lexer_stop_debugging): Likewise.
1137 2016-01-27  Marek Polacek  <polacek@redhat.com>
1139         PR c/68062
1140         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1141         needed.  Add -Wsign-compare warning.
1143 2016-01-27  Ryan Burn  <contact@rnburn.com>
1145         PR cilkplus/69267
1146         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1147         superfluous post_p argument in call to
1148         cilk_gimplify_call_params_in_spawned_fn.
1150 2016-01-27  Marek Polacek  <polacek@redhat.com>
1152         PR c++/69379
1153         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1154         wrapped in NOP_EXPRs.
1156 2016-01-27  Martin Sebor  <msebor@redhat.com>
1158         PR c++/69317
1159         * mangle.c (mangle_decl): Reference the correct (saved) version
1160         of the ABI in -Wabi diagnostics.
1162 2016-01-27  Marek Polacek  <polacek@redhat.com>
1164         PR c++/69496
1165         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1166         elements of the array.
1168 2016-01-26  Jason Merrill  <jason@redhat.com>
1170         PR c++/68949
1171         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1172         (cxx_eval_call_expression): Don't look through clones.
1173         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1174         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1175         maybe-in-charge *tor.
1177 2016-01-26  Jason Merrill  <jason@redhat.com>
1179         PR c++/68782
1180         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1181         and TREE_SIDE_EFFECTS.
1182         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1183         verify_constructor_flags.
1185 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1187         PR c++/68357
1188         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1189         return error_mark_node instead of building trees with error_mark_node
1190         operands.
1192 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1194         PR other/69006
1195         * error.c (print_instantiation_partial_context_line): Add missing
1196         newlines from output for the t == NULL case.
1197         (print_instantiation_partial_context): Remove call to pp_newline.
1199 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
1201         Revert:
1202         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1204         PR c++/11858
1205         PR c++/24663
1206         PR c++/24664
1207         * decl.c (grokdeclarator): Don't decay array parameter type to
1208         a pointer type if it's dependent.
1209         (grokparms): Invoke strip_top_quals instead of directly invoking
1210         cp_build_qualified_type.
1211         * pt.c (decay_dependent_array_parm_type): New static function.
1212         (type_unification_real): Call decay_dependent_array_parm_type
1213         to decay a dependent array parameter type to its corresponding
1214         pointer type before unification.
1215         (more_specialized_fn): Likewise.
1216         (get_bindings): Likewise.
1217         * tree.c (cp_build_qualified_type): Trivial typofix in
1218         documentation.
1220 2016-01-23  Martin Sebor  <msebor@redhat.com>
1222         PR c++/58109
1223         PR c++/69022
1224         * decl2.c (is_late_template_attribute): Handle dependent argument
1225         to attribute align and attribute vector_size.
1227 2016-01-21  Jason Merrill  <jason@redhat.com>
1229         PR c++/69392
1230         * lambda.c (lambda_capture_field_type): Handle 'this' specially
1231         for init-capture, too.
1233         PR c++/65687
1234         * decl.c (type_is_deprecated): Don't look into a typedef.
1236         PR c++/40751
1237         PR c++/64987
1238         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1240         PR c++/43407
1241         * decl.c (start_enum): Add attributes parameter.
1242         * parser.c (cp_parser_enum_specifier): Pass it.
1243         * pt.c (lookup_template_class_1): Pass it.
1244         * cp-tree.h: Adjust.
1246 2016-01-19  Jason Merrill  <jason@redhat.com>
1248         PR c++/59759
1249         * pt.c (convert_template_argument): Handle VAR_DECL properly.
1251 2016-01-19  Marek Polacek  <polacek@redhat.com>
1253         PR c++/68586
1254         * constexpr.c (clear_cv_cache): New.
1255         * cp-gimplify.c (clear_fold_cache): New.
1256         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1257         * decl.c (finish_enum_value_list): Call them.
1259         PR c++/68965
1260         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1262 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1264         PR c++/11858
1265         PR c++/24663
1266         PR c++/24664
1267         * decl.c (grokdeclarator): Don't decay array parameter type to
1268         a pointer type if it's dependent.
1269         (grokparms): Invoke strip_top_quals instead of directly invoking
1270         cp_build_qualified_type.
1271         * pt.c (decay_dependent_array_parm_type): New static function.
1272         (type_unification_real): Call decay_dependent_array_parm_type
1273         to decay a dependent array parameter type to its corresponding
1274         pointer type before unification.
1275         (more_specialized_fn): Likewise.
1276         (get_bindings): Likewise.
1277         * tree.c (cp_build_qualified_type): Trivial typofix in
1278         documentation.
1280 2016-01-18  Jason Merrill  <jason@redhat.com>
1282         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1284         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1286         PR c++/68767
1287         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
1288         (contains_label_1, contains_label_p): Remove.
1290 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1292         PR c++/69091
1293         * pt.c (type_dependent_expression_p): For a function template
1294         specialization, a type is dependent iff any of its template
1295         arguments are.
1297 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1299         * cp-array-notation.c (cp_expand_cond_array_notations): Return
1300         error_mark_node only if find_rank failed, not if it was
1301         successful.
1303 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1305         PR c++/68936
1306         * tree.c (build_min_non_dep_call_vec): Don't retain the
1307         KOENIG_LOOKUP_P flag of the non-dependent expression that's
1308         been built.
1309         (build_min_non_dep_op_overload): Instead, do it here.
1311 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
1313         PR bootstrap/68271
1314         * parser.h (cp_token): Remove pragma_kind field.  Add comment
1315         with number of unused bits.
1316         * parser.c (eof_token): Remove pragma_kind field initializer.
1317         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1318         field, don't clear CPP_PRAGMA u.value.
1319         (cp_parser_pragma_kind): New function.
1320         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1321         cp_parser_omp_construct, cp_parser_initial_pragma,
1322         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1323         pragma_kind field.
1325 2016-01-15  Jason Merrill  <jason@redhat.com>
1327         PR c++/68847
1328         * call.c (build_cxx_call): Use fold_non_dependent_expr.
1330         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1331         value.
1333         PR c++/69257
1334         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1335         array/function-to-pointer conversion.  Call
1336         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1337         * call.c (convert_like_real): Print call context if
1338         decay_conversion errors.
1340 2016-01-14  Tom de Vries  <tom@codesourcery.com>
1342         PR tree-optimization/68773
1343         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1344         set force_output.
1346 2016-01-14  Jason Merrill  <jason@redhat.com>
1348         PR c++/69261
1349         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
1351 2016-01-12  Marek Polacek  <polacek@redhat.com>
1353         PR c++/68979
1354         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
1355         error_at and adjust the return value.
1357 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
1359         PR objc++/68511
1360         PR c++/69213
1361         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
1362         GS_ERROR whenever seen_error (), only if *expr_p contains
1363         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
1365         PR c++/66808
1366         PR c++/69000
1367         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
1369 2016-01-11  Jason Merrill  <jason@redhat.com>
1371         PR c++/69131
1372         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
1373         (process_subob_fn): Likewise.  Don't consider triviality if true.
1374         (synthesize_method_walk): Pass it.
1376 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
1378         PR c++/68795
1379         * parser.c (cp_parser_postfix_expression): Initialize
1380         close_paren_loc to UNKNOWN_LOCATION; only use it if
1381         it has been written to by
1382         cp_parser_parenthesized_expression_list.
1383         (cp_parser_parenthesized_expression_list): Document the behavior
1384         with respect to the CLOSE_PAREN_LOC param.
1386 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
1388         PR c++/69211
1389         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1390         folded operands have side-effects, but folding changed any of them,
1391         build a new tree with the folded operands instead of returning the
1392         unfolded tree.
1394 2016-01-09  Marek Polacek  <polacek@redhat.com>
1396         PR c++/69113
1397         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1399 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
1401         PR c++/69164
1402         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1404 2016-01-08  Jason Merrill  <jason@redhat.com>
1406         PR c++/69158
1407         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1408         in completion.
1410 2016-01-08  Marek Polacek  <polacek@redhat.com>
1412         PR c++/68449
1413         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1415 2016-01-08  Jason Merrill  <jason@redhat.com>
1417         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1418         workaround.
1420         PR c++/68983
1421         PR c++/67557
1422         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1423         TREE_ADDRESSABLE type.
1425         PR c++/68983
1426         PR c++/67557
1427         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1429 2016-01-05  Nathan Sidwell  <nathan@acm.org>
1431         PR c++/58583
1432         * pt.c (build_non_dependent_expr): Don't try a checking fold when
1433         parsing an nsdmi.
1435 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1437         Update copyright years.
1439 Copyright (C) 2016 Free Software Foundation, Inc.
1441 Copying and distribution of this file, with or without modification,
1442 are permitted in any medium without royalty provided the copyright
1443 notice and this notice are preserved.