]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/ChangeLog
/cp
[thirdparty/gcc.git] / gcc / cp / ChangeLog
index 34e9c79ef2a667d726e06ff3e8f360d465a3e78f..ab25cb94d3d6dcc84256627c15f6362d8444cf1b 100644 (file)
@@ -1,3 +1,422 @@
+2019-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/90173
+       * decl.c (grokdeclarator): Set type to error_mark_node
+       upon error about template placeholder type non followed
+       by a simple declarator-id.
+
+2019-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
+       min_location.
+
+2019-04-24  Jason Merrill  <jason@redhat.com>
+
+       PR c++/90227 - error with template parameter packs.
+       * pt.c (coerce_template_parms): Do add empty pack when
+       require_all_args.
+
+2019-04-24  Richard Biener  <rguenther@suse.de>
+
+       * call.c (null_ptr_cst_p): Order checks according to expensiveness.
+       (conversion_null_warnings): Likewise.
+       * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
+       early if type1 == type2.
+
+2019-04-22  Jason Merrill  <jason@redhat.com>
+
+       PR c++/87366 - wrong error with alias template.
+       * typeck.c (structural_comptypes): When comparing_specializations,
+       aliases are unequal.
+       (comptypes): When comparing_specializations, do structural
+       comparison.
+
+2019-04-19  Jason Merrill  <jason@redhat.com>
+
+       PR c++/90190 - CTAD with list-constructor.
+       * pt.c (do_class_deduction): Don't try the single element deduction
+       if the single element is also a braced list.
+
+       PR c++/90171 - ICE with destroying delete with size_t parm.
+       * call.c (sized_deallocation_fn_p): New.  Use it instead of
+       second_parm_is_size_t in most cases.
+       (second_parm_is_size_t): Don't check for aligned.
+
+2019-04-19  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/89900
+       * pt.c (fn_type_unification): When handling null explicit
+       arguments do not special case non-parameter packs.
+
+2019-04-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/90138
+       * pt.c (process_template_parm): Set decl to pushdecl result.  If
+       !is_non_type, also set parm to that.
+
+       PR c/89888
+       * decl.c (struct cp_switch): Remove outside_range_p member.
+       (push_switch): Don't clear it.
+       (pop_switch): Adjust c_do_switch_warnings caller.
+       (finish_case_label): Adjust c_add_case_label caller.
+
+       PR c++/90108
+       * decl.c (duplicate_decls): If remove is main variant and
+       DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
+       variant that has newdecl as TYPE_NAME if any.
+
+2019-04-18  Jason Merrill  <jason@redhat.com>
+
+       PR c++/87554 - ICE with extern template and reference member.
+       * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
+
+2019-04-17  Jason Merrill  <jason@redhat.com>
+
+       PR c++/90047 - ICE with enable_if alias template.
+       * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
+       hash table when we're in SFINAE context.
+
+2019-04-17  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/90124 - bogus error with incomplete type in decltype.
+       * typeck.c (build_class_member_access_expr): Check
+       cp_unevaluated_operand.
+
+2019-04-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/89933
+       * decl.c (duplicate_decls): When newdecl's type is its main variant,
+       don't try to remove it from the variant list, but instead assert
+       it has no variants.
+
+2019-04-12  Martin Sebor  <msebor@redhat.com>
+
+       PR c/88383
+       PR c/89288
+       * parser.c (cp_parser_has_attribute_expression): Handle assignment
+       expressions.
+
+2019-04-12  Jason Merrill  <jason@redhat.com>
+
+       * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
+       of PMF type.
+
+2019-04-12  Marek Polacek  <polacek@redhat.com>
+
+       * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
+       instead of perform_implicit_conversion_flags.
+
+       PR c++/87603 - constexpr functions are no longer noexcept.
+       * constexpr.c (is_sub_constant_expr): Remove unused function.
+       * cp-tree.h (is_sub_constant_expr): Remove declaration.
+       * except.c (check_noexcept_r): Don't consider a call to a constexpr
+       function noexcept.
+
+2019-04-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR translation/90035
+       * parser.h (struct cp_parser): Add
+       type_definition_forbidden_message_arg member.
+       * parser.c (cp_debug_parser): Print it.
+       (cp_parser_check_type_definition): Pass
+       parser->type_definition_forbidden_message_arg as second argument to
+       error.
+       (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
+       parser->type_definition_forbidden_message_arg and use G_() with
+       %qs for parser->type_definition_forbidden_message instead of
+       building untranslatable message using concat.
+
+2019-04-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR translation/90011
+       * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
+
+2019-04-08  Marek Polacek  <polacek@redhat.com>
+
+       * typeck2.c (digest_init_r): Don't condition the object slicing warning
+       on flag_checking.
+
+2019-04-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/89914
+       * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
+       when maybe_instantiate_noexcept fails.
+       (classtype_has_nothrow_assign_or_copy_p): Likewise.
+       * method.c (implicitly_declare_fn): Avoid passing error_mark_node
+       to build_exception_variant.
+
+2019-04-05  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/87145 - bogus error converting class type in template arg list.
+       * pt.c (convert_nontype_argument): Don't call
+       build_converted_constant_expr if it could involve calling a conversion
+       function with a instantiation-dependent constructor as its argument.
+
+2019-04-05  Martin Sebor  <msebor@redhat.com>
+
+       PR bootstrap/89980
+       * decl.c (reshape_init_array_1): Avoid treating empty strings
+       as zeros in array initializers.
+       Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
+
+2019-04-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/89948 - ICE with break in statement-expr.
+       * constexpr.c (cxx_eval_statement_list): Jumping out of a
+       statement-expr is non-constant.
+
+2019-04-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/89966 - error with non-type auto tparm.
+       * pt.c (do_auto_deduction): Clear tf_partial.
+
+2019-04-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/86986 - ICE with TTP with parameter pack.
+       * pt.c (coerce_template_parameter_pack): Only look at the type of a
+       non-type parameter pack.
+       (fixed_parameter_pack_p_1): Don't recurse into the type of a
+       non-type parameter pack.
+       (coerce_template_template_parms): Call add_outermost_template_args.
+
+2019-04-04  Martin Sebor  <msebor@redhat.com>
+
+       PR c++/89974
+       PR c++/89878
+       PR c++/89833
+       PR c++/47488
+       * decl.c (reshape_init_array_1): Strip trailing zero-initializers
+       from arrays of trivial type and known size.
+        * mangle.c (write_expression): Convert braced initializer lists
+        to STRING_CSTs.
+       (write_expression): Trim trailing zero-initializers from arrays
+       of trivial type.
+        (write_template_arg_literal): Mangle strings the same as braced
+        initializer lists.
+
+2019-04-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/81866 - ICE with member template and default targ.
+       * pt.c (tsubst_template_decl): Handle getting a type from
+       retrieve_specialization.
+
+       PR c++/86586 - -fcompare-debug=-Wsign-compare.
+       * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
+
+       PR c++/89331 - ICE with offsetof in incomplete class.
+       * semantics.c (finish_offsetof): Handle error_mark_node.
+       * typeck.c (build_class_member_access_expr): Call
+       complete_type_or_maybe_complain before converting to base.
+
+       PR c++/89917 - ICE with lambda in variadic mem-init.
+       * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
+
+2019-04-01  Jason Merrill  <jason@redhat.com>
+
+       PR c++/86946 - ICE with function call in template argument.
+       DR 1321
+       * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
+       dependent_name.
+
+2019-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/62207
+       * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
+
+2019-03-31  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/89852 - ICE with C++11 functional cast with { }.
+       * constexpr.c (fold_non_dependent_expr_template): New static function
+       broken out of...
+       (fold_non_dependent_expr): ...here.
+       (fold_non_dependent_init): New function.
+       * cp-tree.h (fold_non_dependent_init): Declare.
+       * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
+       of fold_non_dependent_expr.  Don't call maybe_constant_init.
+
+2019-03-30  Jason Merrill  <jason@redhat.com>
+
+       PR c++/89744 - ICE with specialization of member class template.
+       * pt.c (lookup_template_class_1): If the partial instantiation is
+       explicitly specialized, adjust.
+       (maybe_process_partial_specialization): Also adjust
+       CLASSTYPE_TI_ARGS.
+
+2019-03-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR sanitizer/89869
+       * typeck.c: Include gimplify.h.
+       (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
+       for second time.  Formatting fixes.
+
+2019-03-29  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/89876 - ICE with deprecated conversion.
+       * call.c (convert_like_real): Only give warnings with tf_warning.
+
+2019-03-28  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/89612 - ICE with member friend template with noexcept.
+       * pt.c (maybe_instantiate_noexcept): For function templates, use their
+       template result (function decl).  Don't set up local specializations.
+       Temporarily turn on processing_template_decl.  Update the template type
+       too.
+
+       PR c++/89836 - bool constant expression and explicit conversions.
+       * call.c (build_converted_constant_expr_internal): New function,
+       renamed from...
+       (build_converted_constant_expr): ...this.  New.
+       (build_converted_constant_bool_expr): New.
+       * cp-tree.h (build_converted_constant_bool_expr): Declare.
+       * decl.c (build_explicit_specifier): Call
+       build_converted_constant_bool_expr.
+
+2019-03-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/89785
+       * constexpr.c (struct check_for_return_continue_data): New type.
+       (check_for_return_continue): New function.
+       (potential_constant_expression_1) <case SWITCH_STMT>: Walk
+       SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
+       in loop bodies and set *jump_target to that if found.
+
+2019-03-27  Jason Merrill  <jason@redhat.com>
+
+       PR c++/89831 - error with qualified-id in const member function.
+       * semantics.c (finish_non_static_data_member): Use object cv-quals
+       in scoped case, too.
+
+       PR c++/89421 - ICE with lambda in template parameter list.
+       * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
+       template parameter list before C++20.
+       * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
+       * semantics.c (begin_class_definition): Restore error about defining
+       non-lambda class in template parm list.
+
+2019-03-26  Jason Merrill  <jason@redhat.com>
+
+       PR c++/86932 - missed SFINAE with empty pack.
+       * pt.c (coerce_template_parms): Don't add an empty pack if
+       tf_partial.
+       (fn_type_unification): Pass tf_partial to coerce_template_parms.
+
+       PR c++/86429 - constexpr variable in lambda.
+       PR c++/82643
+       PR c++/87327
+       * constexpr.c (cxx_eval_constant_expression): In a lambda function,
+       try evaluating the captured variable directly.
+
+2019-03-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/89796
+       * semantics.c (finish_omp_atomic): Add warning_sentinel for
+       -Wunused-value around finish_expr_stmt call.
+
+2019-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84661
+       PR c++/85013
+       * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
+       to undo the disabling of warnings.
+
+2019-03-25  Jason Merrill  <jason@redhat.com>
+
+       PR c++/87748 - substitution failure error with decltype.
+       * pt.c (most_specialized_partial_spec): Clear
+       processing_template_decl.
+
+2019-03-25  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/89214 - ICE when initializing aggregates with bases.
+       * typeck2.c (digest_init_r): Warn about object slicing instead of
+       crashing.
+
+       PR c++/89705 - ICE with reference binding with conversion function.
+       * call.c (reference_binding): If the result of the conversion function
+       is a prvalue of non-class type, use the cv-unqualified type.
+
+2019-03-25  Nathan Sidwell  <nathan@acm.org>
+
+       * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
+
+2019-03-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/60702
+       * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
+       (maybe_get_tls_wrapper_call): Declare.
+       * decl2.c (get_tls_wrapper_fn): Make static.
+       (maybe_get_tls_wrapper_call): New function.
+       * typeck.c (build_class_member_access_expr): Handle accesses to TLS
+       variables.
+       * semantics.c (finish_qualified_id_expr): Likewise.
+       (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
+       * pt.c (tsubst_copy_and_build): Likewise.
+
+       PR c++/87481
+       * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
+       (cxx_eval_constant_expression): When not skipping, not constant class
+       or location wrapper, increment *ctx->constexpr_ops_count and if it is
+       above constexpr_loop_nest_limit, diagnose failure.
+       (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
+       initialize ctx.constexpr_ops_count to its address.
+       (is_sub_constant_expr): Likewise.
+
+2019-03-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/71446
+       * call.c (filed_in_pset): Change pset from hash_set<tree> * to
+       hash_set<tree, true> &, adjust uses accordingly.
+       (build_aggr_conv): Change pset from hash_set<tree> *
+       to hash_set<tree, true>.  Replace goto fail; with return NULL;,
+       adjust pset uses.
+
+       PR c++/89767
+       * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
+       variables, check for duplicates in this function.
+       * lambda.c (add_capture): Don't check for duplicates nor use
+       IDENTIFIER_MARKED.
+       (register_capture_members): Don't clear IDENTIFIER_MARKED here.
+
+2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/89571
+       * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
+       error_mark_node to comp_except_specs.
+
+2019-03-20  Jason Merrill  <jason@redhat.com>
+
+       PR c++/87480 - decltype of member access in default template arg
+       * pt.c (type_unification_real): Accept a dependent result in
+       template context.
+
+2019-03-19  Martin Sebor  <msebor@redhat.com>
+
+       PR tree-optimization/89688
+       * typeck2.c (store_init_value): Call braced_lists_to_string for more
+       kinds of initializers.
+
+2019-03-18  Jason Merrill  <jason@redhat.com>
+
+       PR c++/89630 - ICE with dependent using-decl as template arg.
+       * tree.c (cp_tree_equal): Always return false for USING_DECL.
+
+       PR c++/89761 - ICE with sizeof... in pack expansion.
+       * pt.c (argument_pack_element_is_expansion_p): Handle
+       ARGUMENT_PACK_SELECT.
+
+       PR c++/89640 - GNU attributes on lambda.
+       * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
+
+       PR c++/89682 - wrong access error in default argument.
+       * pt.c (tsubst_default_argument): Don't defer access checks.
+
+2019-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/85014
+       * semantics.c (finish_non_static_data_member): Check return value
+       of context_for_name_lookup and immediately return error_mark_node
+       if isn't a type.
+
 2019-03-17  Jason Merrill  <jason@redhat.com>
 
        PR c++/89571 - ICE with ill-formed noexcept on constructor.