Fix cleanup location for try_finally_expr.
[platform/upstream/linaro-gcc.git] / gcc / cp / ChangeLog
1 2017-07-06  Vyacheslav Barinov  <v.barinov@samsung.com>
2
3         * parser.c (cp_parser_compound_statement): Use STATEMENT_LIST_END
4         to keep the location of closing brace.
5         * pt.c: Handle STATEMENT_LIST_END.
6         * constexpr.c (cxx_eval_constant_expression): Likewise.
7
8 2017-01-26  Jason Merrill  <jason@redhat.com>
9
10         PR c++/79176 - lambda ICE with -flto -Os
11         * decl2.c (vague_linkage_p): Handle decloned 'tors.
12         * tree.c (decl_linkage): Likewise.
13
14 2017-01-20  Marek Polacek  <polacek@redhat.com>
15         
16         Backported from mainline
17         2017-01-04  Marek Polacek  <polacek@redhat.com>
18
19         PR c++/77545
20         PR c++/77284
21         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
22
23 2017-01-17  Jakub Jelinek  <jakub@redhat.com>
24
25         Backported from mainline
26         2017-01-11  Jakub Jelinek  <jakub@redhat.com>
27
28         PR c++/78341
29         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
30         assertion.  Formatting fix.
31
32         2017-01-04  Jakub Jelinek  <jakub@redhat.com>
33
34         PR c++/78949
35         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
36         vector type.
37
38         PR c++/78693
39         * parser.c (cp_parser_simple_declaration): Only complain about
40         inconsistent auto deduction if auto_result doesn't use auto.
41
42         PR c++/71182
43         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
44         assertion, as lexer->buffer may be NULL.
45
46 2017-01-11  Nathan Sidwell  <nathan@acm.org>
47
48         PR c++/77812
49         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
50         is a new overload.
51
52 2016-12-21  Release Manager
53
54         * GCC 6.3.0 released.
55
56 2016-12-14  Nathan Sidwell  <nathan@acm.org>
57
58         PR c++/78701
59         * pt.c (type_unification_real): Check tsubst arg doesn't have
60         remaining template parms before converting it.
61
62 2016-12-08  Nathan Sidwell  <nathan@acm.org>
63
64         PR c++/78551
65         * constexpr.c (extract_string_elt): New.  Broken out of ...
66         (cxx_eval_array_reference): ... here.  Call it.
67         (cxx_eval_store_expression): Convert init by STRING_CST into
68         CONSTRUCTOR, if needed.
69
70 2016-12-07  Jakub Jelinek  <jakub@redhat.com>
71
72         Backported from mainline
73         2016-12-02  Jakub Jelinek  <jakub@redhat.com>
74
75         PR c++/78649
76         * pt.c (tsubst_init): Don't call build_value_init if decl's type
77         is error_mark_node.
78
79         2016-11-28  Jakub Jelinek  <jakub@redhat.com>
80                     Jason Merrill  <jason@redhat.com>
81
82         PR c++/72808
83         * decl.c (finish_enum_value_list): Call fixup_type_variants on
84         current_class_type after
85         insert_late_enum_def_into_classtype_sorted_fields.
86
87         2016-11-28  Jakub Jelinek  <jakub@redhat.com>
88
89         PR c++/77591
90         * typeck.c (maybe_warn_about_returning_address_of_local): Optimize
91         whats_returned through fold_for_warn.
92
93         2016-11-23  Jakub Jelinek  <jakub@redhat.com>
94
95         PR c++/77739
96         * cp-gimplify.c (cp_gimplify_tree) <case VEC_INIT_EXPR>: Pass
97         false as handle_invisiref_parm_p to cp_genericize_tree.
98         (struct cp_genericize_data): Add handle_invisiref_parm_p field.
99         (cp_genericize_r): Don't wrap is_invisiref_parm into references
100         if !wtd->handle_invisiref_parm_p.
101         (cp_genericize_tree): Add handle_invisiref_parm_p argument,
102         set wtd.handle_invisiref_parm_p to it.
103         (cp_genericize): Pass true as handle_invisiref_parm_p to
104         cp_genericize_tree.  Formatting fix.
105
106         2016-11-18  Jakub Jelinek  <jakub@redhat.com>
107
108         PR c++/77285
109         * mangle.c (mangle_tls_init_fn, mangle_tls_wrapper_fn): Call
110         check_abi_tags.
111
112         2016-10-31  Jakub Jelinek  <jakub@redhat.com>
113
114         PR c++/78089
115         * parser.c (cp_parser_postfix_expression): Replace return statement in
116         the first switch with setting postfix_expression to the return
117         expression and break;.
118
119         2016-09-28  Jakub Jelinek  <jakub@redhat.com>
120
121         PR c++/77467
122         * constexpr.c (enum constexpr_switch_state): New.
123         (struct constexpr_ctx): Add css_state field.
124         (label_matches): Add CTX and STMT arguments, remove I and
125         DEFAULT_LABEL.  For CASE_LABEL_EXPR assert ctx->css_state != NULL,
126         handle default labels according to css_state.
127         (cxx_eval_statement_list): Remove statement skipping, label_matches
128         and default_label handling code.
129         (cxx_eval_loop_expr): Exit after first iteration even if
130         switches (jump_target).
131         (cxx_eval_switch_expr): Set up css_state field in ctx, if default
132         label has been seen in the body, but no cases matched, evaluate
133         the body second time.
134         (cxx_eval_constant_expression): Handle stmt skipping and label_matches
135         here.  Handle PREDICT_EXPR.  For MODIFY_EXPR or INIT_EXPR, assert
136         statement is not skipped.  For COND_EXPR during skipping, don't
137         evaluate condition, just the then block and if still skipping at the
138         end also the else block.
139         (cxx_eval_outermost_constant_expr): Adjust constexpr_ctx initializer.
140         (is_sub_constant_expr): Likewise.
141
142         2016-09-27  Jakub Jelinek  <jakub@redhat.com>
143
144         PR c++/77722
145         * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Instrument also
146         functions that have just a STATEMENT_LIST instead of BIND_EXPR, or
147         BIND_EXPR with some statement rather than STATEMENT_LIST as body.
148
149         2016-09-20  Jakub Jelinek  <jakub@redhat.com>
150
151         PR c++/77638
152         * parser.c (cp_parser_template_declaration_after_parameter): For 2
153         argument operator"" template set ok to false for
154         parm == error_mark_node.
155
156         PR c++/77637
157         * parser.c (cp_parser_std_attribute_list): Reject ... without
158         preceding attribute.
159
160         2016-09-16  Jakub Jelinek  <jakub@redhat.com>
161
162         PR c++/77482
163         * error.c (dump_simple_decl): Only check DECL_DECLARED_CONCEPT_P
164         if DECL_LANG_SPECIFIC is non-NULL.  Fix up formatting.
165
166         PR c++/77375
167         * class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any
168         TYPE_HAS_MUTABLE_P for any bases.
169
170 2016-12-06  Jason Merrill  <jason@redhat.com>
171
172         PR c++/71274
173         * decl2.c (maybe_instantiate_decl): Split out from mark_used.
174         (decl_constant_var_p): Use it instead.
175
176         PR c++/71515
177         * pt.c (resolve_typename_type): Try to avoid calling
178         currently_open_class.
179
180         PR c++/77907
181         * constexpr.c (cxx_eval_constant_expression): Use cp_fold_convert.
182
183         PR c++/57728
184         * pt.c (do_type_instantiation): Don't mess with non-user-provided
185         member functions.
186
187 2016-11-18  Jason Merrill  <jason@redhat.com>
188
189         PR c++/67631 - list-init and explicit conversions
190         * semantics.c (finish_compound_literal): Call digest_init_flags.
191         * typeck2.c (digest_init_flags): Add complain parm.
192         (store_init_value): Pass it.
193
194 2016-11-17  Jason Merrill  <jason@redhat.com>
195
196         PR c++/68377
197         * parser.c (cp_parser_fold_expression): Check TREE_NO_WARNING.
198
199 2016-11-05  Martin Sebor  <msebor@redhat.com>
200
201         PR c++/78039
202         * class.c (diagnose_flexarrays): Avoid rejecting an invalid flexible
203         array member with a hard error when it is followed by another member
204         in a different struct, and instead issue just a pedantic warning.
205
206 2016-10-14  Martin Sebor  <msebor@redhat.com>
207
208         PR c++/71912
209         * class.c (struct flexmems_t):  Add members.
210         (find_flexarrays): Add arguments.  Correct handling of anonymous
211         structs.
212         (diagnose_flexarrays): Adjust to issue warnings in addition to errors.
213         (check_flexarrays): Add argument.
214         (diagnose_invalid_flexarray): New functions.
215
216 2016-10-04  Martin Sebor  <msebor@redhat.com>
217
218         PR c++/77804
219         * init.c (warn_placement_new_too_small): Avoid assuming an array type
220         has a constant size.
221
222 2016-09-22  Paolo Carlini  <paolo.carlini@oracle.com>
223
224         PR c++/71979
225         * class.c (build_base_path): Allow for lookup_base returning
226         NULL_TREE.
227
228 2016-09-16  Jakub Jelinek  <jakub@redhat.com>
229
230         Backported from mainline
231         2016-09-13  Jakub Jelinek  <jakub@redhat.com>
232
233         PR c++/77553
234         * constexpr.c (cxx_fold_pointer_plus_expression): New function.
235         (cxx_eval_binary_expression): Use it for POINTER_PLUS_EXPR.
236         (cxx_eval_pointer_plus_expression): Remove.
237         (cxx_eval_constant_expression) <case POINTER_PLUS_EXPR>: Don't
238         call cxx_eval_pointer_plus_expression.
239
240 2016-09-14  Nathan Sidwell  <nathan@acm.org>
241
242         PR c++/77539
243         * constexpr.c (get_fundef_copy): Use the original function for
244         non-recursive evaluations.
245         (save_fundef_copy): Always expect a slot to be available.
246
247 2016-08-22  Release Manager
248
249         * GCC 6.2.0 released.
250
251 2016-08-13  Jason Merrill  <jason@redhat.com>
252
253         PR c++/71972
254         * constexpr.c (cxx_eval_array_reference): Handle looking for the
255         value of an element we're currently modifying.
256
257 2016-08-11  Jakub Jelinek  <jakub@redhat.com>
258
259         PR c++/72868
260         * constexpr.c (label_matches): Handle case range expressions.
261
262 2016-08-11  Jason Merrill  <jason@redhat.com>
263
264         PR c++/73456
265         * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION.
266
267 2016-08-08  Paolo Carlini  <paolo.carlini@oracle.com>
268
269         PR c++/72800
270         * lambda.c (add_capture): Check lambda_capture_field_type return
271         value for error_mark_node.
272
273 2016-08-05  Nathan Sidwell  <nathan@acm.org>
274
275         PR c++/68724
276         * pt.c (unify): TRAIT_EXPR is an expr.
277
278 2016-08-04  Jason Merrill  <jason@redhat.com>
279
280         PR c++/72415
281         * pt.c (tsubst_pack_expansion): Pull a single pack expansion out
282         of the TREE_VEC.
283
284 2016-07-29  Jason Merrill  <jason@redhat.com>
285
286         PR c++/72457
287         * init.c (expand_aggr_init_1): Only handle value-init of bases.
288         * constexpr.c (build_data_member_initialization): Handle multiple
289         initializers for the same field.
290
291 2016-07-25  Jason Merrill  <jason@redhat.com>
292
293         PR c++/71576
294         * call.c (convert_like_real): Use lvalue_kind.
295
296         PR c++/71833
297         * pt.c (coerce_template_parameter_pack): Fix logic for
298         pack index.
299
300 2016-07-23  Jason Merrill  <jason@redhat.com>
301
302         PR c++/55922
303         PR c++/63151
304         * init.c (expand_aggr_init_1): Handle list-initialization from {}.
305
306         PR c++/70709
307         * class.c (walk_subobject_offsets): Handle 0-length array.
308
309         PR c++/70778
310         * pt.c (tsubst): Also substitute into the template of a
311         BOUND_TEMPLATE_TEMPLATE_PARM.
312
313         PR c++/71738
314         * pt.c (lookup_template_class_1): Handle getting template from tsubst.
315
316         PR c++/71350
317         * decl.c (reshape_init_r): Check complain for missing braces warning.
318
319 2016-07-22  Jason Merrill  <jason@redhat.com>
320
321         PR c++/71748
322         PR c++/52746
323         * pt.c (tsubst_baselink): Call
324         adjust_result_of_qualified_name_lookup for unqualified
325         destructors.
326
327 2016-07-21  Jason Merrill  <jason@redhat.com>
328
329         PR c++/69223
330         * semantics.c (apply_deduced_return_type): Call
331         complete_type_or_else before building the new RESULT_DECL.
332
333         PR c++/71630
334         * pt.c (instantiate_decl): Fix pattern_defined for namespace scope
335         variable templates.
336
337         PR c++/71913
338         * call.c (unsafe_copy_elision_p): It's OK to elide when
339         initializing an unknown object.
340
341 2016-07-21  Jakub Jelinek  <jakub@redhat.com>
342
343         PR c++/71728
344         * constexpr.c (potential_constant_expression_1) <case GOTO_EXPR>:
345         Replace assert with test, return false if the goto isn't break
346         or continue.  Formatting fix.
347
348 2016-07-21  Jakub Jelinek  <jakub@redhat.com>
349
350         PR c++/71941
351         * cp-gimplify.c (cp_genericize): For nested cp_genericize calls
352         save/restore bc_label array.
353
354 2016-07-21  Patrick Palka  <ppalka@gcc.gnu.org>
355
356         PR c++/70822
357         PR c++/70106
358         * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
359         SCOPE_REFs too.
360         * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
361         on the qualified_id then propagate it to the resulting
362         expression.
363         (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
364         too.
365         * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
366         its REF_PARENTHESIZED_P flag.
367
368 2016-07-21  Andrew Sutton  <andrew.n.sutton@gmail.com>
369             Jason Merrill  <jason@redhat.com>
370
371         Improving concepts performance and diagnostics.
372         PR c++/67565
373         PR c++/67579
374         PR c++/71843
375         * cp-tree.def (CHECK_CONSTR): New.
376         * cp-tree.h (CHECK_CONSTR_CONCEPT): New.
377         (CHECK_CONSTR_ARGS): New.
378         * constraint.cc (make_predicate_constraint): Remove in favor of
379         normalize_expression.
380         (resolve_constraint_check): Actually return error_mark_node when
381         resolution fails.
382         (resolve_variable_concept_check): Perform coercion as if processing
383         a template. Also return errors on resolution failure.
384         (lift_*): Remove all of these functions. Don't unnecessarily inline
385         concepts.
386         (learn_*): Add facilities to memoize implications for subsumption
387         during normalization.
388         (expanding_concept): New.
389         (expand_concept): New. Return the inlined and normalized definition
390         of a concept when needed.
391         (transform_*, xform_*): Rename to normalize_* to better reflect the
392         responsibility of those functions.
393         (normalize_template_id_expression): Check for non-boolean operands
394         when possible. Generate check constraints instead of normal variable
395         references.
396         (normalize_call_expression): Report errors when resolution fails.
397         (check_for_logical_overloads): Rewrite this check to more accurately
398         report the error.
399         (normalize_atom): Check for overloaded calls and invalid types before
400         determining if the expression refers to a concept.
401         (build_constraints): Don't cache normalized constraints or decomposed
402         assumptions.
403         (finish_shorthand_constraint): Return a normalized expression instead
404         of a predicate constraint.
405         (finish_template_introduction): Same.
406         (placeholder_extract_concept_and_args): Rewrite this since we only
407         ever get check constraints here.
408         (equivalent_placeholder_constraints): Rewrite in terms of check
409         constraints, and handle error_mark_nodes correctly.
410         (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr)
411         (tsubst_implicit_conversion_constr)
412         (tsubst_argument_deduction_constr, tsubst_exception_constr)
413         (tsubst_parameterized_constraint, tsubst_constraint): New.
414         (tsbust_conjunection): Replace with tsubst_logical_operator and
415         actually generate the right kind of constraint.
416         (tsubst_requirement_body): Reverse the order of substituted arguments
417         so that they appear in the order written (helps diagnostics).
418         (satisfy_check_constraint): New.
419         (satisfy_conjunction): Simplify.
420         (satisfy_disjunction): Same.
421         (satisfy_constraint_1): Handle check constraints.
422         (eval_constr): New (private) global state.
423         (evaluating_constraints_sentinel): New. Manages eval_constr.
424         (satisfy_constraint): Add timing variables.
425         (satisfy_associated_constraints): Add hooks for memoization.
426         (evaluate_function_concept): Build a check constraint instead of
427         normalizing its definition.
428         (evaluate_variable_concept): Same.
429         (evaluate_constraint_expression): Normalize, but in the current
430         declaration processing context.
431         (evaluating_constraints_p): New.
432         (elide_constraint_failure_p): Actually emit constraint_thresh errors.
433         (diagnose_*): Remove artificial indentation. Add a new parameter to
434         each that tracks the current (complete) constraint prior to any
435         substitutions.
436         (diagnose_expression): Removed.
437         (diagnose_call_expression): Same.
438         (diagnose_template_id): Same.
439         (diagnose_template_id): New.
440         (diagnose_logical_constraint): New.
441         (diagnose_expression_constraint): Show the original expression.
442         (diagnose_type_constraint): Show the original type.
443         (diagnose_implicit_conversion_constraint): Be specific about
444         failures, don't re-diagnose a known-to-be-failed substitutions,
445         and manage elisions properly.
446         (diagnose_argument_deduction_constraint): Same.
447         (diagnose_exception_constraint): Same.
448         (diagnose_parameterized_constraint): Same.
449         (constraint_p): Allow EXPR_PACK_EXPANSION.
450         * logic.cc (next_by_distance): Removed. No longer used.
451         (any_p): Renamed from any_of.
452         (term_entry, term_hasher): New.
453         (term_list): Rewrite to include a hash table for quick lookup.
454         Also, make less stateful.
455         (proof_state): Extend to allow goals to be discharged once
456         satisfied.
457         (non_atomic_constraint_p): New.
458         (any_non_atomic_constraints_p): New.
459         (...rest...): Previous implementation completely replaced with an
460         iterative algorithm that opportunistically prunes the search space
461         before committing to using more memory.
462         * parser.c: (cp_parser_type_parameter): Normalize constraints.
463         (cp_parser_explicit_template_declaration): Same.
464         * pt.c: (finish_template_variable): Be less redundant with this error
465         message.
466         (template_args_equal): No longer static.
467         (tsubst_decl): Don't try to find specializations of variables that
468         have already been instantiated.
469         (build_non_dependent_expr): Avoid infinite recursion during concept
470         expansion.
471         (make_constrained_auto): Normalize constraints.
472         (do_auto_deduction): When doing auto deduction from a
473         partial-concept-id, be sure to include the explicit args checking
474         the constraints.
475         (constraint_sat_*): New. Memoize satisfied constraints.
476         (concept_spec_*): New. Memoize expressions associated with a concept
477         specialization.
478         (constraint_memos, concept_memos): New.
479         (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New.
480         (lookup_concept_satisfaction, memoize_concept_satisfaction): New.
481         (get_concept_expansion, save_concept_expansion): New.
482         (hash_subsumption_args): New.
483         (comp_subsumption_args): New.
484         (subsumption_*): New. Memoize parts of the subsumption relation.
485         (lookup_subsumption_result, save_subsumption_result): New.
486         (init_constraint_processing): Initialize memo tables.
487         (get_constraints): Shortcut if !flag_concepts.
488         * decl.c (grokfndecl): Normalize constraints.
489         * error.c (dump_simple_decl): Print "concept" when appropriate.
490         (dump_function_decl): Same.
491         (dump_template_decl): Don't write requirements when we're not
492         printing the header.
493         (dump_expr): Handle fold expressions.
494         * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle
495         fold expressions.
496         (get_fold_operator): New.
497         (pp_cxx_unary_left_fold_expression): New.
498         (pp_cxx_unary_right_fold_expression): New.
499         (pp_cxx_binary_fold_expression): New.
500         (pp_cxx_check_constraint): New.
501         (pp_cxx_*_constraint): Rewrite the grammar of internal constraints
502         to make them easier to read when debugging.
503         * search.c (accessible_p): Don't shortcut when evaluating constraints.
504         * tree.c (cp_tree_equal): Handle CHECK_CONSTR.
505
506 2016-07-21  Jason Merrill  <jason@redhat.com>
507
508         PR c++/70781
509         * parser.c (cp_parser_lambda_expression): Unset OK if there was an
510         error parsing the lambda-declarator.
511
512         PR c++/71896
513         * constexpr.c (cxx_eval_binary_expression): Handle comparison
514         between lowered and unlowered PTRMEM_CST.
515
516         PR c++/71092
517         * constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
518         threw away DECL_SAVED_TREE.
519
520         PR c++/71117
521         Core 2189
522         * call.c (add_template_conv_candidate): Disable if there are
523         viable candidates.
524
525         PR c++/71495
526         * call.c (convert_like_real): Mask complain.
527
528         PR c++/71511
529         * typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.
530
531         PR c++/71513
532         * pt.c (tsubst_attributes): Fix loop logic.
533
534         PR c++/71604
535         PR c++/54430
536         * parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
537         (cp_parser_simple_declaration): Diagnose type definition in
538         for-range-declaration.
539
540         PR c++/71711
541         * operators.def: Add *_FOLD_EXPR.
542         * cp-tree.h (FOLD_EXPR_P): Parenthesize.
543         * mangle.c (write_expression): Handle fold-expressions.
544         * pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
545         (tsubst_unary_right_fold, tsubst_binary_right_fold): Handle
546         partial instantiation.
547
548         PR c++/71814
549         * mangle.c (write_expression): Handle sizeof... an argument pack.
550
551         PR c++/71718
552         * pt.c (push_tinst_level_loc): Set at_eof before fatal_error.
553
554         PR c++/70824
555         * init.c (constant_value_1): Don't instantiated DECL_INITIAL of
556         artificial variables.
557
558         * lambda.c (maybe_add_lambda_conv_op): Fix null object argument.
559
560 2016-07-20  Jakub Jelinek  <jakub@redhat.com>
561
562         PR c++/71909
563         * parser.c (cp_parser_save_member_function_body): Consume
564         __transaction_relaxed or __transaction_atomic with optional
565         attribute.  Only skip catch with block if try keyword is seen.
566
567 2016-07-19  Jakub Jelinek  <jakub@redhat.com>
568
569         Backported from mainline
570         2016-07-18  Jakub Jelinek  <jakub@redhat.com>
571
572         PR c++/71835
573         * call.c (build_op_call_1): Use convert_like_with_context only
574         if cand->fn is a decl.
575
576         PR c++/71828
577         * constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
578         For lval don't use cxx_eval_unary_expression and instead recurse
579         and if needed rebuild the reference.
580
581         PR c++/71822
582         * cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
583         fold *expr_p before genericizing it.
584
585         PR c++/71871
586         * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
587
588         2016-07-07  Jakub Jelinek  <jakub@redhat.com>
589                     Kai Tietz  <ktietz70@googlemail.com>
590
591         PR c++/70869
592         PR c++/71054
593         * cp-gimplify.c (cp_genericize_r): For DECL_EXPR for non-static
594         artificial vars, genericize their initializers.
595
596 2016-06-21  Jakub Jelinek  <jakub@redhat.com>
597
598         Backported from mainline
599         2016-06-17  Jakub Jelinek  <jakub@redhat.com>
600
601         * semantics.c (handle_omp_array_sections_1): Don't ICE when
602         processing_template_decl when checking for bitfields and unions.
603         Look through REFERENCE_REF_P as base of COMPONENT_REF.
604         (finish_omp_clauses): Look through REFERENCE_REF_P even for
605         array sections with COMPONENT_REF bases.
606
607         2016-06-16  Jakub Jelinek  <jakub@redhat.com>
608
609         * parser.c (cp_parser_omp_var_list_no_open): Call
610         convert_from_reference before cp_parser_postfix_dot_deref_expression.
611         * semantics.c (finish_omp_clauses): Don't ICE when
612         processing_template_decl when checking for bitfields and unions.
613         Look through REFERENCE_REF_P as base of COMPONENT_REF.
614
615         2016-06-14  Jakub Jelinek  <jakub@redhat.com>
616
617         PR c++/71528
618         * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
619         olddecl vars, preserve their TREE_READONLY bit.
620
621 2016-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
622
623         PR c++/70572
624         * decl.c (cp_finish_decl): Check do_auto_deduction return value
625         and return immediately in case of erroneous code.
626
627 2016-06-14  Jakub Jelinek  <jakub@redhat.com>
628
629         PR c++/71516
630         * decl.c (complete_vars): Handle gracefully type == error_mark_node.
631
632 2016-06-10  Thomas Schwinge  <thomas@codesourcery.com>
633
634         PR c/71381
635         Backport from trunk r237290:
636         * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
637         Loosen checking.
638
639 2016-06-08  Jakub Jelinek  <jakub@redhat.com>
640
641         PR c++/71442
642         * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
643
644 2016-06-06  Jakub Jelinek  <jakub@redhat.com>
645             Patrick Palka  <ppalka@gcc.gnu.org>
646
647         PR c++/70847
648         PR c++/71330
649         PR c++/71393
650         * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
651         right after cp_fold call if cp_fold has returned the same stmt
652         already in some earlier cp_fold_r call.
653         (cp_fold_function): Add pset automatic variable, pass its address
654         to cp_walk_tree.
655
656 2016-06-02  Jakub Jelinek  <jakub@redhat.com>
657
658         PR c++/71372
659         * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
660         is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
661         and TREE_THIS_VOLATILE flags.  For ARRAY_REF and ARRAY_RANGE_REF, copy
662         over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
663         to the newly built tree.
664
665 2016-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
666
667         PR c++/70972
668         * method.c (forward_parm): Use cp_build_reference_type.
669
670 2016-05-31  Jason Merrill  <jason@redhat.com>
671
672         PR c++/71166
673         * decl2.c (c_parse_final_cleanups): Don't call fini_constexpr.
674
675         PR c++/71227
676         * pt.c (check_explicit_specialization): Give better diagnostic about
677         specializing a hidden friend.
678
679         PR c++/60095
680         PR c++/69515
681         PR c++/69009
682         * pt.c (instantiate_template_1): Don't put the partial
683         specialization in DECL_TI_TEMPLATE.
684         (partial_specialization_p, impartial_args): Remove.
685         (regenerate_decl_from_template): Add args parm.
686         (instantiate_decl): Look up the partial specialization again.
687
688         PR c++/71173
689         PR c++/70522
690         * cp-tree.h (enum tag_types): Add scope_type.
691         * parser.c (cp_parser_class_name): Use scope_type.
692         (prefer_type_arg): Handle scope_type.
693         (cp_parser_lookup_name): Use prefer_type_arg.
694         * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
695         int prefer_type, use lookup_flags.
696         * name-lookup.h: Adjust.
697
698         PR c++/70584
699         * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
700         returns a decl.
701         (cp_fold) [INDIRECT_REF]: Call maybe_undo_parenthesized_ref.
702
703         PR c++/70735
704         * pt.c (tsubst_copy): Just return a local variable from
705         non-template context.  Don't call rest_of_decl_compilation for
706         duplicated static locals.
707         (tsubst_decl): Set DECL_CONTEXT of local static from another
708         function.
709
710 2016-05-31  Martin Sebor  <msebor@redhat.com>
711
712         PR c++/71306
713         * init.c (warn_placement_new_too_small): Handle placement new arguments
714         that are elements of arrays more carefully.  Remove a pointless loop.
715
716 2016-05-30  Jakub Jelinek  <jakub@redhat.com>
717
718         PR c++/71349
719         * parser.c (cp_parser_omp_for): Don't disallow nowait clause
720         when combined with target construct.
721         (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
722         to cp_parser_omp_all_clauses.
723
724 2016-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
725
726         PR c++/71105
727         * lambda.c (maybe_add_lambda_conv_op): Early return also when
728         LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
729
730 2016-05-24  Martin Sebor  <msebor@redhat.com>
731
732         PR c++/71147
733         * decl.c (layout_var_decl, grokdeclarator): Use
734         complete_or_array_type_p.
735         * pt.c (instantiate_class_template_1): Try to complete the element
736         type of a flexible array member.
737         (can_complete_type_without_circularity): Handle arrays of unknown bound.
738         * typeck.c (complete_type): Also complete the type of the elements of
739         arrays with an unspecified bound.
740
741 2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
742
743         PR c++/69872
744         * typeck2.c (check_narrowing): Check pedwarn return value.
745
746 2016-05-24  Jakub Jelinek  <jakub@redhat.com>
747
748         PR c++/71257
749         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
750         For OMP_CLAUSE_LINEAR_REF don't require type to be
751         integral or pointer.
752
753 2016-05-23  Jason Merrill  <jason@redhat.com>
754
755         PR c++/70344
756         * constexpr.c (cxx_eval_call_expression): Check for
757         fun == current_function_decl again.
758
759 2016-05-19  David Malcolm  <dmalcolm@redhat.com>
760
761         Backport from trunk r236483.
762         PR c++/71184
763         * parser.c (cp_parser_operator): For array new/delete, check that
764         cp_parser_require returned a non-NULL token before dereferencing
765         it.
766
767 2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
768
769         Backport from mainline
770         2016-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
771
772         * decl.c (finish_enum_value_list): Use the specified mode.
773
774 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
775
776         PR c++/70466
777         * call.c (convert_like_real): Check that we are actually converting
778         from an init list.
779
780 2016-04-29  Cesar Philippidis  <cesar@codesourcery.com>
781
782         PR middle-end/70626
783         * parser.c (cp_parser_oacc_loop): Don't augment mask with
784         OACC_LOOP_CLAUSE_MASK.
785         (cp_parser_oacc_kernels_parallel): Update call to
786         c_oacc_split_loop_clauses.
787
788 2016-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
789
790         PR c++/70540
791         * semantics.c (process_outer_var_ref): Unconditionally return
792         error_mark_node when mark_used returns false.
793
794 2016-04-27  Release Manager
795
796         * GCC 6.1.0 released.
797
798 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
799
800         PR bootstrap/70704
801         * pt.c (build_non_dependent_expr): Temporarily disable flag_checking
802         guarded code.
803
804 2016-04-22  Jason Merrill  <jason@redhat.com>
805
806         PR c++/68206
807         PR c++/68530
808         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
809         and GOTO_EXPR.
810
811         PR c++/70522
812         * name-lookup.c (qualified_lookup_using_namespace): Look through
813         hidden names.
814
815 2016-04-19  Jason Merrill  <jason@redhat.com>
816
817         PR c++/66543
818         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
819         * pt.c (make_pack_expansion): Call mark_exp_read.
820         * semantics.c (finish_id_expression): Call mark_type_use in
821         unevaluated context.
822
823 2016-04-18  Jason Merrill  <jason@redhat.com>
824
825         PR c++/70690
826         PR c++/70528
827         * class.c (type_maybe_constexpr_default_constructor): New.
828         (type_has_constexpr_default_constructor): Revert.
829
830         PR c++/70505
831         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
832         unknown_type_node, too.
833
834 2016-04-15  Jason Merrill  <jason@redhat.com>
835
836         PR c++/70685
837         * constexpr.c (get_fundef_copy): Handle null *slot.
838
839 2016-04-15  Jason Merrill  <jason@redhat.com>
840             Nathan Sidwell  <nathan@acm.org>
841
842         PR c++/70594
843         * constexpr.c (constexpr_call_table): Preserve in GC.
844         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
845         (fundef_copies_table): Preserve in GC. Change to pointer to
846         tree->tree hash.
847         (maybe_initialize_fundef_copies_table): Adjust.
848         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
849         (save_fundef_copy): Adjust for a TREE_LIST.
850         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
851         (fini_constexpr): New.
852         * cp-tree.h (fini_constexpr): Declare.
853         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
854
855 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
856
857         PR c/70436
858         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
859         where needed.
860         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
861         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
862         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
863         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
864         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
865         cp_parser_statement.
866         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
867         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
868         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
869         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
870         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
871         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
872         cp_parser_omp_taskloop, cp_parser_omp_construct,
873         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
874         Add IF_P argument, pass it down where needed.
875         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
876         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
877         calls.
878
879 2016-04-14  Jason Merrill  <jason@redhat.com>
880
881         PR c++/70494
882         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
883         * typeck2.c (split_nonconstant_init_1): Use it.
884
885         PR c++/70528
886         * class.c (type_has_constexpr_default_constructor): Return true
887         for an implicitly declared constructor.
888
889         PR c++/70622
890         * parser.c (cp_parser_init_declarator): Add auto_result parm.
891         (cp_parser_simple_declaration): Pass it.
892         (strip_declarator_types): New.
893
894         PR c++/70543
895         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
896         initializer also makes the variable value-dependent.
897
898         PR c++/70648
899         * constexpr.c (cxx_eval_store_expression): Also copy
900         CONSTRUCTOR_NO_IMPLICIT_ZERO.
901
902 2016-04-14  Martin Sebor  <msebor@redhat.com>
903
904         PR c++/69517
905         PR c++/70019
906         PR c++/70588
907         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
908
909 2016-04-14  Jason Merrill  <jason@redhat.com>
910
911         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
912         parameter ABI change.
913
914 2016-04-13  Martin Sebor  <msebor@redhat.com>
915
916         PR c++/69517
917         PR c++/70019
918         PR c++/70588
919         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
920         functions.
921         * decl.c (check_initializer, cp_finish_decl): Call them.
922         (reshape_init_r): Reject incompletely braced intializer-lists
923         for VLAs.
924         * init.c (throw_bad_array_length, build_vla_check)
925         (build_vla_size_check, build_vla_init_check): Define new functions.
926         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
927         to detect a VLA.
928         (store_init_value): Same.
929
930 2016-04-13  Jason Merrill  <jason@redhat.com>
931
932         Warn about empty parameter ABI with -Wabi=9.
933         * call.c (empty_class_msg, mark_for_abi_warning)
934         (warn_empty_class_abi): New.
935         (build_call_a): Use them.
936         * decl.c (store_parm_decls): Use mark_for_abi_warning.
937         * error.c (pp_format_to_string): New.
938
939         Pass empty class parameters like C.
940         * call.c (pass_as_empty_struct, empty_class_arg): New.
941         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
942         (build_call_a): Use empty_class_arg.
943         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
944         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
945
946 2016-04-13  Jason Merrill  <jason@redhat.com>
947
948         PR c++/70627
949         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
950
951 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
952
953         PR c++/70635
954         * pt.c (resolve_typename_type): Fix typos in infinite recursion
955         avoidance mechanism.
956
957 2016-04-13  Jason Merrill  <jason@redhat.com>
958
959         PR c++/70634
960         * pt.c (instantiation_dependent_uneval_expression_p): Split out
961         from instantiation_dependent_expression_p.
962         (value_dependent_expression_p): Use it for unevaluated operands.
963         (instantiation_dependent_r): Don't check value-dependence.
964         (instantiation_dependent_expression_p): Check
965         value-dependence of the expression as a whole.
966         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
967         * semantics.c (finish_decltype_type): Use it.
968
969         * constexpr.c (potential_nondependent_constant_expression): New.
970         (potential_nondependent_static_init_expression): New.
971         (maybe_constant_value_1, fold_non_dependent_expr)
972         (maybe_constant_init): Use them.
973         * pt.c (instantiate_non_dependent_expr_sfinae)
974         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
975         them.
976         * cp-tree.h: Declare them.
977
978 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
979
980         PR c++/70594
981         * decl.c (pop_labels_1): Removed.
982         (note_label, sort_labels): New functions.
983         (pop_labels): During named_labels traversal, just push the slot
984         pointers into a vector, then qsort it by DECL_UID and only then
985         call pop_label and chain it into BLOCK_VARS.
986
987 2016-04-13  Jason Merrill  <jason@redhat.com>
988
989         PR c++/70615
990         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
991         (cp_gimplify_expr): Not here.
992
993 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
994
995         PR c++/70610
996         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
997         recurse into it.
998         * typeck.c (build_x_conditional_expr): Unconditionally remember
999         that the result is an lvalue or xvalue.
1000
1001 2016-04-12  Jason Merrill  <jason@redhat.com>
1002
1003         * class.c (is_really_empty_class): A zero-length array is empty.
1004         An unnamed bit-field doesn't make a class non-empty.
1005
1006 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
1007
1008         PR c++/68722
1009         * parser.c (cp_parser_cache_defarg): When file ends in default
1010         argument simply return error_mark_node.
1011
1012 2016-04-12  Nathan Sidwell  <nathan@acm.org>
1013
1014         PR c++/70501
1015         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
1016         similarly to PMF.
1017
1018 2016-04-11  Jason Merrill  <jason@redhat.com>
1019
1020         * mangle.c (decl_is_template_id): The template itself counts as a
1021         template-id.
1022
1023 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
1024
1025         PR c++/70590
1026         PR c++/70452
1027         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
1028         on the result if it's not a CONSTRUCTOR.
1029
1030 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
1031
1032         PR c++/70452
1033         * constexpr.c (find_constructor): New function.
1034         (unshare_constructor): New function.
1035         (cxx_eval_call_expression): Use unshare_constructor instead of
1036         unshare_expr.
1037         (find_array_ctor_elt): Likewise.
1038         (cxx_eval_vec_init_1): Likewise.
1039         (cxx_eval_store_expression): Likewise.
1040         (cxx_eval_constant_expression): Likewise.
1041
1042 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
1043
1044         PR c/70436
1045         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
1046         potentially generating a future -Wparentheses warning in its
1047         callers.
1048
1049 2016-04-06  Jason Merrill  <jason@redhat.com>
1050
1051         * class.c (check_abi_tags): Fix function template handling.
1052
1053 2016-04-05  Nathan Sidwell  <nathan@acm.org>
1054
1055         PR c++/70512
1056         * class.c (fixup_may_alias): New.
1057         (fixup_attribute_variants): Call it.
1058
1059 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
1060
1061         PR c++/70452
1062         * constexpr.c (struct fundef_copy): New struct.
1063         (struct fundef_copies_table_t): New struct.
1064         (fundef_copies_table): New static variable.
1065         (maybe_initialize_fundef_copies_table): New static function.
1066         (get_fundef_copy): New static function.
1067         (save_fundef_copy): New static function.
1068         (cxx_eval_call_expression): Use get_fundef_copy, and
1069         save_fundef_copy.
1070         (constexpr_call_table): Add "deletable" GTY marker.
1071
1072 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
1073
1074         PR c++/70452
1075         * cp-tree.h (class cache_map): Remove.
1076         * constexpr.c (cv_cache): Change type to
1077         GTY((deletable)) hash_map<tree, tree> *.
1078         (maybe_constant_value): Adjust following the change to cv_cache.
1079         (clear_cv_cache): New static function.
1080         (clear_cv_and_fold_caches): Use it.
1081         * cp-gimplify.c (fold_cache): Change type to
1082         GTY((deletable)) hash_map<tree, tree> *.
1083         (clear_fold_cache): Adjust following the change to fold_cache.
1084         (cp_fold): Likewise.
1085
1086 2016-04-02  Martin Sebor  <msebor@redhat.com>
1087
1088         PR c++/67376
1089         PR c++/70170
1090         PR c++/70172
1091         PR c++/70228
1092         * constexpr.c (diag_array_subscript): New function.
1093         (cxx_eval_array_reference): Detect out of bounds array indices.
1094
1095 2016-04-01  Jason Merrill  <jason@redhat.com>
1096
1097         PR c++/70449
1098         PR c++/70344
1099         * pt.c (instantiate_decl): A function isn't fully defined if
1100         DECL_INITIAL is error_mark_node.
1101         * constexpr.c (cxx_eval_call_expression): Likewise.
1102
1103 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
1104             Marek Polacek  <polacek@redhat.com>
1105
1106         PR c++/70488
1107         * init.c (warn_placement_new_too_small): Test whether
1108         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
1109
1110 2016-04-01  Nathan Sidwell  <nathan@acm.org>
1111
1112         PR c++/68475
1113         * decl.c (check_redeclaration_exception_specification): Check
1114         regardless of -fno-exceptions.
1115         * typeck2.c (merge_exception_specifiers): Relax assert by checking
1116         flag_exceptions too.
1117
1118 2016-03-31  Nathan Sidwell  <nathan@acm.org>
1119
1120         * decl.c (start_preparsed_function): Remove unnecessary bracing.
1121         (finish_destructor_body): Don't emit operator delete here.
1122
1123 2016-03-31  Nathan Sidwell  <nathan@acm.org>
1124
1125         PR c++/70393
1126         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
1127         elements in field order.
1128
1129 2016-03-31  Marek Polacek  <polacek@redhat.com>
1130
1131         PR c/70297
1132         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
1133
1134 2016-03-31  Richard Biener  <rguenther@suse.de>
1135
1136         PR c++/70430
1137         * typeck.c (cp_build_binary_op): Fix operand order of vector
1138         conditional in truth op handling.
1139
1140 2016-03-29  Jason Merrill  <jason@redhat.com>
1141
1142         PR c++/70353
1143         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
1144         in constexpr functions.
1145
1146 2016-03-28  Jason Merrill  <jason@redhat.com>
1147
1148         PR c++/70422
1149         PR c++/64266
1150         PR c++/70353
1151         * decl.c, pt.c, constexpr.c: Revert last patch.
1152
1153 2016-03-25  Jason Merrill  <jason@redhat.com>
1154             Martin LiÅ¡ka  <mliska@suse.cz>
1155
1156         PR c++/64266
1157         PR c++/70353
1158         Core issue 1962
1159         * decl.c (cp_fname_init): Decay the initializer to pointer.
1160         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
1161         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1162         Don't call cp_finish_decl.
1163         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
1164         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
1165         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
1166         Handle DECL_VALUE_EXPR.
1167
1168 2016-03-24  Jason Merrill  <jason@redhat.com>
1169
1170         PR c++/70386
1171         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
1172
1173         PR c++/70323
1174         * constexpr.c (cxx_eval_call_expression): Don't cache result if
1175         *overflow_p.
1176
1177 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
1178
1179         PR c++/62212
1180         * tree.c (build_cplus_array_type): Determine type-dependentess
1181         with uses_template_parms instead of with dependent_type_p.
1182
1183 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1184
1185         PR c++/70347
1186         * typeck.c (process_init_constructor_union): If the initializer
1187         is empty, use the union's NSDMI if it has one.
1188
1189 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
1190
1191         PR c++/70332
1192         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
1193         NSDMI that's part of an aggregrate initialization.
1194
1195 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
1196
1197         PR c++/70001
1198         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
1199         for 1..max even for multi-dimensional arrays.  Call unshare_expr
1200         on it.
1201
1202         PR c++/70323
1203         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
1204         on TREE_OVERFLOW constants.
1205
1206         PR c++/70376
1207         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
1208         for OMP_TASKLOOP here.
1209         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
1210         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
1211
1212 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
1213             Jason Merrill  <jason@redhat.com>
1214             Jakub Jelinek  <jakub@redhat.com>
1215
1216         PR c++/69315
1217         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1218         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1219         (finish_function): Don't set or test them.
1220         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
1221
1222 2016-03-23  Jason Merrill  <jason@redhat.com>
1223
1224         PR c++/70344
1225         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
1226
1227 2016-03-23  Marek Polacek  <polacek@redhat.com>
1228
1229         PR c++/69884
1230         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
1231
1232 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
1233
1234         * call.c (build_conditional_expr_1): Always use original
1235         condition type for vector type checks and build.
1236
1237 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1238
1239         PR c++/70096
1240         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
1241
1242 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
1243
1244         PR c++/70204
1245         * constexpr.c (non_const_var_error): Check
1246         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1247
1248 2016-03-21  Richard Henderson  <rth@redhat.com>
1249
1250         PR c++/70273
1251         * decl.c (notice_forced_label_r): New.
1252         (cp_finish_decl): Use it.
1253
1254 2016-03-21  Jason Merrill  <jason@redhat.com>
1255
1256         PR c++/70285
1257         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1258
1259 2016-03-18  Jason Merrill  <jason@redhat.com>
1260
1261         PR c++/70139
1262         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
1263
1264         PR c++/70147
1265         * class.c (vptr_via_virtual_p): New.
1266         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
1267         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
1268         a vptr from any virtual base in a not-in-charge 'structor.
1269
1270         * decl.c (build_clobber_this): Factor out of
1271         start_preparsed_function and begin_destructor_body.  Handle
1272         virtual bases better.
1273
1274         * class.c (build_if_in_charge): Split out from build_base_path.
1275         * init.c (expand_virtual_init, expand_default_init): Use it.
1276         * call.c (build_special_member_call): Use it.
1277
1278 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
1279
1280         PR c++/70267
1281         * init.c (build_new_1): Complain and return error_mark_node
1282         if alloc_fn is not _Jv_AllocObject function returning pointer.
1283
1284 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1285
1286         PR c++/70205
1287         * search.c (adjust_result_of_qualified_name_lookup): Don't
1288         update the BASELINK_BINFO of DECL if the second call
1289         to lookup_base fails.
1290
1291 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
1292
1293         PR c++/70218
1294         * parser.c (cp_parser_lambda_expression): Move call to
1295         pop_deferring_access_checks ahead of the call to
1296         cp_parser_end_tentative_firewall.
1297
1298 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
1299
1300         PR c++/70144
1301         * cp-tree.h (magic_varargs_p): Return int instead of bool.
1302         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
1303         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
1304         varargs.
1305         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
1306         if magic_varargs_p == 1, call decay_conversion
1307         instead of mark_type_use.  Don't store error_mark_node arguments to
1308         argarray, instead return error_mark_node.
1309
1310         PR c++/70272
1311         * decl.c (begin_destructor_body): Don't insert clobber if
1312         is_empty_class (current_class_type).
1313
1314 2016-03-17  Marek Polacek  <polacek@redhat.com>
1315
1316         PR c++/70194
1317         * typeck.c (warn_for_null_address): New function.
1318         (cp_build_binary_op): Call it.
1319
1320 2016-03-16  Jason Merrill  <jason@redhat.com>
1321
1322         PR c++/70259
1323         * decl.c (start_preparsed_function): Don't clobber an empty base.
1324
1325 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
1326
1327         PR c++/70147
1328         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1329         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1330
1331         PR c++/70147
1332         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1333         set in_base_initializer.
1334
1335 2016-03-15  Marek Polacek  <polacek@redhat.com>
1336
1337         PR c++/70209
1338         * tree.c (strip_typedefs): Call strip_typedefs again on the
1339         DECL_ORIGINAL_TYPE result.
1340
1341 2016-03-15  Jason Merrill  <jason@redhat.com>
1342
1343         PR c++/70095
1344         * pt.c (instantiate_decl): Fix call to variable_template_p.
1345
1346         PR c++/70141
1347         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1348
1349 2016-03-14  Casey Carter  <casey@carter.net>
1350             Jason Merrill  <jason@redhat.com>
1351
1352         P0184R0: Generalizing the Range-Based For Loop
1353         * parser.c (cp_convert_range_for): Set the type of __end separately.
1354         (cp_parser_perform_range_for_lookup): Allow different begin/end
1355         types if they are comparable.
1356
1357 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
1358
1359         PR c++/70106
1360         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1361         processing_template_decl and EXPR is a SCOPE_REF.
1362
1363 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
1364             Jakub Jelinek  <jakub@redhat.com>
1365
1366         PR c++/70001
1367         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
1368         return value from cxx_eval_constant_expression from earlier
1369         elements if it is valid constant initializer requiring no
1370         relocations.
1371
1372 2016-03-10  Marek Polacek  <polacek@redhat.com>
1373
1374         PR c++/70153
1375         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1376
1377 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
1378
1379         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1380         when calling c_finish_omp_clauses.
1381
1382 2016-03-08  Jason Merrill  <jason@redhat.com>
1383
1384         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
1385         diagnostic for use of "concept".
1386         (cp_parser_requires_clause_opt): And "requires".
1387         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
1388         (cp_parser_explicit_template_declaration): Adjust.
1389         * Make-lang.in (check-c++-all): Add "concepts" to std list.
1390
1391         P0036R0: Unary Folds and Empty Parameter Packs
1392         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1393
1394 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
1395
1396         PR c++/70135
1397         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1398         even after the last iteration of the loop.
1399
1400         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1401
1402 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
1403
1404         PR c++/66786
1405         * pt.c (get_template_info): Handle PARM_DECL.
1406         (template_class_depth): Check DECL_P instead of
1407         VAR_OR_FUNCTION_DECL_P.
1408
1409 2016-03-05  Jason Merrill  <jason@redhat.com>
1410
1411         PR c++/67364
1412         * constexpr.c (cxx_eval_store_expression): Replace
1413         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1414
1415 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
1416
1417         PR c++/66786
1418         * pt.c (template_class_depth): Given a lambda type, iterate
1419         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
1420         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
1421         CP_DECL_CONTEXT.
1422
1423 2016-03-04  Jason Merrill  <jason@redhat.com>
1424
1425         PR c++/69203
1426         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
1427         * init.c (build_vec_delete_1): Set it.
1428         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
1429
1430 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
1431
1432         * decl.c (start_preparsed_function): Don't emit start clobber at the
1433         start of constructor clones.
1434
1435         PR c++/70035
1436         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
1437         * decl.c (start_preparsed_function): Call
1438         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
1439         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
1440         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
1441
1442 2016-03-04  Jason Merrill  <jason@redhat.com>
1443
1444         PR c++/67364
1445         * constexpr.c (cxx_eval_component_reference): Further tweak.
1446
1447         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
1448         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
1449         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
1450         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
1451
1452         PR c++/70067
1453         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1454         same type.
1455
1456 2016-03-03  Jason Merrill  <jason@redhat.com>
1457
1458         * method.c (synthesized_method_walk): operator= can also be constexpr.
1459
1460         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1461         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1462
1463         PR c++/67164
1464         * pt.c (copy_template_args): New.
1465         (tsubst_pack_expansion): Use it.
1466
1467         * call.c (build_aggr_conv): Use get_nsdmi.
1468
1469         PR c++/51406
1470         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1471
1472         PR c++/67364
1473         * constexpr.c (cxx_eval_component_reference): Just return an empty
1474         CONSTRUCTOR for an empty class.
1475
1476 2016-03-01  Jason Merrill  <jason@redhat.com>
1477
1478         PR c++/70036
1479         * parser.c (cp_parser_requires_clause): Call
1480         check_for_bare_parameter_packs.
1481
1482         PR c++/51489
1483         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1484         the operands.
1485
1486         PR c++/69995
1487         * constexpr.c (cxx_eval_call_expression): Unshare arg.
1488         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1489         [TARGET_EXPR]: Unshare init.
1490
1491 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
1492
1493         PR c++/68948
1494         PR c++/69961
1495         * pt.c (tsubst_baselink): Reinstate the check for an invalid
1496         constructor call.
1497
1498 2016-02-28  Jason Merrill  <jason@redhat.com>
1499
1500         PR c++/69995
1501         * constexpr.c (cxx_eval_store_expression): Unshare init.
1502
1503 2016-02-26  Jason Merrill  <jason@redhat.com>
1504
1505         PR c++/69958
1506         * pt.c (make_argument_pack): New.
1507         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1508         (tsubst_copy_and_build): Likewise.
1509
1510 2016-02-25  Jason Merrill  <jason@redhat.com>
1511
1512         PR c++/69889
1513         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
1514         * tree.c (build_aggr_init_expr): Set it.
1515         * semantics.c (simplify_aggr_init_expr): Check it.
1516         * cp-gimplify.c (cp_genericize_r): Don't walk into
1517         a call/aggr_init from a thunk.
1518
1519         PR c++/69842
1520         * method.c (forward_parm): Handle parameter packs.
1521         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1522
1523         PR c++/67364
1524         * constexpr.c (cxx_eval_component_reference): Don't complain about
1525         unevaluated empty classes.
1526
1527         PR c++/68049
1528         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1529
1530 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
1531
1532         PR c++/69736
1533         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
1534         (maybe_undo_parenthesized_ref): Declare.
1535         * semantics.c (maybe_undo_parenthesized_ref): Split out from
1536         check_return_expr.
1537         (finish_call_expr): Use it.
1538         * typeck.c (check_return_expr): Use it.
1539         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
1540         REF_PARENTHESIZED_P flag.
1541
1542 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
1543
1544         PR c++/69922
1545         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1546         Avoid folding it.
1547         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
1548         tests.
1549         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
1550         unless they are folded into INTEGER_CST, error_mark_node or some
1551         comparison with NULL, avoid folding them and use either the original
1552         comparison or non-folded comparison of folded arguments.
1553         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
1554         comparison, don't fold the comparison right away.
1555
1556 2016-02-24  Jason Merrill  <jason@redhat.com>
1557
1558         PR c++/69323
1559         * friend.c (make_friend_class): Likewise.
1560         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1561
1562 2016-02-24  Jason Merrill  <jason@redhat.com>
1563
1564         PR c++/69323
1565         * pt.c (instantiate_class_template_1): Set
1566         processing_template_decl before substituting friend_type.
1567
1568 016-02-24  Martin Sebor  <msebor@redhat.com>
1569
1570         PR c++/69912
1571         * tree.c (build_ctor_subob_ref): Compare types' main variants
1572         instead of the types as they are.
1573
1574 2016-02-24  Jason Merrill  <jason@redhat.com>
1575
1576         * decl.c (start_preparsed_function): Condition ctor clobber on
1577         flag_lifetime_dse > 1.
1578
1579         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1580
1581 2016-02-19  Jason Merrill  <jason@redhat.com>
1582
1583         PR c++/69743
1584         * call.c (remaining_arguments): No longer static.
1585         * cp-tree.h: Declare it.
1586         * pt.c (more_specialized_fn): Use it.
1587
1588 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1589             Bernd Edlinger  <bernd.edlinger@hotmail.de>
1590
1591         * Make-lang.in: Invoke gperf with -L C++.
1592         * cfns.gperf: Remove prototypes for hash and libc_name_p
1593         inlines.
1594         * cfns.h: Regenerated.
1595         * except.c (nothrow_libfn_p): Adjust.
1596
1597 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1598
1599         PR c++/69850
1600         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1601         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1602
1603 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
1604
1605         PR c++/68948
1606         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1607         call here.
1608         * semantics.c (finish_call_expr): Don't assume a constructor
1609         call is dependent if only the "this" pointer is dependent.  When
1610         building a constructor call, always use a dummy object.
1611
1612 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
1613
1614         PR c++/69850
1615         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1616         condition.
1617         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1618         operators if folding preserved the binop, just with different
1619         arguments.
1620
1621         PR c++/67767
1622         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1623         attr_spec is always single element chain, chain all the attributes
1624         properly together in the right order.
1625
1626 2016-02-18  Jason Merrill  <jason@redhat.com>
1627
1628         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
1629         mangle_decl.
1630         (mangle_decl): Call maybe_check_abi_tags for function scope.
1631         (mangle_guard_variable): Call maybe_check_abi_tags here.
1632         (write_guarded_var_name): Not here.
1633
1634 2016-02-17  Jason Merrill  <jason@redhat.com>
1635
1636         PR c++/65985
1637         * constexpr.c (build_constexpr_constructor_member_initializers):
1638         Handle an additional STATEMENT_LIST.
1639
1640         PR c++/68585
1641         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1642
1643         PR c++/68679
1644         * decl2.c (reset_type_linkage_2): Look through member templates.
1645
1646 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
1647
1648         PR c++/69850
1649         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1650
1651 2016-02-17  Jason Merrill  <jason@redhat.com>
1652
1653         PR c++/69842
1654         * method.c (forward_parm): Split out from...
1655         (add_one_base_init): ...here.
1656         * lambda.c (maybe_add_lambda_conv_op): Use it.
1657
1658 2016-02-16  Jason Merrill  <jason@redhat.com>
1659
1660         PR c++/10200
1661         PR c++/69753
1662         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1663         tree.c, typeck2.c: Revert earlier changes.
1664         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1665         non-type templates after -> or .
1666
1667 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
1668
1669         PR c/69835
1670         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1671
1672 2016-02-16  Jason Merrill  <jason@redhat.com>
1673
1674         PR c++/69657
1675         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1676         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
1677         * name-lookup.h: Adjust.
1678
1679 2016-02-16  James Norris  <jnorris@codesourcery.com>
1680
1681         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1682         * semantics.c (finish_omp_clauses): Add deviceptr checking.
1683
1684 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1685
1686         PR c++/69658
1687         * init.c (expand_default_init): Only call reshape_init
1688         in the direct-initialization from an initializer list case.
1689
1690 2016-02-15  Jason Merrill  <jason@redhat.com>
1691
1692         PR c++/69753
1693         * semantics.c (finish_call_expr): Implicit 'this' does not make
1694         the call dependent.
1695         * search.c (any_dependent_bases_p): Split out...
1696         * name-lookup.c (do_class_using_decl): ...from here.
1697         * call.c (build_new_method_call_1): Don't complain about missing object
1698         if there are dependent bases.  Tweak error.
1699         * tree.c (non_static_member_function_p): Remove.
1700         * pt.c (type_dependent_expression_p): A member template of a
1701         dependent type is dependent.
1702         * cp-tree.h: Adjust.
1703
1704         PR c++/68890
1705         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1706
1707 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1708
1709         PR c++/69098
1710         * pt.c (lookup_and_finish_template_variable): New function,
1711         extracted from ...
1712         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1713         (tsubst_qualified_id): Consider that EXPR might be a variable
1714         template.
1715         * typeck.c (check_template_keyword): Don't emit an error
1716         if DECL is a variable template.
1717
1718 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1719
1720         * error.c: Spelling fixes - behaviour -> behavior and
1721         neighbour -> neighbor.
1722         * decl.c: Likewise.
1723         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1724         diagnostics.
1725         * init.c (build_delete): Likewise.
1726
1727 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1728
1729         PR c/69768
1730         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1731         arguments for -Waddress warning.  Fix up formatting.
1732
1733 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1734
1735         PR c++/68726
1736         * pt.c (lookup_template_class_1): Check tsubst return value for
1737         error_mark_node.
1738
1739 2016-02-10  Jason Merrill  <jason@redhat.com>
1740
1741         PR c++/68926
1742         * pt.c (resolve_nondeduced_context): Add complain parm.
1743         (do_auto_deduction): Pass it.
1744         * cvt.c (convert_to_void): Likewise.
1745         * decl.c (cp_finish_decl): Likewise.
1746         * init.c (build_new): Likewise.
1747         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1748         * semantics.c (finish_decltype_type): Likewise.
1749         * typeck.c (decay_conversion): Likewise.
1750         * cp-tree.h: Adjust declaration.
1751         * call.c (standard_conversion): Add complain parm, pass it along.
1752         (implicit_conversion): Pass it.
1753
1754         PR c++/69657
1755         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1756         (lookup_name_real_1): Likewise.
1757         (remove_hidden_names): Handle non-functions too.
1758
1759         PR c++/10200
1760         * parser.c (cp_parser_lookup_name): When looking for a template
1761         after . or ->, only consider class templates.
1762         (cp_parser_postfix_dot_deref_expression): Handle the current
1763         instantiation.  Remember a dependent object expression.
1764         * typeck2.c (build_x_arrow): Handle the current instantiation.
1765
1766         * ptree.c (debug_tree): Implement for cp_expr.
1767
1768 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1769
1770         PR c++/69139
1771         * parser.c (cp_parser_simple_type_specifier): Make the check
1772         for disambiguating between an 'auto' placeholder and an implicit
1773         template parameter more robust.
1774
1775 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1776
1777         PR c++/69283
1778         PR c++/67835
1779         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1780         setting its TREE_USED flag.
1781
1782 2016-02-08  Jason Merrill  <jason@redhat.com>
1783
1784         PR c++/69657
1785         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1786         built-ins alone.
1787
1788 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1789
1790         PR c++/59627
1791         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1792         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1793
1794 2016-02-08  Marek Polacek  <polacek@redhat.com>
1795
1796         PR c++/69688
1797         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1798         Call clear_fold_cache.
1799         * cp-tree.h: Adjust declaration.
1800         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1801         rather than clear_cv_cache and clear_fold_cache.
1802         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1803
1804 2016-02-08  Jason Merrill  <jason@redhat.com>
1805
1806         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1807         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1808         (ocp_convert): Use *_maybe_fold.
1809         (cp_convert_to_pointer): Add dofold parameter.
1810         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1811
1812 2016-02-05  Martin Sebor  <msebor@redhat.com>
1813
1814         PR c++/69662
1815         * init.c (find_field_init): New function.
1816         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1817         at ends of structures special.
1818
1819 2016-02-05  Jason Merrill  <jason@redhat.com>
1820
1821         PR c++/68948
1822         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1823         make sure we've seen_error().
1824
1825 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1826
1827         PR c++/68948
1828         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1829         if lookup_fnfields returns NULL_TREE and the name being looked
1830         up has the form A::A.
1831
1832 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1833
1834         * constexpr.c (cxx_eval_binary_expression): Fold equality
1835         comparisons involving PTRMEM_CSTs.
1836
1837 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1838
1839         * class.c (find_flexarrays): Don't declare dom variable.
1840         (diagnose_flexarray): Likewise.
1841
1842 2016-02-02  Martain Sebor  <msebor@redhat.com>
1843
1844         PR c++/69251
1845         PR c++/69253
1846         PR c++/69290
1847         PR c++/69277
1848         PR c++/69349
1849         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1850         of a flexible array member for equality to null.
1851         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1852         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1853         (check_flexarrays): Same.
1854         * decl.c (compute_array_index_type): Avoid special case for flexible
1855         array members.
1856         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1857         array members.
1858         * error.c (dump_type_suffix): Revert changes introduced in r231665
1859         and rendered unnecessary by the changes above.
1860         * pt.c (tsubst):  Same.
1861         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1862         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1863         (process_init_constructor_array): Same.
1864         (process_init_constructor_record): Same.
1865
1866 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1867
1868         PR c++/69056
1869         * pt.c (try_one_overload): Handle comparing argument packs so
1870         that there is no conflict if we deduced more arguments of an
1871         argument pack than were explicitly specified.
1872
1873 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1874             Jason Merrill  <jason@redhat.com>
1875
1876         PR c++/68763
1877         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1878         function type if nothing is changing.
1879
1880 2016-01-31  Jason Merrill  <jason@redhat.com>
1881
1882         PR c++/69009
1883         * pt.c (partial_specialization_p, impartial_args): New.
1884         (instantiate_decl): Call impartial_args.
1885
1886         * mangle.c (maybe_check_abi_tags): New.
1887         (write_guarded_var_name): Call it.
1888         (mangle_ref_init_variable): Call check_abi_tags.
1889
1890         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1891         between template and instantiation.
1892
1893 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1894
1895         PR debug/66869
1896         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1897         function declarations.
1898
1899 2016-01-29  Marek Polacek  <polacek@redhat.com>
1900
1901         PR c++/69509
1902         PR c++/69516
1903         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1904         out of bound" error earlier.
1905         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1906         commentary.
1907
1908 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1909
1910         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1911         structure, update free_binding_level before the structure's
1912         level_chain field gets cleared, not after.
1913
1914 2016-01-28  Jason Merrill  <jason@redhat.com>
1915
1916         PR c++/67407
1917         * search.c (dfs_walk_once, dfs_walk_once_r)
1918         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1919         hash_set instead of BINFO_MARKED.
1920         (dfs_unmark_r): Remove.
1921
1922 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1923
1924         PR c++/24208
1925         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1926         (cp_lexer_debugging_p): Use it.
1927         (cp_lexer_start_debugging): Likewise.
1928         (cp_lexer_stop_debugging): Likewise.
1929
1930 2016-01-27  Marek Polacek  <polacek@redhat.com>
1931
1932         PR c/68062
1933         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1934         needed.  Add -Wsign-compare warning.
1935
1936 2016-01-27  Ryan Burn  <contact@rnburn.com>
1937
1938         PR cilkplus/69267
1939         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1940         superfluous post_p argument in call to
1941         cilk_gimplify_call_params_in_spawned_fn.
1942
1943 2016-01-27  Marek Polacek  <polacek@redhat.com>
1944
1945         PR c++/69379
1946         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1947         wrapped in NOP_EXPRs.
1948
1949 2016-01-27  Martin Sebor  <msebor@redhat.com>
1950
1951         PR c++/69317
1952         * mangle.c (mangle_decl): Reference the correct (saved) version
1953         of the ABI in -Wabi diagnostics.
1954
1955 2016-01-27  Marek Polacek  <polacek@redhat.com>
1956
1957         PR c++/69496
1958         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1959         elements of the array.
1960
1961 2016-01-26  Jason Merrill  <jason@redhat.com>
1962
1963         PR c++/68949
1964         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1965         (cxx_eval_call_expression): Don't look through clones.
1966         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1967         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1968         maybe-in-charge *tor.
1969
1970 2016-01-26  Jason Merrill  <jason@redhat.com>
1971
1972         PR c++/68782
1973         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1974         and TREE_SIDE_EFFECTS.
1975         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1976         verify_constructor_flags.
1977
1978 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1979
1980         PR c++/68357
1981         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1982         return error_mark_node instead of building trees with error_mark_node
1983         operands.
1984
1985 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1986
1987         PR other/69006
1988         * error.c (print_instantiation_partial_context_line): Add missing
1989         newlines from output for the t == NULL case.
1990         (print_instantiation_partial_context): Remove call to pp_newline.
1991
1992 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
1993
1994         Revert:
1995         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1996
1997         PR c++/11858
1998         PR c++/24663
1999         PR c++/24664
2000         * decl.c (grokdeclarator): Don't decay array parameter type to
2001         a pointer type if it's dependent.
2002         (grokparms): Invoke strip_top_quals instead of directly invoking
2003         cp_build_qualified_type.
2004         * pt.c (decay_dependent_array_parm_type): New static function.
2005         (type_unification_real): Call decay_dependent_array_parm_type
2006         to decay a dependent array parameter type to its corresponding
2007         pointer type before unification.
2008         (more_specialized_fn): Likewise.
2009         (get_bindings): Likewise.
2010         * tree.c (cp_build_qualified_type): Trivial typofix in
2011         documentation.
2012
2013 2016-01-23  Martin Sebor  <msebor@redhat.com>
2014
2015         PR c++/58109
2016         PR c++/69022
2017         * decl2.c (is_late_template_attribute): Handle dependent argument
2018         to attribute align and attribute vector_size.
2019
2020 2016-01-21  Jason Merrill  <jason@redhat.com>
2021
2022         PR c++/69392
2023         * lambda.c (lambda_capture_field_type): Handle 'this' specially
2024         for init-capture, too.
2025
2026         PR c++/65687
2027         * decl.c (type_is_deprecated): Don't look into a typedef.
2028
2029         PR c++/40751
2030         PR c++/64987
2031         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
2032
2033         PR c++/43407
2034         * decl.c (start_enum): Add attributes parameter.
2035         * parser.c (cp_parser_enum_specifier): Pass it.
2036         * pt.c (lookup_template_class_1): Pass it.
2037         * cp-tree.h: Adjust.
2038
2039 2016-01-19  Jason Merrill  <jason@redhat.com>
2040
2041         PR c++/59759
2042         * pt.c (convert_template_argument): Handle VAR_DECL properly.
2043
2044 2016-01-19  Marek Polacek  <polacek@redhat.com>
2045
2046         PR c++/68586
2047         * constexpr.c (clear_cv_cache): New.
2048         * cp-gimplify.c (clear_fold_cache): New.
2049         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
2050         * decl.c (finish_enum_value_list): Call them.
2051
2052         PR c++/68965
2053         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
2054
2055 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
2056
2057         PR c++/11858
2058         PR c++/24663
2059         PR c++/24664
2060         * decl.c (grokdeclarator): Don't decay array parameter type to
2061         a pointer type if it's dependent.
2062         (grokparms): Invoke strip_top_quals instead of directly invoking
2063         cp_build_qualified_type.
2064         * pt.c (decay_dependent_array_parm_type): New static function.
2065         (type_unification_real): Call decay_dependent_array_parm_type
2066         to decay a dependent array parameter type to its corresponding
2067         pointer type before unification.
2068         (more_specialized_fn): Likewise.
2069         (get_bindings): Likewise.
2070         * tree.c (cp_build_qualified_type): Trivial typofix in
2071         documentation.
2072
2073 2016-01-18  Jason Merrill  <jason@redhat.com>
2074
2075         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
2076
2077         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
2078
2079         PR c++/68767
2080         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
2081         (contains_label_1, contains_label_p): Remove.
2082
2083 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2084
2085         PR c++/69091
2086         * pt.c (type_dependent_expression_p): For a function template
2087         specialization, a type is dependent iff any of its template
2088         arguments are.
2089
2090 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2091
2092         * cp-array-notation.c (cp_expand_cond_array_notations): Return
2093         error_mark_node only if find_rank failed, not if it was
2094         successful.
2095
2096 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
2097
2098         PR c++/68936
2099         * tree.c (build_min_non_dep_call_vec): Don't retain the
2100         KOENIG_LOOKUP_P flag of the non-dependent expression that's
2101         been built.
2102         (build_min_non_dep_op_overload): Instead, do it here.
2103
2104 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
2105
2106         PR bootstrap/68271
2107         * parser.h (cp_token): Remove pragma_kind field.  Add comment
2108         with number of unused bits.
2109         * parser.c (eof_token): Remove pragma_kind field initializer.
2110         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
2111         field, don't clear CPP_PRAGMA u.value.
2112         (cp_parser_pragma_kind): New function.
2113         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
2114         cp_parser_omp_construct, cp_parser_initial_pragma,
2115         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
2116         pragma_kind field.
2117
2118 2016-01-15  Jason Merrill  <jason@redhat.com>
2119
2120         PR c++/68847
2121         * call.c (build_cxx_call): Use fold_non_dependent_expr.
2122
2123         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
2124         value.
2125
2126         PR c++/69257
2127         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
2128         array/function-to-pointer conversion.  Call
2129         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
2130         * call.c (convert_like_real): Print call context if
2131         decay_conversion errors.
2132
2133 2016-01-14  Tom de Vries  <tom@codesourcery.com>
2134
2135         PR tree-optimization/68773
2136         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
2137         set force_output.
2138
2139 2016-01-14  Jason Merrill  <jason@redhat.com>
2140
2141         PR c++/69261
2142         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
2143
2144 2016-01-12  Marek Polacek  <polacek@redhat.com>
2145
2146         PR c++/68979
2147         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
2148         error_at and adjust the return value.
2149
2150 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
2151
2152         PR objc++/68511
2153         PR c++/69213
2154         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
2155         GS_ERROR whenever seen_error (), only if *expr_p contains
2156         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
2157
2158         PR c++/66808
2159         PR c++/69000
2160         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
2161
2162 2016-01-11  Jason Merrill  <jason@redhat.com>
2163
2164         PR c++/69131
2165         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
2166         (process_subob_fn): Likewise.  Don't consider triviality if true.
2167         (synthesize_method_walk): Pass it.
2168
2169 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
2170
2171         PR c++/68795
2172         * parser.c (cp_parser_postfix_expression): Initialize
2173         close_paren_loc to UNKNOWN_LOCATION; only use it if
2174         it has been written to by
2175         cp_parser_parenthesized_expression_list.
2176         (cp_parser_parenthesized_expression_list): Document the behavior
2177         with respect to the CLOSE_PAREN_LOC param.
2178
2179 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
2180
2181         PR c++/69211
2182         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
2183         folded operands have side-effects, but folding changed any of them,
2184         build a new tree with the folded operands instead of returning the
2185         unfolded tree.
2186
2187 2016-01-09  Marek Polacek  <polacek@redhat.com>
2188
2189         PR c++/69113
2190         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
2191
2192 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
2193
2194         PR c++/69164
2195         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
2196
2197 2016-01-08  Jason Merrill  <jason@redhat.com>
2198
2199         PR c++/69158
2200         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
2201         in completion.
2202
2203 2016-01-08  Marek Polacek  <polacek@redhat.com>
2204
2205         PR c++/68449
2206         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
2207
2208 2016-01-08  Jason Merrill  <jason@redhat.com>
2209
2210         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
2211         workaround.
2212
2213         PR c++/68983
2214         PR c++/67557
2215         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
2216         TREE_ADDRESSABLE type.
2217
2218         PR c++/68983
2219         PR c++/67557
2220         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2221
2222 2016-01-05  Nathan Sidwell  <nathan@acm.org>
2223
2224         PR c++/58583
2225         * pt.c (build_non_dependent_expr): Don't try a checking fold when
2226         parsing an nsdmi.
2227
2228 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
2229
2230         Update copyright years.
2231 \f
2232 Copyright (C) 2016 Free Software Foundation, Inc.
2233
2234 Copying and distribution of this file, with or without modification,
2235 are permitted in any medium without royalty provided the copyright
2236 notice and this notice are preserved.