c-common.h (enum c_omp_region_type): Define.
[official-gcc.git] / gcc / cp / ChangeLog
blob30dddeb765ce821410a562b5aa30c82f1c79707c
1 2016-05-02  Cesar Philippidis  <cesar@codesourcery.com>
3         * cp-tree.h (finish_omp_clauses): Update prototype.
4         * parser.c (cp_parser_oacc_all_clauses): Update call to
5         finish_omp_clauses.
6         (cp_parser_omp_all_clauses): Likewise.
7         (cp_parser_omp_for_loop): Likewise.
8         (cp_omp_split_clauses): Likewise.
9         (cp_parser_oacc_cache): Likewise.
10         (cp_parser_oacc_loop): Likewise.
11         (cp_parser_omp_declare_target):
12         (cp_parser_cilk_simd_all_clauses): Likewise.
13         (cp_parser_cilk_for): Likewise.
14         * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
15         arguments with enum c_omp_region_type ort.
16         (tsubst_omp_clauses): Update calls to finish_omp_clauses.
17         (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
18         (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
19         (tsubst_expr): Update calls to tsubst_omp_clauses.
20         * semantics.c (finish_omp_clauses): Replace bool arguments
21         allow_fields, declare_simd, and is_cilk with bitmask ort.
22         (finish_omp_for): Update call to finish_omp_clauses.
24 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
26         PR c++/62314
27         * parser.c (cp_parser_class_head): Capture the start location;
28         use it to emit a fix-it insertion hint when complaining
29         about missing "template <> " in explicit specializations.
31 2016-05-02  Richard Sandiford  <richard.sandiford@arm.com>
33         * init.c (build_new_1): Use shift operators instead of wi:: shifts.
35 2016-05-02  Richard Biener  <rguenther@suse.de>
37         * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
38         anonymous VLAs.
40 2016-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
42         PR c++/66644
43         * class.c (check_field_decl): Remove final int* parameter, change
44         the return type to bool; fix logic in order not to reject multiple
45         initialized fields in anonymous struct.
46         (check_field_decls): Adjust call.
48 2016-04-29  Cesar Philippidis  <cesar@codesourcery.com>
50         PR middle-end/70626
51         * parser.c (cp_parser_oacc_loop): Don't augment mask with
52         OACC_LOOP_CLAUSE_MASK.
53         (cp_parser_oacc_kernels_parallel): Update call to
54         c_oacc_split_loop_clauses.
56 2016-04-28  Jason Merrill  <jason@redhat.com>
58         Implement C++17 [[nodiscard]] attribute.
59         PR c++/38172
60         PR c++/54379
61         * parser.c (cp_parser_std_attribute): Handle [[nodiscard]].
62         * tree.c (handle_nodiscard_attribute): New.
63         (cxx_attribute_table): Add [[nodiscard]].
64         * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New.
65         (maybe_warn_nodiscard): New.
66         (convert_to_void): Call it.
68         * cvt.c (cp_get_callee): New.
69         * constexpr.c (get_function_named_in_call): Use it.
70         * cxx-pretty-print.c (postfix_expression): Use it.
71         * except.c (check_noexcept_r): Use it.
72         * method.c (check_nontriv): Use it.
73         * tree.c (build_aggr_init_expr): Use it.
74         * cp-tree.h: Declare it.
76 2015-04-27  Ryan Burn  <contact@rnburn.com>
77             Jeff Law  <law@redhat.com>
79         PR c++/69024
80         PR c++/68997
81         * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
82         instead of cilk_detect_spawn_and_unwrap.
83         * cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
84         (find_spawn): New.
85         (cilk_cp_detect_spawn_and_unwrap): New.
86         * lambda.c: Include cp-cilkplus.h.
87         * parser.c: Include cp-cilkplus.h.
88         * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into...
89         * cp-cilkpus.h: New file.
91 2016-04-27  Nathan Sidwell  <nathan@acm.org>
93         * constexpr.c (get_fundef_copy): Use the original function for
94         non-recursive evaluations.
95         (save_fundef_copy): Always expect a slot to be available.
97 2016-04-27  Bernd Schmidt  <bschmidt@redhat.com>
99         * parser.c (cp_parser_postfix_expression): Call
100         warn_for_memset instead of warning directly here.
102 2016-04-26  Patrick Palka  <ppalka@gcc.gnu.org>
104         PR c++/70241
105         * decl.c (build_enumerator): Set current_access_specifier when
106         declaring an enumerator belonging to an in-class enumeration.
107         * parser.c (cp_parser_check_access_in_redecleration): Also
108         consider in-class enumerations.
110 2016-04-26  Marek Polacek  <polacek@redhat.com>
112         PR c++/70744
113         * call.c (build_conditional_expr_1): Call cp_stabilize_reference
114         instead of stabilize_reference.
115         (build_over_call): Likewise.
116         * cp-tree.h (cp_stabilize_reference): Declare.
117         * tree.c (cp_stabilize_reference): New function.
118         * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
119         stabilize_reference.
120         (unary_complex_lvalue): Likewise.
121         (cp_build_modify_expr): Likewise.
123 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
125         PR bootstrap/70704
126         * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
127         just flag_checking.
129 2016-04-25  Jason Merrill  <jason@redhat.com>
131         * tree.c (std_attribute_table): New.
132         (init_tree): Register it.
134 2016-04-22  Jason Merrill  <jason@redhat.com>
136         * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
138 2016-04-21  Patrick Palka  <ppalka@gcc.gnu.org>
140         * name-lookup.c (free_saved_scope): New free list of saved_scope
141         structures.
142         (push_to_top_level): Attempt to reuse a saved_scope struct
143         from free_saved_scope instead of allocating a new one each time.
144         (pop_from_top_level_1): Chain the now-unused saved_scope structure
145         onto free_saved_scope.
147 2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
149         PR c++/70540
150         * semantics.c (process_outer_var_ref): Unconditionally return
151         error_mark_node when mark_used returns false.
153 2016-04-21  Marek Polacek  <polacek@redhat.com>
155         PR c++/70513
156         * parser.c (cp_parser_enum_specifier): Check and possibly error for
157         extra qualification.
159 2016-04-20  Nathan Sidwell  <nathan@acm.org>
161         PR c++/55635
162         * init.c (build_vec_delete_1): Protect operator delete call in try
163         finally.
164         (build_delete): Likewise.
165         * optimize.c (build_delete_destructor_body): Likewise.
167 2016-04-20  Ilya Verbin  <ilya.verbin@intel.com>
169         PR c++/69363
170         * cp-tree.h (finish_omp_clauses): Add new default argument.
171         * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
172         instead of c_finish_cilk_clauses.
173         * semantics.c (finish_omp_clauses): Add new argument.  Allow
174         floating-point variables in the linear clause for Cilk Plus.
176 2016-04-20  Nathan Sidwell  <nathan@acm.org>
178         * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
179         TARGET_EXPR.
181 2016-04-19  Jason Merrill  <jason@redhat.com>
183         PR c++/66543
184         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
185         * pt.c (make_pack_expansion): Call mark_exp_read.
186         * semantics.c (finish_id_expression): Call mark_type_use in
187         unevaluated context.
189         DR 2137
190         * call.c (implicit_conversion): If we choose a copy constructor
191         for list-initialization from the same type, the conversion is an
192         exact match.
194         * constexpr.c (breaks): Handle EXIT_EXPR.
195         (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
196         (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
197         of COMPOUND_EXPR.
199         PR c++/68206
200         PR c++/68530
201         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
202         and GOTO_EXPR.
204         * pt.c (tsubst_expr): Remove shadowing declaration.
205         (tsubst_pack_expansion): Add assert.
207         * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
209         PR c++/70522
210         * name-lookup.c (qualified_lookup_using_namespace): Look through
211         hidden names.
213 2016-04-18  Michael Matz  <matz@suse.de>
215         * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
216         (layout_class_type): Ditto.
217         (build_base_field): Use SET_DECL_ALIGN.
218         (fixup_attribute_variants): Use SET_TYPE_ALIGN.
219         * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
220         (record_unknown_type): Use SET_TYPE_ALIGN.
221         (cxx_init_decl_processing): Ditto.
222         (copy_type_enum): Ditto.
223         (grokfndecl): Use SET_DECL_ALIGN.
224         (copy_type_enum): Use SET_TYPE_ALIGN.
225         * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
226         (tsubst): Ditto.
227         * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
228         * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
229         * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
230         * rtti.c (emit_tinfo_decl): Ditto.
232 2016-04-18  Jason Merrill  <jason@redhat.com>
234         PR c++/70690
235         PR c++/70528
236         * class.c (type_maybe_constexpr_default_constructor): New.
237         (type_has_constexpr_default_constructor): Revert.
239 2016-04-16  Sandra Loosemore  <sandra@codesourcery.com>
241         PR target/1078
243         * tree.c (cxx_attribute_table): Remove "com_interface" entry.
244         (handle_com_interface_attribute): Delete.
246 2016-04-15  Jason Merrill  <jason@redhat.com>
248         PR c++/70685
249         * constexpr.c (get_fundef_copy): Handle null *slot.
251         PR c++/70505
252         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
253         unknown_type_node, too.
255 2016-04-15  Jason Merrill  <jason@redhat.com>
256             Nathan Sidwell  <nathan@acm.org>
258         PR c++/70594
259         * constexpr.c (constexpr_call_table): Preserve in GC.
260         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
261         (fundef_copies_table): Preserve in GC. Change to pointer to
262         tree->tree hash.
263         (maybe_initialize_fundef_copies_table): Adjust.
264         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
265         (save_fundef_copy): Adjust for a TREE_LIST.
266         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
267         (fini_constexpr): New.
268         * cp-tree.h (fini_constexpr): Declare.
269         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
271 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
273         PR c/70436
274         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
275         where needed.
276         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
277         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
278         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
279         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
280         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
281         cp_parser_statement.
282         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
283         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
284         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
285         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
286         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
287         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
288         cp_parser_omp_taskloop, cp_parser_omp_construct,
289         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
290         Add IF_P argument, pass it down where needed.
291         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
292         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
293         calls.
295 2016-04-14  Jason Merrill  <jason@redhat.com>
297         PR c++/70494
298         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
299         * typeck2.c (split_nonconstant_init_1): Use it.
301         PR c++/70528
302         * class.c (type_has_constexpr_default_constructor): Return true
303         for an implicitly declared constructor.
305         PR c++/70622
306         * parser.c (cp_parser_init_declarator): Add auto_result parm.
307         (cp_parser_simple_declaration): Pass it.
308         (strip_declarator_types): New.
310         PR c++/70543
311         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
312         initializer also makes the variable value-dependent.
314         PR c++/70648
315         * constexpr.c (cxx_eval_store_expression): Also copy
316         CONSTRUCTOR_NO_IMPLICIT_ZERO.
318 2016-04-14  Martin Sebor  <msebor@redhat.com>
320         PR c++/69517
321         PR c++/70019
322         PR c++/70588
323         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
325 2016-04-14  Jason Merrill  <jason@redhat.com>
327         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
328         parameter ABI change.
330 2016-04-13  Martin Sebor  <msebor@redhat.com>
332         PR c++/69517
333         PR c++/70019
334         PR c++/70588
335         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
336         functions.
337         * decl.c (check_initializer, cp_finish_decl): Call them.
338         (reshape_init_r): Reject incompletely braced intializer-lists
339         for VLAs.
340         * init.c (throw_bad_array_length, build_vla_check)
341         (build_vla_size_check, build_vla_init_check): Define new functions.
342         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
343         to detect a VLA.
344         (store_init_value): Same.
346 2016-04-13  Jason Merrill  <jason@redhat.com>
348         Warn about empty parameter ABI with -Wabi=9.
349         * call.c (empty_class_msg, mark_for_abi_warning)
350         (warn_empty_class_abi): New.
351         (build_call_a): Use them.
352         * decl.c (store_parm_decls): Use mark_for_abi_warning.
353         * error.c (pp_format_to_string): New.
355         Pass empty class parameters like C.
356         * call.c (pass_as_empty_struct, empty_class_arg): New.
357         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
358         (build_call_a): Use empty_class_arg.
359         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
360         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
362 2016-04-13  Jason Merrill  <jason@redhat.com>
364         PR c++/70627
365         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
367 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
369         PR c++/70635
370         * pt.c (resolve_typename_type): Fix typos in infinite recursion
371         avoidance mechanism.
373 2016-04-13  Jason Merrill  <jason@redhat.com>
375         PR c++/70634
376         * pt.c (instantiation_dependent_uneval_expression_p): Split out
377         from instantiation_dependent_expression_p.
378         (value_dependent_expression_p): Use it for unevaluated operands.
379         (instantiation_dependent_r): Don't check value-dependence.
380         (instantiation_dependent_expression_p): Check
381         value-dependence of the expression as a whole.
382         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
383         * semantics.c (finish_decltype_type): Use it.
385         * constexpr.c (potential_nondependent_constant_expression): New.
386         (potential_nondependent_static_init_expression): New.
387         (maybe_constant_value_1, fold_non_dependent_expr)
388         (maybe_constant_init): Use them.
389         * pt.c (instantiate_non_dependent_expr_sfinae)
390         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
391         them.
392         * cp-tree.h: Declare them.
394 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
396         PR c++/70594
397         * decl.c (pop_labels_1): Removed.
398         (note_label, sort_labels): New functions.
399         (pop_labels): During named_labels traversal, just push the slot
400         pointers into a vector, then qsort it by DECL_UID and only then
401         call pop_label and chain it into BLOCK_VARS.
403 2016-04-13  Jason Merrill  <jason@redhat.com>
405         PR c++/70615
406         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
407         (cp_gimplify_expr): Not here.
409 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
411         PR c++/70610
412         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
413         recurse into it.
414         * typeck.c (build_x_conditional_expr): Unconditionally remember
415         that the result is an lvalue or xvalue.
417 2016-04-12  Jason Merrill  <jason@redhat.com>
419         * class.c (is_really_empty_class): A zero-length array is empty.
420         An unnamed bit-field doesn't make a class non-empty.
422 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
424         PR c++/68722
425         * parser.c (cp_parser_cache_defarg): When file ends in default
426         argument simply return error_mark_node.
428 2016-04-12  Nathan Sidwell  <nathan@acm.org>
430         PR c++/70501
431         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
432         similarly to PMF.
434 2016-04-11  Jason Merrill  <jason@redhat.com>
436         * mangle.c (decl_is_template_id): The template itself counts as a
437         template-id.
439 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
441         PR c++/70590
442         PR c++/70452
443         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
444         on the result if it's not a CONSTRUCTOR.
446 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
448         PR c++/70452
449         * constexpr.c (find_constructor): New function.
450         (unshare_constructor): New function.
451         (cxx_eval_call_expression): Use unshare_constructor instead of
452         unshare_expr.
453         (find_array_ctor_elt): Likewise.
454         (cxx_eval_vec_init_1): Likewise.
455         (cxx_eval_store_expression): Likewise.
456         (cxx_eval_constant_expression): Likewise.
458 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
460         PR c/70436
461         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
462         potentially generating a future -Wparentheses warning in its
463         callers.
465 2016-04-06  Jason Merrill  <jason@redhat.com>
467         * class.c (check_abi_tags): Fix function template handling.
469 2016-04-05  Nathan Sidwell  <nathan@acm.org>
471         PR c++/70512
472         * class.c (fixup_may_alias): New.
473         (fixup_attribute_variants): Call it.
475 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
477         PR c++/70452
478         * constexpr.c (struct fundef_copy): New struct.
479         (struct fundef_copies_table_t): New struct.
480         (fundef_copies_table): New static variable.
481         (maybe_initialize_fundef_copies_table): New static function.
482         (get_fundef_copy): New static function.
483         (save_fundef_copy): New static function.
484         (cxx_eval_call_expression): Use get_fundef_copy, and
485         save_fundef_copy.
486         (constexpr_call_table): Add "deletable" GTY marker.
488 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
490         PR c++/70452
491         * cp-tree.h (class cache_map): Remove.
492         * constexpr.c (cv_cache): Change type to
493         GTY((deletable)) hash_map<tree, tree> *.
494         (maybe_constant_value): Adjust following the change to cv_cache.
495         (clear_cv_cache): New static function.
496         (clear_cv_and_fold_caches): Use it.
497         * cp-gimplify.c (fold_cache): Change type to
498         GTY((deletable)) hash_map<tree, tree> *.
499         (clear_fold_cache): Adjust following the change to fold_cache.
500         (cp_fold): Likewise.
502 2016-04-02  Martin Sebor  <msebor@redhat.com>
504         PR c++/67376
505         PR c++/70170
506         PR c++/70172
507         PR c++/70228
508         * constexpr.c (diag_array_subscript): New function.
509         (cxx_eval_array_reference): Detect out of bounds array indices.
511 2016-04-01  Jason Merrill  <jason@redhat.com>
513         PR c++/70449
514         PR c++/70344
515         * pt.c (instantiate_decl): A function isn't fully defined if
516         DECL_INITIAL is error_mark_node.
517         * constexpr.c (cxx_eval_call_expression): Likewise.
519 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
520             Marek Polacek  <polacek@redhat.com>
522         PR c++/70488
523         * init.c (warn_placement_new_too_small): Test whether
524         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
526 2016-04-01  Nathan Sidwell  <nathan@acm.org>
528         PR c++/68475
529         * decl.c (check_redeclaration_exception_specification): Check
530         regardless of -fno-exceptions.
531         * typeck2.c (merge_exception_specifiers): Relax assert by checking
532         flag_exceptions too.
534 2016-03-31  Nathan Sidwell  <nathan@acm.org>
536         * decl.c (start_preparsed_function): Remove unnecessary bracing.
537         (finish_destructor_body): Don't emit operator delete here.
539 2016-03-31  Nathan Sidwell  <nathan@acm.org>
541         PR c++/70393
542         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
543         elements in field order.
545 2016-03-31  Marek Polacek  <polacek@redhat.com>
547         PR c/70297
548         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
550 2016-03-31  Richard Biener  <rguenther@suse.de>
552         PR c++/70430
553         * typeck.c (cp_build_binary_op): Fix operand order of vector
554         conditional in truth op handling.
556 2016-03-29  Jason Merrill  <jason@redhat.com>
558         PR c++/70353
559         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
560         in constexpr functions.
562 2016-03-28  Jason Merrill  <jason@redhat.com>
564         PR c++/70422
565         PR c++/64266
566         PR c++/70353
567         * decl.c, pt.c, constexpr.c: Revert last patch.
569 2016-03-25  Jason Merrill  <jason@redhat.com>
570             Martin LiÅ¡ka  <mliska@suse.cz>
572         PR c++/64266
573         PR c++/70353
574         Core issue 1962
575         * decl.c (cp_fname_init): Decay the initializer to pointer.
576         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
577         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
578         Don't call cp_finish_decl.
579         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
580         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
581         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
582         Handle DECL_VALUE_EXPR.
584 2016-03-24  Jason Merrill  <jason@redhat.com>
586         PR c++/70386
587         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
589         PR c++/70323
590         * constexpr.c (cxx_eval_call_expression): Don't cache result if
591         *overflow_p.
593 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
595         PR c++/62212
596         * tree.c (build_cplus_array_type): Determine type-dependentess
597         with uses_template_parms instead of with dependent_type_p.
599 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
601         PR c++/70347
602         * typeck.c (process_init_constructor_union): If the initializer
603         is empty, use the union's NSDMI if it has one.
605 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
607         PR c++/70332
608         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
609         NSDMI that's part of an aggregrate initialization.
611 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
613         PR c++/70001
614         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
615         for 1..max even for multi-dimensional arrays.  Call unshare_expr
616         on it.
618         PR c++/70323
619         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
620         on TREE_OVERFLOW constants.
622         PR c++/70376
623         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
624         for OMP_TASKLOOP here.
625         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
626         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
628 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
629             Jason Merrill  <jason@redhat.com>
630             Jakub Jelinek  <jakub@redhat.com>
632         PR c++/69315
633         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
634         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
635         (finish_function): Don't set or test them.
636         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
638 2016-03-23  Jason Merrill  <jason@redhat.com>
640         PR c++/70344
641         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
643 2016-03-23  Marek Polacek  <polacek@redhat.com>
645         PR c++/69884
646         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
648 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
650         * call.c (build_conditional_expr_1): Always use original
651         condition type for vector type checks and build.
653 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
655         PR c++/70096
656         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
658 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
660         PR c++/70204
661         * constexpr.c (non_const_var_error): Check
662         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
664 2016-03-21  Richard Henderson  <rth@redhat.com>
666         PR c++/70273
667         * decl.c (notice_forced_label_r): New.
668         (cp_finish_decl): Use it.
670 2016-03-21  Jason Merrill  <jason@redhat.com>
672         PR c++/70285
673         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
675 2016-03-18  Jason Merrill  <jason@redhat.com>
677         PR c++/70139
678         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
680         PR c++/70147
681         * class.c (vptr_via_virtual_p): New.
682         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
683         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
684         a vptr from any virtual base in a not-in-charge 'structor.
686         * decl.c (build_clobber_this): Factor out of
687         start_preparsed_function and begin_destructor_body.  Handle
688         virtual bases better.
690         * class.c (build_if_in_charge): Split out from build_base_path.
691         * init.c (expand_virtual_init, expand_default_init): Use it.
692         * call.c (build_special_member_call): Use it.
694 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
696         PR c++/70267
697         * init.c (build_new_1): Complain and return error_mark_node
698         if alloc_fn is not _Jv_AllocObject function returning pointer.
700 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
702         PR c++/70205
703         * search.c (adjust_result_of_qualified_name_lookup): Don't
704         update the BASELINK_BINFO of DECL if the second call
705         to lookup_base fails.
707 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
709         PR c++/70218
710         * parser.c (cp_parser_lambda_expression): Move call to
711         pop_deferring_access_checks ahead of the call to
712         cp_parser_end_tentative_firewall.
714 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
716         PR c++/70144
717         * cp-tree.h (magic_varargs_p): Return int instead of bool.
718         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
719         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
720         varargs.
721         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
722         if magic_varargs_p == 1, call decay_conversion
723         instead of mark_type_use.  Don't store error_mark_node arguments to
724         argarray, instead return error_mark_node.
726         PR c++/70272
727         * decl.c (begin_destructor_body): Don't insert clobber if
728         is_empty_class (current_class_type).
730 2016-03-17  Marek Polacek  <polacek@redhat.com>
732         PR c++/70194
733         * typeck.c (warn_for_null_address): New function.
734         (cp_build_binary_op): Call it.
736 2016-03-16  Jason Merrill  <jason@redhat.com>
738         PR c++/70259
739         * decl.c (start_preparsed_function): Don't clobber an empty base.
741 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
743         PR c++/70147
744         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
745         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
747         PR c++/70147
748         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
749         set in_base_initializer.
751 2016-03-15  Marek Polacek  <polacek@redhat.com>
753         PR c++/70209
754         * tree.c (strip_typedefs): Call strip_typedefs again on the
755         DECL_ORIGINAL_TYPE result.
757 2016-03-15  Jason Merrill  <jason@redhat.com>
759         PR c++/70095
760         * pt.c (instantiate_decl): Fix call to variable_template_p.
762         PR c++/70141
763         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
765 2016-03-14  Casey Carter  <casey@carter.net>
766             Jason Merrill  <jason@redhat.com>
768         P0184R0: Generalizing the Range-Based For Loop
769         * parser.c (cp_convert_range_for): Set the type of __end separately.
770         (cp_parser_perform_range_for_lookup): Allow different begin/end
771         types if they are comparable.
773 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
775         PR c++/70106
776         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
777         processing_template_decl and EXPR is a SCOPE_REF.
779 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
780             Jakub Jelinek  <jakub@redhat.com>
782         PR c++/70001
783         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
784         return value from cxx_eval_constant_expression from earlier
785         elements if it is valid constant initializer requiring no
786         relocations.
788 2016-03-10  Marek Polacek  <polacek@redhat.com>
790         PR c++/70153
791         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
793 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
795         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
796         when calling c_finish_omp_clauses.
798 2016-03-08  Jason Merrill  <jason@redhat.com>
800         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
801         diagnostic for use of "concept".
802         (cp_parser_requires_clause_opt): And "requires".
803         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
804         (cp_parser_explicit_template_declaration): Adjust.
805         * Make-lang.in (check-c++-all): Add "concepts" to std list.
807         P0036R0: Unary Folds and Empty Parameter Packs
808         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
810 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
812         PR c++/70135
813         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
814         even after the last iteration of the loop.
816         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
818 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
820         PR c++/66786
821         * pt.c (get_template_info): Handle PARM_DECL.
822         (template_class_depth): Check DECL_P instead of
823         VAR_OR_FUNCTION_DECL_P.
825 2016-03-05  Jason Merrill  <jason@redhat.com>
827         PR c++/67364
828         * constexpr.c (cxx_eval_store_expression): Replace
829         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
831 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
833         PR c++/66786
834         * pt.c (template_class_depth): Given a lambda type, iterate
835         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
836         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
837         CP_DECL_CONTEXT.
839 2016-03-04  Jason Merrill  <jason@redhat.com>
841         PR c++/69203
842         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
843         * init.c (build_vec_delete_1): Set it.
844         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
846 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
848         * decl.c (start_preparsed_function): Don't emit start clobber at the
849         start of constructor clones.
851         PR c++/70035
852         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
853         * decl.c (start_preparsed_function): Call
854         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
855         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
856         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
858 2016-03-04  Jason Merrill  <jason@redhat.com>
860         PR c++/67364
861         * constexpr.c (cxx_eval_component_reference): Further tweak.
863         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
864         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
865         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
866         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
868         PR c++/70067
869         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
870         same type.
872 2016-03-03  Jason Merrill  <jason@redhat.com>
874         * method.c (synthesized_method_walk): operator= can also be constexpr.
876         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
877         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
879         PR c++/67164
880         * pt.c (copy_template_args): New.
881         (tsubst_pack_expansion): Use it.
883         * call.c (build_aggr_conv): Use get_nsdmi.
885         PR c++/51406
886         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
888         PR c++/67364
889         * constexpr.c (cxx_eval_component_reference): Just return an empty
890         CONSTRUCTOR for an empty class.
892 2016-03-01  Jason Merrill  <jason@redhat.com>
894         PR c++/70036
895         * parser.c (cp_parser_requires_clause): Call
896         check_for_bare_parameter_packs.
898         PR c++/51489
899         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
900         the operands.
902         PR c++/69995
903         * constexpr.c (cxx_eval_call_expression): Unshare arg.
904         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
905         [TARGET_EXPR]: Unshare init.
907 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
909         PR c++/68948
910         PR c++/69961
911         * pt.c (tsubst_baselink): Reinstate the check for an invalid
912         constructor call.
914 2016-02-28  Jason Merrill  <jason@redhat.com>
916         PR c++/69995
917         * constexpr.c (cxx_eval_store_expression): Unshare init.
919 2016-02-26  Jason Merrill  <jason@redhat.com>
921         PR c++/69958
922         * pt.c (make_argument_pack): New.
923         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
924         (tsubst_copy_and_build): Likewise.
926 2016-02-25  Jason Merrill  <jason@redhat.com>
928         PR c++/69889
929         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
930         * tree.c (build_aggr_init_expr): Set it.
931         * semantics.c (simplify_aggr_init_expr): Check it.
932         * cp-gimplify.c (cp_genericize_r): Don't walk into
933         a call/aggr_init from a thunk.
935         PR c++/69842
936         * method.c (forward_parm): Handle parameter packs.
937         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
939         PR c++/67364
940         * constexpr.c (cxx_eval_component_reference): Don't complain about
941         unevaluated empty classes.
943         PR c++/68049
944         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
946 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
948         PR c++/69736
949         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
950         (maybe_undo_parenthesized_ref): Declare.
951         * semantics.c (maybe_undo_parenthesized_ref): Split out from
952         check_return_expr.
953         (finish_call_expr): Use it.
954         * typeck.c (check_return_expr): Use it.
955         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
956         REF_PARENTHESIZED_P flag.
958 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
960         PR c++/69922
961         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
962         Avoid folding it.
963         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
964         tests.
965         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
966         unless they are folded into INTEGER_CST, error_mark_node or some
967         comparison with NULL, avoid folding them and use either the original
968         comparison or non-folded comparison of folded arguments.
969         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
970         comparison, don't fold the comparison right away.
972 2016-02-24  Jason Merrill  <jason@redhat.com>
974         PR c++/69323
975         * friend.c (make_friend_class): Likewise.
976         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
978 2016-02-24  Jason Merrill  <jason@redhat.com>
980         PR c++/69323
981         * pt.c (instantiate_class_template_1): Set
982         processing_template_decl before substituting friend_type.
984 016-02-24  Martin Sebor  <msebor@redhat.com>
986         PR c++/69912
987         * tree.c (build_ctor_subob_ref): Compare types' main variants
988         instead of the types as they are.
990 2016-02-24  Jason Merrill  <jason@redhat.com>
992         * decl.c (start_preparsed_function): Condition ctor clobber on
993         flag_lifetime_dse > 1.
995         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
997 2016-02-19  Jason Merrill  <jason@redhat.com>
999         PR c++/69743
1000         * call.c (remaining_arguments): No longer static.
1001         * cp-tree.h: Declare it.
1002         * pt.c (more_specialized_fn): Use it.
1004 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1005             Bernd Edlinger  <bernd.edlinger@hotmail.de>
1007         * Make-lang.in: Invoke gperf with -L C++.
1008         * cfns.gperf: Remove prototypes for hash and libc_name_p
1009         inlines.
1010         * cfns.h: Regenerated.
1011         * except.c (nothrow_libfn_p): Adjust.
1013 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1015         PR c++/69850
1016         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1017         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1019 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
1021         PR c++/68948
1022         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1023         call here.
1024         * semantics.c (finish_call_expr): Don't assume a constructor
1025         call is dependent if only the "this" pointer is dependent.  When
1026         building a constructor call, always use a dummy object.
1028 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1030         PR c++/69850
1031         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1032         condition.
1033         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1034         operators if folding preserved the binop, just with different
1035         arguments.
1037         PR c++/67767
1038         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1039         attr_spec is always single element chain, chain all the attributes
1040         properly together in the right order.
1042 2016-02-18  Jason Merrill  <jason@redhat.com>
1044         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
1045         mangle_decl.
1046         (mangle_decl): Call maybe_check_abi_tags for function scope.
1047         (mangle_guard_variable): Call maybe_check_abi_tags here.
1048         (write_guarded_var_name): Not here.
1050 2016-02-17  Jason Merrill  <jason@redhat.com>
1052         PR c++/65985
1053         * constexpr.c (build_constexpr_constructor_member_initializers):
1054         Handle an additional STATEMENT_LIST.
1056         PR c++/68585
1057         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1059         PR c++/68679
1060         * decl2.c (reset_type_linkage_2): Look through member templates.
1062 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
1064         PR c++/69850
1065         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1067 2016-02-17  Jason Merrill  <jason@redhat.com>
1069         PR c++/69842
1070         * method.c (forward_parm): Split out from...
1071         (add_one_base_init): ...here.
1072         * lambda.c (maybe_add_lambda_conv_op): Use it.
1074 2016-02-16  Jason Merrill  <jason@redhat.com>
1076         PR c++/10200
1077         PR c++/69753
1078         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1079         tree.c, typeck2.c: Revert earlier changes.
1080         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1081         non-type templates after -> or .
1083 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
1085         PR c/69835
1086         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1088 2016-02-16  Jason Merrill  <jason@redhat.com>
1090         PR c++/69657
1091         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1092         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
1093         * name-lookup.h: Adjust.
1095 2016-02-16  James Norris  <jnorris@codesourcery.com>
1097         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1098         * semantics.c (finish_omp_clauses): Add deviceptr checking.
1100 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1102         PR c++/69658
1103         * init.c (expand_default_init): Only call reshape_init
1104         in the direct-initialization from an initializer list case.
1106 2016-02-15  Jason Merrill  <jason@redhat.com>
1108         PR c++/69753
1109         * semantics.c (finish_call_expr): Implicit 'this' does not make
1110         the call dependent.
1111         * search.c (any_dependent_bases_p): Split out...
1112         * name-lookup.c (do_class_using_decl): ...from here.
1113         * call.c (build_new_method_call_1): Don't complain about missing object
1114         if there are dependent bases.  Tweak error.
1115         * tree.c (non_static_member_function_p): Remove.
1116         * pt.c (type_dependent_expression_p): A member template of a
1117         dependent type is dependent.
1118         * cp-tree.h: Adjust.
1120         PR c++/68890
1121         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1123 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1125         PR c++/69098
1126         * pt.c (lookup_and_finish_template_variable): New function,
1127         extracted from ...
1128         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1129         (tsubst_qualified_id): Consider that EXPR might be a variable
1130         template.
1131         * typeck.c (check_template_keyword): Don't emit an error
1132         if DECL is a variable template.
1134 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1136         * error.c: Spelling fixes - behaviour -> behavior and
1137         neighbour -> neighbor.
1138         * decl.c: Likewise.
1139         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1140         diagnostics.
1141         * init.c (build_delete): Likewise.
1143 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1145         PR c/69768
1146         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1147         arguments for -Waddress warning.  Fix up formatting.
1149 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1151         PR c++/68726
1152         * pt.c (lookup_template_class_1): Check tsubst return value for
1153         error_mark_node.
1155 2016-02-10  Jason Merrill  <jason@redhat.com>
1157         PR c++/68926
1158         * pt.c (resolve_nondeduced_context): Add complain parm.
1159         (do_auto_deduction): Pass it.
1160         * cvt.c (convert_to_void): Likewise.
1161         * decl.c (cp_finish_decl): Likewise.
1162         * init.c (build_new): Likewise.
1163         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1164         * semantics.c (finish_decltype_type): Likewise.
1165         * typeck.c (decay_conversion): Likewise.
1166         * cp-tree.h: Adjust declaration.
1167         * call.c (standard_conversion): Add complain parm, pass it along.
1168         (implicit_conversion): Pass it.
1170         PR c++/69657
1171         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1172         (lookup_name_real_1): Likewise.
1173         (remove_hidden_names): Handle non-functions too.
1175         PR c++/10200
1176         * parser.c (cp_parser_lookup_name): When looking for a template
1177         after . or ->, only consider class templates.
1178         (cp_parser_postfix_dot_deref_expression): Handle the current
1179         instantiation.  Remember a dependent object expression.
1180         * typeck2.c (build_x_arrow): Handle the current instantiation.
1182         * ptree.c (debug_tree): Implement for cp_expr.
1184 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1186         PR c++/69139
1187         * parser.c (cp_parser_simple_type_specifier): Make the check
1188         for disambiguating between an 'auto' placeholder and an implicit
1189         template parameter more robust.
1191 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1193         PR c++/69283
1194         PR c++/67835
1195         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1196         setting its TREE_USED flag.
1198 2016-02-08  Jason Merrill  <jason@redhat.com>
1200         PR c++/69657
1201         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1202         built-ins alone.
1204 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1206         PR c++/59627
1207         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1208         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1210 2016-02-08  Marek Polacek  <polacek@redhat.com>
1212         PR c++/69688
1213         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1214         Call clear_fold_cache.
1215         * cp-tree.h: Adjust declaration.
1216         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1217         rather than clear_cv_cache and clear_fold_cache.
1218         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1220 2016-02-08  Jason Merrill  <jason@redhat.com>
1222         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1223         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1224         (ocp_convert): Use *_maybe_fold.
1225         (cp_convert_to_pointer): Add dofold parameter.
1226         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1228 2016-02-05  Martin Sebor  <msebor@redhat.com>
1230         PR c++/69662
1231         * init.c (find_field_init): New function.
1232         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1233         at ends of structures special.
1235 2016-02-05  Jason Merrill  <jason@redhat.com>
1237         PR c++/68948
1238         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1239         make sure we've seen_error().
1241 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1243         PR c++/68948
1244         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1245         if lookup_fnfields returns NULL_TREE and the name being looked
1246         up has the form A::A.
1248 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1250         * constexpr.c (cxx_eval_binary_expression): Fold equality
1251         comparisons involving PTRMEM_CSTs.
1253 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1255         * class.c (find_flexarrays): Don't declare dom variable.
1256         (diagnose_flexarray): Likewise.
1258 2016-02-02  Martain Sebor  <msebor@redhat.com>
1260         PR c++/69251
1261         PR c++/69253
1262         PR c++/69290
1263         PR c++/69277
1264         PR c++/69349
1265         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1266         of a flexible array member for equality to null.
1267         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1268         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1269         (check_flexarrays): Same.
1270         * decl.c (compute_array_index_type): Avoid special case for flexible
1271         array members.
1272         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1273         array members.
1274         * error.c (dump_type_suffix): Revert changes introduced in r231665
1275         and rendered unnecessary by the changes above.
1276         * pt.c (tsubst):  Same.
1277         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1278         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1279         (process_init_constructor_array): Same.
1280         (process_init_constructor_record): Same.
1282 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1284         PR c++/69056
1285         * pt.c (try_one_overload): Handle comparing argument packs so
1286         that there is no conflict if we deduced more arguments of an
1287         argument pack than were explicitly specified.
1289 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1290             Jason Merrill  <jason@redhat.com>
1292         PR c++/68763
1293         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1294         function type if nothing is changing.
1296 2016-01-31  Jason Merrill  <jason@redhat.com>
1298         PR c++/69009
1299         * pt.c (partial_specialization_p, impartial_args): New.
1300         (instantiate_decl): Call impartial_args.
1302         * mangle.c (maybe_check_abi_tags): New.
1303         (write_guarded_var_name): Call it.
1304         (mangle_ref_init_variable): Call check_abi_tags.
1306         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1307         between template and instantiation.
1309 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1311         PR debug/66869
1312         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1313         function declarations.
1315 2016-01-29  Marek Polacek  <polacek@redhat.com>
1317         PR c++/69509
1318         PR c++/69516
1319         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1320         out of bound" error earlier.
1321         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1322         commentary.
1324 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1326         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1327         structure, update free_binding_level before the structure's
1328         level_chain field gets cleared, not after.
1330 2016-01-28  Jason Merrill  <jason@redhat.com>
1332         PR c++/67407
1333         * search.c (dfs_walk_once, dfs_walk_once_r)
1334         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1335         hash_set instead of BINFO_MARKED.
1336         (dfs_unmark_r): Remove.
1338 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1340         PR c++/24208
1341         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1342         (cp_lexer_debugging_p): Use it.
1343         (cp_lexer_start_debugging): Likewise.
1344         (cp_lexer_stop_debugging): Likewise.
1346 2016-01-27  Marek Polacek  <polacek@redhat.com>
1348         PR c/68062
1349         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1350         needed.  Add -Wsign-compare warning.
1352 2016-01-27  Ryan Burn  <contact@rnburn.com>
1354         PR cilkplus/69267
1355         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1356         superfluous post_p argument in call to
1357         cilk_gimplify_call_params_in_spawned_fn.
1359 2016-01-27  Marek Polacek  <polacek@redhat.com>
1361         PR c++/69379
1362         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1363         wrapped in NOP_EXPRs.
1365 2016-01-27  Martin Sebor  <msebor@redhat.com>
1367         PR c++/69317
1368         * mangle.c (mangle_decl): Reference the correct (saved) version
1369         of the ABI in -Wabi diagnostics.
1371 2016-01-27  Marek Polacek  <polacek@redhat.com>
1373         PR c++/69496
1374         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1375         elements of the array.
1377 2016-01-26  Jason Merrill  <jason@redhat.com>
1379         PR c++/68949
1380         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1381         (cxx_eval_call_expression): Don't look through clones.
1382         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1383         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1384         maybe-in-charge *tor.
1386 2016-01-26  Jason Merrill  <jason@redhat.com>
1388         PR c++/68782
1389         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1390         and TREE_SIDE_EFFECTS.
1391         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1392         verify_constructor_flags.
1394 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1396         PR c++/68357
1397         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1398         return error_mark_node instead of building trees with error_mark_node
1399         operands.
1401 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1403         PR other/69006
1404         * error.c (print_instantiation_partial_context_line): Add missing
1405         newlines from output for the t == NULL case.
1406         (print_instantiation_partial_context): Remove call to pp_newline.
1408 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
1410         Revert:
1411         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1413         PR c++/11858
1414         PR c++/24663
1415         PR c++/24664
1416         * decl.c (grokdeclarator): Don't decay array parameter type to
1417         a pointer type if it's dependent.
1418         (grokparms): Invoke strip_top_quals instead of directly invoking
1419         cp_build_qualified_type.
1420         * pt.c (decay_dependent_array_parm_type): New static function.
1421         (type_unification_real): Call decay_dependent_array_parm_type
1422         to decay a dependent array parameter type to its corresponding
1423         pointer type before unification.
1424         (more_specialized_fn): Likewise.
1425         (get_bindings): Likewise.
1426         * tree.c (cp_build_qualified_type): Trivial typofix in
1427         documentation.
1429 2016-01-23  Martin Sebor  <msebor@redhat.com>
1431         PR c++/58109
1432         PR c++/69022
1433         * decl2.c (is_late_template_attribute): Handle dependent argument
1434         to attribute align and attribute vector_size.
1436 2016-01-21  Jason Merrill  <jason@redhat.com>
1438         PR c++/69392
1439         * lambda.c (lambda_capture_field_type): Handle 'this' specially
1440         for init-capture, too.
1442         PR c++/65687
1443         * decl.c (type_is_deprecated): Don't look into a typedef.
1445         PR c++/40751
1446         PR c++/64987
1447         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1449         PR c++/43407
1450         * decl.c (start_enum): Add attributes parameter.
1451         * parser.c (cp_parser_enum_specifier): Pass it.
1452         * pt.c (lookup_template_class_1): Pass it.
1453         * cp-tree.h: Adjust.
1455 2016-01-19  Jason Merrill  <jason@redhat.com>
1457         PR c++/59759
1458         * pt.c (convert_template_argument): Handle VAR_DECL properly.
1460 2016-01-19  Marek Polacek  <polacek@redhat.com>
1462         PR c++/68586
1463         * constexpr.c (clear_cv_cache): New.
1464         * cp-gimplify.c (clear_fold_cache): New.
1465         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1466         * decl.c (finish_enum_value_list): Call them.
1468         PR c++/68965
1469         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1471 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1473         PR c++/11858
1474         PR c++/24663
1475         PR c++/24664
1476         * decl.c (grokdeclarator): Don't decay array parameter type to
1477         a pointer type if it's dependent.
1478         (grokparms): Invoke strip_top_quals instead of directly invoking
1479         cp_build_qualified_type.
1480         * pt.c (decay_dependent_array_parm_type): New static function.
1481         (type_unification_real): Call decay_dependent_array_parm_type
1482         to decay a dependent array parameter type to its corresponding
1483         pointer type before unification.
1484         (more_specialized_fn): Likewise.
1485         (get_bindings): Likewise.
1486         * tree.c (cp_build_qualified_type): Trivial typofix in
1487         documentation.
1489 2016-01-18  Jason Merrill  <jason@redhat.com>
1491         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1493         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1495         PR c++/68767
1496         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
1497         (contains_label_1, contains_label_p): Remove.
1499 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1501         PR c++/69091
1502         * pt.c (type_dependent_expression_p): For a function template
1503         specialization, a type is dependent iff any of its template
1504         arguments are.
1506 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1508         * cp-array-notation.c (cp_expand_cond_array_notations): Return
1509         error_mark_node only if find_rank failed, not if it was
1510         successful.
1512 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1514         PR c++/68936
1515         * tree.c (build_min_non_dep_call_vec): Don't retain the
1516         KOENIG_LOOKUP_P flag of the non-dependent expression that's
1517         been built.
1518         (build_min_non_dep_op_overload): Instead, do it here.
1520 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
1522         PR bootstrap/68271
1523         * parser.h (cp_token): Remove pragma_kind field.  Add comment
1524         with number of unused bits.
1525         * parser.c (eof_token): Remove pragma_kind field initializer.
1526         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1527         field, don't clear CPP_PRAGMA u.value.
1528         (cp_parser_pragma_kind): New function.
1529         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1530         cp_parser_omp_construct, cp_parser_initial_pragma,
1531         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1532         pragma_kind field.
1534 2016-01-15  Jason Merrill  <jason@redhat.com>
1536         PR c++/68847
1537         * call.c (build_cxx_call): Use fold_non_dependent_expr.
1539         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1540         value.
1542         PR c++/69257
1543         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1544         array/function-to-pointer conversion.  Call
1545         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1546         * call.c (convert_like_real): Print call context if
1547         decay_conversion errors.
1549 2016-01-14  Tom de Vries  <tom@codesourcery.com>
1551         PR tree-optimization/68773
1552         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1553         set force_output.
1555 2016-01-14  Jason Merrill  <jason@redhat.com>
1557         PR c++/69261
1558         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
1560 2016-01-12  Marek Polacek  <polacek@redhat.com>
1562         PR c++/68979
1563         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
1564         error_at and adjust the return value.
1566 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
1568         PR objc++/68511
1569         PR c++/69213
1570         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
1571         GS_ERROR whenever seen_error (), only if *expr_p contains
1572         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
1574         PR c++/66808
1575         PR c++/69000
1576         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
1578 2016-01-11  Jason Merrill  <jason@redhat.com>
1580         PR c++/69131
1581         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
1582         (process_subob_fn): Likewise.  Don't consider triviality if true.
1583         (synthesize_method_walk): Pass it.
1585 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
1587         PR c++/68795
1588         * parser.c (cp_parser_postfix_expression): Initialize
1589         close_paren_loc to UNKNOWN_LOCATION; only use it if
1590         it has been written to by
1591         cp_parser_parenthesized_expression_list.
1592         (cp_parser_parenthesized_expression_list): Document the behavior
1593         with respect to the CLOSE_PAREN_LOC param.
1595 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
1597         PR c++/69211
1598         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1599         folded operands have side-effects, but folding changed any of them,
1600         build a new tree with the folded operands instead of returning the
1601         unfolded tree.
1603 2016-01-09  Marek Polacek  <polacek@redhat.com>
1605         PR c++/69113
1606         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1608 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
1610         PR c++/69164
1611         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1613 2016-01-08  Jason Merrill  <jason@redhat.com>
1615         PR c++/69158
1616         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1617         in completion.
1619 2016-01-08  Marek Polacek  <polacek@redhat.com>
1621         PR c++/68449
1622         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1624 2016-01-08  Jason Merrill  <jason@redhat.com>
1626         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1627         workaround.
1629         PR c++/68983
1630         PR c++/67557
1631         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1632         TREE_ADDRESSABLE type.
1634         PR c++/68983
1635         PR c++/67557
1636         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1638 2016-01-05  Nathan Sidwell  <nathan@acm.org>
1640         PR c++/58583
1641         * pt.c (build_non_dependent_expr): Don't try a checking fold when
1642         parsing an nsdmi.
1644 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1646         Update copyright years.
1648 Copyright (C) 2016 Free Software Foundation, Inc.
1650 Copying and distribution of this file, with or without modification,
1651 are permitted in any medium without royalty provided the copyright
1652 notice and this notice are preserved.