1 2017-07-06 Vyacheslav Barinov <v.barinov@samsung.com>
3 * parser.c (cp_parser_compound_statement): Use STATEMENT_LIST_END
4 to keep the location of closing brace.
5 * pt.c: Handle STATEMENT_LIST_END.
6 * constexpr.c (cxx_eval_constant_expression): Likewise.
8 2017-01-26 Jason Merrill <jason@redhat.com>
10 PR c++/79176 - lambda ICE with -flto -Os
11 * decl2.c (vague_linkage_p): Handle decloned 'tors.
12 * tree.c (decl_linkage): Likewise.
14 2017-01-20 Marek Polacek <polacek@redhat.com>
16 Backported from mainline
17 2017-01-04 Marek Polacek <polacek@redhat.com>
21 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
23 2017-01-17 Jakub Jelinek <jakub@redhat.com>
25 Backported from mainline
26 2017-01-11 Jakub Jelinek <jakub@redhat.com>
29 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
30 assertion. Formatting fix.
32 2017-01-04 Jakub Jelinek <jakub@redhat.com>
35 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
39 * parser.c (cp_parser_simple_declaration): Only complain about
40 inconsistent auto deduction if auto_result doesn't use auto.
43 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
44 assertion, as lexer->buffer may be NULL.
46 2017-01-11 Nathan Sidwell <nathan@acm.org>
49 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
52 2016-12-21 Release Manager
56 2016-12-14 Nathan Sidwell <nathan@acm.org>
59 * pt.c (type_unification_real): Check tsubst arg doesn't have
60 remaining template parms before converting it.
62 2016-12-08 Nathan Sidwell <nathan@acm.org>
65 * constexpr.c (extract_string_elt): New. Broken out of ...
66 (cxx_eval_array_reference): ... here. Call it.
67 (cxx_eval_store_expression): Convert init by STRING_CST into
68 CONSTRUCTOR, if needed.
70 2016-12-07 Jakub Jelinek <jakub@redhat.com>
72 Backported from mainline
73 2016-12-02 Jakub Jelinek <jakub@redhat.com>
76 * pt.c (tsubst_init): Don't call build_value_init if decl's type
79 2016-11-28 Jakub Jelinek <jakub@redhat.com>
80 Jason Merrill <jason@redhat.com>
83 * decl.c (finish_enum_value_list): Call fixup_type_variants on
84 current_class_type after
85 insert_late_enum_def_into_classtype_sorted_fields.
87 2016-11-28 Jakub Jelinek <jakub@redhat.com>
90 * typeck.c (maybe_warn_about_returning_address_of_local): Optimize
91 whats_returned through fold_for_warn.
93 2016-11-23 Jakub Jelinek <jakub@redhat.com>
96 * cp-gimplify.c (cp_gimplify_tree) <case VEC_INIT_EXPR>: Pass
97 false as handle_invisiref_parm_p to cp_genericize_tree.
98 (struct cp_genericize_data): Add handle_invisiref_parm_p field.
99 (cp_genericize_r): Don't wrap is_invisiref_parm into references
100 if !wtd->handle_invisiref_parm_p.
101 (cp_genericize_tree): Add handle_invisiref_parm_p argument,
102 set wtd.handle_invisiref_parm_p to it.
103 (cp_genericize): Pass true as handle_invisiref_parm_p to
104 cp_genericize_tree. Formatting fix.
106 2016-11-18 Jakub Jelinek <jakub@redhat.com>
109 * mangle.c (mangle_tls_init_fn, mangle_tls_wrapper_fn): Call
112 2016-10-31 Jakub Jelinek <jakub@redhat.com>
115 * parser.c (cp_parser_postfix_expression): Replace return statement in
116 the first switch with setting postfix_expression to the return
117 expression and break;.
119 2016-09-28 Jakub Jelinek <jakub@redhat.com>
122 * constexpr.c (enum constexpr_switch_state): New.
123 (struct constexpr_ctx): Add css_state field.
124 (label_matches): Add CTX and STMT arguments, remove I and
125 DEFAULT_LABEL. For CASE_LABEL_EXPR assert ctx->css_state != NULL,
126 handle default labels according to css_state.
127 (cxx_eval_statement_list): Remove statement skipping, label_matches
128 and default_label handling code.
129 (cxx_eval_loop_expr): Exit after first iteration even if
130 switches (jump_target).
131 (cxx_eval_switch_expr): Set up css_state field in ctx, if default
132 label has been seen in the body, but no cases matched, evaluate
133 the body second time.
134 (cxx_eval_constant_expression): Handle stmt skipping and label_matches
135 here. Handle PREDICT_EXPR. For MODIFY_EXPR or INIT_EXPR, assert
136 statement is not skipped. For COND_EXPR during skipping, don't
137 evaluate condition, just the then block and if still skipping at the
138 end also the else block.
139 (cxx_eval_outermost_constant_expr): Adjust constexpr_ctx initializer.
140 (is_sub_constant_expr): Likewise.
142 2016-09-27 Jakub Jelinek <jakub@redhat.com>
145 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Instrument also
146 functions that have just a STATEMENT_LIST instead of BIND_EXPR, or
147 BIND_EXPR with some statement rather than STATEMENT_LIST as body.
149 2016-09-20 Jakub Jelinek <jakub@redhat.com>
152 * parser.c (cp_parser_template_declaration_after_parameter): For 2
153 argument operator"" template set ok to false for
154 parm == error_mark_node.
157 * parser.c (cp_parser_std_attribute_list): Reject ... without
160 2016-09-16 Jakub Jelinek <jakub@redhat.com>
163 * error.c (dump_simple_decl): Only check DECL_DECLARED_CONCEPT_P
164 if DECL_LANG_SPECIFIC is non-NULL. Fix up formatting.
167 * class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any
168 TYPE_HAS_MUTABLE_P for any bases.
170 2016-12-06 Jason Merrill <jason@redhat.com>
173 * decl2.c (maybe_instantiate_decl): Split out from mark_used.
174 (decl_constant_var_p): Use it instead.
177 * pt.c (resolve_typename_type): Try to avoid calling
178 currently_open_class.
181 * constexpr.c (cxx_eval_constant_expression): Use cp_fold_convert.
184 * pt.c (do_type_instantiation): Don't mess with non-user-provided
187 2016-11-18 Jason Merrill <jason@redhat.com>
189 PR c++/67631 - list-init and explicit conversions
190 * semantics.c (finish_compound_literal): Call digest_init_flags.
191 * typeck2.c (digest_init_flags): Add complain parm.
192 (store_init_value): Pass it.
194 2016-11-17 Jason Merrill <jason@redhat.com>
197 * parser.c (cp_parser_fold_expression): Check TREE_NO_WARNING.
199 2016-11-05 Martin Sebor <msebor@redhat.com>
202 * class.c (diagnose_flexarrays): Avoid rejecting an invalid flexible
203 array member with a hard error when it is followed by another member
204 in a different struct, and instead issue just a pedantic warning.
206 2016-10-14 Martin Sebor <msebor@redhat.com>
209 * class.c (struct flexmems_t): Add members.
210 (find_flexarrays): Add arguments. Correct handling of anonymous
212 (diagnose_flexarrays): Adjust to issue warnings in addition to errors.
213 (check_flexarrays): Add argument.
214 (diagnose_invalid_flexarray): New functions.
216 2016-10-04 Martin Sebor <msebor@redhat.com>
219 * init.c (warn_placement_new_too_small): Avoid assuming an array type
222 2016-09-22 Paolo Carlini <paolo.carlini@oracle.com>
225 * class.c (build_base_path): Allow for lookup_base returning
228 2016-09-16 Jakub Jelinek <jakub@redhat.com>
230 Backported from mainline
231 2016-09-13 Jakub Jelinek <jakub@redhat.com>
234 * constexpr.c (cxx_fold_pointer_plus_expression): New function.
235 (cxx_eval_binary_expression): Use it for POINTER_PLUS_EXPR.
236 (cxx_eval_pointer_plus_expression): Remove.
237 (cxx_eval_constant_expression) <case POINTER_PLUS_EXPR>: Don't
238 call cxx_eval_pointer_plus_expression.
240 2016-09-14 Nathan Sidwell <nathan@acm.org>
243 * constexpr.c (get_fundef_copy): Use the original function for
244 non-recursive evaluations.
245 (save_fundef_copy): Always expect a slot to be available.
247 2016-08-22 Release Manager
249 * GCC 6.2.0 released.
251 2016-08-13 Jason Merrill <jason@redhat.com>
254 * constexpr.c (cxx_eval_array_reference): Handle looking for the
255 value of an element we're currently modifying.
257 2016-08-11 Jakub Jelinek <jakub@redhat.com>
260 * constexpr.c (label_matches): Handle case range expressions.
262 2016-08-11 Jason Merrill <jason@redhat.com>
265 * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION.
267 2016-08-08 Paolo Carlini <paolo.carlini@oracle.com>
270 * lambda.c (add_capture): Check lambda_capture_field_type return
271 value for error_mark_node.
273 2016-08-05 Nathan Sidwell <nathan@acm.org>
276 * pt.c (unify): TRAIT_EXPR is an expr.
278 2016-08-04 Jason Merrill <jason@redhat.com>
281 * pt.c (tsubst_pack_expansion): Pull a single pack expansion out
284 2016-07-29 Jason Merrill <jason@redhat.com>
287 * init.c (expand_aggr_init_1): Only handle value-init of bases.
288 * constexpr.c (build_data_member_initialization): Handle multiple
289 initializers for the same field.
291 2016-07-25 Jason Merrill <jason@redhat.com>
294 * call.c (convert_like_real): Use lvalue_kind.
297 * pt.c (coerce_template_parameter_pack): Fix logic for
300 2016-07-23 Jason Merrill <jason@redhat.com>
304 * init.c (expand_aggr_init_1): Handle list-initialization from {}.
307 * class.c (walk_subobject_offsets): Handle 0-length array.
310 * pt.c (tsubst): Also substitute into the template of a
311 BOUND_TEMPLATE_TEMPLATE_PARM.
314 * pt.c (lookup_template_class_1): Handle getting template from tsubst.
317 * decl.c (reshape_init_r): Check complain for missing braces warning.
319 2016-07-22 Jason Merrill <jason@redhat.com>
323 * pt.c (tsubst_baselink): Call
324 adjust_result_of_qualified_name_lookup for unqualified
327 2016-07-21 Jason Merrill <jason@redhat.com>
330 * semantics.c (apply_deduced_return_type): Call
331 complete_type_or_else before building the new RESULT_DECL.
334 * pt.c (instantiate_decl): Fix pattern_defined for namespace scope
338 * call.c (unsafe_copy_elision_p): It's OK to elide when
339 initializing an unknown object.
341 2016-07-21 Jakub Jelinek <jakub@redhat.com>
344 * constexpr.c (potential_constant_expression_1) <case GOTO_EXPR>:
345 Replace assert with test, return false if the goto isn't break
346 or continue. Formatting fix.
348 2016-07-21 Jakub Jelinek <jakub@redhat.com>
351 * cp-gimplify.c (cp_genericize): For nested cp_genericize calls
352 save/restore bc_label array.
354 2016-07-21 Patrick Palka <ppalka@gcc.gnu.org>
358 * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
360 * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
361 on the qualified_id then propagate it to the resulting
363 (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
365 * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
366 its REF_PARENTHESIZED_P flag.
368 2016-07-21 Andrew Sutton <andrew.n.sutton@gmail.com>
369 Jason Merrill <jason@redhat.com>
371 Improving concepts performance and diagnostics.
375 * cp-tree.def (CHECK_CONSTR): New.
376 * cp-tree.h (CHECK_CONSTR_CONCEPT): New.
377 (CHECK_CONSTR_ARGS): New.
378 * constraint.cc (make_predicate_constraint): Remove in favor of
379 normalize_expression.
380 (resolve_constraint_check): Actually return error_mark_node when
382 (resolve_variable_concept_check): Perform coercion as if processing
383 a template. Also return errors on resolution failure.
384 (lift_*): Remove all of these functions. Don't unnecessarily inline
386 (learn_*): Add facilities to memoize implications for subsumption
387 during normalization.
388 (expanding_concept): New.
389 (expand_concept): New. Return the inlined and normalized definition
390 of a concept when needed.
391 (transform_*, xform_*): Rename to normalize_* to better reflect the
392 responsibility of those functions.
393 (normalize_template_id_expression): Check for non-boolean operands
394 when possible. Generate check constraints instead of normal variable
396 (normalize_call_expression): Report errors when resolution fails.
397 (check_for_logical_overloads): Rewrite this check to more accurately
399 (normalize_atom): Check for overloaded calls and invalid types before
400 determining if the expression refers to a concept.
401 (build_constraints): Don't cache normalized constraints or decomposed
403 (finish_shorthand_constraint): Return a normalized expression instead
404 of a predicate constraint.
405 (finish_template_introduction): Same.
406 (placeholder_extract_concept_and_args): Rewrite this since we only
407 ever get check constraints here.
408 (equivalent_placeholder_constraints): Rewrite in terms of check
409 constraints, and handle error_mark_nodes correctly.
410 (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr)
411 (tsubst_implicit_conversion_constr)
412 (tsubst_argument_deduction_constr, tsubst_exception_constr)
413 (tsubst_parameterized_constraint, tsubst_constraint): New.
414 (tsbust_conjunection): Replace with tsubst_logical_operator and
415 actually generate the right kind of constraint.
416 (tsubst_requirement_body): Reverse the order of substituted arguments
417 so that they appear in the order written (helps diagnostics).
418 (satisfy_check_constraint): New.
419 (satisfy_conjunction): Simplify.
420 (satisfy_disjunction): Same.
421 (satisfy_constraint_1): Handle check constraints.
422 (eval_constr): New (private) global state.
423 (evaluating_constraints_sentinel): New. Manages eval_constr.
424 (satisfy_constraint): Add timing variables.
425 (satisfy_associated_constraints): Add hooks for memoization.
426 (evaluate_function_concept): Build a check constraint instead of
427 normalizing its definition.
428 (evaluate_variable_concept): Same.
429 (evaluate_constraint_expression): Normalize, but in the current
430 declaration processing context.
431 (evaluating_constraints_p): New.
432 (elide_constraint_failure_p): Actually emit constraint_thresh errors.
433 (diagnose_*): Remove artificial indentation. Add a new parameter to
434 each that tracks the current (complete) constraint prior to any
436 (diagnose_expression): Removed.
437 (diagnose_call_expression): Same.
438 (diagnose_template_id): Same.
439 (diagnose_template_id): New.
440 (diagnose_logical_constraint): New.
441 (diagnose_expression_constraint): Show the original expression.
442 (diagnose_type_constraint): Show the original type.
443 (diagnose_implicit_conversion_constraint): Be specific about
444 failures, don't re-diagnose a known-to-be-failed substitutions,
445 and manage elisions properly.
446 (diagnose_argument_deduction_constraint): Same.
447 (diagnose_exception_constraint): Same.
448 (diagnose_parameterized_constraint): Same.
449 (constraint_p): Allow EXPR_PACK_EXPANSION.
450 * logic.cc (next_by_distance): Removed. No longer used.
451 (any_p): Renamed from any_of.
452 (term_entry, term_hasher): New.
453 (term_list): Rewrite to include a hash table for quick lookup.
454 Also, make less stateful.
455 (proof_state): Extend to allow goals to be discharged once
457 (non_atomic_constraint_p): New.
458 (any_non_atomic_constraints_p): New.
459 (...rest...): Previous implementation completely replaced with an
460 iterative algorithm that opportunistically prunes the search space
461 before committing to using more memory.
462 * parser.c: (cp_parser_type_parameter): Normalize constraints.
463 (cp_parser_explicit_template_declaration): Same.
464 * pt.c: (finish_template_variable): Be less redundant with this error
466 (template_args_equal): No longer static.
467 (tsubst_decl): Don't try to find specializations of variables that
468 have already been instantiated.
469 (build_non_dependent_expr): Avoid infinite recursion during concept
471 (make_constrained_auto): Normalize constraints.
472 (do_auto_deduction): When doing auto deduction from a
473 partial-concept-id, be sure to include the explicit args checking
475 (constraint_sat_*): New. Memoize satisfied constraints.
476 (concept_spec_*): New. Memoize expressions associated with a concept
478 (constraint_memos, concept_memos): New.
479 (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New.
480 (lookup_concept_satisfaction, memoize_concept_satisfaction): New.
481 (get_concept_expansion, save_concept_expansion): New.
482 (hash_subsumption_args): New.
483 (comp_subsumption_args): New.
484 (subsumption_*): New. Memoize parts of the subsumption relation.
485 (lookup_subsumption_result, save_subsumption_result): New.
486 (init_constraint_processing): Initialize memo tables.
487 (get_constraints): Shortcut if !flag_concepts.
488 * decl.c (grokfndecl): Normalize constraints.
489 * error.c (dump_simple_decl): Print "concept" when appropriate.
490 (dump_function_decl): Same.
491 (dump_template_decl): Don't write requirements when we're not
493 (dump_expr): Handle fold expressions.
494 * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle
496 (get_fold_operator): New.
497 (pp_cxx_unary_left_fold_expression): New.
498 (pp_cxx_unary_right_fold_expression): New.
499 (pp_cxx_binary_fold_expression): New.
500 (pp_cxx_check_constraint): New.
501 (pp_cxx_*_constraint): Rewrite the grammar of internal constraints
502 to make them easier to read when debugging.
503 * search.c (accessible_p): Don't shortcut when evaluating constraints.
504 * tree.c (cp_tree_equal): Handle CHECK_CONSTR.
506 2016-07-21 Jason Merrill <jason@redhat.com>
509 * parser.c (cp_parser_lambda_expression): Unset OK if there was an
510 error parsing the lambda-declarator.
513 * constexpr.c (cxx_eval_binary_expression): Handle comparison
514 between lowered and unlowered PTRMEM_CST.
517 * constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
518 threw away DECL_SAVED_TREE.
522 * call.c (add_template_conv_candidate): Disable if there are
526 * call.c (convert_like_real): Mask complain.
529 * typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.
532 * pt.c (tsubst_attributes): Fix loop logic.
536 * parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
537 (cp_parser_simple_declaration): Diagnose type definition in
538 for-range-declaration.
541 * operators.def: Add *_FOLD_EXPR.
542 * cp-tree.h (FOLD_EXPR_P): Parenthesize.
543 * mangle.c (write_expression): Handle fold-expressions.
544 * pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
545 (tsubst_unary_right_fold, tsubst_binary_right_fold): Handle
546 partial instantiation.
549 * mangle.c (write_expression): Handle sizeof... an argument pack.
552 * pt.c (push_tinst_level_loc): Set at_eof before fatal_error.
555 * init.c (constant_value_1): Don't instantiated DECL_INITIAL of
556 artificial variables.
558 * lambda.c (maybe_add_lambda_conv_op): Fix null object argument.
560 2016-07-20 Jakub Jelinek <jakub@redhat.com>
563 * parser.c (cp_parser_save_member_function_body): Consume
564 __transaction_relaxed or __transaction_atomic with optional
565 attribute. Only skip catch with block if try keyword is seen.
567 2016-07-19 Jakub Jelinek <jakub@redhat.com>
569 Backported from mainline
570 2016-07-18 Jakub Jelinek <jakub@redhat.com>
573 * call.c (build_op_call_1): Use convert_like_with_context only
574 if cand->fn is a decl.
577 * constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
578 For lval don't use cxx_eval_unary_expression and instead recurse
579 and if needed rebuild the reference.
582 * cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
583 fold *expr_p before genericizing it.
586 * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
588 2016-07-07 Jakub Jelinek <jakub@redhat.com>
589 Kai Tietz <ktietz70@googlemail.com>
593 * cp-gimplify.c (cp_genericize_r): For DECL_EXPR for non-static
594 artificial vars, genericize their initializers.
596 2016-06-21 Jakub Jelinek <jakub@redhat.com>
598 Backported from mainline
599 2016-06-17 Jakub Jelinek <jakub@redhat.com>
601 * semantics.c (handle_omp_array_sections_1): Don't ICE when
602 processing_template_decl when checking for bitfields and unions.
603 Look through REFERENCE_REF_P as base of COMPONENT_REF.
604 (finish_omp_clauses): Look through REFERENCE_REF_P even for
605 array sections with COMPONENT_REF bases.
607 2016-06-16 Jakub Jelinek <jakub@redhat.com>
609 * parser.c (cp_parser_omp_var_list_no_open): Call
610 convert_from_reference before cp_parser_postfix_dot_deref_expression.
611 * semantics.c (finish_omp_clauses): Don't ICE when
612 processing_template_decl when checking for bitfields and unions.
613 Look through REFERENCE_REF_P as base of COMPONENT_REF.
615 2016-06-14 Jakub Jelinek <jakub@redhat.com>
618 * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
619 olddecl vars, preserve their TREE_READONLY bit.
621 2016-06-14 Paolo Carlini <paolo.carlini@oracle.com>
624 * decl.c (cp_finish_decl): Check do_auto_deduction return value
625 and return immediately in case of erroneous code.
627 2016-06-14 Jakub Jelinek <jakub@redhat.com>
630 * decl.c (complete_vars): Handle gracefully type == error_mark_node.
632 2016-06-10 Thomas Schwinge <thomas@codesourcery.com>
635 Backport from trunk r237290:
636 * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
639 2016-06-08 Jakub Jelinek <jakub@redhat.com>
642 * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
644 2016-06-06 Jakub Jelinek <jakub@redhat.com>
645 Patrick Palka <ppalka@gcc.gnu.org>
650 * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
651 right after cp_fold call if cp_fold has returned the same stmt
652 already in some earlier cp_fold_r call.
653 (cp_fold_function): Add pset automatic variable, pass its address
656 2016-06-02 Jakub Jelinek <jakub@redhat.com>
659 * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
660 is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
661 and TREE_THIS_VOLATILE flags. For ARRAY_REF and ARRAY_RANGE_REF, copy
662 over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
663 to the newly built tree.
665 2016-06-02 Paolo Carlini <paolo.carlini@oracle.com>
668 * method.c (forward_parm): Use cp_build_reference_type.
670 2016-05-31 Jason Merrill <jason@redhat.com>
673 * decl2.c (c_parse_final_cleanups): Don't call fini_constexpr.
676 * pt.c (check_explicit_specialization): Give better diagnostic about
677 specializing a hidden friend.
682 * pt.c (instantiate_template_1): Don't put the partial
683 specialization in DECL_TI_TEMPLATE.
684 (partial_specialization_p, impartial_args): Remove.
685 (regenerate_decl_from_template): Add args parm.
686 (instantiate_decl): Look up the partial specialization again.
690 * cp-tree.h (enum tag_types): Add scope_type.
691 * parser.c (cp_parser_class_name): Use scope_type.
692 (prefer_type_arg): Handle scope_type.
693 (cp_parser_lookup_name): Use prefer_type_arg.
694 * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
695 int prefer_type, use lookup_flags.
696 * name-lookup.h: Adjust.
699 * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
701 (cp_fold) [INDIRECT_REF]: Call maybe_undo_parenthesized_ref.
704 * pt.c (tsubst_copy): Just return a local variable from
705 non-template context. Don't call rest_of_decl_compilation for
706 duplicated static locals.
707 (tsubst_decl): Set DECL_CONTEXT of local static from another
710 2016-05-31 Martin Sebor <msebor@redhat.com>
713 * init.c (warn_placement_new_too_small): Handle placement new arguments
714 that are elements of arrays more carefully. Remove a pointless loop.
716 2016-05-30 Jakub Jelinek <jakub@redhat.com>
719 * parser.c (cp_parser_omp_for): Don't disallow nowait clause
720 when combined with target construct.
721 (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
722 to cp_parser_omp_all_clauses.
724 2016-05-29 Paolo Carlini <paolo.carlini@oracle.com>
727 * lambda.c (maybe_add_lambda_conv_op): Early return also when
728 LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
730 2016-05-24 Martin Sebor <msebor@redhat.com>
733 * decl.c (layout_var_decl, grokdeclarator): Use
734 complete_or_array_type_p.
735 * pt.c (instantiate_class_template_1): Try to complete the element
736 type of a flexible array member.
737 (can_complete_type_without_circularity): Handle arrays of unknown bound.
738 * typeck.c (complete_type): Also complete the type of the elements of
739 arrays with an unspecified bound.
741 2016-05-24 Paolo Carlini <paolo.carlini@oracle.com>
744 * typeck2.c (check_narrowing): Check pedwarn return value.
746 2016-05-24 Jakub Jelinek <jakub@redhat.com>
749 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
750 For OMP_CLAUSE_LINEAR_REF don't require type to be
753 2016-05-23 Jason Merrill <jason@redhat.com>
756 * constexpr.c (cxx_eval_call_expression): Check for
757 fun == current_function_decl again.
759 2016-05-19 David Malcolm <dmalcolm@redhat.com>
761 Backport from trunk r236483.
763 * parser.c (cp_parser_operator): For array new/delete, check that
764 cp_parser_require returned a non-NULL token before dereferencing
767 2016-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
769 Backport from mainline
770 2016-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
772 * decl.c (finish_enum_value_list): Use the specified mode.
774 2016-05-18 Paolo Carlini <paolo.carlini@oracle.com>
777 * call.c (convert_like_real): Check that we are actually converting
780 2016-04-29 Cesar Philippidis <cesar@codesourcery.com>
783 * parser.c (cp_parser_oacc_loop): Don't augment mask with
784 OACC_LOOP_CLAUSE_MASK.
785 (cp_parser_oacc_kernels_parallel): Update call to
786 c_oacc_split_loop_clauses.
788 2016-04-28 Paolo Carlini <paolo.carlini@oracle.com>
791 * semantics.c (process_outer_var_ref): Unconditionally return
792 error_mark_node when mark_used returns false.
794 2016-04-27 Release Manager
796 * GCC 6.1.0 released.
798 2016-04-26 Jakub Jelinek <jakub@redhat.com>
801 * pt.c (build_non_dependent_expr): Temporarily disable flag_checking
804 2016-04-22 Jason Merrill <jason@redhat.com>
808 * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
812 * name-lookup.c (qualified_lookup_using_namespace): Look through
815 2016-04-19 Jason Merrill <jason@redhat.com>
818 * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
819 * pt.c (make_pack_expansion): Call mark_exp_read.
820 * semantics.c (finish_id_expression): Call mark_type_use in
823 2016-04-18 Jason Merrill <jason@redhat.com>
827 * class.c (type_maybe_constexpr_default_constructor): New.
828 (type_has_constexpr_default_constructor): Revert.
831 * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
832 unknown_type_node, too.
834 2016-04-15 Jason Merrill <jason@redhat.com>
837 * constexpr.c (get_fundef_copy): Handle null *slot.
839 2016-04-15 Jason Merrill <jason@redhat.com>
840 Nathan Sidwell <nathan@acm.org>
843 * constexpr.c (constexpr_call_table): Preserve in GC.
844 (struct fundef_copy, struct fundef_copies_table_t): Delete.
845 (fundef_copies_table): Preserve in GC. Change to pointer to
847 (maybe_initialize_fundef_copies_table): Adjust.
848 (get_fundef_copy): Return a TREE_LIST. Use non-inserting search.
849 (save_fundef_copy): Adjust for a TREE_LIST.
850 (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
851 (fini_constexpr): New.
852 * cp-tree.h (fini_constexpr): Declare.
853 * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
855 2016-04-15 Jakub Jelinek <jakub@redhat.com>
858 * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
860 (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
861 cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
862 cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
863 (cp_parser_statement): Likewise. Adjust cp_parser_cilk_for caller.
864 (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
866 (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
867 cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
868 cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
869 cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
870 cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
871 cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
872 cp_parser_omp_taskloop, cp_parser_omp_construct,
873 cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
874 Add IF_P argument, pass it down where needed.
875 (cp_parser_omp_for_loop): Likewise. Clear IF_P if nbraces.
876 (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
879 2016-04-14 Jason Merrill <jason@redhat.com>
882 * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
883 * typeck2.c (split_nonconstant_init_1): Use it.
886 * class.c (type_has_constexpr_default_constructor): Return true
887 for an implicitly declared constructor.
890 * parser.c (cp_parser_init_declarator): Add auto_result parm.
891 (cp_parser_simple_declaration): Pass it.
892 (strip_declarator_types): New.
895 * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
896 initializer also makes the variable value-dependent.
899 * constexpr.c (cxx_eval_store_expression): Also copy
900 CONSTRUCTOR_NO_IMPLICIT_ZERO.
902 2016-04-14 Martin Sebor <msebor@redhat.com>
907 * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
909 2016-04-14 Jason Merrill <jason@redhat.com>
911 * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
912 parameter ABI change.
914 2016-04-13 Martin Sebor <msebor@redhat.com>
919 * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
921 * decl.c (check_initializer, cp_finish_decl): Call them.
922 (reshape_init_r): Reject incompletely braced intializer-lists
924 * init.c (throw_bad_array_length, build_vla_check)
925 (build_vla_size_check, build_vla_init_check): Define new functions.
926 * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
928 (store_init_value): Same.
930 2016-04-13 Jason Merrill <jason@redhat.com>
932 Warn about empty parameter ABI with -Wabi=9.
933 * call.c (empty_class_msg, mark_for_abi_warning)
934 (warn_empty_class_abi): New.
935 (build_call_a): Use them.
936 * decl.c (store_parm_decls): Use mark_for_abi_warning.
937 * error.c (pp_format_to_string): New.
939 Pass empty class parameters like C.
940 * call.c (pass_as_empty_struct, empty_class_arg): New.
941 (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
942 (build_call_a): Use empty_class_arg.
943 * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
944 * decl.c (cxx_init_decl_processing): Create empty_struct_type.
946 2016-04-13 Jason Merrill <jason@redhat.com>
949 * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
951 2016-04-13 Paolo Carlini <paolo.carlini@oracle.com>
954 * pt.c (resolve_typename_type): Fix typos in infinite recursion
957 2016-04-13 Jason Merrill <jason@redhat.com>
960 * pt.c (instantiation_dependent_uneval_expression_p): Split out
961 from instantiation_dependent_expression_p.
962 (value_dependent_expression_p): Use it for unevaluated operands.
963 (instantiation_dependent_r): Don't check value-dependence.
964 (instantiation_dependent_expression_p): Check
965 value-dependence of the expression as a whole.
966 * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
967 * semantics.c (finish_decltype_type): Use it.
969 * constexpr.c (potential_nondependent_constant_expression): New.
970 (potential_nondependent_static_init_expression): New.
971 (maybe_constant_value_1, fold_non_dependent_expr)
972 (maybe_constant_init): Use them.
973 * pt.c (instantiate_non_dependent_expr_sfinae)
974 (instantiate_non_dependent_or_null, convert_nontype_argument): Use
976 * cp-tree.h: Declare them.
978 2016-04-13 Jakub Jelinek <jakub@redhat.com>
981 * decl.c (pop_labels_1): Removed.
982 (note_label, sort_labels): New functions.
983 (pop_labels): During named_labels traversal, just push the slot
984 pointers into a vector, then qsort it by DECL_UID and only then
985 call pop_label and chain it into BLOCK_VARS.
987 2016-04-13 Jason Merrill <jason@redhat.com>
990 * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
991 (cp_gimplify_expr): Not here.
993 2016-04-12 Patrick Palka <ppalka@gcc.gnu.org>
996 * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
998 * typeck.c (build_x_conditional_expr): Unconditionally remember
999 that the result is an lvalue or xvalue.
1001 2016-04-12 Jason Merrill <jason@redhat.com>
1003 * class.c (is_really_empty_class): A zero-length array is empty.
1004 An unnamed bit-field doesn't make a class non-empty.
1006 2016-04-12 Paolo Carlini <paolo.carlini@oracle.com>
1009 * parser.c (cp_parser_cache_defarg): When file ends in default
1010 argument simply return error_mark_node.
1012 2016-04-12 Nathan Sidwell <nathan@acm.org>
1015 * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
1018 2016-04-11 Jason Merrill <jason@redhat.com>
1020 * mangle.c (decl_is_template_id): The template itself counts as a
1023 2016-04-08 Patrick Palka <ppalka@gcc.gnu.org>
1027 * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
1028 on the result if it's not a CONSTRUCTOR.
1030 2016-04-07 Patrick Palka <ppalka@gcc.gnu.org>
1033 * constexpr.c (find_constructor): New function.
1034 (unshare_constructor): New function.
1035 (cxx_eval_call_expression): Use unshare_constructor instead of
1037 (find_array_ctor_elt): Likewise.
1038 (cxx_eval_vec_init_1): Likewise.
1039 (cxx_eval_store_expression): Likewise.
1040 (cxx_eval_constant_expression): Likewise.
1042 2016-04-06 Patrick Palka <ppalka@gcc.gnu.org>
1045 * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
1046 potentially generating a future -Wparentheses warning in its
1049 2016-04-06 Jason Merrill <jason@redhat.com>
1051 * class.c (check_abi_tags): Fix function template handling.
1053 2016-04-05 Nathan Sidwell <nathan@acm.org>
1056 * class.c (fixup_may_alias): New.
1057 (fixup_attribute_variants): Call it.
1059 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
1062 * constexpr.c (struct fundef_copy): New struct.
1063 (struct fundef_copies_table_t): New struct.
1064 (fundef_copies_table): New static variable.
1065 (maybe_initialize_fundef_copies_table): New static function.
1066 (get_fundef_copy): New static function.
1067 (save_fundef_copy): New static function.
1068 (cxx_eval_call_expression): Use get_fundef_copy, and
1070 (constexpr_call_table): Add "deletable" GTY marker.
1072 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
1075 * cp-tree.h (class cache_map): Remove.
1076 * constexpr.c (cv_cache): Change type to
1077 GTY((deletable)) hash_map<tree, tree> *.
1078 (maybe_constant_value): Adjust following the change to cv_cache.
1079 (clear_cv_cache): New static function.
1080 (clear_cv_and_fold_caches): Use it.
1081 * cp-gimplify.c (fold_cache): Change type to
1082 GTY((deletable)) hash_map<tree, tree> *.
1083 (clear_fold_cache): Adjust following the change to fold_cache.
1084 (cp_fold): Likewise.
1086 2016-04-02 Martin Sebor <msebor@redhat.com>
1092 * constexpr.c (diag_array_subscript): New function.
1093 (cxx_eval_array_reference): Detect out of bounds array indices.
1095 2016-04-01 Jason Merrill <jason@redhat.com>
1099 * pt.c (instantiate_decl): A function isn't fully defined if
1100 DECL_INITIAL is error_mark_node.
1101 * constexpr.c (cxx_eval_call_expression): Likewise.
1103 2016-04-01 Jakub Jelinek <jakub@redhat.com>
1104 Marek Polacek <polacek@redhat.com>
1107 * init.c (warn_placement_new_too_small): Test whether
1108 DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
1110 2016-04-01 Nathan Sidwell <nathan@acm.org>
1113 * decl.c (check_redeclaration_exception_specification): Check
1114 regardless of -fno-exceptions.
1115 * typeck2.c (merge_exception_specifiers): Relax assert by checking
1116 flag_exceptions too.
1118 2016-03-31 Nathan Sidwell <nathan@acm.org>
1120 * decl.c (start_preparsed_function): Remove unnecessary bracing.
1121 (finish_destructor_body): Don't emit operator delete here.
1123 2016-03-31 Nathan Sidwell <nathan@acm.org>
1126 * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
1127 elements in field order.
1129 2016-03-31 Marek Polacek <polacek@redhat.com>
1132 * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
1134 2016-03-31 Richard Biener <rguenther@suse.de>
1137 * typeck.c (cp_build_binary_op): Fix operand order of vector
1138 conditional in truth op handling.
1140 2016-03-29 Jason Merrill <jason@redhat.com>
1143 * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
1144 in constexpr functions.
1146 2016-03-28 Jason Merrill <jason@redhat.com>
1151 * decl.c, pt.c, constexpr.c: Revert last patch.
1153 2016-03-25 Jason Merrill <jason@redhat.com>
1154 Martin Liška <mliska@suse.cz>
1159 * decl.c (cp_fname_init): Decay the initializer to pointer.
1160 (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
1161 DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1162 Don't call cp_finish_decl.
1163 * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
1164 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. Don't call cp_finish_decl.
1165 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
1166 Handle DECL_VALUE_EXPR.
1168 2016-03-24 Jason Merrill <jason@redhat.com>
1171 * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
1174 * constexpr.c (cxx_eval_call_expression): Don't cache result if
1177 2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
1180 * tree.c (build_cplus_array_type): Determine type-dependentess
1181 with uses_template_parms instead of with dependent_type_p.
1183 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
1186 * typeck.c (process_init_constructor_union): If the initializer
1187 is empty, use the union's NSDMI if it has one.
1189 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
1192 * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
1193 NSDMI that's part of an aggregrate initialization.
1195 2016-03-23 Jakub Jelinek <jakub@redhat.com>
1198 * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
1199 for 1..max even for multi-dimensional arrays. Call unshare_expr
1203 * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
1204 on TREE_OVERFLOW constants.
1207 * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
1208 for OMP_TASKLOOP here.
1209 (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
1210 genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
1212 2016-03-23 Alexandre Oliva <aoliva@redhat.com>
1213 Jason Merrill <jason@redhat.com>
1214 Jakub Jelinek <jakub@redhat.com>
1217 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1218 * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
1219 (finish_function): Don't set or test them.
1220 * decl2.c (mark_used): Don't handle defer_mark_used_calls.
1222 2016-03-23 Jason Merrill <jason@redhat.com>
1225 * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
1227 2016-03-23 Marek Polacek <polacek@redhat.com>
1230 * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
1232 2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
1234 * call.c (build_conditional_expr_1): Always use original
1235 condition type for vector type checks and build.
1237 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
1240 * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
1242 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
1245 * constexpr.c (non_const_var_error): Check
1246 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1248 2016-03-21 Richard Henderson <rth@redhat.com>
1251 * decl.c (notice_forced_label_r): New.
1252 (cp_finish_decl): Use it.
1254 2016-03-21 Jason Merrill <jason@redhat.com>
1257 * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
1259 2016-03-18 Jason Merrill <jason@redhat.com>
1262 * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
1265 * class.c (vptr_via_virtual_p): New.
1266 (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
1267 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
1268 a vptr from any virtual base in a not-in-charge 'structor.
1270 * decl.c (build_clobber_this): Factor out of
1271 start_preparsed_function and begin_destructor_body. Handle
1272 virtual bases better.
1274 * class.c (build_if_in_charge): Split out from build_base_path.
1275 * init.c (expand_virtual_init, expand_default_init): Use it.
1276 * call.c (build_special_member_call): Use it.
1278 2016-03-18 Jakub Jelinek <jakub@redhat.com>
1281 * init.c (build_new_1): Complain and return error_mark_node
1282 if alloc_fn is not _Jv_AllocObject function returning pointer.
1284 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
1287 * search.c (adjust_result_of_qualified_name_lookup): Don't
1288 update the BASELINK_BINFO of DECL if the second call
1289 to lookup_base fails.
1291 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
1294 * parser.c (cp_parser_lambda_expression): Move call to
1295 pop_deferring_access_checks ahead of the call to
1296 cp_parser_end_tentative_firewall.
1298 2016-03-17 Jakub Jelinek <jakub@redhat.com>
1301 * cp-tree.h (magic_varargs_p): Return int instead of bool.
1302 * call.c (magic_varargs_p): Return int instead of bool, return 2 for
1303 Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
1305 (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
1306 if magic_varargs_p == 1, call decay_conversion
1307 instead of mark_type_use. Don't store error_mark_node arguments to
1308 argarray, instead return error_mark_node.
1311 * decl.c (begin_destructor_body): Don't insert clobber if
1312 is_empty_class (current_class_type).
1314 2016-03-17 Marek Polacek <polacek@redhat.com>
1317 * typeck.c (warn_for_null_address): New function.
1318 (cp_build_binary_op): Call it.
1320 2016-03-16 Jason Merrill <jason@redhat.com>
1323 * decl.c (start_preparsed_function): Don't clobber an empty base.
1325 2016-03-16 Jakub Jelinek <jakub@redhat.com>
1328 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
1329 BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
1332 * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
1333 set in_base_initializer.
1335 2016-03-15 Marek Polacek <polacek@redhat.com>
1338 * tree.c (strip_typedefs): Call strip_typedefs again on the
1339 DECL_ORIGINAL_TYPE result.
1341 2016-03-15 Jason Merrill <jason@redhat.com>
1344 * pt.c (instantiate_decl): Fix call to variable_template_p.
1347 * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
1349 2016-03-14 Casey Carter <casey@carter.net>
1350 Jason Merrill <jason@redhat.com>
1352 P0184R0: Generalizing the Range-Based For Loop
1353 * parser.c (cp_convert_range_for): Set the type of __end separately.
1354 (cp_parser_perform_range_for_lookup): Allow different begin/end
1355 types if they are comparable.
1357 2016-03-12 Patrick Palka <ppalka@gcc.gnu.org>
1360 * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
1361 processing_template_decl and EXPR is a SCOPE_REF.
1363 2016-03-10 Patrick Palka <ppalka@gcc.gnu.org>
1364 Jakub Jelinek <jakub@redhat.com>
1367 * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
1368 return value from cxx_eval_constant_expression from earlier
1369 elements if it is valid constant initializer requiring no
1372 2016-03-10 Marek Polacek <polacek@redhat.com>
1375 * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
1377 2016-03-09 Cesar Philippidis <cesar@codesourcery.com>
1379 * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
1380 when calling c_finish_omp_clauses.
1382 2016-03-08 Jason Merrill <jason@redhat.com>
1384 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
1385 diagnostic for use of "concept".
1386 (cp_parser_requires_clause_opt): And "requires".
1387 (cp_parser_type_parameter, cp_parser_late_return_type_opt)
1388 (cp_parser_explicit_template_declaration): Adjust.
1389 * Make-lang.in (check-c++-all): Add "concepts" to std list.
1391 P0036R0: Unary Folds and Empty Parameter Packs
1392 * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
1394 2016-03-08 Jakub Jelinek <jakub@redhat.com>
1397 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
1398 even after the last iteration of the loop.
1400 * decl.c (duplicate_decls): Fix spelling - becuase -> because.
1402 2016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
1405 * pt.c (get_template_info): Handle PARM_DECL.
1406 (template_class_depth): Check DECL_P instead of
1407 VAR_OR_FUNCTION_DECL_P.
1409 2016-03-05 Jason Merrill <jason@redhat.com>
1412 * constexpr.c (cxx_eval_store_expression): Replace
1413 CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
1415 2016-03-05 Patrick Palka <ppalka@gcc.gnu.org>
1418 * pt.c (template_class_depth): Given a lambda type, iterate
1419 into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
1420 TYPE_CONTEXT. Given a VAR_DECL, iterate into its
1423 2016-03-04 Jason Merrill <jason@redhat.com>
1426 * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
1427 * init.c (build_vec_delete_1): Set it.
1428 * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
1430 2016-03-04 Jakub Jelinek <jakub@redhat.com>
1432 * decl.c (start_preparsed_function): Don't emit start clobber at the
1433 start of constructor clones.
1436 * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
1437 * decl.c (start_preparsed_function): Call
1438 cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
1439 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
1440 cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
1442 2016-03-04 Jason Merrill <jason@redhat.com>
1445 * constexpr.c (cxx_eval_component_reference): Further tweak.
1447 * constexpr.c (struct constexpr_ctx): Add save_exprs field.
1448 (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
1449 (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
1450 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
1453 * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
1456 2016-03-03 Jason Merrill <jason@redhat.com>
1458 * method.c (synthesized_method_walk): operator= can also be constexpr.
1460 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
1461 LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
1464 * pt.c (copy_template_args): New.
1465 (tsubst_pack_expansion): Use it.
1467 * call.c (build_aggr_conv): Use get_nsdmi.
1470 * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
1473 * constexpr.c (cxx_eval_component_reference): Just return an empty
1474 CONSTRUCTOR for an empty class.
1476 2016-03-01 Jason Merrill <jason@redhat.com>
1479 * parser.c (cp_parser_requires_clause): Call
1480 check_for_bare_parameter_packs.
1483 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
1487 * constexpr.c (cxx_eval_call_expression): Unshare arg.
1488 (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
1489 [TARGET_EXPR]: Unshare init.
1491 2016-03-01 Patrick Palka <ppalka@gcc.gnu.org>
1495 * pt.c (tsubst_baselink): Reinstate the check for an invalid
1498 2016-02-28 Jason Merrill <jason@redhat.com>
1501 * constexpr.c (cxx_eval_store_expression): Unshare init.
1503 2016-02-26 Jason Merrill <jason@redhat.com>
1506 * pt.c (make_argument_pack): New.
1507 (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
1508 (tsubst_copy_and_build): Likewise.
1510 2016-02-25 Jason Merrill <jason@redhat.com>
1513 * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
1514 * tree.c (build_aggr_init_expr): Set it.
1515 * semantics.c (simplify_aggr_init_expr): Check it.
1516 * cp-gimplify.c (cp_genericize_r): Don't walk into
1517 a call/aggr_init from a thunk.
1520 * method.c (forward_parm): Handle parameter packs.
1521 * lambda.c (maybe_add_lambda_conv_op): Use it for them.
1524 * constexpr.c (cxx_eval_component_reference): Don't complain about
1525 unevaluated empty classes.
1528 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
1530 2016-02-25 Patrick Palka <ppalka@gcc.gnu.org>
1533 * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
1534 (maybe_undo_parenthesized_ref): Declare.
1535 * semantics.c (maybe_undo_parenthesized_ref): Split out from
1537 (finish_call_expr): Use it.
1538 * typeck.c (check_return_expr): Use it.
1539 * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
1540 REF_PARENTHESIZED_P flag.
1542 2016-02-24 Jakub Jelinek <jakub@redhat.com>
1545 * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
1547 * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
1549 * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
1550 unless they are folded into INTEGER_CST, error_mark_node or some
1551 comparison with NULL, avoid folding them and use either the original
1552 comparison or non-folded comparison of folded arguments.
1553 * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
1554 comparison, don't fold the comparison right away.
1556 2016-02-24 Jason Merrill <jason@redhat.com>
1559 * friend.c (make_friend_class): Likewise.
1560 * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
1562 2016-02-24 Jason Merrill <jason@redhat.com>
1565 * pt.c (instantiate_class_template_1): Set
1566 processing_template_decl before substituting friend_type.
1568 016-02-24 Martin Sebor <msebor@redhat.com>
1571 * tree.c (build_ctor_subob_ref): Compare types' main variants
1572 instead of the types as they are.
1574 2016-02-24 Jason Merrill <jason@redhat.com>
1576 * decl.c (start_preparsed_function): Condition ctor clobber on
1577 flag_lifetime_dse > 1.
1579 * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
1581 2016-02-19 Jason Merrill <jason@redhat.com>
1584 * call.c (remaining_arguments): No longer static.
1585 * cp-tree.h: Declare it.
1586 * pt.c (more_specialized_fn): Use it.
1588 2016-02-19 Jakub Jelinek <jakub@redhat.com>
1589 Bernd Edlinger <bernd.edlinger@hotmail.de>
1591 * Make-lang.in: Invoke gperf with -L C++.
1592 * cfns.gperf: Remove prototypes for hash and libc_name_p
1594 * cfns.h: Regenerated.
1595 * except.c (nothrow_libfn_p): Adjust.
1597 2016-02-19 Jakub Jelinek <jakub@redhat.com>
1600 * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
1601 NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
1603 2016-02-19 Patrick Palka <ppalka@gcc.gnu.org>
1606 * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
1608 * semantics.c (finish_call_expr): Don't assume a constructor
1609 call is dependent if only the "this" pointer is dependent. When
1610 building a constructor call, always use a dummy object.
1612 2016-02-19 Jakub Jelinek <jakub@redhat.com>
1615 * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
1617 * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
1618 operators if folding preserved the binop, just with different
1622 * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
1623 attr_spec is always single element chain, chain all the attributes
1624 properly together in the right order.
1626 2016-02-18 Jason Merrill <jason@redhat.com>
1628 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
1630 (mangle_decl): Call maybe_check_abi_tags for function scope.
1631 (mangle_guard_variable): Call maybe_check_abi_tags here.
1632 (write_guarded_var_name): Not here.
1634 2016-02-17 Jason Merrill <jason@redhat.com>
1637 * constexpr.c (build_constexpr_constructor_member_initializers):
1638 Handle an additional STATEMENT_LIST.
1641 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
1644 * decl2.c (reset_type_linkage_2): Look through member templates.
1646 2016-02-17 Jakub Jelinek <jakub@redhat.com>
1649 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
1651 2016-02-17 Jason Merrill <jason@redhat.com>
1654 * method.c (forward_parm): Split out from...
1655 (add_one_base_init): ...here.
1656 * lambda.c (maybe_add_lambda_conv_op): Use it.
1658 2016-02-16 Jason Merrill <jason@redhat.com>
1662 * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
1663 tree.c, typeck2.c: Revert earlier changes.
1664 * parser.c (cp_parser_lookup_name): Ignore namespace-scope
1665 non-type templates after -> or .
1667 2016-02-16 Jakub Jelinek <jakub@redhat.com>
1670 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
1672 2016-02-16 Jason Merrill <jason@redhat.com>
1675 * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
1676 (set_decl_namespace): Pass it. Complain about finding a hidden friend.
1677 * name-lookup.h: Adjust.
1679 2016-02-16 James Norris <jnorris@codesourcery.com>
1681 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
1682 * semantics.c (finish_omp_clauses): Add deviceptr checking.
1684 2016-02-15 Jakub Jelinek <jakub@redhat.com>
1687 * init.c (expand_default_init): Only call reshape_init
1688 in the direct-initialization from an initializer list case.
1690 2016-02-15 Jason Merrill <jason@redhat.com>
1693 * semantics.c (finish_call_expr): Implicit 'this' does not make
1695 * search.c (any_dependent_bases_p): Split out...
1696 * name-lookup.c (do_class_using_decl): ...from here.
1697 * call.c (build_new_method_call_1): Don't complain about missing object
1698 if there are dependent bases. Tweak error.
1699 * tree.c (non_static_member_function_p): Remove.
1700 * pt.c (type_dependent_expression_p): A member template of a
1701 dependent type is dependent.
1702 * cp-tree.h: Adjust.
1705 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1707 2016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
1710 * pt.c (lookup_and_finish_template_variable): New function,
1712 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
1713 (tsubst_qualified_id): Consider that EXPR might be a variable
1715 * typeck.c (check_template_keyword): Don't emit an error
1716 if DECL is a variable template.
1718 2016-02-12 Jakub Jelinek <jakub@redhat.com>
1720 * error.c: Spelling fixes - behaviour -> behavior and
1721 neighbour -> neighbor.
1723 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1725 * init.c (build_delete): Likewise.
1727 2016-02-11 Jakub Jelinek <jakub@redhat.com>
1730 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1731 arguments for -Waddress warning. Fix up formatting.
1733 2016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
1736 * pt.c (lookup_template_class_1): Check tsubst return value for
1739 2016-02-10 Jason Merrill <jason@redhat.com>
1742 * pt.c (resolve_nondeduced_context): Add complain parm.
1743 (do_auto_deduction): Pass it.
1744 * cvt.c (convert_to_void): Likewise.
1745 * decl.c (cp_finish_decl): Likewise.
1746 * init.c (build_new): Likewise.
1747 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1748 * semantics.c (finish_decltype_type): Likewise.
1749 * typeck.c (decay_conversion): Likewise.
1750 * cp-tree.h: Adjust declaration.
1751 * call.c (standard_conversion): Add complain parm, pass it along.
1752 (implicit_conversion): Pass it.
1755 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1756 (lookup_name_real_1): Likewise.
1757 (remove_hidden_names): Handle non-functions too.
1760 * parser.c (cp_parser_lookup_name): When looking for a template
1761 after . or ->, only consider class templates.
1762 (cp_parser_postfix_dot_deref_expression): Handle the current
1763 instantiation. Remember a dependent object expression.
1764 * typeck2.c (build_x_arrow): Handle the current instantiation.
1766 * ptree.c (debug_tree): Implement for cp_expr.
1768 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
1771 * parser.c (cp_parser_simple_type_specifier): Make the check
1772 for disambiguating between an 'auto' placeholder and an implicit
1773 template parameter more robust.
1775 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
1779 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1780 setting its TREE_USED flag.
1782 2016-02-08 Jason Merrill <jason@redhat.com>
1785 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1788 2016-02-08 Jakub Jelinek <jakub@redhat.com>
1791 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1792 of the DECL_OMP_DECLARE_REDUCTION_P decls.
1794 2016-02-08 Marek Polacek <polacek@redhat.com>
1797 * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1798 Call clear_fold_cache.
1799 * cp-tree.h: Adjust declaration.
1800 * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1801 rather than clear_cv_cache and clear_fold_cache.
1802 * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1804 2016-02-08 Jason Merrill <jason@redhat.com>
1806 * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1807 * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1808 (ocp_convert): Use *_maybe_fold.
1809 (cp_convert_to_pointer): Add dofold parameter.
1810 * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1812 2016-02-05 Martin Sebor <msebor@redhat.com>
1815 * init.c (find_field_init): New function.
1816 (warn_placement_new_too_small): Call it. Handle one-element arrays
1817 at ends of structures special.
1819 2016-02-05 Jason Merrill <jason@redhat.com>
1822 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1823 make sure we've seen_error().
1825 2016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
1828 * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1829 if lookup_fnfields returns NULL_TREE and the name being looked
1830 up has the form A::A.
1832 2016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
1834 * constexpr.c (cxx_eval_binary_expression): Fold equality
1835 comparisons involving PTRMEM_CSTs.
1837 2016-02-04 Jakub Jelinek <jakub@redhat.com>
1839 * class.c (find_flexarrays): Don't declare dom variable.
1840 (diagnose_flexarray): Likewise.
1842 2016-02-02 Martain Sebor <msebor@redhat.com>
1849 * class.c (walk_subobject_offsets): Avoid testing the upper bound
1850 of a flexible array member for equality to null.
1851 (find_flexarrays): Remove spurious whitespace introduced in r231665.
1852 (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1853 (check_flexarrays): Same.
1854 * decl.c (compute_array_index_type): Avoid special case for flexible
1856 (grokdeclarator): Avoid calling compute_array_index_type for flexible
1858 * error.c (dump_type_suffix): Revert changes introduced in r231665
1859 and rendered unnecessary by the changes above.
1860 * pt.c (tsubst): Same.
1861 * tree.c (build_ctor_subob_ref): Handle flexible array members.
1862 * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1863 (process_init_constructor_array): Same.
1864 (process_init_constructor_record): Same.
1866 2016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
1869 * pt.c (try_one_overload): Handle comparing argument packs so
1870 that there is no conflict if we deduced more arguments of an
1871 argument pack than were explicitly specified.
1873 2016-01-31 Jakub Jelinek <jakub@redhat.com>
1874 Jason Merrill <jason@redhat.com>
1877 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1878 function type if nothing is changing.
1880 2016-01-31 Jason Merrill <jason@redhat.com>
1883 * pt.c (partial_specialization_p, impartial_args): New.
1884 (instantiate_decl): Call impartial_args.
1886 * mangle.c (maybe_check_abi_tags): New.
1887 (write_guarded_var_name): Call it.
1888 (mangle_ref_init_variable): Call check_abi_tags.
1890 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1891 between template and instantiation.
1893 2016-01-29 Jakub Jelinek <jakub@redhat.com>
1896 * decl.c (wrapup_globals_for_namespace): Warn about unused static
1897 function declarations.
1899 2016-01-29 Marek Polacek <polacek@redhat.com>
1903 * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1904 out of bound" error earlier.
1905 * init.c (build_vec_init): Change NE_EXPR into GT_EXPR. Update the
1908 2016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
1910 * name-lookup.c (begin_scope): After reusing a cp_binding_level
1911 structure, update free_binding_level before the structure's
1912 level_chain field gets cleared, not after.
1914 2016-01-28 Jason Merrill <jason@redhat.com>
1917 * search.c (dfs_walk_once, dfs_walk_once_r)
1918 (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1919 hash_set instead of BINFO_MARKED.
1920 (dfs_unmark_r): Remove.
1922 2016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
1925 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1926 (cp_lexer_debugging_p): Use it.
1927 (cp_lexer_start_debugging): Likewise.
1928 (cp_lexer_stop_debugging): Likewise.
1930 2016-01-27 Marek Polacek <polacek@redhat.com>
1933 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1934 needed. Add -Wsign-compare warning.
1936 2016-01-27 Ryan Burn <contact@rnburn.com>
1939 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1940 superfluous post_p argument in call to
1941 cilk_gimplify_call_params_in_spawned_fn.
1943 2016-01-27 Marek Polacek <polacek@redhat.com>
1946 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1947 wrapped in NOP_EXPRs.
1949 2016-01-27 Martin Sebor <msebor@redhat.com>
1952 * mangle.c (mangle_decl): Reference the correct (saved) version
1953 of the ABI in -Wabi diagnostics.
1955 2016-01-27 Marek Polacek <polacek@redhat.com>
1958 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1959 elements of the array.
1961 2016-01-26 Jason Merrill <jason@redhat.com>
1964 * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1965 (cxx_eval_call_expression): Don't look through clones.
1966 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1967 * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1968 maybe-in-charge *tor.
1970 2016-01-26 Jason Merrill <jason@redhat.com>
1973 * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1974 and TREE_SIDE_EFFECTS.
1975 (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1976 verify_constructor_flags.
1978 2016-01-26 Jakub Jelinek <jakub@redhat.com>
1981 * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1982 return error_mark_node instead of building trees with error_mark_node
1985 2016-01-26 David Malcolm <dmalcolm@redhat.com>
1988 * error.c (print_instantiation_partial_context_line): Add missing
1989 newlines from output for the t == NULL case.
1990 (print_instantiation_partial_context): Remove call to pp_newline.
1992 2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
1995 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
2000 * decl.c (grokdeclarator): Don't decay array parameter type to
2001 a pointer type if it's dependent.
2002 (grokparms): Invoke strip_top_quals instead of directly invoking
2003 cp_build_qualified_type.
2004 * pt.c (decay_dependent_array_parm_type): New static function.
2005 (type_unification_real): Call decay_dependent_array_parm_type
2006 to decay a dependent array parameter type to its corresponding
2007 pointer type before unification.
2008 (more_specialized_fn): Likewise.
2009 (get_bindings): Likewise.
2010 * tree.c (cp_build_qualified_type): Trivial typofix in
2013 2016-01-23 Martin Sebor <msebor@redhat.com>
2017 * decl2.c (is_late_template_attribute): Handle dependent argument
2018 to attribute align and attribute vector_size.
2020 2016-01-21 Jason Merrill <jason@redhat.com>
2023 * lambda.c (lambda_capture_field_type): Handle 'this' specially
2024 for init-capture, too.
2027 * decl.c (type_is_deprecated): Don't look into a typedef.
2031 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
2034 * decl.c (start_enum): Add attributes parameter.
2035 * parser.c (cp_parser_enum_specifier): Pass it.
2036 * pt.c (lookup_template_class_1): Pass it.
2037 * cp-tree.h: Adjust.
2039 2016-01-19 Jason Merrill <jason@redhat.com>
2042 * pt.c (convert_template_argument): Handle VAR_DECL properly.
2044 2016-01-19 Marek Polacek <polacek@redhat.com>
2047 * constexpr.c (clear_cv_cache): New.
2048 * cp-gimplify.c (clear_fold_cache): New.
2049 * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
2050 * decl.c (finish_enum_value_list): Call them.
2053 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
2055 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
2060 * decl.c (grokdeclarator): Don't decay array parameter type to
2061 a pointer type if it's dependent.
2062 (grokparms): Invoke strip_top_quals instead of directly invoking
2063 cp_build_qualified_type.
2064 * pt.c (decay_dependent_array_parm_type): New static function.
2065 (type_unification_real): Call decay_dependent_array_parm_type
2066 to decay a dependent array parameter type to its corresponding
2067 pointer type before unification.
2068 (more_specialized_fn): Likewise.
2069 (get_bindings): Likewise.
2070 * tree.c (cp_build_qualified_type): Trivial typofix in
2073 2016-01-18 Jason Merrill <jason@redhat.com>
2075 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
2077 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
2080 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
2081 (contains_label_1, contains_label_p): Remove.
2083 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
2086 * pt.c (type_dependent_expression_p): For a function template
2087 specialization, a type is dependent iff any of its template
2090 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
2092 * cp-array-notation.c (cp_expand_cond_array_notations): Return
2093 error_mark_node only if find_rank failed, not if it was
2096 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
2099 * tree.c (build_min_non_dep_call_vec): Don't retain the
2100 KOENIG_LOOKUP_P flag of the non-dependent expression that's
2102 (build_min_non_dep_op_overload): Instead, do it here.
2104 2016-01-15 Jakub Jelinek <jakub@redhat.com>
2107 * parser.h (cp_token): Remove pragma_kind field. Add comment
2108 with number of unused bits.
2109 * parser.c (eof_token): Remove pragma_kind field initializer.
2110 (cp_lexer_get_preprocessor_token): Don't set pragma_kind
2111 field, don't clear CPP_PRAGMA u.value.
2112 (cp_parser_pragma_kind): New function.
2113 (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
2114 cp_parser_omp_construct, cp_parser_initial_pragma,
2115 cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
2118 2016-01-15 Jason Merrill <jason@redhat.com>
2121 * call.c (build_cxx_call): Use fold_non_dependent_expr.
2123 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
2127 * typeck.c (decay_conversion): Don't call mark_rvalue_use for
2128 array/function-to-pointer conversion. Call
2129 complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
2130 * call.c (convert_like_real): Print call context if
2131 decay_conversion errors.
2133 2016-01-14 Tom de Vries <tom@codesourcery.com>
2135 PR tree-optimization/68773
2136 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
2139 2016-01-14 Jason Merrill <jason@redhat.com>
2142 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
2144 2016-01-12 Marek Polacek <polacek@redhat.com>
2147 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
2148 error_at and adjust the return value.
2150 2016-01-12 Jakub Jelinek <jakub@redhat.com>
2154 * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
2155 GS_ERROR whenever seen_error (), only if *expr_p contains
2156 cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
2160 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
2162 2016-01-11 Jason Merrill <jason@redhat.com>
2165 * method.c (walk_field_subobs): Add dtor_from_ctor parm.
2166 (process_subob_fn): Likewise. Don't consider triviality if true.
2167 (synthesize_method_walk): Pass it.
2169 2016-01-11 David Malcolm <dmalcolm@redhat.com>
2172 * parser.c (cp_parser_postfix_expression): Initialize
2173 close_paren_loc to UNKNOWN_LOCATION; only use it if
2174 it has been written to by
2175 cp_parser_parenthesized_expression_list.
2176 (cp_parser_parenthesized_expression_list): Document the behavior
2177 with respect to the CLOSE_PAREN_LOC param.
2179 2016-01-11 Jakub Jelinek <jakub@redhat.com>
2182 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
2183 folded operands have side-effects, but folding changed any of them,
2184 build a new tree with the folded operands instead of returning the
2187 2016-01-09 Marek Polacek <polacek@redhat.com>
2190 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
2192 2016-01-09 Jakub Jelinek <jakub@redhat.com>
2195 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
2197 2016-01-08 Jason Merrill <jason@redhat.com>
2200 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
2203 2016-01-08 Marek Polacek <polacek@redhat.com>
2206 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
2208 2016-01-08 Jason Merrill <jason@redhat.com>
2210 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
2215 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
2216 TREE_ADDRESSABLE type.
2220 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2222 2016-01-05 Nathan Sidwell <nathan@acm.org>
2225 * pt.c (build_non_dependent_expr): Don't try a checking fold when
2228 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2230 Update copyright years.
2232 Copyright (C) 2016 Free Software Foundation, Inc.
2234 Copying and distribution of this file, with or without modification,
2235 are permitted in any medium without royalty provided the copyright
2236 notice and this notice are preserved.