PR c++/85149 - generic lambda and constexpr if.
[gcc.git] / gcc / cp / ChangeLog
index 236ea215452c0e5ef7a588cd4df94ac507bb30fc..9dbb215154e59826737599356a47a5d67bb11b24 100644 (file)
@@ -1,3 +1,335 @@
+2018-04-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/85149 - generic lambda and constexpr if.
+       * pt.c (build_extra_args, add_extra_args): Split from
+       tsubst_pack_expansion.
+       (tsubst_expr) [IF_STMT]: Use them.
+       * cp-tree.h (IF_STMT_EXTRA_ARGS): New.
+
+       * typeck.c (merge_types): Limit matching attribute shortcut to
+       the default case.
+
+2018-04-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/85147
+       * pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node.
+
+       PR c++/85140
+       * name-lookup.c (handle_namespace_attrs): Return early if attributes
+       is error_mark_node.
+
+       PR c++/85134
+       * decl.c (cp_finish_decl): If ensure_literal_type_for_constexpr_object
+       fails, after clearing DECL_DECLARED_CONSTEXPR_P don't return early,
+       instead for static data members clear init and set DECL_EXTERNAL.
+
+2018-04-02  Jason Merrill  <jason@redhat.com>
+
+       PR c++/64095 - auto... parameter pack.
+       * parser.c (cp_parser_parameter_declaration): Handle turning autos
+       into packs here.
+       (cp_parser_parameter_declaration_list): Not here.
+
+2018-03-31  Alexandre Oliva <aoliva@redhat.com>
+
+       PR c++/85027
+       * class.c (instantiate_type): Peel off SAVE_EXPR before
+       BASELINK.
+
+2018-03-30  Jason Merrill  <jason@redhat.com>
+
+       * typeck2.c (process_init_constructor_record): Use
+       init_list_type_node for the CONSTRUCTOR around an anonymous union
+       designated initializer.
+
+2018-03-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84791
+       * semantics.c (finish_omp_reduction_clause): If
+       OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true
+       even if processing_template_decl.
+
+2018-03-29  David Malcolm  <dmalcolm@redhat.com>
+
+       PR c++/84269
+       * name-lookup.c (get_std_name_hint): Add names from <memory>,
+       <tuple>, and <utility>.
+
+2018-03-29  Jason Merrill  <jason@redhat.com>
+
+       PR c++/85093 - too many template args with pack expansion.
+       * pt.c (coerce_template_parms): Keep pack expansion args that will
+       need to be empty.
+
+2018-03-29  Jason Merrill  <jason@redhat.com>
+
+       * pt.c (build_non_dependent_expr): Propagate expr location.
+
+2018-03-27  Jason Merrill  <jason@redhat.com>
+
+       PR c++/85060 - wrong-code with call to base member in template.
+       * search.c (any_dependent_bases_p): Check uses_template_parms
+       rather than processing_template_decl.
+
+2018-03-29  David Malcolm  <dmalcolm@redhat.com>
+
+       PR c++/85110
+       * typeck.c (convert_for_assignment): When complaining due to
+       conversions for an argument, attempt to use the location of the
+       argument.
+
+2018-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/85028
+       * pt.c (tsubst_default_argument): Early return if the type of the
+       parameter is erroneous.
+
+2018-03-28  Alexandre Oliva <aoliva@redhat.com>
+
+       PR c++/84973
+       * decl2.c (note_vague_linkage_fn): Don't defer uninstantiated
+       templates.
+
+       PR c++/84968
+       * tree.c (strip_typedefs_expr): Reject STATEMENT_LISTs.
+
+2018-03-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/85067
+       * method.c (defaulted_late_check): Partially revert r253321 changes,
+       do not early return upon error.
+
+2018-03-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/85077
+       * cp-gimplify.c (cp_fold) <case CONSTRUCTOR>: For ctors with vector
+       type call fold to generate VECTOR_CSTs when possible.
+
+       PR c++/85076
+       * tree.c (cp_build_reference_type): If to_type is error_mark_node,
+       return it right away.
+
+2018-03-27  Volker Reichelt  <v.reichelt@netcologne.de>
+
+       * search.c (check_final_overrider): Use inform instead of error
+       for the diagnostics of the overridden functions.  Tweak wording.
+
+2018-03-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/85068
+       * class.c (update_vtable_entry_for_fn): Don't ICE if base_binfo
+       is NULL.  Assert if thunk_binfo is NULL then errorcount is non-zero.
+
+2018-03-27  Paolo Carlini  <paolo.carlini@oracle.com>
+           Jason Merrill  <jason@redhat.com>
+
+       PR c++/84632
+       * init.c (build_aggr_init): When initializing from array,
+       reject anything but CONSTRUCTORs and TARGET_EXPRs.
+       (build_vec_init): Handle separately ARRAY_TYPEs.
+
+2018-03-26  Jason Merrill  <jason@redhat.com>
+
+       PR c++/85062 - ICE with alignas in wrong place.
+       * decl.c (grokdeclarator): Ignore attributes on type-specifiers
+       here.
+
+       PR c++/85049 - ICE with __integer_pack.
+       * pt.c (unify_pack_expansion): Don't try to deduce generated packs.
+       * cp-tree.h (TEMPLATE_PARM_P): New.
+
+2018-03-23  Jason Merrill  <jason@redhat.com>
+
+       PR c++/78489 - wrong SFINAE behavior.
+
+       PR c++/84489
+       * pt.c (type_unification_real): Don't defer substitution failure.
+
+2018-03-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/85015
+       * decl.c (compute_array_index_type): Set osize to mark_rvalue_use
+       result.
+
+       PR c++/84942
+       * pt.c (tsubst_copy_and_build) <case FIX_TRUNC_EXPR>: Replace
+       cp_build_unary_op call with gcc_unreachable ().
+
+2018-03-23  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/85045
+       * cxx-pretty-print.c (cxx_pretty_printer::multiplicative_expression):
+       Handle EXACT_DIV_EXPR and RDIV_EXPR.  Tweak condition.
+       (cxx_pretty_printer::expression): Handle EXACT_DIV_EXPR and RDIV_EXPR.
+
+2018-03-23  Ville Voutilainen  <ville.voutilainen@gmail.com>
+
+       Implement P0962
+       * parser.c (cp_parser_perform_range_for_lookup): Change
+       the condition for deciding whether to use members.
+
+2018-03-23  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/85033
+       * semantics.c (finish_offsetof): Don't allow CONST_DECLs.
+
+2018-03-23  Alexandre Oliva <aoliva@redhat.com>
+
+       PR c++/71251
+       * parser.c (cp_parser_alias_declaration): Call
+       parser_check_template_parameters.
+
+       PR c++/84789
+       * pt.c (resolve_typename_type): Drop assert that stopped
+       simplification to template-independent types.  Add assert to
+       verify the initial scope is template dependent.
+       * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
+       Reparse the id expression as a type-name, not a declarator.
+
+       PR c++/84729
+       * init.c (build_vec_init): Error at parenthesized array init.
+
+       PR c++/84610
+       PR c++/84642
+       PR c++/84942
+       * cp-tree.h (temp_override): New template class, generalizing
+       a cleanup that was only used...
+       * parser.c (cp_parser_parameter_declaration_clause):
+       ... here for auto_is_implicit_function_template_parm_p.
+       (cp_parser_gnu_attributes_opt): Use it here as well.
+       (cp_parser_std_attribute): Likewise.
+
+2018-03-22  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84854
+       * semantics.c (finish_if_stmt_cond): Check if the type of the condition
+       is boolean.
+
+2018-03-21  Jason Merrill  <jason@redhat.com>
+
+       PR c++/81311 - wrong C++17 overload resolution.
+       * call.c (build_user_type_conversion_1): Remove C++17 code.
+       (conv_binds_ref_to_prvalue): New.
+       (build_over_call): Handle C++17 copy elision.
+       (build_special_member_call): Only do C++17 copy elision here if the
+       argument is already the right type.
+
+2018-03-21  Alexandre Oliva <aoliva@redhat.com>
+
+       PR c++/71965
+       * init.c (build_vec_init): Silence error, former sorry,
+       without tf_error.
+
+       PR c++/84610
+       PR c++/84642
+       * parser.c (abort_fully_implicit_template_p): New.
+       (cp_parser_skip_to_end_of_statement): Use it.
+       (cp_parser_skip_to_end_of_block_or_statement): Likewise.
+       (finish_fully_implicit_template_p): Clear
+       implicit_template_parms and implicit_template_scope.
+
+2018-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84972
+       * decl.c (maybe_deduce_size_from_array_init): Set TREE_TYPE to
+       error_mark_node when check_array_designated_initializer fails.
+
+2018-03-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84961
+       * cp-tree.h (genericize_compound_lvalue): Declare.
+       * typeck.c (genericize_compound_lvalue): New function.
+       (unary_complex_lvalue, cp_build_modify_expr): Use it.
+       * semantics.c (finish_asm_stmt): Replace MODIFY_EXPR, PREINCREMENT_EXPR
+       and PREDECREMENT_EXPR in output and "m" constrained input operands with
+       COMPOUND_EXPR.  Call cxx_mark_addressable on the rightmost
+       COMPOUND_EXPR operand.
+
+2018-03-21  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/85008
+       * tree.c (decl_linkage): Use DECL_CLONED_FUNCTION_P.
+       * decl2.c (vague_linkage_p): Likewise.
+
+2018-03-21  David Malcolm  <dmalcolm@redhat.com>
+
+       PR c++/84994
+       * constexpr.c (constexpr_fn_retval): Make non-"static".
+       * cp-tree.h (constexpr_fn_retval): New decl.
+       * search.c (direct_accessor_p): Update leading comment.
+       (reference_accessor_p): Likewise.
+       (field_accessor_p): Replace check that function body is a
+       RETURN_EXPR with a call to constexpr_fn_retval.  Fix
+       indentation of "field_type" decl.
+
+2018-03-21  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/84804
+       * name-lookup.c (do_pushtag): Permit lambdas to be pushed into
+       complete classes.
+
+2018-03-21  Martin Sebor  <msebor@redhat.com>
+
+       PR c++/84850
+       * call.c (first_non_public_field): New template and function.
+       (first_non_trivial_field): New function.
+       (maybe_warn_class_memaccess): Call them.
+
+2018-03-21  David Malcolm  <dmalcolm@redhat.com>
+
+       PR c++/84892
+       * search.c (field_accessor_p): Use class_of_this_parm rather than
+       type_of_this_parm, to check that "this" is a "const T *", rather
+       than a "T *const".
+
+2018-03-21  Nathan Sidwell  <nathan@acm.org>
+
+       * class.c (finish_struct_anon_r): Refactor, deprecate anything
+       other than public non-static data members.
+       * parser.c (cp_parser_init_declarator): Deprecate attributes after
+       parenthesized initializer.
+
+       PR c++/84836
+       * name-lookup.c (update_binding): Correct logic for local binding
+       update.
+
+2018-03-21  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/71638, ICE with NSDMI and reference.
+       * constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags
+       even when we replace an element.
+
+2018-03-20  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/84978, ICE with NRVO.
+       * constexpr.c (cxx_eval_constant_expression): Handle the case when
+       a RESULT_DECL isn't in the hash map.
+
+2018-03-20  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84978, ICE with NRVO.
+       * cvt.c (cp_get_fndecl_from_callee): Add fold parameter.
+       (cp_get_callee_fndecl_nofold): New.
+       * cp-gimplify.c (cp_genericize_r): Use it instead.
+       * call.c (check_self_delegation): Likewise.
+
+2018-03-20  Nathan Sidwell  <nathan@acm.org>
+
+       PR c++/84962
+       * name-lookup.c (pushdecl_class_level): Push anon-struct's
+       member_vec, if there is one.
+
+       PR c++/84970
+       * cp-tree.h (lookup_list_keep): Declare.
+       * tree.c (lookup_list_keep): New, broken out of ...
+       (build_min): ... here.  Call it.
+       * decl.c (cp_finish_decl): Call lookup_list_keep.
+
+2018-03-19  Jason Merrill  <jason@redhat.com>
+
+       PR c++/84937 - ICE with class deduction and auto.
+       * pt.c (rewrite_template_parm): Fix auto handling.
+
 2018-03-19  Marek Polacek  <polacek@redhat.com>
 
        PR c++/84925
@@ -9,7 +341,7 @@
        (cxx_eval_constant_expression): Verify constructor's flags
        unconditionally.
 
-2018-03-16  Jason Merrill  <jason@redhat.com>
+2018-03-19  Jason Merrill  <jason@redhat.com>
 
        PR c++/71834 - template-id with too few arguments.
        * pt.c (coerce_template_parms): Check fixed_parameter_pack_p.