* g++.dg/debug/pr71432.C: Fail on AIX.
[official-gcc.git] / gcc / cp / ChangeLog
blobc129b5f7ce6ef908b67f585aee3fc8693b892f77
1 2016-07-05  David Malcolm  <dmalcolm@redhat.com>
3         PR c++/62314
4         * parser.c (cp_parser_class_specifier_1): When reporting
5         missing semicolons, use a fixit-hint to suggest insertion
6         of a semicolon immediately after the closing brace,
7         offsetting the reported column accordingly.
9 2016-07-04  Jan Beulich  <jbeulich@suse.com>
11         * lang-specs.h ("@c++-header"): Conditionalize "-o".
13 2016-06-29  Thomas Schwinge  <thomas@codesourcery.com>
15         * parser.c (cp_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
16         Move pragma context checking into...
17         (cp_parser_omp_cancellation_point): ... here, and improve
18         diagnostic messages.
19         * semantics.c (finish_omp_cancel, finish_omp_cancellation_point):
20         Improve diagnostic messages.
22 2016-06-28  Jakub Jelinek  <jakub@redhat.com>
24         * Make-lang.in: Don't cat ../stage_current if it does not exist.
26 2016-06-24  Jason Merrill  <jason@redhat.com>
28         P0145R2: Refining Expression Order for C++.
29         * typeck.c (cp_build_modify_expr): Leave COMPOUND_EXPR on LHS.
31         * tree.c (get_target_expr_sfinae): Handle bit-fields.
32         (build_target_expr): Call mark_rvalue_use.
34 2016-06-24  Jakub Jelinek  <jakub@redhat.com>
36         * call.c (magic_varargs_p): Return 3 for __builtin_*_overflow_p.
37         (build_over_call): For magic == 3, do no conversion only on 3rd
38         argument.
40 2016-06-23  Andi Kleen  <ak@linux.intel.com>
42         * Make-lang.in: Add support for autofdo.
44 2016-06-21  Jason Merrill  <jason@redhat.com>
46         * constraint.cc (constraints_satisfied_p): Keep as many levels of
47         args as our template has levels of parms.
49         * pt.c (template_parm_outer_level, uses_outer_template_parms): New.
50         (type_dependent_expression_p): Use uses_outer_template_parms.
52 2016-06-20  David Malcolm  <dmalcolm@redhat.com>
54         * parser.c (cp_parser_string_literal): Convert non-standard
55         concatenation error to directly use a rich_location, and
56         use that to add the location of the first literal to the
57         diagnostic.
59 2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
61         * decl.c (validate_constexpr_redeclaration): Change pair of errors
62         to error + inform.
63         * error.c (dump_function_decl): Save the constexpr specifier too.
65 2016-06-17  Jakub Jelinek  <jakub@redhat.com>
67         * tree.c (builtin_valid_in_constant_expr_p): Test for
68         DECL_BUILT_IN_CLASS equal to BUILT_IN_NORMAL instead of just
69         DECL_BUILT_IN.
70         (bot_manip): Likewise.
71         * call.c (magic_varargs_p): Likewise.
73 2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
75         * decl.c (grokfndecl): Change pair of errors to error + inform.
77 2016-06-17  Jason Merrill  <jason@redhat.com>
79         PR c++/71209
80         * typeck.c (finish_class_member_access_expr): Avoid "not a base"
81         warning when there are dependent bases.
83 2016-06-17  Jakub Jelinek  <jakub@redhat.com>
85         * semantics.c (handle_omp_array_sections_1): Don't ICE when
86         processing_template_decl when checking for bitfields and unions.
87         Look through REFERENCE_REF_P as base of COMPONENT_REF.
88         (finish_omp_clauses): Look through REFERENCE_REF_P even for
89         array sections with COMPONENT_REF bases.
91 2016-06-16  Jakub Jelinek  <jakub@redhat.com>
93         * parser.c (cp_parser_omp_var_list_no_open): Call
94         convert_from_reference before cp_parser_postfix_dot_deref_expression.
95         * semantics.c (finish_omp_clauses): Don't ICE when
96         processing_template_decl when checking for bitfields and unions.
97         Look through REFERENCE_REF_P as base of COMPONENT_REF.
99 2016-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
101         * decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and
102         "%qF" in warning_at instead of "%q+F" in warning.
103         (check_redeclaration_exception_specification): Likewise in pedwarn
104         (and error, inform, for consistency).
105         * call.c (joust): Likewise.
107 2016-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
109         PR c++/70202
110         * decl.c (xref_basetypes): Revert r117839 changes; add fix-up
111         code at the end of the for loop; also revert r159637 changes,
112         add back the gcc_assert.
113         * cp-tree.h (xref_basetypes): Adjust declaration.
114         * parser.c (cp_parser_class_head): Adjust xref_basetypes call.
116 2016-06-14  David Malcolm  <dmalcolm@redhat.com>
118         * search.c: Include spellcheck-tree.h rather than spellcheck.h.
120 2016-06-14  David Malcolm  <dmalcolm@redhat.com>
122         * typeck.c: Include "gcc-rich-location.h".
123         (finish_class_member_access_expr): Simplify fixit code by
124         using gcc_rich_location::add_fixit_misspelled_id.
126 2016-06-14  Jason Merrill  <jason@redhat.com>
128         P0145R2: Refining Expression Order for C++.
129         * cp-tree.h (CALL_EXPR_OPERATOR_SYNTAX, CALL_EXPR_ORDERED_ARGS)
130         (CALL_EXPR_REVERSE_ARGS): New.
131         * call.c (build_new_op_1): Set them.
132         (extract_call_expr, op_is_ordered): New.
133         (build_over_call): Set CALL_EXPR_ORDERED_ARGS.
134         * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Handle new flags.
135         * pt.c (tsubst_copy_and_build): Copy new flags.
136         * semantics.c (simplify_aggr_init_expr): Likewise.
137         * tree.c (build_aggr_init_expr): Likewise.
138         (build_min_non_dep_op_overload): Likewise.
140 2016-06-14  Jakub Jelinek  <jakub@redhat.com>
142         PR c++/71528
143         * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
144         olddecl vars, preserve their TREE_READONLY bit.
146         PR c++/71516
147         * decl.c (complete_vars): Handle gracefully type == error_mark_node.
149 2016-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
151         * typeck2.c (digest_init_r): Use EXPR_LOC_OR_LOC on init.
153 2016-06-13  Paolo Carlini  <paolo.carlini@oracle.com>
155         * decl.c (grokdeclarator): Fix typo in pedwarn text.
157 2016-06-10  Thomas Schwinge  <thomas@codesourcery.com>
159         PR c/71381
160         * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
161         Loosen checking.
163 2016-06-09  Paolo Carlini  <paolo.carlini@oracle.com>
165         PR c++/71465
166         Revert:
167         2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
169         PR c++/70202
170         * parser.c (cp_parser_class_head): When xref_basetypes fails and
171         emits an error do not zero the type.
173 2016-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
175         * decl.c (maybe_deduce_size_from_array_init): Use
176         DECL_SOURCE_LOCATION in error_at.
177         (layout_var_decl): Likewise.
178         (check_array_initializer): Likewise.
179         (check_initializer): Likewise.
180         (duplicate_decls, check_elaborated_type_specifier): Tidy.
182 2016-06-08  Martin Sebor  <msebor@redhat.com>
183             Jakub Jelinek  <jakub@redhat.com>
185         PR c++/70507
186         PR c/68120
187         * constexpr.c: Include gimple-fold.h.
188         (cxx_eval_internal_function): New function.
189         (cxx_eval_call_expression): Call it.
190         (potential_constant_expression_1): Handle integer arithmetic
191         overflow built-ins.
192         * tree.c (builtin_valid_in_constant_expr_p): Handle
193         BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
195 2016-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
197         * pt.c (tsubst, case TYPENAME_TYPE): Don't delay checking the
198         return value of tsubst_aggr_type for error_mark_node.
200 2016-06-08  Jakub Jelinek  <jakub@redhat.com>
202         PR c++/71442
203         * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
205 2016-06-06  Jakub Jelinek  <jakub@redhat.com>
206             Patrick Palka  <ppalka@gcc.gnu.org>
208         PR c++/70847
209         PR c++/71330
210         PR c++/71393
211         * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
212         right after cp_fold call if cp_fold has returned the same stmt
213         already in some earlier cp_fold_r call.
214         (cp_fold_function): Add pset automatic variable, pass its address
215         to cp_walk_tree.
217 2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
219         PR c++/70202
220         * parser.c (cp_parser_class_head): When xref_basetypes fails and
221         emits an error do not zero the type.
223 2016-06-03  Patrick Palka  <ppalka@gcc.gnu.org>
225         PR c++/27100
226         * decl.c (duplicate_decls): Properly copy the
227         DECL_PENDING_INLINE_P, DECL_PENDING_INLINE_INFO and
228         DECL_SAVED_FUNCTION_DATA fields from OLDDECL to NEWDECL.
230 2016-06-03  Chung-Lin Tang  <cltang@codesourcery.com>
232         * semantics.c (finish_omp_clauses): Mark OpenACC reduction
233         arguments as addressable when async clause exists.
235 2016-06-02  Jan Hubicka  <jh@suse.cz>
237         * cp-gimplify.c (genericize_continue_stmt): Force addition of
238         predict stmt.
240 2016-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
242         * decl.c (xref_tag_1): Change pairs of errors to error + inform.
243         (start_enum): Likewise.
244         * parser.c (cp_parser_class_head): Likewise.
246 2016-06-02  Jakub Jelinek  <jakub@redhat.com>
248         PR c++/71372
249         * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
250         is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
251         and TREE_THIS_VOLATILE flags.  For ARRAY_REF and ARRAY_RANGE_REF, copy
252         over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
253         to the newly built tree.
255 2016-05-31  Jason Merrill  <jason@redhat.com>
257         * pt.c (instantiate_decl): Avoid recalculation.
259         PR c++/60095
260         PR c++/69515
261         PR c++/69009
262         * pt.c (instantiate_template_1): Don't put the partial
263         specialization in DECL_TI_TEMPLATE.
264         (partial_specialization_p, impartial_args): Remove.
265         (regenerate_decl_from_template): Add args parm.
266         (instantiate_decl): Look up the partial specialization again.
268         PR c++/71227
269         * pt.c (check_explicit_specialization): Give better diagnostic about
270         specializing a hidden friend.
272 2016-05-31  Paolo Carlini  <paolo.carlini@oracle.com>
274         PR c++/71248
275         * decl.c (check_static_variable_definition): Use DECL_SOURCE_LOCATION
276         to obtain correct locations; avoid redundant diagnostics on
277         out-of-class definitions.
279 2016-05-30  Martin Sebor  <msebor@redhat.com>
281         PR c++/71306
282         * init.c (warn_placement_new_too_small): Handle placement new arguments
283         that are elements of arrays more carefully.  Remove a pointless loop.
285 2016-05-30  Jakub Jelinek  <jakub@redhat.com>
287         PR c++/71349
288         * parser.c (cp_parser_omp_for): Don't disallow nowait clause
289         when combined with target construct.
290         (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
291         to cp_parser_omp_all_clauses.
293 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
295         PR c++/71238
296         * lex.c (unqualified_name_lookup_error): Take a location too.
297         (unqualified_fn_lookup_error): Take a cp_expr.
298         * cp-tree.h (unqualified_name_lookup_error,
299         unqualified_fn_lookup_error): Adjust declarations.
300         * semantics.c (perform_koenig_lookup): Adjust
301         unqualified_fn_lookup_error call, pass the location of
302         the identifier too as part of a cp_expr.
304 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
306         PR c++/71099
307         * parser.c (cp_parser_function_specifier_opt): Use current_class_type
308         to improve the diagnostic about wrong uses of 'virtual'.
310 2016-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
312         PR c++/71105
313         * lambda.c (maybe_add_lambda_conv_op): Early return also when
314         LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
316 2016-05-28  Ville Voutilainen  <ville.voutilainen@gmail.com>
318         Revert:
319         PR c++/69855
320         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
321         decls into the global scope after stripping template bits
322         and setting DECL_ANTICIPATED.
324 2016-05-27  Paolo Carlini  <paolo.carlini@oracle.com>
326         PR c++/60385
327         * name-lookup.c (push_namespace): Return bool, false when pushdecl
328         fails.
329         * name-lookup.h (push_namespace): Adjust declaration.
330         * parser.c (cp_parser_namespace_definition): Check push_namespace
331         return value.
333 2016-05-27  Ville Voutilainen  <ville.voutilainen@gmail.com>
335         PR c++/69855
336         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
337         decls into the global scope after stripping template bits
338         and setting DECL_ANTICIPATED.
340 2016-05-26  Jakub Jelinek  <jakub@redhat.com>
342         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_SCHEDULE>: Warn
343         if OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
345 2016-05-26  Patrick Palka  <ppalka@gcc.gnu.org>
347         PR c++/70822
348         PR c++/70106
349         * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
350         SCOPE_REFs too.
351         * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
352         on the qualified_id then propagate it to the resulting
353         expression.
354         (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
355         too.
356         * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
357         its REF_PARENTHESIZED_P flag.
359 2016-05-25  Jason Merrill  <jason@redhat.com>
361         PR c++/71173
362         PR c++/70522
363         * cp-tree.h (enum tag_types): Add scope_type.
364         * parser.c (cp_parser_class_name): Use scope_type.
365         (prefer_type_arg): Handle scope_type.
366         (cp_parser_lookup_name): Use prefer_type_arg.
367         * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
368         int prefer_type, use lookup_flags.
369         * name-lookup.h: Adjust.
371 2016-05-24  Cesar Philippidis  <cesar@codesourcery.com>
373         * parser.c (cp_parser_oacc_declare): Add support for
374         GOMP_MAP_FIRSTPRIVATE_POINTER.
375         * semantics.c (handle_omp_array_sections_1): Replace bool is_omp
376         argument with enum c_omp_region_type ort.  Don't privatize OpenACC
377         non-static members.
378         (handle_omp_array_sections): Replace bool is_omp argument with enum
379         c_omp_region_type ort.  Update call to handle_omp_array_sections_1.
380         (finish_omp_clauses): Add specific errors and warning messages for
381         OpenACC.  Use firsrtprivate pointers for OpenACC subarrays.  Update
382         call to handle_omp_array_sections.
384 2016-05-24  Jason Merrill  <jason@redhat.com>
386         PR c++/70584
387         * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
388         returns a decl.
389         (cp_fold) [INDIRECT_REF]: Don't fold to an rvalue.
391 2016-05-24  Martin Sebor  <msebor@redhat.com>
393         PR c++/71147
394         * decl.c (layout_var_decl, grokdeclarator): Use complete_or_array_type_p.
395         * pt.c (instantiate_class_template_1): Try to complete the element
396         type of a flexible array member.
397         (can_complete_type_without_circularity): Handle arrays of unknown bound.
398         * typeck.c (complete_type): Also complete the type of the elements of
399         arrays with an unspecified bound.
401 2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
403         PR c++/69872
404         * typeck2.c (check_narrowing): Check pedwarn return value.
406 2016-05-24  Jakub Jelinek  <jakub@redhat.com>
408         PR c++/71257
409         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
410         For OMP_CLAUSE_LINEAR_REF don't require type to be
411         integral or pointer.
413 2016-05-24  Richard Biener  <rguenther@suse.de>
415         PR middle-end/70434
416         PR c/69504
417         * expr.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
418         * constexpr.c (cxx_eval_array_reference): Handle indexed
419         vectors.
420         * typeck.c (cp_build_array_ref): Adjust.
422 2016-05-23  Jason Merrill  <jason@redhat.com>
424         PR c++/70344
425         * constexpr.c (cxx_eval_call_expression): Check for
426         fun == current_function_decl again.
428         PR c++/70584
429         * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call
430         maybe_undo_parenthesized_ref.
432         PR c++/70735
433         * pt.c (tsubst_copy): Just return a local variable from
434         non-template context.  Don't call rest_of_decl_compilation for
435         duplicated static locals.
436         (tsubst_decl): Set DECL_CONTEXT of local static from another
437         function.
439 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
441         PR c++/70972
442         * method.c (forward_parm): Use cp_build_reference_type.
444 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
446         PR c++/69095
447         * parser.c (cp_parser_initializer): Use check_for_bare_parameter_packs.
449 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
451         * pt.c (check_for_bare_parameter_packs): Improve error message
452         location for expressions.
454 2016-05-20  Nathan Sidwell  <nathan@acm.org>
456         * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
457         ... goto.
458         (cxx_eval_call_expression): Fix comment grammar.
460 2016-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
462         PR c++/70572
463         * decl.c (cp_finish_decl): Check do_auto_deduction return value
464         and return immediately in case of erroneous code.
466 2016-05-19  Marek Polacek  <polacek@redhat.com>
468         PR c++/71075
469         * pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.
471 2016-05-19  Jason Merrill  <jason@redhat.com>
473         PR c++/10200
474         * pt.c (fn_type_unification): Add outer template args if needed.
475         (type_unification_real): Handle getting full args.
477 2016-05-19  David Malcolm  <dmalcolm@redhat.com>
479         PR c++/71184
480         * parser.c (cp_parser_operator): For array new/delete, check that
481         cp_parser_require returned a non-NULL token before dereferencing
482         it.
484 2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
486         * decl.c (finish_enum_value_list): Use the specified mode.
488 2016-05-18  Jason Merrill  <jason@redhat.com>
490         * pt.c (value_dependent_expression_p): Tweak new cases to better
491         match the wording in the standard.
493 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
495         PR c++/69793
496         * parser.c (cp_parser_template_id): Don't call cp_lexer_peek_nth_token
497         when the previous cp_lexer_peek_token returns CPP_EOF.
499 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
501         PR c++/70466
502         * call.c (convert_like_real): Check that we are actually converting
503         from an init list.
505 2016-05-16  Matthew Wahab  <matthew.wahab@arm.com>
507         * decl.c (grokdeclarator): Remove errmsg and use of
508         targetm.invalid_return_type.
509         (grokparms): Remove errmsg and use of
510         targetm.invalid_parameter_type.
512 2016-05-13  Jason Merrill  <jason@redhat.com>
514         PR c++/10200
515         PR c++/69753
516         * pt.c (tsubst_decl): Use uses_template_parms.
517         (instantiate_template_1): Handle non-dependent calls in templates.
518         (value_dependent_expression_p): Handle BASELINK, FUNCTION_DECL.
519         (type_dependent_expression_p): Only consider innermost template args.
520         (dependent_template_arg_p): Check enclosing class of a template here.
521         (dependent_template_p): Not here.
522         (type_dependent_object_expression_p): New.
523         * typeck.c (finish_class_member_access_expr): Use it.
524         * parser.c (cp_parser_postfix_expression): Use it.
525         (cp_parser_postfix_dot_deref_expression): Use it.  Use comptypes
526         to detect the current instantiation.
527         (cp_parser_lookup_name): Really implement DR 141.
528         * search.c (lookup_field_r): Prefer a dependent using-declaration.
529         (any_dependent_bases_p): Split out from...
530         * name-lookup.c (do_class_using_decl): ...here.
531         * call.c (build_new_method_call_1): Use it.
532         * semantics.c (finish_call_expr): 'this' doesn't make a call dependent.
533         * tree.c (non_static_member_function_p): Remove.
534         * typeck2.c (build_x_arrow): Use dependent_scope_p.
536         * parser.c (cp_parser_postfix_dot_deref_expression): Use
537         complete_type_or_else for unknown_type_node, too.
539 2016-05-12  Marek Polacek  <polacek@redhat.com>
541         PR c/70756
542         * call.c (build_new_op_1): Pass LOC to cp_build_modify_expr.
543         * cp-tree.h (cp_build_modify_expr): Update declaration.
544         (cxx_incomplete_type_error, cxx_incomplete_type_diagnostic): New inline
545         overloads.
546         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Pass INPUT_LOCATION to
547         cp_build_modify_expr.
548         * decl2.c (set_guard): Likewise.
549         (handle_tls_init): Likewise.
550         * init.c (perform_member_init): Likewise.
551         (expand_virtual_init): Likewise.
552         (build_new_1): Likewise.
553         (build_vec_delete_1): Likewise.
554         (get_temp_regvar): Likewise.
555         (build_vec_init): Likewise.
556         * method.c (do_build_copy_assign): Likewise.
557         (assignable_expr): Likewise.
558         * semantics.c (finish_omp_for): Likewise.
559         * typeck.c (cp_build_binary_op): Pass LOCATION to pointer_diff and
560         cp_pointer_int_sum.
561         (cp_pointer_int_sum): Add location parameter.  Pass it down to
562         pointer_int_sum.
563         (pointer_diff): Add location parameter.  Use it.
564         (build_modify_expr): Pass location down to cp_build_modify_expr.
565         (cp_build_modify_expr): Add location parameter.  Use it.
566         (build_x_modify_expr): Pass location down to cp_build_modify_expr.
567         * typeck2.c (cxx_incomplete_type_diagnostic,
568         cxx_incomplete_type_error): Add location parameter.
570 2016-05-11  Marek Polacek  <polacek@redhat.com>
572         PR c++/71024
573         * decl.c (duplicate_decls): Call diagnose_mismatched_decls.
575 2016-05-05  Jakub Jelinek  <jakub@redhat.com>
577         * parser.c (cp_parser_selection_statement): For RID_SWITCH,
578         pass if_p instead of NULL to cp_parser_implicitly_scoped_statement.
580 2016-05-04  Marek Polacek  <polacek@redhat.com>
582         * parser.c (cp_parser_selection_statement): Replace OPT_Wparentheses
583         with OPT_Wdangling_else.
585 2016-05-03  Martin Sebor  <msebor@redhat.com>
587         PR c++/66561
588         * tree.c (builtin_valid_in_constant_expr_p): Treat BUILT_IN_FILE,
589         BUILT_IN_FUNCTION, and BUILT_IN_LINE as constant expressions.
591 2016-05-03  Marek Polacek  <polacek@redhat.com>
593         PR c/70859
594         * call.c (build_cxx_call): Pass location and vNULL down to
595         check_builtin_function_arguments.
597 2016-05-03  Richard Biener  <rguenther@suse.de>
599         * Make-lang.in (cc1plus-checksum.c): For stage-final re-use
600         the checksum from the previous stage.
602 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
604         PR c++/62314
605         * typeck.c (finish_class_member_access_expr): When
606         giving a hint about a possibly-misspelled member name,
607         add a fix-it replacement hint.
609 2016-05-02  Cesar Philippidis  <cesar@codesourcery.com>
611         * cp-tree.h (finish_omp_clauses): Update prototype.
612         * parser.c (cp_parser_oacc_all_clauses): Update call to
613         finish_omp_clauses.
614         (cp_parser_omp_all_clauses): Likewise.
615         (cp_parser_omp_for_loop): Likewise.
616         (cp_omp_split_clauses): Likewise.
617         (cp_parser_oacc_cache): Likewise.
618         (cp_parser_oacc_loop): Likewise.
619         (cp_parser_omp_declare_target):
620         (cp_parser_cilk_simd_all_clauses): Likewise.
621         (cp_parser_cilk_for): Likewise.
622         * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
623         arguments with enum c_omp_region_type ort.
624         (tsubst_omp_clauses): Update calls to finish_omp_clauses.
625         (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
626         (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
627         (tsubst_expr): Update calls to tsubst_omp_clauses.
628         * semantics.c (finish_omp_clauses): Replace bool arguments
629         allow_fields, declare_simd, and is_cilk with bitmask ort.
630         (finish_omp_for): Update call to finish_omp_clauses.
632 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
634         PR c++/62314
635         * parser.c (cp_parser_class_head): Capture the start location;
636         use it to emit a fix-it insertion hint when complaining
637         about missing "template <> " in explicit specializations.
639 2016-05-02  Richard Sandiford  <richard.sandiford@arm.com>
641         * init.c (build_new_1): Use shift operators instead of wi:: shifts.
643 2016-05-02  Richard Biener  <rguenther@suse.de>
645         * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
646         anonymous VLAs.
648 2016-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
650         PR c++/66644
651         * class.c (check_field_decl): Remove final int* parameter, change
652         the return type to bool; fix logic in order not to reject multiple
653         initialized fields in anonymous struct.
654         (check_field_decls): Adjust call.
656 2016-04-29  Cesar Philippidis  <cesar@codesourcery.com>
658         PR middle-end/70626
659         * parser.c (cp_parser_oacc_loop): Don't augment mask with
660         OACC_LOOP_CLAUSE_MASK.
661         (cp_parser_oacc_kernels_parallel): Update call to
662         c_oacc_split_loop_clauses.
664 2016-04-28  Jason Merrill  <jason@redhat.com>
666         Implement C++17 [[nodiscard]] attribute.
667         PR c++/38172
668         PR c++/54379
669         * parser.c (cp_parser_std_attribute): Handle [[nodiscard]].
670         * tree.c (handle_nodiscard_attribute): New.
671         (cxx_attribute_table): Add [[nodiscard]].
672         * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New.
673         (maybe_warn_nodiscard): New.
674         (convert_to_void): Call it.
676         * cvt.c (cp_get_callee): New.
677         * constexpr.c (get_function_named_in_call): Use it.
678         * cxx-pretty-print.c (postfix_expression): Use it.
679         * except.c (check_noexcept_r): Use it.
680         * method.c (check_nontriv): Use it.
681         * tree.c (build_aggr_init_expr): Use it.
682         * cp-tree.h: Declare it.
684 2015-04-27  Ryan Burn  <contact@rnburn.com>
685             Jeff Law  <law@redhat.com>
687         PR c++/69024
688         PR c++/68997
689         * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
690         instead of cilk_detect_spawn_and_unwrap.
691         * cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
692         (find_spawn): New.
693         (cilk_cp_detect_spawn_and_unwrap): New.
694         * lambda.c: Include cp-cilkplus.h.
695         * parser.c: Include cp-cilkplus.h.
696         * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into...
697         * cp-cilkpus.h: New file.
699 2016-04-27  Nathan Sidwell  <nathan@acm.org>
701         * constexpr.c (get_fundef_copy): Use the original function for
702         non-recursive evaluations.
703         (save_fundef_copy): Always expect a slot to be available.
705 2016-04-27  Bernd Schmidt  <bschmidt@redhat.com>
707         * parser.c (cp_parser_postfix_expression): Call
708         warn_for_memset instead of warning directly here.
710 2016-04-26  Patrick Palka  <ppalka@gcc.gnu.org>
712         PR c++/70241
713         * decl.c (build_enumerator): Set current_access_specifier when
714         declaring an enumerator belonging to an in-class enumeration.
715         * parser.c (cp_parser_check_access_in_redecleration): Also
716         consider in-class enumerations.
718 2016-04-26  Marek Polacek  <polacek@redhat.com>
720         PR c++/70744
721         * call.c (build_conditional_expr_1): Call cp_stabilize_reference
722         instead of stabilize_reference.
723         (build_over_call): Likewise.
724         * cp-tree.h (cp_stabilize_reference): Declare.
725         * tree.c (cp_stabilize_reference): New function.
726         * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
727         stabilize_reference.
728         (unary_complex_lvalue): Likewise.
729         (cp_build_modify_expr): Likewise.
731 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
733         PR bootstrap/70704
734         * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
735         just flag_checking.
737 2016-04-25  Jason Merrill  <jason@redhat.com>
739         * tree.c (std_attribute_table): New.
740         (init_tree): Register it.
742 2016-04-22  Jason Merrill  <jason@redhat.com>
744         * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
746 2016-04-21  Patrick Palka  <ppalka@gcc.gnu.org>
748         * name-lookup.c (free_saved_scope): New free list of saved_scope
749         structures.
750         (push_to_top_level): Attempt to reuse a saved_scope struct
751         from free_saved_scope instead of allocating a new one each time.
752         (pop_from_top_level_1): Chain the now-unused saved_scope structure
753         onto free_saved_scope.
755 2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
757         PR c++/70540
758         * semantics.c (process_outer_var_ref): Unconditionally return
759         error_mark_node when mark_used returns false.
761 2016-04-21  Marek Polacek  <polacek@redhat.com>
763         PR c++/70513
764         * parser.c (cp_parser_enum_specifier): Check and possibly error for
765         extra qualification.
767 2016-04-20  Nathan Sidwell  <nathan@acm.org>
769         PR c++/55635
770         * init.c (build_vec_delete_1): Protect operator delete call in try
771         finally.
772         (build_delete): Likewise.
773         * optimize.c (build_delete_destructor_body): Likewise.
775 2016-04-20  Ilya Verbin  <ilya.verbin@intel.com>
777         PR c++/69363
778         * cp-tree.h (finish_omp_clauses): Add new default argument.
779         * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
780         instead of c_finish_cilk_clauses.
781         * semantics.c (finish_omp_clauses): Add new argument.  Allow
782         floating-point variables in the linear clause for Cilk Plus.
784 2016-04-20  Nathan Sidwell  <nathan@acm.org>
786         * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
787         TARGET_EXPR.
789 2016-04-19  Jason Merrill  <jason@redhat.com>
791         PR c++/66543
792         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
793         * pt.c (make_pack_expansion): Call mark_exp_read.
794         * semantics.c (finish_id_expression): Call mark_type_use in
795         unevaluated context.
797         DR 2137
798         * call.c (implicit_conversion): If we choose a copy constructor
799         for list-initialization from the same type, the conversion is an
800         exact match.
802         * constexpr.c (breaks): Handle EXIT_EXPR.
803         (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
804         (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
805         of COMPOUND_EXPR.
807         PR c++/68206
808         PR c++/68530
809         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
810         and GOTO_EXPR.
812         * pt.c (tsubst_expr): Remove shadowing declaration.
813         (tsubst_pack_expansion): Add assert.
815         * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
817         PR c++/70522
818         * name-lookup.c (qualified_lookup_using_namespace): Look through
819         hidden names.
821 2016-04-18  Michael Matz  <matz@suse.de>
823         * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
824         (layout_class_type): Ditto.
825         (build_base_field): Use SET_DECL_ALIGN.
826         (fixup_attribute_variants): Use SET_TYPE_ALIGN.
827         * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
828         (record_unknown_type): Use SET_TYPE_ALIGN.
829         (cxx_init_decl_processing): Ditto.
830         (copy_type_enum): Ditto.
831         (grokfndecl): Use SET_DECL_ALIGN.
832         (copy_type_enum): Use SET_TYPE_ALIGN.
833         * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
834         (tsubst): Ditto.
835         * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
836         * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
837         * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
838         * rtti.c (emit_tinfo_decl): Ditto.
840 2016-04-18  Jason Merrill  <jason@redhat.com>
842         PR c++/70690
843         PR c++/70528
844         * class.c (type_maybe_constexpr_default_constructor): New.
845         (type_has_constexpr_default_constructor): Revert.
847 2016-04-16  Sandra Loosemore  <sandra@codesourcery.com>
849         PR target/1078
851         * tree.c (cxx_attribute_table): Remove "com_interface" entry.
852         (handle_com_interface_attribute): Delete.
854 2016-04-15  Jason Merrill  <jason@redhat.com>
856         PR c++/70685
857         * constexpr.c (get_fundef_copy): Handle null *slot.
859         PR c++/70505
860         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
861         unknown_type_node, too.
863 2016-04-15  Jason Merrill  <jason@redhat.com>
864             Nathan Sidwell  <nathan@acm.org>
866         PR c++/70594
867         * constexpr.c (constexpr_call_table): Preserve in GC.
868         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
869         (fundef_copies_table): Preserve in GC. Change to pointer to
870         tree->tree hash.
871         (maybe_initialize_fundef_copies_table): Adjust.
872         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
873         (save_fundef_copy): Adjust for a TREE_LIST.
874         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
875         (fini_constexpr): New.
876         * cp-tree.h (fini_constexpr): Declare.
877         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
879 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
881         PR c/70436
882         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
883         where needed.
884         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
885         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
886         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
887         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
888         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
889         cp_parser_statement.
890         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
891         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
892         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
893         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
894         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
895         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
896         cp_parser_omp_taskloop, cp_parser_omp_construct,
897         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
898         Add IF_P argument, pass it down where needed.
899         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
900         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
901         calls.
903 2016-04-14  Jason Merrill  <jason@redhat.com>
905         PR c++/70494
906         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
907         * typeck2.c (split_nonconstant_init_1): Use it.
909         PR c++/70528
910         * class.c (type_has_constexpr_default_constructor): Return true
911         for an implicitly declared constructor.
913         PR c++/70622
914         * parser.c (cp_parser_init_declarator): Add auto_result parm.
915         (cp_parser_simple_declaration): Pass it.
916         (strip_declarator_types): New.
918         PR c++/70543
919         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
920         initializer also makes the variable value-dependent.
922         PR c++/70648
923         * constexpr.c (cxx_eval_store_expression): Also copy
924         CONSTRUCTOR_NO_IMPLICIT_ZERO.
926 2016-04-14  Martin Sebor  <msebor@redhat.com>
928         PR c++/69517
929         PR c++/70019
930         PR c++/70588
931         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
933 2016-04-14  Jason Merrill  <jason@redhat.com>
935         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
936         parameter ABI change.
938 2016-04-13  Martin Sebor  <msebor@redhat.com>
940         PR c++/69517
941         PR c++/70019
942         PR c++/70588
943         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
944         functions.
945         * decl.c (check_initializer, cp_finish_decl): Call them.
946         (reshape_init_r): Reject incompletely braced intializer-lists
947         for VLAs.
948         * init.c (throw_bad_array_length, build_vla_check)
949         (build_vla_size_check, build_vla_init_check): Define new functions.
950         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
951         to detect a VLA.
952         (store_init_value): Same.
954 2016-04-13  Jason Merrill  <jason@redhat.com>
956         Warn about empty parameter ABI with -Wabi=9.
957         * call.c (empty_class_msg, mark_for_abi_warning)
958         (warn_empty_class_abi): New.
959         (build_call_a): Use them.
960         * decl.c (store_parm_decls): Use mark_for_abi_warning.
961         * error.c (pp_format_to_string): New.
963         Pass empty class parameters like C.
964         * call.c (pass_as_empty_struct, empty_class_arg): New.
965         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
966         (build_call_a): Use empty_class_arg.
967         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
968         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
970 2016-04-13  Jason Merrill  <jason@redhat.com>
972         PR c++/70627
973         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
975 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
977         PR c++/70635
978         * pt.c (resolve_typename_type): Fix typos in infinite recursion
979         avoidance mechanism.
981 2016-04-13  Jason Merrill  <jason@redhat.com>
983         PR c++/70634
984         * pt.c (instantiation_dependent_uneval_expression_p): Split out
985         from instantiation_dependent_expression_p.
986         (value_dependent_expression_p): Use it for unevaluated operands.
987         (instantiation_dependent_r): Don't check value-dependence.
988         (instantiation_dependent_expression_p): Check
989         value-dependence of the expression as a whole.
990         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
991         * semantics.c (finish_decltype_type): Use it.
993         * constexpr.c (potential_nondependent_constant_expression): New.
994         (potential_nondependent_static_init_expression): New.
995         (maybe_constant_value_1, fold_non_dependent_expr)
996         (maybe_constant_init): Use them.
997         * pt.c (instantiate_non_dependent_expr_sfinae)
998         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
999         them.
1000         * cp-tree.h: Declare them.
1002 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
1004         PR c++/70594
1005         * decl.c (pop_labels_1): Removed.
1006         (note_label, sort_labels): New functions.
1007         (pop_labels): During named_labels traversal, just push the slot
1008         pointers into a vector, then qsort it by DECL_UID and only then
1009         call pop_label and chain it into BLOCK_VARS.
1011 2016-04-13  Jason Merrill  <jason@redhat.com>
1013         PR c++/70615
1014         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
1015         (cp_gimplify_expr): Not here.
1017 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
1019         PR c++/70610
1020         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
1021         recurse into it.
1022         * typeck.c (build_x_conditional_expr): Unconditionally remember
1023         that the result is an lvalue or xvalue.
1025 2016-04-12  Jason Merrill  <jason@redhat.com>
1027         * class.c (is_really_empty_class): A zero-length array is empty.
1028         An unnamed bit-field doesn't make a class non-empty.
1030 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
1032         PR c++/68722
1033         * parser.c (cp_parser_cache_defarg): When file ends in default
1034         argument simply return error_mark_node.
1036 2016-04-12  Nathan Sidwell  <nathan@acm.org>
1038         PR c++/70501
1039         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
1040         similarly to PMF.
1042 2016-04-11  Jason Merrill  <jason@redhat.com>
1044         * mangle.c (decl_is_template_id): The template itself counts as a
1045         template-id.
1047 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
1049         PR c++/70590
1050         PR c++/70452
1051         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
1052         on the result if it's not a CONSTRUCTOR.
1054 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
1056         PR c++/70452
1057         * constexpr.c (find_constructor): New function.
1058         (unshare_constructor): New function.
1059         (cxx_eval_call_expression): Use unshare_constructor instead of
1060         unshare_expr.
1061         (find_array_ctor_elt): Likewise.
1062         (cxx_eval_vec_init_1): Likewise.
1063         (cxx_eval_store_expression): Likewise.
1064         (cxx_eval_constant_expression): Likewise.
1066 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
1068         PR c/70436
1069         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
1070         potentially generating a future -Wparentheses warning in its
1071         callers.
1073 2016-04-06  Jason Merrill  <jason@redhat.com>
1075         * class.c (check_abi_tags): Fix function template handling.
1077 2016-04-05  Nathan Sidwell  <nathan@acm.org>
1079         PR c++/70512
1080         * class.c (fixup_may_alias): New.
1081         (fixup_attribute_variants): Call it.
1083 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
1085         PR c++/70452
1086         * constexpr.c (struct fundef_copy): New struct.
1087         (struct fundef_copies_table_t): New struct.
1088         (fundef_copies_table): New static variable.
1089         (maybe_initialize_fundef_copies_table): New static function.
1090         (get_fundef_copy): New static function.
1091         (save_fundef_copy): New static function.
1092         (cxx_eval_call_expression): Use get_fundef_copy, and
1093         save_fundef_copy.
1094         (constexpr_call_table): Add "deletable" GTY marker.
1096 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
1098         PR c++/70452
1099         * cp-tree.h (class cache_map): Remove.
1100         * constexpr.c (cv_cache): Change type to
1101         GTY((deletable)) hash_map<tree, tree> *.
1102         (maybe_constant_value): Adjust following the change to cv_cache.
1103         (clear_cv_cache): New static function.
1104         (clear_cv_and_fold_caches): Use it.
1105         * cp-gimplify.c (fold_cache): Change type to
1106         GTY((deletable)) hash_map<tree, tree> *.
1107         (clear_fold_cache): Adjust following the change to fold_cache.
1108         (cp_fold): Likewise.
1110 2016-04-02  Martin Sebor  <msebor@redhat.com>
1112         PR c++/67376
1113         PR c++/70170
1114         PR c++/70172
1115         PR c++/70228
1116         * constexpr.c (diag_array_subscript): New function.
1117         (cxx_eval_array_reference): Detect out of bounds array indices.
1119 2016-04-01  Jason Merrill  <jason@redhat.com>
1121         PR c++/70449
1122         PR c++/70344
1123         * pt.c (instantiate_decl): A function isn't fully defined if
1124         DECL_INITIAL is error_mark_node.
1125         * constexpr.c (cxx_eval_call_expression): Likewise.
1127 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
1128             Marek Polacek  <polacek@redhat.com>
1130         PR c++/70488
1131         * init.c (warn_placement_new_too_small): Test whether
1132         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
1134 2016-04-01  Nathan Sidwell  <nathan@acm.org>
1136         PR c++/68475
1137         * decl.c (check_redeclaration_exception_specification): Check
1138         regardless of -fno-exceptions.
1139         * typeck2.c (merge_exception_specifiers): Relax assert by checking
1140         flag_exceptions too.
1142 2016-03-31  Nathan Sidwell  <nathan@acm.org>
1144         * decl.c (start_preparsed_function): Remove unnecessary bracing.
1145         (finish_destructor_body): Don't emit operator delete here.
1147 2016-03-31  Nathan Sidwell  <nathan@acm.org>
1149         PR c++/70393
1150         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
1151         elements in field order.
1153 2016-03-31  Marek Polacek  <polacek@redhat.com>
1155         PR c/70297
1156         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
1158 2016-03-31  Richard Biener  <rguenther@suse.de>
1160         PR c++/70430
1161         * typeck.c (cp_build_binary_op): Fix operand order of vector
1162         conditional in truth op handling.
1164 2016-03-29  Jason Merrill  <jason@redhat.com>
1166         PR c++/70353
1167         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
1168         in constexpr functions.
1170 2016-03-28  Jason Merrill  <jason@redhat.com>
1172         PR c++/70422
1173         PR c++/64266
1174         PR c++/70353
1175         * decl.c, pt.c, constexpr.c: Revert last patch.
1177 2016-03-25  Jason Merrill  <jason@redhat.com>
1178             Martin LiÅ¡ka  <mliska@suse.cz>
1180         PR c++/64266
1181         PR c++/70353
1182         Core issue 1962
1183         * decl.c (cp_fname_init): Decay the initializer to pointer.
1184         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
1185         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1186         Don't call cp_finish_decl.
1187         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
1188         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
1189         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
1190         Handle DECL_VALUE_EXPR.
1192 2016-03-24  Jason Merrill  <jason@redhat.com>
1194         PR c++/70386
1195         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
1197         PR c++/70323
1198         * constexpr.c (cxx_eval_call_expression): Don't cache result if
1199         *overflow_p.
1201 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
1203         PR c++/62212
1204         * tree.c (build_cplus_array_type): Determine type-dependentess
1205         with uses_template_parms instead of with dependent_type_p.
1207 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1209         PR c++/70347
1210         * typeck.c (process_init_constructor_union): If the initializer
1211         is empty, use the union's NSDMI if it has one.
1213 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1215         PR c++/70332
1216         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
1217         NSDMI that's part of an aggregrate initialization.
1219 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
1221         PR c++/70001
1222         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
1223         for 1..max even for multi-dimensional arrays.  Call unshare_expr
1224         on it.
1226         PR c++/70323
1227         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
1228         on TREE_OVERFLOW constants.
1230         PR c++/70376
1231         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
1232         for OMP_TASKLOOP here.
1233         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
1234         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
1236 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
1237             Jason Merrill  <jason@redhat.com>
1238             Jakub Jelinek  <jakub@redhat.com>
1240         PR c++/69315
1241         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1242         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1243         (finish_function): Don't set or test them.
1244         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
1246 2016-03-23  Jason Merrill  <jason@redhat.com>
1248         PR c++/70344
1249         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
1251 2016-03-23  Marek Polacek  <polacek@redhat.com>
1253         PR c++/69884
1254         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
1256 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
1258         * call.c (build_conditional_expr_1): Always use original
1259         condition type for vector type checks and build.
1261 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1263         PR c++/70096
1264         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
1266 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1268         PR c++/70204
1269         * constexpr.c (non_const_var_error): Check
1270         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1272 2016-03-21  Richard Henderson  <rth@redhat.com>
1274         PR c++/70273
1275         * decl.c (notice_forced_label_r): New.
1276         (cp_finish_decl): Use it.
1278 2016-03-21  Jason Merrill  <jason@redhat.com>
1280         PR c++/70285
1281         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1283 2016-03-18  Jason Merrill  <jason@redhat.com>
1285         PR c++/70139
1286         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
1288         PR c++/70147
1289         * class.c (vptr_via_virtual_p): New.
1290         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
1291         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
1292         a vptr from any virtual base in a not-in-charge 'structor.
1294         * decl.c (build_clobber_this): Factor out of
1295         start_preparsed_function and begin_destructor_body.  Handle
1296         virtual bases better.
1298         * class.c (build_if_in_charge): Split out from build_base_path.
1299         * init.c (expand_virtual_init, expand_default_init): Use it.
1300         * call.c (build_special_member_call): Use it.
1302 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
1304         PR c++/70267
1305         * init.c (build_new_1): Complain and return error_mark_node
1306         if alloc_fn is not _Jv_AllocObject function returning pointer.
1308 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1310         PR c++/70205
1311         * search.c (adjust_result_of_qualified_name_lookup): Don't
1312         update the BASELINK_BINFO of DECL if the second call
1313         to lookup_base fails.
1315 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1317         PR c++/70218
1318         * parser.c (cp_parser_lambda_expression): Move call to
1319         pop_deferring_access_checks ahead of the call to
1320         cp_parser_end_tentative_firewall.
1322 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
1324         PR c++/70144
1325         * cp-tree.h (magic_varargs_p): Return int instead of bool.
1326         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
1327         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
1328         varargs.
1329         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
1330         if magic_varargs_p == 1, call decay_conversion
1331         instead of mark_type_use.  Don't store error_mark_node arguments to
1332         argarray, instead return error_mark_node.
1334         PR c++/70272
1335         * decl.c (begin_destructor_body): Don't insert clobber if
1336         is_empty_class (current_class_type).
1338 2016-03-17  Marek Polacek  <polacek@redhat.com>
1340         PR c++/70194
1341         * typeck.c (warn_for_null_address): New function.
1342         (cp_build_binary_op): Call it.
1344 2016-03-16  Jason Merrill  <jason@redhat.com>
1346         PR c++/70259
1347         * decl.c (start_preparsed_function): Don't clobber an empty base.
1349 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
1351         PR c++/70147
1352         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1353         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1355         PR c++/70147
1356         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1357         set in_base_initializer.
1359 2016-03-15  Marek Polacek  <polacek@redhat.com>
1361         PR c++/70209
1362         * tree.c (strip_typedefs): Call strip_typedefs again on the
1363         DECL_ORIGINAL_TYPE result.
1365 2016-03-15  Jason Merrill  <jason@redhat.com>
1367         PR c++/70095
1368         * pt.c (instantiate_decl): Fix call to variable_template_p.
1370         PR c++/70141
1371         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1373 2016-03-14  Casey Carter  <casey@carter.net>
1374             Jason Merrill  <jason@redhat.com>
1376         P0184R0: Generalizing the Range-Based For Loop
1377         * parser.c (cp_convert_range_for): Set the type of __end separately.
1378         (cp_parser_perform_range_for_lookup): Allow different begin/end
1379         types if they are comparable.
1381 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
1383         PR c++/70106
1384         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1385         processing_template_decl and EXPR is a SCOPE_REF.
1387 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
1388             Jakub Jelinek  <jakub@redhat.com>
1390         PR c++/70001
1391         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
1392         return value from cxx_eval_constant_expression from earlier
1393         elements if it is valid constant initializer requiring no
1394         relocations.
1396 2016-03-10  Marek Polacek  <polacek@redhat.com>
1398         PR c++/70153
1399         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1401 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
1403         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1404         when calling c_finish_omp_clauses.
1406 2016-03-08  Jason Merrill  <jason@redhat.com>
1408         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
1409         diagnostic for use of "concept".
1410         (cp_parser_requires_clause_opt): And "requires".
1411         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
1412         (cp_parser_explicit_template_declaration): Adjust.
1413         * Make-lang.in (check-c++-all): Add "concepts" to std list.
1415         P0036R0: Unary Folds and Empty Parameter Packs
1416         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1418 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
1420         PR c++/70135
1421         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1422         even after the last iteration of the loop.
1424         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1426 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
1428         PR c++/66786
1429         * pt.c (get_template_info): Handle PARM_DECL.
1430         (template_class_depth): Check DECL_P instead of
1431         VAR_OR_FUNCTION_DECL_P.
1433 2016-03-05  Jason Merrill  <jason@redhat.com>
1435         PR c++/67364
1436         * constexpr.c (cxx_eval_store_expression): Replace
1437         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1439 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
1441         PR c++/66786
1442         * pt.c (template_class_depth): Given a lambda type, iterate
1443         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
1444         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
1445         CP_DECL_CONTEXT.
1447 2016-03-04  Jason Merrill  <jason@redhat.com>
1449         PR c++/69203
1450         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
1451         * init.c (build_vec_delete_1): Set it.
1452         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
1454 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
1456         * decl.c (start_preparsed_function): Don't emit start clobber at the
1457         start of constructor clones.
1459         PR c++/70035
1460         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
1461         * decl.c (start_preparsed_function): Call
1462         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
1463         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
1464         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
1466 2016-03-04  Jason Merrill  <jason@redhat.com>
1468         PR c++/67364
1469         * constexpr.c (cxx_eval_component_reference): Further tweak.
1471         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
1472         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
1473         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
1474         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
1476         PR c++/70067
1477         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1478         same type.
1480 2016-03-03  Jason Merrill  <jason@redhat.com>
1482         * method.c (synthesized_method_walk): operator= can also be constexpr.
1484         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1485         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1487         PR c++/67164
1488         * pt.c (copy_template_args): New.
1489         (tsubst_pack_expansion): Use it.
1491         * call.c (build_aggr_conv): Use get_nsdmi.
1493         PR c++/51406
1494         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1496         PR c++/67364
1497         * constexpr.c (cxx_eval_component_reference): Just return an empty
1498         CONSTRUCTOR for an empty class.
1500 2016-03-01  Jason Merrill  <jason@redhat.com>
1502         PR c++/70036
1503         * parser.c (cp_parser_requires_clause): Call
1504         check_for_bare_parameter_packs.
1506         PR c++/51489
1507         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1508         the operands.
1510         PR c++/69995
1511         * constexpr.c (cxx_eval_call_expression): Unshare arg.
1512         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1513         [TARGET_EXPR]: Unshare init.
1515 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
1517         PR c++/68948
1518         PR c++/69961
1519         * pt.c (tsubst_baselink): Reinstate the check for an invalid
1520         constructor call.
1522 2016-02-28  Jason Merrill  <jason@redhat.com>
1524         PR c++/69995
1525         * constexpr.c (cxx_eval_store_expression): Unshare init.
1527 2016-02-26  Jason Merrill  <jason@redhat.com>
1529         PR c++/69958
1530         * pt.c (make_argument_pack): New.
1531         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1532         (tsubst_copy_and_build): Likewise.
1534 2016-02-25  Jason Merrill  <jason@redhat.com>
1536         PR c++/69889
1537         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
1538         * tree.c (build_aggr_init_expr): Set it.
1539         * semantics.c (simplify_aggr_init_expr): Check it.
1540         * cp-gimplify.c (cp_genericize_r): Don't walk into
1541         a call/aggr_init from a thunk.
1543         PR c++/69842
1544         * method.c (forward_parm): Handle parameter packs.
1545         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1547         PR c++/67364
1548         * constexpr.c (cxx_eval_component_reference): Don't complain about
1549         unevaluated empty classes.
1551         PR c++/68049
1552         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1554 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
1556         PR c++/69736
1557         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
1558         (maybe_undo_parenthesized_ref): Declare.
1559         * semantics.c (maybe_undo_parenthesized_ref): Split out from
1560         check_return_expr.
1561         (finish_call_expr): Use it.
1562         * typeck.c (check_return_expr): Use it.
1563         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
1564         REF_PARENTHESIZED_P flag.
1566 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
1568         PR c++/69922
1569         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1570         Avoid folding it.
1571         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
1572         tests.
1573         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
1574         unless they are folded into INTEGER_CST, error_mark_node or some
1575         comparison with NULL, avoid folding them and use either the original
1576         comparison or non-folded comparison of folded arguments.
1577         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
1578         comparison, don't fold the comparison right away.
1580 2016-02-24  Jason Merrill  <jason@redhat.com>
1582         PR c++/69323
1583         * friend.c (make_friend_class): Likewise.
1584         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1586 2016-02-24  Jason Merrill  <jason@redhat.com>
1588         PR c++/69323
1589         * pt.c (instantiate_class_template_1): Set
1590         processing_template_decl before substituting friend_type.
1592 016-02-24  Martin Sebor  <msebor@redhat.com>
1594         PR c++/69912
1595         * tree.c (build_ctor_subob_ref): Compare types' main variants
1596         instead of the types as they are.
1598 2016-02-24  Jason Merrill  <jason@redhat.com>
1600         * decl.c (start_preparsed_function): Condition ctor clobber on
1601         flag_lifetime_dse > 1.
1603         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1605 2016-02-19  Jason Merrill  <jason@redhat.com>
1607         PR c++/69743
1608         * call.c (remaining_arguments): No longer static.
1609         * cp-tree.h: Declare it.
1610         * pt.c (more_specialized_fn): Use it.
1612 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1613             Bernd Edlinger  <bernd.edlinger@hotmail.de>
1615         * Make-lang.in: Invoke gperf with -L C++.
1616         * cfns.gperf: Remove prototypes for hash and libc_name_p
1617         inlines.
1618         * cfns.h: Regenerated.
1619         * except.c (nothrow_libfn_p): Adjust.
1621 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1623         PR c++/69850
1624         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1625         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1627 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
1629         PR c++/68948
1630         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1631         call here.
1632         * semantics.c (finish_call_expr): Don't assume a constructor
1633         call is dependent if only the "this" pointer is dependent.  When
1634         building a constructor call, always use a dummy object.
1636 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1638         PR c++/69850
1639         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1640         condition.
1641         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1642         operators if folding preserved the binop, just with different
1643         arguments.
1645         PR c++/67767
1646         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1647         attr_spec is always single element chain, chain all the attributes
1648         properly together in the right order.
1650 2016-02-18  Jason Merrill  <jason@redhat.com>
1652         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
1653         mangle_decl.
1654         (mangle_decl): Call maybe_check_abi_tags for function scope.
1655         (mangle_guard_variable): Call maybe_check_abi_tags here.
1656         (write_guarded_var_name): Not here.
1658 2016-02-17  Jason Merrill  <jason@redhat.com>
1660         PR c++/65985
1661         * constexpr.c (build_constexpr_constructor_member_initializers):
1662         Handle an additional STATEMENT_LIST.
1664         PR c++/68585
1665         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1667         PR c++/68679
1668         * decl2.c (reset_type_linkage_2): Look through member templates.
1670 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
1672         PR c++/69850
1673         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1675 2016-02-17  Jason Merrill  <jason@redhat.com>
1677         PR c++/69842
1678         * method.c (forward_parm): Split out from...
1679         (add_one_base_init): ...here.
1680         * lambda.c (maybe_add_lambda_conv_op): Use it.
1682 2016-02-16  Jason Merrill  <jason@redhat.com>
1684         PR c++/10200
1685         PR c++/69753
1686         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1687         tree.c, typeck2.c: Revert earlier changes.
1688         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1689         non-type templates after -> or .
1691 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
1693         PR c/69835
1694         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1696 2016-02-16  Jason Merrill  <jason@redhat.com>
1698         PR c++/69657
1699         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1700         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
1701         * name-lookup.h: Adjust.
1703 2016-02-16  James Norris  <jnorris@codesourcery.com>
1705         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1706         * semantics.c (finish_omp_clauses): Add deviceptr checking.
1708 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1710         PR c++/69658
1711         * init.c (expand_default_init): Only call reshape_init
1712         in the direct-initialization from an initializer list case.
1714 2016-02-15  Jason Merrill  <jason@redhat.com>
1716         PR c++/69753
1717         * semantics.c (finish_call_expr): Implicit 'this' does not make
1718         the call dependent.
1719         * search.c (any_dependent_bases_p): Split out...
1720         * name-lookup.c (do_class_using_decl): ...from here.
1721         * call.c (build_new_method_call_1): Don't complain about missing object
1722         if there are dependent bases.  Tweak error.
1723         * tree.c (non_static_member_function_p): Remove.
1724         * pt.c (type_dependent_expression_p): A member template of a
1725         dependent type is dependent.
1726         * cp-tree.h: Adjust.
1728         PR c++/68890
1729         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1731 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1733         PR c++/69098
1734         * pt.c (lookup_and_finish_template_variable): New function,
1735         extracted from ...
1736         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1737         (tsubst_qualified_id): Consider that EXPR might be a variable
1738         template.
1739         * typeck.c (check_template_keyword): Don't emit an error
1740         if DECL is a variable template.
1742 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1744         * error.c: Spelling fixes - behaviour -> behavior and
1745         neighbour -> neighbor.
1746         * decl.c: Likewise.
1747         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1748         diagnostics.
1749         * init.c (build_delete): Likewise.
1751 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1753         PR c/69768
1754         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1755         arguments for -Waddress warning.  Fix up formatting.
1757 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1759         PR c++/68726
1760         * pt.c (lookup_template_class_1): Check tsubst return value for
1761         error_mark_node.
1763 2016-02-10  Jason Merrill  <jason@redhat.com>
1765         PR c++/68926
1766         * pt.c (resolve_nondeduced_context): Add complain parm.
1767         (do_auto_deduction): Pass it.
1768         * cvt.c (convert_to_void): Likewise.
1769         * decl.c (cp_finish_decl): Likewise.
1770         * init.c (build_new): Likewise.
1771         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1772         * semantics.c (finish_decltype_type): Likewise.
1773         * typeck.c (decay_conversion): Likewise.
1774         * cp-tree.h: Adjust declaration.
1775         * call.c (standard_conversion): Add complain parm, pass it along.
1776         (implicit_conversion): Pass it.
1778         PR c++/69657
1779         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1780         (lookup_name_real_1): Likewise.
1781         (remove_hidden_names): Handle non-functions too.
1783         PR c++/10200
1784         * parser.c (cp_parser_lookup_name): When looking for a template
1785         after . or ->, only consider class templates.
1786         (cp_parser_postfix_dot_deref_expression): Handle the current
1787         instantiation.  Remember a dependent object expression.
1788         * typeck2.c (build_x_arrow): Handle the current instantiation.
1790         * ptree.c (debug_tree): Implement for cp_expr.
1792 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1794         PR c++/69139
1795         * parser.c (cp_parser_simple_type_specifier): Make the check
1796         for disambiguating between an 'auto' placeholder and an implicit
1797         template parameter more robust.
1799 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1801         PR c++/69283
1802         PR c++/67835
1803         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1804         setting its TREE_USED flag.
1806 2016-02-08  Jason Merrill  <jason@redhat.com>
1808         PR c++/69657
1809         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1810         built-ins alone.
1812 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1814         PR c++/59627
1815         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1816         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1818 2016-02-08  Marek Polacek  <polacek@redhat.com>
1820         PR c++/69688
1821         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1822         Call clear_fold_cache.
1823         * cp-tree.h: Adjust declaration.
1824         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1825         rather than clear_cv_cache and clear_fold_cache.
1826         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1828 2016-02-08  Jason Merrill  <jason@redhat.com>
1830         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1831         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1832         (ocp_convert): Use *_maybe_fold.
1833         (cp_convert_to_pointer): Add dofold parameter.
1834         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1836 2016-02-05  Martin Sebor  <msebor@redhat.com>
1838         PR c++/69662
1839         * init.c (find_field_init): New function.
1840         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1841         at ends of structures special.
1843 2016-02-05  Jason Merrill  <jason@redhat.com>
1845         PR c++/68948
1846         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1847         make sure we've seen_error().
1849 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1851         PR c++/68948
1852         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1853         if lookup_fnfields returns NULL_TREE and the name being looked
1854         up has the form A::A.
1856 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1858         * constexpr.c (cxx_eval_binary_expression): Fold equality
1859         comparisons involving PTRMEM_CSTs.
1861 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1863         * class.c (find_flexarrays): Don't declare dom variable.
1864         (diagnose_flexarray): Likewise.
1866 2016-02-02  Martain Sebor  <msebor@redhat.com>
1868         PR c++/69251
1869         PR c++/69253
1870         PR c++/69290
1871         PR c++/69277
1872         PR c++/69349
1873         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1874         of a flexible array member for equality to null.
1875         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1876         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1877         (check_flexarrays): Same.
1878         * decl.c (compute_array_index_type): Avoid special case for flexible
1879         array members.
1880         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1881         array members.
1882         * error.c (dump_type_suffix): Revert changes introduced in r231665
1883         and rendered unnecessary by the changes above.
1884         * pt.c (tsubst):  Same.
1885         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1886         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1887         (process_init_constructor_array): Same.
1888         (process_init_constructor_record): Same.
1890 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1892         PR c++/69056
1893         * pt.c (try_one_overload): Handle comparing argument packs so
1894         that there is no conflict if we deduced more arguments of an
1895         argument pack than were explicitly specified.
1897 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1898             Jason Merrill  <jason@redhat.com>
1900         PR c++/68763
1901         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1902         function type if nothing is changing.
1904 2016-01-31  Jason Merrill  <jason@redhat.com>
1906         PR c++/69009
1907         * pt.c (partial_specialization_p, impartial_args): New.
1908         (instantiate_decl): Call impartial_args.
1910         * mangle.c (maybe_check_abi_tags): New.
1911         (write_guarded_var_name): Call it.
1912         (mangle_ref_init_variable): Call check_abi_tags.
1914         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1915         between template and instantiation.
1917 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1919         PR debug/66869
1920         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1921         function declarations.
1923 2016-01-29  Marek Polacek  <polacek@redhat.com>
1925         PR c++/69509
1926         PR c++/69516
1927         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1928         out of bound" error earlier.
1929         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1930         commentary.
1932 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1934         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1935         structure, update free_binding_level before the structure's
1936         level_chain field gets cleared, not after.
1938 2016-01-28  Jason Merrill  <jason@redhat.com>
1940         PR c++/67407
1941         * search.c (dfs_walk_once, dfs_walk_once_r)
1942         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1943         hash_set instead of BINFO_MARKED.
1944         (dfs_unmark_r): Remove.
1946 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1948         PR c++/24208
1949         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1950         (cp_lexer_debugging_p): Use it.
1951         (cp_lexer_start_debugging): Likewise.
1952         (cp_lexer_stop_debugging): Likewise.
1954 2016-01-27  Marek Polacek  <polacek@redhat.com>
1956         PR c/68062
1957         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1958         needed.  Add -Wsign-compare warning.
1960 2016-01-27  Ryan Burn  <contact@rnburn.com>
1962         PR cilkplus/69267
1963         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1964         superfluous post_p argument in call to
1965         cilk_gimplify_call_params_in_spawned_fn.
1967 2016-01-27  Marek Polacek  <polacek@redhat.com>
1969         PR c++/69379
1970         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1971         wrapped in NOP_EXPRs.
1973 2016-01-27  Martin Sebor  <msebor@redhat.com>
1975         PR c++/69317
1976         * mangle.c (mangle_decl): Reference the correct (saved) version
1977         of the ABI in -Wabi diagnostics.
1979 2016-01-27  Marek Polacek  <polacek@redhat.com>
1981         PR c++/69496
1982         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1983         elements of the array.
1985 2016-01-26  Jason Merrill  <jason@redhat.com>
1987         PR c++/68949
1988         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1989         (cxx_eval_call_expression): Don't look through clones.
1990         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1991         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1992         maybe-in-charge *tor.
1994 2016-01-26  Jason Merrill  <jason@redhat.com>
1996         PR c++/68782
1997         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1998         and TREE_SIDE_EFFECTS.
1999         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
2000         verify_constructor_flags.
2002 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
2004         PR c++/68357
2005         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
2006         return error_mark_node instead of building trees with error_mark_node
2007         operands.
2009 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
2011         PR other/69006
2012         * error.c (print_instantiation_partial_context_line): Add missing
2013         newlines from output for the t == NULL case.
2014         (print_instantiation_partial_context): Remove call to pp_newline.
2016 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
2018         Revert:
2019         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
2021         PR c++/11858
2022         PR c++/24663
2023         PR c++/24664
2024         * decl.c (grokdeclarator): Don't decay array parameter type to
2025         a pointer type if it's dependent.
2026         (grokparms): Invoke strip_top_quals instead of directly invoking
2027         cp_build_qualified_type.
2028         * pt.c (decay_dependent_array_parm_type): New static function.
2029         (type_unification_real): Call decay_dependent_array_parm_type
2030         to decay a dependent array parameter type to its corresponding
2031         pointer type before unification.
2032         (more_specialized_fn): Likewise.
2033         (get_bindings): Likewise.
2034         * tree.c (cp_build_qualified_type): Trivial typofix in
2035         documentation.
2037 2016-01-23  Martin Sebor  <msebor@redhat.com>
2039         PR c++/58109
2040         PR c++/69022
2041         * decl2.c (is_late_template_attribute): Handle dependent argument
2042         to attribute align and attribute vector_size.
2044 2016-01-21  Jason Merrill  <jason@redhat.com>
2046         PR c++/69392
2047         * lambda.c (lambda_capture_field_type): Handle 'this' specially
2048         for init-capture, too.
2050         PR c++/65687
2051         * decl.c (type_is_deprecated): Don't look into a typedef.
2053         PR c++/40751
2054         PR c++/64987
2055         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
2057         PR c++/43407
2058         * decl.c (start_enum): Add attributes parameter.
2059         * parser.c (cp_parser_enum_specifier): Pass it.
2060         * pt.c (lookup_template_class_1): Pass it.
2061         * cp-tree.h: Adjust.
2063 2016-01-19  Jason Merrill  <jason@redhat.com>
2065         PR c++/59759
2066         * pt.c (convert_template_argument): Handle VAR_DECL properly.
2068 2016-01-19  Marek Polacek  <polacek@redhat.com>
2070         PR c++/68586
2071         * constexpr.c (clear_cv_cache): New.
2072         * cp-gimplify.c (clear_fold_cache): New.
2073         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
2074         * decl.c (finish_enum_value_list): Call them.
2076         PR c++/68965
2077         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
2079 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
2081         PR c++/11858
2082         PR c++/24663
2083         PR c++/24664
2084         * decl.c (grokdeclarator): Don't decay array parameter type to
2085         a pointer type if it's dependent.
2086         (grokparms): Invoke strip_top_quals instead of directly invoking
2087         cp_build_qualified_type.
2088         * pt.c (decay_dependent_array_parm_type): New static function.
2089         (type_unification_real): Call decay_dependent_array_parm_type
2090         to decay a dependent array parameter type to its corresponding
2091         pointer type before unification.
2092         (more_specialized_fn): Likewise.
2093         (get_bindings): Likewise.
2094         * tree.c (cp_build_qualified_type): Trivial typofix in
2095         documentation.
2097 2016-01-18  Jason Merrill  <jason@redhat.com>
2099         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
2101         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
2103         PR c++/68767
2104         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
2105         (contains_label_1, contains_label_p): Remove.
2107 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2109         PR c++/69091
2110         * pt.c (type_dependent_expression_p): For a function template
2111         specialization, a type is dependent iff any of its template
2112         arguments are.
2114 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2116         * cp-array-notation.c (cp_expand_cond_array_notations): Return
2117         error_mark_node only if find_rank failed, not if it was
2118         successful.
2120 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2122         PR c++/68936
2123         * tree.c (build_min_non_dep_call_vec): Don't retain the
2124         KOENIG_LOOKUP_P flag of the non-dependent expression that's
2125         been built.
2126         (build_min_non_dep_op_overload): Instead, do it here.
2128 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
2130         PR bootstrap/68271
2131         * parser.h (cp_token): Remove pragma_kind field.  Add comment
2132         with number of unused bits.
2133         * parser.c (eof_token): Remove pragma_kind field initializer.
2134         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
2135         field, don't clear CPP_PRAGMA u.value.
2136         (cp_parser_pragma_kind): New function.
2137         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
2138         cp_parser_omp_construct, cp_parser_initial_pragma,
2139         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
2140         pragma_kind field.
2142 2016-01-15  Jason Merrill  <jason@redhat.com>
2144         PR c++/68847
2145         * call.c (build_cxx_call): Use fold_non_dependent_expr.
2147         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
2148         value.
2150         PR c++/69257
2151         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
2152         array/function-to-pointer conversion.  Call
2153         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
2154         * call.c (convert_like_real): Print call context if
2155         decay_conversion errors.
2157 2016-01-14  Tom de Vries  <tom@codesourcery.com>
2159         PR tree-optimization/68773
2160         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
2161         set force_output.
2163 2016-01-14  Jason Merrill  <jason@redhat.com>
2165         PR c++/69261
2166         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
2168 2016-01-12  Marek Polacek  <polacek@redhat.com>
2170         PR c++/68979
2171         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
2172         error_at and adjust the return value.
2174 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
2176         PR objc++/68511
2177         PR c++/69213
2178         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
2179         GS_ERROR whenever seen_error (), only if *expr_p contains
2180         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
2182         PR c++/66808
2183         PR c++/69000
2184         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
2186 2016-01-11  Jason Merrill  <jason@redhat.com>
2188         PR c++/69131
2189         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
2190         (process_subob_fn): Likewise.  Don't consider triviality if true.
2191         (synthesize_method_walk): Pass it.
2193 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
2195         PR c++/68795
2196         * parser.c (cp_parser_postfix_expression): Initialize
2197         close_paren_loc to UNKNOWN_LOCATION; only use it if
2198         it has been written to by
2199         cp_parser_parenthesized_expression_list.
2200         (cp_parser_parenthesized_expression_list): Document the behavior
2201         with respect to the CLOSE_PAREN_LOC param.
2203 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
2205         PR c++/69211
2206         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
2207         folded operands have side-effects, but folding changed any of them,
2208         build a new tree with the folded operands instead of returning the
2209         unfolded tree.
2211 2016-01-09  Marek Polacek  <polacek@redhat.com>
2213         PR c++/69113
2214         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
2216 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
2218         PR c++/69164
2219         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
2221 2016-01-08  Jason Merrill  <jason@redhat.com>
2223         PR c++/69158
2224         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
2225         in completion.
2227 2016-01-08  Marek Polacek  <polacek@redhat.com>
2229         PR c++/68449
2230         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
2232 2016-01-08  Jason Merrill  <jason@redhat.com>
2234         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
2235         workaround.
2237         PR c++/68983
2238         PR c++/67557
2239         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
2240         TREE_ADDRESSABLE type.
2242         PR c++/68983
2243         PR c++/67557
2244         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2246 2016-01-05  Nathan Sidwell  <nathan@acm.org>
2248         PR c++/58583
2249         * pt.c (build_non_dependent_expr): Don't try a checking fold when
2250         parsing an nsdmi.
2252 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
2254         Update copyright years.
2256 Copyright (C) 2016 Free Software Foundation, Inc.
2258 Copying and distribution of this file, with or without modification,
2259 are permitted in any medium without royalty provided the copyright
2260 notice and this notice are preserved.