2021-12-20  Patrick Palka  <ppalka@redhat.com>

	* call.c (build_new_method_call): Set
	BASELINK_FUNCTIONS_MAYBE_INCOMPLETE_P on the pruned baselink.
	* cp-tree.h (BASELINK_FUNCTIONS_MAYBE_INCOMPLETE_P): Define.
	* pt.c (filter_memfn_lookup): New subroutine of tsubst_baselink.
	(tsubst_baselink): Use filter_memfn_lookup on the new lookup
	result when BASELINK_FUNCTIONS_MAYBE_INCOMPLETE_P is set on the
	old baselink.  Remove redundant BASELINK_P check.
	* search.c (build_baselink): Set
	BASELINK_FUNCTIONS_MAYBE_INCOMPLETE_P appropriately.

2021-12-20  Patrick Palka  <ppalka@redhat.com>

	* call.c (build_new_method_call): For a non-dependent call
	expression inside a template, returning a templated tree
	whose overload set contains just the selected function.
	* semantics.c (finish_call_expr): Likewise.

2021-12-19  Matthias Kretz  <m.kretz@gsi.de>

	* module.cc (trees_out::get_merge_kind): NAMESPACE_DECLs also
	cannot have a DECL_TEMPLATE_INFO.

2021-12-19  Patrick Palka  <ppalka@redhat.com>

	PR c++/94376
	* lambda.c (lambda_capture_field_type): Strip location wrappers
	before checking for a capture proxy.
	(is_capture_proxy): Assert that we don't see a location wrapper.
	(mark_const_cap_r): Don't call is_constant_capture_proxy on a
	location wrapper.

2021-12-19  Patrick Palka  <ppalka@redhat.com>

	PR c++/103714
	* constraint.cc (satisfy_declaration_constraints): Do
	push_to_top_level and pop_from_top_level around the call to
	satisfy_normalized_constraints.

2021-12-17  Marek Polacek  <polacek@redhat.com>

	PR c/103649
	* parser.c (cp_parser_declaration): Don't warn for attribute_ignored_p.
	(cp_parser_std_attribute): Skip parsing of the attribute
	arguments when the attribute is ignored.

2021-12-17  Marek Polacek  <polacek@redhat.com>

	PR c++/103749
	* decl.c (lookup_and_check_tag): Give an error when a class was
	declared as template but no template header has been provided.
	* pt.c (do_class_deduction): Don't deduce CLASSTYPE_ERRONEOUS
	types.

2021-12-17  Iain Sandoe  <iain@sandoe.co.uk>

	PR c++/100127
	* coroutines.cc (coro_rewrite_function_body): Handle initial
	await expressions that try to produce a reference value.

2021-12-17  Iain Sandoe  <iain@sandoe.co.uk>

	PR c++/100772
	* coroutines.cc (morph_fn_to_coro): Convert function parms
	from reference before constructing any operator-new args
	list.

2021-12-17  Jason Merrill  <jason@redhat.com>

	* constraint.cc (deduce_concept_introduction): Adjust comment.

2021-12-17  Jason Merrill  <jason@redhat.com>

	PR c++/103681
	* cp-tree.h (struct lang_type): Add non_pod_aggregate.
	(CLASSTYPE_NON_POD_AGGREGATE): New.
	* class.c (check_field_decls): Set it.
	(check_bases_and_members): Check it.
	(check_non_pod_aggregate): New.
	(enum eoc_mode): New.
	(end_of_class): Always include non-empty fields.
	Add eoc_nv_or_dsize mode.
	(include_empty_classes, layout_class_type): Adjust.

2021-12-16  Marek Polacek  <polacek@redhat.com>

	PR c++/99980
	* parser.c (cp_parser_single_declaration): Maybe pass
	CP_PARSER_FLAGS_DELAY_NOEXCEPT down to cp_parser_init_declarator.

2021-12-16  Martin Sebor  <msebor@redhat.com>

	PR c++/103703
	* parser.c (class_decl_loc_t::diag_mismatched_tags): Check for class
	type before assuming a type is one.

