Increase loop alignment on Cortex cores to 8 and set function alignment to 16.
[official-gcc.git] / gcc / cp / ChangeLog
blob327391bf775f27d877051d3c6a55e91822e7838f
1 2016-06-29  Thomas Schwinge  <thomas@codesourcery.com>
3         * parser.c (cp_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
4         Move pragma context checking into...
5         (cp_parser_omp_cancellation_point): ... here, and improve
6         diagnostic messages.
7         * semantics.c (finish_omp_cancel, finish_omp_cancellation_point):
8         Improve diagnostic messages.
10 2016-06-28  Jakub Jelinek  <jakub@redhat.com>
12         * Make-lang.in: Don't cat ../stage_current if it does not exist.
14 2016-06-24  Jason Merrill  <jason@redhat.com>
16         P0145R2: Refining Expression Order for C++.
17         * typeck.c (cp_build_modify_expr): Leave COMPOUND_EXPR on LHS.
19         * tree.c (get_target_expr_sfinae): Handle bit-fields.
20         (build_target_expr): Call mark_rvalue_use.
22 2016-06-24  Jakub Jelinek  <jakub@redhat.com>
24         * call.c (magic_varargs_p): Return 3 for __builtin_*_overflow_p.
25         (build_over_call): For magic == 3, do no conversion only on 3rd
26         argument.
28 2016-06-23  Andi Kleen  <ak@linux.intel.com>
30         * Make-lang.in: Add support for autofdo.
32 2016-06-21  Jason Merrill  <jason@redhat.com>
34         * constraint.cc (constraints_satisfied_p): Keep as many levels of
35         args as our template has levels of parms.
37         * pt.c (template_parm_outer_level, uses_outer_template_parms): New.
38         (type_dependent_expression_p): Use uses_outer_template_parms.
40 2016-06-20  David Malcolm  <dmalcolm@redhat.com>
42         * parser.c (cp_parser_string_literal): Convert non-standard
43         concatenation error to directly use a rich_location, and
44         use that to add the location of the first literal to the
45         diagnostic.
47 2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
49         * decl.c (validate_constexpr_redeclaration): Change pair of errors
50         to error + inform.
51         * error.c (dump_function_decl): Save the constexpr specifier too.
53 2016-06-17  Jakub Jelinek  <jakub@redhat.com>
55         * tree.c (builtin_valid_in_constant_expr_p): Test for
56         DECL_BUILT_IN_CLASS equal to BUILT_IN_NORMAL instead of just
57         DECL_BUILT_IN.
58         (bot_manip): Likewise.
59         * call.c (magic_varargs_p): Likewise.
61 2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
63         * decl.c (grokfndecl): Change pair of errors to error + inform.
65 2016-06-17  Jason Merrill  <jason@redhat.com>
67         PR c++/71209
68         * typeck.c (finish_class_member_access_expr): Avoid "not a base"
69         warning when there are dependent bases.
71 2016-06-17  Jakub Jelinek  <jakub@redhat.com>
73         * semantics.c (handle_omp_array_sections_1): Don't ICE when
74         processing_template_decl when checking for bitfields and unions.
75         Look through REFERENCE_REF_P as base of COMPONENT_REF.
76         (finish_omp_clauses): Look through REFERENCE_REF_P even for
77         array sections with COMPONENT_REF bases.
79 2016-06-16  Jakub Jelinek  <jakub@redhat.com>
81         * parser.c (cp_parser_omp_var_list_no_open): Call
82         convert_from_reference before cp_parser_postfix_dot_deref_expression.
83         * semantics.c (finish_omp_clauses): Don't ICE when
84         processing_template_decl when checking for bitfields and unions.
85         Look through REFERENCE_REF_P as base of COMPONENT_REF.
87 2016-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
89         * decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and
90         "%qF" in warning_at instead of "%q+F" in warning.
91         (check_redeclaration_exception_specification): Likewise in pedwarn
92         (and error, inform, for consistency).
93         * call.c (joust): Likewise.
95 2016-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
97         PR c++/70202
98         * decl.c (xref_basetypes): Revert r117839 changes; add fix-up
99         code at the end of the for loop; also revert r159637 changes,
100         add back the gcc_assert.
101         * cp-tree.h (xref_basetypes): Adjust declaration.
102         * parser.c (cp_parser_class_head): Adjust xref_basetypes call.
104 2016-06-14  David Malcolm  <dmalcolm@redhat.com>
106         * search.c: Include spellcheck-tree.h rather than spellcheck.h.
108 2016-06-14  David Malcolm  <dmalcolm@redhat.com>
110         * typeck.c: Include "gcc-rich-location.h".
111         (finish_class_member_access_expr): Simplify fixit code by
112         using gcc_rich_location::add_fixit_misspelled_id.
114 2016-06-14  Jason Merrill  <jason@redhat.com>
116         P0145R2: Refining Expression Order for C++.
117         * cp-tree.h (CALL_EXPR_OPERATOR_SYNTAX, CALL_EXPR_ORDERED_ARGS)
118         (CALL_EXPR_REVERSE_ARGS): New.
119         * call.c (build_new_op_1): Set them.
120         (extract_call_expr, op_is_ordered): New.
121         (build_over_call): Set CALL_EXPR_ORDERED_ARGS.
122         * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Handle new flags.
123         * pt.c (tsubst_copy_and_build): Copy new flags.
124         * semantics.c (simplify_aggr_init_expr): Likewise.
125         * tree.c (build_aggr_init_expr): Likewise.
126         (build_min_non_dep_op_overload): Likewise.
128 2016-06-14  Jakub Jelinek  <jakub@redhat.com>
130         PR c++/71528
131         * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
132         olddecl vars, preserve their TREE_READONLY bit.
134         PR c++/71516
135         * decl.c (complete_vars): Handle gracefully type == error_mark_node.
137 2016-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
139         * typeck2.c (digest_init_r): Use EXPR_LOC_OR_LOC on init.
141 2016-06-13  Paolo Carlini  <paolo.carlini@oracle.com>
143         * decl.c (grokdeclarator): Fix typo in pedwarn text.
145 2016-06-10  Thomas Schwinge  <thomas@codesourcery.com>
147         PR c/71381
148         * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
149         Loosen checking.
151 2016-06-09  Paolo Carlini  <paolo.carlini@oracle.com>
153         PR c++/71465
154         Revert:
155         2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
157         PR c++/70202
158         * parser.c (cp_parser_class_head): When xref_basetypes fails and
159         emits an error do not zero the type.
161 2016-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
163         * decl.c (maybe_deduce_size_from_array_init): Use
164         DECL_SOURCE_LOCATION in error_at.
165         (layout_var_decl): Likewise.
166         (check_array_initializer): Likewise.
167         (check_initializer): Likewise.
168         (duplicate_decls, check_elaborated_type_specifier): Tidy.
170 2016-06-08  Martin Sebor  <msebor@redhat.com>
171             Jakub Jelinek  <jakub@redhat.com>
173         PR c++/70507
174         PR c/68120
175         * constexpr.c: Include gimple-fold.h.
176         (cxx_eval_internal_function): New function.
177         (cxx_eval_call_expression): Call it.
178         (potential_constant_expression_1): Handle integer arithmetic
179         overflow built-ins.
180         * tree.c (builtin_valid_in_constant_expr_p): Handle
181         BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
183 2016-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
185         * pt.c (tsubst, case TYPENAME_TYPE): Don't delay checking the
186         return value of tsubst_aggr_type for error_mark_node.
188 2016-06-08  Jakub Jelinek  <jakub@redhat.com>
190         PR c++/71442
191         * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
193 2016-06-06  Jakub Jelinek  <jakub@redhat.com>
194             Patrick Palka  <ppalka@gcc.gnu.org>
196         PR c++/70847
197         PR c++/71330
198         PR c++/71393
199         * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
200         right after cp_fold call if cp_fold has returned the same stmt
201         already in some earlier cp_fold_r call.
202         (cp_fold_function): Add pset automatic variable, pass its address
203         to cp_walk_tree.
205 2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
207         PR c++/70202
208         * parser.c (cp_parser_class_head): When xref_basetypes fails and
209         emits an error do not zero the type.
211 2016-06-03  Patrick Palka  <ppalka@gcc.gnu.org>
213         PR c++/27100
214         * decl.c (duplicate_decls): Properly copy the
215         DECL_PENDING_INLINE_P, DECL_PENDING_INLINE_INFO and
216         DECL_SAVED_FUNCTION_DATA fields from OLDDECL to NEWDECL.
218 2016-06-03  Chung-Lin Tang  <cltang@codesourcery.com>
220         * semantics.c (finish_omp_clauses): Mark OpenACC reduction
221         arguments as addressable when async clause exists.
223 2016-06-02  Jan Hubicka  <jh@suse.cz>
225         * cp-gimplify.c (genericize_continue_stmt): Force addition of
226         predict stmt.
228 2016-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
230         * decl.c (xref_tag_1): Change pairs of errors to error + inform.
231         (start_enum): Likewise.
232         * parser.c (cp_parser_class_head): Likewise.
234 2016-06-02  Jakub Jelinek  <jakub@redhat.com>
236         PR c++/71372
237         * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
238         is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
239         and TREE_THIS_VOLATILE flags.  For ARRAY_REF and ARRAY_RANGE_REF, copy
240         over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
241         to the newly built tree.
243 2016-05-31  Jason Merrill  <jason@redhat.com>
245         * pt.c (instantiate_decl): Avoid recalculation.
247         PR c++/60095
248         PR c++/69515
249         PR c++/69009
250         * pt.c (instantiate_template_1): Don't put the partial
251         specialization in DECL_TI_TEMPLATE.
252         (partial_specialization_p, impartial_args): Remove.
253         (regenerate_decl_from_template): Add args parm.
254         (instantiate_decl): Look up the partial specialization again.
256         PR c++/71227
257         * pt.c (check_explicit_specialization): Give better diagnostic about
258         specializing a hidden friend.
260 2016-05-31  Paolo Carlini  <paolo.carlini@oracle.com>
262         PR c++/71248
263         * decl.c (check_static_variable_definition): Use DECL_SOURCE_LOCATION
264         to obtain correct locations; avoid redundant diagnostics on
265         out-of-class definitions.
267 2016-05-30  Martin Sebor  <msebor@redhat.com>
269         PR c++/71306
270         * init.c (warn_placement_new_too_small): Handle placement new arguments
271         that are elements of arrays more carefully.  Remove a pointless loop.
273 2016-05-30  Jakub Jelinek  <jakub@redhat.com>
275         PR c++/71349
276         * parser.c (cp_parser_omp_for): Don't disallow nowait clause
277         when combined with target construct.
278         (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
279         to cp_parser_omp_all_clauses.
281 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
283         PR c++/71238
284         * lex.c (unqualified_name_lookup_error): Take a location too.
285         (unqualified_fn_lookup_error): Take a cp_expr.
286         * cp-tree.h (unqualified_name_lookup_error,
287         unqualified_fn_lookup_error): Adjust declarations.
288         * semantics.c (perform_koenig_lookup): Adjust
289         unqualified_fn_lookup_error call, pass the location of
290         the identifier too as part of a cp_expr.
292 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
294         PR c++/71099
295         * parser.c (cp_parser_function_specifier_opt): Use current_class_type
296         to improve the diagnostic about wrong uses of 'virtual'.
298 2016-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
300         PR c++/71105
301         * lambda.c (maybe_add_lambda_conv_op): Early return also when
302         LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
304 2016-05-28  Ville Voutilainen  <ville.voutilainen@gmail.com>
306         Revert:
307         PR c++/69855
308         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
309         decls into the global scope after stripping template bits
310         and setting DECL_ANTICIPATED.
312 2016-05-27  Paolo Carlini  <paolo.carlini@oracle.com>
314         PR c++/60385
315         * name-lookup.c (push_namespace): Return bool, false when pushdecl
316         fails.
317         * name-lookup.h (push_namespace): Adjust declaration.
318         * parser.c (cp_parser_namespace_definition): Check push_namespace
319         return value.
321 2016-05-27  Ville Voutilainen  <ville.voutilainen@gmail.com>
323         PR c++/69855
324         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
325         decls into the global scope after stripping template bits
326         and setting DECL_ANTICIPATED.
328 2016-05-26  Jakub Jelinek  <jakub@redhat.com>
330         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_SCHEDULE>: Warn
331         if OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
333 2016-05-26  Patrick Palka  <ppalka@gcc.gnu.org>
335         PR c++/70822
336         PR c++/70106
337         * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
338         SCOPE_REFs too.
339         * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
340         on the qualified_id then propagate it to the resulting
341         expression.
342         (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
343         too.
344         * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
345         its REF_PARENTHESIZED_P flag.
347 2016-05-25  Jason Merrill  <jason@redhat.com>
349         PR c++/71173
350         PR c++/70522
351         * cp-tree.h (enum tag_types): Add scope_type.
352         * parser.c (cp_parser_class_name): Use scope_type.
353         (prefer_type_arg): Handle scope_type.
354         (cp_parser_lookup_name): Use prefer_type_arg.
355         * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
356         int prefer_type, use lookup_flags.
357         * name-lookup.h: Adjust.
359 2016-05-24  Cesar Philippidis  <cesar@codesourcery.com>
361         * parser.c (cp_parser_oacc_declare): Add support for
362         GOMP_MAP_FIRSTPRIVATE_POINTER.
363         * semantics.c (handle_omp_array_sections_1): Replace bool is_omp
364         argument with enum c_omp_region_type ort.  Don't privatize OpenACC
365         non-static members.
366         (handle_omp_array_sections): Replace bool is_omp argument with enum
367         c_omp_region_type ort.  Update call to handle_omp_array_sections_1.
368         (finish_omp_clauses): Add specific errors and warning messages for
369         OpenACC.  Use firsrtprivate pointers for OpenACC subarrays.  Update
370         call to handle_omp_array_sections.
372 2016-05-24  Jason Merrill  <jason@redhat.com>
374         PR c++/70584
375         * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
376         returns a decl.
377         (cp_fold) [INDIRECT_REF]: Don't fold to an rvalue.
379 2016-05-24  Martin Sebor  <msebor@redhat.com>
381         PR c++/71147
382         * decl.c (layout_var_decl, grokdeclarator): Use complete_or_array_type_p.
383         * pt.c (instantiate_class_template_1): Try to complete the element
384         type of a flexible array member.
385         (can_complete_type_without_circularity): Handle arrays of unknown bound.
386         * typeck.c (complete_type): Also complete the type of the elements of
387         arrays with an unspecified bound.
389 2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
391         PR c++/69872
392         * typeck2.c (check_narrowing): Check pedwarn return value.
394 2016-05-24  Jakub Jelinek  <jakub@redhat.com>
396         PR c++/71257
397         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
398         For OMP_CLAUSE_LINEAR_REF don't require type to be
399         integral or pointer.
401 2016-05-24  Richard Biener  <rguenther@suse.de>
403         PR middle-end/70434
404         PR c/69504
405         * expr.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
406         * constexpr.c (cxx_eval_array_reference): Handle indexed
407         vectors.
408         * typeck.c (cp_build_array_ref): Adjust.
410 2016-05-23  Jason Merrill  <jason@redhat.com>
412         PR c++/70344
413         * constexpr.c (cxx_eval_call_expression): Check for
414         fun == current_function_decl again.
416         PR c++/70584
417         * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call
418         maybe_undo_parenthesized_ref.
420         PR c++/70735
421         * pt.c (tsubst_copy): Just return a local variable from
422         non-template context.  Don't call rest_of_decl_compilation for
423         duplicated static locals.
424         (tsubst_decl): Set DECL_CONTEXT of local static from another
425         function.
427 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
429         PR c++/70972
430         * method.c (forward_parm): Use cp_build_reference_type.
432 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
434         PR c++/69095
435         * parser.c (cp_parser_initializer): Use check_for_bare_parameter_packs.
437 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
439         * pt.c (check_for_bare_parameter_packs): Improve error message
440         location for expressions.
442 2016-05-20  Nathan Sidwell  <nathan@acm.org>
444         * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
445         ... goto.
446         (cxx_eval_call_expression): Fix comment grammar.
448 2016-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
450         PR c++/70572
451         * decl.c (cp_finish_decl): Check do_auto_deduction return value
452         and return immediately in case of erroneous code.
454 2016-05-19  Marek Polacek  <polacek@redhat.com>
456         PR c++/71075
457         * pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.
459 2016-05-19  Jason Merrill  <jason@redhat.com>
461         PR c++/10200
462         * pt.c (fn_type_unification): Add outer template args if needed.
463         (type_unification_real): Handle getting full args.
465 2016-05-19  David Malcolm  <dmalcolm@redhat.com>
467         PR c++/71184
468         * parser.c (cp_parser_operator): For array new/delete, check that
469         cp_parser_require returned a non-NULL token before dereferencing
470         it.
472 2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
474         * decl.c (finish_enum_value_list): Use the specified mode.
476 2016-05-18  Jason Merrill  <jason@redhat.com>
478         * pt.c (value_dependent_expression_p): Tweak new cases to better
479         match the wording in the standard.
481 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
483         PR c++/69793
484         * parser.c (cp_parser_template_id): Don't call cp_lexer_peek_nth_token
485         when the previous cp_lexer_peek_token returns CPP_EOF.
487 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
489         PR c++/70466
490         * call.c (convert_like_real): Check that we are actually converting
491         from an init list.
493 2016-05-16  Matthew Wahab  <matthew.wahab@arm.com>
495         * decl.c (grokdeclarator): Remove errmsg and use of
496         targetm.invalid_return_type.
497         (grokparms): Remove errmsg and use of
498         targetm.invalid_parameter_type.
500 2016-05-13  Jason Merrill  <jason@redhat.com>
502         PR c++/10200
503         PR c++/69753
504         * pt.c (tsubst_decl): Use uses_template_parms.
505         (instantiate_template_1): Handle non-dependent calls in templates.
506         (value_dependent_expression_p): Handle BASELINK, FUNCTION_DECL.
507         (type_dependent_expression_p): Only consider innermost template args.
508         (dependent_template_arg_p): Check enclosing class of a template here.
509         (dependent_template_p): Not here.
510         (type_dependent_object_expression_p): New.
511         * typeck.c (finish_class_member_access_expr): Use it.
512         * parser.c (cp_parser_postfix_expression): Use it.
513         (cp_parser_postfix_dot_deref_expression): Use it.  Use comptypes
514         to detect the current instantiation.
515         (cp_parser_lookup_name): Really implement DR 141.
516         * search.c (lookup_field_r): Prefer a dependent using-declaration.
517         (any_dependent_bases_p): Split out from...
518         * name-lookup.c (do_class_using_decl): ...here.
519         * call.c (build_new_method_call_1): Use it.
520         * semantics.c (finish_call_expr): 'this' doesn't make a call dependent.
521         * tree.c (non_static_member_function_p): Remove.
522         * typeck2.c (build_x_arrow): Use dependent_scope_p.
524         * parser.c (cp_parser_postfix_dot_deref_expression): Use
525         complete_type_or_else for unknown_type_node, too.
527 2016-05-12  Marek Polacek  <polacek@redhat.com>
529         PR c/70756
530         * call.c (build_new_op_1): Pass LOC to cp_build_modify_expr.
531         * cp-tree.h (cp_build_modify_expr): Update declaration.
532         (cxx_incomplete_type_error, cxx_incomplete_type_diagnostic): New inline
533         overloads.
534         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Pass INPUT_LOCATION to
535         cp_build_modify_expr.
536         * decl2.c (set_guard): Likewise.
537         (handle_tls_init): Likewise.
538         * init.c (perform_member_init): Likewise.
539         (expand_virtual_init): Likewise.
540         (build_new_1): Likewise.
541         (build_vec_delete_1): Likewise.
542         (get_temp_regvar): Likewise.
543         (build_vec_init): Likewise.
544         * method.c (do_build_copy_assign): Likewise.
545         (assignable_expr): Likewise.
546         * semantics.c (finish_omp_for): Likewise.
547         * typeck.c (cp_build_binary_op): Pass LOCATION to pointer_diff and
548         cp_pointer_int_sum.
549         (cp_pointer_int_sum): Add location parameter.  Pass it down to
550         pointer_int_sum.
551         (pointer_diff): Add location parameter.  Use it.
552         (build_modify_expr): Pass location down to cp_build_modify_expr.
553         (cp_build_modify_expr): Add location parameter.  Use it.
554         (build_x_modify_expr): Pass location down to cp_build_modify_expr.
555         * typeck2.c (cxx_incomplete_type_diagnostic,
556         cxx_incomplete_type_error): Add location parameter.
558 2016-05-11  Marek Polacek  <polacek@redhat.com>
560         PR c++/71024
561         * decl.c (duplicate_decls): Call diagnose_mismatched_decls.
563 2016-05-05  Jakub Jelinek  <jakub@redhat.com>
565         * parser.c (cp_parser_selection_statement): For RID_SWITCH,
566         pass if_p instead of NULL to cp_parser_implicitly_scoped_statement.
568 2016-05-04  Marek Polacek  <polacek@redhat.com>
570         * parser.c (cp_parser_selection_statement): Replace OPT_Wparentheses
571         with OPT_Wdangling_else.
573 2016-05-03  Martin Sebor  <msebor@redhat.com>
575         PR c++/66561
576         * tree.c (builtin_valid_in_constant_expr_p): Treat BUILT_IN_FILE,
577         BUILT_IN_FUNCTION, and BUILT_IN_LINE as constant expressions.
579 2016-05-03  Marek Polacek  <polacek@redhat.com>
581         PR c/70859
582         * call.c (build_cxx_call): Pass location and vNULL down to
583         check_builtin_function_arguments.
585 2016-05-03  Richard Biener  <rguenther@suse.de>
587         * Make-lang.in (cc1plus-checksum.c): For stage-final re-use
588         the checksum from the previous stage.
590 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
592         PR c++/62314
593         * typeck.c (finish_class_member_access_expr): When
594         giving a hint about a possibly-misspelled member name,
595         add a fix-it replacement hint.
597 2016-05-02  Cesar Philippidis  <cesar@codesourcery.com>
599         * cp-tree.h (finish_omp_clauses): Update prototype.
600         * parser.c (cp_parser_oacc_all_clauses): Update call to
601         finish_omp_clauses.
602         (cp_parser_omp_all_clauses): Likewise.
603         (cp_parser_omp_for_loop): Likewise.
604         (cp_omp_split_clauses): Likewise.
605         (cp_parser_oacc_cache): Likewise.
606         (cp_parser_oacc_loop): Likewise.
607         (cp_parser_omp_declare_target):
608         (cp_parser_cilk_simd_all_clauses): Likewise.
609         (cp_parser_cilk_for): Likewise.
610         * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
611         arguments with enum c_omp_region_type ort.
612         (tsubst_omp_clauses): Update calls to finish_omp_clauses.
613         (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
614         (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
615         (tsubst_expr): Update calls to tsubst_omp_clauses.
616         * semantics.c (finish_omp_clauses): Replace bool arguments
617         allow_fields, declare_simd, and is_cilk with bitmask ort.
618         (finish_omp_for): Update call to finish_omp_clauses.
620 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
622         PR c++/62314
623         * parser.c (cp_parser_class_head): Capture the start location;
624         use it to emit a fix-it insertion hint when complaining
625         about missing "template <> " in explicit specializations.
627 2016-05-02  Richard Sandiford  <richard.sandiford@arm.com>
629         * init.c (build_new_1): Use shift operators instead of wi:: shifts.
631 2016-05-02  Richard Biener  <rguenther@suse.de>
633         * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
634         anonymous VLAs.
636 2016-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
638         PR c++/66644
639         * class.c (check_field_decl): Remove final int* parameter, change
640         the return type to bool; fix logic in order not to reject multiple
641         initialized fields in anonymous struct.
642         (check_field_decls): Adjust call.
644 2016-04-29  Cesar Philippidis  <cesar@codesourcery.com>
646         PR middle-end/70626
647         * parser.c (cp_parser_oacc_loop): Don't augment mask with
648         OACC_LOOP_CLAUSE_MASK.
649         (cp_parser_oacc_kernels_parallel): Update call to
650         c_oacc_split_loop_clauses.
652 2016-04-28  Jason Merrill  <jason@redhat.com>
654         Implement C++17 [[nodiscard]] attribute.
655         PR c++/38172
656         PR c++/54379
657         * parser.c (cp_parser_std_attribute): Handle [[nodiscard]].
658         * tree.c (handle_nodiscard_attribute): New.
659         (cxx_attribute_table): Add [[nodiscard]].
660         * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New.
661         (maybe_warn_nodiscard): New.
662         (convert_to_void): Call it.
664         * cvt.c (cp_get_callee): New.
665         * constexpr.c (get_function_named_in_call): Use it.
666         * cxx-pretty-print.c (postfix_expression): Use it.
667         * except.c (check_noexcept_r): Use it.
668         * method.c (check_nontriv): Use it.
669         * tree.c (build_aggr_init_expr): Use it.
670         * cp-tree.h: Declare it.
672 2015-04-27  Ryan Burn  <contact@rnburn.com>
673             Jeff Law  <law@redhat.com>
675         PR c++/69024
676         PR c++/68997
677         * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
678         instead of cilk_detect_spawn_and_unwrap.
679         * cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
680         (find_spawn): New.
681         (cilk_cp_detect_spawn_and_unwrap): New.
682         * lambda.c: Include cp-cilkplus.h.
683         * parser.c: Include cp-cilkplus.h.
684         * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into...
685         * cp-cilkpus.h: New file.
687 2016-04-27  Nathan Sidwell  <nathan@acm.org>
689         * constexpr.c (get_fundef_copy): Use the original function for
690         non-recursive evaluations.
691         (save_fundef_copy): Always expect a slot to be available.
693 2016-04-27  Bernd Schmidt  <bschmidt@redhat.com>
695         * parser.c (cp_parser_postfix_expression): Call
696         warn_for_memset instead of warning directly here.
698 2016-04-26  Patrick Palka  <ppalka@gcc.gnu.org>
700         PR c++/70241
701         * decl.c (build_enumerator): Set current_access_specifier when
702         declaring an enumerator belonging to an in-class enumeration.
703         * parser.c (cp_parser_check_access_in_redecleration): Also
704         consider in-class enumerations.
706 2016-04-26  Marek Polacek  <polacek@redhat.com>
708         PR c++/70744
709         * call.c (build_conditional_expr_1): Call cp_stabilize_reference
710         instead of stabilize_reference.
711         (build_over_call): Likewise.
712         * cp-tree.h (cp_stabilize_reference): Declare.
713         * tree.c (cp_stabilize_reference): New function.
714         * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
715         stabilize_reference.
716         (unary_complex_lvalue): Likewise.
717         (cp_build_modify_expr): Likewise.
719 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
721         PR bootstrap/70704
722         * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
723         just flag_checking.
725 2016-04-25  Jason Merrill  <jason@redhat.com>
727         * tree.c (std_attribute_table): New.
728         (init_tree): Register it.
730 2016-04-22  Jason Merrill  <jason@redhat.com>
732         * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
734 2016-04-21  Patrick Palka  <ppalka@gcc.gnu.org>
736         * name-lookup.c (free_saved_scope): New free list of saved_scope
737         structures.
738         (push_to_top_level): Attempt to reuse a saved_scope struct
739         from free_saved_scope instead of allocating a new one each time.
740         (pop_from_top_level_1): Chain the now-unused saved_scope structure
741         onto free_saved_scope.
743 2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
745         PR c++/70540
746         * semantics.c (process_outer_var_ref): Unconditionally return
747         error_mark_node when mark_used returns false.
749 2016-04-21  Marek Polacek  <polacek@redhat.com>
751         PR c++/70513
752         * parser.c (cp_parser_enum_specifier): Check and possibly error for
753         extra qualification.
755 2016-04-20  Nathan Sidwell  <nathan@acm.org>
757         PR c++/55635
758         * init.c (build_vec_delete_1): Protect operator delete call in try
759         finally.
760         (build_delete): Likewise.
761         * optimize.c (build_delete_destructor_body): Likewise.
763 2016-04-20  Ilya Verbin  <ilya.verbin@intel.com>
765         PR c++/69363
766         * cp-tree.h (finish_omp_clauses): Add new default argument.
767         * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
768         instead of c_finish_cilk_clauses.
769         * semantics.c (finish_omp_clauses): Add new argument.  Allow
770         floating-point variables in the linear clause for Cilk Plus.
772 2016-04-20  Nathan Sidwell  <nathan@acm.org>
774         * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
775         TARGET_EXPR.
777 2016-04-19  Jason Merrill  <jason@redhat.com>
779         PR c++/66543
780         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
781         * pt.c (make_pack_expansion): Call mark_exp_read.
782         * semantics.c (finish_id_expression): Call mark_type_use in
783         unevaluated context.
785         DR 2137
786         * call.c (implicit_conversion): If we choose a copy constructor
787         for list-initialization from the same type, the conversion is an
788         exact match.
790         * constexpr.c (breaks): Handle EXIT_EXPR.
791         (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
792         (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
793         of COMPOUND_EXPR.
795         PR c++/68206
796         PR c++/68530
797         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
798         and GOTO_EXPR.
800         * pt.c (tsubst_expr): Remove shadowing declaration.
801         (tsubst_pack_expansion): Add assert.
803         * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
805         PR c++/70522
806         * name-lookup.c (qualified_lookup_using_namespace): Look through
807         hidden names.
809 2016-04-18  Michael Matz  <matz@suse.de>
811         * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
812         (layout_class_type): Ditto.
813         (build_base_field): Use SET_DECL_ALIGN.
814         (fixup_attribute_variants): Use SET_TYPE_ALIGN.
815         * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
816         (record_unknown_type): Use SET_TYPE_ALIGN.
817         (cxx_init_decl_processing): Ditto.
818         (copy_type_enum): Ditto.
819         (grokfndecl): Use SET_DECL_ALIGN.
820         (copy_type_enum): Use SET_TYPE_ALIGN.
821         * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
822         (tsubst): Ditto.
823         * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
824         * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
825         * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
826         * rtti.c (emit_tinfo_decl): Ditto.
828 2016-04-18  Jason Merrill  <jason@redhat.com>
830         PR c++/70690
831         PR c++/70528
832         * class.c (type_maybe_constexpr_default_constructor): New.
833         (type_has_constexpr_default_constructor): Revert.
835 2016-04-16  Sandra Loosemore  <sandra@codesourcery.com>
837         PR target/1078
839         * tree.c (cxx_attribute_table): Remove "com_interface" entry.
840         (handle_com_interface_attribute): Delete.
842 2016-04-15  Jason Merrill  <jason@redhat.com>
844         PR c++/70685
845         * constexpr.c (get_fundef_copy): Handle null *slot.
847         PR c++/70505
848         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
849         unknown_type_node, too.
851 2016-04-15  Jason Merrill  <jason@redhat.com>
852             Nathan Sidwell  <nathan@acm.org>
854         PR c++/70594
855         * constexpr.c (constexpr_call_table): Preserve in GC.
856         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
857         (fundef_copies_table): Preserve in GC. Change to pointer to
858         tree->tree hash.
859         (maybe_initialize_fundef_copies_table): Adjust.
860         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
861         (save_fundef_copy): Adjust for a TREE_LIST.
862         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
863         (fini_constexpr): New.
864         * cp-tree.h (fini_constexpr): Declare.
865         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
867 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
869         PR c/70436
870         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
871         where needed.
872         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
873         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
874         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
875         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
876         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
877         cp_parser_statement.
878         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
879         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
880         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
881         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
882         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
883         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
884         cp_parser_omp_taskloop, cp_parser_omp_construct,
885         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
886         Add IF_P argument, pass it down where needed.
887         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
888         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
889         calls.
891 2016-04-14  Jason Merrill  <jason@redhat.com>
893         PR c++/70494
894         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
895         * typeck2.c (split_nonconstant_init_1): Use it.
897         PR c++/70528
898         * class.c (type_has_constexpr_default_constructor): Return true
899         for an implicitly declared constructor.
901         PR c++/70622
902         * parser.c (cp_parser_init_declarator): Add auto_result parm.
903         (cp_parser_simple_declaration): Pass it.
904         (strip_declarator_types): New.
906         PR c++/70543
907         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
908         initializer also makes the variable value-dependent.
910         PR c++/70648
911         * constexpr.c (cxx_eval_store_expression): Also copy
912         CONSTRUCTOR_NO_IMPLICIT_ZERO.
914 2016-04-14  Martin Sebor  <msebor@redhat.com>
916         PR c++/69517
917         PR c++/70019
918         PR c++/70588
919         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
921 2016-04-14  Jason Merrill  <jason@redhat.com>
923         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
924         parameter ABI change.
926 2016-04-13  Martin Sebor  <msebor@redhat.com>
928         PR c++/69517
929         PR c++/70019
930         PR c++/70588
931         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
932         functions.
933         * decl.c (check_initializer, cp_finish_decl): Call them.
934         (reshape_init_r): Reject incompletely braced intializer-lists
935         for VLAs.
936         * init.c (throw_bad_array_length, build_vla_check)
937         (build_vla_size_check, build_vla_init_check): Define new functions.
938         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
939         to detect a VLA.
940         (store_init_value): Same.
942 2016-04-13  Jason Merrill  <jason@redhat.com>
944         Warn about empty parameter ABI with -Wabi=9.
945         * call.c (empty_class_msg, mark_for_abi_warning)
946         (warn_empty_class_abi): New.
947         (build_call_a): Use them.
948         * decl.c (store_parm_decls): Use mark_for_abi_warning.
949         * error.c (pp_format_to_string): New.
951         Pass empty class parameters like C.
952         * call.c (pass_as_empty_struct, empty_class_arg): New.
953         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
954         (build_call_a): Use empty_class_arg.
955         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
956         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
958 2016-04-13  Jason Merrill  <jason@redhat.com>
960         PR c++/70627
961         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
963 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
965         PR c++/70635
966         * pt.c (resolve_typename_type): Fix typos in infinite recursion
967         avoidance mechanism.
969 2016-04-13  Jason Merrill  <jason@redhat.com>
971         PR c++/70634
972         * pt.c (instantiation_dependent_uneval_expression_p): Split out
973         from instantiation_dependent_expression_p.
974         (value_dependent_expression_p): Use it for unevaluated operands.
975         (instantiation_dependent_r): Don't check value-dependence.
976         (instantiation_dependent_expression_p): Check
977         value-dependence of the expression as a whole.
978         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
979         * semantics.c (finish_decltype_type): Use it.
981         * constexpr.c (potential_nondependent_constant_expression): New.
982         (potential_nondependent_static_init_expression): New.
983         (maybe_constant_value_1, fold_non_dependent_expr)
984         (maybe_constant_init): Use them.
985         * pt.c (instantiate_non_dependent_expr_sfinae)
986         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
987         them.
988         * cp-tree.h: Declare them.
990 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
992         PR c++/70594
993         * decl.c (pop_labels_1): Removed.
994         (note_label, sort_labels): New functions.
995         (pop_labels): During named_labels traversal, just push the slot
996         pointers into a vector, then qsort it by DECL_UID and only then
997         call pop_label and chain it into BLOCK_VARS.
999 2016-04-13  Jason Merrill  <jason@redhat.com>
1001         PR c++/70615
1002         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
1003         (cp_gimplify_expr): Not here.
1005 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
1007         PR c++/70610
1008         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
1009         recurse into it.
1010         * typeck.c (build_x_conditional_expr): Unconditionally remember
1011         that the result is an lvalue or xvalue.
1013 2016-04-12  Jason Merrill  <jason@redhat.com>
1015         * class.c (is_really_empty_class): A zero-length array is empty.
1016         An unnamed bit-field doesn't make a class non-empty.
1018 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
1020         PR c++/68722
1021         * parser.c (cp_parser_cache_defarg): When file ends in default
1022         argument simply return error_mark_node.
1024 2016-04-12  Nathan Sidwell  <nathan@acm.org>
1026         PR c++/70501
1027         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
1028         similarly to PMF.
1030 2016-04-11  Jason Merrill  <jason@redhat.com>
1032         * mangle.c (decl_is_template_id): The template itself counts as a
1033         template-id.
1035 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
1037         PR c++/70590
1038         PR c++/70452
1039         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
1040         on the result if it's not a CONSTRUCTOR.
1042 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
1044         PR c++/70452
1045         * constexpr.c (find_constructor): New function.
1046         (unshare_constructor): New function.
1047         (cxx_eval_call_expression): Use unshare_constructor instead of
1048         unshare_expr.
1049         (find_array_ctor_elt): Likewise.
1050         (cxx_eval_vec_init_1): Likewise.
1051         (cxx_eval_store_expression): Likewise.
1052         (cxx_eval_constant_expression): Likewise.
1054 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
1056         PR c/70436
1057         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
1058         potentially generating a future -Wparentheses warning in its
1059         callers.
1061 2016-04-06  Jason Merrill  <jason@redhat.com>
1063         * class.c (check_abi_tags): Fix function template handling.
1065 2016-04-05  Nathan Sidwell  <nathan@acm.org>
1067         PR c++/70512
1068         * class.c (fixup_may_alias): New.
1069         (fixup_attribute_variants): Call it.
1071 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
1073         PR c++/70452
1074         * constexpr.c (struct fundef_copy): New struct.
1075         (struct fundef_copies_table_t): New struct.
1076         (fundef_copies_table): New static variable.
1077         (maybe_initialize_fundef_copies_table): New static function.
1078         (get_fundef_copy): New static function.
1079         (save_fundef_copy): New static function.
1080         (cxx_eval_call_expression): Use get_fundef_copy, and
1081         save_fundef_copy.
1082         (constexpr_call_table): Add "deletable" GTY marker.
1084 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
1086         PR c++/70452
1087         * cp-tree.h (class cache_map): Remove.
1088         * constexpr.c (cv_cache): Change type to
1089         GTY((deletable)) hash_map<tree, tree> *.
1090         (maybe_constant_value): Adjust following the change to cv_cache.
1091         (clear_cv_cache): New static function.
1092         (clear_cv_and_fold_caches): Use it.
1093         * cp-gimplify.c (fold_cache): Change type to
1094         GTY((deletable)) hash_map<tree, tree> *.
1095         (clear_fold_cache): Adjust following the change to fold_cache.
1096         (cp_fold): Likewise.
1098 2016-04-02  Martin Sebor  <msebor@redhat.com>
1100         PR c++/67376
1101         PR c++/70170
1102         PR c++/70172
1103         PR c++/70228
1104         * constexpr.c (diag_array_subscript): New function.
1105         (cxx_eval_array_reference): Detect out of bounds array indices.
1107 2016-04-01  Jason Merrill  <jason@redhat.com>
1109         PR c++/70449
1110         PR c++/70344
1111         * pt.c (instantiate_decl): A function isn't fully defined if
1112         DECL_INITIAL is error_mark_node.
1113         * constexpr.c (cxx_eval_call_expression): Likewise.
1115 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
1116             Marek Polacek  <polacek@redhat.com>
1118         PR c++/70488
1119         * init.c (warn_placement_new_too_small): Test whether
1120         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
1122 2016-04-01  Nathan Sidwell  <nathan@acm.org>
1124         PR c++/68475
1125         * decl.c (check_redeclaration_exception_specification): Check
1126         regardless of -fno-exceptions.
1127         * typeck2.c (merge_exception_specifiers): Relax assert by checking
1128         flag_exceptions too.
1130 2016-03-31  Nathan Sidwell  <nathan@acm.org>
1132         * decl.c (start_preparsed_function): Remove unnecessary bracing.
1133         (finish_destructor_body): Don't emit operator delete here.
1135 2016-03-31  Nathan Sidwell  <nathan@acm.org>
1137         PR c++/70393
1138         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
1139         elements in field order.
1141 2016-03-31  Marek Polacek  <polacek@redhat.com>
1143         PR c/70297
1144         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
1146 2016-03-31  Richard Biener  <rguenther@suse.de>
1148         PR c++/70430
1149         * typeck.c (cp_build_binary_op): Fix operand order of vector
1150         conditional in truth op handling.
1152 2016-03-29  Jason Merrill  <jason@redhat.com>
1154         PR c++/70353
1155         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
1156         in constexpr functions.
1158 2016-03-28  Jason Merrill  <jason@redhat.com>
1160         PR c++/70422
1161         PR c++/64266
1162         PR c++/70353
1163         * decl.c, pt.c, constexpr.c: Revert last patch.
1165 2016-03-25  Jason Merrill  <jason@redhat.com>
1166             Martin LiÅ¡ka  <mliska@suse.cz>
1168         PR c++/64266
1169         PR c++/70353
1170         Core issue 1962
1171         * decl.c (cp_fname_init): Decay the initializer to pointer.
1172         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
1173         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1174         Don't call cp_finish_decl.
1175         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
1176         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
1177         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
1178         Handle DECL_VALUE_EXPR.
1180 2016-03-24  Jason Merrill  <jason@redhat.com>
1182         PR c++/70386
1183         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
1185         PR c++/70323
1186         * constexpr.c (cxx_eval_call_expression): Don't cache result if
1187         *overflow_p.
1189 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
1191         PR c++/62212
1192         * tree.c (build_cplus_array_type): Determine type-dependentess
1193         with uses_template_parms instead of with dependent_type_p.
1195 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1197         PR c++/70347
1198         * typeck.c (process_init_constructor_union): If the initializer
1199         is empty, use the union's NSDMI if it has one.
1201 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1203         PR c++/70332
1204         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
1205         NSDMI that's part of an aggregrate initialization.
1207 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
1209         PR c++/70001
1210         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
1211         for 1..max even for multi-dimensional arrays.  Call unshare_expr
1212         on it.
1214         PR c++/70323
1215         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
1216         on TREE_OVERFLOW constants.
1218         PR c++/70376
1219         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
1220         for OMP_TASKLOOP here.
1221         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
1222         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
1224 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
1225             Jason Merrill  <jason@redhat.com>
1226             Jakub Jelinek  <jakub@redhat.com>
1228         PR c++/69315
1229         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1230         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1231         (finish_function): Don't set or test them.
1232         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
1234 2016-03-23  Jason Merrill  <jason@redhat.com>
1236         PR c++/70344
1237         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
1239 2016-03-23  Marek Polacek  <polacek@redhat.com>
1241         PR c++/69884
1242         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
1244 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
1246         * call.c (build_conditional_expr_1): Always use original
1247         condition type for vector type checks and build.
1249 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1251         PR c++/70096
1252         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
1254 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1256         PR c++/70204
1257         * constexpr.c (non_const_var_error): Check
1258         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1260 2016-03-21  Richard Henderson  <rth@redhat.com>
1262         PR c++/70273
1263         * decl.c (notice_forced_label_r): New.
1264         (cp_finish_decl): Use it.
1266 2016-03-21  Jason Merrill  <jason@redhat.com>
1268         PR c++/70285
1269         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1271 2016-03-18  Jason Merrill  <jason@redhat.com>
1273         PR c++/70139
1274         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
1276         PR c++/70147
1277         * class.c (vptr_via_virtual_p): New.
1278         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
1279         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
1280         a vptr from any virtual base in a not-in-charge 'structor.
1282         * decl.c (build_clobber_this): Factor out of
1283         start_preparsed_function and begin_destructor_body.  Handle
1284         virtual bases better.
1286         * class.c (build_if_in_charge): Split out from build_base_path.
1287         * init.c (expand_virtual_init, expand_default_init): Use it.
1288         * call.c (build_special_member_call): Use it.
1290 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
1292         PR c++/70267
1293         * init.c (build_new_1): Complain and return error_mark_node
1294         if alloc_fn is not _Jv_AllocObject function returning pointer.
1296 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1298         PR c++/70205
1299         * search.c (adjust_result_of_qualified_name_lookup): Don't
1300         update the BASELINK_BINFO of DECL if the second call
1301         to lookup_base fails.
1303 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1305         PR c++/70218
1306         * parser.c (cp_parser_lambda_expression): Move call to
1307         pop_deferring_access_checks ahead of the call to
1308         cp_parser_end_tentative_firewall.
1310 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
1312         PR c++/70144
1313         * cp-tree.h (magic_varargs_p): Return int instead of bool.
1314         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
1315         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
1316         varargs.
1317         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
1318         if magic_varargs_p == 1, call decay_conversion
1319         instead of mark_type_use.  Don't store error_mark_node arguments to
1320         argarray, instead return error_mark_node.
1322         PR c++/70272
1323         * decl.c (begin_destructor_body): Don't insert clobber if
1324         is_empty_class (current_class_type).
1326 2016-03-17  Marek Polacek  <polacek@redhat.com>
1328         PR c++/70194
1329         * typeck.c (warn_for_null_address): New function.
1330         (cp_build_binary_op): Call it.
1332 2016-03-16  Jason Merrill  <jason@redhat.com>
1334         PR c++/70259
1335         * decl.c (start_preparsed_function): Don't clobber an empty base.
1337 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
1339         PR c++/70147
1340         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1341         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1343         PR c++/70147
1344         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1345         set in_base_initializer.
1347 2016-03-15  Marek Polacek  <polacek@redhat.com>
1349         PR c++/70209
1350         * tree.c (strip_typedefs): Call strip_typedefs again on the
1351         DECL_ORIGINAL_TYPE result.
1353 2016-03-15  Jason Merrill  <jason@redhat.com>
1355         PR c++/70095
1356         * pt.c (instantiate_decl): Fix call to variable_template_p.
1358         PR c++/70141
1359         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1361 2016-03-14  Casey Carter  <casey@carter.net>
1362             Jason Merrill  <jason@redhat.com>
1364         P0184R0: Generalizing the Range-Based For Loop
1365         * parser.c (cp_convert_range_for): Set the type of __end separately.
1366         (cp_parser_perform_range_for_lookup): Allow different begin/end
1367         types if they are comparable.
1369 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
1371         PR c++/70106
1372         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1373         processing_template_decl and EXPR is a SCOPE_REF.
1375 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
1376             Jakub Jelinek  <jakub@redhat.com>
1378         PR c++/70001
1379         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
1380         return value from cxx_eval_constant_expression from earlier
1381         elements if it is valid constant initializer requiring no
1382         relocations.
1384 2016-03-10  Marek Polacek  <polacek@redhat.com>
1386         PR c++/70153
1387         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1389 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
1391         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1392         when calling c_finish_omp_clauses.
1394 2016-03-08  Jason Merrill  <jason@redhat.com>
1396         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
1397         diagnostic for use of "concept".
1398         (cp_parser_requires_clause_opt): And "requires".
1399         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
1400         (cp_parser_explicit_template_declaration): Adjust.
1401         * Make-lang.in (check-c++-all): Add "concepts" to std list.
1403         P0036R0: Unary Folds and Empty Parameter Packs
1404         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1406 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
1408         PR c++/70135
1409         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1410         even after the last iteration of the loop.
1412         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1414 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
1416         PR c++/66786
1417         * pt.c (get_template_info): Handle PARM_DECL.
1418         (template_class_depth): Check DECL_P instead of
1419         VAR_OR_FUNCTION_DECL_P.
1421 2016-03-05  Jason Merrill  <jason@redhat.com>
1423         PR c++/67364
1424         * constexpr.c (cxx_eval_store_expression): Replace
1425         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1427 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
1429         PR c++/66786
1430         * pt.c (template_class_depth): Given a lambda type, iterate
1431         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
1432         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
1433         CP_DECL_CONTEXT.
1435 2016-03-04  Jason Merrill  <jason@redhat.com>
1437         PR c++/69203
1438         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
1439         * init.c (build_vec_delete_1): Set it.
1440         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
1442 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
1444         * decl.c (start_preparsed_function): Don't emit start clobber at the
1445         start of constructor clones.
1447         PR c++/70035
1448         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
1449         * decl.c (start_preparsed_function): Call
1450         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
1451         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
1452         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
1454 2016-03-04  Jason Merrill  <jason@redhat.com>
1456         PR c++/67364
1457         * constexpr.c (cxx_eval_component_reference): Further tweak.
1459         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
1460         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
1461         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
1462         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
1464         PR c++/70067
1465         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1466         same type.
1468 2016-03-03  Jason Merrill  <jason@redhat.com>
1470         * method.c (synthesized_method_walk): operator= can also be constexpr.
1472         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1473         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1475         PR c++/67164
1476         * pt.c (copy_template_args): New.
1477         (tsubst_pack_expansion): Use it.
1479         * call.c (build_aggr_conv): Use get_nsdmi.
1481         PR c++/51406
1482         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1484         PR c++/67364
1485         * constexpr.c (cxx_eval_component_reference): Just return an empty
1486         CONSTRUCTOR for an empty class.
1488 2016-03-01  Jason Merrill  <jason@redhat.com>
1490         PR c++/70036
1491         * parser.c (cp_parser_requires_clause): Call
1492         check_for_bare_parameter_packs.
1494         PR c++/51489
1495         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1496         the operands.
1498         PR c++/69995
1499         * constexpr.c (cxx_eval_call_expression): Unshare arg.
1500         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1501         [TARGET_EXPR]: Unshare init.
1503 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
1505         PR c++/68948
1506         PR c++/69961
1507         * pt.c (tsubst_baselink): Reinstate the check for an invalid
1508         constructor call.
1510 2016-02-28  Jason Merrill  <jason@redhat.com>
1512         PR c++/69995
1513         * constexpr.c (cxx_eval_store_expression): Unshare init.
1515 2016-02-26  Jason Merrill  <jason@redhat.com>
1517         PR c++/69958
1518         * pt.c (make_argument_pack): New.
1519         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1520         (tsubst_copy_and_build): Likewise.
1522 2016-02-25  Jason Merrill  <jason@redhat.com>
1524         PR c++/69889
1525         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
1526         * tree.c (build_aggr_init_expr): Set it.
1527         * semantics.c (simplify_aggr_init_expr): Check it.
1528         * cp-gimplify.c (cp_genericize_r): Don't walk into
1529         a call/aggr_init from a thunk.
1531         PR c++/69842
1532         * method.c (forward_parm): Handle parameter packs.
1533         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1535         PR c++/67364
1536         * constexpr.c (cxx_eval_component_reference): Don't complain about
1537         unevaluated empty classes.
1539         PR c++/68049
1540         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1542 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
1544         PR c++/69736
1545         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
1546         (maybe_undo_parenthesized_ref): Declare.
1547         * semantics.c (maybe_undo_parenthesized_ref): Split out from
1548         check_return_expr.
1549         (finish_call_expr): Use it.
1550         * typeck.c (check_return_expr): Use it.
1551         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
1552         REF_PARENTHESIZED_P flag.
1554 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
1556         PR c++/69922
1557         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1558         Avoid folding it.
1559         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
1560         tests.
1561         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
1562         unless they are folded into INTEGER_CST, error_mark_node or some
1563         comparison with NULL, avoid folding them and use either the original
1564         comparison or non-folded comparison of folded arguments.
1565         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
1566         comparison, don't fold the comparison right away.
1568 2016-02-24  Jason Merrill  <jason@redhat.com>
1570         PR c++/69323
1571         * friend.c (make_friend_class): Likewise.
1572         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1574 2016-02-24  Jason Merrill  <jason@redhat.com>
1576         PR c++/69323
1577         * pt.c (instantiate_class_template_1): Set
1578         processing_template_decl before substituting friend_type.
1580 016-02-24  Martin Sebor  <msebor@redhat.com>
1582         PR c++/69912
1583         * tree.c (build_ctor_subob_ref): Compare types' main variants
1584         instead of the types as they are.
1586 2016-02-24  Jason Merrill  <jason@redhat.com>
1588         * decl.c (start_preparsed_function): Condition ctor clobber on
1589         flag_lifetime_dse > 1.
1591         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1593 2016-02-19  Jason Merrill  <jason@redhat.com>
1595         PR c++/69743
1596         * call.c (remaining_arguments): No longer static.
1597         * cp-tree.h: Declare it.
1598         * pt.c (more_specialized_fn): Use it.
1600 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1601             Bernd Edlinger  <bernd.edlinger@hotmail.de>
1603         * Make-lang.in: Invoke gperf with -L C++.
1604         * cfns.gperf: Remove prototypes for hash and libc_name_p
1605         inlines.
1606         * cfns.h: Regenerated.
1607         * except.c (nothrow_libfn_p): Adjust.
1609 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1611         PR c++/69850
1612         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1613         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1615 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
1617         PR c++/68948
1618         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1619         call here.
1620         * semantics.c (finish_call_expr): Don't assume a constructor
1621         call is dependent if only the "this" pointer is dependent.  When
1622         building a constructor call, always use a dummy object.
1624 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1626         PR c++/69850
1627         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1628         condition.
1629         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1630         operators if folding preserved the binop, just with different
1631         arguments.
1633         PR c++/67767
1634         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1635         attr_spec is always single element chain, chain all the attributes
1636         properly together in the right order.
1638 2016-02-18  Jason Merrill  <jason@redhat.com>
1640         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
1641         mangle_decl.
1642         (mangle_decl): Call maybe_check_abi_tags for function scope.
1643         (mangle_guard_variable): Call maybe_check_abi_tags here.
1644         (write_guarded_var_name): Not here.
1646 2016-02-17  Jason Merrill  <jason@redhat.com>
1648         PR c++/65985
1649         * constexpr.c (build_constexpr_constructor_member_initializers):
1650         Handle an additional STATEMENT_LIST.
1652         PR c++/68585
1653         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1655         PR c++/68679
1656         * decl2.c (reset_type_linkage_2): Look through member templates.
1658 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
1660         PR c++/69850
1661         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1663 2016-02-17  Jason Merrill  <jason@redhat.com>
1665         PR c++/69842
1666         * method.c (forward_parm): Split out from...
1667         (add_one_base_init): ...here.
1668         * lambda.c (maybe_add_lambda_conv_op): Use it.
1670 2016-02-16  Jason Merrill  <jason@redhat.com>
1672         PR c++/10200
1673         PR c++/69753
1674         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1675         tree.c, typeck2.c: Revert earlier changes.
1676         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1677         non-type templates after -> or .
1679 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
1681         PR c/69835
1682         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1684 2016-02-16  Jason Merrill  <jason@redhat.com>
1686         PR c++/69657
1687         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1688         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
1689         * name-lookup.h: Adjust.
1691 2016-02-16  James Norris  <jnorris@codesourcery.com>
1693         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1694         * semantics.c (finish_omp_clauses): Add deviceptr checking.
1696 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1698         PR c++/69658
1699         * init.c (expand_default_init): Only call reshape_init
1700         in the direct-initialization from an initializer list case.
1702 2016-02-15  Jason Merrill  <jason@redhat.com>
1704         PR c++/69753
1705         * semantics.c (finish_call_expr): Implicit 'this' does not make
1706         the call dependent.
1707         * search.c (any_dependent_bases_p): Split out...
1708         * name-lookup.c (do_class_using_decl): ...from here.
1709         * call.c (build_new_method_call_1): Don't complain about missing object
1710         if there are dependent bases.  Tweak error.
1711         * tree.c (non_static_member_function_p): Remove.
1712         * pt.c (type_dependent_expression_p): A member template of a
1713         dependent type is dependent.
1714         * cp-tree.h: Adjust.
1716         PR c++/68890
1717         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1719 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1721         PR c++/69098
1722         * pt.c (lookup_and_finish_template_variable): New function,
1723         extracted from ...
1724         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1725         (tsubst_qualified_id): Consider that EXPR might be a variable
1726         template.
1727         * typeck.c (check_template_keyword): Don't emit an error
1728         if DECL is a variable template.
1730 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1732         * error.c: Spelling fixes - behaviour -> behavior and
1733         neighbour -> neighbor.
1734         * decl.c: Likewise.
1735         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1736         diagnostics.
1737         * init.c (build_delete): Likewise.
1739 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1741         PR c/69768
1742         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1743         arguments for -Waddress warning.  Fix up formatting.
1745 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1747         PR c++/68726
1748         * pt.c (lookup_template_class_1): Check tsubst return value for
1749         error_mark_node.
1751 2016-02-10  Jason Merrill  <jason@redhat.com>
1753         PR c++/68926
1754         * pt.c (resolve_nondeduced_context): Add complain parm.
1755         (do_auto_deduction): Pass it.
1756         * cvt.c (convert_to_void): Likewise.
1757         * decl.c (cp_finish_decl): Likewise.
1758         * init.c (build_new): Likewise.
1759         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1760         * semantics.c (finish_decltype_type): Likewise.
1761         * typeck.c (decay_conversion): Likewise.
1762         * cp-tree.h: Adjust declaration.
1763         * call.c (standard_conversion): Add complain parm, pass it along.
1764         (implicit_conversion): Pass it.
1766         PR c++/69657
1767         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1768         (lookup_name_real_1): Likewise.
1769         (remove_hidden_names): Handle non-functions too.
1771         PR c++/10200
1772         * parser.c (cp_parser_lookup_name): When looking for a template
1773         after . or ->, only consider class templates.
1774         (cp_parser_postfix_dot_deref_expression): Handle the current
1775         instantiation.  Remember a dependent object expression.
1776         * typeck2.c (build_x_arrow): Handle the current instantiation.
1778         * ptree.c (debug_tree): Implement for cp_expr.
1780 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1782         PR c++/69139
1783         * parser.c (cp_parser_simple_type_specifier): Make the check
1784         for disambiguating between an 'auto' placeholder and an implicit
1785         template parameter more robust.
1787 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1789         PR c++/69283
1790         PR c++/67835
1791         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1792         setting its TREE_USED flag.
1794 2016-02-08  Jason Merrill  <jason@redhat.com>
1796         PR c++/69657
1797         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1798         built-ins alone.
1800 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1802         PR c++/59627
1803         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1804         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1806 2016-02-08  Marek Polacek  <polacek@redhat.com>
1808         PR c++/69688
1809         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1810         Call clear_fold_cache.
1811         * cp-tree.h: Adjust declaration.
1812         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1813         rather than clear_cv_cache and clear_fold_cache.
1814         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1816 2016-02-08  Jason Merrill  <jason@redhat.com>
1818         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1819         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1820         (ocp_convert): Use *_maybe_fold.
1821         (cp_convert_to_pointer): Add dofold parameter.
1822         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1824 2016-02-05  Martin Sebor  <msebor@redhat.com>
1826         PR c++/69662
1827         * init.c (find_field_init): New function.
1828         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1829         at ends of structures special.
1831 2016-02-05  Jason Merrill  <jason@redhat.com>
1833         PR c++/68948
1834         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1835         make sure we've seen_error().
1837 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1839         PR c++/68948
1840         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1841         if lookup_fnfields returns NULL_TREE and the name being looked
1842         up has the form A::A.
1844 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1846         * constexpr.c (cxx_eval_binary_expression): Fold equality
1847         comparisons involving PTRMEM_CSTs.
1849 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1851         * class.c (find_flexarrays): Don't declare dom variable.
1852         (diagnose_flexarray): Likewise.
1854 2016-02-02  Martain Sebor  <msebor@redhat.com>
1856         PR c++/69251
1857         PR c++/69253
1858         PR c++/69290
1859         PR c++/69277
1860         PR c++/69349
1861         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1862         of a flexible array member for equality to null.
1863         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1864         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1865         (check_flexarrays): Same.
1866         * decl.c (compute_array_index_type): Avoid special case for flexible
1867         array members.
1868         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1869         array members.
1870         * error.c (dump_type_suffix): Revert changes introduced in r231665
1871         and rendered unnecessary by the changes above.
1872         * pt.c (tsubst):  Same.
1873         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1874         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1875         (process_init_constructor_array): Same.
1876         (process_init_constructor_record): Same.
1878 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1880         PR c++/69056
1881         * pt.c (try_one_overload): Handle comparing argument packs so
1882         that there is no conflict if we deduced more arguments of an
1883         argument pack than were explicitly specified.
1885 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1886             Jason Merrill  <jason@redhat.com>
1888         PR c++/68763
1889         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1890         function type if nothing is changing.
1892 2016-01-31  Jason Merrill  <jason@redhat.com>
1894         PR c++/69009
1895         * pt.c (partial_specialization_p, impartial_args): New.
1896         (instantiate_decl): Call impartial_args.
1898         * mangle.c (maybe_check_abi_tags): New.
1899         (write_guarded_var_name): Call it.
1900         (mangle_ref_init_variable): Call check_abi_tags.
1902         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1903         between template and instantiation.
1905 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1907         PR debug/66869
1908         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1909         function declarations.
1911 2016-01-29  Marek Polacek  <polacek@redhat.com>
1913         PR c++/69509
1914         PR c++/69516
1915         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1916         out of bound" error earlier.
1917         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1918         commentary.
1920 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1922         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1923         structure, update free_binding_level before the structure's
1924         level_chain field gets cleared, not after.
1926 2016-01-28  Jason Merrill  <jason@redhat.com>
1928         PR c++/67407
1929         * search.c (dfs_walk_once, dfs_walk_once_r)
1930         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1931         hash_set instead of BINFO_MARKED.
1932         (dfs_unmark_r): Remove.
1934 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1936         PR c++/24208
1937         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1938         (cp_lexer_debugging_p): Use it.
1939         (cp_lexer_start_debugging): Likewise.
1940         (cp_lexer_stop_debugging): Likewise.
1942 2016-01-27  Marek Polacek  <polacek@redhat.com>
1944         PR c/68062
1945         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1946         needed.  Add -Wsign-compare warning.
1948 2016-01-27  Ryan Burn  <contact@rnburn.com>
1950         PR cilkplus/69267
1951         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1952         superfluous post_p argument in call to
1953         cilk_gimplify_call_params_in_spawned_fn.
1955 2016-01-27  Marek Polacek  <polacek@redhat.com>
1957         PR c++/69379
1958         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1959         wrapped in NOP_EXPRs.
1961 2016-01-27  Martin Sebor  <msebor@redhat.com>
1963         PR c++/69317
1964         * mangle.c (mangle_decl): Reference the correct (saved) version
1965         of the ABI in -Wabi diagnostics.
1967 2016-01-27  Marek Polacek  <polacek@redhat.com>
1969         PR c++/69496
1970         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1971         elements of the array.
1973 2016-01-26  Jason Merrill  <jason@redhat.com>
1975         PR c++/68949
1976         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1977         (cxx_eval_call_expression): Don't look through clones.
1978         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1979         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1980         maybe-in-charge *tor.
1982 2016-01-26  Jason Merrill  <jason@redhat.com>
1984         PR c++/68782
1985         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1986         and TREE_SIDE_EFFECTS.
1987         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1988         verify_constructor_flags.
1990 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1992         PR c++/68357
1993         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1994         return error_mark_node instead of building trees with error_mark_node
1995         operands.
1997 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1999         PR other/69006
2000         * error.c (print_instantiation_partial_context_line): Add missing
2001         newlines from output for the t == NULL case.
2002         (print_instantiation_partial_context): Remove call to pp_newline.
2004 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
2006         Revert:
2007         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
2009         PR c++/11858
2010         PR c++/24663
2011         PR c++/24664
2012         * decl.c (grokdeclarator): Don't decay array parameter type to
2013         a pointer type if it's dependent.
2014         (grokparms): Invoke strip_top_quals instead of directly invoking
2015         cp_build_qualified_type.
2016         * pt.c (decay_dependent_array_parm_type): New static function.
2017         (type_unification_real): Call decay_dependent_array_parm_type
2018         to decay a dependent array parameter type to its corresponding
2019         pointer type before unification.
2020         (more_specialized_fn): Likewise.
2021         (get_bindings): Likewise.
2022         * tree.c (cp_build_qualified_type): Trivial typofix in
2023         documentation.
2025 2016-01-23  Martin Sebor  <msebor@redhat.com>
2027         PR c++/58109
2028         PR c++/69022
2029         * decl2.c (is_late_template_attribute): Handle dependent argument
2030         to attribute align and attribute vector_size.
2032 2016-01-21  Jason Merrill  <jason@redhat.com>
2034         PR c++/69392
2035         * lambda.c (lambda_capture_field_type): Handle 'this' specially
2036         for init-capture, too.
2038         PR c++/65687
2039         * decl.c (type_is_deprecated): Don't look into a typedef.
2041         PR c++/40751
2042         PR c++/64987
2043         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
2045         PR c++/43407
2046         * decl.c (start_enum): Add attributes parameter.
2047         * parser.c (cp_parser_enum_specifier): Pass it.
2048         * pt.c (lookup_template_class_1): Pass it.
2049         * cp-tree.h: Adjust.
2051 2016-01-19  Jason Merrill  <jason@redhat.com>
2053         PR c++/59759
2054         * pt.c (convert_template_argument): Handle VAR_DECL properly.
2056 2016-01-19  Marek Polacek  <polacek@redhat.com>
2058         PR c++/68586
2059         * constexpr.c (clear_cv_cache): New.
2060         * cp-gimplify.c (clear_fold_cache): New.
2061         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
2062         * decl.c (finish_enum_value_list): Call them.
2064         PR c++/68965
2065         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
2067 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
2069         PR c++/11858
2070         PR c++/24663
2071         PR c++/24664
2072         * decl.c (grokdeclarator): Don't decay array parameter type to
2073         a pointer type if it's dependent.
2074         (grokparms): Invoke strip_top_quals instead of directly invoking
2075         cp_build_qualified_type.
2076         * pt.c (decay_dependent_array_parm_type): New static function.
2077         (type_unification_real): Call decay_dependent_array_parm_type
2078         to decay a dependent array parameter type to its corresponding
2079         pointer type before unification.
2080         (more_specialized_fn): Likewise.
2081         (get_bindings): Likewise.
2082         * tree.c (cp_build_qualified_type): Trivial typofix in
2083         documentation.
2085 2016-01-18  Jason Merrill  <jason@redhat.com>
2087         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
2089         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
2091         PR c++/68767
2092         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
2093         (contains_label_1, contains_label_p): Remove.
2095 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2097         PR c++/69091
2098         * pt.c (type_dependent_expression_p): For a function template
2099         specialization, a type is dependent iff any of its template
2100         arguments are.
2102 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2104         * cp-array-notation.c (cp_expand_cond_array_notations): Return
2105         error_mark_node only if find_rank failed, not if it was
2106         successful.
2108 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2110         PR c++/68936
2111         * tree.c (build_min_non_dep_call_vec): Don't retain the
2112         KOENIG_LOOKUP_P flag of the non-dependent expression that's
2113         been built.
2114         (build_min_non_dep_op_overload): Instead, do it here.
2116 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
2118         PR bootstrap/68271
2119         * parser.h (cp_token): Remove pragma_kind field.  Add comment
2120         with number of unused bits.
2121         * parser.c (eof_token): Remove pragma_kind field initializer.
2122         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
2123         field, don't clear CPP_PRAGMA u.value.
2124         (cp_parser_pragma_kind): New function.
2125         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
2126         cp_parser_omp_construct, cp_parser_initial_pragma,
2127         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
2128         pragma_kind field.
2130 2016-01-15  Jason Merrill  <jason@redhat.com>
2132         PR c++/68847
2133         * call.c (build_cxx_call): Use fold_non_dependent_expr.
2135         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
2136         value.
2138         PR c++/69257
2139         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
2140         array/function-to-pointer conversion.  Call
2141         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
2142         * call.c (convert_like_real): Print call context if
2143         decay_conversion errors.
2145 2016-01-14  Tom de Vries  <tom@codesourcery.com>
2147         PR tree-optimization/68773
2148         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
2149         set force_output.
2151 2016-01-14  Jason Merrill  <jason@redhat.com>
2153         PR c++/69261
2154         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
2156 2016-01-12  Marek Polacek  <polacek@redhat.com>
2158         PR c++/68979
2159         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
2160         error_at and adjust the return value.
2162 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
2164         PR objc++/68511
2165         PR c++/69213
2166         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
2167         GS_ERROR whenever seen_error (), only if *expr_p contains
2168         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
2170         PR c++/66808
2171         PR c++/69000
2172         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
2174 2016-01-11  Jason Merrill  <jason@redhat.com>
2176         PR c++/69131
2177         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
2178         (process_subob_fn): Likewise.  Don't consider triviality if true.
2179         (synthesize_method_walk): Pass it.
2181 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
2183         PR c++/68795
2184         * parser.c (cp_parser_postfix_expression): Initialize
2185         close_paren_loc to UNKNOWN_LOCATION; only use it if
2186         it has been written to by
2187         cp_parser_parenthesized_expression_list.
2188         (cp_parser_parenthesized_expression_list): Document the behavior
2189         with respect to the CLOSE_PAREN_LOC param.
2191 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
2193         PR c++/69211
2194         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
2195         folded operands have side-effects, but folding changed any of them,
2196         build a new tree with the folded operands instead of returning the
2197         unfolded tree.
2199 2016-01-09  Marek Polacek  <polacek@redhat.com>
2201         PR c++/69113
2202         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
2204 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
2206         PR c++/69164
2207         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
2209 2016-01-08  Jason Merrill  <jason@redhat.com>
2211         PR c++/69158
2212         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
2213         in completion.
2215 2016-01-08  Marek Polacek  <polacek@redhat.com>
2217         PR c++/68449
2218         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
2220 2016-01-08  Jason Merrill  <jason@redhat.com>
2222         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
2223         workaround.
2225         PR c++/68983
2226         PR c++/67557
2227         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
2228         TREE_ADDRESSABLE type.
2230         PR c++/68983
2231         PR c++/67557
2232         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2234 2016-01-05  Nathan Sidwell  <nathan@acm.org>
2236         PR c++/58583
2237         * pt.c (build_non_dependent_expr): Don't try a checking fold when
2238         parsing an nsdmi.
2240 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
2242         Update copyright years.
2244 Copyright (C) 2016 Free Software Foundation, Inc.
2246 Copying and distribution of this file, with or without modification,
2247 are permitted in any medium without royalty provided the copyright
2248 notice and this notice are preserved.