1 2017-01-26 Jason Merrill <jason@redhat.com>
3 PR c++/79176 - lambda ICE with -flto -Os
4 * decl2.c (vague_linkage_p): Handle decloned 'tors.
5 * tree.c (decl_linkage): Likewise.
7 2017-01-20 Marek Polacek <polacek@redhat.com>
9 Backported from mainline
10 2017-01-04 Marek Polacek <polacek@redhat.com>
14 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
16 2017-01-17 Jakub Jelinek <jakub@redhat.com>
18 Backported from mainline
19 2017-01-11 Jakub Jelinek <jakub@redhat.com>
22 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
23 assertion. Formatting fix.
25 2017-01-04 Jakub Jelinek <jakub@redhat.com>
28 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
32 * parser.c (cp_parser_simple_declaration): Only complain about
33 inconsistent auto deduction if auto_result doesn't use auto.
36 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
37 assertion, as lexer->buffer may be NULL.
39 2017-01-11 Nathan Sidwell <nathan@acm.org>
42 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
45 2016-12-21 Release Manager
49 2016-12-14 Nathan Sidwell <nathan@acm.org>
52 * pt.c (type_unification_real): Check tsubst arg doesn't have
53 remaining template parms before converting it.
55 2016-12-08 Nathan Sidwell <nathan@acm.org>
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.
63 2016-12-07 Jakub Jelinek <jakub@redhat.com>
65 Backported from mainline
66 2016-12-02 Jakub Jelinek <jakub@redhat.com>
69 * pt.c (tsubst_init): Don't call build_value_init if decl's type
72 2016-11-28 Jakub Jelinek <jakub@redhat.com>
73 Jason Merrill <jason@redhat.com>
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.
80 2016-11-28 Jakub Jelinek <jakub@redhat.com>
83 * typeck.c (maybe_warn_about_returning_address_of_local): Optimize
84 whats_returned through fold_for_warn.
86 2016-11-23 Jakub Jelinek <jakub@redhat.com>
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.
99 2016-11-18 Jakub Jelinek <jakub@redhat.com>
102 * mangle.c (mangle_tls_init_fn, mangle_tls_wrapper_fn): Call
105 2016-10-31 Jakub Jelinek <jakub@redhat.com>
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;.
112 2016-09-28 Jakub Jelinek <jakub@redhat.com>
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.
135 2016-09-27 Jakub Jelinek <jakub@redhat.com>
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.
142 2016-09-20 Jakub Jelinek <jakub@redhat.com>
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.
150 * parser.c (cp_parser_std_attribute_list): Reject ... without
153 2016-09-16 Jakub Jelinek <jakub@redhat.com>
156 * error.c (dump_simple_decl): Only check DECL_DECLARED_CONCEPT_P
157 if DECL_LANG_SPECIFIC is non-NULL. Fix up formatting.
160 * class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any
161 TYPE_HAS_MUTABLE_P for any bases.
163 2016-12-06 Jason Merrill <jason@redhat.com>
166 * decl2.c (maybe_instantiate_decl): Split out from mark_used.
167 (decl_constant_var_p): Use it instead.
170 * pt.c (resolve_typename_type): Try to avoid calling
171 currently_open_class.
174 * constexpr.c (cxx_eval_constant_expression): Use cp_fold_convert.
177 * pt.c (do_type_instantiation): Don't mess with non-user-provided
180 2016-11-18 Jason Merrill <jason@redhat.com>
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.
187 2016-11-17 Jason Merrill <jason@redhat.com>
190 * parser.c (cp_parser_fold_expression): Check TREE_NO_WARNING.
192 2016-11-05 Martin Sebor <msebor@redhat.com>
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.
199 2016-10-14 Martin Sebor <msebor@redhat.com>
202 * class.c (struct flexmems_t): Add members.
203 (find_flexarrays): Add arguments. Correct handling of anonymous
205 (diagnose_flexarrays): Adjust to issue warnings in addition to errors.
206 (check_flexarrays): Add argument.
207 (diagnose_invalid_flexarray): New functions.
209 2016-10-04 Martin Sebor <msebor@redhat.com>
212 * init.c (warn_placement_new_too_small): Avoid assuming an array type
215 2016-09-22 Paolo Carlini <paolo.carlini@oracle.com>
218 * class.c (build_base_path): Allow for lookup_base returning
221 2016-09-16 Jakub Jelinek <jakub@redhat.com>
223 Backported from mainline
224 2016-09-13 Jakub Jelinek <jakub@redhat.com>
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.
233 2016-09-14 Nathan Sidwell <nathan@acm.org>
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.
240 2016-08-22 Release Manager
242 * GCC 6.2.0 released.
244 2016-08-13 Jason Merrill <jason@redhat.com>
247 * constexpr.c (cxx_eval_array_reference): Handle looking for the
248 value of an element we're currently modifying.
250 2016-08-11 Jakub Jelinek <jakub@redhat.com>
253 * constexpr.c (label_matches): Handle case range expressions.
255 2016-08-11 Jason Merrill <jason@redhat.com>
258 * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION.
260 2016-08-08 Paolo Carlini <paolo.carlini@oracle.com>
263 * lambda.c (add_capture): Check lambda_capture_field_type return
264 value for error_mark_node.
266 2016-08-05 Nathan Sidwell <nathan@acm.org>
269 * pt.c (unify): TRAIT_EXPR is an expr.
271 2016-08-04 Jason Merrill <jason@redhat.com>
274 * pt.c (tsubst_pack_expansion): Pull a single pack expansion out
277 2016-07-29 Jason Merrill <jason@redhat.com>
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.
284 2016-07-25 Jason Merrill <jason@redhat.com>
287 * call.c (convert_like_real): Use lvalue_kind.
290 * pt.c (coerce_template_parameter_pack): Fix logic for
293 2016-07-23 Jason Merrill <jason@redhat.com>
297 * init.c (expand_aggr_init_1): Handle list-initialization from {}.
300 * class.c (walk_subobject_offsets): Handle 0-length array.
303 * pt.c (tsubst): Also substitute into the template of a
304 BOUND_TEMPLATE_TEMPLATE_PARM.
307 * pt.c (lookup_template_class_1): Handle getting template from tsubst.
310 * decl.c (reshape_init_r): Check complain for missing braces warning.
312 2016-07-22 Jason Merrill <jason@redhat.com>
316 * pt.c (tsubst_baselink): Call
317 adjust_result_of_qualified_name_lookup for unqualified
320 2016-07-21 Jason Merrill <jason@redhat.com>
323 * semantics.c (apply_deduced_return_type): Call
324 complete_type_or_else before building the new RESULT_DECL.
327 * pt.c (instantiate_decl): Fix pattern_defined for namespace scope
331 * call.c (unsafe_copy_elision_p): It's OK to elide when
332 initializing an unknown object.
334 2016-07-21 Jakub Jelinek <jakub@redhat.com>
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.
341 2016-07-21 Jakub Jelinek <jakub@redhat.com>
344 * cp-gimplify.c (cp_genericize): For nested cp_genericize calls
345 save/restore bc_label array.
347 2016-07-21 Patrick Palka <ppalka@gcc.gnu.org>
351 * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
353 * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
354 on the qualified_id then propagate it to the resulting
356 (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
358 * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
359 its REF_PARENTHESIZED_P flag.
361 2016-07-21 Andrew Sutton <andrew.n.sutton@gmail.com>
362 Jason Merrill <jason@redhat.com>
364 Improving concepts performance and diagnostics.
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
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
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
389 (normalize_call_expression): Report errors when resolution fails.
390 (check_for_logical_overloads): Rewrite this check to more accurately
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
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
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
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
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
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
468 (constraint_sat_*): New. Memoize satisfied constraints.
469 (concept_spec_*): New. Memoize expressions associated with a concept
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
486 (dump_expr): Handle fold expressions.
487 * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle
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.
499 2016-07-21 Jason Merrill <jason@redhat.com>
502 * parser.c (cp_parser_lambda_expression): Unset OK if there was an
503 error parsing the lambda-declarator.
506 * constexpr.c (cxx_eval_binary_expression): Handle comparison
507 between lowered and unlowered PTRMEM_CST.
510 * constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
511 threw away DECL_SAVED_TREE.
515 * call.c (add_template_conv_candidate): Disable if there are
519 * call.c (convert_like_real): Mask complain.
522 * typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.
525 * pt.c (tsubst_attributes): Fix loop logic.
529 * parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
530 (cp_parser_simple_declaration): Diagnose type definition in
531 for-range-declaration.
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.
542 * mangle.c (write_expression): Handle sizeof... an argument pack.
545 * pt.c (push_tinst_level_loc): Set at_eof before fatal_error.
548 * init.c (constant_value_1): Don't instantiated DECL_INITIAL of
549 artificial variables.
551 * lambda.c (maybe_add_lambda_conv_op): Fix null object argument.
553 2016-07-20 Jakub Jelinek <jakub@redhat.com>
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.
560 2016-07-19 Jakub Jelinek <jakub@redhat.com>
562 Backported from mainline
563 2016-07-18 Jakub Jelinek <jakub@redhat.com>
566 * call.c (build_op_call_1): Use convert_like_with_context only
567 if cand->fn is a decl.
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.
575 * cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
576 fold *expr_p before genericizing it.
579 * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
581 2016-07-07 Jakub Jelinek <jakub@redhat.com>
582 Kai Tietz <ktietz70@googlemail.com>
586 * cp-gimplify.c (cp_genericize_r): For DECL_EXPR for non-static
587 artificial vars, genericize their initializers.
589 2016-06-21 Jakub Jelinek <jakub@redhat.com>
591 Backported from mainline
592 2016-06-17 Jakub Jelinek <jakub@redhat.com>
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.
600 2016-06-16 Jakub Jelinek <jakub@redhat.com>
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.
608 2016-06-14 Jakub Jelinek <jakub@redhat.com>
611 * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
612 olddecl vars, preserve their TREE_READONLY bit.
614 2016-06-14 Paolo Carlini <paolo.carlini@oracle.com>
617 * decl.c (cp_finish_decl): Check do_auto_deduction return value
618 and return immediately in case of erroneous code.
620 2016-06-14 Jakub Jelinek <jakub@redhat.com>
623 * decl.c (complete_vars): Handle gracefully type == error_mark_node.
625 2016-06-10 Thomas Schwinge <thomas@codesourcery.com>
628 Backport from trunk r237290:
629 * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
632 2016-06-08 Jakub Jelinek <jakub@redhat.com>
635 * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
637 2016-06-06 Jakub Jelinek <jakub@redhat.com>
638 Patrick Palka <ppalka@gcc.gnu.org>
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
649 2016-06-02 Jakub Jelinek <jakub@redhat.com>
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.
658 2016-06-02 Paolo Carlini <paolo.carlini@oracle.com>
661 * method.c (forward_parm): Use cp_build_reference_type.
663 2016-05-31 Jason Merrill <jason@redhat.com>
666 * decl2.c (c_parse_final_cleanups): Don't call fini_constexpr.
669 * pt.c (check_explicit_specialization): Give better diagnostic about
670 specializing a hidden friend.
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.
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.
692 * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
694 (cp_fold) [INDIRECT_REF]: Call maybe_undo_parenthesized_ref.
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
703 2016-05-31 Martin Sebor <msebor@redhat.com>
706 * init.c (warn_placement_new_too_small): Handle placement new arguments
707 that are elements of arrays more carefully. Remove a pointless loop.
709 2016-05-30 Jakub Jelinek <jakub@redhat.com>
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.
717 2016-05-29 Paolo Carlini <paolo.carlini@oracle.com>
720 * lambda.c (maybe_add_lambda_conv_op): Early return also when
721 LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
723 2016-05-24 Martin Sebor <msebor@redhat.com>
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.
734 2016-05-24 Paolo Carlini <paolo.carlini@oracle.com>
737 * typeck2.c (check_narrowing): Check pedwarn return value.
739 2016-05-24 Jakub Jelinek <jakub@redhat.com>
742 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
743 For OMP_CLAUSE_LINEAR_REF don't require type to be
746 2016-05-23 Jason Merrill <jason@redhat.com>
749 * constexpr.c (cxx_eval_call_expression): Check for
750 fun == current_function_decl again.
752 2016-05-19 David Malcolm <dmalcolm@redhat.com>
754 Backport from trunk r236483.
756 * parser.c (cp_parser_operator): For array new/delete, check that
757 cp_parser_require returned a non-NULL token before dereferencing
760 2016-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
762 Backport from mainline
763 2016-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
765 * decl.c (finish_enum_value_list): Use the specified mode.
767 2016-05-18 Paolo Carlini <paolo.carlini@oracle.com>
770 * call.c (convert_like_real): Check that we are actually converting
773 2016-04-29 Cesar Philippidis <cesar@codesourcery.com>
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.
781 2016-04-28 Paolo Carlini <paolo.carlini@oracle.com>
784 * semantics.c (process_outer_var_ref): Unconditionally return
785 error_mark_node when mark_used returns false.
787 2016-04-27 Release Manager
789 * GCC 6.1.0 released.
791 2016-04-26 Jakub Jelinek <jakub@redhat.com>
794 * pt.c (build_non_dependent_expr): Temporarily disable flag_checking
797 2016-04-22 Jason Merrill <jason@redhat.com>
801 * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
805 * name-lookup.c (qualified_lookup_using_namespace): Look through
808 2016-04-19 Jason Merrill <jason@redhat.com>
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
816 2016-04-18 Jason Merrill <jason@redhat.com>
820 * class.c (type_maybe_constexpr_default_constructor): New.
821 (type_has_constexpr_default_constructor): Revert.
824 * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
825 unknown_type_node, too.
827 2016-04-15 Jason Merrill <jason@redhat.com>
830 * constexpr.c (get_fundef_copy): Handle null *slot.
832 2016-04-15 Jason Merrill <jason@redhat.com>
833 Nathan Sidwell <nathan@acm.org>
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
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.
848 2016-04-15 Jakub Jelinek <jakub@redhat.com>
851 * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
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
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
872 2016-04-14 Jason Merrill <jason@redhat.com>
875 * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
876 * typeck2.c (split_nonconstant_init_1): Use it.
879 * class.c (type_has_constexpr_default_constructor): Return true
880 for an implicitly declared constructor.
883 * parser.c (cp_parser_init_declarator): Add auto_result parm.
884 (cp_parser_simple_declaration): Pass it.
885 (strip_declarator_types): New.
888 * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
889 initializer also makes the variable value-dependent.
892 * constexpr.c (cxx_eval_store_expression): Also copy
893 CONSTRUCTOR_NO_IMPLICIT_ZERO.
895 2016-04-14 Martin Sebor <msebor@redhat.com>
900 * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
902 2016-04-14 Jason Merrill <jason@redhat.com>
904 * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
905 parameter ABI change.
907 2016-04-13 Martin Sebor <msebor@redhat.com>
912 * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
914 * decl.c (check_initializer, cp_finish_decl): Call them.
915 (reshape_init_r): Reject incompletely braced intializer-lists
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()
921 (store_init_value): Same.
923 2016-04-13 Jason Merrill <jason@redhat.com>
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.
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.
939 2016-04-13 Jason Merrill <jason@redhat.com>
942 * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
944 2016-04-13 Paolo Carlini <paolo.carlini@oracle.com>
947 * pt.c (resolve_typename_type): Fix typos in infinite recursion
950 2016-04-13 Jason Merrill <jason@redhat.com>
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.
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
969 * cp-tree.h: Declare them.
971 2016-04-13 Jakub Jelinek <jakub@redhat.com>
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.
980 2016-04-13 Jason Merrill <jason@redhat.com>
983 * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
984 (cp_gimplify_expr): Not here.
986 2016-04-12 Patrick Palka <ppalka@gcc.gnu.org>
989 * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
991 * typeck.c (build_x_conditional_expr): Unconditionally remember
992 that the result is an lvalue or xvalue.
994 2016-04-12 Jason Merrill <jason@redhat.com>
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.
999 2016-04-12 Paolo Carlini <paolo.carlini@oracle.com>
1002 * parser.c (cp_parser_cache_defarg): When file ends in default
1003 argument simply return error_mark_node.
1005 2016-04-12 Nathan Sidwell <nathan@acm.org>
1008 * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
1011 2016-04-11 Jason Merrill <jason@redhat.com>
1013 * mangle.c (decl_is_template_id): The template itself counts as a
1016 2016-04-08 Patrick Palka <ppalka@gcc.gnu.org>
1020 * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
1021 on the result if it's not a CONSTRUCTOR.
1023 2016-04-07 Patrick Palka <ppalka@gcc.gnu.org>
1026 * constexpr.c (find_constructor): New function.
1027 (unshare_constructor): New function.
1028 (cxx_eval_call_expression): Use unshare_constructor instead of
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.
1035 2016-04-06 Patrick Palka <ppalka@gcc.gnu.org>
1038 * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
1039 potentially generating a future -Wparentheses warning in its
1042 2016-04-06 Jason Merrill <jason@redhat.com>
1044 * class.c (check_abi_tags): Fix function template handling.
1046 2016-04-05 Nathan Sidwell <nathan@acm.org>
1049 * class.c (fixup_may_alias): New.
1050 (fixup_attribute_variants): Call it.
1052 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
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
1063 (constexpr_call_table): Add "deletable" GTY marker.
1065 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
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.
1079 2016-04-02 Martin Sebor <msebor@redhat.com>
1085 * constexpr.c (diag_array_subscript): New function.
1086 (cxx_eval_array_reference): Detect out of bounds array indices.
1088 2016-04-01 Jason Merrill <jason@redhat.com>
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.
1096 2016-04-01 Jakub Jelinek <jakub@redhat.com>
1097 Marek Polacek <polacek@redhat.com>
1100 * init.c (warn_placement_new_too_small): Test whether
1101 DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
1103 2016-04-01 Nathan Sidwell <nathan@acm.org>
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.
1111 2016-03-31 Nathan Sidwell <nathan@acm.org>
1113 * decl.c (start_preparsed_function): Remove unnecessary bracing.
1114 (finish_destructor_body): Don't emit operator delete here.
1116 2016-03-31 Nathan Sidwell <nathan@acm.org>
1119 * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
1120 elements in field order.
1122 2016-03-31 Marek Polacek <polacek@redhat.com>
1125 * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
1127 2016-03-31 Richard Biener <rguenther@suse.de>
1130 * typeck.c (cp_build_binary_op): Fix operand order of vector
1131 conditional in truth op handling.
1133 2016-03-29 Jason Merrill <jason@redhat.com>
1136 * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
1137 in constexpr functions.
1139 2016-03-28 Jason Merrill <jason@redhat.com>
1144 * decl.c, pt.c, constexpr.c: Revert last patch.
1146 2016-03-25 Jason Merrill <jason@redhat.com>
1147 Martin Liška <mliska@suse.cz>
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.
1161 2016-03-24 Jason Merrill <jason@redhat.com>
1164 * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
1167 * constexpr.c (cxx_eval_call_expression): Don't cache result if
1170 2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
1173 * tree.c (build_cplus_array_type): Determine type-dependentess
1174 with uses_template_parms instead of with dependent_type_p.
1176 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
1179 * typeck.c (process_init_constructor_union): If the initializer
1180 is empty, use the union's NSDMI if it has one.
1182 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
1185 * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
1186 NSDMI that's part of an aggregrate initialization.
1188 2016-03-23 Jakub Jelinek <jakub@redhat.com>
1191 * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
1192 for 1..max even for multi-dimensional arrays. Call unshare_expr
1196 * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
1197 on TREE_OVERFLOW constants.
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.
1205 2016-03-23 Alexandre Oliva <aoliva@redhat.com>
1206 Jason Merrill <jason@redhat.com>
1207 Jakub Jelinek <jakub@redhat.com>
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.
1215 2016-03-23 Jason Merrill <jason@redhat.com>
1218 * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
1220 2016-03-23 Marek Polacek <polacek@redhat.com>
1223 * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
1225 2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
1227 * call.c (build_conditional_expr_1): Always use original
1228 condition type for vector type checks and build.
1230 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
1233 * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
1235 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
1238 * constexpr.c (non_const_var_error): Check
1239 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1241 2016-03-21 Richard Henderson <rth@redhat.com>
1244 * decl.c (notice_forced_label_r): New.
1245 (cp_finish_decl): Use it.
1247 2016-03-21 Jason Merrill <jason@redhat.com>
1250 * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1252 2016-03-18 Jason Merrill <jason@redhat.com>
1255 * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
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.
1263 * decl.c (build_clobber_this): Factor out of
1264 start_preparsed_function and begin_destructor_body. Handle
1265 virtual bases better.
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.
1271 2016-03-18 Jakub Jelinek <jakub@redhat.com>
1274 * init.c (build_new_1): Complain and return error_mark_node
1275 if alloc_fn is not _Jv_AllocObject function returning pointer.
1277 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
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.
1284 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
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.
1291 2016-03-17 Jakub Jelinek <jakub@redhat.com>
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
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.
1304 * decl.c (begin_destructor_body): Don't insert clobber if
1305 is_empty_class (current_class_type).
1307 2016-03-17 Marek Polacek <polacek@redhat.com>
1310 * typeck.c (warn_for_null_address): New function.
1311 (cp_build_binary_op): Call it.
1313 2016-03-16 Jason Merrill <jason@redhat.com>
1316 * decl.c (start_preparsed_function): Don't clobber an empty base.
1318 2016-03-16 Jakub Jelinek <jakub@redhat.com>
1321 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1322 BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1325 * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1326 set in_base_initializer.
1328 2016-03-15 Marek Polacek <polacek@redhat.com>
1331 * tree.c (strip_typedefs): Call strip_typedefs again on the
1332 DECL_ORIGINAL_TYPE result.
1334 2016-03-15 Jason Merrill <jason@redhat.com>
1337 * pt.c (instantiate_decl): Fix call to variable_template_p.
1340 * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1342 2016-03-14 Casey Carter <casey@carter.net>
1343 Jason Merrill <jason@redhat.com>
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.
1350 2016-03-12 Patrick Palka <ppalka@gcc.gnu.org>
1353 * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1354 processing_template_decl and EXPR is a SCOPE_REF.
1356 2016-03-10 Patrick Palka <ppalka@gcc.gnu.org>
1357 Jakub Jelinek <jakub@redhat.com>
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
1365 2016-03-10 Marek Polacek <polacek@redhat.com>
1368 * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1370 2016-03-09 Cesar Philippidis <cesar@codesourcery.com>
1372 * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1373 when calling c_finish_omp_clauses.
1375 2016-03-08 Jason Merrill <jason@redhat.com>
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.
1384 P0036R0: Unary Folds and Empty Parameter Packs
1385 * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1387 2016-03-08 Jakub Jelinek <jakub@redhat.com>
1390 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1391 even after the last iteration of the loop.
1393 * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1395 2016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
1398 * pt.c (get_template_info): Handle PARM_DECL.
1399 (template_class_depth): Check DECL_P instead of
1400 VAR_OR_FUNCTION_DECL_P.
1402 2016-03-05 Jason Merrill <jason@redhat.com>
1405 * constexpr.c (cxx_eval_store_expression): Replace
1406 CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1408 2016-03-05 Patrick Palka <ppalka@gcc.gnu.org>
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
1416 2016-03-04 Jason Merrill <jason@redhat.com>
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.
1423 2016-03-04 Jakub Jelinek <jakub@redhat.com>
1425 * decl.c (start_preparsed_function): Don't emit start clobber at the
1426 start of constructor clones.
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.
1435 2016-03-04 Jason Merrill <jason@redhat.com>
1438 * constexpr.c (cxx_eval_component_reference): Further tweak.
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.
1446 * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1449 2016-03-03 Jason Merrill <jason@redhat.com>
1451 * method.c (synthesized_method_walk): operator= can also be constexpr.
1453 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1454 LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1457 * pt.c (copy_template_args): New.
1458 (tsubst_pack_expansion): Use it.
1460 * call.c (build_aggr_conv): Use get_nsdmi.
1463 * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1466 * constexpr.c (cxx_eval_component_reference): Just return an empty
1467 CONSTRUCTOR for an empty class.
1469 2016-03-01 Jason Merrill <jason@redhat.com>
1472 * parser.c (cp_parser_requires_clause): Call
1473 check_for_bare_parameter_packs.
1476 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1480 * constexpr.c (cxx_eval_call_expression): Unshare arg.
1481 (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1482 [TARGET_EXPR]: Unshare init.
1484 2016-03-01 Patrick Palka <ppalka@gcc.gnu.org>
1488 * pt.c (tsubst_baselink): Reinstate the check for an invalid
1491 2016-02-28 Jason Merrill <jason@redhat.com>
1494 * constexpr.c (cxx_eval_store_expression): Unshare init.
1496 2016-02-26 Jason Merrill <jason@redhat.com>
1499 * pt.c (make_argument_pack): New.
1500 (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1501 (tsubst_copy_and_build): Likewise.
1503 2016-02-25 Jason Merrill <jason@redhat.com>
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.
1513 * method.c (forward_parm): Handle parameter packs.
1514 * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1517 * constexpr.c (cxx_eval_component_reference): Don't complain about
1518 unevaluated empty classes.
1521 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1523 2016-02-25 Patrick Palka <ppalka@gcc.gnu.org>
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
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.
1535 2016-02-24 Jakub Jelinek <jakub@redhat.com>
1538 * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1540 * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
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.
1549 2016-02-24 Jason Merrill <jason@redhat.com>
1552 * friend.c (make_friend_class): Likewise.
1553 * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1555 2016-02-24 Jason Merrill <jason@redhat.com>
1558 * pt.c (instantiate_class_template_1): Set
1559 processing_template_decl before substituting friend_type.
1561 016-02-24 Martin Sebor <msebor@redhat.com>
1564 * tree.c (build_ctor_subob_ref): Compare types' main variants
1565 instead of the types as they are.
1567 2016-02-24 Jason Merrill <jason@redhat.com>
1569 * decl.c (start_preparsed_function): Condition ctor clobber on
1570 flag_lifetime_dse > 1.
1572 * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1574 2016-02-19 Jason Merrill <jason@redhat.com>
1577 * call.c (remaining_arguments): No longer static.
1578 * cp-tree.h: Declare it.
1579 * pt.c (more_specialized_fn): Use it.
1581 2016-02-19 Jakub Jelinek <jakub@redhat.com>
1582 Bernd Edlinger <bernd.edlinger@hotmail.de>
1584 * Make-lang.in: Invoke gperf with -L C++.
1585 * cfns.gperf: Remove prototypes for hash and libc_name_p
1587 * cfns.h: Regenerated.
1588 * except.c (nothrow_libfn_p): Adjust.
1590 2016-02-19 Jakub Jelinek <jakub@redhat.com>
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.
1596 2016-02-19 Patrick Palka <ppalka@gcc.gnu.org>
1599 * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
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.
1605 2016-02-19 Jakub Jelinek <jakub@redhat.com>
1608 * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1610 * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1611 operators if folding preserved the binop, just with different
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.
1619 2016-02-18 Jason Merrill <jason@redhat.com>
1621 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
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.
1627 2016-02-17 Jason Merrill <jason@redhat.com>
1630 * constexpr.c (build_constexpr_constructor_member_initializers):
1631 Handle an additional STATEMENT_LIST.
1634 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1637 * decl2.c (reset_type_linkage_2): Look through member templates.
1639 2016-02-17 Jakub Jelinek <jakub@redhat.com>
1642 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1644 2016-02-17 Jason Merrill <jason@redhat.com>
1647 * method.c (forward_parm): Split out from...
1648 (add_one_base_init): ...here.
1649 * lambda.c (maybe_add_lambda_conv_op): Use it.
1651 2016-02-16 Jason Merrill <jason@redhat.com>
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 .
1660 2016-02-16 Jakub Jelinek <jakub@redhat.com>
1663 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1665 2016-02-16 Jason Merrill <jason@redhat.com>
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.
1672 2016-02-16 James Norris <jnorris@codesourcery.com>
1674 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1675 * semantics.c (finish_omp_clauses): Add deviceptr checking.
1677 2016-02-15 Jakub Jelinek <jakub@redhat.com>
1680 * init.c (expand_default_init): Only call reshape_init
1681 in the direct-initialization from an initializer list case.
1683 2016-02-15 Jason Merrill <jason@redhat.com>
1686 * semantics.c (finish_call_expr): Implicit 'this' does not make
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.
1698 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1700 2016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
1703 * pt.c (lookup_and_finish_template_variable): New function,
1705 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
1706 (tsubst_qualified_id): Consider that EXPR might be a variable
1708 * typeck.c (check_template_keyword): Don't emit an error
1709 if DECL is a variable template.
1711 2016-02-12 Jakub Jelinek <jakub@redhat.com>
1713 * error.c: Spelling fixes - behaviour -> behavior and
1714 neighbour -> neighbor.
1716 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1718 * init.c (build_delete): Likewise.
1720 2016-02-11 Jakub Jelinek <jakub@redhat.com>
1723 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1724 arguments for -Waddress warning. Fix up formatting.
1726 2016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
1729 * pt.c (lookup_template_class_1): Check tsubst return value for
1732 2016-02-10 Jason Merrill <jason@redhat.com>
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.
1748 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1749 (lookup_name_real_1): Likewise.
1750 (remove_hidden_names): Handle non-functions too.
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.
1759 * ptree.c (debug_tree): Implement for cp_expr.
1761 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
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.
1768 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
1772 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1773 setting its TREE_USED flag.
1775 2016-02-08 Jason Merrill <jason@redhat.com>
1778 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1781 2016-02-08 Jakub Jelinek <jakub@redhat.com>
1784 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1785 of the DECL_OMP_DECLARE_REDUCTION_P decls.
1787 2016-02-08 Marek Polacek <polacek@redhat.com>
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.
1797 2016-02-08 Jason Merrill <jason@redhat.com>
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.
1805 2016-02-05 Martin Sebor <msebor@redhat.com>
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.
1812 2016-02-05 Jason Merrill <jason@redhat.com>
1815 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1816 make sure we've seen_error().
1818 2016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
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.
1825 2016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
1827 * constexpr.c (cxx_eval_binary_expression): Fold equality
1828 comparisons involving PTRMEM_CSTs.
1830 2016-02-04 Jakub Jelinek <jakub@redhat.com>
1832 * class.c (find_flexarrays): Don't declare dom variable.
1833 (diagnose_flexarray): Likewise.
1835 2016-02-02 Martain Sebor <msebor@redhat.com>
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
1849 (grokdeclarator): Avoid calling compute_array_index_type for flexible
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.
1859 2016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
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.
1866 2016-01-31 Jakub Jelinek <jakub@redhat.com>
1867 Jason Merrill <jason@redhat.com>
1870 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1871 function type if nothing is changing.
1873 2016-01-31 Jason Merrill <jason@redhat.com>
1876 * pt.c (partial_specialization_p, impartial_args): New.
1877 (instantiate_decl): Call impartial_args.
1879 * mangle.c (maybe_check_abi_tags): New.
1880 (write_guarded_var_name): Call it.
1881 (mangle_ref_init_variable): Call check_abi_tags.
1883 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1884 between template and instantiation.
1886 2016-01-29 Jakub Jelinek <jakub@redhat.com>
1889 * decl.c (wrapup_globals_for_namespace): Warn about unused static
1890 function declarations.
1892 2016-01-29 Marek Polacek <polacek@redhat.com>
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
1901 2016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
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.
1907 2016-01-28 Jason Merrill <jason@redhat.com>
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.
1915 2016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
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.
1923 2016-01-27 Marek Polacek <polacek@redhat.com>
1926 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1927 needed. Add -Wsign-compare warning.
1929 2016-01-27 Ryan Burn <contact@rnburn.com>
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.
1936 2016-01-27 Marek Polacek <polacek@redhat.com>
1939 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1940 wrapped in NOP_EXPRs.
1942 2016-01-27 Martin Sebor <msebor@redhat.com>
1945 * mangle.c (mangle_decl): Reference the correct (saved) version
1946 of the ABI in -Wabi diagnostics.
1948 2016-01-27 Marek Polacek <polacek@redhat.com>
1951 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1952 elements of the array.
1954 2016-01-26 Jason Merrill <jason@redhat.com>
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.
1963 2016-01-26 Jason Merrill <jason@redhat.com>
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.
1971 2016-01-26 Jakub Jelinek <jakub@redhat.com>
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
1978 2016-01-26 David Malcolm <dmalcolm@redhat.com>
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.
1985 2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
1988 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
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
2006 2016-01-23 Martin Sebor <msebor@redhat.com>
2010 * decl2.c (is_late_template_attribute): Handle dependent argument
2011 to attribute align and attribute vector_size.
2013 2016-01-21 Jason Merrill <jason@redhat.com>
2016 * lambda.c (lambda_capture_field_type): Handle 'this' specially
2017 for init-capture, too.
2020 * decl.c (type_is_deprecated): Don't look into a typedef.
2024 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
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.
2032 2016-01-19 Jason Merrill <jason@redhat.com>
2035 * pt.c (convert_template_argument): Handle VAR_DECL properly.
2037 2016-01-19 Marek Polacek <polacek@redhat.com>
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.
2046 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
2048 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
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
2066 2016-01-18 Jason Merrill <jason@redhat.com>
2068 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
2070 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
2073 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
2074 (contains_label_1, contains_label_p): Remove.
2076 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
2079 * pt.c (type_dependent_expression_p): For a function template
2080 specialization, a type is dependent iff any of its template
2083 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
2085 * cp-array-notation.c (cp_expand_cond_array_notations): Return
2086 error_mark_node only if find_rank failed, not if it was
2089 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
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
2095 (build_min_non_dep_op_overload): Instead, do it here.
2097 2016-01-15 Jakub Jelinek <jakub@redhat.com>
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
2111 2016-01-15 Jason Merrill <jason@redhat.com>
2114 * call.c (build_cxx_call): Use fold_non_dependent_expr.
2116 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
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.
2126 2016-01-14 Tom de Vries <tom@codesourcery.com>
2128 PR tree-optimization/68773
2129 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
2132 2016-01-14 Jason Merrill <jason@redhat.com>
2135 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
2137 2016-01-12 Marek Polacek <polacek@redhat.com>
2140 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
2141 error_at and adjust the return value.
2143 2016-01-12 Jakub Jelinek <jakub@redhat.com>
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.
2153 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
2155 2016-01-11 Jason Merrill <jason@redhat.com>
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.
2162 2016-01-11 David Malcolm <dmalcolm@redhat.com>
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.
2172 2016-01-11 Jakub Jelinek <jakub@redhat.com>
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
2180 2016-01-09 Marek Polacek <polacek@redhat.com>
2183 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
2185 2016-01-09 Jakub Jelinek <jakub@redhat.com>
2188 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
2190 2016-01-08 Jason Merrill <jason@redhat.com>
2193 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
2196 2016-01-08 Marek Polacek <polacek@redhat.com>
2199 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
2201 2016-01-08 Jason Merrill <jason@redhat.com>
2203 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
2208 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
2209 TREE_ADDRESSABLE type.
2213 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2215 2016-01-05 Nathan Sidwell <nathan@acm.org>
2218 * pt.c (build_non_dependent_expr): Don't try a checking fold when
2221 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2223 Update copyright years.
2225 Copyright (C) 2016 Free Software Foundation, Inc.
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.