2021-12-16  Patrick Palka  <ppalka@redhat.com>

	PR c++/51577
	PR c++/83035
	PR c++/100465
	* call.c (add_operator_candidates): Add lookups parameter.
	Use it to avoid performing a second unqualified lookup when
	instantiating a dependent operator expression.
	(build_new_op): Add lookups parameter and pass it appropriately.
	* constraint.cc (finish_constraint_binary_op): Use
	build_min_nt_loc instead of build_x_binary_op.
	* coroutines.cc (build_co_await): Adjust call to build_new_op.
	* cp-objcp-common.c (cp_common_init_ts): Mark
	DEPENDENT_OPERATOR_TYPE appropriately.
	* cp-tree.def (DEPENDENT_OPERATOR_TYPE): Define.
	* cp-tree.h (WILDCARD_TYPE_P): Accept DEPENDENT_OPERATOR_TYPE.
	(FOLD_EXPR_OP_RAW): New, renamed from ...
	(FOLD_EXPR_OP): ... this.  Change this to return the tree_code directly.
	(DEPENDENT_OPERATOR_TYPE_SAVED_LOOKUPS): Define.
	(templated_operator_saved_lookups): Define.
	(build_new_op): Add lookups parameter.
	(build_dependent_operator_type): Declare.
	(build_x_indirect_ref): Add lookups parameter.
	(build_x_binary_op): Likewise.
	(build_x_unary_op): Likewise.
	(build_x_compound_expr): Likewise.
	(build_x_modify_expr): Likewise.
	* cxx-pretty-print.c (get_fold_operator): Adjust after
	FOLD_EXPR_OP change.
	* decl.c (start_preparsed_function): Don't call
	push_operator_bindings.
	* decl2.c (grok_array_decl): Adjust calls to build_new_op.
	* method.c (do_one_comp): Likewise.
	(build_comparison_op): Likewise.
	* module.cc (trees_out::type_node): Handle DEPENDENT_OPERATOR_TYPE.
	(trees_in::tree_node): Likewise.
	* name-lookup.c (lookup_name): Revert r11-2876 change.
	(op_unqualified_lookup): Remove.
	(maybe_save_operator_binding): Remove.
	(discard_operator_bindings): Remove.
	(push_operator_bindings): Remove.
	* name-lookup.h (maybe_save_operator_binding): Remove.
	(push_operator_bindings): Remove.
	(discard_operator_bindings): Remove.
	* parser.c (cp_parser_unary_expression): Adjust calls to build_x_*.
	(cp_parser_binary_expression): Likewise.
	(cp_parser_assignment_expression): Likewise.
	(cp_parser_expression): Likewise.
	(do_range_for_auto_deduction): Likewise.
	(cp_convert_range_for): Likewise.
	(cp_parser_perform_range_for_lookup): Likewise.
	(cp_parser_template_argument): Likewise.
	(cp_parser_omp_for_cond): Likewise.
	(cp_parser_omp_for_incr): Likewise.
	(cp_parser_omp_for_loop_init): Likewise.
	(cp_convert_omp_range_for): Likewise.
	(cp_finish_omp_range_for): Likewise.
	* pt.c (fold_expression): Adjust after FOLD_EXPR_OP change. Pass
	templated_operator_saved_lookups to build_x_*.
	(tsubst_omp_for_iterator): Adjust call to build_x_modify_expr.
	(tsubst_expr) <case COMPOUND_EXPR>: Pass
	templated_operator_saved_lookups to build_x_*.
	(tsubst_copy_and_build) <case INDIRECT_REF>: Likewise.
	<case tcc_unary>: Likewise.
	<case tcc_binary>: Likewise.
	<case MODOP_EXPR>: Likewise.
	<case COMPOUND_EXPR>: Likewise.
	(dependent_type_p_r): Return true for DEPENDENT_OPERATOR_TYPE.
	* ptree.c (cxx_print_type): Handle DEPENDENT_OPERATOR_TYPE.
	* semantics.c (finish_increment_expr): Adjust call to
	build_x_unary_op.
	(finish_unary_op_expr): Likewise.
	(handle_omp_for_class_iterator): Adjust calls to build_x_*.
	(finish_omp_cancel): Likewise.
	(finish_unary_fold_expr): Use build_dependent_operator_type.
	(finish_binary_fold_expr): Likewise.
	* tree.c (cp_free_lang_data): Don't call discard_operator_bindings.
	* typeck.c (rationalize_conditional_expr): Adjust call to
	build_x_binary_op.
	(op_unqualified_lookup): Define.
	(build_dependent_operator_type): Define.
	(build_x_indirect_ref): Add lookups parameter and use
	build_dependent_operator_type.
	(build_x_binary_op): Likewise.
	(build_x_array_ref): Likewise.
	(build_x_unary_op): Likewise.
	(build_x_compound_expr_from_list): Adjust call to
	build_x_compound_expr.
	(build_x_compound_expr_from_vec): Likewise.
	(build_x_compound_expr): Add lookups parameter and use
	build_dependent_operator_type.
	(cp_build_modify_expr): Adjust call to build_new_op.
	(build_x_modify_expr): Add lookups parameter and use
	build_dependent_operator_type.
	* typeck2.c (build_x_arrow): Adjust call to build_new_op.

2021-12-15  Marek Polacek  <polacek@redhat.com>

	PR c++/102229
	* decl.c (check_decltype_auto): New.
	(grokdeclarator): Call it.
	* pt.c (do_auto_deduction): Don't check decltype(auto) here.

