/cp
[official-gcc.git] / gcc / cp / ChangeLog
bloba94cebea7dc9937bf74071416effc85963726b70
1 2016-06-09  Paolo Carlini  <paolo.carlini@oracle.com>
3         PR c++/71465
4         Revert:
5         2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
7         PR c++/70202
8         * parser.c (cp_parser_class_head): When xref_basetypes fails and
9         emits an error do not zero the type.
11 2016-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
13         * decl.c (maybe_deduce_size_from_array_init): Use
14         DECL_SOURCE_LOCATION in error_at.
15         (layout_var_decl): Likewise.
16         (check_array_initializer): Likewise.
17         (check_initializer): Likewise.
18         (duplicate_decls, check_elaborated_type_specifier): Tidy.
20 2016-06-08  Martin Sebor  <msebor@redhat.com>
21             Jakub Jelinek  <jakub@redhat.com>
23         PR c++/70507
24         PR c/68120
25         * constexpr.c: Include gimple-fold.h.
26         (cxx_eval_internal_function): New function.
27         (cxx_eval_call_expression): Call it.
28         (potential_constant_expression_1): Handle integer arithmetic
29         overflow built-ins.
30         * tree.c (builtin_valid_in_constant_expr_p): Handle
31         BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
33 2016-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
35         * pt.c (tsubst, case TYPENAME_TYPE): Don't delay checking the
36         return value of tsubst_aggr_type for error_mark_node.
38 2016-06-08  Jakub Jelinek  <jakub@redhat.com>
40         PR c++/71442
41         * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
43 2016-06-06  Jakub Jelinek  <jakub@redhat.com>
44             Patrick Palka  <ppalka@gcc.gnu.org>
46         PR c++/70847
47         PR c++/71330
48         PR c++/71393
49         * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
50         right after cp_fold call if cp_fold has returned the same stmt
51         already in some earlier cp_fold_r call.
52         (cp_fold_function): Add pset automatic variable, pass its address
53         to cp_walk_tree.
55 2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
57         PR c++/70202
58         * parser.c (cp_parser_class_head): When xref_basetypes fails and
59         emits an error do not zero the type.
61 2016-06-03  Patrick Palka  <ppalka@gcc.gnu.org>
63         PR c++/27100
64         * decl.c (duplicate_decls): Properly copy the
65         DECL_PENDING_INLINE_P, DECL_PENDING_INLINE_INFO and
66         DECL_SAVED_FUNCTION_DATA fields from OLDDECL to NEWDECL.
68 2016-06-03  Chung-Lin Tang  <cltang@codesourcery.com>
70         * semantics.c (finish_omp_clauses): Mark OpenACC reduction
71         arguments as addressable when async clause exists.
73 2016-06-02  Jan Hubicka  <jh@suse.cz>
75         * cp-gimplify.c (genericize_continue_stmt): Force addition of
76         predict stmt.
78 2016-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
80         * decl.c (xref_tag_1): Change pairs of errors to error + inform.
81         (start_enum): Likewise.
82         * parser.c (cp_parser_class_head): Likewise.
84 2016-06-02  Jakub Jelinek  <jakub@redhat.com>
86         PR c++/71372
87         * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
88         is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
89         and TREE_THIS_VOLATILE flags.  For ARRAY_REF and ARRAY_RANGE_REF, copy
90         over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
91         to the newly built tree.
93 2016-05-31  Jason Merrill  <jason@redhat.com>
95         * pt.c (instantiate_decl): Avoid recalculation.
97         PR c++/60095
98         PR c++/69515
99         PR c++/69009
100         * pt.c (instantiate_template_1): Don't put the partial
101         specialization in DECL_TI_TEMPLATE.
102         (partial_specialization_p, impartial_args): Remove.
103         (regenerate_decl_from_template): Add args parm.
104         (instantiate_decl): Look up the partial specialization again.
106         PR c++/71227
107         * pt.c (check_explicit_specialization): Give better diagnostic about
108         specializing a hidden friend.
110 2016-05-31  Paolo Carlini  <paolo.carlini@oracle.com>
112         PR c++/71248
113         * decl.c (check_static_variable_definition): Use DECL_SOURCE_LOCATION
114         to obtain correct locations; avoid redundant diagnostics on
115         out-of-class definitions.
117 2016-05-30  Martin Sebor  <msebor@redhat.com>
119         PR c++/71306
120         * init.c (warn_placement_new_too_small): Handle placement new arguments
121         that are elements of arrays more carefully.  Remove a pointless loop.
123 2016-05-30  Jakub Jelinek  <jakub@redhat.com>
125         PR c++/71349
126         * parser.c (cp_parser_omp_for): Don't disallow nowait clause
127         when combined with target construct.
128         (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
129         to cp_parser_omp_all_clauses.
131 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
133         PR c++/71238
134         * lex.c (unqualified_name_lookup_error): Take a location too.
135         (unqualified_fn_lookup_error): Take a cp_expr.
136         * cp-tree.h (unqualified_name_lookup_error,
137         unqualified_fn_lookup_error): Adjust declarations.
138         * semantics.c (perform_koenig_lookup): Adjust
139         unqualified_fn_lookup_error call, pass the location of
140         the identifier too as part of a cp_expr.
142 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
144         PR c++/71099
145         * parser.c (cp_parser_function_specifier_opt): Use current_class_type
146         to improve the diagnostic about wrong uses of 'virtual'.
148 2016-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
150         PR c++/71105
151         * lambda.c (maybe_add_lambda_conv_op): Early return also when
152         LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
154 2016-05-28  Ville Voutilainen  <ville.voutilainen@gmail.com>
156         Revert:
157         PR c++/69855
158         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
159         decls into the global scope after stripping template bits
160         and setting DECL_ANTICIPATED.
162 2016-05-27  Paolo Carlini  <paolo.carlini@oracle.com>
164         PR c++/60385
165         * name-lookup.c (push_namespace): Return bool, false when pushdecl
166         fails.
167         * name-lookup.h (push_namespace): Adjust declaration.
168         * parser.c (cp_parser_namespace_definition): Check push_namespace
169         return value.
171 2016-05-27  Ville Voutilainen  <ville.voutilainen@gmail.com>
173         PR c++/69855
174         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
175         decls into the global scope after stripping template bits
176         and setting DECL_ANTICIPATED.
178 2016-05-26  Jakub Jelinek  <jakub@redhat.com>
180         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_SCHEDULE>: Warn
181         if OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
183 2016-05-26  Patrick Palka  <ppalka@gcc.gnu.org>
185         PR c++/70822
186         PR c++/70106
187         * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
188         SCOPE_REFs too.
189         * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
190         on the qualified_id then propagate it to the resulting
191         expression.
192         (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
193         too.
194         * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
195         its REF_PARENTHESIZED_P flag.
197 2016-05-25  Jason Merrill  <jason@redhat.com>
199         PR c++/71173
200         PR c++/70522
201         * cp-tree.h (enum tag_types): Add scope_type.
202         * parser.c (cp_parser_class_name): Use scope_type.
203         (prefer_type_arg): Handle scope_type.
204         (cp_parser_lookup_name): Use prefer_type_arg.
205         * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
206         int prefer_type, use lookup_flags.
207         * name-lookup.h: Adjust.
209 2016-05-24  Cesar Philippidis  <cesar@codesourcery.com>
211         * parser.c (cp_parser_oacc_declare): Add support for
212         GOMP_MAP_FIRSTPRIVATE_POINTER.
213         * semantics.c (handle_omp_array_sections_1): Replace bool is_omp
214         argument with enum c_omp_region_type ort.  Don't privatize OpenACC
215         non-static members.
216         (handle_omp_array_sections): Replace bool is_omp argument with enum
217         c_omp_region_type ort.  Update call to handle_omp_array_sections_1.
218         (finish_omp_clauses): Add specific errors and warning messages for
219         OpenACC.  Use firsrtprivate pointers for OpenACC subarrays.  Update
220         call to handle_omp_array_sections.
222 2016-05-24  Jason Merrill  <jason@redhat.com>
224         PR c++/70584
225         * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
226         returns a decl.
227         (cp_fold) [INDIRECT_REF]: Don't fold to an rvalue.
229 2016-05-24  Martin Sebor  <msebor@redhat.com>
231         PR c++/71147
232         * decl.c (layout_var_decl, grokdeclarator): Use complete_or_array_type_p.
233         * pt.c (instantiate_class_template_1): Try to complete the element
234         type of a flexible array member.
235         (can_complete_type_without_circularity): Handle arrays of unknown bound.
236         * typeck.c (complete_type): Also complete the type of the elements of
237         arrays with an unspecified bound.
239 2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
241         PR c++/69872
242         * typeck2.c (check_narrowing): Check pedwarn return value.
244 2016-05-24  Jakub Jelinek  <jakub@redhat.com>
246         PR c++/71257
247         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
248         For OMP_CLAUSE_LINEAR_REF don't require type to be
249         integral or pointer.
251 2016-05-24  Richard Biener  <rguenther@suse.de>
253         PR middle-end/70434
254         PR c/69504
255         * expr.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
256         * constexpr.c (cxx_eval_array_reference): Handle indexed
257         vectors.
258         * typeck.c (cp_build_array_ref): Adjust.
260 2016-05-23  Jason Merrill  <jason@redhat.com>
262         PR c++/70344
263         * constexpr.c (cxx_eval_call_expression): Check for
264         fun == current_function_decl again.
266         PR c++/70584
267         * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call
268         maybe_undo_parenthesized_ref.
270         PR c++/70735
271         * pt.c (tsubst_copy): Just return a local variable from
272         non-template context.  Don't call rest_of_decl_compilation for
273         duplicated static locals.
274         (tsubst_decl): Set DECL_CONTEXT of local static from another
275         function.
277 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
279         PR c++/70972
280         * method.c (forward_parm): Use cp_build_reference_type.
282 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
284         PR c++/69095
285         * parser.c (cp_parser_initializer): Use check_for_bare_parameter_packs.
287 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
289         * pt.c (check_for_bare_parameter_packs): Improve error message
290         location for expressions.
292 2016-05-20  Nathan Sidwell  <nathan@acm.org>
294         * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
295         ... goto.
296         (cxx_eval_call_expression): Fix comment grammar.
298 2016-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
300         PR c++/70572
301         * decl.c (cp_finish_decl): Check do_auto_deduction return value
302         and return immediately in case of erroneous code.
304 2016-05-19  Marek Polacek  <polacek@redhat.com>
306         PR c++/71075
307         * pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.
309 2016-05-19  Jason Merrill  <jason@redhat.com>
311         PR c++/10200
312         * pt.c (fn_type_unification): Add outer template args if needed.
313         (type_unification_real): Handle getting full args.
315 2016-05-19  David Malcolm  <dmalcolm@redhat.com>
317         PR c++/71184
318         * parser.c (cp_parser_operator): For array new/delete, check that
319         cp_parser_require returned a non-NULL token before dereferencing
320         it.
322 2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
324         * decl.c (finish_enum_value_list): Use the specified mode.
326 2016-05-18  Jason Merrill  <jason@redhat.com>
328         * pt.c (value_dependent_expression_p): Tweak new cases to better
329         match the wording in the standard.
331 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
333         PR c++/69793
334         * parser.c (cp_parser_template_id): Don't call cp_lexer_peek_nth_token
335         when the previous cp_lexer_peek_token returns CPP_EOF.
337 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
339         PR c++/70466
340         * call.c (convert_like_real): Check that we are actually converting
341         from an init list.
343 2016-05-16  Matthew Wahab  <matthew.wahab@arm.com>
345         * decl.c (grokdeclarator): Remove errmsg and use of
346         targetm.invalid_return_type.
347         (grokparms): Remove errmsg and use of
348         targetm.invalid_parameter_type.
350 2016-05-13  Jason Merrill  <jason@redhat.com>
352         PR c++/10200
353         PR c++/69753
354         * pt.c (tsubst_decl): Use uses_template_parms.
355         (instantiate_template_1): Handle non-dependent calls in templates.
356         (value_dependent_expression_p): Handle BASELINK, FUNCTION_DECL.
357         (type_dependent_expression_p): Only consider innermost template args.
358         (dependent_template_arg_p): Check enclosing class of a template here.
359         (dependent_template_p): Not here.
360         (type_dependent_object_expression_p): New.
361         * typeck.c (finish_class_member_access_expr): Use it.
362         * parser.c (cp_parser_postfix_expression): Use it.
363         (cp_parser_postfix_dot_deref_expression): Use it.  Use comptypes
364         to detect the current instantiation.
365         (cp_parser_lookup_name): Really implement DR 141.
366         * search.c (lookup_field_r): Prefer a dependent using-declaration.
367         (any_dependent_bases_p): Split out from...
368         * name-lookup.c (do_class_using_decl): ...here.
369         * call.c (build_new_method_call_1): Use it.
370         * semantics.c (finish_call_expr): 'this' doesn't make a call dependent.
371         * tree.c (non_static_member_function_p): Remove.
372         * typeck2.c (build_x_arrow): Use dependent_scope_p.
374         * parser.c (cp_parser_postfix_dot_deref_expression): Use
375         complete_type_or_else for unknown_type_node, too.
377 2016-05-12  Marek Polacek  <polacek@redhat.com>
379         PR c/70756
380         * call.c (build_new_op_1): Pass LOC to cp_build_modify_expr.
381         * cp-tree.h (cp_build_modify_expr): Update declaration.
382         (cxx_incomplete_type_error, cxx_incomplete_type_diagnostic): New inline
383         overloads.
384         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Pass INPUT_LOCATION to
385         cp_build_modify_expr.
386         * decl2.c (set_guard): Likewise.
387         (handle_tls_init): Likewise.
388         * init.c (perform_member_init): Likewise.
389         (expand_virtual_init): Likewise.
390         (build_new_1): Likewise.
391         (build_vec_delete_1): Likewise.
392         (get_temp_regvar): Likewise.
393         (build_vec_init): Likewise.
394         * method.c (do_build_copy_assign): Likewise.
395         (assignable_expr): Likewise.
396         * semantics.c (finish_omp_for): Likewise.
397         * typeck.c (cp_build_binary_op): Pass LOCATION to pointer_diff and
398         cp_pointer_int_sum.
399         (cp_pointer_int_sum): Add location parameter.  Pass it down to
400         pointer_int_sum.
401         (pointer_diff): Add location parameter.  Use it.
402         (build_modify_expr): Pass location down to cp_build_modify_expr.
403         (cp_build_modify_expr): Add location parameter.  Use it.
404         (build_x_modify_expr): Pass location down to cp_build_modify_expr.
405         * typeck2.c (cxx_incomplete_type_diagnostic,
406         cxx_incomplete_type_error): Add location parameter.
408 2016-05-11  Marek Polacek  <polacek@redhat.com>
410         PR c++/71024
411         * decl.c (duplicate_decls): Call diagnose_mismatched_decls.
413 2016-05-05  Jakub Jelinek  <jakub@redhat.com>
415         * parser.c (cp_parser_selection_statement): For RID_SWITCH,
416         pass if_p instead of NULL to cp_parser_implicitly_scoped_statement.
418 2016-05-04  Marek Polacek  <polacek@redhat.com>
420         * parser.c (cp_parser_selection_statement): Replace OPT_Wparentheses
421         with OPT_Wdangling_else.
423 2016-05-03  Martin Sebor  <msebor@redhat.com>
425         PR c++/66561
426         * tree.c (builtin_valid_in_constant_expr_p): Treat BUILT_IN_FILE,
427         BUILT_IN_FUNCTION, and BUILT_IN_LINE as constant expressions.
429 2016-05-03  Marek Polacek  <polacek@redhat.com>
431         PR c/70859
432         * call.c (build_cxx_call): Pass location and vNULL down to
433         check_builtin_function_arguments.
435 2016-05-03  Richard Biener  <rguenther@suse.de>
437         * Make-lang.in (cc1plus-checksum.c): For stage-final re-use
438         the checksum from the previous stage.
440 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
442         PR c++/62314
443         * typeck.c (finish_class_member_access_expr): When
444         giving a hint about a possibly-misspelled member name,
445         add a fix-it replacement hint.
447 2016-05-02  Cesar Philippidis  <cesar@codesourcery.com>
449         * cp-tree.h (finish_omp_clauses): Update prototype.
450         * parser.c (cp_parser_oacc_all_clauses): Update call to
451         finish_omp_clauses.
452         (cp_parser_omp_all_clauses): Likewise.
453         (cp_parser_omp_for_loop): Likewise.
454         (cp_omp_split_clauses): Likewise.
455         (cp_parser_oacc_cache): Likewise.
456         (cp_parser_oacc_loop): Likewise.
457         (cp_parser_omp_declare_target):
458         (cp_parser_cilk_simd_all_clauses): Likewise.
459         (cp_parser_cilk_for): Likewise.
460         * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
461         arguments with enum c_omp_region_type ort.
462         (tsubst_omp_clauses): Update calls to finish_omp_clauses.
463         (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
464         (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
465         (tsubst_expr): Update calls to tsubst_omp_clauses.
466         * semantics.c (finish_omp_clauses): Replace bool arguments
467         allow_fields, declare_simd, and is_cilk with bitmask ort.
468         (finish_omp_for): Update call to finish_omp_clauses.
470 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
472         PR c++/62314
473         * parser.c (cp_parser_class_head): Capture the start location;
474         use it to emit a fix-it insertion hint when complaining
475         about missing "template <> " in explicit specializations.
477 2016-05-02  Richard Sandiford  <richard.sandiford@arm.com>
479         * init.c (build_new_1): Use shift operators instead of wi:: shifts.
481 2016-05-02  Richard Biener  <rguenther@suse.de>
483         * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
484         anonymous VLAs.
486 2016-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
488         PR c++/66644
489         * class.c (check_field_decl): Remove final int* parameter, change
490         the return type to bool; fix logic in order not to reject multiple
491         initialized fields in anonymous struct.
492         (check_field_decls): Adjust call.
494 2016-04-29  Cesar Philippidis  <cesar@codesourcery.com>
496         PR middle-end/70626
497         * parser.c (cp_parser_oacc_loop): Don't augment mask with
498         OACC_LOOP_CLAUSE_MASK.
499         (cp_parser_oacc_kernels_parallel): Update call to
500         c_oacc_split_loop_clauses.
502 2016-04-28  Jason Merrill  <jason@redhat.com>
504         Implement C++17 [[nodiscard]] attribute.
505         PR c++/38172
506         PR c++/54379
507         * parser.c (cp_parser_std_attribute): Handle [[nodiscard]].
508         * tree.c (handle_nodiscard_attribute): New.
509         (cxx_attribute_table): Add [[nodiscard]].
510         * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New.
511         (maybe_warn_nodiscard): New.
512         (convert_to_void): Call it.
514         * cvt.c (cp_get_callee): New.
515         * constexpr.c (get_function_named_in_call): Use it.
516         * cxx-pretty-print.c (postfix_expression): Use it.
517         * except.c (check_noexcept_r): Use it.
518         * method.c (check_nontriv): Use it.
519         * tree.c (build_aggr_init_expr): Use it.
520         * cp-tree.h: Declare it.
522 2015-04-27  Ryan Burn  <contact@rnburn.com>
523             Jeff Law  <law@redhat.com>
525         PR c++/69024
526         PR c++/68997
527         * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
528         instead of cilk_detect_spawn_and_unwrap.
529         * cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
530         (find_spawn): New.
531         (cilk_cp_detect_spawn_and_unwrap): New.
532         * lambda.c: Include cp-cilkplus.h.
533         * parser.c: Include cp-cilkplus.h.
534         * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into...
535         * cp-cilkpus.h: New file.
537 2016-04-27  Nathan Sidwell  <nathan@acm.org>
539         * constexpr.c (get_fundef_copy): Use the original function for
540         non-recursive evaluations.
541         (save_fundef_copy): Always expect a slot to be available.
543 2016-04-27  Bernd Schmidt  <bschmidt@redhat.com>
545         * parser.c (cp_parser_postfix_expression): Call
546         warn_for_memset instead of warning directly here.
548 2016-04-26  Patrick Palka  <ppalka@gcc.gnu.org>
550         PR c++/70241
551         * decl.c (build_enumerator): Set current_access_specifier when
552         declaring an enumerator belonging to an in-class enumeration.
553         * parser.c (cp_parser_check_access_in_redecleration): Also
554         consider in-class enumerations.
556 2016-04-26  Marek Polacek  <polacek@redhat.com>
558         PR c++/70744
559         * call.c (build_conditional_expr_1): Call cp_stabilize_reference
560         instead of stabilize_reference.
561         (build_over_call): Likewise.
562         * cp-tree.h (cp_stabilize_reference): Declare.
563         * tree.c (cp_stabilize_reference): New function.
564         * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
565         stabilize_reference.
566         (unary_complex_lvalue): Likewise.
567         (cp_build_modify_expr): Likewise.
569 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
571         PR bootstrap/70704
572         * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
573         just flag_checking.
575 2016-04-25  Jason Merrill  <jason@redhat.com>
577         * tree.c (std_attribute_table): New.
578         (init_tree): Register it.
580 2016-04-22  Jason Merrill  <jason@redhat.com>
582         * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
584 2016-04-21  Patrick Palka  <ppalka@gcc.gnu.org>
586         * name-lookup.c (free_saved_scope): New free list of saved_scope
587         structures.
588         (push_to_top_level): Attempt to reuse a saved_scope struct
589         from free_saved_scope instead of allocating a new one each time.
590         (pop_from_top_level_1): Chain the now-unused saved_scope structure
591         onto free_saved_scope.
593 2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
595         PR c++/70540
596         * semantics.c (process_outer_var_ref): Unconditionally return
597         error_mark_node when mark_used returns false.
599 2016-04-21  Marek Polacek  <polacek@redhat.com>
601         PR c++/70513
602         * parser.c (cp_parser_enum_specifier): Check and possibly error for
603         extra qualification.
605 2016-04-20  Nathan Sidwell  <nathan@acm.org>
607         PR c++/55635
608         * init.c (build_vec_delete_1): Protect operator delete call in try
609         finally.
610         (build_delete): Likewise.
611         * optimize.c (build_delete_destructor_body): Likewise.
613 2016-04-20  Ilya Verbin  <ilya.verbin@intel.com>
615         PR c++/69363
616         * cp-tree.h (finish_omp_clauses): Add new default argument.
617         * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
618         instead of c_finish_cilk_clauses.
619         * semantics.c (finish_omp_clauses): Add new argument.  Allow
620         floating-point variables in the linear clause for Cilk Plus.
622 2016-04-20  Nathan Sidwell  <nathan@acm.org>
624         * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
625         TARGET_EXPR.
627 2016-04-19  Jason Merrill  <jason@redhat.com>
629         PR c++/66543
630         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
631         * pt.c (make_pack_expansion): Call mark_exp_read.
632         * semantics.c (finish_id_expression): Call mark_type_use in
633         unevaluated context.
635         DR 2137
636         * call.c (implicit_conversion): If we choose a copy constructor
637         for list-initialization from the same type, the conversion is an
638         exact match.
640         * constexpr.c (breaks): Handle EXIT_EXPR.
641         (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
642         (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
643         of COMPOUND_EXPR.
645         PR c++/68206
646         PR c++/68530
647         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
648         and GOTO_EXPR.
650         * pt.c (tsubst_expr): Remove shadowing declaration.
651         (tsubst_pack_expansion): Add assert.
653         * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
655         PR c++/70522
656         * name-lookup.c (qualified_lookup_using_namespace): Look through
657         hidden names.
659 2016-04-18  Michael Matz  <matz@suse.de>
661         * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
662         (layout_class_type): Ditto.
663         (build_base_field): Use SET_DECL_ALIGN.
664         (fixup_attribute_variants): Use SET_TYPE_ALIGN.
665         * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
666         (record_unknown_type): Use SET_TYPE_ALIGN.
667         (cxx_init_decl_processing): Ditto.
668         (copy_type_enum): Ditto.
669         (grokfndecl): Use SET_DECL_ALIGN.
670         (copy_type_enum): Use SET_TYPE_ALIGN.
671         * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
672         (tsubst): Ditto.
673         * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
674         * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
675         * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
676         * rtti.c (emit_tinfo_decl): Ditto.
678 2016-04-18  Jason Merrill  <jason@redhat.com>
680         PR c++/70690
681         PR c++/70528
682         * class.c (type_maybe_constexpr_default_constructor): New.
683         (type_has_constexpr_default_constructor): Revert.
685 2016-04-16  Sandra Loosemore  <sandra@codesourcery.com>
687         PR target/1078
689         * tree.c (cxx_attribute_table): Remove "com_interface" entry.
690         (handle_com_interface_attribute): Delete.
692 2016-04-15  Jason Merrill  <jason@redhat.com>
694         PR c++/70685
695         * constexpr.c (get_fundef_copy): Handle null *slot.
697         PR c++/70505
698         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
699         unknown_type_node, too.
701 2016-04-15  Jason Merrill  <jason@redhat.com>
702             Nathan Sidwell  <nathan@acm.org>
704         PR c++/70594
705         * constexpr.c (constexpr_call_table): Preserve in GC.
706         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
707         (fundef_copies_table): Preserve in GC. Change to pointer to
708         tree->tree hash.
709         (maybe_initialize_fundef_copies_table): Adjust.
710         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
711         (save_fundef_copy): Adjust for a TREE_LIST.
712         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
713         (fini_constexpr): New.
714         * cp-tree.h (fini_constexpr): Declare.
715         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
717 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
719         PR c/70436
720         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
721         where needed.
722         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
723         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
724         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
725         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
726         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
727         cp_parser_statement.
728         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
729         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
730         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
731         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
732         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
733         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
734         cp_parser_omp_taskloop, cp_parser_omp_construct,
735         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
736         Add IF_P argument, pass it down where needed.
737         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
738         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
739         calls.
741 2016-04-14  Jason Merrill  <jason@redhat.com>
743         PR c++/70494
744         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
745         * typeck2.c (split_nonconstant_init_1): Use it.
747         PR c++/70528
748         * class.c (type_has_constexpr_default_constructor): Return true
749         for an implicitly declared constructor.
751         PR c++/70622
752         * parser.c (cp_parser_init_declarator): Add auto_result parm.
753         (cp_parser_simple_declaration): Pass it.
754         (strip_declarator_types): New.
756         PR c++/70543
757         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
758         initializer also makes the variable value-dependent.
760         PR c++/70648
761         * constexpr.c (cxx_eval_store_expression): Also copy
762         CONSTRUCTOR_NO_IMPLICIT_ZERO.
764 2016-04-14  Martin Sebor  <msebor@redhat.com>
766         PR c++/69517
767         PR c++/70019
768         PR c++/70588
769         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
771 2016-04-14  Jason Merrill  <jason@redhat.com>
773         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
774         parameter ABI change.
776 2016-04-13  Martin Sebor  <msebor@redhat.com>
778         PR c++/69517
779         PR c++/70019
780         PR c++/70588
781         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
782         functions.
783         * decl.c (check_initializer, cp_finish_decl): Call them.
784         (reshape_init_r): Reject incompletely braced intializer-lists
785         for VLAs.
786         * init.c (throw_bad_array_length, build_vla_check)
787         (build_vla_size_check, build_vla_init_check): Define new functions.
788         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
789         to detect a VLA.
790         (store_init_value): Same.
792 2016-04-13  Jason Merrill  <jason@redhat.com>
794         Warn about empty parameter ABI with -Wabi=9.
795         * call.c (empty_class_msg, mark_for_abi_warning)
796         (warn_empty_class_abi): New.
797         (build_call_a): Use them.
798         * decl.c (store_parm_decls): Use mark_for_abi_warning.
799         * error.c (pp_format_to_string): New.
801         Pass empty class parameters like C.
802         * call.c (pass_as_empty_struct, empty_class_arg): New.
803         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
804         (build_call_a): Use empty_class_arg.
805         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
806         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
808 2016-04-13  Jason Merrill  <jason@redhat.com>
810         PR c++/70627
811         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
813 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
815         PR c++/70635
816         * pt.c (resolve_typename_type): Fix typos in infinite recursion
817         avoidance mechanism.
819 2016-04-13  Jason Merrill  <jason@redhat.com>
821         PR c++/70634
822         * pt.c (instantiation_dependent_uneval_expression_p): Split out
823         from instantiation_dependent_expression_p.
824         (value_dependent_expression_p): Use it for unevaluated operands.
825         (instantiation_dependent_r): Don't check value-dependence.
826         (instantiation_dependent_expression_p): Check
827         value-dependence of the expression as a whole.
828         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
829         * semantics.c (finish_decltype_type): Use it.
831         * constexpr.c (potential_nondependent_constant_expression): New.
832         (potential_nondependent_static_init_expression): New.
833         (maybe_constant_value_1, fold_non_dependent_expr)
834         (maybe_constant_init): Use them.
835         * pt.c (instantiate_non_dependent_expr_sfinae)
836         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
837         them.
838         * cp-tree.h: Declare them.
840 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
842         PR c++/70594
843         * decl.c (pop_labels_1): Removed.
844         (note_label, sort_labels): New functions.
845         (pop_labels): During named_labels traversal, just push the slot
846         pointers into a vector, then qsort it by DECL_UID and only then
847         call pop_label and chain it into BLOCK_VARS.
849 2016-04-13  Jason Merrill  <jason@redhat.com>
851         PR c++/70615
852         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
853         (cp_gimplify_expr): Not here.
855 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
857         PR c++/70610
858         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
859         recurse into it.
860         * typeck.c (build_x_conditional_expr): Unconditionally remember
861         that the result is an lvalue or xvalue.
863 2016-04-12  Jason Merrill  <jason@redhat.com>
865         * class.c (is_really_empty_class): A zero-length array is empty.
866         An unnamed bit-field doesn't make a class non-empty.
868 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
870         PR c++/68722
871         * parser.c (cp_parser_cache_defarg): When file ends in default
872         argument simply return error_mark_node.
874 2016-04-12  Nathan Sidwell  <nathan@acm.org>
876         PR c++/70501
877         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
878         similarly to PMF.
880 2016-04-11  Jason Merrill  <jason@redhat.com>
882         * mangle.c (decl_is_template_id): The template itself counts as a
883         template-id.
885 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
887         PR c++/70590
888         PR c++/70452
889         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
890         on the result if it's not a CONSTRUCTOR.
892 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
894         PR c++/70452
895         * constexpr.c (find_constructor): New function.
896         (unshare_constructor): New function.
897         (cxx_eval_call_expression): Use unshare_constructor instead of
898         unshare_expr.
899         (find_array_ctor_elt): Likewise.
900         (cxx_eval_vec_init_1): Likewise.
901         (cxx_eval_store_expression): Likewise.
902         (cxx_eval_constant_expression): Likewise.
904 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
906         PR c/70436
907         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
908         potentially generating a future -Wparentheses warning in its
909         callers.
911 2016-04-06  Jason Merrill  <jason@redhat.com>
913         * class.c (check_abi_tags): Fix function template handling.
915 2016-04-05  Nathan Sidwell  <nathan@acm.org>
917         PR c++/70512
918         * class.c (fixup_may_alias): New.
919         (fixup_attribute_variants): Call it.
921 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
923         PR c++/70452
924         * constexpr.c (struct fundef_copy): New struct.
925         (struct fundef_copies_table_t): New struct.
926         (fundef_copies_table): New static variable.
927         (maybe_initialize_fundef_copies_table): New static function.
928         (get_fundef_copy): New static function.
929         (save_fundef_copy): New static function.
930         (cxx_eval_call_expression): Use get_fundef_copy, and
931         save_fundef_copy.
932         (constexpr_call_table): Add "deletable" GTY marker.
934 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
936         PR c++/70452
937         * cp-tree.h (class cache_map): Remove.
938         * constexpr.c (cv_cache): Change type to
939         GTY((deletable)) hash_map<tree, tree> *.
940         (maybe_constant_value): Adjust following the change to cv_cache.
941         (clear_cv_cache): New static function.
942         (clear_cv_and_fold_caches): Use it.
943         * cp-gimplify.c (fold_cache): Change type to
944         GTY((deletable)) hash_map<tree, tree> *.
945         (clear_fold_cache): Adjust following the change to fold_cache.
946         (cp_fold): Likewise.
948 2016-04-02  Martin Sebor  <msebor@redhat.com>
950         PR c++/67376
951         PR c++/70170
952         PR c++/70172
953         PR c++/70228
954         * constexpr.c (diag_array_subscript): New function.
955         (cxx_eval_array_reference): Detect out of bounds array indices.
957 2016-04-01  Jason Merrill  <jason@redhat.com>
959         PR c++/70449
960         PR c++/70344
961         * pt.c (instantiate_decl): A function isn't fully defined if
962         DECL_INITIAL is error_mark_node.
963         * constexpr.c (cxx_eval_call_expression): Likewise.
965 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
966             Marek Polacek  <polacek@redhat.com>
968         PR c++/70488
969         * init.c (warn_placement_new_too_small): Test whether
970         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
972 2016-04-01  Nathan Sidwell  <nathan@acm.org>
974         PR c++/68475
975         * decl.c (check_redeclaration_exception_specification): Check
976         regardless of -fno-exceptions.
977         * typeck2.c (merge_exception_specifiers): Relax assert by checking
978         flag_exceptions too.
980 2016-03-31  Nathan Sidwell  <nathan@acm.org>
982         * decl.c (start_preparsed_function): Remove unnecessary bracing.
983         (finish_destructor_body): Don't emit operator delete here.
985 2016-03-31  Nathan Sidwell  <nathan@acm.org>
987         PR c++/70393
988         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
989         elements in field order.
991 2016-03-31  Marek Polacek  <polacek@redhat.com>
993         PR c/70297
994         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
996 2016-03-31  Richard Biener  <rguenther@suse.de>
998         PR c++/70430
999         * typeck.c (cp_build_binary_op): Fix operand order of vector
1000         conditional in truth op handling.
1002 2016-03-29  Jason Merrill  <jason@redhat.com>
1004         PR c++/70353
1005         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
1006         in constexpr functions.
1008 2016-03-28  Jason Merrill  <jason@redhat.com>
1010         PR c++/70422
1011         PR c++/64266
1012         PR c++/70353
1013         * decl.c, pt.c, constexpr.c: Revert last patch.
1015 2016-03-25  Jason Merrill  <jason@redhat.com>
1016             Martin LiÅ¡ka  <mliska@suse.cz>
1018         PR c++/64266
1019         PR c++/70353
1020         Core issue 1962
1021         * decl.c (cp_fname_init): Decay the initializer to pointer.
1022         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
1023         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1024         Don't call cp_finish_decl.
1025         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
1026         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
1027         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
1028         Handle DECL_VALUE_EXPR.
1030 2016-03-24  Jason Merrill  <jason@redhat.com>
1032         PR c++/70386
1033         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
1035         PR c++/70323
1036         * constexpr.c (cxx_eval_call_expression): Don't cache result if
1037         *overflow_p.
1039 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
1041         PR c++/62212
1042         * tree.c (build_cplus_array_type): Determine type-dependentess
1043         with uses_template_parms instead of with dependent_type_p.
1045 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1047         PR c++/70347
1048         * typeck.c (process_init_constructor_union): If the initializer
1049         is empty, use the union's NSDMI if it has one.
1051 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1053         PR c++/70332
1054         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
1055         NSDMI that's part of an aggregrate initialization.
1057 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
1059         PR c++/70001
1060         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
1061         for 1..max even for multi-dimensional arrays.  Call unshare_expr
1062         on it.
1064         PR c++/70323
1065         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
1066         on TREE_OVERFLOW constants.
1068         PR c++/70376
1069         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
1070         for OMP_TASKLOOP here.
1071         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
1072         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
1074 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
1075             Jason Merrill  <jason@redhat.com>
1076             Jakub Jelinek  <jakub@redhat.com>
1078         PR c++/69315
1079         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1080         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1081         (finish_function): Don't set or test them.
1082         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
1084 2016-03-23  Jason Merrill  <jason@redhat.com>
1086         PR c++/70344
1087         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
1089 2016-03-23  Marek Polacek  <polacek@redhat.com>
1091         PR c++/69884
1092         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
1094 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
1096         * call.c (build_conditional_expr_1): Always use original
1097         condition type for vector type checks and build.
1099 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1101         PR c++/70096
1102         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
1104 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1106         PR c++/70204
1107         * constexpr.c (non_const_var_error): Check
1108         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1110 2016-03-21  Richard Henderson  <rth@redhat.com>
1112         PR c++/70273
1113         * decl.c (notice_forced_label_r): New.
1114         (cp_finish_decl): Use it.
1116 2016-03-21  Jason Merrill  <jason@redhat.com>
1118         PR c++/70285
1119         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1121 2016-03-18  Jason Merrill  <jason@redhat.com>
1123         PR c++/70139
1124         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
1126         PR c++/70147
1127         * class.c (vptr_via_virtual_p): New.
1128         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
1129         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
1130         a vptr from any virtual base in a not-in-charge 'structor.
1132         * decl.c (build_clobber_this): Factor out of
1133         start_preparsed_function and begin_destructor_body.  Handle
1134         virtual bases better.
1136         * class.c (build_if_in_charge): Split out from build_base_path.
1137         * init.c (expand_virtual_init, expand_default_init): Use it.
1138         * call.c (build_special_member_call): Use it.
1140 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
1142         PR c++/70267
1143         * init.c (build_new_1): Complain and return error_mark_node
1144         if alloc_fn is not _Jv_AllocObject function returning pointer.
1146 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1148         PR c++/70205
1149         * search.c (adjust_result_of_qualified_name_lookup): Don't
1150         update the BASELINK_BINFO of DECL if the second call
1151         to lookup_base fails.
1153 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1155         PR c++/70218
1156         * parser.c (cp_parser_lambda_expression): Move call to
1157         pop_deferring_access_checks ahead of the call to
1158         cp_parser_end_tentative_firewall.
1160 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
1162         PR c++/70144
1163         * cp-tree.h (magic_varargs_p): Return int instead of bool.
1164         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
1165         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
1166         varargs.
1167         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
1168         if magic_varargs_p == 1, call decay_conversion
1169         instead of mark_type_use.  Don't store error_mark_node arguments to
1170         argarray, instead return error_mark_node.
1172         PR c++/70272
1173         * decl.c (begin_destructor_body): Don't insert clobber if
1174         is_empty_class (current_class_type).
1176 2016-03-17  Marek Polacek  <polacek@redhat.com>
1178         PR c++/70194
1179         * typeck.c (warn_for_null_address): New function.
1180         (cp_build_binary_op): Call it.
1182 2016-03-16  Jason Merrill  <jason@redhat.com>
1184         PR c++/70259
1185         * decl.c (start_preparsed_function): Don't clobber an empty base.
1187 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
1189         PR c++/70147
1190         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1191         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1193         PR c++/70147
1194         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1195         set in_base_initializer.
1197 2016-03-15  Marek Polacek  <polacek@redhat.com>
1199         PR c++/70209
1200         * tree.c (strip_typedefs): Call strip_typedefs again on the
1201         DECL_ORIGINAL_TYPE result.
1203 2016-03-15  Jason Merrill  <jason@redhat.com>
1205         PR c++/70095
1206         * pt.c (instantiate_decl): Fix call to variable_template_p.
1208         PR c++/70141
1209         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1211 2016-03-14  Casey Carter  <casey@carter.net>
1212             Jason Merrill  <jason@redhat.com>
1214         P0184R0: Generalizing the Range-Based For Loop
1215         * parser.c (cp_convert_range_for): Set the type of __end separately.
1216         (cp_parser_perform_range_for_lookup): Allow different begin/end
1217         types if they are comparable.
1219 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
1221         PR c++/70106
1222         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1223         processing_template_decl and EXPR is a SCOPE_REF.
1225 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
1226             Jakub Jelinek  <jakub@redhat.com>
1228         PR c++/70001
1229         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
1230         return value from cxx_eval_constant_expression from earlier
1231         elements if it is valid constant initializer requiring no
1232         relocations.
1234 2016-03-10  Marek Polacek  <polacek@redhat.com>
1236         PR c++/70153
1237         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1239 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
1241         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1242         when calling c_finish_omp_clauses.
1244 2016-03-08  Jason Merrill  <jason@redhat.com>
1246         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
1247         diagnostic for use of "concept".
1248         (cp_parser_requires_clause_opt): And "requires".
1249         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
1250         (cp_parser_explicit_template_declaration): Adjust.
1251         * Make-lang.in (check-c++-all): Add "concepts" to std list.
1253         P0036R0: Unary Folds and Empty Parameter Packs
1254         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1256 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
1258         PR c++/70135
1259         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1260         even after the last iteration of the loop.
1262         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1264 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
1266         PR c++/66786
1267         * pt.c (get_template_info): Handle PARM_DECL.
1268         (template_class_depth): Check DECL_P instead of
1269         VAR_OR_FUNCTION_DECL_P.
1271 2016-03-05  Jason Merrill  <jason@redhat.com>
1273         PR c++/67364
1274         * constexpr.c (cxx_eval_store_expression): Replace
1275         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1277 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
1279         PR c++/66786
1280         * pt.c (template_class_depth): Given a lambda type, iterate
1281         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
1282         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
1283         CP_DECL_CONTEXT.
1285 2016-03-04  Jason Merrill  <jason@redhat.com>
1287         PR c++/69203
1288         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
1289         * init.c (build_vec_delete_1): Set it.
1290         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
1292 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
1294         * decl.c (start_preparsed_function): Don't emit start clobber at the
1295         start of constructor clones.
1297         PR c++/70035
1298         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
1299         * decl.c (start_preparsed_function): Call
1300         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
1301         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
1302         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
1304 2016-03-04  Jason Merrill  <jason@redhat.com>
1306         PR c++/67364
1307         * constexpr.c (cxx_eval_component_reference): Further tweak.
1309         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
1310         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
1311         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
1312         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
1314         PR c++/70067
1315         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1316         same type.
1318 2016-03-03  Jason Merrill  <jason@redhat.com>
1320         * method.c (synthesized_method_walk): operator= can also be constexpr.
1322         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1323         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1325         PR c++/67164
1326         * pt.c (copy_template_args): New.
1327         (tsubst_pack_expansion): Use it.
1329         * call.c (build_aggr_conv): Use get_nsdmi.
1331         PR c++/51406
1332         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1334         PR c++/67364
1335         * constexpr.c (cxx_eval_component_reference): Just return an empty
1336         CONSTRUCTOR for an empty class.
1338 2016-03-01  Jason Merrill  <jason@redhat.com>
1340         PR c++/70036
1341         * parser.c (cp_parser_requires_clause): Call
1342         check_for_bare_parameter_packs.
1344         PR c++/51489
1345         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1346         the operands.
1348         PR c++/69995
1349         * constexpr.c (cxx_eval_call_expression): Unshare arg.
1350         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1351         [TARGET_EXPR]: Unshare init.
1353 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
1355         PR c++/68948
1356         PR c++/69961
1357         * pt.c (tsubst_baselink): Reinstate the check for an invalid
1358         constructor call.
1360 2016-02-28  Jason Merrill  <jason@redhat.com>
1362         PR c++/69995
1363         * constexpr.c (cxx_eval_store_expression): Unshare init.
1365 2016-02-26  Jason Merrill  <jason@redhat.com>
1367         PR c++/69958
1368         * pt.c (make_argument_pack): New.
1369         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1370         (tsubst_copy_and_build): Likewise.
1372 2016-02-25  Jason Merrill  <jason@redhat.com>
1374         PR c++/69889
1375         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
1376         * tree.c (build_aggr_init_expr): Set it.
1377         * semantics.c (simplify_aggr_init_expr): Check it.
1378         * cp-gimplify.c (cp_genericize_r): Don't walk into
1379         a call/aggr_init from a thunk.
1381         PR c++/69842
1382         * method.c (forward_parm): Handle parameter packs.
1383         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1385         PR c++/67364
1386         * constexpr.c (cxx_eval_component_reference): Don't complain about
1387         unevaluated empty classes.
1389         PR c++/68049
1390         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1392 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
1394         PR c++/69736
1395         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
1396         (maybe_undo_parenthesized_ref): Declare.
1397         * semantics.c (maybe_undo_parenthesized_ref): Split out from
1398         check_return_expr.
1399         (finish_call_expr): Use it.
1400         * typeck.c (check_return_expr): Use it.
1401         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
1402         REF_PARENTHESIZED_P flag.
1404 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
1406         PR c++/69922
1407         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1408         Avoid folding it.
1409         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
1410         tests.
1411         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
1412         unless they are folded into INTEGER_CST, error_mark_node or some
1413         comparison with NULL, avoid folding them and use either the original
1414         comparison or non-folded comparison of folded arguments.
1415         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
1416         comparison, don't fold the comparison right away.
1418 2016-02-24  Jason Merrill  <jason@redhat.com>
1420         PR c++/69323
1421         * friend.c (make_friend_class): Likewise.
1422         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1424 2016-02-24  Jason Merrill  <jason@redhat.com>
1426         PR c++/69323
1427         * pt.c (instantiate_class_template_1): Set
1428         processing_template_decl before substituting friend_type.
1430 016-02-24  Martin Sebor  <msebor@redhat.com>
1432         PR c++/69912
1433         * tree.c (build_ctor_subob_ref): Compare types' main variants
1434         instead of the types as they are.
1436 2016-02-24  Jason Merrill  <jason@redhat.com>
1438         * decl.c (start_preparsed_function): Condition ctor clobber on
1439         flag_lifetime_dse > 1.
1441         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1443 2016-02-19  Jason Merrill  <jason@redhat.com>
1445         PR c++/69743
1446         * call.c (remaining_arguments): No longer static.
1447         * cp-tree.h: Declare it.
1448         * pt.c (more_specialized_fn): Use it.
1450 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1451             Bernd Edlinger  <bernd.edlinger@hotmail.de>
1453         * Make-lang.in: Invoke gperf with -L C++.
1454         * cfns.gperf: Remove prototypes for hash and libc_name_p
1455         inlines.
1456         * cfns.h: Regenerated.
1457         * except.c (nothrow_libfn_p): Adjust.
1459 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1461         PR c++/69850
1462         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1463         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1465 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
1467         PR c++/68948
1468         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1469         call here.
1470         * semantics.c (finish_call_expr): Don't assume a constructor
1471         call is dependent if only the "this" pointer is dependent.  When
1472         building a constructor call, always use a dummy object.
1474 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1476         PR c++/69850
1477         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1478         condition.
1479         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1480         operators if folding preserved the binop, just with different
1481         arguments.
1483         PR c++/67767
1484         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1485         attr_spec is always single element chain, chain all the attributes
1486         properly together in the right order.
1488 2016-02-18  Jason Merrill  <jason@redhat.com>
1490         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
1491         mangle_decl.
1492         (mangle_decl): Call maybe_check_abi_tags for function scope.
1493         (mangle_guard_variable): Call maybe_check_abi_tags here.
1494         (write_guarded_var_name): Not here.
1496 2016-02-17  Jason Merrill  <jason@redhat.com>
1498         PR c++/65985
1499         * constexpr.c (build_constexpr_constructor_member_initializers):
1500         Handle an additional STATEMENT_LIST.
1502         PR c++/68585
1503         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1505         PR c++/68679
1506         * decl2.c (reset_type_linkage_2): Look through member templates.
1508 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
1510         PR c++/69850
1511         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1513 2016-02-17  Jason Merrill  <jason@redhat.com>
1515         PR c++/69842
1516         * method.c (forward_parm): Split out from...
1517         (add_one_base_init): ...here.
1518         * lambda.c (maybe_add_lambda_conv_op): Use it.
1520 2016-02-16  Jason Merrill  <jason@redhat.com>
1522         PR c++/10200
1523         PR c++/69753
1524         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1525         tree.c, typeck2.c: Revert earlier changes.
1526         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1527         non-type templates after -> or .
1529 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
1531         PR c/69835
1532         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1534 2016-02-16  Jason Merrill  <jason@redhat.com>
1536         PR c++/69657
1537         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1538         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
1539         * name-lookup.h: Adjust.
1541 2016-02-16  James Norris  <jnorris@codesourcery.com>
1543         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1544         * semantics.c (finish_omp_clauses): Add deviceptr checking.
1546 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1548         PR c++/69658
1549         * init.c (expand_default_init): Only call reshape_init
1550         in the direct-initialization from an initializer list case.
1552 2016-02-15  Jason Merrill  <jason@redhat.com>
1554         PR c++/69753
1555         * semantics.c (finish_call_expr): Implicit 'this' does not make
1556         the call dependent.
1557         * search.c (any_dependent_bases_p): Split out...
1558         * name-lookup.c (do_class_using_decl): ...from here.
1559         * call.c (build_new_method_call_1): Don't complain about missing object
1560         if there are dependent bases.  Tweak error.
1561         * tree.c (non_static_member_function_p): Remove.
1562         * pt.c (type_dependent_expression_p): A member template of a
1563         dependent type is dependent.
1564         * cp-tree.h: Adjust.
1566         PR c++/68890
1567         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1569 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1571         PR c++/69098
1572         * pt.c (lookup_and_finish_template_variable): New function,
1573         extracted from ...
1574         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1575         (tsubst_qualified_id): Consider that EXPR might be a variable
1576         template.
1577         * typeck.c (check_template_keyword): Don't emit an error
1578         if DECL is a variable template.
1580 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1582         * error.c: Spelling fixes - behaviour -> behavior and
1583         neighbour -> neighbor.
1584         * decl.c: Likewise.
1585         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1586         diagnostics.
1587         * init.c (build_delete): Likewise.
1589 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1591         PR c/69768
1592         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1593         arguments for -Waddress warning.  Fix up formatting.
1595 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1597         PR c++/68726
1598         * pt.c (lookup_template_class_1): Check tsubst return value for
1599         error_mark_node.
1601 2016-02-10  Jason Merrill  <jason@redhat.com>
1603         PR c++/68926
1604         * pt.c (resolve_nondeduced_context): Add complain parm.
1605         (do_auto_deduction): Pass it.
1606         * cvt.c (convert_to_void): Likewise.
1607         * decl.c (cp_finish_decl): Likewise.
1608         * init.c (build_new): Likewise.
1609         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1610         * semantics.c (finish_decltype_type): Likewise.
1611         * typeck.c (decay_conversion): Likewise.
1612         * cp-tree.h: Adjust declaration.
1613         * call.c (standard_conversion): Add complain parm, pass it along.
1614         (implicit_conversion): Pass it.
1616         PR c++/69657
1617         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1618         (lookup_name_real_1): Likewise.
1619         (remove_hidden_names): Handle non-functions too.
1621         PR c++/10200
1622         * parser.c (cp_parser_lookup_name): When looking for a template
1623         after . or ->, only consider class templates.
1624         (cp_parser_postfix_dot_deref_expression): Handle the current
1625         instantiation.  Remember a dependent object expression.
1626         * typeck2.c (build_x_arrow): Handle the current instantiation.
1628         * ptree.c (debug_tree): Implement for cp_expr.
1630 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1632         PR c++/69139
1633         * parser.c (cp_parser_simple_type_specifier): Make the check
1634         for disambiguating between an 'auto' placeholder and an implicit
1635         template parameter more robust.
1637 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1639         PR c++/69283
1640         PR c++/67835
1641         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1642         setting its TREE_USED flag.
1644 2016-02-08  Jason Merrill  <jason@redhat.com>
1646         PR c++/69657
1647         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1648         built-ins alone.
1650 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1652         PR c++/59627
1653         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1654         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1656 2016-02-08  Marek Polacek  <polacek@redhat.com>
1658         PR c++/69688
1659         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1660         Call clear_fold_cache.
1661         * cp-tree.h: Adjust declaration.
1662         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1663         rather than clear_cv_cache and clear_fold_cache.
1664         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1666 2016-02-08  Jason Merrill  <jason@redhat.com>
1668         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1669         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1670         (ocp_convert): Use *_maybe_fold.
1671         (cp_convert_to_pointer): Add dofold parameter.
1672         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1674 2016-02-05  Martin Sebor  <msebor@redhat.com>
1676         PR c++/69662
1677         * init.c (find_field_init): New function.
1678         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1679         at ends of structures special.
1681 2016-02-05  Jason Merrill  <jason@redhat.com>
1683         PR c++/68948
1684         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1685         make sure we've seen_error().
1687 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1689         PR c++/68948
1690         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1691         if lookup_fnfields returns NULL_TREE and the name being looked
1692         up has the form A::A.
1694 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1696         * constexpr.c (cxx_eval_binary_expression): Fold equality
1697         comparisons involving PTRMEM_CSTs.
1699 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1701         * class.c (find_flexarrays): Don't declare dom variable.
1702         (diagnose_flexarray): Likewise.
1704 2016-02-02  Martain Sebor  <msebor@redhat.com>
1706         PR c++/69251
1707         PR c++/69253
1708         PR c++/69290
1709         PR c++/69277
1710         PR c++/69349
1711         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1712         of a flexible array member for equality to null.
1713         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1714         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1715         (check_flexarrays): Same.
1716         * decl.c (compute_array_index_type): Avoid special case for flexible
1717         array members.
1718         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1719         array members.
1720         * error.c (dump_type_suffix): Revert changes introduced in r231665
1721         and rendered unnecessary by the changes above.
1722         * pt.c (tsubst):  Same.
1723         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1724         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1725         (process_init_constructor_array): Same.
1726         (process_init_constructor_record): Same.
1728 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1730         PR c++/69056
1731         * pt.c (try_one_overload): Handle comparing argument packs so
1732         that there is no conflict if we deduced more arguments of an
1733         argument pack than were explicitly specified.
1735 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1736             Jason Merrill  <jason@redhat.com>
1738         PR c++/68763
1739         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1740         function type if nothing is changing.
1742 2016-01-31  Jason Merrill  <jason@redhat.com>
1744         PR c++/69009
1745         * pt.c (partial_specialization_p, impartial_args): New.
1746         (instantiate_decl): Call impartial_args.
1748         * mangle.c (maybe_check_abi_tags): New.
1749         (write_guarded_var_name): Call it.
1750         (mangle_ref_init_variable): Call check_abi_tags.
1752         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1753         between template and instantiation.
1755 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1757         PR debug/66869
1758         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1759         function declarations.
1761 2016-01-29  Marek Polacek  <polacek@redhat.com>
1763         PR c++/69509
1764         PR c++/69516
1765         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1766         out of bound" error earlier.
1767         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1768         commentary.
1770 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1772         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1773         structure, update free_binding_level before the structure's
1774         level_chain field gets cleared, not after.
1776 2016-01-28  Jason Merrill  <jason@redhat.com>
1778         PR c++/67407
1779         * search.c (dfs_walk_once, dfs_walk_once_r)
1780         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1781         hash_set instead of BINFO_MARKED.
1782         (dfs_unmark_r): Remove.
1784 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1786         PR c++/24208
1787         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1788         (cp_lexer_debugging_p): Use it.
1789         (cp_lexer_start_debugging): Likewise.
1790         (cp_lexer_stop_debugging): Likewise.
1792 2016-01-27  Marek Polacek  <polacek@redhat.com>
1794         PR c/68062
1795         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1796         needed.  Add -Wsign-compare warning.
1798 2016-01-27  Ryan Burn  <contact@rnburn.com>
1800         PR cilkplus/69267
1801         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1802         superfluous post_p argument in call to
1803         cilk_gimplify_call_params_in_spawned_fn.
1805 2016-01-27  Marek Polacek  <polacek@redhat.com>
1807         PR c++/69379
1808         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1809         wrapped in NOP_EXPRs.
1811 2016-01-27  Martin Sebor  <msebor@redhat.com>
1813         PR c++/69317
1814         * mangle.c (mangle_decl): Reference the correct (saved) version
1815         of the ABI in -Wabi diagnostics.
1817 2016-01-27  Marek Polacek  <polacek@redhat.com>
1819         PR c++/69496
1820         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1821         elements of the array.
1823 2016-01-26  Jason Merrill  <jason@redhat.com>
1825         PR c++/68949
1826         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1827         (cxx_eval_call_expression): Don't look through clones.
1828         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1829         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1830         maybe-in-charge *tor.
1832 2016-01-26  Jason Merrill  <jason@redhat.com>
1834         PR c++/68782
1835         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1836         and TREE_SIDE_EFFECTS.
1837         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1838         verify_constructor_flags.
1840 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1842         PR c++/68357
1843         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1844         return error_mark_node instead of building trees with error_mark_node
1845         operands.
1847 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1849         PR other/69006
1850         * error.c (print_instantiation_partial_context_line): Add missing
1851         newlines from output for the t == NULL case.
1852         (print_instantiation_partial_context): Remove call to pp_newline.
1854 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
1856         Revert:
1857         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1859         PR c++/11858
1860         PR c++/24663
1861         PR c++/24664
1862         * decl.c (grokdeclarator): Don't decay array parameter type to
1863         a pointer type if it's dependent.
1864         (grokparms): Invoke strip_top_quals instead of directly invoking
1865         cp_build_qualified_type.
1866         * pt.c (decay_dependent_array_parm_type): New static function.
1867         (type_unification_real): Call decay_dependent_array_parm_type
1868         to decay a dependent array parameter type to its corresponding
1869         pointer type before unification.
1870         (more_specialized_fn): Likewise.
1871         (get_bindings): Likewise.
1872         * tree.c (cp_build_qualified_type): Trivial typofix in
1873         documentation.
1875 2016-01-23  Martin Sebor  <msebor@redhat.com>
1877         PR c++/58109
1878         PR c++/69022
1879         * decl2.c (is_late_template_attribute): Handle dependent argument
1880         to attribute align and attribute vector_size.
1882 2016-01-21  Jason Merrill  <jason@redhat.com>
1884         PR c++/69392
1885         * lambda.c (lambda_capture_field_type): Handle 'this' specially
1886         for init-capture, too.
1888         PR c++/65687
1889         * decl.c (type_is_deprecated): Don't look into a typedef.
1891         PR c++/40751
1892         PR c++/64987
1893         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1895         PR c++/43407
1896         * decl.c (start_enum): Add attributes parameter.
1897         * parser.c (cp_parser_enum_specifier): Pass it.
1898         * pt.c (lookup_template_class_1): Pass it.
1899         * cp-tree.h: Adjust.
1901 2016-01-19  Jason Merrill  <jason@redhat.com>
1903         PR c++/59759
1904         * pt.c (convert_template_argument): Handle VAR_DECL properly.
1906 2016-01-19  Marek Polacek  <polacek@redhat.com>
1908         PR c++/68586
1909         * constexpr.c (clear_cv_cache): New.
1910         * cp-gimplify.c (clear_fold_cache): New.
1911         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1912         * decl.c (finish_enum_value_list): Call them.
1914         PR c++/68965
1915         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1917 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1919         PR c++/11858
1920         PR c++/24663
1921         PR c++/24664
1922         * decl.c (grokdeclarator): Don't decay array parameter type to
1923         a pointer type if it's dependent.
1924         (grokparms): Invoke strip_top_quals instead of directly invoking
1925         cp_build_qualified_type.
1926         * pt.c (decay_dependent_array_parm_type): New static function.
1927         (type_unification_real): Call decay_dependent_array_parm_type
1928         to decay a dependent array parameter type to its corresponding
1929         pointer type before unification.
1930         (more_specialized_fn): Likewise.
1931         (get_bindings): Likewise.
1932         * tree.c (cp_build_qualified_type): Trivial typofix in
1933         documentation.
1935 2016-01-18  Jason Merrill  <jason@redhat.com>
1937         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1939         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1941         PR c++/68767
1942         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
1943         (contains_label_1, contains_label_p): Remove.
1945 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1947         PR c++/69091
1948         * pt.c (type_dependent_expression_p): For a function template
1949         specialization, a type is dependent iff any of its template
1950         arguments are.
1952 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1954         * cp-array-notation.c (cp_expand_cond_array_notations): Return
1955         error_mark_node only if find_rank failed, not if it was
1956         successful.
1958 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1960         PR c++/68936
1961         * tree.c (build_min_non_dep_call_vec): Don't retain the
1962         KOENIG_LOOKUP_P flag of the non-dependent expression that's
1963         been built.
1964         (build_min_non_dep_op_overload): Instead, do it here.
1966 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
1968         PR bootstrap/68271
1969         * parser.h (cp_token): Remove pragma_kind field.  Add comment
1970         with number of unused bits.
1971         * parser.c (eof_token): Remove pragma_kind field initializer.
1972         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1973         field, don't clear CPP_PRAGMA u.value.
1974         (cp_parser_pragma_kind): New function.
1975         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1976         cp_parser_omp_construct, cp_parser_initial_pragma,
1977         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1978         pragma_kind field.
1980 2016-01-15  Jason Merrill  <jason@redhat.com>
1982         PR c++/68847
1983         * call.c (build_cxx_call): Use fold_non_dependent_expr.
1985         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1986         value.
1988         PR c++/69257
1989         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1990         array/function-to-pointer conversion.  Call
1991         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1992         * call.c (convert_like_real): Print call context if
1993         decay_conversion errors.
1995 2016-01-14  Tom de Vries  <tom@codesourcery.com>
1997         PR tree-optimization/68773
1998         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1999         set force_output.
2001 2016-01-14  Jason Merrill  <jason@redhat.com>
2003         PR c++/69261
2004         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
2006 2016-01-12  Marek Polacek  <polacek@redhat.com>
2008         PR c++/68979
2009         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
2010         error_at and adjust the return value.
2012 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
2014         PR objc++/68511
2015         PR c++/69213
2016         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
2017         GS_ERROR whenever seen_error (), only if *expr_p contains
2018         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
2020         PR c++/66808
2021         PR c++/69000
2022         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
2024 2016-01-11  Jason Merrill  <jason@redhat.com>
2026         PR c++/69131
2027         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
2028         (process_subob_fn): Likewise.  Don't consider triviality if true.
2029         (synthesize_method_walk): Pass it.
2031 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
2033         PR c++/68795
2034         * parser.c (cp_parser_postfix_expression): Initialize
2035         close_paren_loc to UNKNOWN_LOCATION; only use it if
2036         it has been written to by
2037         cp_parser_parenthesized_expression_list.
2038         (cp_parser_parenthesized_expression_list): Document the behavior
2039         with respect to the CLOSE_PAREN_LOC param.
2041 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
2043         PR c++/69211
2044         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
2045         folded operands have side-effects, but folding changed any of them,
2046         build a new tree with the folded operands instead of returning the
2047         unfolded tree.
2049 2016-01-09  Marek Polacek  <polacek@redhat.com>
2051         PR c++/69113
2052         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
2054 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
2056         PR c++/69164
2057         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
2059 2016-01-08  Jason Merrill  <jason@redhat.com>
2061         PR c++/69158
2062         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
2063         in completion.
2065 2016-01-08  Marek Polacek  <polacek@redhat.com>
2067         PR c++/68449
2068         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
2070 2016-01-08  Jason Merrill  <jason@redhat.com>
2072         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
2073         workaround.
2075         PR c++/68983
2076         PR c++/67557
2077         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
2078         TREE_ADDRESSABLE type.
2080         PR c++/68983
2081         PR c++/67557
2082         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2084 2016-01-05  Nathan Sidwell  <nathan@acm.org>
2086         PR c++/58583
2087         * pt.c (build_non_dependent_expr): Don't try a checking fold when
2088         parsing an nsdmi.
2090 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
2092         Update copyright years.
2094 Copyright (C) 2016 Free Software Foundation, Inc.
2096 Copying and distribution of this file, with or without modification,
2097 are permitted in any medium without royalty provided the copyright
2098 notice and this notice are preserved.