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