2021-12-15  Martin Liska  <mliska@suse.cz>

	PR c++/103713
	* tree.c (maybe_warn_parm_abi): Fix warning word splitting.

2021-12-15  Jakub Jelinek  <jakub@redhat.com>

	PR c++/103704
	* semantics.c (finish_omp_target_clauses_r): For OMP_CLAUSEs
	just walk subtrees.

2021-12-14  Patrick Palka  <ppalka@redhat.com>

	PR c++/103408
	* constraint.cc (type_deducible_p): Remove workaround for
	non-templated requires-expressions.
	(normalize_placeholder_type_constraints): Likewise.
	* cp-tree.h (current_template_depth): Define.
	(PROCESSING_REAL_TEMPLATE_DECL): Inspect current_template_depth
	instead of the magnitude of processing_template_decl.
	* decl.c (start_decl): Likewise.
	(grokfndecl): Likewise.
	(grokvardecl): Likewise.
	(grokdeclarator): Likewise.
	* friend.c (make_friend_class): Likewise.  Calculate
	friend_depth differently when called at instantiation time
	instead of parse time.
	(do_friend): Likewise.
	* parser.c (cp_parser_requires_clause_expression): Remove
	workaround for lambdas inside constraints.
	(cp_parser_constraint_expression): Likewise.
	(cp_parser_requires_expression): Likewise.
	(synthesize_implicit_template_parm): Add to current_template_parms
	before calling process_template_parm.
	* pt.c (inline_needs_template_parms): Inspect
	current_template_depth instead of the magnitude of
	processing_template_decl.
	(push_inline_template_parms_recursive): Likewise.
	(maybe_begin_member_template_processing): Likewise.
	(begin_template_parm_list): Likewise.
	(process_template_parm): Likewise.
	(end_template_parm_list): Likewise.
	(push_template_decl): Likewise.
	(add_inherited_template_parms): Likewise.
	(instantiate_class_template_1): Don't adjust
	processing_template_decl around the call to make_friend_class.
	adjust_processing_template_decl to adjust_template_depth.  Set
	current_template_parms instead of processing_template_decl when
	adjust_template_depth.
	(make_auto_1): Inspect current_template_depth instead of the
	magnitude of processing_template_decl.
	(splice_late_return_type): Likewise.
	* semantics.c (fixup_template_type): Likewise.

2021-12-14  Patrick Palka  <ppalka@redhat.com>

	* call.c (build_new_op): Use releasing_vec for arglist.  Declare
	conv in the scope it's used.

2021-12-14  Patrick Palka  <ppalka@redhat.com>

	* cp-tree.h (COMPOUND_EXPR_OVERLOADED): Remove.
	* pt.c (build_non_dependent_expr): Don't inspect the flag.
	* tree.c (build_min_non_dep): Don't set the flag.

2021-12-12  Jonathan Wakely  <jwakely@redhat.com>

	* error.c: Define INCLUDE_MEMORY instead of
	INCLUDE_UNIQUE_PTR.
	* lex.c: Likewise.
	* name-lookup.c: Likewise.
	(class namespace_limit_reached): Use std::unique_ptr instead of
	gnu::unique_ptr.
	(suggest_alternatives_for): Use std::move instead of gnu::move.
	(suggest_alternatives_in_other_namespaces): Likewise.
	* parser.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR.

2021-12-09  Marek Polacek  <polacek@redhat.com>

	PR c++/103401
	* parser.c (cp_parser_decltype): Clear
	auto_is_implicit_function_template_parm_p.
	(cp_parser_type_id_1): Give errors only when !cp_parser_simulate_error.
	(cp_parser_parameter_declaration): Clear
	auto_is_implicit_function_template_parm_p after parsing the
	decl-specifier-seq.
	(cp_parser_sizeof_operand): Clear
	auto_is_implicit_function_template_parm_p.

2021-12-09  Jakub Jelinek  <jakub@redhat.com>

	PR pch/71934
	* module.cc (nop): Add another void * argument.
	* name-lookup.c (resort_member_name_cmp): Pass the same pointer twice
	to resort_data.new_value.

2021-12-08  Chung-Lin Tang  <cltang@codesourcery.com>

	* parser.c (struct omp_dim): New struct type for use inside
	cp_parser_omp_var_list_no_open.
	(cp_parser_omp_var_list_no_open): Allow multiple levels of array and
	component accesses in array section base-pointer expression.
	(cp_parser_omp_all_clauses): Set 'allow_deref' to true in call to
	cp_parser_omp_var_list for to/from clauses.
	* semantics.c (handle_omp_array_sections_1): Extend allowed range
	of base-pointer expressions involving INDIRECT/MEM/ARRAY_REF and
	POINTER_PLUS_EXPR.
	(handle_omp_array_sections): Adjust pointer map generation of
	references.
	(finish_omp_clauses): Extend allowed ranged of expressions
	involving INDIRE