Daily bump.
[official-gcc.git] / gcc / cp / ChangeLog
blob579c528a53d4008c153df4ce1dcc5de155ab9f99
1 2021-09-30  Patrick Palka  <ppalka@redhat.com>
3         PR c++/102535
4         * method.c (is_xible_helper): Don't exit early for multi-arg
5         ctors in C++20.
7 2021-09-30  Patrick Palka  <ppalka@redhat.com>
9         * parser.c (cp_parser_trait_expr): Call nreverse on the reversed
10         list of trailing arguments.
12 2021-09-30  Patrick Palka  <ppalka@redhat.com>
14         PR c++/95567
15         * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields.
17 2021-09-28  Patrick Palka  <ppalka@redhat.com>
19         PR c++/99909
20         * pt.c (coerce_template_template_parms): Keep
21         processing_template_decl set around the call to unify as well.
23 2021-09-28  Iain Sandoe  <iain@sandoe.co.uk>
25         PR c++/102454
26         * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
27         unnamed function params.
28         (morph_fn_to_coro): Do not try to set a guard variable for param
29         DTORs in the ramp, unless we have exceptions active.
31 2021-09-27  Patrick Palka  <ppalka@redhat.com>
33         PR c++/102479
34         * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
35         Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
36         rewritten ttp.
37         (alias_ctad_tweaks): Set current_template_parms accordingly.
39 2021-09-23  Michel Morin  <mimomorin@gmail.com>
41         * parser.c (cp_keyword_starts_decl_specifier_p): Do not
42         handle RID_ATTRIBUTE.
43         (cp_parser_constructor_declarator_p): Remove now-redundant
44         checks.
45         (cp_parser_lambda_declarator_opt): Likewise.
47 2021-09-23  Michel Morin  <mimomorin@gmail.com>
49         PR c++/77565
50         * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
51         decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
53 2021-09-23  Patrick Palka  <ppalka@redhat.com>
55         * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
56         a TEMPLATE_DECL.  Dump the DECL_TEMPLATE_INFO rather than just
57         printing its pointer value.
59 2021-09-23  Jakub Jelinek  <jakub@redhat.com>
61         PR c++/102413
62         * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
63         is not followed by a balanced token sequence starting with open paren.
65 2021-09-22  Patrick Palka  <ppalka@redhat.com>
67         DR 2446
68         PR c++/102412
69         * constexpr.c (cxx_eval_constant_expression)
70         <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
71         instead of processing_template_decl.
72         * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
73         Return true only if any_dependent_template_arguments_p.
74         (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
75         <case TEMPLATE_ID_EXPR>: Likewise.
77 2021-09-22  Jakub Jelinek  <jakub@redhat.com>
79         * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
80         modifiers.
81         * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
82         semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
83         * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
84         also OMP_CLAUSE_ALLOCATE_ALIGN.
86 2021-09-22  Barrett Adair  <barrettellisadair@gmail.com>
88         * pt.c (find_parm_usage_r): New walk_tree callback to find func
89         parms.
90         (any_template_arguments_need_structural_equality_p): New special
91         case.
93 2021-09-21  wangpc  <pc.wang@linux.alibaba.com>
95         * decl.c (start_decl_1): Move verify_type_context to ...
96         (cp_finish_decl): ... to here.
98 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
100         * parser.c (cp_parser_omp_clause_order): Parse unconstrained
101         and reproducible modifiers.
102         (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
104 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
106         * parser.c (cp_parser_omp_clause_default): Handle private and
107         firstprivate arguments, adjust diagnostics on unknown argument.
108         * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
110 2021-09-18  Jason Merrill  <jason@redhat.com>
112         * cp-tree.h (dependentish_scope_p): Declare.
113         * pt.c (dependentish_scope_p): New.
114         * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
115         for lookup of a type in a dependent object.
116         (cp_parser_template_id): Handle TYPENAME_TYPE.
117         (cp_parser_template_name): If we're looking for a type,
118         a name followed by < names a template.
120 2021-09-18  Jason Merrill  <jason@redhat.com>
122         * cp-tree.h: Fix typo in LANG_FLAG list.
124 2021-09-17  Jakub Jelinek  <jakub@redhat.com>
126         * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
127         * parser.c (cp_parser_omp_atomic): Update function comment for
128         OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
129         weak clauses.
130         * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
131         them, handle COND_EXPRs.
132         * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
133         finish_omp_atomic can now produce.
135 2021-09-16  Patrick Palka  <ppalka@redhat.com>
137         PR c++/98486
138         * constraint.cc (get_normalized_constraints_from_decl): Always
139         look up constraints using the most general template.
140         * decl.c (grokdeclarator): Set constraints on a static data
141         member template.
142         * pt.c (determine_specialization): Check constraints on a
143         variable template.
145 2021-09-16  Iain Sandoe  <iain@sandoe.co.uk>
147         * coroutines.cc (await_statement_walker): Code cleanups.
149 2021-09-16  Jason Merrill  <jason@redhat.com>
151         * constexpr.c (cxx_eval_outermost_constant_expr): Use
152         protected_set_expr_location.
154 2021-09-15  Patrick Palka  <ppalka@redhat.com>
156         PR c++/101904
157         * call.c (build_user_type_conversion_1): Add tf_conv to complain.
158         (add_candidates): When in a SFINAE context, instead of adding a
159         candidate to bad_fns just mark it unviable.
161 2021-09-15  Jason Merrill  <jason@redhat.com>
163         * cp-tree.h (parsing_function_declarator): Declare.
164         * name-lookup.c (set_decl_context_in_fn): Use it.
165         * parser.c (cp_parser_direct_declarator): Use it.
166         (parsing_function_declarator): New.
168 2021-09-15  Jakub Jelinek  <jakub@redhat.com>
170         PR c++/88578
171         PR c++/102295
172         * typeck2.c (split_nonconstant_init_1): Don't throw away empty
173         initializers of flexible array members if they have non-zero type
174         size.
176 2021-09-15  Patrick Palka  <ppalka@redhat.com>
178         PR c++/102050
179         * decl.c (grok_special_member_properties): Set
180         TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
181         and TYPE_HAS_LIST_CTOR independently from each other.
183 2021-09-15  Jason Merrill  <jason@redhat.com>
185         * decl.c (cxx_init_decl_processing): Only warn about odd
186         interference sizes if they were specified with --param.
188 2021-09-15  Jason Merrill  <jason@redhat.com>
190         PR c++/48396
191         * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
192         (type_info_ptr_type): Remove.
193         * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
194         (typeid_ok_p): Check for null const_type_info_type_node.
195         (type_info_ptr_type, get_void_tinfo_ptr): New fns.
196         (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
197         (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
198         (get_tinfo_desc): Use const_ptr_type_node.
200 2021-09-15  Jason Merrill  <jason@redhat.com>
202         * parser.c (cp_parser_template_name): Move object type.
203         (cp_parser_pre_parsed_nested_name_specifier): Likewise.
205 2021-09-15  Jason Merrill  <jason@redhat.com>
207         * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
208         a declarator.
210 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
212         * coroutines.cc (struct param_info): Add copy_var.
213         (build_actor_fn): Use simplified param references.
214         (register_param_uses): Likewise.
215         (rewrite_param_uses): Likewise.
216         (analyze_fn_parms): New function.
217         (coro_rewrite_function_body): Add proxies for the fn
218         parameters to the outer bind scope of the rewritten code.
219         (morph_fn_to_coro): Use simplified version of param ref.
221 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
223         * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
224         coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
225         coro_self_handle_id, coro_actor_continue_id,
226         coro_frame_i_a_r_c_id): New.
227         (coro_init_identifiers): Initialize new name identifiers.
228         (coro_promise_type_found_p): Use pre-built identifiers.
229         (struct await_xform_data): Remove unused fields.
230         (transform_await_expr): Delete code that is now unused.
231         (build_actor_fn): Simplify interface, use pre-built identifiers and
232         remove transforms that are no longer needed.
233         (build_destroy_fn): Use revised field names.
234         (register_local_var_uses): Use pre-built identifiers.
235         (coro_rewrite_function_body): Simplify interface, use pre-built
236         identifiers.  Generate proxy vars in the outer bind expr scope for the
237         implementation state that we wish to expose.
238         (morph_fn_to_coro): Adjust comments for new variable names, use pre-
239         built identifiers.  Remove unused code to generate frame entries for
240         the implementation state.  Adjust call for build_actor_fn.
242 2021-09-14  Patrick Palka  <ppalka@redhat.com>
244         PR c++/102163
245         * constexpr.c (cxx_eval_call_expression): After evaluating a
246         subobject constructor call for an empty union member, produce a
247         side effect that makes sure the member gets activated.
249 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
251         PR c++/102295
252         * decl.c (layout_var_decl): For aggregates ending with a flexible
253         array member, add the size of the initializer for that member to
254         DECL_SIZE and DECL_SIZE_UNIT.
256 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
258         PR c++/102305
259         * method.c (is_xible_helper): Call complete_type on to.
261 2021-09-14  Jason Merrill  <jason@redhat.com>
263         * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
264         size is smaller than maxalign.
266 2021-09-13  Jason Merrill  <jason@redhat.com>
268         * constexpr.c (maybe_warn_about_constant_value):
269         Complain about std::hardware_destructive_interference_size.
270         (cxx_eval_constant_expression): Call it.
271         * decl.c (cxx_init_decl_processing): Check
272         --param *-interference-size values.
274 2021-09-13  Patrick Palka  <ppalka@redhat.com>
276         PR c++/101764
277         * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
278         macro.
279         * pt.c (has_extra_args_mechanism_p): New function.
280         (find_parameter_pack_data::found_extra_args_tree_p): New data
281         member.
282         (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
283         appropriately.
284         (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
285         ppd.found_extra_args_tree_p.
286         (use_pack_expansion_extra_args_p): Return true if there were
287         unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
288         (tsubst_pack_expansion): Pass the pack expansion to
289         use_pack_expansion_extra_args_p.
291 2021-09-10  Jakub Jelinek  <jakub@redhat.com>
293         * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
294         and acq_rel/acquire clauses on update.
295         * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
297 2021-09-08  Richard Biener  <rguenther@suse.de>
299         PR c++/102228
300         * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
301         * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
302         place on invalid code.
303         * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
304         access.
305         * module.cc (trees_in::read_class_def): Likewise.  Reconstruct
306         ANON_AGGR_TYPE_FIELD.
307         * semantics.c (finish_member_declaration): Populate
308         ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
309         * typeck.c (lookup_anon_field): Remove DFS search and return
310         ANON_AGGR_TYPE_FIELD directly.
312 2021-09-07  Jakub Jelinek  <jakub@redhat.com>
314         PR c++/100495
315         * constexpr.c (maybe_save_constexpr_fundef): Save body even for
316         constexpr deleting dtors.
317         (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
318         deleting dtors.
320 2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>
322         * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
323         directive.
324         * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
326 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
328         * coroutines.cc (register_local_var_uses): Do not mangle
329         frame entries for the outermost scope.  Record the outer
330         scope as nesting depth 0.
332 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
334         * coroutines.cc (coro_build_artificial_var): New.
335         (build_actor_fn): Use var builder, rename vars to use
336         implementation namespace.
337         (coro_rewrite_function_body): Likewise.
338         (morph_fn_to_coro): Likewise.
340 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
342         * coroutines.cc (transform_local_var_uses): Record
343         frame offset expressions as DECL_VALUE_EXPRs instead of
344         rewriting them.
346 2021-09-03  Patrick Palka  <ppalka@redhat.com>
348         PR c++/101904
349         * call.c (build_this_conversion): New function, split out from
350         add_function_candidate.
351         (add_function_candidate): New parameter shortcut_bad_convs.
352         Document it.  Use build_this_conversion.  Stop at the first bad
353         argument conversion when shortcut_bad_convs is true.
354         (add_template_candidate_real): New parameter shortcut_bad_convs.
355         Use build_this_conversion to check the 'this' conversion before
356         attempting deduction.  When the rejection reason code is
357         rr_bad_arg_conversion, pass -1 instead of 0 as the viable
358         parameter to add_candidate.  Pass 'convs' to add_candidate.
359         (add_template_candidate): New parameter shortcut_bad_convs.
360         (add_template_conv_candidate): Pass false as shortcut_bad_convs
361         to add_template_candidate_real.
362         (add_candidates): Prefer to shortcut bad conversions during
363         overload resolution under the assumption that we'll eventually
364         see a strictly viable candidate.  If this assumption turns out
365         to be false, re-process the non-strictly viable candidates
366         without shortcutting those bad conversions.
368 2021-09-03  Jason Merrill  <jason@redhat.com>
370         * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
371         we decide not to instantiate.
373 2021-09-03  Jakub Jelinek  <jakub@redhat.com>
375         PR target/102024
376         * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
377         instead of writing to DECL_FIELD_ABI_IGNORED.
378         (layout_class_type): Likewise.  In the place where zero-width
379         bitfields used to be removed, use
380         SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
382 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
384         * call.c (build_over_call): Handle unavailable state in addition to
385         deprecation.
386         * class.c (type_build_ctor_call): Likewise.
387         (type_build_dtor_call): Likewise.
388         * cp-tree.h: Rename cp_warn_deprecated_use to
389         cp_handle_deprecated_or_unavailable.
390         * decl.c (duplicate_decls): Merge unavailability.
391         (grokdeclarator): Handle unavailability in addition to deprecation.
392         (type_is_unavailable): New.
393         (grokparms): Handle unavailability in addition to deprecation.
394         * decl.h (enum deprecated_states): Add
395         UNAVAILABLE_DEPRECATED_SUPPRESS.
396         * decl2.c (cplus_decl_attributes): Propagate unavailability to
397         templates.
398         (cp_warn_deprecated_use): Rename to ...
399         (cp_handle_deprecated_or_unavailable): ... this and amend to handle
400         the unavailable case. It remains a warning in the case of deprecation
401         but becomes an error in the case of unavailability.
402         (cp_warn_deprecated_use_scopes): Handle unavailability.
403         (mark_used): Likewise.
404         * parser.c (cp_parser_template_name): Likewise.
405         (cp_parser_template_argument): Likewise.
406         (cp_parser_parameter_declaration_list): Likewise.
407         * typeck.c (build_class_member_access_expr): Likewise.
408         (finish_class_member_access_expr): Likewise.
409         * typeck2.c (build_functional_cast_1): Likewise.
411 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
413         * coroutines.cc (build_actor_fn): Add begin/finish clauses
414         to the initial test in the actor function.
416 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
418         * coroutines.cc (await_statement_walker): Use build_stmt and
419         add_stmt instead of build1 and finish_expr_stmt.
421 2021-08-31  Jason Merrill  <jason@redhat.com>
423         * coroutines.cc (flatten_await_stmt): Fix copyo.
424         * decl.c (reshape_init_class): Simplify.
425         * module.cc (module_state::read_language): Add null check.
426         * parser.c (build_range_temp): Avoid type_uses_auto.
427         (cp_parser_class_specifier_1): Add null check.
429 2021-08-31  Patrick Palka  <ppalka@redhat.com>
431         PR c++/12672
432         * call.c (rejection_reason::call_varargs_p): Rename this
433         previously unused member to ...
434         (rejection_reason::least_p): ... this.
435         (arity_rejection): Add least_p parameter.
436         (add_template_candidate_real): When there are explicit
437         template arguments, check that the arity of the call agrees with
438         the arity of the function before attempting deduction.
439         (print_arity_information): Add least_p parameter.
440         (print_z_candidate): Adjust call to print_arity_information.
442 2021-08-31  Martin Sebor  <msebor@redhat.com>
444         * parser.c (cp_parser_selection_statement): Use direct initialization
445         instead of copy.
447 2021-08-31  Jason Merrill  <jason@redhat.com>
449         * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
451 2021-08-31  Jason Merrill  <jason@redhat.com>
453         PR c++/92193
454         * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
455         * constexpr.c (cxx_eval_call_expression): Set it.
456         * pt.c (neglectable_inst_p): Check it.
458 2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>
460         * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
461         and 'ancestor' in 'target device' clauses.
462         * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
463         evaluate to '1' if 'ancestor' is used.
465 2021-08-30  Jason Merrill  <jason@redhat.com>
467         PR c++/96286
468         * cp-tree.h (struct lang_type): Add erroneous bit-field.
469         (CLASSTYPE_ERRONEOUS): New.
470         * pt.c (limit_bad_template_recursion): Check it.
471         (instantiate_class_template_1): Set it.
473 2021-08-30  Jason Merrill  <jason@redhat.com>
475         * constexpr.c (cxx_eval_outermost_constant_expr): Copy
476         expr location to result.
478 2021-08-30  Jason Merrill  <jason@redhat.com>
480         PR c++/101460
481         * cp-tree.h (cxx_constant_value_sfinae): Declare.
482         * constexpr.c (cxx_constant_value_sfinae): New.
483         * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
484         (tsubst_copy_and_build) [CALL_EXPR]: Call
485         maybe_fold_fn_template_args.
487 2021-08-30  Jason Merrill  <jason@redhat.com>
489         * parser.c (cp_parser_simple_requirement): Warn about missing
490         requires.
492 2021-08-27  Jason Merrill  <jason@redhat.com>
494         * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
495         a dependent pointer.
497 2021-08-25  Andrew Pinski  <apinski@marvell.com>
499         PR c++/66590
500         * cp-objcp-common.c (cxx_block_may_fallthru): Handle
501         CLEANUP_STMT for the case which will be try/finally.
503 2021-08-25  Jakub Jelinek  <jakub@redhat.com>
505         PR c++/102019
506         * init.c (build_value_init_noctor): Ignore unnamed zero-width
507         bitfields.
509 2021-08-23  Jakub Jelinek  <jakub@redhat.com>
511         * parser.c (cp_parser_omp_clause_num_tasks,
512         cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
514 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
516         * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
517         PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
518         (cp_parser_omp_error): New function.
519         (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
521 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
523         * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
524         comma at the end of list.  Don't parse closing paren here...
525         (cp_parser_omp_clause_depend): ... but here instead.
527 2021-08-19  Patrick Palka  <ppalka@redhat.com>
529         PR c++/101803
530         * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
532 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
534         * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
535         and optionally consume token if current token is CPP_EOF,
536         CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
538 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
540         * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
541         instead of cp_parser_skip_to_pragma_eol.
543 2021-08-18  Patrick Palka  <ppalka@redhat.com>
545         PR c++/101344
546         PR c++/101803
547         * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
548         * decl.c (reshape_init_r): Set it.
549         * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
550         iff CONSTRUCTOR_BRACES_ELIDED_P.
552 2021-08-18  Patrick Palka  <ppalka@redhat.com>
554         PR c++/101883
555         * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
556         do_auto_deduction.
558 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
560         * parser.c (cp_parser_omp_nothing): New function.
561         (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
563 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
565         * parser.c (cp_parser_omp_ordered): Return true instead of
566         false after emitting errors that the directive is not allowed in
567         pragma_stmt context.
568         (cp_parser_omp_target_update): Likewise.
569         (cp_parser_omp_cancellation_point): Change return type from void to
570         bool, return false if the directive should be ignored in pragma_stmt
571         contexts.
572         (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
573         Change return type from tree to bool, return false if the
574         directive should be ignored in pragma_stmt contexts.
575         (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
576         return their result directly.
577         (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
578         cp_parser_omp_cancellation_point returned.  Return true instead of
579         false after emitting errors that the directive is not allowed in
580         pragma_stmt context.
582 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
584         PR c++/101539
585         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
586         (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
587         (fold_builtin_is_corresponding_member, next_common_initial_seqence,
588         layout_compatible_type_p): Declare.
589         * parser.c (cp_parser_primary_expression): Handle
590         RID_IS_LAYOUT_COMPATIBLE.
591         (cp_parser_trait_expr): Likewise.
592         * cp-objcp-common.c (names_builtin_p): Likewise.
593         * constraint.cc (diagnose_trait_expr): Handle
594         CPTK_IS_LAYOUT_COMPATIBLE.
595         * decl.c (cxx_init_decl_processing): Register
596         __builtin_is_corresponding_member builtin.
597         * constexpr.c (cxx_eval_builtin_function_call): Handle
598         CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
599         * semantics.c (is_corresponding_member_union,
600         is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
601         New functions.
602         (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
603         (finish_trait_expr): Likewise.
604         * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
605         New functions.
606         * cp-gimplify.c (cp_gimplify_expr): Fold
607         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
608         (cp_fold): Likewise.
609         * tree.c (builtin_valid_in_constant_expr_p): Handle
610         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
611         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
612         CPTK_IS_LAYOUT_COMPATIBLE.
613         * class.c (remove_zero_width_bit_fields): Remove.
614         (layout_class_type): Don't call it.
616 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
618         * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
619         (cp_parser_omp_scope): New function.
620         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
621         * pt.c (tsubst_expr): Handle OMP_SCOPE.
623 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
625         * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
626         (cp_parser_omp_clause_filter): New function.
627         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
628         (OMP_MASKED_CLAUSE_MASK): Define.
629         (cp_parser_omp_masked): New function.
630         (cp_parser_omp_parallel): Handle parallel masked.
631         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
632         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
633         * pt.c (tsubst_omp_clauses): Likewise.
634         (tsubst_expr): Handle OMP_MASKED.
636 2021-08-12  Sergei Trofimovich  <siarheit@google.com>
638         PR c++/101219
639         * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
640         to construct ptrmemfunc expression instantiation.
642 2021-08-12  Tobias Burnus  <tobias@codesourcery.com>
644         * parser.c (cp_parser_omp_clause_proc_bind): Accept
645         'primary' as alias for 'master'.
647 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
649         * cp-tree.h (omp_declare_target_attr): New type.
650         (struct saved_scope): Change type of omp_declare_target_attribute
651         from int to vec<omp_declare_target_attr, va_gc> * and move it.
652         * parser.c (cp_parser_omp_declare_target): Instead of
653         incrementing scope_chain->omp_declare_target_attribute, push
654         a struct containing parser->lexer->in_omp_attribute_pragma to
655         the vector.
656         (cp_parser_omp_end_declare_target): Instead of decrementing
657         scope_chain->omp_declare_target_attribute, pop a structure
658         from it.  Diagnose mismatching declare target vs.
659         end declare target syntax.
660         * semantics.c (finish_translation_unit): Use vec_safe_length
661         and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
662         * decl2.c (cplus_decl_attributes): Use vec_safe_length
663         on scope_chain->omp_declare_target_attributes.
665 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
667         * parser.c (cp_parser_lambda_body): Add temp overrides
668         for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
669         (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
670         cp_parser_declaration_statement.
671         (cp_parser_default_argument): Add temp override for
672         parser->omp_attrs_forbidden_p.
673         (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
674         or declare variant in attribute syntax on a declaration immediately
675         following an OpenMP construct in pragma syntax.
677 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
679         PR c++/94162
680         * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
681         or for classes not in std namespace.
683 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
685         * name-lookup.c (finish_using_directive): Diagnose omp::directive
686         or omp::sequence attributes on using-directive.
688 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
690         * parser.c (cp_parser_block_declaration): Call
691         cp_parser_using_directive for C++11 attributes followed by
692         using namespace tokens.
693         (cp_parser_using_directive): Parse C++11 attributes at the start
694         of the directive rather than at the end, only parse GNU attributes
695         at the end.
697 2021-08-12  Patrick Palka  <ppalka@redhat.com>
699         PR c++/101663
700         * constexpr.c (cxx_eval_store_expression): Handle the lval=true
701         case in the early exit code path for empty stores with mismatched
702         types.
704 2021-08-11  Patrick Palka  <ppalka@redhat.com>
706         PR c++/101725
707         DR 2082
708         * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
709         * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
710         operands.
711         * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
712         reject uses of local variables in unevaluated contexts.
713         * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
714         cp_unevaluated_operand.  Use cp_walk_tree directly instead of
715         WALK_SUBTREE to avoid the goto.  Use REQUIRES_EXPR_REQS instead
716         of TREE_OPERAND directly.
718 2021-08-11  Jakub Jelinek  <jakub@redhat.com>
720         PR c++/101786
721         * decl2.c (var_defined_without_dynamic_init): Return true for
722         DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
724 2021-08-11  Patrick Palka  <ppalka@redhat.com>
726         PR c++/79501
727         * parser.c (maybe_adjust_declarator_for_dguide): New, split
728         out from ...
729         (cp_parser_init_declarator): ... here.
730         (cp_parser_member_declaration): Use it.
732 2021-08-11  Patrick Palka  <ppalka@redhat.com>
734         PR c++/89062
735         * parser.c (cp_parser_parameter_declaration_list): Don't call
736         grokdeclarator if cp_parser_error_occurred.
737         (cp_parser_parameter_declaration): Simulate an error if we see
738         the beginning of a CTAD form, i.e. if we see an opening brace
739         after the decl-specifier-seq and the type is a CTAD placeholder.
741 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
743         * parser.c (cp_parser_member_declaration): Move odsd declaration
744         before cp_parser_using_declaration call to avoid errors with
745         GCC 4.8 to 6.
747 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
749         * parser.h (struct cp_omp_declare_simd_data): Remove
750         in_omp_attribute_pragma and clauses members, add loc and attribs.
751         (struct cp_oacc_routine_data): Remove loc member, add clauses
752         member.
753         * parser.c (cp_finalize_omp_declare_simd): New function.
754         (cp_parser_handle_statement_omp_attributes): Mention in
755         function comment the function is used also for
756         attribute-declaration.
757         (cp_parser_handle_directive_omp_attributes): New function.
758         (cp_parser_statement): Don't call
759         cp_parser_handle_statement_omp_attributes if statement doesn't
760         have attribute-specifier-seq at the beginning at all or if
761         if those attributes don't appertain to the statement.
762         (cp_parser_simple_declaration): Call
763         cp_parser_handle_directive_omp_attributes and
764         cp_finalize_omp_declare_simd.
765         (cp_parser_explicit_instantiation): Likewise.
766         (cp_parser_init_declarator): Initialize prefix_attributes
767         only after parsing declarators.
768         (cp_parser_direct_declarator): Call
769         cp_parser_handle_directive_omp_attributes and
770         cp_finalize_omp_declare_simd.
771         (cp_parser_member_declaration): Likewise.
772         (cp_parser_single_declaration): Likewise.
773         (cp_parser_omp_declare_simd): Don't initialize
774         data.in_omp_attribute_pragma, instead initialize
775         data.attribs[0] and data.attribs[1].
776         (cp_finish_omp_declare_variant): Remove
777         in_omp_attribute_pragma argument, instead use
778         parser->lexer->in_omp_attribute_pragma.
779         (cp_parser_late_parsing_omp_declare_simd): Adjust
780         cp_finish_omp_declare_variant caller.  Handle attribute-syntax
781         declare simd/variant.
783 2021-08-06  Tamar Christina  <tamar.christina@arm.com>
785         * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
786         * decl.c (cxx_simulate_enum_decl): Likewise.
788 2021-08-04  Jakub Jelinek  <jakub@redhat.com>
790         PR c++/101759
791         * parser.c (cp_parser_default_argument): Temporarily override
792         parser->omp_declare_simd and parser->oacc_routine to NULL.
794 2021-08-02  Patrick Palka  <ppalka@redhat.com>
796         PR c++/100828
797         * logic.cc (formula::formula): Use emplace_back instead of
798         push_back.
799         (formula::branch): Insert a copy of m_current directly after
800         m_current instead of at the end of the list.
801         (formula::erase): Define.
802         (decompose_formula): Remove.
803         (decompose_antecedents): Remove.
804         (decompose_consequents): Remove.
805         (derive_proofs): Remove.
806         (max_problem_size): Remove.
807         (diagnose_constraint_size): Remove.
808         (subsumes_constraints_nonnull): Rewrite directly in terms of
809         decompose_clause and derive_proof, interleaving decomposition
810         with implication checking.  Remove limit on constraint complexity.
811         Use formula::erase to free the current clause before moving on to
812         the next one.
814 2021-07-31  Jason Merrill  <jason@redhat.com>
816         PR c++/96636
817         * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
818         after error.
820 2021-07-31  Jason Merrill  <jason@redhat.com>
822         * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
823         PACK_EXPANSION_PATTERN.
825 2021-07-31  Jakub Jelinek  <jakub@redhat.com>
827         * parser.c (cp_parser_declaration): Handle OpenMP directives
828         in attribute-declaration.
830 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
832         PR c++/101539
833         * cp-tree.h (enum cp_trait_kind): Add
834         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
835         (enum cp_built_in_function): Add
836         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
837         (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
838         * parser.c (cp_parser_primary_expression): Handle
839         RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
840         (cp_parser_trait_expr): Likewise.
841         * cp-objcp-common.c (names_builtin_p): Likewise.
842         * constraint.cc (diagnose_trait_expr): Handle
843         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
844         * decl.c (cxx_init_decl_processing): Register
845         __builtin_is_pointer_interconvertible_with_class builtin.
846         * constexpr.c (cxx_eval_builtin_function_call): Handle
847         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
848         * semantics.c (pointer_interconvertible_base_of_p,
849         first_nonstatic_data_member_p,
850         fold_builtin_is_pointer_inverconvertible_with_class): New functions.
851         (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
852         (finish_trait_expr): Likewise.  Formatting fix.
853         * cp-gimplify.c (cp_gimplify_expr): Fold
854         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
855         fndecl_built_in_p just once.
856         (cp_fold): Likewise.
857         * tree.c (builtin_valid_in_constant_expr_p): Handle
858         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
859         fndecl_built_in_p just once.
860         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
861         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
863 2021-07-30  Jason Merrill  <jason@redhat.com>
865         * class.c (finish_struct_anon): Improve comment.
866         * decl.c (fixup_anonymous_aggr): Reject anonymous struct
867         with bases.
869 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
871         * parser.c (cp_parser_statement): Rollback attributes not just
872         when std_attrs is non-NULL, but whenever
873         cp_parser_std_attribute_spec_seq parsed any tokens.
875 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
877         PR c++/101582
878         * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
879         declaration.
880         (cp_parser_declaration): Parse empty-declaration and
881         attribute-declaration.
882         (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
884 2021-07-28  Martin Sebor  <msebor@redhat.com>
886         * init.c: Include new header.
888 2021-07-27  Marek Polacek  <polacek@redhat.com>
890         DR 1512
891         PR c++/99701
892         * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
893         a switch.
894         * typeck.c (cp_build_binary_op): Reject ordered comparison
895         of two null pointers.
897 2021-07-26  Jakub Jelinek  <jakub@redhat.com>
899         * parser.h (struct cp_lexer): Add orphan_p member.
900         * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
901         upon restart from CPP_PRAGMA handling.  Fix up condition when a lexer
902         should be destroyed and adjust saved_tokens if it records tokens from
903         the to be destroyed lexer.
904         (cp_parser_omp_section_scan): New function.
905         (cp_parser_omp_scan_loop_body): Use it.  If
906         parser->lexer->in_omp_attribute_pragma, allow optional comma
907         after scan.
908         (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
910 2021-07-23  Jakub Jelinek  <jakub@redhat.com>
912         * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
913         * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
914         mixing of attribute and pragma syntax directives when seeing
915         omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
916         directives are followed by OpenMP pragma.
917         (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
918         the cp_parser_handle_statement_omp_attributes call.
919         (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
920         if true, set parser->omp_attrs_forbidden_p.
921         (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
922         false as disallow_omp_attrs to cp_parser_omp_structured_block.
923         (cp_parser_omp_parallel, cp_parser_omp_task): Set
924         parser->omp_attrs_forbidden_p.
926 2021-07-21  Thomas Schwinge  <thomas@codesourcery.com>
927             Joseph Myers  <joseph@codesourcery.com>
928             Cesar Philippidis  <cesar@codesourcery.com>
930         * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
931         (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
932         (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
933         * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
934         * semantics.c (finish_omp_clauses): Likewise.
936 2021-07-21  Jakub Jelinek  <jakub@redhat.com>
938         PR c++/101516
939         * semantics.c (finish_omp_reduction_clause): Also call
940         complete_type_or_else and return true if it fails.
942 2021-07-19  Iain Sandoe  <iain@sandoe.co.uk>
944         PR c++/95520
945         * coroutines.cc (struct coroutine_info): Add fields for
946         actor and destroy function decls.
947         (to_ramp): New.
948         (coro_get_ramp_function): New.
949         (coro_get_actor_function): New.
950         (coro_get_destroy_function): New.
951         (act_des_fn): Set up mapping between ramp, actor and
952         destroy functions.
953         (morph_fn_to_coro): Adjust interface to the builder for
954         helper function decls.
955         * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
956         JOIN_STR): New.
957         * mangle.c (write_encoding): Handle coroutine helpers.
958         (write_unqualified_name): Handle lambda coroutine helpers.
960 2021-07-16  Patrick Palka  <ppalka@redhat.com>
962         PR c++/101233
963         * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
964         substituting DECL_ARGUMENTS.
966 2021-07-16  Patrick Palka  <ppalka@redhat.com>
968         DR 960
969         PR c++/99664
970         * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
971         when the return types are references.
973 2021-07-16  Marek Polacek  <polacek@redhat.com>
975         * typeck2.c (check_narrowing): Don't suppress the pedantic error
976         in system headers.
978 2021-07-15  Jakub Jelinek  <jakub@redhat.com>
980         PR c++/101443
981         * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
982         operands, fold them right away to true or false.
984 2021-07-15  Jason Merrill  <jason@redhat.com>
986         PR c++/101095
987         * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
988         (cp_tree_size): Remove redundant entries.
990 2021-07-14  Patrick Palka  <ppalka@redhat.com>
992         PR c++/88252
993         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
994         * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
995         handling.
996         (redeclare_class_template): Likewise.
997         (forwarding_reference_p): Define.
998         (maybe_adjust_types_for_deduction): Use it instead.  Add 'tparms'
999         parameter.
1000         (unify_one_argument): Pass tparms to
1001         maybe_adjust_types_for_deduction.
1002         (try_one_overload): Likewise.
1003         (unify): Likewise.
1004         (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1005         handling.
1007 2021-07-14  Jason Merrill  <jason@redhat.com>
1009         * class.c (struct find_final_overrider_data): Use auto_vec.
1010         (find_final_overrider): Remove explicit release.
1011         * coroutines.cc (process_conditional): Use auto_vec.
1012         * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
1013         (cp_genericize_tree): Remove explicit release.
1014         * parser.c (cp_parser_objc_at_property_declaration): Use
1015         auto_delete_vec.
1016         * semantics.c (omp_reduction_lookup): Use auto_vec.
1018 2021-07-14  Marek Polacek  <polacek@redhat.com>
1020         PR c++/101371
1021         * constexpr.c (cxx_eval_array_reference): Create a new .object
1022         and .ctor for the non-aggregate non-scalar case too when
1023         value-initializing.
1025 2021-07-12  Patrick Palka  <ppalka@redhat.com>
1027         PR c++/79501
1028         PR c++/100983
1029         * decl.c (grokfndecl): Don't require that deduction guides are
1030         declared at namespace scope.  Check that class-scope deduction
1031         guides have the same access as the member class template.
1032         (grokdeclarator): Pretend class-scope deduction guides are static.
1033         * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1034         deduction guides.
1036 2021-07-10  Patrick Palka  <ppalka@redhat.com>
1038         PR c++/82110
1039         * init.c (build_aggr_init): Return error_mark_node if
1040         expand_aggr_init_1 returns false.
1041         (expand_default_init): Change return type to bool.  Return false
1042         on error, true on success.
1043         (expand_aggr_init_1): Likewise.
1045 2021-07-09  Jason Merrill  <jason@redhat.com>
1047         PR c++/101098
1048         * decl.c (function_requirements_equivalent_p): Only compare
1049         trailing requirements on a specialization.
1051 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1053         * coroutines.cc (build_actor_fn): Move common code to
1054         act_des_fn.
1055         (build_destroy_fn): Likewise.
1056         (act_des_fn): Build the void return here.  Ensure that the
1057         source location matches the original function.
1059 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1061         * coroutines.cc
1062         (coro_rewrite_function_body): Connect the replacement
1063         function block to the block nest correctly.
1065 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1067         PR c++/101181
1068         * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1069         add_extra_args.
1070         * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1071         * pt.c (build_extra_args): Make a copy of args.
1072         (add_extra_args): Add complain/in_decl parameters.  Enable the
1073         code for handling the case where the extra arguments are
1074         dependent.
1075         (tsubst_pack_expansion): Pass complain/in_decl to
1076         add_extra_args.
1077         (tsubst_template_args): Handle missing template arguments.
1078         (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1079         add_extra_args.
1081 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1083         PR c++/101247
1084         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1085         DECL_CONTEXT.
1087 2021-07-08  Martin Sebor  <msebor@redhat.com>
1089         PR bootstrap/101372
1090         * module.cc (identifier): Suppress warning.
1091         (module_state::read_macro_maps): Remove warning suppression.
1092         (module_state::install_macros): Ditto.
1094 2021-07-08  Marek Polacek  <polacek@redhat.com>
1096         PR c++/101087
1097         * cp-tree.h (unevaluated_p): New.
1098         * except.c (check_noexcept_r): Use it.  Don't walk into
1099         unevaluated operands.
1101 2021-07-08  Martin Sebor  <msebor@redhat.com>
1103         PR bootstrap/101374
1104         * module.cc (module_state::read_macro_maps): Temporarily disable
1105         -Warray-bounds.
1106         (module_state::install_macros): Same.
1108 2021-07-06  Martin Sebor  <msebor@redhat.com>
1110         * error.c (cp_printer):  Remove support for %G and %K.
1112 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1114         * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1115         (struct cp_omp_declare_simd_data): Likewise.
1116         * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1117         (omp_identifier): Define.
1118         * parser.c (cp_parser_skip_to_pragma_eol): Handle
1119         in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1120         (cp_parser_require_pragma_eol): Likewise.
1121         (struct cp_omp_attribute_data): New type.
1122         (cp_parser_handle_statement_omp_attributes): New function.
1123         (cp_parser_statement): Handle OpenMP directives in statement's
1124         attribute-specifier-seq.
1125         (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1126         functions.
1127         (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1128         attributes.
1129         (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1130         a comma also before the first clause.
1131         (cp_parser_omp_allocate): Likewise.
1132         (cp_parser_omp_atomic): Likewise.
1133         (cp_parser_omp_depobj): Likewise.
1134         (cp_parser_omp_flush): Likewise.
1135         (cp_parser_omp_ordered): Likewise.
1136         (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1137         into struct cp_omp_declare_simd_data.
1138         (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1139         argument.  If set, allow a comma also before match clause.
1140         (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1141         allow a comma also before the first clause.  Adjust
1142         cp_finish_omp_declare_variant caller.
1143         (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1144         a comma also before the first clause.
1145         (cp_parser_omp_declare_reduction_exprs): Likewise.
1146         (cp_parser_omp_requires): Likewise.
1147         * decl.c (initialize_predefined_identifiers): Initialize
1148         omp_identifier.
1149         * decl2.c (cplus_decl_attributes): Reject omp::directive and
1150         omp::sequence attributes.
1152 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1154         PR c/101297
1155         * parser.c (cp_parser_omp_atomic): Consume comma only if it
1156         appears before a CPP_NAME.
1158 2021-07-02  Patrick Palka  <ppalka@redhat.com>
1160         PR c++/101247
1161         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1162         use common_enclosing_class and to not depend on the TREE_TYPE
1163         of outer levels pointing to the corresponding primary template.
1165 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1167         PR c++/101194
1168         * constexpr.c (cxx_eval_array_reference): When the element type
1169         is an empty type and the corresponding element is omitted, just
1170         return an empty CONSTRUCTOR instead of attempting value
1171         initialization.
1173 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1175         PR c++/96204
1176         * pt.c (finish_template_variable): Pass the partially
1177         instantiated template and its args to instantiate_template.
1178         (instantiate_class_template_1): No need to call
1179         push_nested_class and pop_nested_class around the call to
1180         most_specialized_partial_spec.
1181         (instantiate_template_1): Pass the partially instantiated
1182         template to lookup_template_variable.
1183         (most_specialized_partial_spec):  Use push_access_scope_guard
1184         to set the access scope appropriately.  Use
1185         deferring_access_check_sentinel to force access to get checked
1186         immediately.
1187         (instantiate_decl): Just pass the VAR_DECL to
1188         most_specialized_partial_spec.
1190 2021-06-30  Patrick Palka  <ppalka@redhat.com>
1192         * constraint.cc (get_normalized_constraints_from_decl): Use
1193         push_access_scope_guard instead of push_nested_class_guard.
1194         * cp-tree.h (struct push_nested_class_guard): Replace with ...
1195         (struct push_access_scope_guard): ... this.
1196         * pt.c (push_access_scope): When the argument corresponds to
1197         a class type, push the class instead of its context.
1198         (pop_access_scope): Adjust accordingly.
1200 2021-06-30  Marek Polacek  <polacek@redhat.com>
1202         PR c++/100975
1203         DR 2397
1204         * decl.c (create_array_type_for_decl): Allow array of auto.
1206 2021-06-29  Jason Merrill  <jason@redhat.com>
1208         * pt.c (instantiate_decl): Only consider partial specializations of
1209         actual variable templates.
1211 2021-06-26  Patrick Palka  <ppalka@redhat.com>
1213         PR c++/96204
1214         * pt.c (instantiate_class_template_1): Enter the scope of the
1215         type when calling most_specialized_partial_spec.
1217 2021-06-26  Jason Merrill  <jason@redhat.com>
1219         PR c++/101040
1220         PR c++/97566
1221         * class.c (is_empty_field): Handle null argument.
1222         * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1223         for empty field.
1225 2021-06-26  Marek Polacek  <polacek@redhat.com>
1227         PR c++/100752
1228         * parser.c (cp_parser_declarator): Pass flags down to
1229         cp_parser_declarator.  Also pass static_p/member_p.
1231 2021-06-25  Martin Sebor  <msebor@redhat.com>
1233         * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1234         with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1235         nothing if not necessary.
1236         (set_up_extended_ref_temp): Same.
1237         * class.c (layout_class_type): Same.
1238         * constraint.cc (constraint_satisfaction_value): Same.
1239         * coroutines.cc (finish_co_await_expr): Same.
1240         (finish_co_yield_expr): Same.
1241         (finish_co_return_stmt): Same.
1242         (build_actor_fn): Same.
1243         (coro_rewrite_function_body): Same.
1244         (morph_fn_to_coro): Same.
1245         * cp-gimplify.c (genericize_eh_spec_block): Same.
1246         (gimplify_expr_stmt): Same.
1247         (cp_genericize_r): Same.
1248         (cp_fold): Same.
1249         * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1250         * cvt.c (cp_fold_convert): Same.
1251         (convert_to_void): Same.
1252         * decl.c (wrapup_namespace_globals): Same.
1253         (grokdeclarator): Same.
1254         (finish_function): Same.
1255         (require_deduced_type): Same.
1256         * decl2.c (no_linkage_error): Same.
1257         (c_parse_final_cleanups): Same.
1258         * except.c (expand_end_catch_block): Same.
1259         * init.c (build_new_1): Same.
1260         (build_new): Same.
1261         (build_vec_delete_1): Same.
1262         (build_vec_init): Same.
1263         (build_delete): Same.
1264         * method.c (defaultable_fn_check): Same.
1265         * parser.c (cp_parser_fold_expression): Same.
1266         (cp_parser_primary_expression): Same.
1267         * pt.c (push_tinst_level_loc): Same.
1268         (tsubst_copy): Same.
1269         (tsubst_omp_udr): Same.
1270         (tsubst_copy_and_build): Same.
1271         * rtti.c (build_if_nonnull): Same.
1272         * semantics.c (maybe_convert_cond): Same.
1273         (finish_return_stmt): Same.
1274         (finish_parenthesized_expr): Same.
1275         (cp_check_omp_declare_reduction): Same.
1276         * tree.c (build_cplus_array_type): Same.
1277         * typeck.c (build_ptrmemfunc_access_expr): Same.
1278         (cp_build_indirect_ref_1): Same.
1279         (cp_build_function_call_vec): Same.
1280         (warn_for_null_address): Same.
1281         (cp_build_binary_op): Same.
1282         (unary_complex_lvalue): Same.
1283         (cp_build_modify_expr): Same.
1284         (build_x_modify_expr): Same.
1285         (convert_for_assignment): Same.
1287 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1289         PR c++/98832
1290         * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1292 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1294         PR c++/101182
1295         * constraint.cc (evaluate_requires_expr): Adjust function comment.
1296         * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1297         (cp_fold) <case REQUIRES_EXPR>: ... here.
1299 2021-06-24  Jakub Jelinek  <jakub@redhat.com>
1301         * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1302         C_ORT_OMP for clauses on target construct.
1303         (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1304         (cp_parser_omp_target): For non-combined target add
1305         map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION.  Pass
1306         C_ORT_OMP_TARGET to finish_omp_clauses.
1307         * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1308         for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1309         never present on C_ORT_*DECLARE_SIMD.
1310         (handle_omp_array_sections): Likewise.
1311         (finish_omp_clauses): Likewise.  Handle OMP_CLAUSE_IN_REDUCTION
1312         on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1313         corresponding map clauses.
1314         * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1315         clauses on target construct.
1317 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1319         PR c++/101174
1320         * pt.c (push_access_scope): For artificial deduction guides,
1321         set the access scope to that of the constructor.
1322         (pop_access_scope): Likewise.
1323         (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1325 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1327         PR c++/86439
1328         * call.c (print_error_for_call_failure): Constify 'args' parameter.
1329         (perform_dguide_overload_resolution): Define.
1330         * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1331         * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1332         instead of build_new_function_call.  Don't use tf_decltype or
1333         set cp_unevaluated_operand.  Remove unnecessary NULL_TREE tests.
1335 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1337         PR c++/67302
1338         * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1339         sooner, before the NRVO handling.
1341 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1343         PR c++/80431
1344         * tree.c (bot_replace): Use convert_to_base to build the
1345         conversion to the (morally) virtual base.
1347 2021-06-21  Jakub Jelinek  <jakub@redhat.com>
1349         PR inline-asm/100785
1350         * typeck.c (cxx_mark_addressable): Diagnose trying to make
1351         bit-fields addressable.
1353 2021-06-17  Jason Merrill  <jason@redhat.com>
1355         PR c++/101106
1356         * decl.c (duplicate_decls): Make 'deleted after first declaration'
1357         pedwarn on by default.
1359 2021-06-17  Jason Merrill  <jason@redhat.com>
1361         PR c++/101029
1362         * init.c (build_vec_init): Preserve the type of base.
1364 2021-06-16  Jason Merrill  <jason@redhat.com>
1366         PR c++/101078
1367         PR c++/91706
1368         * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1370 2021-06-15  Robin Dapp  <rdapp@linux.ibm.com>
1372         * decl.c (duplicate_decls): Likewise.
1374 2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
1376         PR c/100913
1377         * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1378         var in the error case.
1380 2021-06-13  Trevor Saunders  <tbsaunde@tbsaunde.org>
1382         * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1383         with range based for.
1384         (cxx_eval_store_expression): Likewise.
1385         (cxx_eval_loop_expr): Likewise.
1386         * decl.c (wrapup_namespace_globals): Likewise.
1387         (cp_finish_decl): Likewise.
1388         (cxx_simulate_enum_decl): Likewise.
1389         * parser.c (cp_parser_postfix_expression): Likewise.
1391 2021-06-12  Jason Merrill  <jason@redhat.com>
1393         PR c++/101029
1394         * init.c (build_vec_init): Shortcut [0] case.
1396 2021-06-12  Jason Merrill  <jason@redhat.com>
1398         * pt.c (lookup_template_class_1): Shortcut current_class_type.
1400 2021-06-11  Patrick Palka  <ppalka@redhat.com>
1402         DR 1227
1403         PR c++/96560
1404         * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1405         TYPE_ARG_TYPES in forward order while short circuiting
1406         appropriately.  Adjust formatting.
1408 2021-06-11  Jakub Jelinek  <jakub@redhat.com>
1410         PR c++/100974
1411         * cp-tree.h (struct saved_scope): Add consteval_if_p
1412         member.  Formatting fix for the discarded_stmt comment.
1413         (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1414         * parser.c (cp_parser_lambda_expression): Temporarily disable
1415         in_consteval_if_p when parsing lambda body.
1416         (cp_parser_selection_statement): Parse consteval if.
1417         * decl.c (struct named_label_entry): Add in_consteval_if member.
1418         (level_for_consteval_if): New function.
1419         (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1420         consteval if.
1421         * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1422         why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1423         for !ctx->manifestly_const_eval.
1424         (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1425         condition as if it was __builtin_is_constant_evaluated call.
1426         (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1427         recurse on both branches.
1428         * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1429         as the else branch.
1430         * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1431         Temporarily set in_consteval_if_p when recursing on
1432         IF_STMT_CONSTEVAL_P then branch.
1433         (tsubst_lambda_expr): Temporarily disable
1434         in_consteval_if_p when instantiating lambda body.
1435         * call.c (immediate_invocation_p): Return false when
1436         in_consteval_if_p.
1438 2021-06-11  Marek Polacek  <polacek@redhat.com>
1440         PR c++/100995
1441         * constexpr.c (maybe_constexpr_fn): New.
1442         * cp-tree.h (maybe_constexpr_fn): Declare.
1443         * semantics.c (find_std_constant_evaluated_r): New.
1444         (maybe_warn_for_constant_evaluated): New.
1445         (finish_if_stmt_cond): Call it.
1447 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1449         PR c++/67829
1450         * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1451         the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1452         a template template parameter, adjust to the
1453         TEMPLATE_TEMPLATE_PARAMETER before falling through.
1455 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1457         PR c++/100946
1458         * constraint.cc (normalize_placeholder_type_constraints): When
1459         normalizing a non-templated return-type-requirement, add a dummy
1460         level to initial_parms.
1462 2021-06-08  Marek Polacek  <polacek@redhat.com>
1464         PR c++/100065
1465         * decl.c (grokdeclarator): Store a value-dependent
1466         explicit-specifier even for deduction guides.
1468 2021-06-08  Jason Merrill  <jason@redhat.com>
1470         * parser.c (cp_parser_string_literal): Adjust diagnostic.
1472 2021-06-08  Jason Merrill  <jason@redhat.com>
1474         PR c++/100963
1475         * call.c (perfect_conversion_p): Check check_narrowing.
1477 2021-06-08  Jason Merrill  <jason@redhat.com>
1479         PR c++/91706
1480         * name-lookup.c (get_class_binding): Keep a BASELINK.
1481         (set_inherited_value_binding_p): Adjust.
1482         * lambda.c (is_lambda_ignored_entity): Adjust.
1483         * pt.c (lookup_template_function): Copy a BASELINK before
1484         modifying it.
1486 2021-06-08  Jason Merrill  <jason@redhat.com>
1488         PR c++/91706
1489         * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1491 2021-06-08  Jason Merrill  <jason@redhat.com>
1493         * module.cc (duplicate_hash::hash): Comment out.
1494         (trees_in::tree_value): Adjust loop counter.
1496 2021-06-08  Jason Merrill  <jason@redhat.com>
1498         PR c++/100102
1499         * init.c (build_offset_ref): Return the BASELINK for a static
1500         member function.
1502 2021-06-07  Patrick Palka  <ppalka@redhat.com>
1504         PR c++/100918
1505         * parser.c (cp_parser_lookup_name): Check access of the lookup
1506         result before we potentially adjust an injected-class-name to
1507         its TEMPLATE_DECL.
1509 2021-06-06  Jakub Jelinek  <jakub@redhat.com>
1511         PR c/100902
1512         * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1513         even when target is combined with other constructs.
1515 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1517         PR c++/100893
1518         * pt.c (convert_template_argument): Strip top-level cv-quals
1519         on the substituted type of a non-type template parameter.
1521 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1523         PR c++/100102
1524         * pt.c (tsubst_function_decl): Remove old code for reducing
1525         args when it has excess levels.
1527 2021-06-04  Jakub Jelinek  <jakub@redhat.com>
1529         PR c++/100872
1530         * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1531         ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1532         to the start.
1534 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1536         PR c++/100592
1537         * decl.c (make_typename_type): After calling
1538         lookup_template_class, adjust the result to its TYPE_NAME and
1539         then consider the tf_keep_type_decl flag.
1541 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1543         PR c++/100862
1544         * pt.c (set_current_access_from_decl): Move to ...
1545         * class.c (set_current_access_from_decl): ... here.
1546         (handle_using_decl): Use it to propagate the access of the
1547         using-enum decl to the copy of the imported enumerator.
1548         * cp-tree.h (set_current_access_from_decl): Declare.
1549         * decl.c (build_enumerator): Simplify using make_temp_override
1550         and set_current_access_from_decl.
1552 2021-06-03  Jakub Jelinek  <jakub@redhat.com>
1554         PR c++/100859
1555         * semantics.c (handle_omp_array_sections_1): For
1556         OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1557         finish_non_static_data_member and allow this as base.
1558         (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1559         after depend only cases.  Let this be diagnosed by !lvalue_p
1560         case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1561         assert.
1562         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1564 2021-06-02  Jason Merrill  <jason@redhat.com>
1566         PR c++/100838
1567         * call.c (convert_like_internal): Clear tf_no_cleanup when
1568         recursing.
1569         (build_user_type_conversion_1): Only add ck_rvalue if
1570         LOOKUP_ONLYCONVERTING.
1572 2021-06-01  Patrick Palka  <ppalka@redhat.com>
1574         PR c++/65816
1575         * init.c (expand_aggr_init_1): Check
1576         type_has_non_user_provided_default_constructor instead of
1577         type_has_user_provided_constructor.
1579 2021-06-01  Jason Merrill  <jason@redhat.com>
1581         PR c++/91859
1582         * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1583         for destroying delete.
1584         * init.c (build_delete): Don't clobber before destroying delete.
1586 2021-06-01  Jason Merrill  <jason@redhat.com>
1588         PR c++/94492
1589         * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1591 2021-05-31  Richard Biener  <rguenther@suse.de>
1593         PR c++/88601
1594         * cp-objcp-common.c (names_builtin_p): Handle
1595         RID_BUILTIN_SHUFFLEVECTOR.
1596         * cp-tree.h (build_x_shufflevector): Declare.
1597         * parser.c (cp_parser_postfix_expression): Handle
1598         RID_BUILTIN_SHUFFLEVECTOR.
1599         * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1600         * typeck.c (build_x_shufflevector): Build either a lowered
1601         VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1602         internal function IFN_SHUFFLEVECTOR.
1604 2021-05-28  Jason Merrill  <jason@redhat.com>
1606         * constexpr.c (build_data_member_initialization): Use tsi_range.
1607         (build_constexpr_constructor_member_initializers): Likewise.
1608         (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1609         (potential_constant_expression_1): Likewise.
1610         * coroutines.cc (await_statement_expander): Likewise.
1611         (await_statement_walker): Likewise.
1612         * module.cc (trees_out::core_vals): Likewise.
1613         * pt.c (tsubst_expr): Likewise.
1614         * semantics.c (set_cleanup_locs): Likewise.
1616 2021-05-28  Jason Merrill  <jason@redhat.com>
1618         PR c++/100797
1619         PR c++/95719
1620         * call.c (build_over_call): Adjust base_binfo in
1621         resolves_to_fixed_type_p case.
1623 2021-05-28  Jakub Jelinek  <jakub@redhat.com>
1625         PR middle-end/99928
1626         * semantics.c (handle_omp_array_sections): Copy
1627         OMP_CLAUSE_MAP_IMPLICIT.
1628         (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1629         marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT.  Add
1630         map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1631         maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1632         present too.  For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1633         if present in map_head, map_field_head or map_firstprivate_head
1634         bitmaps.
1636 2021-05-28  Tobias Burnus  <tobias@codesourcery.com>
1638         * parser.c (cp_parser_omp_clause_affinity): New.
1639         (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1640         cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1641         clause.
1642         * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1643         finish_omp_clauses): Likewise.
1645 2021-05-27  Matthias Kretz  <kretz@kde.org>
1647         PR c++/100716
1648         * error.c (dump_template_bindings): Include code to print
1649         "[with" and ']', conditional on whether anything is printed at
1650         all. This is tied to whether a semicolon is needed to separate
1651         multiple template parameters. If the template argument repeats
1652         the template parameter (T = T), then skip the parameter.
1653         (dump_substitution): Moved code to print "[with" and ']' to
1654         dump_template_bindings.
1655         (dump_function_decl): Partial revert of PR50828, which masked
1656         TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1657         TFF_TEMPLATE_NAME is masked for the scope of the function and
1658         only carries through to dump_function_name.
1659         (dump_function_name): Avoid calling dump_template_parms if
1660         TFF_TEMPLATE_NAME is set.
1662 2021-05-27  Matthias Kretz  <kretz@kde.org>
1664         PR c++/100763
1665         * error.c: Call dump_scope when printing a typedef.
1667 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1669         PR c++/99893
1670         * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1672 2021-05-27  Jason Merrill  <jason@redhat.com>
1674         PR c++/86355
1675         * pt.c (use_pack_expansion_extra_args_p): Don't compare
1676         args from the same argument pack.
1678 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1680         DR 1315
1681         PR c++/67593
1682         PR c++/96555
1683         * pt.c (process_partial_specialization): Don't error on a
1684         non-simple non-type template argument that involves template
1685         parameters.
1686         (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1687         MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1689 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1691         PR c++/100502
1692         * typeck.c (finish_class_member_access_expr): Disable ahead
1693         of time access checking during the member lookup.
1695 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1697         PR c++/100368
1698         * tree.c (build_target_expr_with_type): Don't call force_rvalue
1699         on CALL_EXPR initializer.  Simplify now that bot_manip is no
1700         longer a caller.
1701         (bot_manip): Use force_target_expr instead of
1702         build_target_expr_with_type.
1704 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1706         PR c++/97420
1707         * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1708         (fnptr_conv_p): Don't call non_reference.  Use INDIRECT_TYPE_P
1709         instead of TYPE_PTR_P.
1710         * pt.c (convert_nontype_argument_function): Look through
1711         implicit INDIRECT_REFs before calling strip_fnptr_conv.
1713 2021-05-25  Jakub Jelinek  <jakub@redhat.com>
1715         PR c++/100666
1716         * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1717         and side-effects, temporarily disable -Wunused-result warning when
1718         building COMPOUND_EXPR.
1720 2021-05-21  Jakub Jelinek  <jakub@redhat.com>
1722         PR middle-end/99928
1723         * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1724         OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't error
1725         if a decl is mentioned both in map clause and in such firstprivate
1726         clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1728 2021-05-20  Jason Merrill  <jason@redhat.com>
1730         * call.c (reference_binding): Check for designator.
1731         (implicit_conversion_1, build_special_member_call): Likewise.
1732         * decl.c (reshape_init_r): Likewise.
1733         * pt.c (do_class_deduction): Likewise.
1734         * typeck2.c (digest_init_r): Likewise.
1736 2021-05-20  Jason Merrill  <jason@redhat.com>
1738         PR c++/100489
1739         * decl.c (reshape_init_class): Handle designator for
1740         member of anonymous aggregate here.
1741         * typeck2.c (process_init_constructor_record): Not here.
1743 2021-05-20  Jonathan Wakely  <jwakely@redhat.com>
1745         * call.c (maybe_warn_array_conv): Use new warning option.
1746         * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1747         * error.c (maybe_warn_cpp0x): Likewise.
1748         * parser.c (cp_parser_primary_expression)
1749         (cp_parser_unqualified_id)
1750         (cp_parser_pseudo_destructor_name)
1751         (cp_parser_lambda_introducer)
1752         (cp_parser_lambda_declarator_opt)
1753         (cp_parser_selection_statement)
1754         (cp_parser_init_statement)
1755         (cp_parser_decomposition_declaration)
1756         (cp_parser_function_specifier_opt)
1757         (cp_parser_static_assert)
1758         (cp_parser_namespace_definition)
1759         (cp_parser_using_declaration)
1760         (cp_parser_asm_definition)
1761         (cp_parser_ctor_initializer_opt_and_function_body)
1762         (cp_parser_initializer_list)
1763         (cp_parser_type_parameter_key)
1764         (cp_parser_member_declaration)
1765         (cp_parser_try_block)
1766         (cp_parser_std_attribute_spec): Likewise.
1767         * pt.c (check_template_variable): Likewise.
1769 2021-05-20  Jason Merrill  <jason@redhat.com>
1771         PR c++/100634
1772         * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1774 2021-05-20  Jason Merrill  <jason@redhat.com>
1776         PR c++/100659
1777         * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1779 2021-05-19  Jason Merrill  <jason@redhat.com>
1781         PR c++/100367
1782         PR c++/96299
1783         * method.c (genericize_spaceship): Use fold_build2 for scalar
1784         operands.
1786 2021-05-19  Jason Merrill  <jason@redhat.com>
1788         * pt.c (build_deduction_guide): Treat the implicit deduction guide
1789         as a member of the class.
1791 2021-05-19  Marek Polacek  <polacek@redhat.com>
1793         PR c++/100596
1794         * cp-tree.h (any_non_type_attribute_p): Remove.
1795         * decl.c (grokdeclarator): Turn an error into a warning and only
1796         warn for standard attributes.
1797         * decl2.c (any_non_type_attribute_p): Remove.
1798         * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1799         into a warning and only warn for standard attributes.
1800         (cp_parser_member_declaration): Likewise.
1802 2021-05-19  Martin Liska  <mliska@suse.cz>
1804         PR testsuite/100658
1805         * mangle.c (write_encoding): Fix typos.
1807 2021-05-19  Jakub Jelinek  <jakub@redhat.com>
1809         PR middle-end/99928
1810         * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1811         master when combined with taskloop.
1812         (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1813         parallel master when not combined with taskloop.
1815 2021-05-19  Jason Merrill  <jason@redhat.com>
1817         PR c++/100261
1818         * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1820 2021-05-19  Jason Merrill  <jason@redhat.com>
1822         PR c++/100372
1823         * tree.c (strip_typedefs): Only look at the pattern of a
1824         TYPE_PACK_EXPANSION if it's a type.
1826 2021-05-18  Marek Polacek  <polacek@redhat.com>
1828         * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1829         * constraint.cc (contains_wildcard_p): Likewise.
1830         (get_template_head_requirements): Likewise.
1831         (check_constrained_friend): Likewise.
1832         (subsumes_constraints): Likewise.
1833         * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1834         (push_void_library_fn): Likewise.
1835         (get_pattern_parm): Likewise.
1836         (get_template_parms_at_level): Likewise.
1837         (lambda_return_type): Likewise.
1838         (get_template_head_requirements): Likewise.
1839         (check_constrained_friend): Likewise.
1840         (subsumes_constraints): Likewise.
1841         * decl.c (push_void_library_fn): Likewise.
1842         * lambda.c (lambda_return_type): Likewise.
1843         * pt.c (get_template_parms_at_level): Likewise.
1844         (get_pattern_parm): Likewise.
1846 2021-05-18  Jason Merrill  <jason@redhat.com>
1848         PR c++/100644
1849         * call.c (perfect_candidate_p): An implicitly deleted move
1850         is not perfect.
1852 2021-05-18  Andreas Krebbel  <krebbel@linux.ibm.com>
1854         PR c++/100281
1855         * cvt.c (cp_convert_to_pointer): Use the size of the target
1856         pointer type.
1857         * tree.c (cp_build_reference_type): Call
1858         cp_build_reference_type_for_mode with VOIDmode.
1859         (cp_build_reference_type_for_mode): Rename from
1860         cp_build_reference_type.  Add MODE argument and invoke
1861         build_reference_type_for_mode.
1862         (strip_typedefs): Use build_pointer_type_for_mode and
1863         cp_build_reference_type_for_mode for pointers and references.
1865 2021-05-17  Jonathan Wakely  <jwakely@redhat.com>
1867         PR c++/100635
1868         * call.c (convert_like_internal): Print different diagnostic if
1869         the lvalue reference is const.
1871 2021-05-14  Jason Merrill  <jason@redhat.com>
1873         PR c++/95870
1874         * pt.c (enclosing_instantiation_of): Just compare
1875         DECL_SOURCE_LOCATION.
1876         (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1878 2021-05-14  Marek Polacek  <polacek@redhat.com>
1879             Jason Merrill  <jason@redhat.com>
1881         PR c++/99032
1882         * cp-tree.h (any_non_type_attribute_p): Declare.
1883         * decl.c (grokdeclarator): Diagnose when an attribute appertains to
1884         a friend declaration that is not a definition.
1885         * decl2.c (any_non_type_attribute_p): New.
1886         * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
1887         in the middle of decl-specifiers.
1888         (cp_parser_elaborated_type_specifier): Diagnose when an attribute
1889         appertains to a friend declaration that is not a definition.
1890         (cp_parser_member_declaration): Likewise.
1892 2021-05-12  Marek Polacek  <polacek@redhat.com>
1894         * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1895         sentinel.
1897 2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>
1899         * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1900         'close'.
1902 2021-05-11  Jason Merrill  <jason@redhat.com>
1904         PR c++/100517
1905         * typeck.c (build_reinterpret_cast_1): Check intype on
1906         cast to vector.
1908 2021-05-11  Patrick Palka  <ppalka@redhat.com>
1910         PR c++/51577
1911         * name-lookup.c (maybe_save_operator_binding): Unconditionally
1912         enable for all function templates, not just generic lambdas.
1913         Handle compound-assignment operator expressions.
1914         * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
1915         in the type-dependent case.
1916         (build_x_modify_expr): Likewise.  Move declaration of 'op' closer
1917         to its first use.
1919 2021-05-11  Patrick Palka  <ppalka@redhat.com>
1921         PR c++/100138
1922         * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1923         (satisfy_atom): Set up iloc_sentinel before calling
1924         cxx_constant_value.
1925         * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
1926         expansion, carry over PACK_EXPANSION_LOCAL_P and
1927         PACK_EXPANSION_SIZEOF_P from the original pack expansion.
1929 2021-05-10  Richard Biener  <rguenther@suse.de>
1931         PR middle-end/100464
1932         PR c++/100468
1933         * call.c (set_up_extended_ref_temp): Mark the temporary
1934         addressable if the TARGET_EXPR was.
1936 2021-05-10  Martin Liska  <mliska@suse.cz>
1938         * decl.c (duplicate_decls): Use startswith
1939         function instead of strncmp.
1940         (cxx_builtin_function): Likewise.
1941         (omp_declare_variant_finalize_one): Likewise.
1942         (grokfndecl): Likewise.
1943         * error.c (dump_decl_name): Likewise.
1944         * mangle.c (find_decomp_unqualified_name): Likewise.
1945         (write_guarded_var_name): Likewise.
1946         (decl_tls_wrapper_p): Likewise.
1947         * parser.c (cp_parser_simple_type_specifier): Likewise.
1948         (cp_parser_tx_qualifier_opt): Likewise.
1949         * pt.c (template_parm_object_p): Likewise.
1950         (dguide_name_p): Likewise.
1952 2021-05-10  Martin Liska  <mliska@suse.cz>
1954         PR c++/99616
1955         * decl.c (grokdeclarator): Remove redundant NULL check.
1957 2021-05-07  Jason Merrill  <jason@redhat.com>
1959         * tree.c (rvalue): Assert expr is not a class lvalue.
1961 2021-05-07  Jason Merrill  <jason@redhat.com>
1963         * cp-tree.h (build_stub_object): Declare.
1964         * method.c (build_stub_object): No longer static.
1965         * call.c (can_convert): Use it.
1966         * tree.c (build_dummy_object): Adjust comment.
1967         * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
1968         TARGET_EXPR.
1970 2021-05-07  Jason Merrill  <jason@redhat.com>
1972         * coroutines.cc (build_co_await): Don't call 'rvalue'.
1973         (flatten_await_stmt): Simplify initialization.
1974         (morph_fn_to_coro): Change 'rvalue' to 'move'.  Simplify.
1976 2021-05-04  Tobias Burnus  <tobias@codesourcery.com>
1978         * semantics.c (finish_omp_reduction_clause): Accept float + complex
1979         for || and && reductions.
1981 2021-05-03  Patrick Palka  <ppalka@redhat.com>
1983         PR c++/100362
1984         * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1985         and popclass when parsing the base-clause that were removed in
1986         r11-6815.
1988 2021-05-03  Patrick Palka  <ppalka@redhat.com>
1990         PR c++/68942
1991         PR c++/100344
1992         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1993         only when the callee is a FUNCTION_DECL.
1995 2021-05-03  Marek Polacek  <polacek@redhat.com>
1997         PR c++/100055
1998         * decl.c (grokfndecl): Check current_template_parms.
2000 2021-05-03  Marek Polacek  <polacek@redhat.com>
2002         DR 1312
2003         * constexpr.c (cxx_eval_constant_expression): Don't check
2004         integer_zerop.
2006 2021-05-01  Jason Merrill  <jason@redhat.com>
2008         * cp-tree.h (class ovl_iterator): Allow copying.  Add op==.
2009         (class ovl_range, class lkp_range): New.
2010         * call.c (build_op_call_1, add_candidates): Use them.
2011         (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
2012         (has_trivial_copy_p): Likewise.
2013         * class.c (handle_using_decl, get_basefndecls): Likewise.
2014         (maybe_warn_about_overly_private_class): Likewise.
2015         (warn_hidden, add_implicitly_declared_members): Likewise.
2016         (check_methods, clone_constructors_and_destructors): Likewise.
2017         (type_has_user_nondefault_constructor): Likewise.
2019 2021-04-29  Jason Merrill  <jason@redhat.com>
2021         * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
2022         don't find a field.
2024 2021-04-29  Jason Merrill  <jason@redhat.com>
2026         PR c++/51344
2027         * decl2.c (grokfield): Call cplus_decl_attributes for friend.
2028         (save_template_attributes): Use chainon.
2029         * friend.c (do_friend): Remove attrlist parm.
2030         * cp-tree.h (do_friend): Adjust.
2031         * class.c (add_implicitly_declared_members): Adjust.
2032         * decl.c (grokdeclarator): Adjust.
2033         * pt.c (apply_late_template_attributes): Optimize.
2035 2021-04-29  Jason Merrill  <jason@redhat.com>
2037         PR c++/97974
2038         * class.c (finish_struct_anon_r): Drop complain parm.
2039         Remove non-field diagnostic.
2040         (finish_struct_anon): Adjust.
2041         * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2043 2021-04-29  Jason Merrill  <jason@redhat.com>
2045         * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2046         * parser.c (cp_parser_constant_expression): Change
2047         allow_non_constant_p to int.  Use cp_evaluated.
2048         (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2049         * semantics.c (finish_id_expression_1): Don't mess with
2050         cp_unevaluated_operand here.
2052 2021-04-29  Jason Merrill  <jason@redhat.com>
2054         * cp-tree.h: Clarify comments.
2055         * pt.c (get_template_parm_object): Add assert.
2056         * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2057         * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2058         * typeck2.c (store_init_value): Likewise.
2060 2021-04-29  Patrick Palka  <ppalka@redhat.com>
2062         PR c++/68942
2063         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2064         set tf_conv during the initial substitution into the function.
2066 2021-04-29  Jakub Jelinek  <jakub@redhat.com>
2068         PR c++/100319
2069         * semantics.c (finish_omp_clauses): Fix up check that variable
2070         mentioned in detach clause doesn't appear in data-sharing clauses.
2072 2021-04-28  Jakub Jelinek  <jakub@redhat.com>
2074         * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2076 2021-04-27  Jason Merrill  <jason@redhat.com>
2078         PR c++/92145
2079         * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2080         of operator=.
2082 2021-04-27  Patrick Palka  <ppalka@redhat.com>
2084         PR c++/88580
2085         * pt.c (tsubst_initializer_list): Correctly handle the case
2086         where an argument inside a base initializer pack expansion is
2087         itself a pack expansion.
2089 2021-04-26  Patrick Palka  <ppalka@redhat.com>
2091         PR c++/100209
2092         * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2093         object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2094         with a negative offset into one whose offset is nonnegative
2095         before calling cxx_fold_indirect_ref_1.
2097 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2099         PR c++/89565
2100         PR c++/93383
2101         PR c++/95291
2102         PR c++/99200
2103         PR c++/99683
2104         * pt.c (do_class_deduction): Punt if the initializer is
2105         type-dependent.
2107 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2109         PR c++/87709
2110         * parser.c (cp_parser_type_id_1): If we see a template
2111         placeholder, first try simulating an error before issuing
2112         a real error.
2114 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2116         PR c++/98767
2117         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2118         Adjust parameter list loop to iterate over 'types' instead of
2119         'args'.  Output the trailing '...' for a variadic function.
2120         Remove PARM_DECL support.
2121         (pp_cxx_requires_expr): Pretty print the parameter list directly
2122         instead of going through pp_cxx_parameter_declaration_clause.
2124 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2126         DR 2374
2127         * decl.c (is_direct_enum_init): Check the implicit
2128         convertibility requirement added by CWG 2374.
2130 2021-04-23  Martin Liska  <mliska@suse.cz>
2132         * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2133         * lex.c (init_operators): Remove run-time check.
2135 2021-04-22  Marek Polacek  <polacek@redhat.com>
2137         PR c++/100161
2138         * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2139         op1 separately for value- or type-dependence.
2141 2021-04-21  Marek Polacek  <polacek@redhat.com>
2143         PR c++/96380
2144         * parser.c (cp_parser_enum_specifier): Don't allow defining
2145         types in enum-base.
2147 2021-04-21  Martin Liska  <mliska@suse.cz>
2149         Revert:
2150         2021-04-21  Martin Liska  <mliska@suse.cz>
2152         * error.c (dump_decl): Use flags in dump_generic_node call.
2154 2021-04-21  Martin Liska  <mliska@suse.cz>
2156         * error.c (dump_decl): Use flags in dump_generic_node call.
2158 2021-04-21  Martin Liska  <mliska@suse.cz>
2160         * error.c (dump_decl): Support anonymous labels.
2162 2021-04-20  Jason Merrill  <jason@redhat.com>
2164         PR c++/100109
2165         * pt.c (find_parameter_packs_r): Look into enum initializers.
2167 2021-04-19  Marek Polacek  <polacek@redhat.com>
2169         PR c++/97536
2170         * decl.c (grokvardecl): Given an error when a concept is not defined
2171         at namespace scope.
2173 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2175         PR c++/100111
2176         * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2177         for empty classes into *valp when types don't match even when *valp
2178         is NULL.
2180 2021-04-16  Marek Polacek  <polacek@redhat.com>
2182         PR c++/99803
2183         * decl.c (make_typename_type): Give an error and return when
2184         name is is_overloaded_fn.
2185         * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2186         before calling make_typename_type.
2188 2021-04-16  Patrick Palka  <ppalka@redhat.com>
2190         PR c++/99700
2191         * constexpr.c (reduced_constant_expression_p): For array
2192         CONSTRUCTORs, use a dedicated loop that additionally verifies
2193         the CONSTRUCTOR spans the entire array.
2195 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2197         PR c++/99850
2198         * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2199         If lambda_p, return pce_ok instead of pce_maybe_postfix.
2201 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2203         PR c++/99833
2204         * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2205         binding, add to data.internal also all corresponding structured
2206         binding decls.
2208 2021-04-16  Jason Merrill  <jason@redhat.com>
2210         PR c++/100079
2211         * cp-tree.h (first_field): Declare.
2212         * mangle.c (range_expr_nelts): New.
2213         (write_expression): Improve class NTTP mangling.
2214         * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2215         * tree.c (zero_init_expr_p): Improve class NTTP handling.
2216         * decl.c: Adjust comment.
2218 2021-04-15  Jason Merrill  <jason@redhat.com>
2220         PR c++/80456
2221         * call.c (build_new_method_call_1): Check again for side-effects
2222         with a volatile object.
2224 2021-04-15  Jason Merrill  <jason@redhat.com>
2226         PR c++/100101
2227         PR c++/99583
2228         * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2229         TYPE_RAISES_EXCEPTIONS here.
2230         * tree.c (cp_walk_subtrees): Not here.
2232 2021-04-15  Jason Merrill  <jason@redhat.com>
2234         PR c++/100091
2235         PR c++/99478
2236         * parser.c (cp_parser_default_type_template_argument): Set
2237         parser->local_variables_forbidden_p.
2239 2021-04-15  Richard Sandiford  <richard.sandiford@arm.com>
2241         PR c++/98852
2242         * typeck.c (merge_type_attributes_from): New function.
2243         (cp_common_type): Use it for vector types.
2245 2021-04-14  Jason Merrill  <jason@redhat.com>
2247         PR c++/100078
2248         PR c++/93085
2249         * pt.c (uses_outer_template_parms): Also look at default
2250         template argument.
2252 2021-04-14  Jason Merrill  <jason@redhat.com>
2254         PR c++/93314
2255         * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2256         for a non-static data member in a constant-expression.
2258 2021-04-14  Patrick Palka  <ppalka@redhat.com>
2260         PR c++/83476
2261         PR c++/99885
2262         * pt.c (deducible_expression): Look through implicit
2263         INDIRECT_REFs as well.
2265 2021-04-14  Jason Merrill  <jason@redhat.com>
2267         PR c++/99478
2268         * parser.c (cp_parser_lambda_expression): Reject lambda
2269         in template parameter type.
2271 2021-04-14  Jason Merrill  <jason@redhat.com>
2273         PR c++/90674
2274         * decl.c (duplicate_decls): Don't propagate
2275         DECL_INITIALIZED_IN_CLASS_P to a specialization.
2277 2021-04-14  Jason Merrill  <jason@redhat.com>
2279         PR c++/88742
2280         PR c++/49951
2281         PR c++/58123
2282         * semantics.c (set_cleanup_locs): New.
2283         (do_poplevel): Call it.
2284         * parser.c (cp_parser_compound_statement): Consume the }
2285         before finish_compound_stmt.
2287 2021-04-13  Jason Merrill  <jason@redhat.com>
2289         PR c++/100032
2290         * pt.c (get_underlying_template): Compare TYPE_QUALS.
2292 2021-04-13  Jason Merrill  <jason@redhat.com>
2294         PR c++/100054
2295         PR c++/90479
2296         * init.c (get_nsdmi): Do more context adjustment for local classes.
2298 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2300         PR c++/99008
2301         * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2302         rather than issuing a pedwarn.
2303         * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2304         for consistent diagnostics.
2306 2021-04-13  Jason Merrill  <jason@redhat.com>
2308         PR c++/91933
2309         * class.c (build_base_path): Shortcut simple non-pointer case.
2311 2021-04-13  Eric Botcazou  <ebotcazou@adacore.com>
2313         * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2314         of the linemap.
2315         (module_state::write_location): Likewise.
2317 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2319         PR c++/97134
2320         * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2321         when checking if the initializer is an equivalent class
2322         placeholder template parameter.
2324 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2326         PR c++/99961
2327         PR c++/99994
2328         * constraint.cc (satisfy_normalized_constraints): Set
2329         cp_unevaluated.
2330         * parser.c (cp_parser_concept_definition): Likewise.
2331         (cp_parser_requires_clause_opt): Likewise.
2333 2021-04-12  Jason Merrill  <jason@redhat.com>
2335         PR c++/93085
2336         * pt.c (uses_outer_template_parms): Handle non-type and template
2337         template parameters specifically.
2339 2021-04-11  Jason Merrill  <jason@redhat.com>
2341         PR c++/97974
2342         * decl.c (fixup_anonymous_aggr): Prune all functions from
2343         CLASSTYPE_MEMBER_VEC.
2345 2021-04-10  Jason Merrill  <jason@redhat.com>
2347         PR c++/98800
2348         PR c++/97399
2349         * parser.c (cp_parser_direct_declarator): Don't
2350         inject_this_parameter if static_p.
2351         (cp_parser_omp_var_list_no_open): Parse 'this' even if
2352         current_class_ptr isn't set for a better diagnostic.
2354 2021-04-10  Jason Merrill  <jason@redhat.com>
2356         PR c++/99180
2357         PR c++/93295
2358         PR c++/93867
2359         PR c++/99118
2360         PR c++/96873
2361         * pt.c (alias_ctad_tweaks): Handle failure better.
2363 2021-04-10  Jason Merrill  <jason@redhat.com>
2365         PR c++/100006
2366         * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2368 2021-04-09  Patrick Palka  <ppalka@redhat.com>
2370         * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2371         (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2372         (LAMBDA_EXPR_REGEN_INFO): ... this.
2373         (tree_lambda_expr::regenerated_from)
2374         (tree_lambda_expr::regenerating_targs): Replace these with ...
2375         (tree_lambda_expr::regen_info): ... this.
2376         * constraint.cc (satisfy_declaration_constraints): Adjust
2377         accordingly.
2378         * lambda.c (build_lambda_expr): Likewise.
2379         * pt.c (regenerated_lambda_fn_p): Likewise.
2380         (most_general_lambda): Likewise.
2381         (tsubst_lambda_expr): Likewise.
2383 2021-04-09  Marek Polacek  <polacek@redhat.com>
2385         PR c++/99806
2386         * parser.c (cp_parser_member_declaration): Call
2387         cp_parser_save_default_args even for function templates.  Use
2388         STRIP_TEMPLATE on the declaration we're passing.
2390 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2392         PR c++/99874
2393         * constraint.cc (get_normalized_constraints_from_decl): Handle
2394         regenerated lambdas.
2395         (satisfy_declaration_constraints): Likewise.  Check for
2396         dependent args later.
2397         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2398         (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2399         (LAMBDA_EXPR_REGENERATING_TARGS): New.
2400         (tree_lambda_expr::regenerated_from): New data member.
2401         (tree_lambda_expr::regenerating_targs): New data member.
2402         (add_to_template_args): Declare.
2403         (regenerated_lambda_fn_p): Likewise.
2404         (most_general_lambda): Likewise.
2405         * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2406         and LAMBDA_EXPR_REGENERATING_TARGS.
2407         * pt.c (add_to_template_args): No longer static.
2408         (tsubst_function_decl): Unconditionally propagate constraints on
2409         the substituted function decl.
2410         (instantiated_lambda_fn_p): Rename to ...
2411         (regenerated_lambda_fn_p): ... this.  Check
2412         LAMBDA_EXPR_REGENERATED_FROM instead of
2413         LAMBDA_EXPR_INSTANTIATED.
2414         (most_general_lambda): Define.
2415         (enclosing_instantiation_of): Adjust after renaming
2416         instantiated_lambda_fn_p.
2417         (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED.  Set
2418         LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2419         Don't substitute or set constraints on the regenerated lambda.
2421 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2423         PR c++/97679
2424         * pt.c (build_deduction_guide): Document OUTER_ARGS.  Substitute
2425         them into the propagated constraints.
2427 2021-04-08  Jason Merrill  <jason@redhat.com>
2429         PR c++/91849
2430         * call.c (convert_like_internal): Improve reference diagnostic.
2432 2021-04-08  Jakub Jelinek  <jakub@redhat.com>
2434         PR c++/99859
2435         * constexpr.c (addr_of_non_const_var): New function.
2436         (cxx_bind_parameters_in_call): Set *non_constant_args to true
2437         even if cp_walk_tree on arg with addr_of_non_const_var callback
2438         returns true.
2440 2021-04-08  Jason Merrill  <jason@redhat.com>
2442         PR c++/94529
2443         * pt.c (determine_specialization): Improve diagnostic.
2445 2021-04-08  Marek Polacek  <polacek@redhat.com>
2447         PR c++/99844
2448         * decl.c (build_explicit_specifier): Call
2449         check_for_bare_parameter_packs.
2450         * except.c (build_noexcept_spec): Likewise.
2452 2021-04-07  Jason Merrill  <jason@redhat.com>
2454         PR c++/41723
2455         * parser.c (cp_parser_class_name): Check dependent_scope_p.
2457 2021-04-07  Jason Merrill  <jason@redhat.com>
2459         PR c++/52625
2460         * pt.c (maybe_process_partial_specialization): Check
2461         DECL_SELF_REFERENCE_P.
2463 2021-04-07  Jason Merrill  <jason@redhat.com>
2465         PR c++/92918
2466         * name-lookup.c (push_class_level_binding_1): Do overload a new
2467         function with a previous using-declaration.
2469 2021-04-06  Jason Merrill  <jason@redhat.com>
2471         PR c++/96673
2472         * init.c (get_nsdmi): Don't defer access checking.
2474 2021-04-06  Jason Merrill  <jason@redhat.com>
2476         PR c++/99901
2477         * decl.c (cp_finish_decl): mark_needed an implicitly inline
2478         static data member with an out-of-class redeclaration.
2480 2021-04-06  Jason Merrill  <jason@redhat.com>
2482         PR c++/91241
2483         * mangle.c (write_compact_number): Add sanity check.
2484         (write_local_name): Use list_length for parm number.
2486 2021-04-06  Patrick Palka  <ppalka@redhat.com>
2488         PR c++/99899
2489         * pt.c (do_auto_deduction): Don't exit early when deducing the
2490         array type of a structured binding.  Also handle adc_decomp_type
2491         during constraint checking.
2493 2021-04-05  Jason Merrill  <jason@redhat.com>
2495         PR c++/96311
2496         * typeck.c (check_return_expr): Call mark_exp_read in dependent
2497         case.
2499 2021-04-05  Jason Merrill  <jason@redhat.com>
2501         PR c++/98440
2502         * typeck.c (build_reinterpret_cast_1): Don't perform
2503         temporary materialization.
2505 2021-04-05  Jason Merrill  <jason@redhat.com>
2507         PR c++/95317
2508         * pt.c (lookup_template_class_1): Do tsubst_enum when
2509         tsubsting a generic lambda.
2511 2021-04-05  Jason Merrill  <jason@redhat.com>
2513         PR c++/95870
2514         * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2515         there is no enclosing non-lambda function.
2517 2021-04-05  Nathan Sidwell  <nathan@acm.org>
2519         PR c++/99380
2520         * module.cc (name_pending_imports): Drop 'atend' parm.  Don't
2521         query export when not needed.
2522         (preprocess_module, preprocessed_module): Adjust.
2524 2021-04-05  Jason Merrill  <jason@redhat.com>
2526         PR c++/99066
2527         * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2529 2021-04-05  Jason Merrill  <jason@redhat.com>
2531         PR c++/99201
2532         * pt.c (class el_data): Add visited field.
2533         (extract_local_specs): Pass it to cp_walk_tree.
2534         (extract_locals_r): Walk into the body of a lambda.
2536 2021-04-05  Jason Merrill  <jason@redhat.com>
2538         * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2539         template result.
2541 2021-04-04  Jason Merrill  <jason@redhat.com>
2543         PR c++/99643
2544         * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2546 2021-04-03  Marek Polacek  <polacek@redhat.com>
2548         PR c++/91416
2549         * parser.c: Create a GC root for attributes in a decl specifier.
2550         (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2552 2021-04-03  Jason Merrill  <jason@redhat.com>
2554         PR c++/91217
2555         * pt.c (tsubst_lambda_expr): Skip the body block from
2556         DECL_SAVED_TREE.
2558 2021-04-03  Jason Merrill  <jason@redhat.com>
2560         PR c++/90664
2561         * cvt.c (can_convert_qual): Check fnptr_conv_p.
2563 2021-04-03  Jason Merrill  <jason@redhat.com>
2565         PR c++/97900
2566         * pt.c (regenerate_decl_from_template): tsubst_decl
2567         the parms.
2569 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2571         PR c++/99869
2572         * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2573         to do_auto_deduction.
2575 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2577         PR c++/99586
2578         * semantics.c (finish_compound_literal): Check
2579         template_placeholder_p instead of type_uses_auto.
2581 2021-04-02  Jason Merrill  <jason@redhat.com>
2583         PR c++/97938
2584         * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2585         * lambda.c (add_capture): Set it.
2586         * pt.c (tsubst_pack_expansion): Handle it.
2588 2021-04-02  Nathan Sidwell  <nathan@acm.org>
2590         * cp-tree.h (lang_decl_base): Correct module flag comment.
2591         * module.cc (trees_in::assert_definition): Break out
2592         not_tmpl var.
2593         (trees_out::lang_decl_bools): Do not write purview for header units.
2595 2021-04-01  Marek Polacek  <polacek@redhat.com>
2597         PR c++/99831
2598         * method.c (defaulted_late_check): ++ and -- function_depth around
2599         the call to synthesize_method.
2600         * pt.c: Remove the saved_trees global.
2602 2021-04-01  Jason Merrill  <jason@redhat.com>
2604         PR c++/99583
2605         PR c++/99584
2606         * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2607         TYPE_RAISES_EXCEPTIONS.
2609 2021-04-01  Iain Sandoe  <iain@sandoe.co.uk>
2611         * mapper-client.cc (INCLUDE_MAP): New; require map to be
2612         included from system.h.
2613         * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2615 2021-04-01  Jason Merrill  <jason@redhat.com>
2617         PR c++/98481
2618         * mangle.c (write_expression): Adjust.
2619         * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2620         (mark_abi_tags_r): Likewise.
2622 2021-04-01  Nathan Sidwell  <nathan@acm.org>
2624         PR c++/99283
2625         * module.cc (trees_out::decl_node): Adjust importedness reference
2626         assert.
2627         (module_state::intercluster_seed): New.  Seed both imports and
2628         inter-cluster references.  Broken out of ...
2629         (module_state::write_cluster): ... here.  Call it.
2631 2021-03-31  Jason Merrill  <jason@redhat.com>
2633         PR c++/99445
2634         * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2636 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2638         PR c++/88115
2639         * mangle.c (write_expression): Adjust the mangling of
2640         __alignof__.
2642 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2644         PR c++/99815
2645         * pt.c (placeholder_type_constraint_dependent_p): Expand
2646         argument packs to separate the first non-pack argument
2647         from the rest.
2649 2021-03-30  Nathan Sidwell  <nathan@acm.org>
2651         PR c++/99283
2652         * module.cc (dumper::operator): Make less brittle.
2653         (trees_out::core_bools): VAR_DECLs always have a context.
2654         (trees_out::key_mergeable): Use same_type_p for asserting.
2655         (trees_in::read_var_def): Propagate
2656         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2658 2021-03-30  Jakub Jelinek  <jakub@redhat.com>
2660         PR c++/99790
2661         * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2663 2021-03-26  Marek Polacek  <polacek@redhat.com>
2665         PR c++/98352
2666         * method.c (implicitly_declare_fn): Pass &raises to
2667         synthesized_method_walk.
2669 2021-03-26  Nathan Sidwell  <nathan@acm.org>
2671         PR c++/99283
2672         * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2673         (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2674         * decl.c (duplicate_decls): Remove template_decl module flag
2675         propagation.
2676         * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2677         (dumper::impl::nested_name): Adjust for template-decl module flag
2678         change.
2679         (trees_in::assert_definition): Likewise.
2680         (trees_in::install_entity): Likewise.
2681         (trees_out::decl_value): Likewise.  Remove alias template
2682         separation of template and type_decl.
2683         (trees_in::decl_value): Likewise.
2684         (trees_out::key_mergeable): Likewise,
2685         (trees_in::key_mergeable): Likewise.
2686         (trees_out::decl_node): Adjust for template-decl module flag
2687         change.
2688         (depset::hash::make_dependency): Likewise.
2689         (get_originating_module, module_may_redeclare): Likewise.
2690         (set_instantiating_module, set_defining_module): Likewise.
2691         * name-lookup.c (name_lookup::search_adl): Likewise.
2692         (do_pushdecl): Likewise.
2693         * pt.c (build_template_decl): Likewise.
2694         (lookup_template_class_1): Remove special alias_template handling
2695         of DECL_TI_TEMPLATE.
2696         (tsubst_template_decl): Likewise.
2698 2021-03-26  Jakub Jelinek  <jakub@redhat.com>
2700         PR c++/99705
2701         * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2702         in DECL_EXPR or in BIND_EXPR_VARS.
2704 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2706         PR c++/99672
2707         * parser.c (cp_parser_postfix_expression): For calls, create
2708         combined_loc and temporarily set input_location to it before
2709         calling finish_call_expr.
2711 2021-03-25  Marek Polacek  <polacek@redhat.com>
2713         PR c++/94751
2714         * call.c (build_over_call): Maybe call mark_used in case
2715         deduce_inheriting_ctor fails and return error_mark_node.
2716         * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2717         * method.c (deduce_inheriting_ctor): Return bool if the deduction
2718         fails.
2719         (implicitly_declare_fn): If raises is error_mark_node, call
2720         synthesized_method_walk with diag being true.
2722 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2724         PR c++/99745
2725         * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2726         packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2728 2021-03-25  Marek Polacek  <polacek@redhat.com>
2730         PR c++/99331
2731         * call.c (build_converted_constant_expr_internal): Don't emit
2732         -Wconversion warnings.
2734 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2736         PR c++/99565
2737         * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2738         to operand_equal_p.
2739         * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2740         or COMPOUND_EXPR.
2742 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2744         PR c++/99283
2745         * name-lookup.c (check_module_override): Set global or partition
2746         DUP on the binding vector.
2748 2021-03-23  Marek Polacek  <polacek@redhat.com>
2750         PR c++/99318
2751         * decl2.c (cp_warn_deprecated_use_scopes): Only call
2752         cp_warn_deprecated_use when decl is a namespace, class, or enum.
2754 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2756         PR c++/99239
2757         * decl.c (duplicate_decls): Remove assert about maybe-imported
2758         artificial decls.
2760 2021-03-23  Jakub Jelinek  <jakub@redhat.com>
2762         PR c++/99650
2763         * decl.c (cp_finish_decomp): Diagnose void initializers when
2764         using tuple_element and get.
2766 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2768         PR c++/99480
2769         * module.cc (depset::hash::make_dependency): Propagate flags for
2770         partial specialization.
2771         (module_may_redeclare): Handle partial specialization.
2773 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2775         PR c++/99425
2776         * cp-tree.h (map_context_from, map_context_to): Delete.
2777         (add_mergeable_specialization): Add is_alias parm.
2778         * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2779         * module.cc (map_context_from, map_context_to): Delete.
2780         (trees_in::decl_value): Add specializations later, adjust call.
2781         Drop useless alias lookup. Set duplicate fn parm context.
2782         (check_mergeable_decl): Drop context mapping.
2783         (trees_in::is_matching_decl): Likewise.
2784         (trees_in::read_function_def): Drop parameter context adjustment
2785         here.
2787 2021-03-22  Martin Liska  <mliska@suse.cz>
2789         PR c++/99687
2790         * module.cc (fini_modules): Call vec_free instead of delete.
2792 2021-03-20  Jakub Jelinek  <jakub@redhat.com>
2794         PR debug/99230
2795         * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2796         special code, instead call c_genericize_control_stmt.
2798 2021-03-19  Jakub Jelinek  <jakub@redhat.com>
2800         PR c++/99456
2801         * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2802         INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2803         don't diagnose it, set *non_constant_p nor return t.
2805 2021-03-19  Marek Polacek  <polacek@redhat.com>
2807         PR c++/99500
2808         * parser.c (cp_parser_requirement_parameter_list): Handle
2809         error_mark_node.
2811 2021-03-18  Marek Polacek  <polacek@redhat.com>
2813         * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2815 2021-03-18  Marek Polacek  <polacek@redhat.com>
2817         * pt.c (tsubst_copy_and_build): Add assert.
2819 2021-03-18  Iain Sandoe  <iain@sandoe.co.uk>
2821         PR objc++/49070
2822         * parser.c (cp_debug_parser): Add Objective-C++ message
2823         state flag.
2824         (cp_parser_nested_name_specifier_opt): Allow colon to
2825         terminate an assignment-expression when parsing Objective-
2826         C++ messages.
2827         (cp_parser_objc_message_expression): Set and clear message
2828         parsing state on entry and exit.
2829         * parser.h (struct cp_parser): Add a context flag for
2830         Objective-C++ message state.
2832 2021-03-18  Martin Liska  <mliska@suse.cz>
2834         PR c++/99617
2835         * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2836         to NULL.
2838 2021-03-17  Marek Polacek  <polacek@redhat.com>
2840         PR c++/97973
2841         * call.c (conv_unsafe_in_template_p): New.
2842         (convert_like): Use it.
2844 2021-03-17  Anthony Sharp  <anthonysharp15@gmail.com>
2845             Jason Merrill  <jason@redhat.com>
2847         * semantics.c (get_class_access_diagnostic_decl): New
2848         function that examines special cases when a parent
2849         class causes a private access failure.
2850         (enforce_access): Slightly modified to call function
2851         above.
2853 2021-03-16  Jason Merrill  <jason@redhat.com>
2855         * tree.c (cp_tree_equal): Use real_identical.
2857 2021-03-16  Jakub Jelinek  <jakub@redhat.com>
2859         PR c++/99613
2860         * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2861         before calling __cxa_guard_release rather than after it.  Formatting
2862         fixes.
2864 2021-03-16  Martin Liska  <mliska@suse.cz>
2865             Jason Merrill  <jason@redhat.com>
2867         PR c++/99108
2868         * call.c (get_function_version_dispatcher): Handle
2869         DECL_LOCAL_DECL_P.
2870         * decl.c (maybe_version_functions): Likewise.
2871         (maybe_mark_function_versioned): New.
2872         * name-lookup.c (push_local_extern_decl_alias): No longer static.
2873         * name-lookup.h (push_local_extern_decl_alias): Adjust.
2875 2021-03-16  Nathan Sidwell  <nathan@acm.org>
2877         PR c++/99496
2878         * module.cc (trees_out::decl_value): Adjust typedef streaming,
2879         indicate whether it is a dependent alias.
2880         (trees_in::decl_value): Likewise.  Set as dependent alias, if it
2881         is one.
2883 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2885         PR c++/99047
2886         * coroutines.cc (expand_one_await_expression): If the
2887         await_ready() expression is not a boolean then convert it
2888         as required.
2890 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2892         PR c++/98704
2893         * coroutines.cc (build_actor_fn): Make destroy index 1
2894         correspond to the abnormal unhandled_exception() exit.
2895         Substitute the proxy for the resume index.
2896         (coro_rewrite_function_body): Arrange to reset the resume
2897         index and make done = true for a rethrown exception from
2898         unhandled_exception ().
2899         (morph_fn_to_coro): Adjust calls to build_actor_fn and
2900         coro_rewrite_function_body.
2902 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2904         PR c++/98480
2905         * coroutines.cc (replace_continue): Rewrite continue into
2906         'goto label'.
2907         (await_statement_walker): Handle await expressions in the
2908         initializer, condition and iteration expressions of for
2909         loops.
2911 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2913         PR c++/96749
2914         * coroutines.cc (flatten_await_stmt): Allow for the case
2915         where a target expression variable only has uses in the
2916         second part of a compound expression.
2917         (maybe_promote_temps): Avoid emiting empty statements.
2919 2021-03-15  Tobias Burnus  <tobias@codesourcery.com>
2921         PR c++/99509
2922         * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2923         ensure that the varpool node is marked as offloadable.
2925 2021-03-12  Nathan Sidwell  <nathan@acm.org>
2927         PR c++/99238
2928         * module.cc (depset::hash::add_binding_entity): Assert not
2929         visited.
2930         (depset::add::add_specializations): Likewise.
2931         * name-lookup.c (name_lookup::dedup): New.
2932         (name_lookup::~name_lookup): Assert not deduping.
2933         (name_lookup::restore_state): Likewise.
2934         (name_lookup::add_overload): Replace outlined code with dedup
2935         call.
2936         (name_lookup::add_value): Likewise.
2937         (name_lookup::search_namespace_only): Likewise.
2938         (name_lookup::adl_namespace_fns): Likewise.
2939         (name_lookup::adl_class_fns): Likewise.
2940         (name_lookup::search_adl): Likewise.  Add clearing dedup call.
2941         (name_lookup::search_qualified): Likewise.
2942         (name_lookup::search_unqualified): Likewise.
2944 2021-03-12  Jakub Jelinek  <jakub@redhat.com>
2946         PR c++/99507
2947         * call.c (build_over_call): For immediate evaluation of functions
2948         that return references, undo convert_from_reference effects before
2949         calling cxx_constant_value and call convert_from_reference
2950         afterwards.
2952 2021-03-11  Nathan Sidwell  <nathan@acm.org>
2954         PR c++/99248
2955         * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
2956         when there's a binding vector.
2957         * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
2959 2021-03-11  Nathan Sidwell  <nathan@acm.org>
2961         PR c++/99528
2962         * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2963         MK_decl_tmpl_spec.
2964         (trees_in::decl_value): Adjust add_mergeable_specialization call.
2965         (trees_out::get_merge_kind): Adjust detecting a partial template
2966         instantiation.
2967         (trees_out::key_mergeable): Adjust handling same.
2968         (trees_in::key_mergeabvle): Likewise.
2970 2021-03-10  Nathan Sidwell  <nathan@acm.org>
2972         PR c++/99423
2973         * module.cc (post_load_processing): Assert not gcable.
2974         (laxy_load_pendings): Extend no-gc region around
2975         post_load_processing.
2977 2021-03-10  Nathan Sidwell  <nathan@acm.org>
2979         PR c++/99508
2980         * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2981         assembler name to the ns alias.
2983 2021-03-09  Jakub Jelinek  <jakub@redhat.com>
2985         PR c++/99459
2986         * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2987         build_special_member_call return value to find the CALL_EXPR.
2988         Simplify.
2990 2021-03-09  Nathan Sidwell  <nathan@acm.org>
2992         PR c++/99472
2993         * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2994         that C++20 does not yet imply modules.
2996 2021-03-08  Nathan Sidwell  <nathan@acm.org>
2998         PR c++/99436
2999         * name-lookup.c (get_cxx_dialect_name): Add cxx23.
3001 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3003         * lex.c (module_token_filter::resume): Ignore module-decls inside
3004         header-unit.
3005         * parser.c (cp_parser_module_declaration): Reject in header-unit.
3007 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3009         PR c++/99285
3010         * cp-tree.h (match_mergeable_specialization)
3011         (add_mergeable_specialization): Adjust parms.
3012         * module.cc (trees_in::decl_value): Adjust
3013         add_mergeable_specialization calls.
3014         (trees_out::key_mergeable): Adjust match_mergeable_specialization
3015         calls.
3016         (specialization_add): Likewise.
3017         * pt.c (match_mergeable_specialization): Do not insert.
3018         (add_mergeable_specialization): Add to hash table here.
3020 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3021             Jakub Jelinek  <jakub@redhat.com>
3023         PR c++/99287
3024         * constexpr.c (cxx_eval_increment_expression): Pass lval when
3025         evaluating the MODIFY_EXPR, and update 'mod' with the result of
3026         this evaluation.  Check *non_constant_p afterwards.  For prefix
3027         ops, just return 'mod'.
3029 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3030             Jakub Jelinek  <jakub@redhat.com>
3032         PR c++/96330
3033         * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3034         variable 'fn' to 'tmpl'.  Handle a variable template-id by
3035         calling lookup_template_variable.
3037 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3039         PR c++/99365
3040         * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3041         outer_targs to do_auto_deduction.
3042         (placeholder_type_constraint_dependent_p): Define.
3043         (do_auto_deduction): When processing_template_decl != 0
3044         and context is adc_unify and we have constraints, pretend the
3045         constraints are satisfied instead of punting.  Otherwise don't
3046         punt unless placeholder_type_constraint_dependent_p holds.
3047         Add some clarifying sanity checks.  Add a hack to add missing
3048         outermost template levels to outer_args before checking
3049         satisfaction.  Don't substitute outer_targs into type if it's
3050         already been done.
3052 2021-03-05  Marek Polacek  <polacek@redhat.com>
3054         PR c++/99374
3055         * call.c (standard_conversion): When converting pointers to
3056         member, don't return NULL when the bases are equivalent but
3057         incomplete.
3059 2021-03-05  Marek Polacek  <polacek@redhat.com>
3061         PR c++/99120
3062         * name-lookup.c (check_local_shadow): Check if the type of decl
3063         is non-null before checking TYPE_PTR*.
3065 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3067         PR c++/99245
3068         * module.cc (module_state::write_cluster): Relax binding assert.
3070 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3072         PR c++/99377
3073         * pt.c (instantiate_decl): Call set_instantiating_module.
3075 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3077         PR c++/98118
3078         * coroutines.cc (build_co_await): Use type_build_ctor_call()
3079         to determine cases when a CTOR needs to be built.
3080         (flatten_await_stmt): Likewise.
3081         (morph_fn_to_coro): Likewise.
3083 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3085         PR c++/95616
3086         * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3087         (coro_diagnose_throwing_final_aw_expr): New helper.
3088         (build_co_await): Diagnose throwing final await expression
3089         components.
3090         (build_init_or_final_await): Diagnose a throwing promise
3091         final_suspend() call.
3093 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3095         PR c++/95615
3096         * coroutines.cc (struct param_info): Track parameter copies that need
3097         a DTOR.
3098         (coro_get_frame_dtor): New helper function factored from build_actor().
3099         (build_actor_fn): Use coro_get_frame_dtor().
3100         (morph_fn_to_coro): Track parameters that need DTORs on exception,
3101         likewise the frame promise and the return object.  On exception, run the
3102         DTORs for these, destroy the frame and then rethrow the exception.
3104 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3106         PR c++/99389
3107         * pt.c (instantiate_class_template_1): Set instantiating module
3108         here.
3110 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
3112         PR c/99137
3113         * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3115 2021-03-04  Jakub Jelinek  <jakub@redhat.com>
3117         PR c++/88146
3118         PR c++/99362
3119         * cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
3120         comment.
3122 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3124         PR c++/99170
3125         * module.cc (class uintset): Delete.
3126         (typedef attached_map_t): A hash map.
3127         (attached_table): Use attached_map_t.  Adjust uses ...
3128         (trees_out::decl_value, trees_in::decl_value): ... here ...
3129         (trees_out::key_mergeable): ... here ...
3130         (trees_in::key_mergeable): ... here ...
3131         (maybe_attach_decl): ... here ...
3132         (direct_import): ... and here.
3134 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3136         PR c++/99170
3137         * cp-tree.h
3138         * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3139         rename.
3140         * module.cc (class pending_key): New.
3141         (default_hash_traits<pending_key>): New specialization.
3142         (pending_map_t): New typedef.
3143         (pending_table): Replace old table.
3144         (trees_out::lang_decl_bools): Adjust.
3145         (trees_in::lang_decl_bools): Adjust.
3146         (trees_in::install_entity): Drop pending member and specialization
3147         handling.
3148         (find_pending_key): New.
3149         (depset::hash::fiund_dependencies): Use it.
3150         (pendset_lazy_load): Delete.
3151         (module_state::write_cluster): Don't count pendings here.  Bye
3152         Duff's device-like thing.
3153         (module_state::write_pendings): Reimplement.
3154         (module_state::read_pendings): Reimplement.
3155         (lazy_specializations_p): Delete.
3156         (module_state::write): Adjust write_pendings call.
3157         (lazy_load_pendings): New.
3158         (lazy_load_specializations): Delete.
3159         (lazy_load_members): Delete.
3160         (init_modules): Adjust.
3161         * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3162         not lazy_load_members.
3163         (note_pending_specializations): Delete.
3164         (load_pending_specializations): Delete.
3165         * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3166         (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3167         (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3168         (note_pending_specializations): Delete.
3169         (load_pending_specializations): Delete.
3170         * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3171         lazy_load_specializations.
3172         (instantiate_template_class_1): Likewise.
3173         (instantiate_decl): Call lazy_load_pendings.
3174         * typeck.c (complete_type): Likewise.
3176 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3178         PR c++/99170
3179         * module.cc (post_load_decls): New.
3180         (lazy_snum, recursive_lazy): Move earlier.
3181         (module_state::read_cluster): Push cloning onto post_load_decls.
3182         (post_load_processing): New.  Do the cloning here.
3183         (module_state::read_inits): Call post_load_processing.
3184         (module_state::read_language): Likewise.
3185         (lazy_load_binding, lazy_load_specializations): Likewise
3186         (lazy_load_members): Likewise
3188 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3190         PR c++/99170
3191         * module.cc (trees_out::decl_value): Stream specialization keys
3192         after decl.
3193         (trees_in::decl_value): Stream them back and insert after
3194         completing the decl.
3195         (trees_out::key_mergeable): Drop some streaming here ...
3196         (trees_in::key_mergeable): ... and here.  Don't insert into
3197         specialization tables.
3199 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3201         * constraint.cc (struct sat_info): Document the different
3202         meanings of noisy() and diagnose_unsatisfaction_p() during
3203         satisfaction and requires-expression evaluation.
3204         (tsubst_valid_expression_requirement): Take a sat_info instead
3205         of a subst_info.  Perform the substitution quietly first.  Fold
3206         in error-replaying code from diagnose_valid_expression.
3207         (tsubst_simple_requirement): Take a sat_info instead of a
3208         subst_info.
3209         (tsubst_type_requirement_1): New.  Fold in error-replaying code
3210         from diagnose_valid_type.
3211         (tsubst_type_requirement): Use the above.  Take a sat_info
3212         instead of a subst_info.
3213         (tsubst_compound_requirement): Likewise.  Fold in
3214         error-replaying code from diagnose_compound_requirement.
3215         (tsubst_nested_requirement): Take a sat_info instead of a
3216         subst_info.  Fold in error-replaying code from
3217         diagnose_nested_requirement.
3218         (tsubst_requirement): Take a sat_info instead of a subst_info.
3219         (tsubst_requires_expr): Split into two versions, one that takes
3220         a sat_info argument and another that takes a complain and
3221         in_decl argument.  Remove outdated documentation.  Document the
3222         effects of the sat_info argument.  Don't short-circuit
3223         processing of requirements when diagnosing unsatisfaction,
3224         mirroring diagnose_requires_expr.
3225         (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3226         assert, and se the three-parameter version of tsubst_requires_expr.
3227         (diagnose_trait_expr): Make static.  Take a template argument
3228         vector instead of a parameter mapping.
3229         (diagnose_valid_expression): Remove.
3230         (diagnose_valid_type): Remove.
3231         (diagnose_simple_requirement): Remove.
3232         (diagnose_compound_requirement): Remove.
3233         (diagnose_type_requirement): Remove.
3234         (diagnose_nested_requirement): Remove.
3235         (diagnose_requirement): Remove.
3236         (diagnose_requires_expr): Remove.
3237         (diagnose_atomic_constraint): Take a sat_info instead of a
3238         subst_info.  Adjust call to diagnose_trait_expr.  Call
3239         tsubst_requires_expr instead of diagnose_requires_expr.
3240         (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3241         and just always call constraint_satisfaction_value.
3243 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3245         * constexpr.c (cxx_eval_call_expression): Adjust call to
3246         evaluate_concept_check.
3247         (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3248         evaluate_requires_expression instead of
3249         satisfy_constraint_expression.
3250         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3251         * constraint.cc (struct sat_info): Adjust comment about which
3252         satisfaction entrypoints use noisy-unsat.
3253         (normalize_template_requirements): Remove (and adjust callers
3254         appropriately).
3255         (normalize_nontemplate_requirements): Likewise.
3256         (tsubst_nested_requirement): Use constraint_satisfaction_value
3257         instead of satisfy_constraint_expression, which'll do the
3258         noisy replaying of ill-formed quiet satisfaction for us.
3259         (decl_satisfied_cache): Adjust comment.
3260         (satisfy_constraint): Rename to ...
3261         (satisfy_normalized_constraints): ... this.
3262         (satisfy_associated_constraints): Remove (and make its
3263         callers check for dependent arguments).
3264         (satisfy_constraint_expression): Rename to ...
3265         (satisfy_nondeclaration_constraints): ... this.  Assert that
3266         'args' is empty when 't' is a concept-id.  Removing handling
3267         bare constraint-expressions, and handle REQUIRES_EXPRs
3268         specially.  Adjust comment accordingly.
3269         (satisfy_declaration_constraints): Assert in the two-parameter
3270         version that 't' is not a TEMPLATE_DECL.  Adjust following
3271         removal of normalize_(non)?template_requirements and
3272         satisfy_asociated_constraints.
3273         (constraint_satisfaction_value): Combine the two- and
3274         three-parameter versions in the natural way.
3275         (constraints_satisfied_p): Combine the one- and two-parameter
3276         versions in the natural way.  Improve documentation.
3277         (evaluate_requires_expr): Define.
3278         (evaluate_concept_check): Remove 'complain' parameter.  Use
3279         constraint_satisfaction_value instead of
3280         satisfy_constraint_expression.
3281         (diagnose_nested_requirement): Adjust following renaming of
3282         satisfy_constraint_expression.
3283         (diagnose_constraints): Handle REQUIRES_EXPR by going through
3284         diagnose_requires_expr directly instead of treating it as a
3285         constraint-expression.  Improve documentation.
3286         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3287         to evaluate_concept_check.
3288         <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3289         constraints_satisfied_p.
3290         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3291         * cp-tree.h (evaluate_requires_expr): Declare.
3292         (evaluate_concept_check): Remove tsubst_flag_t parameter.
3293         (satisfy_constraint_expression): Remove declaration.
3294         (constraints_satisfied_p): Remove one-parameter declaration.
3295         Add a default argument to the two-parameter declaration.
3296         * cvt.c (convert_to_void): Adjust call to
3297         evaluate_concept_check.
3299 2021-03-03  Jakub Jelinek  <jakub@redhat.com>
3301         PR c++/82959
3302         * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3303         and COMPOUND_EXPR.
3305 2021-03-03  Marek Polacek  <polacek@redhat.com>
3307         PR c++/97034
3308         PR c++/99009
3309         * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3310         (maybe_aggr_guide): Use the original template type where needed.  In
3311         a class member template, partially instantiate the result of
3312         collect_ctor_idx_types.
3313         (do_class_deduction): Defer the deduction until the enclosing
3314         scope is non-dependent.
3316 2021-03-03  Jason Merrill  <jason@redhat.com>
3318         PR c++/95675
3319         * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3320         if it didn't get one before.
3322 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3324         PR c++/99344
3325         * module.cc (trees_out::decl_node): Small refactor.
3326         (depset::hash::add_binding_entity): Return true on meeting an
3327         import.  Set namespace's import here.
3328         (module_state:write_namespaces): Inform of purview too.
3329         (module_state:read_namespaces): Adjust.
3330         * name-lookup.c (implicitly_export_namespace): Delete.
3331         (do_pushdecl): Don't call it.
3332         (push_namespace): Likewise, set purview.
3333         (add_imported_namespace): Reorder parms.
3334         * name-lookup.h (add_imported_namespace): Alter param ordering.
3336 2021-03-02  Martin Sebor  <msebor@redhat.com>
3338         PR c++/99251
3339         * class.c (build_base_path): Call build_if_nonnull.
3340         * cp-tree.h (build_if_nonnull): Declare.
3341         * rtti.c (ifnonnull): Rename...
3342         (build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
3343         (build_dynamic_cast_1): Adjust to name change.
3345 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3347         PR c++/96443
3348         PR c++/96960
3349         * constraint.cc (type_deducible_p): Don't substitute into the
3350         constraints, and instead just pass 'args' to do_auto_deduction
3351         as the outer template arguments.
3352         (tsubst_parameter_mapping): Remove confused code for handling
3353         placeholder type arguments.
3354         (normalize_placeholder_type_constraint): Define.
3355         (satisfy_constraint_expression): Use it to handle placeholder
3356         'auto' types.
3357         * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3358         (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3359         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3360         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3361         (make_constrained_placeholder_type): Set
3362         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3363         (do_auto_deduction): Clarify comments about the outer_targs
3364         parameter.  Rework satisfaction of a placeholder type constraint
3365         to pass in the complete set of template arguments directly to
3366         constraints_satisfied_p.
3367         (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3368         instead.  Also rebuild the the constraint info on the new auto.
3370 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3372         * constraint.cc (build_parameter_mapping): Rely on the caller to
3373         determine the in-scope template parameters.
3374         (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3375         to the two-parameter constructor.  In the two-parameter
3376         constructor, fold in the definition of make_context, set
3377         initial_parms appropriately, and don't set the now-removed
3378         orig_decl member.
3379         (norm_info::make_context): Remove, now that its only use is
3380         inlined into the caller.
3381         (norm_info::update_context): Adjust call to
3382         build_parameter_mapping to pass in the relevant set of in-scope
3383         template parameters.
3384         (norm_info::ctx_parms): Define this member function.
3385         (norm_info::context): Initialize to NULL_TREE.
3386         (norm_info::orig_decl): Remove this data member.
3387         (norm_info::initial_parms): Define this data member.
3388         (normalize_atom): Adjust call to build_parameter_mapping to pass
3389         in the relevant set of in-scope template parameters.  Use
3390         info.initial_parms instead of info.orig_decl.
3391         (normalize_constraint_expression): Take a norm_info object
3392         instead of a bool.  Cache the result of normalization.
3393         (tsubst_nested_requirement): Call satisfy_constraint_expression
3394         instead of satisfy_constraint, so that we normalize on demand.
3395         (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3396         Adjust call to normalize_constraint_expression.
3397         (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3398         to current_template_parms.
3399         (diagnose_nested_requirements): Go through
3400         satisfy_constraint_expression, as with tsubst_nested_requirement.
3402 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3404         * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3405         arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3406         started with a TYPE_ARGUMENT_PACK.
3407         (finish_requires_expr): Don't set DECL_CONTEXT and
3408         CONSTRAINT_VAR_P on each of the introduced parameters here.
3409         * parser.c (cp_parser_requirement_parameter_list): Instead set
3410         these fields earlier, here.
3411         * pt.c (do_auto_deduction): Canonicalize the result of
3412         do_auto_deduction.  Pass 'complain' to finish_decltype_type.
3414 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3416         * constraint.cc (tsubst_simple_requirement): Just return
3417         boolean_true_node on success.
3418         (tsubst_type_requirement): Likewise.
3419         (tsubst_compound_requirement): Likewise.
3420         (tsubst_nested_requirement): Likewise.
3421         (tsubst_requirement_body): Remove.
3422         (check_constaint_variables): Rename to ...
3423         (check_constraint_variables): ... this.
3424         (tsubst_constraint_variables): Adjust.
3425         (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3427 2021-03-01  Nathan Sidwell  <nathan@acm.org>
3429         PR c++/99294
3430         * class.c (fixup_type_variants): Propagate mode, precision,
3431         alignment & emptiness.
3432         * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3433         (trees_in::tree_node): Rematerialize alignment here.
3435 2021-02-27  Jason Merrill  <jason@redhat.com>
3437         PR c++/90333
3438         * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3439         between () and ->.
3441 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3443         * parser.c (cp_parser_lambda_declarator_opt): Implement
3444         P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3445         for -std={c,gnu}++2b or with pedwarn in earlier versions.
3447 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3449         PR c++/95451
3450         * lambda.c (is_lambda_ignored_entity): Before checking for
3451         LAMBDA_FUNCTION_P, use OVL_FIRST.  Drop FUNCTION_DECL check.
3453 2021-02-26  Jason Merrill  <jason@redhat.com>
3455         PR c++/98810
3456         * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3457         to a class non-type template argument that needs it.
3459 2021-02-26  Patrick Palka  <ppalka@redhat.com>
3461         PR c++/98990
3462         * pt.c (splice_late_return_type): Rebuild the entire return type
3463         if we have to adjust the level of an auto within.
3464         (type_uses_auto): Adjust call to find_type_usage.
3465         * type-utils.h (find_type_usage): Revert r10-6571 change that
3466         made this function return a pointer to the auto node.
3468 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3470         PR c++/99213
3471         PR c++/94521
3472         * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3473         TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3475 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3477         PR c++/99103
3478         * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3479         (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3481 2021-02-25  Marek Polacek  <polacek@redhat.com>
3483         DR 1312
3484         PR c++/99176
3485         * constexpr.c (is_std_construct_at): New overload.
3486         (is_std_allocator_allocate): New overload.
3487         (cxx_eval_call_expression): Use the new overloads.
3488         (cxx_eval_constant_expression): Reject casting
3489         from void * as per DR 1312.  Don't check can_convert.
3491 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3493         PR c++/97587
3494         * coroutines.cc (struct param_info): Track rvalue refs.
3495         (morph_fn_to_coro): Track rvalue refs, and call the promise
3496         CTOR with the frame copy of passed parms.
3498 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3500         PR c++/95822
3501         * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3502         set throwing_cleanup marker.
3504 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3506         PR c++/99166
3507         * module.cc (module_state::inform_cmi_p): Renamed field.
3508         (module_state::do_import): Adjust.
3509         (init_modules, finish_module_processing): Likewise.
3510         (handle_module_option): Likewise.
3512 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3514         PR c++/98318
3515         * mapper-client.cc (module_client::open_module_client): Fix typo
3516         of fd init.
3518 2021-02-24  Nathan Sidwell  <nathan@acm.org>
3520         PR c++/98718
3521         * module.cc (ool): New indirection vector.
3522         (loc_spans::maybe_propagate): Location is not optional.
3523         (loc_spans::open): Likewise.  Assert monotonically advancing.
3524         (module_for_ordinary_loc): Use ool indirection vector.
3525         (module_state::write_prepare_maps): Do not count empty macro
3526         expansions.  Elide empty spans.
3527         (module_state::write_macro_maps): Skip empty expansions.
3528         (ool_cmp): New qsort comparator.
3529         (module_state::write): Create and destroy ool vector.
3530         (name_pending_imports): Fix dump push/pop.
3531         (preprocess_module): Likewise.  Add more dumping.
3532         (preprocessed_module): Likewise.
3534 2021-02-24  Iain Sandoe  <iain@sandoe.co.uk>
3536         PR c++/96251
3537         * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3538         error reporting when instantiating for a constexpr.
3540 2021-02-23  Nathan Sidwell  <nathan@acm.org>
3542         PR c++/99208
3543         * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3544         identity.
3546 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3548         PR c++/95468
3549         * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3550         over from tsubst_copy.
3552 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3554         * pt.c (instantiation_dependent_expression_p): Check
3555         processing_template_decl before calling
3556         potential_constant_expression.
3558 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3560         PR c++/99174
3561         * module.cc (struct module_state): Add visited_p flag.
3562         (name_pending_imports): Use it to avoid duplicate requests.
3563         (preprocess_module): Don't read preprocessor state if we failed to
3564         load a module's config.
3566 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3568         PR c++/99153
3569         * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3570         to common-path.
3571         * module.cc (set_defining_module): Add assert.
3573 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3575         PR c++/98741
3576         * module.cc (pending_imports): New.
3577         (declare_module): Adjust test condition.
3578         (name_pending_imports): New.
3579         (preprocess_module): Reimplement using pending_imports.
3580         (preprocessed_module): Move name-getting to name_pending_imports.
3581         * name-lookup.c (append_imported_binding_slot): Assert module
3582         ordering is increasing.
3584 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3586         * module.cc (note_cmis): New.
3587         (struct module_state): Add inform_read_p bit.
3588         (module_state::do_import): Inform of CMI location, if enabled.
3589         (init_modules): Canonicalize note_cmis entries.
3590         (handle_module_option): Handle -flang-info-module-read=FOO.
3592 2021-02-19  Jason Merrill  <jason@redhat.com>
3594         PR c++/96926
3595         * call.c (perfect_conversion_p): Limit rvalueness
3596         test to reference bindings.
3598 2021-02-19  Jason Merrill  <jason@redhat.com>
3600         PR c++/96926
3601         * call.c (perfect_conversion_p): New.
3602         (perfect_candidate_p): New.
3603         (add_candidates): Ignore templates after a perfect non-template.
3605 2021-02-18  Nathan Sidwell  <nathan@acm.org>
3607         PR c++/99023
3608         * module.cc (canonicalize_header_name): Use
3609         cpp_probe_header_unit.
3610         (maybe_translate_include): Fix note_includes comparison.
3611         (init_modules): Fix note_includes string termination.
3613 2021-02-18  Jakub Jelinek  <jakub@redhat.com>
3615         PR c++/99132
3616         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3617         cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3618         for immediate function calls.
3620 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3622         PR c++/99023
3623         * module.cc (struct macro_export): Add GTY markers.
3624         (macro_exports): Likewise, us a va_gc Vector.
3626 2021-02-17  Jakub Jelinek  <jakub@redhat.com>
3628         PR sanitizer/99106
3629         * init.c (build_zero_init_1): For flexible array members just return
3630         NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3631         ARRAY_TYPE.
3633 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3635         PR c++/99116
3636         * name-lookup.c (do_pushdecl): Don't peek under template_parm
3637         bindings here ...
3638         (set_identifier_type_value_with_scope): ... or here.
3639         (do_pushtag): Only set_identifier_type_value_with_scope at
3640         non-class template parm scope, and use parent scope.
3642 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3644         PR c++/99071
3645         * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3646         pointer.
3648 2021-02-17  Patrick Palka  <ppalka@redhat.com>
3650         PR debug/96997
3651         PR c++/94034
3652         * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3654 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3656         * module.cc (module_state::write_cluster): Check bindings for
3657         imported using-decls.
3659 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3661         PR c++/99040
3662         * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3663         for new namespace-scope entities.
3664         (module_state::read_cluster): Don't call add_module_decl here.
3665         * name-lookup.h (add_module_decl): Rename to ...
3666         (add_module_namespace_decl): ... this.
3667         * name-lookup.c (newbinding_bookkeeping): Move into ...
3668         (do_pushdecl): ... here.  Its only remaining caller.
3669         (add_module_decl): Rename to ...
3670         (add_module_namespace_decl): ... here.  Add checking-assert for
3671         circularity. Don't call newbinding_bookkeeping, just extern_c
3672         checking and incomplete var checking.
3674 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3676         PR c++/99039
3677         PR c++/99040
3678         * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3679         (global_type_node): Delete.
3680         (IDENTIFIER_TYPE_VALUE): Delete.
3681         (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3682         (get_type_value): Delete.
3683         * name-lookup.h (identifier_type_value): Delete.
3684         * name-lookup.c (check_module_override): Don't
3685         SET_IDENTIFIER_TYPE_VALUE here.
3686         (do_pushdecl): Nor here.
3687         (identifier_type_value_1, identifier_type_value): Delete.
3688         (set_identifier_type_value_with_scope): Only
3689         SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3690         (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3691         (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3692         * call.c (check_dtor_name): Use lookup_name.
3693         * decl.c (cxx_init_decl_processing): Drop global_type_node.
3694         * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3695         here.
3696         * init.c (get_type_value): Delete.
3697         * pt.c (instantiate_class_template_1): Don't call pushtag or
3698         SET_IDENTIFIER_TYPE_VALUE here.
3699         (tsubst): Assert never an identifier.
3700         (dependent_type_p): Drop global_type_node assert.
3701         * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3702         to determine ctorness.
3704 2021-02-12  Jakub Jelinek  <jakub@redhat.com>
3706         PR c++/97742
3707         * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3708         CPP_EOF.
3710 2021-02-12  Jason Merrill  <jason@redhat.com>
3712         PR c++/97246
3713         PR c++/94546
3714         * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3715         (register_parameter_specializations): Not here.
3717 2021-02-11  Marek Polacek  <polacek@redhat.com>
3719         PR c++/95888
3720         * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3721         for the partial instantiation.
3723 2021-02-11  Jakub Jelinek  <jakub@redhat.com>
3725         PR c++/99033
3726         * init.c (build_zero_init_1): Handle zero initialiation of
3727         flexible array members like initialization of [0] arrays.
3728         Use integer_minus_onep instead of comparison to integer_minus_one_node
3729         and integer_zerop instead of comparison against size_zero_node.
3730         Formatting fixes.
3732 2021-02-11  Marek Polacek  <polacek@redhat.com>
3734         PR c++/99063
3735         * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3737 2021-02-11  Patrick Palka  <ppalka@redhat.com>
3739         PR c++/97582
3740         * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3741         lookup result by discarding it if the first element is a
3742         class-scope declaration, otherwise return it.
3743         (push_operator_bindings): Handle an ambiguous lookup result by
3744         doing push_local_binding on each element in the list.
3746 2021-02-11  Marek Polacek  <polacek@redhat.com>
3748         * parser.c (cp_parser_selection_statement): Use vec_free.
3750 2021-02-10  Jakub Jelinek  <jakub@redhat.com>
3752         PR c++/98988
3753         PR c++/99031
3754         * constexpr.c: Include cgraph.h.
3755         (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3756         heap artificial vars.
3757         (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3758         heap artificial vars.
3760 2021-02-10  Nathan Sidwell  <nathan@acm.org>
3762         PR c++/99030
3763         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3764         answer if there's no local specialization.
3766 2021-02-09  Nathan Sidwell  <nathan@acm.org>
3768         PR c++/98944
3769         * module.cc (module_state::is_rooted): Rename to ...
3770         (module_state::has_location): ... here.  Adjust callers.
3771         (module_state::read_partitions): Adjust validity check.
3772         Don't overwrite a known location.
3774 2021-02-09  Jason Merrill  <jason@redhat.com>
3776         PR c++/96905
3777         * pt.c (mark_decl_instantiated): Exit early if consteval.
3779 2021-02-09  Jason Merrill  <jason@redhat.com>
3781         PR c++/98326
3782         PR c++/20408
3783         * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3784         parm.
3786 2021-02-09  Jason Merrill  <jason@redhat.com>
3788         PR c++/98994
3789         PR c++/97566
3790         * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3791         RECORD_TYPE.
3793 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3795         * decl.c (start_cleanup_fn): Push function into
3796         namespace.
3798 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3800         PR c++/98531
3801         * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3802         * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3803         from rtti.c, add default namespace arg.
3804         (check_redeclaration_exception_specification): Allow a lazy
3805         builtin's eh spec to differ from an lready-declared user
3806         declaration.
3807         (declare_global_var): Use push/pop_abi_namespace.
3808         (get_atexit_node): Push the fndecl into a namespace.
3809         * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3810         decl.c.
3812 2021-02-08  Marek Polacek  <polacek@redhat.com>
3814         * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3816 2021-02-05  Marek Polacek  <polacek@redhat.com>
3818         PR c++/98947
3819         * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3820         on arg2/arg3.
3821         * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3822         issuing the -Wvolatile warning.  Only set TREE_THIS_VOLATILE if
3823         a warning was emitted.
3825 2021-02-05  Marek Polacek  <polacek@redhat.com>
3827         PR c++/96462
3828         * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3830 2021-02-05  Jakub Jelinek  <jakub@redhat.com>
3832         PR c++/97878
3833         * decl.c (check_array_initializer): For structured bindings, require
3834         the array type to be complete.
3836 2021-02-04  Jason Merrill  <jason@redhat.com>
3838         PR c++/98717
3839         * constraint.cc (build_concept_check_arguments): Remove assert.
3840         (build_concept_check): Allow empty args.
3842 2021-02-04  Tom Greenslade (thomgree)  <thomgree@cisco.com>
3844         PR c++/90926
3845         * call.c (can_convert_array): Extend to handle all valid aggregate
3846         initializers of an array; including by string literals, not just by
3847         brace-init-list.
3848         (build_aggr_conv): Call can_convert_array more often, not just in
3849         brace-init-list case.
3850         * typeck2.c (array_string_literal_compatible_p): New function.
3851         (digest_init_r): call array_string_literal_compatible_p
3852         * cp-tree.h: (array_string_literal_compatible_p): Declare.
3854 2021-02-04  Jason Merrill  <jason@redhat.com>
3856         PR c++/98802
3857         * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3859 2021-02-04  Jason Merrill  <jason@redhat.com>
3861         PR c++/95192
3862         * pt.c (tsubst_attribute): Handle error.
3863         (apply_late_template_attributes): Return false on error.
3864         (tsubst_function_decl): Check its return value.
3865         (tsubst_decl): Likewise.
3866         (push_template_decl): Assert current_template_parms.
3867         (tsubst_template_decl): Set current_template_parms.
3869 2021-02-03  Marek Polacek  <polacek@redhat.com>
3871         PR c++/98951
3872         * call.c (struct z_candidate): Mark rewritten and reversed as const.
3873         (struct NonPublicField): Mark operator() as const.
3874         (struct NonTrivialField): Likewise.
3876 2021-02-03  Jason Merrill  <jason@redhat.com>
3878         PR c++/98926
3879         PR c++/98570
3880         * pt.c (spec_hasher::equal): Set processing_template_decl.
3881         * Make-lang.in (check-g++-strict-gc): Add --param
3882         hash-table-verification-limit=10000.
3884 2021-02-03  Marek Polacek  <polacek@redhat.com>
3886         PR c++/98899
3887         * parser.c (cp_parser_class_specifier_1): Use any possible
3888         DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
3889         (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
3890         * pt.c (tsubst_exception_specification): Stash new_specs into
3891         DEFPARSE_INSTANTIATIONS.
3892         * tree.c (fixup_deferred_exception_variants): Use
3893         UNPARSED_NOEXCEPT_SPEC_P.
3895 2021-02-02  Jason Merrill  <jason@redhat.com>
3897         PR c++/98929
3898         PR c++/96199
3899         * error.c (dump_expr): Ignore dummy object.
3900         * pt.c (tsubst_baselink): Handle dependent scope.
3902 2021-02-01  Patrick Palka  <ppalka@redhat.com>
3904         PR c++/98295
3905         * constexpr.c (cxx_eval_array_reference): Also set
3906         new_ctx.object when setting new_ctx.ctor.
3908 2021-02-01  Marek Polacek  <polacek@redhat.com>
3910         PR c++/98355
3911         * parser.c (cp_parser_has_attribute_expression): Use
3912         uses_template_parms instead of type_dependent_expression_p.
3914 2021-02-01  Jason Merrill  <jason@redhat.com>
3916         PR c++/98570
3917         * cp-tree.h: Declare it.
3918         * pt.c (comparing_dependent_aliases): New flag.
3919         (template_args_equal, spec_hasher::equal): Set it.
3920         (dependent_alias_template_spec_p): Assert that we don't
3921         get non-types other than error_mark_node.
3922         (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
3923         on complex alias specializations.  Set TYPE_DEPENDENT_P here.
3924         (tsubst_decl): Not here.
3925         * module.cc (module_state::read_cluster): Set
3926         comparing_dependent_aliases instead of
3927         comparing_specializations.
3928         * tree.c (cp_tree_equal): Remove comparing_specializations
3929         module handling.
3930         * typeck.c (structural_comptypes): Adjust.
3931         (comptypes): Remove comparing_specializations handling.
3933 2021-01-29  Nathan Sidwell  <nathan@acm.org>
3935         PR c++/98843
3936         * module.cc (module_state_config): Add num_entities field.
3937         (module_state::read_entities): The entity_ary span is
3938         already allocated.
3939         (module_state::write_config): Write num_entities.
3940         (module_state::read_config): Read num_entities.
3941         (module_state::write): Set config's num_entities.
3942         (module_state::read_initial): Allocate the entity ary
3943         span here.
3944         (module_state::read_language): Do not set entity_lwm
3945         here.
3947 2021-01-29  Marek Polacek  <polacek@redhat.com>
3949         PR c++/96137
3950         * parser.c (cp_parser_class_name): If parser->scope is
3951         error_mark_node, return it, otherwise continue.
3953 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
3955         PR c++/98841
3956         * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
3958 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
3960         PR c++/33661
3961         PR c++/98847
3962         * decl.c (cp_finish_decl): For register vars with asmspec in templates
3963         call set_user_assembler_name and set DECL_HARD_REGISTER.
3964         * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
3965         pass asmspec_tree to cp_finish_decl.
3967 2021-01-28  Nathan Sidwell  <nathan@acm.org>
3969         PR c++/98770
3970         * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3971         check order.
3972         (trees_in::decl_value): Do typedef frobbing only when installing
3973         a new typedef, adjust is_matching_decl call.  Swap is_typedef
3974         & TYPE_NAME check.
3975         (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3976         names and deal with typedef checking.
3978 2021-01-27  Jason Merrill  <jason@redhat.com>
3980         PR c++/97874
3981         * name-lookup.c (lookup_using_decl): Clean up handling
3982         of dependency and inherited constructors.
3983         (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
3984         * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
3986 2021-01-26  Jason Merrill  <jason@redhat.com>
3988         PR c++/97474
3989         * call.c (type_passed_as): Don't mark invisiref restrict.
3991 2021-01-26  Jason Merrill  <jason@redhat.com>
3993         PR c++/97566
3994         PR c++/98463
3995         * class.c (layout_class_type): An empty field gets size 0.
3996         (is_empty_field): New.
3997         (check_bases): Check it.
3998         * cp-tree.h (is_empty_field): Declare it.
3999         * constexpr.c (cxx_eval_store_expression): Check it.
4000         (cx_check_missing_mem_inits): Likewise.
4001         * init.c (perform_member_init): Likewise.
4002         * typeck2.c (process_init_constructor_record): Likewise.
4004 2021-01-25  Martin Sebor  <msebor@redhat.com>
4006         PR c++/98646
4007         * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
4009 2021-01-25  Jason Merrill  <jason@redhat.com>
4011         PR c++/98463
4012         * constexpr.c (get_or_insert_ctor_field): Add check.
4013         (cxx_eval_store_expression): Handle discontinuity of refs.
4015 2021-01-23  Anthony Sharp  <anthonysharp15@gmail.com>
4017         * call.c (complain_about_access): Altered function.
4018         * cp-tree.h (complain_about_access): Changed parameters of function.
4019         (get_parent_with_private_access): Declared new function.
4020         * search.c (get_parent_with_private_access): Defined new function.
4021         * semantics.c (enforce_access): Modified function.
4022         * typeck.c (complain_about_unrecognized_member): Updated function
4023         arguments in complain_about_access.
4025 2021-01-23  Patrick Palka  <ppalka@redhat.com>
4027         PR c++/97399
4028         * cp-tree.h (shared_member_p): Adjust declaration.
4029         * parser.c (cp_parser_init_declarator): If the storage class
4030         specifier is sc_static, pass true for static_p to
4031         cp_parser_declarator.
4032         (cp_parser_direct_declarator): Don't do inject_this_parm when
4033         the declarator is a friend.
4034         * search.c (shared_member_p): Change return type to bool and
4035         adjust function body accordingly.  Return false for a dependent
4036         USING_DECL instead of aborting.
4037         * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4038         even when type-dependent.
4040 2021-01-22  Marek Polacek  <polacek@redhat.com>
4042         PR c++/96623
4043         * parser.c (inject_parm_decls): Remove a redundant assignment.
4044         (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4045         before calling inject_parm_decls.
4047 2021-01-22  Jason Merrill  <jason@redhat.com>
4049         PR c++/98744
4050         * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4052 2021-01-22  Jakub Jelinek  <jakub@redhat.com>
4054         PR sanitizer/95693
4055         * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4056         return build_zero_cst for reference types.
4057         * typeck2.c (process_init_constructor_record): Instead call
4058         build_zero_cst here during error recovery instead of build_zero_init.
4060 2021-01-22  Marek Polacek  <polacek@redhat.com>
4062         PR c++/98545
4063         * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4064         warnings regardless of abi_version_at_least.
4065         (write_expression): When the expression is a dependent name
4066         and an operator name, write "on" before writing its name.
4068 2021-01-22  Marek Polacek  <polacek@redhat.com>
4070         PR c++/97966
4071         * pt.c (instantiate_class_template_1): Instantiate members
4072         marked with attribute used only after we're done instantiating
4073         the class.
4075 2021-01-21  Patrick Palka  <ppalka@redhat.com>
4077         PR c++/71879
4078         * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4079         sentinel at the start of the function.  Remove a now-redundant
4080         manual adjustment of cp_unevaluated_operand.
4082 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4084         PR c++/98624
4085         * module.cc (depset::hash::find_dependencies): Add
4086         module arg.
4087         (trees_out::core_vals): Check state before calling
4088         write_location.
4089         (sort_cluster, module_state::write): Adjust
4090         find_dependencies call.
4092 2021-01-21  Jakub Jelinek  <jakub@redhat.com>
4094         PR c++/98672
4095         * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4096         (check_for_return_continue): Also look for BREAK_STMT.  Handle
4097         SWITCH_STMT by ignoring break_stmt from its body.
4098         (potential_constant_expression_1) <case FOR_STMT>,
4099         <case WHILE_STMT>: If the condition isn't constant true, check if
4100         the loop body can contain a return stmt.
4101         <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4102         <case IF_STMT>: If recursion with tf_none is successful,
4103         merge *jump_target from the branches - returns with highest priority,
4104         breaks or continues lower.  If then branch is potentially constant and
4105         doesn't return, check the else branch if it could return, break or
4106         continue.
4108 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4110         PR c++/98530
4111         * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4113 2021-01-20  Nathan Sidwell  <nathan@acm.org>
4115         * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4116         signed type.
4118 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4120         PR c++/95434
4121         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4122         CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4123         adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4125 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4127         PR c++/82613
4128         * parser.c (cp_parser_class_head): Defer access checking when
4129         parsing the base-clause until all bases are seen and attached
4130         to the class type.
4131         * pt.c (instantiate_class_template): Likewise when substituting
4132         into dependent bases.
4134 2021-01-20  Jakub Jelinek  <jakub@redhat.com>
4136         PR c++/98742
4137         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4138         error_operand_p, remove clause without further checking.  Check
4139         for non-NULL TYPE_NAME.
4141 2021-01-19  Marek Polacek  <polacek@redhat.com>
4143         PR c++/98659
4144         * pt.c (maybe_instantiate_noexcept): Return false if FN is
4145         error_mark_node.
4147 2021-01-19  Marek Polacek  <polacek@redhat.com>
4149         PR c++/98687
4150         * name-lookup.c (push_using_decl_bindings): New, broken out of...
4151         (finish_nonmember_using_decl): ...here.
4152         * name-lookup.h (push_using_decl_bindings): Update declaration.
4153         * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4155 2021-01-19  Patrick Palka  <ppalka@redhat.com>
4157         PR c++/41437
4158         PR c++/58993
4159         * search.c (friend_accessible_p): If scope is a hidden friend
4160         defined inside a dependent class, consider access from the
4161         class.
4162         * parser.c (cp_parser_late_parsing_for_member): Don't push a
4163         dk_no_check access state.
4165 2021-01-19  Marek Polacek  <polacek@redhat.com>
4167         PR c++/98333
4168         * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4169         of NSDMIs before late-parsing of noexcept-specifiers.
4171 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4173         * module.cc (identifier): Merge overloads.
4175 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4177         PR c++/98624
4178         * module.cc (trees_out::write_location): Make static.
4180 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
4182         * parser.c (cp_parser_omp_clause_detach): New.
4183         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4184         (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4185         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4186         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4187         Prevent use of detach with mergeable and overriding the data sharing
4188         mode of the event handle.
4190 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4192         PR c++/98538
4193         * tree.c (cp_build_qualified_type_real): Propagate an array's
4194         dependentness to the copy, if known.
4196 2021-01-15  Jason Merrill  <jason@redhat.com>
4198         PR c++/98642
4199         * call.c (unsafe_return_slot_p): Return int.
4200         (init_by_return_slot_p): Split out from...
4201         (unsafe_copy_elision_p): ...here.
4202         (unsafe_copy_elision_p_opt): New name for old meaning.
4203         (build_over_call): Adjust.
4204         (make_safe_copy_elision): New.
4205         * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4206         list-initialization.
4207         * cp-tree.h: Adjust.
4209 2021-01-15  Jason Merrill  <jason@redhat.com>
4211         * call.c (base_ctor_for, make_base_init_ok): New.
4212         (build_over_call): Use make_base_init_ok.
4214 2021-01-15  Jason Merrill  <jason@redhat.com>
4216         PR c++/63707
4217         * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4218         if we got a CONSTRUCTOR.
4220 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4222         PR c++/98591
4223         * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4225 2021-01-14  Jason Merrill  <jason@redhat.com>
4227         * typeck2.c (process_init_constructor_record): Use fldtype
4228         variable consistently.
4230 2021-01-14  Nathan Sidwell  <nathan@acm.org>
4232         PR c++/98372
4233         * tree.c (cp_tree_equal): Correct map_context logic.
4235 2021-01-13  Marek Polacek  <polacek@redhat.com>
4237         PR c++/98231
4238         * name-lookup.c (push_using_decl_bindings): New.
4239         * name-lookup.h (push_using_decl_bindings): Declare.
4240         * pt.c (tsubst_expr): Call push_using_decl_bindings.
4242 2021-01-13  Nathan Sidwell  <nathan@acm.org>
4244         PR c++/98626
4245         * module.cc (module_add_import_initializers):  Pass a
4246         zero-element argument vector.
4248 2021-01-12  Patrick Palka  <ppalka@redhat.com>
4250         PR c++/98611
4251         * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4252         the template of a CTAD placeholder.
4254 2021-01-12  Marek Polacek  <polacek@redhat.com>
4256         PR c++/98620
4257         * typeck2.c (process_init_constructor_record): Don't emit
4258         -Wmissing-field-initializers warnings in unevaluated contexts.
4260 2021-01-11  Jakub Jelinek  <jakub@redhat.com>
4262         PR c++/98481
4263         * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4264         for types.
4265         (mark_abi_tags_r): Likewise.
4266         * decl2.c (min_vis_r): Likewise.
4267         * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4268         typedefs.
4270 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4272         PR c++/98551
4273         * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4274         instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4276 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4278         PR c++/98515
4279         * semantics.c (check_accessibility_of_qualified_id): Punt if
4280         we're checking access of a scoped non-static member inside a
4281         class template.
4283 2021-01-07  Jakub Jelinek  <jakub@redhat.com>
4285         PR c++/98329
4286         * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4287         cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4288         its location.
4289         (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4291 2021-01-07  Marek Polacek  <polacek@redhat.com>
4293         PR c++/98441
4294         * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4295         !late_return_type block.
4297 2021-01-07  Jason Merrill  <jason@redhat.com>
4299         * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4300         (cxx_eval_store_expression): Add comment.
4302 2021-01-07  Jason Merrill  <jason@redhat.com>
4304         * call.c (has_next): Factor out from...
4305         (next_conversion): ...here.
4306         (strip_standard_conversion): And here.
4307         (is_subseq): And here.
4308         (build_conv): Check it.
4309         (standard_conversion): Don't call build_conv
4310         for ck_identity.
4312 2021-01-06  Martin Sebor  <msebor@redhat.com>
4314         PR c++/95768
4315         * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4317 2021-01-05  Patrick Palka  <ppalka@redhat.com>
4319         * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4320         the type of the NTTP, substitute into the type again.  If the
4321         type is still dependent, don't unify the NTTP.
4323 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4325         * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4326         $(CODYLIB) after $(BACKEND).
4328 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4330         PR c++/98469
4331         * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4332         Punt if lval is true.
4333         * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4334         the result if it has a class type.
4336 2021-01-05  Marek Polacek  <polacek@redhat.com>
4338         PR c++/82099
4339         * pt.c (resolve_overloaded_unification): Call
4340         maybe_instantiate_noexcept after instantiating the function
4341         decl.
4343 2021-01-05  Nathan Sidwell  <nathan@acm.org>
4345         * parser.c (cp_parser_module_declaration): Alter diagnostic
4346         text to say where is permissable.
4348 2021-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4350         PR c++/98316
4351         * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4353 2021-01-02  Jan Hubicka  <jh@suse.cz>
4355         * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4356         * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4357         * tree.c (cp_tree_c_finish_parsing): New function.
4359 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
4361         * ChangeLog-2020: Rotate ChangeLog.  New file.
4364 Copyright (C) 2021 Free Software Foundation, Inc.
4366 Copying and distribution of this file, with or without modification,
4367 are permitted in any medium without royalty provided the copyright
4368 notice and this notice are preserved.