Update ChangeLog and version files for release
[official-gcc.git] / gcc / cp / ChangeLog
blob2026a822f3bb3f87fa08ba7e01565b8c643f1b94
1 2016-08-22  Release Manager
3         * GCC 6.2.0 released.
5 2016-08-13  Jason Merrill  <jason@redhat.com>
7         PR c++/71972
8         * constexpr.c (cxx_eval_array_reference): Handle looking for the
9         value of an element we're currently modifying.
11 2016-08-11  Jakub Jelinek  <jakub@redhat.com>
13         PR c++/72868
14         * constexpr.c (label_matches): Handle case range expressions.
16 2016-08-11  Jason Merrill  <jason@redhat.com>
18         PR c++/73456
19         * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION.
21 2016-08-08  Paolo Carlini  <paolo.carlini@oracle.com>
23         PR c++/72800
24         * lambda.c (add_capture): Check lambda_capture_field_type return
25         value for error_mark_node.
27 2016-08-05  Nathan Sidwell  <nathan@acm.org>
29         PR c++/68724
30         * pt.c (unify): TRAIT_EXPR is an expr.
32 2016-08-04  Jason Merrill  <jason@redhat.com>
34         PR c++/72415
35         * pt.c (tsubst_pack_expansion): Pull a single pack expansion out
36         of the TREE_VEC.
38 2016-07-29  Jason Merrill  <jason@redhat.com>
40         PR c++/72457
41         * init.c (expand_aggr_init_1): Only handle value-init of bases.
42         * constexpr.c (build_data_member_initialization): Handle multiple
43         initializers for the same field.
45 2016-07-25  Jason Merrill  <jason@redhat.com>
47         PR c++/71576
48         * call.c (convert_like_real): Use lvalue_kind.
50         PR c++/71833
51         * pt.c (coerce_template_parameter_pack): Fix logic for
52         pack index.
54 2016-07-23  Jason Merrill  <jason@redhat.com>
56         PR c++/55922
57         PR c++/63151
58         * init.c (expand_aggr_init_1): Handle list-initialization from {}.
60         PR c++/70709
61         * class.c (walk_subobject_offsets): Handle 0-length array.
63         PR c++/70778
64         * pt.c (tsubst): Also substitute into the template of a
65         BOUND_TEMPLATE_TEMPLATE_PARM.
67         PR c++/71738
68         * pt.c (lookup_template_class_1): Handle getting template from tsubst.
70         PR c++/71350
71         * decl.c (reshape_init_r): Check complain for missing braces warning.
73 2016-07-22  Jason Merrill  <jason@redhat.com>
75         PR c++/71748
76         PR c++/52746
77         * pt.c (tsubst_baselink): Call
78         adjust_result_of_qualified_name_lookup for unqualified
79         destructors.
81 2016-07-21  Jason Merrill  <jason@redhat.com>
83         PR c++/69223
84         * semantics.c (apply_deduced_return_type): Call
85         complete_type_or_else before building the new RESULT_DECL.
87         PR c++/71630
88         * pt.c (instantiate_decl): Fix pattern_defined for namespace scope
89         variable templates.
91         PR c++/71913
92         * call.c (unsafe_copy_elision_p): It's OK to elide when
93         initializing an unknown object.
95 2016-07-21  Jakub Jelinek  <jakub@redhat.com>
97         PR c++/71728
98         * constexpr.c (potential_constant_expression_1) <case GOTO_EXPR>:
99         Replace assert with test, return false if the goto isn't break
100         or continue.  Formatting fix.
102 2016-07-21  Jakub Jelinek  <jakub@redhat.com>
104         PR c++/71941
105         * cp-gimplify.c (cp_genericize): For nested cp_genericize calls
106         save/restore bc_label array.
108 2016-07-21  Patrick Palka  <ppalka@gcc.gnu.org>
110         PR c++/70822
111         PR c++/70106
112         * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
113         SCOPE_REFs too.
114         * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
115         on the qualified_id then propagate it to the resulting
116         expression.
117         (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
118         too.
119         * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
120         its REF_PARENTHESIZED_P flag.
122 2016-07-21  Andrew Sutton  <andrew.n.sutton@gmail.com>
123             Jason Merrill  <jason@redhat.com>
125         Improving concepts performance and diagnostics.
126         PR c++/67565
127         PR c++/67579
128         PR c++/71843
129         * cp-tree.def (CHECK_CONSTR): New.
130         * cp-tree.h (CHECK_CONSTR_CONCEPT): New.
131         (CHECK_CONSTR_ARGS): New.
132         * constraint.cc (make_predicate_constraint): Remove in favor of
133         normalize_expression.
134         (resolve_constraint_check): Actually return error_mark_node when
135         resolution fails.
136         (resolve_variable_concept_check): Perform coercion as if processing
137         a template. Also return errors on resolution failure.
138         (lift_*): Remove all of these functions. Don't unnecessarily inline
139         concepts.
140         (learn_*): Add facilities to memoize implications for subsumption
141         during normalization.
142         (expanding_concept): New.
143         (expand_concept): New. Return the inlined and normalized definition
144         of a concept when needed.
145         (transform_*, xform_*): Rename to normalize_* to better reflect the
146         responsibility of those functions.
147         (normalize_template_id_expression): Check for non-boolean operands
148         when possible. Generate check constraints instead of normal variable
149         references.
150         (normalize_call_expression): Report errors when resolution fails.
151         (check_for_logical_overloads): Rewrite this check to more accurately
152         report the error.
153         (normalize_atom): Check for overloaded calls and invalid types before
154         determining if the expression refers to a concept.
155         (build_constraints): Don't cache normalized constraints or decomposed
156         assumptions.
157         (finish_shorthand_constraint): Return a normalized expression instead
158         of a predicate constraint.
159         (finish_template_introduction): Same.
160         (placeholder_extract_concept_and_args): Rewrite this since we only
161         ever get check constraints here.
162         (equivalent_placeholder_constraints): Rewrite in terms of check
163         constraints, and handle error_mark_nodes correctly.
164         (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr)
165         (tsubst_implicit_conversion_constr)
166         (tsubst_argument_deduction_constr, tsubst_exception_constr)
167         (tsubst_parameterized_constraint, tsubst_constraint): New.
168         (tsbust_conjunection): Replace with tsubst_logical_operator and
169         actually generate the right kind of constraint.
170         (tsubst_requirement_body): Reverse the order of substituted arguments
171         so that they appear in the order written (helps diagnostics).
172         (satisfy_check_constraint): New.
173         (satisfy_conjunction): Simplify.
174         (satisfy_disjunction): Same.
175         (satisfy_constraint_1): Handle check constraints.
176         (eval_constr): New (private) global state.
177         (evaluating_constraints_sentinel): New. Manages eval_constr.
178         (satisfy_constraint): Add timing variables.
179         (satisfy_associated_constraints): Add hooks for memoization.
180         (evaluate_function_concept): Build a check constraint instead of
181         normalizing its definition.
182         (evaluate_variable_concept): Same.
183         (evaluate_constraint_expression): Normalize, but in the current
184         declaration processing context.
185         (evaluating_constraints_p): New.
186         (elide_constraint_failure_p): Actually emit constraint_thresh errors.
187         (diagnose_*): Remove artificial indentation. Add a new parameter to
188         each that tracks the current (complete) constraint prior to any
189         substitutions.
190         (diagnose_expression): Removed.
191         (diagnose_call_expression): Same.
192         (diagnose_template_id): Same.
193         (diagnose_template_id): New.
194         (diagnose_logical_constraint): New.
195         (diagnose_expression_constraint): Show the original expression.
196         (diagnose_type_constraint): Show the original type.
197         (diagnose_implicit_conversion_constraint): Be specific about
198         failures, don't re-diagnose a known-to-be-failed substitutions,
199         and manage elisions properly.
200         (diagnose_argument_deduction_constraint): Same.
201         (diagnose_exception_constraint): Same.
202         (diagnose_parameterized_constraint): Same.
203         (constraint_p): Allow EXPR_PACK_EXPANSION.
204         * logic.cc (next_by_distance): Removed. No longer used.
205         (any_p): Renamed from any_of.
206         (term_entry, term_hasher): New.
207         (term_list): Rewrite to include a hash table for quick lookup.
208         Also, make less stateful.
209         (proof_state): Extend to allow goals to be discharged once
210         satisfied.
211         (non_atomic_constraint_p): New.
212         (any_non_atomic_constraints_p): New.
213         (...rest...): Previous implementation completely replaced with an
214         iterative algorithm that opportunistically prunes the search space
215         before committing to using more memory.
216         * parser.c: (cp_parser_type_parameter): Normalize constraints.
217         (cp_parser_explicit_template_declaration): Same.
218         * pt.c: (finish_template_variable): Be less redundant with this error
219         message.
220         (template_args_equal): No longer static.
221         (tsubst_decl): Don't try to find specializations of variables that
222         have already been instantiated.
223         (build_non_dependent_expr): Avoid infinite recursion during concept
224         expansion.
225         (make_constrained_auto): Normalize constraints.
226         (do_auto_deduction): When doing auto deduction from a
227         partial-concept-id, be sure to include the explicit args checking
228         the constraints.
229         (constraint_sat_*): New. Memoize satisfied constraints.
230         (concept_spec_*): New. Memoize expressions associated with a concept
231         specialization.
232         (constraint_memos, concept_memos): New.
233         (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New.
234         (lookup_concept_satisfaction, memoize_concept_satisfaction): New.
235         (get_concept_expansion, save_concept_expansion): New.
236         (hash_subsumption_args): New.
237         (comp_subsumption_args): New.
238         (subsumption_*): New. Memoize parts of the subsumption relation.
239         (lookup_subsumption_result, save_subsumption_result): New.
240         (init_constraint_processing): Initialize memo tables.
241         (get_constraints): Shortcut if !flag_concepts.
242         * decl.c (grokfndecl): Normalize constraints.
243         * error.c (dump_simple_decl): Print "concept" when appropriate.
244         (dump_function_decl): Same.
245         (dump_template_decl): Don't write requirements when we're not
246         printing the header.
247         (dump_expr): Handle fold expressions.
248         * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle
249         fold expressions.
250         (get_fold_operator): New.
251         (pp_cxx_unary_left_fold_expression): New.
252         (pp_cxx_unary_right_fold_expression): New.
253         (pp_cxx_binary_fold_expression): New.
254         (pp_cxx_check_constraint): New.
255         (pp_cxx_*_constraint): Rewrite the grammar of internal constraints
256         to make them easier to read when debugging.
257         * search.c (accessible_p): Don't shortcut when evaluating constraints.
258         * tree.c (cp_tree_equal): Handle CHECK_CONSTR.
260 2016-07-21  Jason Merrill  <jason@redhat.com>
262         PR c++/70781
263         * parser.c (cp_parser_lambda_expression): Unset OK if there was an
264         error parsing the lambda-declarator.
266         PR c++/71896
267         * constexpr.c (cxx_eval_binary_expression): Handle comparison
268         between lowered and unlowered PTRMEM_CST.
270         PR c++/71092
271         * constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
272         threw away DECL_SAVED_TREE.
274         PR c++/71117
275         Core 2189
276         * call.c (add_template_conv_candidate): Disable if there are
277         viable candidates.
279         PR c++/71495
280         * call.c (convert_like_real): Mask complain.
282         PR c++/71511
283         * typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.
285         PR c++/71513
286         * pt.c (tsubst_attributes): Fix loop logic.
288         PR c++/71604
289         PR c++/54430
290         * parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
291         (cp_parser_simple_declaration): Diagnose type definition in
292         for-range-declaration.
294         PR c++/71711
295         * operators.def: Add *_FOLD_EXPR.
296         * cp-tree.h (FOLD_EXPR_P): Parenthesize.
297         * mangle.c (write_expression): Handle fold-expressions.
298         * pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
299         (tsubst_unary_right_fold, tsubst_binary_right_fold): Handle
300         partial instantiation.
302         PR c++/71814
303         * mangle.c (write_expression): Handle sizeof... an argument pack.
305         PR c++/71718
306         * pt.c (push_tinst_level_loc): Set at_eof before fatal_error.
308         PR c++/70824
309         * init.c (constant_value_1): Don't instantiated DECL_INITIAL of
310         artificial variables.
312         * lambda.c (maybe_add_lambda_conv_op): Fix null object argument.
314 2016-07-20  Jakub Jelinek  <jakub@redhat.com>
316         PR c++/71909
317         * parser.c (cp_parser_save_member_function_body): Consume
318         __transaction_relaxed or __transaction_atomic with optional
319         attribute.  Only skip catch with block if try keyword is seen.
321 2016-07-19  Jakub Jelinek  <jakub@redhat.com>
323         Backported from mainline
324         2016-07-18  Jakub Jelinek  <jakub@redhat.com>
326         PR c++/71835
327         * call.c (build_op_call_1): Use convert_like_with_context only
328         if cand->fn is a decl.
330         PR c++/71828
331         * constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
332         For lval don't use cxx_eval_unary_expression and instead recurse
333         and if needed rebuild the reference.
335         PR c++/71822
336         * cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
337         fold *expr_p before genericizing it.
339         PR c++/71871
340         * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
342         2016-07-07  Jakub Jelinek  <jakub@redhat.com>
343                     Kai Tietz  <ktietz70@googlemail.com>
345         PR c++/70869
346         PR c++/71054
347         * cp-gimplify.c (cp_genericize_r): For DECL_EXPR for non-static
348         artificial vars, genericize their initializers.
350 2016-06-21  Jakub Jelinek  <jakub@redhat.com>
352         Backported from mainline
353         2016-06-17  Jakub Jelinek  <jakub@redhat.com>
355         * semantics.c (handle_omp_array_sections_1): Don't ICE when
356         processing_template_decl when checking for bitfields and unions.
357         Look through REFERENCE_REF_P as base of COMPONENT_REF.
358         (finish_omp_clauses): Look through REFERENCE_REF_P even for
359         array sections with COMPONENT_REF bases.
361         2016-06-16  Jakub Jelinek  <jakub@redhat.com>
363         * parser.c (cp_parser_omp_var_list_no_open): Call
364         convert_from_reference before cp_parser_postfix_dot_deref_expression.
365         * semantics.c (finish_omp_clauses): Don't ICE when
366         processing_template_decl when checking for bitfields and unions.
367         Look through REFERENCE_REF_P as base of COMPONENT_REF.
369         2016-06-14  Jakub Jelinek  <jakub@redhat.com>
371         PR c++/71528
372         * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
373         olddecl vars, preserve their TREE_READONLY bit.
375 2016-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
377         PR c++/70572
378         * decl.c (cp_finish_decl): Check do_auto_deduction return value
379         and return immediately in case of erroneous code.
381 2016-06-14  Jakub Jelinek  <jakub@redhat.com>
383         PR c++/71516
384         * decl.c (complete_vars): Handle gracefully type == error_mark_node.
386 2016-06-10  Thomas Schwinge  <thomas@codesourcery.com>
388         PR c/71381
389         Backport from trunk r237290:
390         * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
391         Loosen checking.
393 2016-06-08  Jakub Jelinek  <jakub@redhat.com>
395         PR c++/71442
396         * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
398 2016-06-06  Jakub Jelinek  <jakub@redhat.com>
399             Patrick Palka  <ppalka@gcc.gnu.org>
401         PR c++/70847
402         PR c++/71330
403         PR c++/71393
404         * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
405         right after cp_fold call if cp_fold has returned the same stmt
406         already in some earlier cp_fold_r call.
407         (cp_fold_function): Add pset automatic variable, pass its address
408         to cp_walk_tree.
410 2016-06-02  Jakub Jelinek  <jakub@redhat.com>
412         PR c++/71372
413         * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
414         is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
415         and TREE_THIS_VOLATILE flags.  For ARRAY_REF and ARRAY_RANGE_REF, copy
416         over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
417         to the newly built tree.
419 2016-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
421         PR c++/70972
422         * method.c (forward_parm): Use cp_build_reference_type.
424 2016-05-31  Jason Merrill  <jason@redhat.com>
426         PR c++/71166
427         * decl2.c (c_parse_final_cleanups): Don't call fini_constexpr.
429         PR c++/71227
430         * pt.c (check_explicit_specialization): Give better diagnostic about
431         specializing a hidden friend.
433         PR c++/60095
434         PR c++/69515
435         PR c++/69009
436         * pt.c (instantiate_template_1): Don't put the partial
437         specialization in DECL_TI_TEMPLATE.
438         (partial_specialization_p, impartial_args): Remove.
439         (regenerate_decl_from_template): Add args parm.
440         (instantiate_decl): Look up the partial specialization again.
442         PR c++/71173
443         PR c++/70522
444         * cp-tree.h (enum tag_types): Add scope_type.
445         * parser.c (cp_parser_class_name): Use scope_type.
446         (prefer_type_arg): Handle scope_type.
447         (cp_parser_lookup_name): Use prefer_type_arg.
448         * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
449         int prefer_type, use lookup_flags.
450         * name-lookup.h: Adjust.
452         PR c++/70584
453         * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
454         returns a decl.
455         (cp_fold) [INDIRECT_REF]: Call maybe_undo_parenthesized_ref.
457         PR c++/70735
458         * pt.c (tsubst_copy): Just return a local variable from
459         non-template context.  Don't call rest_of_decl_compilation for
460         duplicated static locals.
461         (tsubst_decl): Set DECL_CONTEXT of local static from another
462         function.
464 2016-05-31  Martin Sebor  <msebor@redhat.com>
466         PR c++/71306
467         * init.c (warn_placement_new_too_small): Handle placement new arguments
468         that are elements of arrays more carefully.  Remove a pointless loop.
470 2016-05-30  Jakub Jelinek  <jakub@redhat.com>
472         PR c++/71349
473         * parser.c (cp_parser_omp_for): Don't disallow nowait clause
474         when combined with target construct.
475         (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
476         to cp_parser_omp_all_clauses.
478 2016-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
480         PR c++/71105
481         * lambda.c (maybe_add_lambda_conv_op): Early return also when
482         LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
484 2016-05-24  Martin Sebor  <msebor@redhat.com>
486         PR c++/71147
487         * decl.c (layout_var_decl, grokdeclarator): Use
488         complete_or_array_type_p.
489         * pt.c (instantiate_class_template_1): Try to complete the element
490         type of a flexible array member.
491         (can_complete_type_without_circularity): Handle arrays of unknown bound.
492         * typeck.c (complete_type): Also complete the type of the elements of
493         arrays with an unspecified bound.
495 2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
497         PR c++/69872
498         * typeck2.c (check_narrowing): Check pedwarn return value.
500 2016-05-24  Jakub Jelinek  <jakub@redhat.com>
502         PR c++/71257
503         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
504         For OMP_CLAUSE_LINEAR_REF don't require type to be
505         integral or pointer.
507 2016-05-23  Jason Merrill  <jason@redhat.com>
509         PR c++/70344
510         * constexpr.c (cxx_eval_call_expression): Check for
511         fun == current_function_decl again.
513 2016-05-19  David Malcolm  <dmalcolm@redhat.com>
515         Backport from trunk r236483.
516         PR c++/71184
517         * parser.c (cp_parser_operator): For array new/delete, check that
518         cp_parser_require returned a non-NULL token before dereferencing
519         it.
521 2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
523         Backport from mainline
524         2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
526         * decl.c (finish_enum_value_list): Use the specified mode.
528 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
530         PR c++/70466
531         * call.c (convert_like_real): Check that we are actually converting
532         from an init list.
534 2016-04-29  Cesar Philippidis  <cesar@codesourcery.com>
536         PR middle-end/70626
537         * parser.c (cp_parser_oacc_loop): Don't augment mask with
538         OACC_LOOP_CLAUSE_MASK.
539         (cp_parser_oacc_kernels_parallel): Update call to
540         c_oacc_split_loop_clauses.
542 2016-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
544         PR c++/70540
545         * semantics.c (process_outer_var_ref): Unconditionally return
546         error_mark_node when mark_used returns false.
548 2016-04-27  Release Manager
550         * GCC 6.1.0 released.
552 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
554         PR bootstrap/70704
555         * pt.c (build_non_dependent_expr): Temporarily disable flag_checking
556         guarded code.
558 2016-04-22  Jason Merrill  <jason@redhat.com>
560         PR c++/68206
561         PR c++/68530
562         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
563         and GOTO_EXPR.
565         PR c++/70522
566         * name-lookup.c (qualified_lookup_using_namespace): Look through
567         hidden names.
569 2016-04-19  Jason Merrill  <jason@redhat.com>
571         PR c++/66543
572         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
573         * pt.c (make_pack_expansion): Call mark_exp_read.
574         * semantics.c (finish_id_expression): Call mark_type_use in
575         unevaluated context.
577 2016-04-18  Jason Merrill  <jason@redhat.com>
579         PR c++/70690
580         PR c++/70528
581         * class.c (type_maybe_constexpr_default_constructor): New.
582         (type_has_constexpr_default_constructor): Revert.
584         PR c++/70505
585         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
586         unknown_type_node, too.
588 2016-04-15  Jason Merrill  <jason@redhat.com>
590         PR c++/70685
591         * constexpr.c (get_fundef_copy): Handle null *slot.
593 2016-04-15  Jason Merrill  <jason@redhat.com>
594             Nathan Sidwell  <nathan@acm.org>
596         PR c++/70594
597         * constexpr.c (constexpr_call_table): Preserve in GC.
598         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
599         (fundef_copies_table): Preserve in GC. Change to pointer to
600         tree->tree hash.
601         (maybe_initialize_fundef_copies_table): Adjust.
602         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
603         (save_fundef_copy): Adjust for a TREE_LIST.
604         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
605         (fini_constexpr): New.
606         * cp-tree.h (fini_constexpr): Declare.
607         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
609 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
611         PR c/70436
612         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
613         where needed.
614         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
615         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
616         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
617         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
618         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
619         cp_parser_statement.
620         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
621         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
622         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
623         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
624         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
625         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
626         cp_parser_omp_taskloop, cp_parser_omp_construct,
627         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
628         Add IF_P argument, pass it down where needed.
629         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
630         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
631         calls.
633 2016-04-14  Jason Merrill  <jason@redhat.com>
635         PR c++/70494
636         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
637         * typeck2.c (split_nonconstant_init_1): Use it.
639         PR c++/70528
640         * class.c (type_has_constexpr_default_constructor): Return true
641         for an implicitly declared constructor.
643         PR c++/70622
644         * parser.c (cp_parser_init_declarator): Add auto_result parm.
645         (cp_parser_simple_declaration): Pass it.
646         (strip_declarator_types): New.
648         PR c++/70543
649         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
650         initializer also makes the variable value-dependent.
652         PR c++/70648
653         * constexpr.c (cxx_eval_store_expression): Also copy
654         CONSTRUCTOR_NO_IMPLICIT_ZERO.
656 2016-04-14  Martin Sebor  <msebor@redhat.com>
658         PR c++/69517
659         PR c++/70019
660         PR c++/70588
661         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
663 2016-04-14  Jason Merrill  <jason@redhat.com>
665         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
666         parameter ABI change.
668 2016-04-13  Martin Sebor  <msebor@redhat.com>
670         PR c++/69517
671         PR c++/70019
672         PR c++/70588
673         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
674         functions.
675         * decl.c (check_initializer, cp_finish_decl): Call them.
676         (reshape_init_r): Reject incompletely braced intializer-lists
677         for VLAs.
678         * init.c (throw_bad_array_length, build_vla_check)
679         (build_vla_size_check, build_vla_init_check): Define new functions.
680         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
681         to detect a VLA.
682         (store_init_value): Same.
684 2016-04-13  Jason Merrill  <jason@redhat.com>
686         Warn about empty parameter ABI with -Wabi=9.
687         * call.c (empty_class_msg, mark_for_abi_warning)
688         (warn_empty_class_abi): New.
689         (build_call_a): Use them.
690         * decl.c (store_parm_decls): Use mark_for_abi_warning.
691         * error.c (pp_format_to_string): New.
693         Pass empty class parameters like C.
694         * call.c (pass_as_empty_struct, empty_class_arg): New.
695         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
696         (build_call_a): Use empty_class_arg.
697         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
698         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
700 2016-04-13  Jason Merrill  <jason@redhat.com>
702         PR c++/70627
703         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
705 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
707         PR c++/70635
708         * pt.c (resolve_typename_type): Fix typos in infinite recursion
709         avoidance mechanism.
711 2016-04-13  Jason Merrill  <jason@redhat.com>
713         PR c++/70634
714         * pt.c (instantiation_dependent_uneval_expression_p): Split out
715         from instantiation_dependent_expression_p.
716         (value_dependent_expression_p): Use it for unevaluated operands.
717         (instantiation_dependent_r): Don't check value-dependence.
718         (instantiation_dependent_expression_p): Check
719         value-dependence of the expression as a whole.
720         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
721         * semantics.c (finish_decltype_type): Use it.
723         * constexpr.c (potential_nondependent_constant_expression): New.
724         (potential_nondependent_static_init_expression): New.
725         (maybe_constant_value_1, fold_non_dependent_expr)
726         (maybe_constant_init): Use them.
727         * pt.c (instantiate_non_dependent_expr_sfinae)
728         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
729         them.
730         * cp-tree.h: Declare them.
732 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
734         PR c++/70594
735         * decl.c (pop_labels_1): Removed.
736         (note_label, sort_labels): New functions.
737         (pop_labels): During named_labels traversal, just push the slot
738         pointers into a vector, then qsort it by DECL_UID and only then
739         call pop_label and chain it into BLOCK_VARS.
741 2016-04-13  Jason Merrill  <jason@redhat.com>
743         PR c++/70615
744         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
745         (cp_gimplify_expr): Not here.
747 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
749         PR c++/70610
750         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
751         recurse into it.
752         * typeck.c (build_x_conditional_expr): Unconditionally remember
753         that the result is an lvalue or xvalue.
755 2016-04-12  Jason Merrill  <jason@redhat.com>
757         * class.c (is_really_empty_class): A zero-length array is empty.
758         An unnamed bit-field doesn't make a class non-empty.
760 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
762         PR c++/68722
763         * parser.c (cp_parser_cache_defarg): When file ends in default
764         argument simply return error_mark_node.
766 2016-04-12  Nathan Sidwell  <nathan@acm.org>
768         PR c++/70501
769         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
770         similarly to PMF.
772 2016-04-11  Jason Merrill  <jason@redhat.com>
774         * mangle.c (decl_is_template_id): The template itself counts as a
775         template-id.
777 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
779         PR c++/70590
780         PR c++/70452
781         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
782         on the result if it's not a CONSTRUCTOR.
784 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
786         PR c++/70452
787         * constexpr.c (find_constructor): New function.
788         (unshare_constructor): New function.
789         (cxx_eval_call_expression): Use unshare_constructor instead of
790         unshare_expr.
791         (find_array_ctor_elt): Likewise.
792         (cxx_eval_vec_init_1): Likewise.
793         (cxx_eval_store_expression): Likewise.
794         (cxx_eval_constant_expression): Likewise.
796 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
798         PR c/70436
799         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
800         potentially generating a future -Wparentheses warning in its
801         callers.
803 2016-04-06  Jason Merrill  <jason@redhat.com>
805         * class.c (check_abi_tags): Fix function template handling.
807 2016-04-05  Nathan Sidwell  <nathan@acm.org>
809         PR c++/70512
810         * class.c (fixup_may_alias): New.
811         (fixup_attribute_variants): Call it.
813 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
815         PR c++/70452
816         * constexpr.c (struct fundef_copy): New struct.
817         (struct fundef_copies_table_t): New struct.
818         (fundef_copies_table): New static variable.
819         (maybe_initialize_fundef_copies_table): New static function.
820         (get_fundef_copy): New static function.
821         (save_fundef_copy): New static function.
822         (cxx_eval_call_expression): Use get_fundef_copy, and
823         save_fundef_copy.
824         (constexpr_call_table): Add "deletable" GTY marker.
826 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
828         PR c++/70452
829         * cp-tree.h (class cache_map): Remove.
830         * constexpr.c (cv_cache): Change type to
831         GTY((deletable)) hash_map<tree, tree> *.
832         (maybe_constant_value): Adjust following the change to cv_cache.
833         (clear_cv_cache): New static function.
834         (clear_cv_and_fold_caches): Use it.
835         * cp-gimplify.c (fold_cache): Change type to
836         GTY((deletable)) hash_map<tree, tree> *.
837         (clear_fold_cache): Adjust following the change to fold_cache.
838         (cp_fold): Likewise.
840 2016-04-02  Martin Sebor  <msebor@redhat.com>
842         PR c++/67376
843         PR c++/70170
844         PR c++/70172
845         PR c++/70228
846         * constexpr.c (diag_array_subscript): New function.
847         (cxx_eval_array_reference): Detect out of bounds array indices.
849 2016-04-01  Jason Merrill  <jason@redhat.com>
851         PR c++/70449
852         PR c++/70344
853         * pt.c (instantiate_decl): A function isn't fully defined if
854         DECL_INITIAL is error_mark_node.
855         * constexpr.c (cxx_eval_call_expression): Likewise.
857 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
858             Marek Polacek  <polacek@redhat.com>
860         PR c++/70488
861         * init.c (warn_placement_new_too_small): Test whether
862         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
864 2016-04-01  Nathan Sidwell  <nathan@acm.org>
866         PR c++/68475
867         * decl.c (check_redeclaration_exception_specification): Check
868         regardless of -fno-exceptions.
869         * typeck2.c (merge_exception_specifiers): Relax assert by checking
870         flag_exceptions too.
872 2016-03-31  Nathan Sidwell  <nathan@acm.org>
874         * decl.c (start_preparsed_function): Remove unnecessary bracing.
875         (finish_destructor_body): Don't emit operator delete here.
877 2016-03-31  Nathan Sidwell  <nathan@acm.org>
879         PR c++/70393
880         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
881         elements in field order.
883 2016-03-31  Marek Polacek  <polacek@redhat.com>
885         PR c/70297
886         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
888 2016-03-31  Richard Biener  <rguenther@suse.de>
890         PR c++/70430
891         * typeck.c (cp_build_binary_op): Fix operand order of vector
892         conditional in truth op handling.
894 2016-03-29  Jason Merrill  <jason@redhat.com>
896         PR c++/70353
897         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
898         in constexpr functions.
900 2016-03-28  Jason Merrill  <jason@redhat.com>
902         PR c++/70422
903         PR c++/64266
904         PR c++/70353
905         * decl.c, pt.c, constexpr.c: Revert last patch.
907 2016-03-25  Jason Merrill  <jason@redhat.com>
908             Martin LiÅ¡ka  <mliska@suse.cz>
910         PR c++/64266
911         PR c++/70353
912         Core issue 1962
913         * decl.c (cp_fname_init): Decay the initializer to pointer.
914         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
915         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
916         Don't call cp_finish_decl.
917         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
918         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
919         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
920         Handle DECL_VALUE_EXPR.
922 2016-03-24  Jason Merrill  <jason@redhat.com>
924         PR c++/70386
925         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
927         PR c++/70323
928         * constexpr.c (cxx_eval_call_expression): Don't cache result if
929         *overflow_p.
931 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
933         PR c++/62212
934         * tree.c (build_cplus_array_type): Determine type-dependentess
935         with uses_template_parms instead of with dependent_type_p.
937 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
939         PR c++/70347
940         * typeck.c (process_init_constructor_union): If the initializer
941         is empty, use the union's NSDMI if it has one.
943 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
945         PR c++/70332
946         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
947         NSDMI that's part of an aggregrate initialization.
949 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
951         PR c++/70001
952         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
953         for 1..max even for multi-dimensional arrays.  Call unshare_expr
954         on it.
956         PR c++/70323
957         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
958         on TREE_OVERFLOW constants.
960         PR c++/70376
961         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
962         for OMP_TASKLOOP here.
963         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
964         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
966 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
967             Jason Merrill  <jason@redhat.com>
968             Jakub Jelinek  <jakub@redhat.com>
970         PR c++/69315
971         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
972         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
973         (finish_function): Don't set or test them.
974         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
976 2016-03-23  Jason Merrill  <jason@redhat.com>
978         PR c++/70344
979         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
981 2016-03-23  Marek Polacek  <polacek@redhat.com>
983         PR c++/69884
984         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
986 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
988         * call.c (build_conditional_expr_1): Always use original
989         condition type for vector type checks and build.
991 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
993         PR c++/70096
994         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
996 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
998         PR c++/70204
999         * constexpr.c (non_const_var_error): Check
1000         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1002 2016-03-21  Richard Henderson  <rth@redhat.com>
1004         PR c++/70273
1005         * decl.c (notice_forced_label_r): New.
1006         (cp_finish_decl): Use it.
1008 2016-03-21  Jason Merrill  <jason@redhat.com>
1010         PR c++/70285
1011         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1013 2016-03-18  Jason Merrill  <jason@redhat.com>
1015         PR c++/70139
1016         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
1018         PR c++/70147
1019         * class.c (vptr_via_virtual_p): New.
1020         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
1021         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
1022         a vptr from any virtual base in a not-in-charge 'structor.
1024         * decl.c (build_clobber_this): Factor out of
1025         start_preparsed_function and begin_destructor_body.  Handle
1026         virtual bases better.
1028         * class.c (build_if_in_charge): Split out from build_base_path.
1029         * init.c (expand_virtual_init, expand_default_init): Use it.
1030         * call.c (build_special_member_call): Use it.
1032 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
1034         PR c++/70267
1035         * init.c (build_new_1): Complain and return error_mark_node
1036         if alloc_fn is not _Jv_AllocObject function returning pointer.
1038 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1040         PR c++/70205
1041         * search.c (adjust_result_of_qualified_name_lookup): Don't
1042         update the BASELINK_BINFO of DECL if the second call
1043         to lookup_base fails.
1045 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1047         PR c++/70218
1048         * parser.c (cp_parser_lambda_expression): Move call to
1049         pop_deferring_access_checks ahead of the call to
1050         cp_parser_end_tentative_firewall.
1052 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
1054         PR c++/70144
1055         * cp-tree.h (magic_varargs_p): Return int instead of bool.
1056         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
1057         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
1058         varargs.
1059         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
1060         if magic_varargs_p == 1, call decay_conversion
1061         instead of mark_type_use.  Don't store error_mark_node arguments to
1062         argarray, instead return error_mark_node.
1064         PR c++/70272
1065         * decl.c (begin_destructor_body): Don't insert clobber if
1066         is_empty_class (current_class_type).
1068 2016-03-17  Marek Polacek  <polacek@redhat.com>
1070         PR c++/70194
1071         * typeck.c (warn_for_null_address): New function.
1072         (cp_build_binary_op): Call it.
1074 2016-03-16  Jason Merrill  <jason@redhat.com>
1076         PR c++/70259
1077         * decl.c (start_preparsed_function): Don't clobber an empty base.
1079 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
1081         PR c++/70147
1082         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1083         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1085         PR c++/70147
1086         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1087         set in_base_initializer.
1089 2016-03-15  Marek Polacek  <polacek@redhat.com>
1091         PR c++/70209
1092         * tree.c (strip_typedefs): Call strip_typedefs again on the
1093         DECL_ORIGINAL_TYPE result.
1095 2016-03-15  Jason Merrill  <jason@redhat.com>
1097         PR c++/70095
1098         * pt.c (instantiate_decl): Fix call to variable_template_p.
1100         PR c++/70141
1101         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1103 2016-03-14  Casey Carter  <casey@carter.net>
1104             Jason Merrill  <jason@redhat.com>
1106         P0184R0: Generalizing the Range-Based For Loop
1107         * parser.c (cp_convert_range_for): Set the type of __end separately.
1108         (cp_parser_perform_range_for_lookup): Allow different begin/end
1109         types if they are comparable.
1111 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
1113         PR c++/70106
1114         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1115         processing_template_decl and EXPR is a SCOPE_REF.
1117 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
1118             Jakub Jelinek  <jakub@redhat.com>
1120         PR c++/70001
1121         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
1122         return value from cxx_eval_constant_expression from earlier
1123         elements if it is valid constant initializer requiring no
1124         relocations.
1126 2016-03-10  Marek Polacek  <polacek@redhat.com>
1128         PR c++/70153
1129         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1131 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
1133         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1134         when calling c_finish_omp_clauses.
1136 2016-03-08  Jason Merrill  <jason@redhat.com>
1138         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
1139         diagnostic for use of "concept".
1140         (cp_parser_requires_clause_opt): And "requires".
1141         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
1142         (cp_parser_explicit_template_declaration): Adjust.
1143         * Make-lang.in (check-c++-all): Add "concepts" to std list.
1145         P0036R0: Unary Folds and Empty Parameter Packs
1146         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1148 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
1150         PR c++/70135
1151         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1152         even after the last iteration of the loop.
1154         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1156 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
1158         PR c++/66786
1159         * pt.c (get_template_info): Handle PARM_DECL.
1160         (template_class_depth): Check DECL_P instead of
1161         VAR_OR_FUNCTION_DECL_P.
1163 2016-03-05  Jason Merrill  <jason@redhat.com>
1165         PR c++/67364
1166         * constexpr.c (cxx_eval_store_expression): Replace
1167         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1169 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
1171         PR c++/66786
1172         * pt.c (template_class_depth): Given a lambda type, iterate
1173         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
1174         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
1175         CP_DECL_CONTEXT.
1177 2016-03-04  Jason Merrill  <jason@redhat.com>
1179         PR c++/69203
1180         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
1181         * init.c (build_vec_delete_1): Set it.
1182         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
1184 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
1186         * decl.c (start_preparsed_function): Don't emit start clobber at the
1187         start of constructor clones.
1189         PR c++/70035
1190         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
1191         * decl.c (start_preparsed_function): Call
1192         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
1193         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
1194         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
1196 2016-03-04  Jason Merrill  <jason@redhat.com>
1198         PR c++/67364
1199         * constexpr.c (cxx_eval_component_reference): Further tweak.
1201         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
1202         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
1203         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
1204         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
1206         PR c++/70067
1207         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1208         same type.
1210 2016-03-03  Jason Merrill  <jason@redhat.com>
1212         * method.c (synthesized_method_walk): operator= can also be constexpr.
1214         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1215         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1217         PR c++/67164
1218         * pt.c (copy_template_args): New.
1219         (tsubst_pack_expansion): Use it.
1221         * call.c (build_aggr_conv): Use get_nsdmi.
1223         PR c++/51406
1224         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1226         PR c++/67364
1227         * constexpr.c (cxx_eval_component_reference): Just return an empty
1228         CONSTRUCTOR for an empty class.
1230 2016-03-01  Jason Merrill  <jason@redhat.com>
1232         PR c++/70036
1233         * parser.c (cp_parser_requires_clause): Call
1234         check_for_bare_parameter_packs.
1236         PR c++/51489
1237         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1238         the operands.
1240         PR c++/69995
1241         * constexpr.c (cxx_eval_call_expression): Unshare arg.
1242         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1243         [TARGET_EXPR]: Unshare init.
1245 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
1247         PR c++/68948
1248         PR c++/69961
1249         * pt.c (tsubst_baselink): Reinstate the check for an invalid
1250         constructor call.
1252 2016-02-28  Jason Merrill  <jason@redhat.com>
1254         PR c++/69995
1255         * constexpr.c (cxx_eval_store_expression): Unshare init.
1257 2016-02-26  Jason Merrill  <jason@redhat.com>
1259         PR c++/69958
1260         * pt.c (make_argument_pack): New.
1261         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1262         (tsubst_copy_and_build): Likewise.
1264 2016-02-25  Jason Merrill  <jason@redhat.com>
1266         PR c++/69889
1267         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
1268         * tree.c (build_aggr_init_expr): Set it.
1269         * semantics.c (simplify_aggr_init_expr): Check it.
1270         * cp-gimplify.c (cp_genericize_r): Don't walk into
1271         a call/aggr_init from a thunk.
1273         PR c++/69842
1274         * method.c (forward_parm): Handle parameter packs.
1275         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1277         PR c++/67364
1278         * constexpr.c (cxx_eval_component_reference): Don't complain about
1279         unevaluated empty classes.
1281         PR c++/68049
1282         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1284 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
1286         PR c++/69736
1287         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
1288         (maybe_undo_parenthesized_ref): Declare.
1289         * semantics.c (maybe_undo_parenthesized_ref): Split out from
1290         check_return_expr.
1291         (finish_call_expr): Use it.
1292         * typeck.c (check_return_expr): Use it.
1293         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
1294         REF_PARENTHESIZED_P flag.
1296 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
1298         PR c++/69922
1299         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1300         Avoid folding it.
1301         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
1302         tests.
1303         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
1304         unless they are folded into INTEGER_CST, error_mark_node or some
1305         comparison with NULL, avoid folding them and use either the original
1306         comparison or non-folded comparison of folded arguments.
1307         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
1308         comparison, don't fold the comparison right away.
1310 2016-02-24  Jason Merrill  <jason@redhat.com>
1312         PR c++/69323
1313         * friend.c (make_friend_class): Likewise.
1314         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1316 2016-02-24  Jason Merrill  <jason@redhat.com>
1318         PR c++/69323
1319         * pt.c (instantiate_class_template_1): Set
1320         processing_template_decl before substituting friend_type.
1322 016-02-24  Martin Sebor  <msebor@redhat.com>
1324         PR c++/69912
1325         * tree.c (build_ctor_subob_ref): Compare types' main variants
1326         instead of the types as they are.
1328 2016-02-24  Jason Merrill  <jason@redhat.com>
1330         * decl.c (start_preparsed_function): Condition ctor clobber on
1331         flag_lifetime_dse > 1.
1333         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1335 2016-02-19  Jason Merrill  <jason@redhat.com>
1337         PR c++/69743
1338         * call.c (remaining_arguments): No longer static.
1339         * cp-tree.h: Declare it.
1340         * pt.c (more_specialized_fn): Use it.
1342 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1343             Bernd Edlinger  <bernd.edlinger@hotmail.de>
1345         * Make-lang.in: Invoke gperf with -L C++.
1346         * cfns.gperf: Remove prototypes for hash and libc_name_p
1347         inlines.
1348         * cfns.h: Regenerated.
1349         * except.c (nothrow_libfn_p): Adjust.
1351 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1353         PR c++/69850
1354         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1355         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1357 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
1359         PR c++/68948
1360         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1361         call here.
1362         * semantics.c (finish_call_expr): Don't assume a constructor
1363         call is dependent if only the "this" pointer is dependent.  When
1364         building a constructor call, always use a dummy object.
1366 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1368         PR c++/69850
1369         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1370         condition.
1371         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1372         operators if folding preserved the binop, just with different
1373         arguments.
1375         PR c++/67767
1376         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1377         attr_spec is always single element chain, chain all the attributes
1378         properly together in the right order.
1380 2016-02-18  Jason Merrill  <jason@redhat.com>
1382         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
1383         mangle_decl.
1384         (mangle_decl): Call maybe_check_abi_tags for function scope.
1385         (mangle_guard_variable): Call maybe_check_abi_tags here.
1386         (write_guarded_var_name): Not here.
1388 2016-02-17  Jason Merrill  <jason@redhat.com>
1390         PR c++/65985
1391         * constexpr.c (build_constexpr_constructor_member_initializers):
1392         Handle an additional STATEMENT_LIST.
1394         PR c++/68585
1395         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1397         PR c++/68679
1398         * decl2.c (reset_type_linkage_2): Look through member templates.
1400 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
1402         PR c++/69850
1403         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1405 2016-02-17  Jason Merrill  <jason@redhat.com>
1407         PR c++/69842
1408         * method.c (forward_parm): Split out from...
1409         (add_one_base_init): ...here.
1410         * lambda.c (maybe_add_lambda_conv_op): Use it.
1412 2016-02-16  Jason Merrill  <jason@redhat.com>
1414         PR c++/10200
1415         PR c++/69753
1416         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1417         tree.c, typeck2.c: Revert earlier changes.
1418         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1419         non-type templates after -> or .
1421 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
1423         PR c/69835
1424         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1426 2016-02-16  Jason Merrill  <jason@redhat.com>
1428         PR c++/69657
1429         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1430         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
1431         * name-lookup.h: Adjust.
1433 2016-02-16  James Norris  <jnorris@codesourcery.com>
1435         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1436         * semantics.c (finish_omp_clauses): Add deviceptr checking.
1438 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1440         PR c++/69658
1441         * init.c (expand_default_init): Only call reshape_init
1442         in the direct-initialization from an initializer list case.
1444 2016-02-15  Jason Merrill  <jason@redhat.com>
1446         PR c++/69753
1447         * semantics.c (finish_call_expr): Implicit 'this' does not make
1448         the call dependent.
1449         * search.c (any_dependent_bases_p): Split out...
1450         * name-lookup.c (do_class_using_decl): ...from here.
1451         * call.c (build_new_method_call_1): Don't complain about missing object
1452         if there are dependent bases.  Tweak error.
1453         * tree.c (non_static_member_function_p): Remove.
1454         * pt.c (type_dependent_expression_p): A member template of a
1455         dependent type is dependent.
1456         * cp-tree.h: Adjust.
1458         PR c++/68890
1459         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1461 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1463         PR c++/69098
1464         * pt.c (lookup_and_finish_template_variable): New function,
1465         extracted from ...
1466         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1467         (tsubst_qualified_id): Consider that EXPR might be a variable
1468         template.
1469         * typeck.c (check_template_keyword): Don't emit an error
1470         if DECL is a variable template.
1472 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1474         * error.c: Spelling fixes - behaviour -> behavior and
1475         neighbour -> neighbor.
1476         * decl.c: Likewise.
1477         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1478         diagnostics.
1479         * init.c (build_delete): Likewise.
1481 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1483         PR c/69768
1484         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1485         arguments for -Waddress warning.  Fix up formatting.
1487 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1489         PR c++/68726
1490         * pt.c (lookup_template_class_1): Check tsubst return value for
1491         error_mark_node.
1493 2016-02-10  Jason Merrill  <jason@redhat.com>
1495         PR c++/68926
1496         * pt.c (resolve_nondeduced_context): Add complain parm.
1497         (do_auto_deduction): Pass it.
1498         * cvt.c (convert_to_void): Likewise.
1499         * decl.c (cp_finish_decl): Likewise.
1500         * init.c (build_new): Likewise.
1501         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1502         * semantics.c (finish_decltype_type): Likewise.
1503         * typeck.c (decay_conversion): Likewise.
1504         * cp-tree.h: Adjust declaration.
1505         * call.c (standard_conversion): Add complain parm, pass it along.
1506         (implicit_conversion): Pass it.
1508         PR c++/69657
1509         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1510         (lookup_name_real_1): Likewise.
1511         (remove_hidden_names): Handle non-functions too.
1513         PR c++/10200
1514         * parser.c (cp_parser_lookup_name): When looking for a template
1515         after . or ->, only consider class templates.
1516         (cp_parser_postfix_dot_deref_expression): Handle the current
1517         instantiation.  Remember a dependent object expression.
1518         * typeck2.c (build_x_arrow): Handle the current instantiation.
1520         * ptree.c (debug_tree): Implement for cp_expr.
1522 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1524         PR c++/69139
1525         * parser.c (cp_parser_simple_type_specifier): Make the check
1526         for disambiguating between an 'auto' placeholder and an implicit
1527         template parameter more robust.
1529 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1531         PR c++/69283
1532         PR c++/67835
1533         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1534         setting its TREE_USED flag.
1536 2016-02-08  Jason Merrill  <jason@redhat.com>
1538         PR c++/69657
1539         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1540         built-ins alone.
1542 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1544         PR c++/59627
1545         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1546         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1548 2016-02-08  Marek Polacek  <polacek@redhat.com>
1550         PR c++/69688
1551         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1552         Call clear_fold_cache.
1553         * cp-tree.h: Adjust declaration.
1554         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1555         rather than clear_cv_cache and clear_fold_cache.
1556         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1558 2016-02-08  Jason Merrill  <jason@redhat.com>
1560         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1561         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1562         (ocp_convert): Use *_maybe_fold.
1563         (cp_convert_to_pointer): Add dofold parameter.
1564         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1566 2016-02-05  Martin Sebor  <msebor@redhat.com>
1568         PR c++/69662
1569         * init.c (find_field_init): New function.
1570         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1571         at ends of structures special.
1573 2016-02-05  Jason Merrill  <jason@redhat.com>
1575         PR c++/68948
1576         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1577         make sure we've seen_error().
1579 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1581         PR c++/68948
1582         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1583         if lookup_fnfields returns NULL_TREE and the name being looked
1584         up has the form A::A.
1586 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1588         * constexpr.c (cxx_eval_binary_expression): Fold equality
1589         comparisons involving PTRMEM_CSTs.
1591 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1593         * class.c (find_flexarrays): Don't declare dom variable.
1594         (diagnose_flexarray): Likewise.
1596 2016-02-02  Martain Sebor  <msebor@redhat.com>
1598         PR c++/69251
1599         PR c++/69253
1600         PR c++/69290
1601         PR c++/69277
1602         PR c++/69349
1603         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1604         of a flexible array member for equality to null.
1605         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1606         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1607         (check_flexarrays): Same.
1608         * decl.c (compute_array_index_type): Avoid special case for flexible
1609         array members.
1610         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1611         array members.
1612         * error.c (dump_type_suffix): Revert changes introduced in r231665
1613         and rendered unnecessary by the changes above.
1614         * pt.c (tsubst):  Same.
1615         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1616         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1617         (process_init_constructor_array): Same.
1618         (process_init_constructor_record): Same.
1620 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1622         PR c++/69056
1623         * pt.c (try_one_overload): Handle comparing argument packs so
1624         that there is no conflict if we deduced more arguments of an
1625         argument pack than were explicitly specified.
1627 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1628             Jason Merrill  <jason@redhat.com>
1630         PR c++/68763
1631         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1632         function type if nothing is changing.
1634 2016-01-31  Jason Merrill  <jason@redhat.com>
1636         PR c++/69009
1637         * pt.c (partial_specialization_p, impartial_args): New.
1638         (instantiate_decl): Call impartial_args.
1640         * mangle.c (maybe_check_abi_tags): New.
1641         (write_guarded_var_name): Call it.
1642         (mangle_ref_init_variable): Call check_abi_tags.
1644         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1645         between template and instantiation.
1647 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1649         PR debug/66869
1650         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1651         function declarations.
1653 2016-01-29  Marek Polacek  <polacek@redhat.com>
1655         PR c++/69509
1656         PR c++/69516
1657         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1658         out of bound" error earlier.
1659         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1660         commentary.
1662 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1664         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1665         structure, update free_binding_level before the structure's
1666         level_chain field gets cleared, not after.
1668 2016-01-28  Jason Merrill  <jason@redhat.com>
1670         PR c++/67407
1671         * search.c (dfs_walk_once, dfs_walk_once_r)
1672         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1673         hash_set instead of BINFO_MARKED.
1674         (dfs_unmark_r): Remove.
1676 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1678         PR c++/24208
1679         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1680         (cp_lexer_debugging_p): Use it.
1681         (cp_lexer_start_debugging): Likewise.
1682         (cp_lexer_stop_debugging): Likewise.
1684 2016-01-27  Marek Polacek  <polacek@redhat.com>
1686         PR c/68062
1687         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1688         needed.  Add -Wsign-compare warning.
1690 2016-01-27  Ryan Burn  <contact@rnburn.com>
1692         PR cilkplus/69267
1693         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1694         superfluous post_p argument in call to
1695         cilk_gimplify_call_params_in_spawned_fn.
1697 2016-01-27  Marek Polacek  <polacek@redhat.com>
1699         PR c++/69379
1700         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1701         wrapped in NOP_EXPRs.
1703 2016-01-27  Martin Sebor  <msebor@redhat.com>
1705         PR c++/69317
1706         * mangle.c (mangle_decl): Reference the correct (saved) version
1707         of the ABI in -Wabi diagnostics.
1709 2016-01-27  Marek Polacek  <polacek@redhat.com>
1711         PR c++/69496
1712         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1713         elements of the array.
1715 2016-01-26  Jason Merrill  <jason@redhat.com>
1717         PR c++/68949
1718         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1719         (cxx_eval_call_expression): Don't look through clones.
1720         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1721         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1722         maybe-in-charge *tor.
1724 2016-01-26  Jason Merrill  <jason@redhat.com>
1726         PR c++/68782
1727         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1728         and TREE_SIDE_EFFECTS.
1729         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1730         verify_constructor_flags.
1732 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1734         PR c++/68357
1735         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1736         return error_mark_node instead of building trees with error_mark_node
1737         operands.
1739 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1741         PR other/69006
1742         * error.c (print_instantiation_partial_context_line): Add missing
1743         newlines from output for the t == NULL case.
1744         (print_instantiation_partial_context): Remove call to pp_newline.
1746 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
1748         Revert:
1749         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1751         PR c++/11858
1752         PR c++/24663
1753         PR c++/24664
1754         * decl.c (grokdeclarator): Don't decay array parameter type to
1755         a pointer type if it's dependent.
1756         (grokparms): Invoke strip_top_quals instead of directly invoking
1757         cp_build_qualified_type.
1758         * pt.c (decay_dependent_array_parm_type): New static function.
1759         (type_unification_real): Call decay_dependent_array_parm_type
1760         to decay a dependent array parameter type to its corresponding
1761         pointer type before unification.
1762         (more_specialized_fn): Likewise.
1763         (get_bindings): Likewise.
1764         * tree.c (cp_build_qualified_type): Trivial typofix in
1765         documentation.
1767 2016-01-23  Martin Sebor  <msebor@redhat.com>
1769         PR c++/58109
1770         PR c++/69022
1771         * decl2.c (is_late_template_attribute): Handle dependent argument
1772         to attribute align and attribute vector_size.
1774 2016-01-21  Jason Merrill  <jason@redhat.com>
1776         PR c++/69392
1777         * lambda.c (lambda_capture_field_type): Handle 'this' specially
1778         for init-capture, too.
1780         PR c++/65687
1781         * decl.c (type_is_deprecated): Don't look into a typedef.
1783         PR c++/40751
1784         PR c++/64987
1785         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1787         PR c++/43407
1788         * decl.c (start_enum): Add attributes parameter.
1789         * parser.c (cp_parser_enum_specifier): Pass it.
1790         * pt.c (lookup_template_class_1): Pass it.
1791         * cp-tree.h: Adjust.
1793 2016-01-19  Jason Merrill  <jason@redhat.com>
1795         PR c++/59759
1796         * pt.c (convert_template_argument): Handle VAR_DECL properly.
1798 2016-01-19  Marek Polacek  <polacek@redhat.com>
1800         PR c++/68586
1801         * constexpr.c (clear_cv_cache): New.
1802         * cp-gimplify.c (clear_fold_cache): New.
1803         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1804         * decl.c (finish_enum_value_list): Call them.
1806         PR c++/68965
1807         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1809 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1811         PR c++/11858
1812         PR c++/24663
1813         PR c++/24664
1814         * decl.c (grokdeclarator): Don't decay array parameter type to
1815         a pointer type if it's dependent.
1816         (grokparms): Invoke strip_top_quals instead of directly invoking
1817         cp_build_qualified_type.
1818         * pt.c (decay_dependent_array_parm_type): New static function.
1819         (type_unification_real): Call decay_dependent_array_parm_type
1820         to decay a dependent array parameter type to its corresponding
1821         pointer type before unification.
1822         (more_specialized_fn): Likewise.
1823         (get_bindings): Likewise.
1824         * tree.c (cp_build_qualified_type): Trivial typofix in
1825         documentation.
1827 2016-01-18  Jason Merrill  <jason@redhat.com>
1829         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1831         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1833         PR c++/68767
1834         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
1835         (contains_label_1, contains_label_p): Remove.
1837 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1839         PR c++/69091
1840         * pt.c (type_dependent_expression_p): For a function template
1841         specialization, a type is dependent iff any of its template
1842         arguments are.
1844 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1846         * cp-array-notation.c (cp_expand_cond_array_notations): Return
1847         error_mark_node only if find_rank failed, not if it was
1848         successful.
1850 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1852         PR c++/68936
1853         * tree.c (build_min_non_dep_call_vec): Don't retain the
1854         KOENIG_LOOKUP_P flag of the non-dependent expression that's
1855         been built.
1856         (build_min_non_dep_op_overload): Instead, do it here.
1858 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
1860         PR bootstrap/68271
1861         * parser.h (cp_token): Remove pragma_kind field.  Add comment
1862         with number of unused bits.
1863         * parser.c (eof_token): Remove pragma_kind field initializer.
1864         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1865         field, don't clear CPP_PRAGMA u.value.
1866         (cp_parser_pragma_kind): New function.
1867         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1868         cp_parser_omp_construct, cp_parser_initial_pragma,
1869         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1870         pragma_kind field.
1872 2016-01-15  Jason Merrill  <jason@redhat.com>
1874         PR c++/68847
1875         * call.c (build_cxx_call): Use fold_non_dependent_expr.
1877         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1878         value.
1880         PR c++/69257
1881         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1882         array/function-to-pointer conversion.  Call
1883         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1884         * call.c (convert_like_real): Print call context if
1885         decay_conversion errors.
1887 2016-01-14  Tom de Vries  <tom@codesourcery.com>
1889         PR tree-optimization/68773
1890         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1891         set force_output.
1893 2016-01-14  Jason Merrill  <jason@redhat.com>
1895         PR c++/69261
1896         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
1898 2016-01-12  Marek Polacek  <polacek@redhat.com>
1900         PR c++/68979
1901         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
1902         error_at and adjust the return value.
1904 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
1906         PR objc++/68511
1907         PR c++/69213
1908         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
1909         GS_ERROR whenever seen_error (), only if *expr_p contains
1910         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
1912         PR c++/66808
1913         PR c++/69000
1914         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
1916 2016-01-11  Jason Merrill  <jason@redhat.com>
1918         PR c++/69131
1919         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
1920         (process_subob_fn): Likewise.  Don't consider triviality if true.
1921         (synthesize_method_walk): Pass it.
1923 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
1925         PR c++/68795
1926         * parser.c (cp_parser_postfix_expression): Initialize
1927         close_paren_loc to UNKNOWN_LOCATION; only use it if
1928         it has been written to by
1929         cp_parser_parenthesized_expression_list.
1930         (cp_parser_parenthesized_expression_list): Document the behavior
1931         with respect to the CLOSE_PAREN_LOC param.
1933 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
1935         PR c++/69211
1936         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1937         folded operands have side-effects, but folding changed any of them,
1938         build a new tree with the folded operands instead of returning the
1939         unfolded tree.
1941 2016-01-09  Marek Polacek  <polacek@redhat.com>
1943         PR c++/69113
1944         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1946 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
1948         PR c++/69164
1949         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1951 2016-01-08  Jason Merrill  <jason@redhat.com>
1953         PR c++/69158
1954         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1955         in completion.
1957 2016-01-08  Marek Polacek  <polacek@redhat.com>
1959         PR c++/68449
1960         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1962 2016-01-08  Jason Merrill  <jason@redhat.com>
1964         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1965         workaround.
1967         PR c++/68983
1968         PR c++/67557
1969         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1970         TREE_ADDRESSABLE type.
1972         PR c++/68983
1973         PR c++/67557
1974         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1976 2016-01-05  Nathan Sidwell  <nathan@acm.org>
1978         PR c++/58583
1979         * pt.c (build_non_dependent_expr): Don't try a checking fold when
1980         parsing an nsdmi.
1982 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1984         Update copyright years.
1986 Copyright (C) 2016 Free Software Foundation, Inc.
1988 Copying and distribution of this file, with or without modification,
1989 are permitted in any medium without royalty provided the copyright
1990 notice and this notice are preserved.