PR c++/71306 - bogus -Wplacement-new with an array element
[official-gcc.git] / gcc / cp / ChangeLog
blob266ca0adcbe6097577f434d5a08d3c98045a2b92
1 2016-05-27  Martin Sebor  <msebor@redhat.com>
3         PR c++/71306
4         * init.c (warn_placement_new_too_small): Handle placement new arguments
5         that are elements of arrays more carefully.  Remove a pointless loop.
7 2016-05-30  Jakub Jelinek  <jakub@redhat.com>
9         PR c++/71349
10         * parser.c (cp_parser_omp_for): Don't disallow nowait clause
11         when combined with target construct.
12         (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
13         to cp_parser_omp_all_clauses.
15 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
17         PR c++/71238
18         * lex.c (unqualified_name_lookup_error): Take a location too.
19         (unqualified_fn_lookup_error): Take a cp_expr.
20         * cp-tree.h (unqualified_name_lookup_error,
21         unqualified_fn_lookup_error): Adjust declarations.
22         * semantics.c (perform_koenig_lookup): Adjust
23         unqualified_fn_lookup_error call, pass the location of
24         the identifier too as part of a cp_expr.
26 2016-05-30  Paolo Carlini  <paolo.carlini@oracle.com>
28         PR c++/71099
29         * parser.c (cp_parser_function_specifier_opt): Use current_class_type
30         to improve the diagnostic about wrong uses of 'virtual'.
32 2016-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
34         PR c++/71105
35         * lambda.c (maybe_add_lambda_conv_op): Early return also when
36         LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
38 2016-05-28  Ville Voutilainen  <ville.voutilainen@gmail.com>
40         Revert:
41         PR c++/69855
42         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
43         decls into the global scope after stripping template bits
44         and setting DECL_ANTICIPATED.
46 2016-05-27  Paolo Carlini  <paolo.carlini@oracle.com>
48         PR c++/60385
49         * name-lookup.c (push_namespace): Return bool, false when pushdecl
50         fails.
51         * name-lookup.h (push_namespace): Adjust declaration.
52         * parser.c (cp_parser_namespace_definition): Check push_namespace
53         return value.
55 2016-05-27  Ville Voutilainen  <ville.voutilainen@gmail.com>
57         PR c++/69855
58         * name-lookup.c (pushdecl_maybe_friend_1): Push local function
59         decls into the global scope after stripping template bits
60         and setting DECL_ANTICIPATED.
62 2016-05-26  Jakub Jelinek  <jakub@redhat.com>
64         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_SCHEDULE>: Warn
65         if OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
67 2016-05-26  Patrick Palka  <ppalka@gcc.gnu.org>
69         PR c++/70822
70         PR c++/70106
71         * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
72         SCOPE_REFs too.
73         * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
74         on the qualified_id then propagate it to the resulting
75         expression.
76         (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
77         too.
78         * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
79         its REF_PARENTHESIZED_P flag.
81 2016-05-25  Jason Merrill  <jason@redhat.com>
83         PR c++/71173
84         PR c++/70522
85         * cp-tree.h (enum tag_types): Add scope_type.
86         * parser.c (cp_parser_class_name): Use scope_type.
87         (prefer_type_arg): Handle scope_type.
88         (cp_parser_lookup_name): Use prefer_type_arg.
89         * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
90         int prefer_type, use lookup_flags.
91         * name-lookup.h: Adjust.
93 2016-05-24  Cesar Philippidis  <cesar@codesourcery.com>
95         * parser.c (cp_parser_oacc_declare): Add support for
96         GOMP_MAP_FIRSTPRIVATE_POINTER.
97         * semantics.c (handle_omp_array_sections_1): Replace bool is_omp
98         argument with enum c_omp_region_type ort.  Don't privatize OpenACC
99         non-static members.
100         (handle_omp_array_sections): Replace bool is_omp argument with enum
101         c_omp_region_type ort.  Update call to handle_omp_array_sections_1.
102         (finish_omp_clauses): Add specific errors and warning messages for
103         OpenACC.  Use firsrtprivate pointers for OpenACC subarrays.  Update
104         call to handle_omp_array_sections.
106 2016-05-24  Jason Merrill  <jason@redhat.com>
108         PR c++/70584
109         * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
110         returns a decl.
111         (cp_fold) [INDIRECT_REF]: Don't fold to an rvalue.
113 2016-05-24  Martin Sebor  <msebor@redhat.com>
115         PR c++/71147
116         * decl.c (layout_var_decl, grokdeclarator): Use complete_or_array_type_p.
117         * pt.c (instantiate_class_template_1): Try to complete the element
118         type of a flexible array member.
119         (can_complete_type_without_circularity): Handle arrays of unknown bound.
120         * typeck.c (complete_type): Also complete the type of the elements of
121         arrays with an unspecified bound.
123 2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
125         PR c++/69872
126         * typeck2.c (check_narrowing): Check pedwarn return value.
128 2016-05-24  Jakub Jelinek  <jakub@redhat.com>
130         PR c++/71257
131         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
132         For OMP_CLAUSE_LINEAR_REF don't require type to be
133         integral or pointer.
135 2016-05-24  Richard Biener  <rguenther@suse.de>
137         PR middle-end/70434
138         PR c/69504
139         * expr.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
140         * constexpr.c (cxx_eval_array_reference): Handle indexed
141         vectors.
142         * typeck.c (cp_build_array_ref): Adjust.
144 2016-05-23  Jason Merrill  <jason@redhat.com>
146         PR c++/70344
147         * constexpr.c (cxx_eval_call_expression): Check for
148         fun == current_function_decl again.
150         PR c++/70584
151         * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call
152         maybe_undo_parenthesized_ref.
154         PR c++/70735
155         * pt.c (tsubst_copy): Just return a local variable from
156         non-template context.  Don't call rest_of_decl_compilation for
157         duplicated static locals.
158         (tsubst_decl): Set DECL_CONTEXT of local static from another
159         function.
161 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
163         PR c++/70972
164         * method.c (forward_parm): Use cp_build_reference_type.
166 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
168         PR c++/69095
169         * parser.c (cp_parser_initializer): Use check_for_bare_parameter_packs.
171 2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
173         * pt.c (check_for_bare_parameter_packs): Improve error message
174         location for expressions.
176 2016-05-20  Nathan Sidwell  <nathan@acm.org>
178         * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
179         ... goto.
180         (cxx_eval_call_expression): Fix comment grammar.
182 2016-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
184         PR c++/70572
185         * decl.c (cp_finish_decl): Check do_auto_deduction return value
186         and return immediately in case of erroneous code.
188 2016-05-19  Marek Polacek  <polacek@redhat.com>
190         PR c++/71075
191         * pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.
193 2016-05-19  Jason Merrill  <jason@redhat.com>
195         PR c++/10200
196         * pt.c (fn_type_unification): Add outer template args if needed.
197         (type_unification_real): Handle getting full args.
199 2016-05-19  David Malcolm  <dmalcolm@redhat.com>
201         PR c++/71184
202         * parser.c (cp_parser_operator): For array new/delete, check that
203         cp_parser_require returned a non-NULL token before dereferencing
204         it.
206 2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
208         * decl.c (finish_enum_value_list): Use the specified mode.
210 2016-05-18  Jason Merrill  <jason@redhat.com>
212         * pt.c (value_dependent_expression_p): Tweak new cases to better
213         match the wording in the standard.
215 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
217         PR c++/69793
218         * parser.c (cp_parser_template_id): Don't call cp_lexer_peek_nth_token
219         when the previous cp_lexer_peek_token returns CPP_EOF.
221 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
223         PR c++/70466
224         * call.c (convert_like_real): Check that we are actually converting
225         from an init list.
227 2016-05-16  Matthew Wahab  <matthew.wahab@arm.com>
229         * decl.c (grokdeclarator): Remove errmsg and use of
230         targetm.invalid_return_type.
231         (grokparms): Remove errmsg and use of
232         targetm.invalid_parameter_type.
234 2016-05-13  Jason Merrill  <jason@redhat.com>
236         PR c++/10200
237         PR c++/69753
238         * pt.c (tsubst_decl): Use uses_template_parms.
239         (instantiate_template_1): Handle non-dependent calls in templates.
240         (value_dependent_expression_p): Handle BASELINK, FUNCTION_DECL.
241         (type_dependent_expression_p): Only consider innermost template args.
242         (dependent_template_arg_p): Check enclosing class of a template here.
243         (dependent_template_p): Not here.
244         (type_dependent_object_expression_p): New.
245         * typeck.c (finish_class_member_access_expr): Use it.
246         * parser.c (cp_parser_postfix_expression): Use it.
247         (cp_parser_postfix_dot_deref_expression): Use it.  Use comptypes
248         to detect the current instantiation.
249         (cp_parser_lookup_name): Really implement DR 141.
250         * search.c (lookup_field_r): Prefer a dependent using-declaration.
251         (any_dependent_bases_p): Split out from...
252         * name-lookup.c (do_class_using_decl): ...here.
253         * call.c (build_new_method_call_1): Use it.
254         * semantics.c (finish_call_expr): 'this' doesn't make a call dependent.
255         * tree.c (non_static_member_function_p): Remove.
256         * typeck2.c (build_x_arrow): Use dependent_scope_p.
258         * parser.c (cp_parser_postfix_dot_deref_expression): Use
259         complete_type_or_else for unknown_type_node, too.
261 2016-05-12  Marek Polacek  <polacek@redhat.com>
263         PR c/70756
264         * call.c (build_new_op_1): Pass LOC to cp_build_modify_expr.
265         * cp-tree.h (cp_build_modify_expr): Update declaration.
266         (cxx_incomplete_type_error, cxx_incomplete_type_diagnostic): New inline
267         overloads.
268         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Pass INPUT_LOCATION to
269         cp_build_modify_expr.
270         * decl2.c (set_guard): Likewise.
271         (handle_tls_init): Likewise.
272         * init.c (perform_member_init): Likewise.
273         (expand_virtual_init): Likewise.
274         (build_new_1): Likewise.
275         (build_vec_delete_1): Likewise.
276         (get_temp_regvar): Likewise.
277         (build_vec_init): Likewise.
278         * method.c (do_build_copy_assign): Likewise.
279         (assignable_expr): Likewise.
280         * semantics.c (finish_omp_for): Likewise.
281         * typeck.c (cp_build_binary_op): Pass LOCATION to pointer_diff and
282         cp_pointer_int_sum.
283         (cp_pointer_int_sum): Add location parameter.  Pass it down to
284         pointer_int_sum.
285         (pointer_diff): Add location parameter.  Use it.
286         (build_modify_expr): Pass location down to cp_build_modify_expr.
287         (cp_build_modify_expr): Add location parameter.  Use it.
288         (build_x_modify_expr): Pass location down to cp_build_modify_expr.
289         * typeck2.c (cxx_incomplete_type_diagnostic,
290         cxx_incomplete_type_error): Add location parameter.
292 2016-05-11  Marek Polacek  <polacek@redhat.com>
294         PR c++/71024
295         * decl.c (duplicate_decls): Call diagnose_mismatched_decls.
297 2016-05-05  Jakub Jelinek  <jakub@redhat.com>
299         * parser.c (cp_parser_selection_statement): For RID_SWITCH,
300         pass if_p instead of NULL to cp_parser_implicitly_scoped_statement.
302 2016-05-04  Marek Polacek  <polacek@redhat.com>
304         * parser.c (cp_parser_selection_statement): Replace OPT_Wparentheses
305         with OPT_Wdangling_else.
307 2016-05-03  Martin Sebor  <msebor@redhat.com>
309         PR c++/66561
310         * tree.c (builtin_valid_in_constant_expr_p): Treat BUILT_IN_FILE,
311         BUILT_IN_FUNCTION, and BUILT_IN_LINE as constant expressions.
313 2016-05-03  Marek Polacek  <polacek@redhat.com>
315         PR c/70859
316         * call.c (build_cxx_call): Pass location and vNULL down to
317         check_builtin_function_arguments.
319 2016-05-03  Richard Biener  <rguenther@suse.de>
321         * Make-lang.in (cc1plus-checksum.c): For stage-final re-use
322         the checksum from the previous stage.
324 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
326         PR c++/62314
327         * typeck.c (finish_class_member_access_expr): When
328         giving a hint about a possibly-misspelled member name,
329         add a fix-it replacement hint.
331 2016-05-02  Cesar Philippidis  <cesar@codesourcery.com>
333         * cp-tree.h (finish_omp_clauses): Update prototype.
334         * parser.c (cp_parser_oacc_all_clauses): Update call to
335         finish_omp_clauses.
336         (cp_parser_omp_all_clauses): Likewise.
337         (cp_parser_omp_for_loop): Likewise.
338         (cp_omp_split_clauses): Likewise.
339         (cp_parser_oacc_cache): Likewise.
340         (cp_parser_oacc_loop): Likewise.
341         (cp_parser_omp_declare_target):
342         (cp_parser_cilk_simd_all_clauses): Likewise.
343         (cp_parser_cilk_for): Likewise.
344         * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
345         arguments with enum c_omp_region_type ort.
346         (tsubst_omp_clauses): Update calls to finish_omp_clauses.
347         (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
348         (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
349         (tsubst_expr): Update calls to tsubst_omp_clauses.
350         * semantics.c (finish_omp_clauses): Replace bool arguments
351         allow_fields, declare_simd, and is_cilk with bitmask ort.
352         (finish_omp_for): Update call to finish_omp_clauses.
354 2016-05-02  David Malcolm  <dmalcolm@redhat.com>
356         PR c++/62314
357         * parser.c (cp_parser_class_head): Capture the start location;
358         use it to emit a fix-it insertion hint when complaining
359         about missing "template <> " in explicit specializations.
361 2016-05-02  Richard Sandiford  <richard.sandiford@arm.com>
363         * init.c (build_new_1): Use shift operators instead of wi:: shifts.
365 2016-05-02  Richard Biener  <rguenther@suse.de>
367         * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
368         anonymous VLAs.
370 2016-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
372         PR c++/66644
373         * class.c (check_field_decl): Remove final int* parameter, change
374         the return type to bool; fix logic in order not to reject multiple
375         initialized fields in anonymous struct.
376         (check_field_decls): Adjust call.
378 2016-04-29  Cesar Philippidis  <cesar@codesourcery.com>
380         PR middle-end/70626
381         * parser.c (cp_parser_oacc_loop): Don't augment mask with
382         OACC_LOOP_CLAUSE_MASK.
383         (cp_parser_oacc_kernels_parallel): Update call to
384         c_oacc_split_loop_clauses.
386 2016-04-28  Jason Merrill  <jason@redhat.com>
388         Implement C++17 [[nodiscard]] attribute.
389         PR c++/38172
390         PR c++/54379
391         * parser.c (cp_parser_std_attribute): Handle [[nodiscard]].
392         * tree.c (handle_nodiscard_attribute): New.
393         (cxx_attribute_table): Add [[nodiscard]].
394         * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New.
395         (maybe_warn_nodiscard): New.
396         (convert_to_void): Call it.
398         * cvt.c (cp_get_callee): New.
399         * constexpr.c (get_function_named_in_call): Use it.
400         * cxx-pretty-print.c (postfix_expression): Use it.
401         * except.c (check_noexcept_r): Use it.
402         * method.c (check_nontriv): Use it.
403         * tree.c (build_aggr_init_expr): Use it.
404         * cp-tree.h: Declare it.
406 2015-04-27  Ryan Burn  <contact@rnburn.com>
407             Jeff Law  <law@redhat.com>
409         PR c++/69024
410         PR c++/68997
411         * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
412         instead of cilk_detect_spawn_and_unwrap.
413         * cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
414         (find_spawn): New.
415         (cilk_cp_detect_spawn_and_unwrap): New.
416         * lambda.c: Include cp-cilkplus.h.
417         * parser.c: Include cp-cilkplus.h.
418         * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into...
419         * cp-cilkpus.h: New file.
421 2016-04-27  Nathan Sidwell  <nathan@acm.org>
423         * constexpr.c (get_fundef_copy): Use the original function for
424         non-recursive evaluations.
425         (save_fundef_copy): Always expect a slot to be available.
427 2016-04-27  Bernd Schmidt  <bschmidt@redhat.com>
429         * parser.c (cp_parser_postfix_expression): Call
430         warn_for_memset instead of warning directly here.
432 2016-04-26  Patrick Palka  <ppalka@gcc.gnu.org>
434         PR c++/70241
435         * decl.c (build_enumerator): Set current_access_specifier when
436         declaring an enumerator belonging to an in-class enumeration.
437         * parser.c (cp_parser_check_access_in_redecleration): Also
438         consider in-class enumerations.
440 2016-04-26  Marek Polacek  <polacek@redhat.com>
442         PR c++/70744
443         * call.c (build_conditional_expr_1): Call cp_stabilize_reference
444         instead of stabilize_reference.
445         (build_over_call): Likewise.
446         * cp-tree.h (cp_stabilize_reference): Declare.
447         * tree.c (cp_stabilize_reference): New function.
448         * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
449         stabilize_reference.
450         (unary_complex_lvalue): Likewise.
451         (cp_build_modify_expr): Likewise.
453 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
455         PR bootstrap/70704
456         * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
457         just flag_checking.
459 2016-04-25  Jason Merrill  <jason@redhat.com>
461         * tree.c (std_attribute_table): New.
462         (init_tree): Register it.
464 2016-04-22  Jason Merrill  <jason@redhat.com>
466         * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
468 2016-04-21  Patrick Palka  <ppalka@gcc.gnu.org>
470         * name-lookup.c (free_saved_scope): New free list of saved_scope
471         structures.
472         (push_to_top_level): Attempt to reuse a saved_scope struct
473         from free_saved_scope instead of allocating a new one each time.
474         (pop_from_top_level_1): Chain the now-unused saved_scope structure
475         onto free_saved_scope.
477 2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
479         PR c++/70540
480         * semantics.c (process_outer_var_ref): Unconditionally return
481         error_mark_node when mark_used returns false.
483 2016-04-21  Marek Polacek  <polacek@redhat.com>
485         PR c++/70513
486         * parser.c (cp_parser_enum_specifier): Check and possibly error for
487         extra qualification.
489 2016-04-20  Nathan Sidwell  <nathan@acm.org>
491         PR c++/55635
492         * init.c (build_vec_delete_1): Protect operator delete call in try
493         finally.
494         (build_delete): Likewise.
495         * optimize.c (build_delete_destructor_body): Likewise.
497 2016-04-20  Ilya Verbin  <ilya.verbin@intel.com>
499         PR c++/69363
500         * cp-tree.h (finish_omp_clauses): Add new default argument.
501         * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
502         instead of c_finish_cilk_clauses.
503         * semantics.c (finish_omp_clauses): Add new argument.  Allow
504         floating-point variables in the linear clause for Cilk Plus.
506 2016-04-20  Nathan Sidwell  <nathan@acm.org>
508         * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
509         TARGET_EXPR.
511 2016-04-19  Jason Merrill  <jason@redhat.com>
513         PR c++/66543
514         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
515         * pt.c (make_pack_expansion): Call mark_exp_read.
516         * semantics.c (finish_id_expression): Call mark_type_use in
517         unevaluated context.
519         DR 2137
520         * call.c (implicit_conversion): If we choose a copy constructor
521         for list-initialization from the same type, the conversion is an
522         exact match.
524         * constexpr.c (breaks): Handle EXIT_EXPR.
525         (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
526         (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
527         of COMPOUND_EXPR.
529         PR c++/68206
530         PR c++/68530
531         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
532         and GOTO_EXPR.
534         * pt.c (tsubst_expr): Remove shadowing declaration.
535         (tsubst_pack_expansion): Add assert.
537         * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
539         PR c++/70522
540         * name-lookup.c (qualified_lookup_using_namespace): Look through
541         hidden names.
543 2016-04-18  Michael Matz  <matz@suse.de>
545         * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
546         (layout_class_type): Ditto.
547         (build_base_field): Use SET_DECL_ALIGN.
548         (fixup_attribute_variants): Use SET_TYPE_ALIGN.
549         * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
550         (record_unknown_type): Use SET_TYPE_ALIGN.
551         (cxx_init_decl_processing): Ditto.
552         (copy_type_enum): Ditto.
553         (grokfndecl): Use SET_DECL_ALIGN.
554         (copy_type_enum): Use SET_TYPE_ALIGN.
555         * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
556         (tsubst): Ditto.
557         * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
558         * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
559         * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
560         * rtti.c (emit_tinfo_decl): Ditto.
562 2016-04-18  Jason Merrill  <jason@redhat.com>
564         PR c++/70690
565         PR c++/70528
566         * class.c (type_maybe_constexpr_default_constructor): New.
567         (type_has_constexpr_default_constructor): Revert.
569 2016-04-16  Sandra Loosemore  <sandra@codesourcery.com>
571         PR target/1078
573         * tree.c (cxx_attribute_table): Remove "com_interface" entry.
574         (handle_com_interface_attribute): Delete.
576 2016-04-15  Jason Merrill  <jason@redhat.com>
578         PR c++/70685
579         * constexpr.c (get_fundef_copy): Handle null *slot.
581         PR c++/70505
582         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
583         unknown_type_node, too.
585 2016-04-15  Jason Merrill  <jason@redhat.com>
586             Nathan Sidwell  <nathan@acm.org>
588         PR c++/70594
589         * constexpr.c (constexpr_call_table): Preserve in GC.
590         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
591         (fundef_copies_table): Preserve in GC. Change to pointer to
592         tree->tree hash.
593         (maybe_initialize_fundef_copies_table): Adjust.
594         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
595         (save_fundef_copy): Adjust for a TREE_LIST.
596         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
597         (fini_constexpr): New.
598         * cp-tree.h (fini_constexpr): Declare.
599         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
601 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
603         PR c/70436
604         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
605         where needed.
606         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
607         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
608         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
609         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
610         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
611         cp_parser_statement.
612         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
613         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
614         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
615         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
616         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
617         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
618         cp_parser_omp_taskloop, cp_parser_omp_construct,
619         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
620         Add IF_P argument, pass it down where needed.
621         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
622         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
623         calls.
625 2016-04-14  Jason Merrill  <jason@redhat.com>
627         PR c++/70494
628         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
629         * typeck2.c (split_nonconstant_init_1): Use it.
631         PR c++/70528
632         * class.c (type_has_constexpr_default_constructor): Return true
633         for an implicitly declared constructor.
635         PR c++/70622
636         * parser.c (cp_parser_init_declarator): Add auto_result parm.
637         (cp_parser_simple_declaration): Pass it.
638         (strip_declarator_types): New.
640         PR c++/70543
641         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
642         initializer also makes the variable value-dependent.
644         PR c++/70648
645         * constexpr.c (cxx_eval_store_expression): Also copy
646         CONSTRUCTOR_NO_IMPLICIT_ZERO.
648 2016-04-14  Martin Sebor  <msebor@redhat.com>
650         PR c++/69517
651         PR c++/70019
652         PR c++/70588
653         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
655 2016-04-14  Jason Merrill  <jason@redhat.com>
657         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
658         parameter ABI change.
660 2016-04-13  Martin Sebor  <msebor@redhat.com>
662         PR c++/69517
663         PR c++/70019
664         PR c++/70588
665         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
666         functions.
667         * decl.c (check_initializer, cp_finish_decl): Call them.
668         (reshape_init_r): Reject incompletely braced intializer-lists
669         for VLAs.
670         * init.c (throw_bad_array_length, build_vla_check)
671         (build_vla_size_check, build_vla_init_check): Define new functions.
672         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
673         to detect a VLA.
674         (store_init_value): Same.
676 2016-04-13  Jason Merrill  <jason@redhat.com>
678         Warn about empty parameter ABI with -Wabi=9.
679         * call.c (empty_class_msg, mark_for_abi_warning)
680         (warn_empty_class_abi): New.
681         (build_call_a): Use them.
682         * decl.c (store_parm_decls): Use mark_for_abi_warning.
683         * error.c (pp_format_to_string): New.
685         Pass empty class parameters like C.
686         * call.c (pass_as_empty_struct, empty_class_arg): New.
687         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
688         (build_call_a): Use empty_class_arg.
689         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
690         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
692 2016-04-13  Jason Merrill  <jason@redhat.com>
694         PR c++/70627
695         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
697 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
699         PR c++/70635
700         * pt.c (resolve_typename_type): Fix typos in infinite recursion
701         avoidance mechanism.
703 2016-04-13  Jason Merrill  <jason@redhat.com>
705         PR c++/70634
706         * pt.c (instantiation_dependent_uneval_expression_p): Split out
707         from instantiation_dependent_expression_p.
708         (value_dependent_expression_p): Use it for unevaluated operands.
709         (instantiation_dependent_r): Don't check value-dependence.
710         (instantiation_dependent_expression_p): Check
711         value-dependence of the expression as a whole.
712         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
713         * semantics.c (finish_decltype_type): Use it.
715         * constexpr.c (potential_nondependent_constant_expression): New.
716         (potential_nondependent_static_init_expression): New.
717         (maybe_constant_value_1, fold_non_dependent_expr)
718         (maybe_constant_init): Use them.
719         * pt.c (instantiate_non_dependent_expr_sfinae)
720         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
721         them.
722         * cp-tree.h: Declare them.
724 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
726         PR c++/70594
727         * decl.c (pop_labels_1): Removed.
728         (note_label, sort_labels): New functions.
729         (pop_labels): During named_labels traversal, just push the slot
730         pointers into a vector, then qsort it by DECL_UID and only then
731         call pop_label and chain it into BLOCK_VARS.
733 2016-04-13  Jason Merrill  <jason@redhat.com>
735         PR c++/70615
736         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
737         (cp_gimplify_expr): Not here.
739 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
741         PR c++/70610
742         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
743         recurse into it.
744         * typeck.c (build_x_conditional_expr): Unconditionally remember
745         that the result is an lvalue or xvalue.
747 2016-04-12  Jason Merrill  <jason@redhat.com>
749         * class.c (is_really_empty_class): A zero-length array is empty.
750         An unnamed bit-field doesn't make a class non-empty.
752 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
754         PR c++/68722
755         * parser.c (cp_parser_cache_defarg): When file ends in default
756         argument simply return error_mark_node.
758 2016-04-12  Nathan Sidwell  <nathan@acm.org>
760         PR c++/70501
761         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
762         similarly to PMF.
764 2016-04-11  Jason Merrill  <jason@redhat.com>
766         * mangle.c (decl_is_template_id): The template itself counts as a
767         template-id.
769 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
771         PR c++/70590
772         PR c++/70452
773         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
774         on the result if it's not a CONSTRUCTOR.
776 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
778         PR c++/70452
779         * constexpr.c (find_constructor): New function.
780         (unshare_constructor): New function.
781         (cxx_eval_call_expression): Use unshare_constructor instead of
782         unshare_expr.
783         (find_array_ctor_elt): Likewise.
784         (cxx_eval_vec_init_1): Likewise.
785         (cxx_eval_store_expression): Likewise.
786         (cxx_eval_constant_expression): Likewise.
788 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
790         PR c/70436
791         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
792         potentially generating a future -Wparentheses warning in its
793         callers.
795 2016-04-06  Jason Merrill  <jason@redhat.com>
797         * class.c (check_abi_tags): Fix function template handling.
799 2016-04-05  Nathan Sidwell  <nathan@acm.org>
801         PR c++/70512
802         * class.c (fixup_may_alias): New.
803         (fixup_attribute_variants): Call it.
805 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
807         PR c++/70452
808         * constexpr.c (struct fundef_copy): New struct.
809         (struct fundef_copies_table_t): New struct.
810         (fundef_copies_table): New static variable.
811         (maybe_initialize_fundef_copies_table): New static function.
812         (get_fundef_copy): New static function.
813         (save_fundef_copy): New static function.
814         (cxx_eval_call_expression): Use get_fundef_copy, and
815         save_fundef_copy.
816         (constexpr_call_table): Add "deletable" GTY marker.
818 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
820         PR c++/70452
821         * cp-tree.h (class cache_map): Remove.
822         * constexpr.c (cv_cache): Change type to
823         GTY((deletable)) hash_map<tree, tree> *.
824         (maybe_constant_value): Adjust following the change to cv_cache.
825         (clear_cv_cache): New static function.
826         (clear_cv_and_fold_caches): Use it.
827         * cp-gimplify.c (fold_cache): Change type to
828         GTY((deletable)) hash_map<tree, tree> *.
829         (clear_fold_cache): Adjust following the change to fold_cache.
830         (cp_fold): Likewise.
832 2016-04-02  Martin Sebor  <msebor@redhat.com>
834         PR c++/67376
835         PR c++/70170
836         PR c++/70172
837         PR c++/70228
838         * constexpr.c (diag_array_subscript): New function.
839         (cxx_eval_array_reference): Detect out of bounds array indices.
841 2016-04-01  Jason Merrill  <jason@redhat.com>
843         PR c++/70449
844         PR c++/70344
845         * pt.c (instantiate_decl): A function isn't fully defined if
846         DECL_INITIAL is error_mark_node.
847         * constexpr.c (cxx_eval_call_expression): Likewise.
849 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
850             Marek Polacek  <polacek@redhat.com>
852         PR c++/70488
853         * init.c (warn_placement_new_too_small): Test whether
854         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
856 2016-04-01  Nathan Sidwell  <nathan@acm.org>
858         PR c++/68475
859         * decl.c (check_redeclaration_exception_specification): Check
860         regardless of -fno-exceptions.
861         * typeck2.c (merge_exception_specifiers): Relax assert by checking
862         flag_exceptions too.
864 2016-03-31  Nathan Sidwell  <nathan@acm.org>
866         * decl.c (start_preparsed_function): Remove unnecessary bracing.
867         (finish_destructor_body): Don't emit operator delete here.
869 2016-03-31  Nathan Sidwell  <nathan@acm.org>
871         PR c++/70393
872         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
873         elements in field order.
875 2016-03-31  Marek Polacek  <polacek@redhat.com>
877         PR c/70297
878         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
880 2016-03-31  Richard Biener  <rguenther@suse.de>
882         PR c++/70430
883         * typeck.c (cp_build_binary_op): Fix operand order of vector
884         conditional in truth op handling.
886 2016-03-29  Jason Merrill  <jason@redhat.com>
888         PR c++/70353
889         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
890         in constexpr functions.
892 2016-03-28  Jason Merrill  <jason@redhat.com>
894         PR c++/70422
895         PR c++/64266
896         PR c++/70353
897         * decl.c, pt.c, constexpr.c: Revert last patch.
899 2016-03-25  Jason Merrill  <jason@redhat.com>
900             Martin LiÅ¡ka  <mliska@suse.cz>
902         PR c++/64266
903         PR c++/70353
904         Core issue 1962
905         * decl.c (cp_fname_init): Decay the initializer to pointer.
906         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
907         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
908         Don't call cp_finish_decl.
909         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
910         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
911         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
912         Handle DECL_VALUE_EXPR.
914 2016-03-24  Jason Merrill  <jason@redhat.com>
916         PR c++/70386
917         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
919         PR c++/70323
920         * constexpr.c (cxx_eval_call_expression): Don't cache result if
921         *overflow_p.
923 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
925         PR c++/62212
926         * tree.c (build_cplus_array_type): Determine type-dependentess
927         with uses_template_parms instead of with dependent_type_p.
929 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
931         PR c++/70347
932         * typeck.c (process_init_constructor_union): If the initializer
933         is empty, use the union's NSDMI if it has one.
935 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
937         PR c++/70332
938         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
939         NSDMI that's part of an aggregrate initialization.
941 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
943         PR c++/70001
944         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
945         for 1..max even for multi-dimensional arrays.  Call unshare_expr
946         on it.
948         PR c++/70323
949         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
950         on TREE_OVERFLOW constants.
952         PR c++/70376
953         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
954         for OMP_TASKLOOP here.
955         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
956         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
958 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
959             Jason Merrill  <jason@redhat.com>
960             Jakub Jelinek  <jakub@redhat.com>
962         PR c++/69315
963         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
964         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
965         (finish_function): Don't set or test them.
966         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
968 2016-03-23  Jason Merrill  <jason@redhat.com>
970         PR c++/70344
971         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
973 2016-03-23  Marek Polacek  <polacek@redhat.com>
975         PR c++/69884
976         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
978 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
980         * call.c (build_conditional_expr_1): Always use original
981         condition type for vector type checks and build.
983 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
985         PR c++/70096
986         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
988 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
990         PR c++/70204
991         * constexpr.c (non_const_var_error): Check
992         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
994 2016-03-21  Richard Henderson  <rth@redhat.com>
996         PR c++/70273
997         * decl.c (notice_forced_label_r): New.
998         (cp_finish_decl): Use it.
1000 2016-03-21  Jason Merrill  <jason@redhat.com>
1002         PR c++/70285
1003         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1005 2016-03-18  Jason Merrill  <jason@redhat.com>
1007         PR c++/70139
1008         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
1010         PR c++/70147
1011         * class.c (vptr_via_virtual_p): New.
1012         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
1013         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
1014         a vptr from any virtual base in a not-in-charge 'structor.
1016         * decl.c (build_clobber_this): Factor out of
1017         start_preparsed_function and begin_destructor_body.  Handle
1018         virtual bases better.
1020         * class.c (build_if_in_charge): Split out from build_base_path.
1021         * init.c (expand_virtual_init, expand_default_init): Use it.
1022         * call.c (build_special_member_call): Use it.
1024 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
1026         PR c++/70267
1027         * init.c (build_new_1): Complain and return error_mark_node
1028         if alloc_fn is not _Jv_AllocObject function returning pointer.
1030 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1032         PR c++/70205
1033         * search.c (adjust_result_of_qualified_name_lookup): Don't
1034         update the BASELINK_BINFO of DECL if the second call
1035         to lookup_base fails.
1037 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1039         PR c++/70218
1040         * parser.c (cp_parser_lambda_expression): Move call to
1041         pop_deferring_access_checks ahead of the call to
1042         cp_parser_end_tentative_firewall.
1044 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
1046         PR c++/70144
1047         * cp-tree.h (magic_varargs_p): Return int instead of bool.
1048         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
1049         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
1050         varargs.
1051         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
1052         if magic_varargs_p == 1, call decay_conversion
1053         instead of mark_type_use.  Don't store error_mark_node arguments to
1054         argarray, instead return error_mark_node.
1056         PR c++/70272
1057         * decl.c (begin_destructor_body): Don't insert clobber if
1058         is_empty_class (current_class_type).
1060 2016-03-17  Marek Polacek  <polacek@redhat.com>
1062         PR c++/70194
1063         * typeck.c (warn_for_null_address): New function.
1064         (cp_build_binary_op): Call it.
1066 2016-03-16  Jason Merrill  <jason@redhat.com>
1068         PR c++/70259
1069         * decl.c (start_preparsed_function): Don't clobber an empty base.
1071 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
1073         PR c++/70147
1074         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1075         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1077         PR c++/70147
1078         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1079         set in_base_initializer.
1081 2016-03-15  Marek Polacek  <polacek@redhat.com>
1083         PR c++/70209
1084         * tree.c (strip_typedefs): Call strip_typedefs again on the
1085         DECL_ORIGINAL_TYPE result.
1087 2016-03-15  Jason Merrill  <jason@redhat.com>
1089         PR c++/70095
1090         * pt.c (instantiate_decl): Fix call to variable_template_p.
1092         PR c++/70141
1093         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1095 2016-03-14  Casey Carter  <casey@carter.net>
1096             Jason Merrill  <jason@redhat.com>
1098         P0184R0: Generalizing the Range-Based For Loop
1099         * parser.c (cp_convert_range_for): Set the type of __end separately.
1100         (cp_parser_perform_range_for_lookup): Allow different begin/end
1101         types if they are comparable.
1103 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
1105         PR c++/70106
1106         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1107         processing_template_decl and EXPR is a SCOPE_REF.
1109 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
1110             Jakub Jelinek  <jakub@redhat.com>
1112         PR c++/70001
1113         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
1114         return value from cxx_eval_constant_expression from earlier
1115         elements if it is valid constant initializer requiring no
1116         relocations.
1118 2016-03-10  Marek Polacek  <polacek@redhat.com>
1120         PR c++/70153
1121         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1123 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
1125         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1126         when calling c_finish_omp_clauses.
1128 2016-03-08  Jason Merrill  <jason@redhat.com>
1130         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
1131         diagnostic for use of "concept".
1132         (cp_parser_requires_clause_opt): And "requires".
1133         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
1134         (cp_parser_explicit_template_declaration): Adjust.
1135         * Make-lang.in (check-c++-all): Add "concepts" to std list.
1137         P0036R0: Unary Folds and Empty Parameter Packs
1138         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1140 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
1142         PR c++/70135
1143         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1144         even after the last iteration of the loop.
1146         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1148 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
1150         PR c++/66786
1151         * pt.c (get_template_info): Handle PARM_DECL.
1152         (template_class_depth): Check DECL_P instead of
1153         VAR_OR_FUNCTION_DECL_P.
1155 2016-03-05  Jason Merrill  <jason@redhat.com>
1157         PR c++/67364
1158         * constexpr.c (cxx_eval_store_expression): Replace
1159         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1161 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
1163         PR c++/66786
1164         * pt.c (template_class_depth): Given a lambda type, iterate
1165         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
1166         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
1167         CP_DECL_CONTEXT.
1169 2016-03-04  Jason Merrill  <jason@redhat.com>
1171         PR c++/69203
1172         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
1173         * init.c (build_vec_delete_1): Set it.
1174         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
1176 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
1178         * decl.c (start_preparsed_function): Don't emit start clobber at the
1179         start of constructor clones.
1181         PR c++/70035
1182         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
1183         * decl.c (start_preparsed_function): Call
1184         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
1185         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
1186         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
1188 2016-03-04  Jason Merrill  <jason@redhat.com>
1190         PR c++/67364
1191         * constexpr.c (cxx_eval_component_reference): Further tweak.
1193         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
1194         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
1195         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
1196         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
1198         PR c++/70067
1199         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1200         same type.
1202 2016-03-03  Jason Merrill  <jason@redhat.com>
1204         * method.c (synthesized_method_walk): operator= can also be constexpr.
1206         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1207         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1209         PR c++/67164
1210         * pt.c (copy_template_args): New.
1211         (tsubst_pack_expansion): Use it.
1213         * call.c (build_aggr_conv): Use get_nsdmi.
1215         PR c++/51406
1216         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1218         PR c++/67364
1219         * constexpr.c (cxx_eval_component_reference): Just return an empty
1220         CONSTRUCTOR for an empty class.
1222 2016-03-01  Jason Merrill  <jason@redhat.com>
1224         PR c++/70036
1225         * parser.c (cp_parser_requires_clause): Call
1226         check_for_bare_parameter_packs.
1228         PR c++/51489
1229         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1230         the operands.
1232         PR c++/69995
1233         * constexpr.c (cxx_eval_call_expression): Unshare arg.
1234         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1235         [TARGET_EXPR]: Unshare init.
1237 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
1239         PR c++/68948
1240         PR c++/69961
1241         * pt.c (tsubst_baselink): Reinstate the check for an invalid
1242         constructor call.
1244 2016-02-28  Jason Merrill  <jason@redhat.com>
1246         PR c++/69995
1247         * constexpr.c (cxx_eval_store_expression): Unshare init.
1249 2016-02-26  Jason Merrill  <jason@redhat.com>
1251         PR c++/69958
1252         * pt.c (make_argument_pack): New.
1253         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1254         (tsubst_copy_and_build): Likewise.
1256 2016-02-25  Jason Merrill  <jason@redhat.com>
1258         PR c++/69889
1259         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
1260         * tree.c (build_aggr_init_expr): Set it.
1261         * semantics.c (simplify_aggr_init_expr): Check it.
1262         * cp-gimplify.c (cp_genericize_r): Don't walk into
1263         a call/aggr_init from a thunk.
1265         PR c++/69842
1266         * method.c (forward_parm): Handle parameter packs.
1267         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1269         PR c++/67364
1270         * constexpr.c (cxx_eval_component_reference): Don't complain about
1271         unevaluated empty classes.
1273         PR c++/68049
1274         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1276 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
1278         PR c++/69736
1279         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
1280         (maybe_undo_parenthesized_ref): Declare.
1281         * semantics.c (maybe_undo_parenthesized_ref): Split out from
1282         check_return_expr.
1283         (finish_call_expr): Use it.
1284         * typeck.c (check_return_expr): Use it.
1285         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
1286         REF_PARENTHESIZED_P flag.
1288 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
1290         PR c++/69922
1291         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1292         Avoid folding it.
1293         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
1294         tests.
1295         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
1296         unless they are folded into INTEGER_CST, error_mark_node or some
1297         comparison with NULL, avoid folding them and use either the original
1298         comparison or non-folded comparison of folded arguments.
1299         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
1300         comparison, don't fold the comparison right away.
1302 2016-02-24  Jason Merrill  <jason@redhat.com>
1304         PR c++/69323
1305         * friend.c (make_friend_class): Likewise.
1306         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1308 2016-02-24  Jason Merrill  <jason@redhat.com>
1310         PR c++/69323
1311         * pt.c (instantiate_class_template_1): Set
1312         processing_template_decl before substituting friend_type.
1314 016-02-24  Martin Sebor  <msebor@redhat.com>
1316         PR c++/69912
1317         * tree.c (build_ctor_subob_ref): Compare types' main variants
1318         instead of the types as they are.
1320 2016-02-24  Jason Merrill  <jason@redhat.com>
1322         * decl.c (start_preparsed_function): Condition ctor clobber on
1323         flag_lifetime_dse > 1.
1325         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1327 2016-02-19  Jason Merrill  <jason@redhat.com>
1329         PR c++/69743
1330         * call.c (remaining_arguments): No longer static.
1331         * cp-tree.h: Declare it.
1332         * pt.c (more_specialized_fn): Use it.
1334 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1335             Bernd Edlinger  <bernd.edlinger@hotmail.de>
1337         * Make-lang.in: Invoke gperf with -L C++.
1338         * cfns.gperf: Remove prototypes for hash and libc_name_p
1339         inlines.
1340         * cfns.h: Regenerated.
1341         * except.c (nothrow_libfn_p): Adjust.
1343 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1345         PR c++/69850
1346         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1347         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1349 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
1351         PR c++/68948
1352         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1353         call here.
1354         * semantics.c (finish_call_expr): Don't assume a constructor
1355         call is dependent if only the "this" pointer is dependent.  When
1356         building a constructor call, always use a dummy object.
1358 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1360         PR c++/69850
1361         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1362         condition.
1363         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1364         operators if folding preserved the binop, just with different
1365         arguments.
1367         PR c++/67767
1368         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1369         attr_spec is always single element chain, chain all the attributes
1370         properly together in the right order.
1372 2016-02-18  Jason Merrill  <jason@redhat.com>
1374         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
1375         mangle_decl.
1376         (mangle_decl): Call maybe_check_abi_tags for function scope.
1377         (mangle_guard_variable): Call maybe_check_abi_tags here.
1378         (write_guarded_var_name): Not here.
1380 2016-02-17  Jason Merrill  <jason@redhat.com>
1382         PR c++/65985
1383         * constexpr.c (build_constexpr_constructor_member_initializers):
1384         Handle an additional STATEMENT_LIST.
1386         PR c++/68585
1387         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1389         PR c++/68679
1390         * decl2.c (reset_type_linkage_2): Look through member templates.
1392 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
1394         PR c++/69850
1395         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1397 2016-02-17  Jason Merrill  <jason@redhat.com>
1399         PR c++/69842
1400         * method.c (forward_parm): Split out from...
1401         (add_one_base_init): ...here.
1402         * lambda.c (maybe_add_lambda_conv_op): Use it.
1404 2016-02-16  Jason Merrill  <jason@redhat.com>
1406         PR c++/10200
1407         PR c++/69753
1408         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1409         tree.c, typeck2.c: Revert earlier changes.
1410         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1411         non-type templates after -> or .
1413 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
1415         PR c/69835
1416         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1418 2016-02-16  Jason Merrill  <jason@redhat.com>
1420         PR c++/69657
1421         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1422         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
1423         * name-lookup.h: Adjust.
1425 2016-02-16  James Norris  <jnorris@codesourcery.com>
1427         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1428         * semantics.c (finish_omp_clauses): Add deviceptr checking.
1430 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1432         PR c++/69658
1433         * init.c (expand_default_init): Only call reshape_init
1434         in the direct-initialization from an initializer list case.
1436 2016-02-15  Jason Merrill  <jason@redhat.com>
1438         PR c++/69753
1439         * semantics.c (finish_call_expr): Implicit 'this' does not make
1440         the call dependent.
1441         * search.c (any_dependent_bases_p): Split out...
1442         * name-lookup.c (do_class_using_decl): ...from here.
1443         * call.c (build_new_method_call_1): Don't complain about missing object
1444         if there are dependent bases.  Tweak error.
1445         * tree.c (non_static_member_function_p): Remove.
1446         * pt.c (type_dependent_expression_p): A member template of a
1447         dependent type is dependent.
1448         * cp-tree.h: Adjust.
1450         PR c++/68890
1451         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1453 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1455         PR c++/69098
1456         * pt.c (lookup_and_finish_template_variable): New function,
1457         extracted from ...
1458         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1459         (tsubst_qualified_id): Consider that EXPR might be a variable
1460         template.
1461         * typeck.c (check_template_keyword): Don't emit an error
1462         if DECL is a variable template.
1464 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1466         * error.c: Spelling fixes - behaviour -> behavior and
1467         neighbour -> neighbor.
1468         * decl.c: Likewise.
1469         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1470         diagnostics.
1471         * init.c (build_delete): Likewise.
1473 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1475         PR c/69768
1476         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1477         arguments for -Waddress warning.  Fix up formatting.
1479 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1481         PR c++/68726
1482         * pt.c (lookup_template_class_1): Check tsubst return value for
1483         error_mark_node.
1485 2016-02-10  Jason Merrill  <jason@redhat.com>
1487         PR c++/68926
1488         * pt.c (resolve_nondeduced_context): Add complain parm.
1489         (do_auto_deduction): Pass it.
1490         * cvt.c (convert_to_void): Likewise.
1491         * decl.c (cp_finish_decl): Likewise.
1492         * init.c (build_new): Likewise.
1493         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1494         * semantics.c (finish_decltype_type): Likewise.
1495         * typeck.c (decay_conversion): Likewise.
1496         * cp-tree.h: Adjust declaration.
1497         * call.c (standard_conversion): Add complain parm, pass it along.
1498         (implicit_conversion): Pass it.
1500         PR c++/69657
1501         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1502         (lookup_name_real_1): Likewise.
1503         (remove_hidden_names): Handle non-functions too.
1505         PR c++/10200
1506         * parser.c (cp_parser_lookup_name): When looking for a template
1507         after . or ->, only consider class templates.
1508         (cp_parser_postfix_dot_deref_expression): Handle the current
1509         instantiation.  Remember a dependent object expression.
1510         * typeck2.c (build_x_arrow): Handle the current instantiation.
1512         * ptree.c (debug_tree): Implement for cp_expr.
1514 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1516         PR c++/69139
1517         * parser.c (cp_parser_simple_type_specifier): Make the check
1518         for disambiguating between an 'auto' placeholder and an implicit
1519         template parameter more robust.
1521 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1523         PR c++/69283
1524         PR c++/67835
1525         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1526         setting its TREE_USED flag.
1528 2016-02-08  Jason Merrill  <jason@redhat.com>
1530         PR c++/69657
1531         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1532         built-ins alone.
1534 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1536         PR c++/59627
1537         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1538         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1540 2016-02-08  Marek Polacek  <polacek@redhat.com>
1542         PR c++/69688
1543         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1544         Call clear_fold_cache.
1545         * cp-tree.h: Adjust declaration.
1546         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1547         rather than clear_cv_cache and clear_fold_cache.
1548         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1550 2016-02-08  Jason Merrill  <jason@redhat.com>
1552         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1553         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1554         (ocp_convert): Use *_maybe_fold.
1555         (cp_convert_to_pointer): Add dofold parameter.
1556         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1558 2016-02-05  Martin Sebor  <msebor@redhat.com>
1560         PR c++/69662
1561         * init.c (find_field_init): New function.
1562         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1563         at ends of structures special.
1565 2016-02-05  Jason Merrill  <jason@redhat.com>
1567         PR c++/68948
1568         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1569         make sure we've seen_error().
1571 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1573         PR c++/68948
1574         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1575         if lookup_fnfields returns NULL_TREE and the name being looked
1576         up has the form A::A.
1578 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1580         * constexpr.c (cxx_eval_binary_expression): Fold equality
1581         comparisons involving PTRMEM_CSTs.
1583 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1585         * class.c (find_flexarrays): Don't declare dom variable.
1586         (diagnose_flexarray): Likewise.
1588 2016-02-02  Martain Sebor  <msebor@redhat.com>
1590         PR c++/69251
1591         PR c++/69253
1592         PR c++/69290
1593         PR c++/69277
1594         PR c++/69349
1595         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1596         of a flexible array member for equality to null.
1597         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1598         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1599         (check_flexarrays): Same.
1600         * decl.c (compute_array_index_type): Avoid special case for flexible
1601         array members.
1602         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1603         array members.
1604         * error.c (dump_type_suffix): Revert changes introduced in r231665
1605         and rendered unnecessary by the changes above.
1606         * pt.c (tsubst):  Same.
1607         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1608         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1609         (process_init_constructor_array): Same.
1610         (process_init_constructor_record): Same.
1612 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1614         PR c++/69056
1615         * pt.c (try_one_overload): Handle comparing argument packs so
1616         that there is no conflict if we deduced more arguments of an
1617         argument pack than were explicitly specified.
1619 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1620             Jason Merrill  <jason@redhat.com>
1622         PR c++/68763
1623         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1624         function type if nothing is changing.
1626 2016-01-31  Jason Merrill  <jason@redhat.com>
1628         PR c++/69009
1629         * pt.c (partial_specialization_p, impartial_args): New.
1630         (instantiate_decl): Call impartial_args.
1632         * mangle.c (maybe_check_abi_tags): New.
1633         (write_guarded_var_name): Call it.
1634         (mangle_ref_init_variable): Call check_abi_tags.
1636         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1637         between template and instantiation.
1639 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1641         PR debug/66869
1642         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1643         function declarations.
1645 2016-01-29  Marek Polacek  <polacek@redhat.com>
1647         PR c++/69509
1648         PR c++/69516
1649         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1650         out of bound" error earlier.
1651         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1652         commentary.
1654 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1656         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1657         structure, update free_binding_level before the structure's
1658         level_chain field gets cleared, not after.
1660 2016-01-28  Jason Merrill  <jason@redhat.com>
1662         PR c++/67407
1663         * search.c (dfs_walk_once, dfs_walk_once_r)
1664         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1665         hash_set instead of BINFO_MARKED.
1666         (dfs_unmark_r): Remove.
1668 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1670         PR c++/24208
1671         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1672         (cp_lexer_debugging_p): Use it.
1673         (cp_lexer_start_debugging): Likewise.
1674         (cp_lexer_stop_debugging): Likewise.
1676 2016-01-27  Marek Polacek  <polacek@redhat.com>
1678         PR c/68062
1679         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1680         needed.  Add -Wsign-compare warning.
1682 2016-01-27  Ryan Burn  <contact@rnburn.com>
1684         PR cilkplus/69267
1685         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1686         superfluous post_p argument in call to
1687         cilk_gimplify_call_params_in_spawned_fn.
1689 2016-01-27  Marek Polacek  <polacek@redhat.com>
1691         PR c++/69379
1692         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1693         wrapped in NOP_EXPRs.
1695 2016-01-27  Martin Sebor  <msebor@redhat.com>
1697         PR c++/69317
1698         * mangle.c (mangle_decl): Reference the correct (saved) version
1699         of the ABI in -Wabi diagnostics.
1701 2016-01-27  Marek Polacek  <polacek@redhat.com>
1703         PR c++/69496
1704         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1705         elements of the array.
1707 2016-01-26  Jason Merrill  <jason@redhat.com>
1709         PR c++/68949
1710         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1711         (cxx_eval_call_expression): Don't look through clones.
1712         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1713         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1714         maybe-in-charge *tor.
1716 2016-01-26  Jason Merrill  <jason@redhat.com>
1718         PR c++/68782
1719         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1720         and TREE_SIDE_EFFECTS.
1721         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1722         verify_constructor_flags.
1724 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1726         PR c++/68357
1727         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1728         return error_mark_node instead of building trees with error_mark_node
1729         operands.
1731 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1733         PR other/69006
1734         * error.c (print_instantiation_partial_context_line): Add missing
1735         newlines from output for the t == NULL case.
1736         (print_instantiation_partial_context): Remove call to pp_newline.
1738 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
1740         Revert:
1741         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1743         PR c++/11858
1744         PR c++/24663
1745         PR c++/24664
1746         * decl.c (grokdeclarator): Don't decay array parameter type to
1747         a pointer type if it's dependent.
1748         (grokparms): Invoke strip_top_quals instead of directly invoking
1749         cp_build_qualified_type.
1750         * pt.c (decay_dependent_array_parm_type): New static function.
1751         (type_unification_real): Call decay_dependent_array_parm_type
1752         to decay a dependent array parameter type to its corresponding
1753         pointer type before unification.
1754         (more_specialized_fn): Likewise.
1755         (get_bindings): Likewise.
1756         * tree.c (cp_build_qualified_type): Trivial typofix in
1757         documentation.
1759 2016-01-23  Martin Sebor  <msebor@redhat.com>
1761         PR c++/58109
1762         PR c++/69022
1763         * decl2.c (is_late_template_attribute): Handle dependent argument
1764         to attribute align and attribute vector_size.
1766 2016-01-21  Jason Merrill  <jason@redhat.com>
1768         PR c++/69392
1769         * lambda.c (lambda_capture_field_type): Handle 'this' specially
1770         for init-capture, too.
1772         PR c++/65687
1773         * decl.c (type_is_deprecated): Don't look into a typedef.
1775         PR c++/40751
1776         PR c++/64987
1777         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1779         PR c++/43407
1780         * decl.c (start_enum): Add attributes parameter.
1781         * parser.c (cp_parser_enum_specifier): Pass it.
1782         * pt.c (lookup_template_class_1): Pass it.
1783         * cp-tree.h: Adjust.
1785 2016-01-19  Jason Merrill  <jason@redhat.com>
1787         PR c++/59759
1788         * pt.c (convert_template_argument): Handle VAR_DECL properly.
1790 2016-01-19  Marek Polacek  <polacek@redhat.com>
1792         PR c++/68586
1793         * constexpr.c (clear_cv_cache): New.
1794         * cp-gimplify.c (clear_fold_cache): New.
1795         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1796         * decl.c (finish_enum_value_list): Call them.
1798         PR c++/68965
1799         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1801 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1803         PR c++/11858
1804         PR c++/24663
1805         PR c++/24664
1806         * decl.c (grokdeclarator): Don't decay array parameter type to
1807         a pointer type if it's dependent.
1808         (grokparms): Invoke strip_top_quals instead of directly invoking
1809         cp_build_qualified_type.
1810         * pt.c (decay_dependent_array_parm_type): New static function.
1811         (type_unification_real): Call decay_dependent_array_parm_type
1812         to decay a dependent array parameter type to its corresponding
1813         pointer type before unification.
1814         (more_specialized_fn): Likewise.
1815         (get_bindings): Likewise.
1816         * tree.c (cp_build_qualified_type): Trivial typofix in
1817         documentation.
1819 2016-01-18  Jason Merrill  <jason@redhat.com>
1821         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1823         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1825         PR c++/68767
1826         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
1827         (contains_label_1, contains_label_p): Remove.
1829 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1831         PR c++/69091
1832         * pt.c (type_dependent_expression_p): For a function template
1833         specialization, a type is dependent iff any of its template
1834         arguments are.
1836 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1838         * cp-array-notation.c (cp_expand_cond_array_notations): Return
1839         error_mark_node only if find_rank failed, not if it was
1840         successful.
1842 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1844         PR c++/68936
1845         * tree.c (build_min_non_dep_call_vec): Don't retain the
1846         KOENIG_LOOKUP_P flag of the non-dependent expression that's
1847         been built.
1848         (build_min_non_dep_op_overload): Instead, do it here.
1850 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
1852         PR bootstrap/68271
1853         * parser.h (cp_token): Remove pragma_kind field.  Add comment
1854         with number of unused bits.
1855         * parser.c (eof_token): Remove pragma_kind field initializer.
1856         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1857         field, don't clear CPP_PRAGMA u.value.
1858         (cp_parser_pragma_kind): New function.
1859         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1860         cp_parser_omp_construct, cp_parser_initial_pragma,
1861         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1862         pragma_kind field.
1864 2016-01-15  Jason Merrill  <jason@redhat.com>
1866         PR c++/68847
1867         * call.c (build_cxx_call): Use fold_non_dependent_expr.
1869         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1870         value.
1872         PR c++/69257
1873         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1874         array/function-to-pointer conversion.  Call
1875         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1876         * call.c (convert_like_real): Print call context if
1877         decay_conversion errors.
1879 2016-01-14  Tom de Vries  <tom@codesourcery.com>
1881         PR tree-optimization/68773
1882         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1883         set force_output.
1885 2016-01-14  Jason Merrill  <jason@redhat.com>
1887         PR c++/69261
1888         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
1890 2016-01-12  Marek Polacek  <polacek@redhat.com>
1892         PR c++/68979
1893         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
1894         error_at and adjust the return value.
1896 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
1898         PR objc++/68511
1899         PR c++/69213
1900         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
1901         GS_ERROR whenever seen_error (), only if *expr_p contains
1902         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
1904         PR c++/66808
1905         PR c++/69000
1906         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
1908 2016-01-11  Jason Merrill  <jason@redhat.com>
1910         PR c++/69131
1911         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
1912         (process_subob_fn): Likewise.  Don't consider triviality if true.
1913         (synthesize_method_walk): Pass it.
1915 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
1917         PR c++/68795
1918         * parser.c (cp_parser_postfix_expression): Initialize
1919         close_paren_loc to UNKNOWN_LOCATION; only use it if
1920         it has been written to by
1921         cp_parser_parenthesized_expression_list.
1922         (cp_parser_parenthesized_expression_list): Document the behavior
1923         with respect to the CLOSE_PAREN_LOC param.
1925 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
1927         PR c++/69211
1928         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1929         folded operands have side-effects, but folding changed any of them,
1930         build a new tree with the folded operands instead of returning the
1931         unfolded tree.
1933 2016-01-09  Marek Polacek  <polacek@redhat.com>
1935         PR c++/69113
1936         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1938 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
1940         PR c++/69164
1941         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1943 2016-01-08  Jason Merrill  <jason@redhat.com>
1945         PR c++/69158
1946         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1947         in completion.
1949 2016-01-08  Marek Polacek  <polacek@redhat.com>
1951         PR c++/68449
1952         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1954 2016-01-08  Jason Merrill  <jason@redhat.com>
1956         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1957         workaround.
1959         PR c++/68983
1960         PR c++/67557
1961         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1962         TREE_ADDRESSABLE type.
1964         PR c++/68983
1965         PR c++/67557
1966         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1968 2016-01-05  Nathan Sidwell  <nathan@acm.org>
1970         PR c++/58583
1971         * pt.c (build_non_dependent_expr): Don't try a checking fold when
1972         parsing an nsdmi.
1974 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1976         Update copyright years.
1978 Copyright (C) 2016 Free Software Foundation, Inc.
1980 Copying and distribution of this file, with or without modification,
1981 are permitted in any medium without royalty provided the copyright
1982 notice and this notice are preserved.