[PR c++/84593] ice on braced init with uninit ref field
[gcc.git] / gcc / cp / ChangeLog
index 1da0a4d4a53d2d74ad417bb86175551091ab912d..3623405ded0cbc350637418d2e6b49a4f55d4896 100644 (file)
@@ -1,3 +1,434 @@
+2018-03-06  Alexandre Oliva <aoliva@redhat.com>
+
+       PR c++/84593
+       * init.c (build_zero_init_1): Zero-initialize references.
+
+       PR c++/84492
+       * semantics.c (finish_stmt_expr_expr): Reject unresolved
+       overloads used as stmt expr values.
+
+2018-03-05  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84708 - ICE with lambda in local class NSDMI.
+       * lambda.c (lambda_expr_this_capture): Handle local class NSDMI
+       context.
+
+2018-03-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84684
+       * constexpr.c (constexpr_call_hasher::equal): Return false if
+       lhs->hash != rhs->hash.  Change return 1 to return true and
+       return 0 to return false.
+
+2018-03-05  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/84702
+       * pt.c (process_template_arg): Mark lookup_keep on a default arg.
+
+2018-03-05  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84707
+       * decl.c (duplicate_decls): Check DECL_NAME before accessing
+       UDLIT_OPER_P.
+
+2018-03-05  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/84694
+       * friend.c (do_friend): Restore check for identifier_p inside
+       TEMPLATE_ID_EXPR.
+
+2018-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84618
+       * parser.c (cp_parser_lambda_introducer): Reject any capture not
+       involving a VAR_DECL or a PARM_DECL.
+
+2018-03-05  Pádraig Brady  <P@draigBrady.com>
+           Jason  Merrill  <jason@redhat.com>
+           Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/84497
+       * decl2.c (get_tls_init_fn): Check TYPE_HAS_TRIVIAL_DFLT too.
+
+2018-03-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84686 - missing volatile loads.
+       * cvt.c (convert_to_void): Call maybe_undo_parenthesized_ref.
+
+2018-03-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/71464
+       * optimize.c (maybe_thunk_body): Bail out immediately if either
+       fns[0] or fns[1] is null.
+
+2018-03-02  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84578
+       * constexpr.c (get_array_or_vector_nelts): New.
+       (cxx_eval_array_reference): Use it.
+       (cxx_eval_vec_init_1): Likewise.
+       (cxx_eval_store_expression): Likewise.
+
+2018-03-02  Jason Merrill  <jason@redhat.com>
+
+       * semantics.c (force_paren_expr): Remove redundant test.
+
+2018-03-02  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84663
+       * decl.c (cp_complete_array_type): Check error_mark_node.
+
+       PR c++/84664
+       * typeck.c (cp_perform_integral_promotions): Check the result of
+       mark_rvalue_use.
+
+2018-03-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84662
+       * pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Use
+       RETURN instead of return.
+       <case POINTER_PLUS_EXPR>: Likewise.
+       <case CONVERT_EXPR>: If op0 is error_mark_node, just return
+       it instead of wrapping it into CONVERT_EXPR.
+
+2018-03-02  Jason Merrill  <jason@redhat.com>
+
+       Fix MIPS16 ICE.
+       * pt.c (type_dependent_expression_p): Check DECL_LANG_SPECIFIC.
+
+2018-03-02  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84590
+       * cp-gimplify.c (cp_fully_fold): Unwrap TARGET_EXPR or a CONSTRUCTOR
+       wrapped in VIEW_CONVERT_EXPR.
+
+2018-03-01  Martin Sebor  <msebor@redhat.com>
+
+       PR c++/84294
+       * decl.c (check_redeclaration_no_default_args): Merge attributes
+       specified on redeclarations of the same function template.
+       Remove dead code.
+
+2018-03-01  Marek Polacek  <polacek@redhat.com>
+           Jason Merrill  <jason@redhat.com>
+
+       PR c++/84582
+       * semantics.c (force_paren_expr): Create a PAREN_EXPR when in
+       a template.
+       (maybe_undo_parenthesized_ref): Unwrap PAREN_EXPR.
+       * typeck2.c (store_init_value): Call fold_non_dependent_expr instead
+       of instantiate_non_dependent_expr.
+       * tree.c (lvalue_kind): Handle PAREN_EXPR like NON_DEPENDENT_EXPR.
+
+2018-03-01  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/84434
+       * name-lookup.c (member_vec_dedup): Remove manually peeled
+       iteration.  Ignore dependent ctor inheritance.
+
+2018-03-01  Jason Merrill  <jason@redhat.com>
+
+       PR c++/71569 - decltype of template.
+       * parser.c (cp_parser_decltype_expr): Handle missing template args.
+
+2018-03-01  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84596
+       * constexpr.c (require_rvalue_constant_expression): New function.
+       * cp-tree.h: Declare it.
+       * semantics.c (finish_static_assert): Use it instead of
+       require_potential_rvalue_constant_expression.
+
+2018-03-01  Jason Merrill  <jason@redhat.com>
+           Alexandre Oliva <aoliva@redhat.com>
+
+       PR c++/71569 - ICE with redundant args on member variable template.
+       * decl.c (start_decl): Handle partial specialization of member
+       variable template.
+       * pt.c (determine_specialization): Allow partial specialization
+       of member variable template without specializing enclosing class.
+       (process_partial_specialization): Improve error message.
+
+2018-02-28  Jason Merrill  <jason@redhat.com>
+
+       PR c++/71784 - ICE with ref-qualifier and explicit specialization.
+       * pt.c (determine_specialization): Check ref-qualifier.
+
+2018-02-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84609
+       * parser.c (cp_parser_attributes_opt): Formatting fix.
+       (cp_parser_skip_balanced_tokens, cp_parser_skip_gnu_attributes_opt,
+       cp_parser_skip_std_attribute_spec_seq, cp_parser_skip_attributes_opt):
+       New functions.
+       (cp_parser_member_declaration): Use cp_parser_skip_attributes_opt
+       instead of tentative parse to peek over optional attribute tokens
+       to check for CPP_COLON after them.
+
+       PR c++/83871
+       PR c++/83503
+       * pt.c (INCLUDE_STRING): Remove define.
+       (warn_spec_missing_attributes): Use pretty_printer instead of
+       std::string.  Fix up inform call so that the list of attributes
+       is in %s argument.
+
+2018-02-28  Martin Sebor  <msebor@redhat.com>
+
+       PR testsuite/84617
+       * decl.c (duplicate_decls): Fully merge attributes const, pure,
+       and malloc.
+
+2018-02-28  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/84602
+       * name-lookup.h (search_anon_aggr): Add defaulted WANT_TYPE arg.
+       * name-lookup.c (fields_linear_search): Look in an anon-aggr
+       regardless of want_type.
+       (search_anon_aggr): Just use get_class_binding_direct.
+
+2018-02-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * decl.c (cp_finish_decomp): Don't adjust eltscnt when calling
+       inform_n.
+
+2018-02-27  Martin Sebor  <msebor@redhat.com>
+
+       * pt.c: Avoid including <string> directly.
+
+2018-02-27  Martin Sebor  <msebor@redhat.com>
+
+       PR c++/83871
+       PR c++/83503
+       * cp-tree.h (warn_spec_missing_attributes): New function.
+       ((check_explicit_specialization): Add an argument.  Call the above
+       function.
+       * decl.c (duplicate_decls): Avoid applying primary function template's
+       attributes to its explicit specializations.
+       cp/pt.c (warn_spec_missing_attributes): Define.
+
+2018-02-27  Håkon Sandsmark  <hsandsmark@gmail.com>
+
+       PR c++/71546 - lambda init-capture with qualified-id.
+       * parser.c (cp_parser_lambda_introducer): Clear scope after
+       each lambda capture.
+
+2018-02-27  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/84426
+       * name-lookup.h (get_member_slot): Rename ...
+       (find_member_slot): ... here.
+       (add_member_slot): New.
+       * name-lookup.c (member_vec_linear_search): No need to check for
+       NULL slot.
+       (get_member_slot): Rename ...
+       (find_member_slot): ... here.  Don't add slot for incomplete class.
+       (add_member_slot): New.
+       * class.c (add_method): Adjust get_member_slot rename.  Bail out
+       if push_class_level_binding fails.  Create slot and grok
+       properties once we're committed to insertion.
+
+2018-02-27  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84489 - dependent default template argument
+       * pt.c (type_unification_real): Handle early substitution failure.
+
+2018-02-26  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84560 - ICE capturing multi-dimensional VLA.
+       * tree.c (array_of_runtime_bound_p): False if the element is
+       variably-modified.
+
+       PR c++/84441 - ICE with base initialized from ?:
+       * call.c (unsafe_copy_elision_p): Handle COND_EXPR.
+
+       PR c++/84520 - ICE with generic lambda in NSDMI.
+       * lambda.c (lambda_expr_this_capture): Don't look for fake NSDMI
+       'this' in a generic lambda instantiation.
+
+       PR c++/84559 - ICE with constexpr VLA.
+       * constexpr.c (ensure_literal_type_for_constexpr_object): Check
+       for constexpr variable with VLA type.
+
+2018-02-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84558
+       * constexpr.c (cxx_eval_vec_init_1): For reuse, treat NULL eltinit like
+       a valid constant initializer.  Formatting fixes.
+
+2018-02-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84540
+       * pt.c (tsubst_attributes): Handle correctly tsubst_attribute
+       returning NULL_TREE.
+       (apply_late_template_attributes): Likewise.
+
+2018-02-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84557
+       * parser.c (cp_parser_omp_var_list_no_open): Only call
+       cp_parser_lookup_name_simple on names satisfying identifier_p.
+       (cp_parser_oacc_routine): Likewise.
+
+2018-02-26  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84551 - ICE with concepts and -g.
+       * parser.c (add_debug_begin_stmt): Do nothing in a concept.
+
+2018-02-26  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84325
+       * tree.c (replace_placeholders_r): Only check TREE_CONSTANT on
+       non-types.
+
+2018-02-26  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84447 - ICE with deleted inherited ctor with default arg.
+       * call.c (build_over_call): Handle deleted functions in one place.
+
+2018-02-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84533
+       * decl.c (redeclaration_error_message): Don't try to use
+       DECL_DECLARED_CONSTEXPR_P on CONST_DECLs.
+
+2018-02-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * lambda.c (build_capture_proxy): Define static.
+       * cp-tree.h (build_capture_proxy): Remove.
+
+2018-02-26  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84537
+       * name-lookup.c (suggest_alternative_in_explicit_scope): Return false
+       if name is error node.
+
+2018-02-25  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84015 - ICE with class deduction and auto template parm.
+       * pt.c (rewrite_template_parm): Use tf_partial in first tsubst.
+
+2018-02-24  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/83692
+       * constexpr.c (maybe_constant_init_1): New function.
+       (maybe_constant_init): Make it a wrapper around maybe_constant_init_1.
+       (cxx_constant_init): New function.
+       * cp-tree.h (cxx_constant_init): Declare.
+       * typeck2.c (store_init_value): Call cxx_constant_init instead of
+       cxx_constant_value.  Move the maybe_constant_init call under an 'else'.
+
+2018-02-22  Jason Merrill  <jason@redhat.com>
+
+       PR c++/70468 - ICE with constructor delegation via typedef.
+       * pt.c (tsubst_initializer_list): Check for other mem-initializers
+       with constructor delegation.
+
+2018-02-22  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84424 - ICE with constexpr and __builtin_shuffle.
+       * constexpr.c (reduced_constant_expression_p): Handle CONSTRUCTOR of
+       VECTOR_TYPE.
+
+2018-02-22  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84493
+       * parser.c (cp_parser_braced_list): Use require_open instead of
+       consume_open.
+
+2018-02-21  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84454 - ICE with pack expansion in signature.
+       * error.c (find_typenames_r): Also stop on EXPR_PACK_EXPANSION.
+
+2018-02-20  Siddhesh Poyarekar  <siddhesh@sourceware.org>
+
+       * cp-objcp-common.c (cxx_block_may_fallthru): Add case for
+       IF_STMT.
+
+2018-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84446
+       * parser.c (cp_parser_init_declarator): Don't call start_lambda_scope
+       on error_mark_node.
+
+2018-02-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84445
+       * class.c (fixed_type_or_null) <case CALL_EXPR>: Only test
+       TREE_HAS_CONSTRUCTOR if instance is not an internal function call.
+
+       PR c++/84449
+       * tree.c (bot_manip): If build_cplus_new or break_out_target_exprs
+       returns error_mark_node, return it immediately.
+       (break_out_target_exprs): If cp_walk_tree with bot_manip returns
+       error_mark_node, return error_mark_node.
+
+       PR c++/84455
+       * pt.c (tsubst_lambda_expr): If not nested, increment temporarily
+       function_depth to avoid GC during finish_lambda_function.
+
+2018-02-19  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84429 - ICE capturing VLA.
+       * lambda.c (build_capture_proxy): Handle reference refs.
+
+2018-02-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84448
+       * parser.c (cp_parser_binary_expression): For no_toplevel_fold_p, if
+       either operand is error_mark_node, set current.lhs to that instead of
+       creating a binary op with error_mark_node operands.
+
+       PR c++/84430
+       * constexpr.c (potential_constant_expression_1): Handle OMP_SIMD.
+
+2018-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84348
+       * decl.c (grokdeclarator): Early return error_mark_node upon
+       ill-formed friend declaration.
+
+2018-02-16  Marek Polacek  <polacek@redhat.com>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84192
+       * constexpr.c (cxx_eval_constant_expression) <case RETURN_EXPR>: Don't
+       set *jump_target to anything if jump_target is NULL.
+
+2018-02-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84151 - unnecessary volatile load with static member.
+       * call.c (build_new_method_call_1): Avoid loading from a volatile
+       lvalue used as the object argument for a static member function.
+
+       PR c++/81853 - using-directive and constexpr.
+       * constexpr.c (cxx_eval_constant_expression): Handle USING_STMT.
+
+       PR c++/84420 - ICE with structured binding in lambda.
+       * lambda.c (is_capture_proxy): Check DECL_DECOMPOSITION_P.
+
+       PR c++/83835 - C++17 error with constructor ctors.
+       * call.c (build_special_member_call): Set TARGET_EXPR_DIRECT_INIT_P.
+
+       PR c++/82664 - ICE with reference to function template parm.
+       * pt.c (convert_nontype_argument_function): Avoid obfuscationg
+       NOP_EXPRs.
+
+       PR c++/82764 - C++17 ICE with empty base
+       * class.c (build_base_field_1): Set DECL_SIZE to zero for empty base.
+
+2018-02-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84421 - type-dependent if constexpr
+       * semantics.c (finish_if_stmt_cond): Check type_dependent_expression_p.
+
+2018-02-16  Nathan Sidwell  <nathan@acm.org>
+
+       Deprecate -ffriend-injection.
+       * decl.c (cxx_init_decl_processing): Emit warning on option.
+       * name-lookup.c (do_pushdecl): Emit warning if we push a visible
+       friend.
+
 2018-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/82468