Daily bump.
[official-gcc.git] / gcc / cp / ChangeLog
blobb4acf62d734894a98c3eafb46922f2fac1ba839f
1 2021-10-07  Patrick Palka  <ppalka@redhat.com>
3         PR c++/61355
4         * pt.c (convert_template_argument): Perform array/function to
5         pointer conversion on the substituted type of an NTTP.
7 2021-10-07  Patrick Palka  <ppalka@redhat.com>
9         PR c++/99904
10         * pt.c (is_compatible_template_arg): Set processing_template_decl
11         around tsubst_constraint_info.
13 2021-10-07  Jonathan Wakely  <jwakely@redhat.com>
15         PR c++/102482
16         * init.c (maybe_warn_list_ctor): Do not warn for a reference to
17         a non-const std::initializer_list.
19 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
21         PR c++/102612
22         * parser.c (cp_parser_jump_statement): Implement C++23 P2242R3.
23         Allow goto expressions in constexpr function bodies for C++23.
24         Adjust error message for older standards to mention it.
25         * decl.c (start_decl): Allow static and thread_local declarations
26         in constexpr function bodies for C++23.  Adjust error message for
27         older standards to mention it.
28         * constexpr.c (ensure_literal_type_for_constexpr_object): Allow
29         declarations of variables with non-literal type in constexpr function
30         bodies for C++23.  Adjust error message for older standards to mention
31         it.
32         (cxx_eval_constant_expression) <case DECL_EXPR>: Diagnose declarations
33         of initialization of static or thread_local vars.
34         (cxx_eval_constant_expression) <case GOTO_EXPR>: Diagnose goto
35         statements for C++23.
36         (potential_constant_expression_1) <case DECL_EXPR>: Swap the
37         CP_DECL_THREAD_LOCAL_P and TREE_STATIC checks.
38         (potential_constant_expression_1) <case LABEL_EXPR>: Allow labels for
39         C++23.  Adjust error message for older standards to mention it.
41 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
42             Jason Merrill  <jason@redhat.com>
44         PR c++/98712
45         PR c++/102490
46         * cp-tree.h (maybe_synthesize_method): Declare.
47         * method.c (genericize_spaceship): Use
48         LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
49         LOOKUP_NORMAL for flags.
50         (comp_info): Remove defining member.  Add complain, code, retcat.
51         (comp_info::comp_info): Adjust.
52         (do_one_comp): Split out from build_comparison_op.   Use
53         LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
54         LOOKUP_NORMAL for flags.
55         (build_comparison_op): Add defining argument. Adjust comp_info
56         construction.  Use defining instead of info.defining.  Assert that
57         if defining, ctype is a complete type.  Walk base binfos.
58         (synthesize_method, maybe_explain_implicit_delete,
59         explain_implicit_non_constexpr): Adjust build_comparison_op callers.
60         (maybe_synthesize_method): New function.
61         * class.c (check_bases_and_members): Don't call defaulted_late_check
62         for sfk_comparison.
63         (finish_struct_1): Call it here instead after class has been
64         completed.
65         * pt.c (maybe_instantiate_noexcept): Call maybe_synthesize_method
66         instead of synthesize_method.
68 2021-10-05  Jakub Jelinek  <jakub@redhat.com>
70         PR c++/102548
71         * tree.c (apply_identity_attributes): Fix handling of the
72         case where an attribute in the list doesn't affect type
73         identity but some attribute before it does.
75 2021-10-05  Patrick Palka  <ppalka@redhat.com>
77         PR c++/102547
78         * constexpr.c (potential_constant_expression_1): Handle
79         NONTYPE_ARGUMENT_PACK.
81 2021-10-05  Patrick Palka  <ppalka@redhat.com>
83         PR c++/98930
84         * pt.c (has_value_dependent_address): Return true for a static
85         local variable from a function template.
87 2021-10-04  Marek Polacek  <polacek@redhat.com>
89         PR c++/97573
90         * typeck.c (cp_build_binary_op): Call do_warn_array_compare.
92 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
94         PR c++/101765
95         * coroutines.cc (register_local_var_uses): Emit a sorry if
96         we encounter a VLA in the coroutine local variables.
98 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
100         PR c++/99710
101         * coroutines.cc (await_statement_walker): Report an error if
102         an await expression is found in a handler body.
104 2021-10-03  John Eivind Helset  <jehelset@gmail.com>
106         PR c++/100673
107         * coroutines.cc (build_co_await): Guard against NULL
108         await_suspend types.
110 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
112         PR c++/101133
113         * coroutines.cc (build_co_await): Mark co_await_expr trees
114         with TREE_SIDE_EFFECTS, also mark any containing expression.
115         (finish_co_await_expr): Mark type-dependent co_await_expr
116         trees with TREE_SIDE_EFFECTS.
118 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
120         PR c++/99575
121         * coroutines.cc (build_co_await): Strip NOPs from
122         candidate awaiter expressions before testing to see
123         if they need a temporary.
125 2021-10-01  Martin Sebor  <msebor@redhat.com>
127         PR c/102103
128         * typeck.c (warn_for_null_address): Enhance.
129         (cp_build_binary_op): Call it also for member pointers.
131 2021-10-01  qingzhe huang  <nickhuang99@hotmail.com>
133         PR c++/101783
134         * tree.c (cp_build_qualified_type_real): Exclude typedef from
135         error.
137 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
138             Richard Biener  <rguenther@suse.de>
140         PR sanitizer/102515
141         * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
142         for division even for SANITIZE_SI_OVERFLOW.
144 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
146         * parser.c (cp_parser_omp_clause_order): Set
147         OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
149 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
151         PR c++/102496
152         * name-lookup.c (push_local_extern_decl_alias): Return early even for
153         tls vars with non-dependent type when processing_template_decl.  For
154         CP_DECL_THREAD_LOCAL_P vars call set_decl_tls_model on alias.
156 2021-09-30  Patrick Palka  <ppalka@redhat.com>
158         PR c++/102535
159         * method.c (is_xible_helper): Don't exit early for multi-arg
160         ctors in C++20.
162 2021-09-30  Patrick Palka  <ppalka@redhat.com>
164         * parser.c (cp_parser_trait_expr): Call nreverse on the reversed
165         list of trailing arguments.
167 2021-09-30  Patrick Palka  <ppalka@redhat.com>
169         PR c++/95567
170         * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields.
172 2021-09-28  Patrick Palka  <ppalka@redhat.com>
174         PR c++/99909
175         * pt.c (coerce_template_template_parms): Keep
176         processing_template_decl set around the call to unify as well.
178 2021-09-28  Iain Sandoe  <iain@sandoe.co.uk>
180         PR c++/102454
181         * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
182         unnamed function params.
183         (morph_fn_to_coro): Do not try to set a guard variable for param
184         DTORs in the ramp, unless we have exceptions active.
186 2021-09-27  Patrick Palka  <ppalka@redhat.com>
188         PR c++/102479
189         * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
190         Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
191         rewritten ttp.
192         (alias_ctad_tweaks): Set current_template_parms accordingly.
194 2021-09-23  Michel Morin  <mimomorin@gmail.com>
196         * parser.c (cp_keyword_starts_decl_specifier_p): Do not
197         handle RID_ATTRIBUTE.
198         (cp_parser_constructor_declarator_p): Remove now-redundant
199         checks.
200         (cp_parser_lambda_declarator_opt): Likewise.
202 2021-09-23  Michel Morin  <mimomorin@gmail.com>
204         PR c++/77565
205         * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
206         decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
208 2021-09-23  Patrick Palka  <ppalka@redhat.com>
210         * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
211         a TEMPLATE_DECL.  Dump the DECL_TEMPLATE_INFO rather than just
212         printing its pointer value.
214 2021-09-23  Jakub Jelinek  <jakub@redhat.com>
216         PR c++/102413
217         * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
218         is not followed by a balanced token sequence starting with open paren.
220 2021-09-22  Patrick Palka  <ppalka@redhat.com>
222         DR 2446
223         PR c++/102412
224         * constexpr.c (cxx_eval_constant_expression)
225         <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
226         instead of processing_template_decl.
227         * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
228         Return true only if any_dependent_template_arguments_p.
229         (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
230         <case TEMPLATE_ID_EXPR>: Likewise.
232 2021-09-22  Jakub Jelinek  <jakub@redhat.com>
234         * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
235         modifiers.
236         * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
237         semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
238         * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
239         also OMP_CLAUSE_ALLOCATE_ALIGN.
241 2021-09-22  Barrett Adair  <barrettellisadair@gmail.com>
243         * pt.c (find_parm_usage_r): New walk_tree callback to find func
244         parms.
245         (any_template_arguments_need_structural_equality_p): New special
246         case.
248 2021-09-21  wangpc  <pc.wang@linux.alibaba.com>
250         * decl.c (start_decl_1): Move verify_type_context to ...
251         (cp_finish_decl): ... to here.
253 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
255         * parser.c (cp_parser_omp_clause_order): Parse unconstrained
256         and reproducible modifiers.
257         (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
259 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
261         * parser.c (cp_parser_omp_clause_default): Handle private and
262         firstprivate arguments, adjust diagnostics on unknown argument.
263         * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
265 2021-09-18  Jason Merrill  <jason@redhat.com>
267         * cp-tree.h (dependentish_scope_p): Declare.
268         * pt.c (dependentish_scope_p): New.
269         * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
270         for lookup of a type in a dependent object.
271         (cp_parser_template_id): Handle TYPENAME_TYPE.
272         (cp_parser_template_name): If we're looking for a type,
273         a name followed by < names a template.
275 2021-09-18  Jason Merrill  <jason@redhat.com>
277         * cp-tree.h: Fix typo in LANG_FLAG list.
279 2021-09-17  Jakub Jelinek  <jakub@redhat.com>
281         * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
282         * parser.c (cp_parser_omp_atomic): Update function comment for
283         OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
284         weak clauses.
285         * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
286         them, handle COND_EXPRs.
287         * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
288         finish_omp_atomic can now produce.
290 2021-09-16  Patrick Palka  <ppalka@redhat.com>
292         PR c++/98486
293         * constraint.cc (get_normalized_constraints_from_decl): Always
294         look up constraints using the most general template.
295         * decl.c (grokdeclarator): Set constraints on a static data
296         member template.
297         * pt.c (determine_specialization): Check constraints on a
298         variable template.
300 2021-09-16  Iain Sandoe  <iain@sandoe.co.uk>
302         * coroutines.cc (await_statement_walker): Code cleanups.
304 2021-09-16  Jason Merrill  <jason@redhat.com>
306         * constexpr.c (cxx_eval_outermost_constant_expr): Use
307         protected_set_expr_location.
309 2021-09-15  Patrick Palka  <ppalka@redhat.com>
311         PR c++/101904
312         * call.c (build_user_type_conversion_1): Add tf_conv to complain.
313         (add_candidates): When in a SFINAE context, instead of adding a
314         candidate to bad_fns just mark it unviable.
316 2021-09-15  Jason Merrill  <jason@redhat.com>
318         * cp-tree.h (parsing_function_declarator): Declare.
319         * name-lookup.c (set_decl_context_in_fn): Use it.
320         * parser.c (cp_parser_direct_declarator): Use it.
321         (parsing_function_declarator): New.
323 2021-09-15  Jakub Jelinek  <jakub@redhat.com>
325         PR c++/88578
326         PR c++/102295
327         * typeck2.c (split_nonconstant_init_1): Don't throw away empty
328         initializers of flexible array members if they have non-zero type
329         size.
331 2021-09-15  Patrick Palka  <ppalka@redhat.com>
333         PR c++/102050
334         * decl.c (grok_special_member_properties): Set
335         TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
336         and TYPE_HAS_LIST_CTOR independently from each other.
338 2021-09-15  Jason Merrill  <jason@redhat.com>
340         * decl.c (cxx_init_decl_processing): Only warn about odd
341         interference sizes if they were specified with --param.
343 2021-09-15  Jason Merrill  <jason@redhat.com>
345         PR c++/48396
346         * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
347         (type_info_ptr_type): Remove.
348         * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
349         (typeid_ok_p): Check for null const_type_info_type_node.
350         (type_info_ptr_type, get_void_tinfo_ptr): New fns.
351         (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
352         (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
353         (get_tinfo_desc): Use const_ptr_type_node.
355 2021-09-15  Jason Merrill  <jason@redhat.com>
357         * parser.c (cp_parser_template_name): Move object type.
358         (cp_parser_pre_parsed_nested_name_specifier): Likewise.
360 2021-09-15  Jason Merrill  <jason@redhat.com>
362         * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
363         a declarator.
365 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
367         * coroutines.cc (struct param_info): Add copy_var.
368         (build_actor_fn): Use simplified param references.
369         (register_param_uses): Likewise.
370         (rewrite_param_uses): Likewise.
371         (analyze_fn_parms): New function.
372         (coro_rewrite_function_body): Add proxies for the fn
373         parameters to the outer bind scope of the rewritten code.
374         (morph_fn_to_coro): Use simplified version of param ref.
376 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
378         * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
379         coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
380         coro_self_handle_id, coro_actor_continue_id,
381         coro_frame_i_a_r_c_id): New.
382         (coro_init_identifiers): Initialize new name identifiers.
383         (coro_promise_type_found_p): Use pre-built identifiers.
384         (struct await_xform_data): Remove unused fields.
385         (transform_await_expr): Delete code that is now unused.
386         (build_actor_fn): Simplify interface, use pre-built identifiers and
387         remove transforms that are no longer needed.
388         (build_destroy_fn): Use revised field names.
389         (register_local_var_uses): Use pre-built identifiers.
390         (coro_rewrite_function_body): Simplify interface, use pre-built
391         identifiers.  Generate proxy vars in the outer bind expr scope for the
392         implementation state that we wish to expose.
393         (morph_fn_to_coro): Adjust comments for new variable names, use pre-
394         built identifiers.  Remove unused code to generate frame entries for
395         the implementation state.  Adjust call for build_actor_fn.
397 2021-09-14  Patrick Palka  <ppalka@redhat.com>
399         PR c++/102163
400         * constexpr.c (cxx_eval_call_expression): After evaluating a
401         subobject constructor call for an empty union member, produce a
402         side effect that makes sure the member gets activated.
404 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
406         PR c++/102295
407         * decl.c (layout_var_decl): For aggregates ending with a flexible
408         array member, add the size of the initializer for that member to
409         DECL_SIZE and DECL_SIZE_UNIT.
411 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
413         PR c++/102305
414         * method.c (is_xible_helper): Call complete_type on to.
416 2021-09-14  Jason Merrill  <jason@redhat.com>
418         * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
419         size is smaller than maxalign.
421 2021-09-13  Jason Merrill  <jason@redhat.com>
423         * constexpr.c (maybe_warn_about_constant_value):
424         Complain about std::hardware_destructive_interference_size.
425         (cxx_eval_constant_expression): Call it.
426         * decl.c (cxx_init_decl_processing): Check
427         --param *-interference-size values.
429 2021-09-13  Patrick Palka  <ppalka@redhat.com>
431         PR c++/101764
432         * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
433         macro.
434         * pt.c (has_extra_args_mechanism_p): New function.
435         (find_parameter_pack_data::found_extra_args_tree_p): New data
436         member.
437         (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
438         appropriately.
439         (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
440         ppd.found_extra_args_tree_p.
441         (use_pack_expansion_extra_args_p): Return true if there were
442         unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
443         (tsubst_pack_expansion): Pass the pack expansion to
444         use_pack_expansion_extra_args_p.
446 2021-09-10  Jakub Jelinek  <jakub@redhat.com>
448         * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
449         and acq_rel/acquire clauses on update.
450         * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
452 2021-09-08  Richard Biener  <rguenther@suse.de>
454         PR c++/102228
455         * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
456         * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
457         place on invalid code.
458         * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
459         access.
460         * module.cc (trees_in::read_class_def): Likewise.  Reconstruct
461         ANON_AGGR_TYPE_FIELD.
462         * semantics.c (finish_member_declaration): Populate
463         ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
464         * typeck.c (lookup_anon_field): Remove DFS search and return
465         ANON_AGGR_TYPE_FIELD directly.
467 2021-09-07  Jakub Jelinek  <jakub@redhat.com>
469         PR c++/100495
470         * constexpr.c (maybe_save_constexpr_fundef): Save body even for
471         constexpr deleting dtors.
472         (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
473         deleting dtors.
475 2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>
477         * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
478         directive.
479         * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
481 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
483         * coroutines.cc (register_local_var_uses): Do not mangle
484         frame entries for the outermost scope.  Record the outer
485         scope as nesting depth 0.
487 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
489         * coroutines.cc (coro_build_artificial_var): New.
490         (build_actor_fn): Use var builder, rename vars to use
491         implementation namespace.
492         (coro_rewrite_function_body): Likewise.
493         (morph_fn_to_coro): Likewise.
495 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
497         * coroutines.cc (transform_local_var_uses): Record
498         frame offset expressions as DECL_VALUE_EXPRs instead of
499         rewriting them.
501 2021-09-03  Patrick Palka  <ppalka@redhat.com>
503         PR c++/101904
504         * call.c (build_this_conversion): New function, split out from
505         add_function_candidate.
506         (add_function_candidate): New parameter shortcut_bad_convs.
507         Document it.  Use build_this_conversion.  Stop at the first bad
508         argument conversion when shortcut_bad_convs is true.
509         (add_template_candidate_real): New parameter shortcut_bad_convs.
510         Use build_this_conversion to check the 'this' conversion before
511         attempting deduction.  When the rejection reason code is
512         rr_bad_arg_conversion, pass -1 instead of 0 as the viable
513         parameter to add_candidate.  Pass 'convs' to add_candidate.
514         (add_template_candidate): New parameter shortcut_bad_convs.
515         (add_template_conv_candidate): Pass false as shortcut_bad_convs
516         to add_template_candidate_real.
517         (add_candidates): Prefer to shortcut bad conversions during
518         overload resolution under the assumption that we'll eventually
519         see a strictly viable candidate.  If this assumption turns out
520         to be false, re-process the non-strictly viable candidates
521         without shortcutting those bad conversions.
523 2021-09-03  Jason Merrill  <jason@redhat.com>
525         * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
526         we decide not to instantiate.
528 2021-09-03  Jakub Jelinek  <jakub@redhat.com>
530         PR target/102024
531         * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
532         instead of writing to DECL_FIELD_ABI_IGNORED.
533         (layout_class_type): Likewise.  In the place where zero-width
534         bitfields used to be removed, use
535         SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
537 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
539         * call.c (build_over_call): Handle unavailable state in addition to
540         deprecation.
541         * class.c (type_build_ctor_call): Likewise.
542         (type_build_dtor_call): Likewise.
543         * cp-tree.h: Rename cp_warn_deprecated_use to
544         cp_handle_deprecated_or_unavailable.
545         * decl.c (duplicate_decls): Merge unavailability.
546         (grokdeclarator): Handle unavailability in addition to deprecation.
547         (type_is_unavailable): New.
548         (grokparms): Handle unavailability in addition to deprecation.
549         * decl.h (enum deprecated_states): Add
550         UNAVAILABLE_DEPRECATED_SUPPRESS.
551         * decl2.c (cplus_decl_attributes): Propagate unavailability to
552         templates.
553         (cp_warn_deprecated_use): Rename to ...
554         (cp_handle_deprecated_or_unavailable): ... this and amend to handle
555         the unavailable case. It remains a warning in the case of deprecation
556         but becomes an error in the case of unavailability.
557         (cp_warn_deprecated_use_scopes): Handle unavailability.
558         (mark_used): Likewise.
559         * parser.c (cp_parser_template_name): Likewise.
560         (cp_parser_template_argument): Likewise.
561         (cp_parser_parameter_declaration_list): Likewise.
562         * typeck.c (build_class_member_access_expr): Likewise.
563         (finish_class_member_access_expr): Likewise.
564         * typeck2.c (build_functional_cast_1): Likewise.
566 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
568         * coroutines.cc (build_actor_fn): Add begin/finish clauses
569         to the initial test in the actor function.
571 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
573         * coroutines.cc (await_statement_walker): Use build_stmt and
574         add_stmt instead of build1 and finish_expr_stmt.
576 2021-08-31  Jason Merrill  <jason@redhat.com>
578         * coroutines.cc (flatten_await_stmt): Fix copyo.
579         * decl.c (reshape_init_class): Simplify.
580         * module.cc (module_state::read_language): Add null check.
581         * parser.c (build_range_temp): Avoid type_uses_auto.
582         (cp_parser_class_specifier_1): Add null check.
584 2021-08-31  Patrick Palka  <ppalka@redhat.com>
586         PR c++/12672
587         * call.c (rejection_reason::call_varargs_p): Rename this
588         previously unused member to ...
589         (rejection_reason::least_p): ... this.
590         (arity_rejection): Add least_p parameter.
591         (add_template_candidate_real): When there are explicit
592         template arguments, check that the arity of the call agrees with
593         the arity of the function before attempting deduction.
594         (print_arity_information): Add least_p parameter.
595         (print_z_candidate): Adjust call to print_arity_information.
597 2021-08-31  Martin Sebor  <msebor@redhat.com>
599         * parser.c (cp_parser_selection_statement): Use direct initialization
600         instead of copy.
602 2021-08-31  Jason Merrill  <jason@redhat.com>
604         * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
606 2021-08-31  Jason Merrill  <jason@redhat.com>
608         PR c++/92193
609         * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
610         * constexpr.c (cxx_eval_call_expression): Set it.
611         * pt.c (neglectable_inst_p): Check it.
613 2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>
615         * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
616         and 'ancestor' in 'target device' clauses.
617         * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
618         evaluate to '1' if 'ancestor' is used.
620 2021-08-30  Jason Merrill  <jason@redhat.com>
622         PR c++/96286
623         * cp-tree.h (struct lang_type): Add erroneous bit-field.
624         (CLASSTYPE_ERRONEOUS): New.
625         * pt.c (limit_bad_template_recursion): Check it.
626         (instantiate_class_template_1): Set it.
628 2021-08-30  Jason Merrill  <jason@redhat.com>
630         * constexpr.c (cxx_eval_outermost_constant_expr): Copy
631         expr location to result.
633 2021-08-30  Jason Merrill  <jason@redhat.com>
635         PR c++/101460
636         * cp-tree.h (cxx_constant_value_sfinae): Declare.
637         * constexpr.c (cxx_constant_value_sfinae): New.
638         * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
639         (tsubst_copy_and_build) [CALL_EXPR]: Call
640         maybe_fold_fn_template_args.
642 2021-08-30  Jason Merrill  <jason@redhat.com>
644         * parser.c (cp_parser_simple_requirement): Warn about missing
645         requires.
647 2021-08-27  Jason Merrill  <jason@redhat.com>
649         * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
650         a dependent pointer.
652 2021-08-25  Andrew Pinski  <apinski@marvell.com>
654         PR c++/66590
655         * cp-objcp-common.c (cxx_block_may_fallthru): Handle
656         CLEANUP_STMT for the case which will be try/finally.
658 2021-08-25  Jakub Jelinek  <jakub@redhat.com>
660         PR c++/102019
661         * init.c (build_value_init_noctor): Ignore unnamed zero-width
662         bitfields.
664 2021-08-23  Jakub Jelinek  <jakub@redhat.com>
666         * parser.c (cp_parser_omp_clause_num_tasks,
667         cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
669 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
671         * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
672         PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
673         (cp_parser_omp_error): New function.
674         (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
676 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
678         * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
679         comma at the end of list.  Don't parse closing paren here...
680         (cp_parser_omp_clause_depend): ... but here instead.
682 2021-08-19  Patrick Palka  <ppalka@redhat.com>
684         PR c++/101803
685         * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
687 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
689         * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
690         and optionally consume token if current token is CPP_EOF,
691         CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
693 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
695         * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
696         instead of cp_parser_skip_to_pragma_eol.
698 2021-08-18  Patrick Palka  <ppalka@redhat.com>
700         PR c++/101344
701         PR c++/101803
702         * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
703         * decl.c (reshape_init_r): Set it.
704         * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
705         iff CONSTRUCTOR_BRACES_ELIDED_P.
707 2021-08-18  Patrick Palka  <ppalka@redhat.com>
709         PR c++/101883
710         * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
711         do_auto_deduction.
713 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
715         * parser.c (cp_parser_omp_nothing): New function.
716         (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
718 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
720         * parser.c (cp_parser_omp_ordered): Return true instead of
721         false after emitting errors that the directive is not allowed in
722         pragma_stmt context.
723         (cp_parser_omp_target_update): Likewise.
724         (cp_parser_omp_cancellation_point): Change return type from void to
725         bool, return false if the directive should be ignored in pragma_stmt
726         contexts.
727         (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
728         Change return type from tree to bool, return false if the
729         directive should be ignored in pragma_stmt contexts.
730         (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
731         return their result directly.
732         (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
733         cp_parser_omp_cancellation_point returned.  Return true instead of
734         false after emitting errors that the directive is not allowed in
735         pragma_stmt context.
737 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
739         PR c++/101539
740         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
741         (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
742         (fold_builtin_is_corresponding_member, next_common_initial_seqence,
743         layout_compatible_type_p): Declare.
744         * parser.c (cp_parser_primary_expression): Handle
745         RID_IS_LAYOUT_COMPATIBLE.
746         (cp_parser_trait_expr): Likewise.
747         * cp-objcp-common.c (names_builtin_p): Likewise.
748         * constraint.cc (diagnose_trait_expr): Handle
749         CPTK_IS_LAYOUT_COMPATIBLE.
750         * decl.c (cxx_init_decl_processing): Register
751         __builtin_is_corresponding_member builtin.
752         * constexpr.c (cxx_eval_builtin_function_call): Handle
753         CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
754         * semantics.c (is_corresponding_member_union,
755         is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
756         New functions.
757         (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
758         (finish_trait_expr): Likewise.
759         * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
760         New functions.
761         * cp-gimplify.c (cp_gimplify_expr): Fold
762         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
763         (cp_fold): Likewise.
764         * tree.c (builtin_valid_in_constant_expr_p): Handle
765         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
766         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
767         CPTK_IS_LAYOUT_COMPATIBLE.
768         * class.c (remove_zero_width_bit_fields): Remove.
769         (layout_class_type): Don't call it.
771 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
773         * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
774         (cp_parser_omp_scope): New function.
775         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
776         * pt.c (tsubst_expr): Handle OMP_SCOPE.
778 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
780         * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
781         (cp_parser_omp_clause_filter): New function.
782         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
783         (OMP_MASKED_CLAUSE_MASK): Define.
784         (cp_parser_omp_masked): New function.
785         (cp_parser_omp_parallel): Handle parallel masked.
786         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
787         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
788         * pt.c (tsubst_omp_clauses): Likewise.
789         (tsubst_expr): Handle OMP_MASKED.
791 2021-08-12  Sergei Trofimovich  <siarheit@google.com>
793         PR c++/101219
794         * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
795         to construct ptrmemfunc expression instantiation.
797 2021-08-12  Tobias Burnus  <tobias@codesourcery.com>
799         * parser.c (cp_parser_omp_clause_proc_bind): Accept
800         'primary' as alias for 'master'.
802 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
804         * cp-tree.h (omp_declare_target_attr): New type.
805         (struct saved_scope): Change type of omp_declare_target_attribute
806         from int to vec<omp_declare_target_attr, va_gc> * and move it.
807         * parser.c (cp_parser_omp_declare_target): Instead of
808         incrementing scope_chain->omp_declare_target_attribute, push
809         a struct containing parser->lexer->in_omp_attribute_pragma to
810         the vector.
811         (cp_parser_omp_end_declare_target): Instead of decrementing
812         scope_chain->omp_declare_target_attribute, pop a structure
813         from it.  Diagnose mismatching declare target vs.
814         end declare target syntax.
815         * semantics.c (finish_translation_unit): Use vec_safe_length
816         and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
817         * decl2.c (cplus_decl_attributes): Use vec_safe_length
818         on scope_chain->omp_declare_target_attributes.
820 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
822         * parser.c (cp_parser_lambda_body): Add temp overrides
823         for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
824         (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
825         cp_parser_declaration_statement.
826         (cp_parser_default_argument): Add temp override for
827         parser->omp_attrs_forbidden_p.
828         (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
829         or declare variant in attribute syntax on a declaration immediately
830         following an OpenMP construct in pragma syntax.
832 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
834         PR c++/94162
835         * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
836         or for classes not in std namespace.
838 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
840         * name-lookup.c (finish_using_directive): Diagnose omp::directive
841         or omp::sequence attributes on using-directive.
843 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
845         * parser.c (cp_parser_block_declaration): Call
846         cp_parser_using_directive for C++11 attributes followed by
847         using namespace tokens.
848         (cp_parser_using_directive): Parse C++11 attributes at the start
849         of the directive rather than at the end, only parse GNU attributes
850         at the end.
852 2021-08-12  Patrick Palka  <ppalka@redhat.com>
854         PR c++/101663
855         * constexpr.c (cxx_eval_store_expression): Handle the lval=true
856         case in the early exit code path for empty stores with mismatched
857         types.
859 2021-08-11  Patrick Palka  <ppalka@redhat.com>
861         PR c++/101725
862         DR 2082
863         * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
864         * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
865         operands.
866         * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
867         reject uses of local variables in unevaluated contexts.
868         * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
869         cp_unevaluated_operand.  Use cp_walk_tree directly instead of
870         WALK_SUBTREE to avoid the goto.  Use REQUIRES_EXPR_REQS instead
871         of TREE_OPERAND directly.
873 2021-08-11  Jakub Jelinek  <jakub@redhat.com>
875         PR c++/101786
876         * decl2.c (var_defined_without_dynamic_init): Return true for
877         DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
879 2021-08-11  Patrick Palka  <ppalka@redhat.com>
881         PR c++/79501
882         * parser.c (maybe_adjust_declarator_for_dguide): New, split
883         out from ...
884         (cp_parser_init_declarator): ... here.
885         (cp_parser_member_declaration): Use it.
887 2021-08-11  Patrick Palka  <ppalka@redhat.com>
889         PR c++/89062
890         * parser.c (cp_parser_parameter_declaration_list): Don't call
891         grokdeclarator if cp_parser_error_occurred.
892         (cp_parser_parameter_declaration): Simulate an error if we see
893         the beginning of a CTAD form, i.e. if we see an opening brace
894         after the decl-specifier-seq and the type is a CTAD placeholder.
896 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
898         * parser.c (cp_parser_member_declaration): Move odsd declaration
899         before cp_parser_using_declaration call to avoid errors with
900         GCC 4.8 to 6.
902 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
904         * parser.h (struct cp_omp_declare_simd_data): Remove
905         in_omp_attribute_pragma and clauses members, add loc and attribs.
906         (struct cp_oacc_routine_data): Remove loc member, add clauses
907         member.
908         * parser.c (cp_finalize_omp_declare_simd): New function.
909         (cp_parser_handle_statement_omp_attributes): Mention in
910         function comment the function is used also for
911         attribute-declaration.
912         (cp_parser_handle_directive_omp_attributes): New function.
913         (cp_parser_statement): Don't call
914         cp_parser_handle_statement_omp_attributes if statement doesn't
915         have attribute-specifier-seq at the beginning at all or if
916         if those attributes don't appertain to the statement.
917         (cp_parser_simple_declaration): Call
918         cp_parser_handle_directive_omp_attributes and
919         cp_finalize_omp_declare_simd.
920         (cp_parser_explicit_instantiation): Likewise.
921         (cp_parser_init_declarator): Initialize prefix_attributes
922         only after parsing declarators.
923         (cp_parser_direct_declarator): Call
924         cp_parser_handle_directive_omp_attributes and
925         cp_finalize_omp_declare_simd.
926         (cp_parser_member_declaration): Likewise.
927         (cp_parser_single_declaration): Likewise.
928         (cp_parser_omp_declare_simd): Don't initialize
929         data.in_omp_attribute_pragma, instead initialize
930         data.attribs[0] and data.attribs[1].
931         (cp_finish_omp_declare_variant): Remove
932         in_omp_attribute_pragma argument, instead use
933         parser->lexer->in_omp_attribute_pragma.
934         (cp_parser_late_parsing_omp_declare_simd): Adjust
935         cp_finish_omp_declare_variant caller.  Handle attribute-syntax
936         declare simd/variant.
938 2021-08-06  Tamar Christina  <tamar.christina@arm.com>
940         * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
941         * decl.c (cxx_simulate_enum_decl): Likewise.
943 2021-08-04  Jakub Jelinek  <jakub@redhat.com>
945         PR c++/101759
946         * parser.c (cp_parser_default_argument): Temporarily override
947         parser->omp_declare_simd and parser->oacc_routine to NULL.
949 2021-08-02  Patrick Palka  <ppalka@redhat.com>
951         PR c++/100828
952         * logic.cc (formula::formula): Use emplace_back instead of
953         push_back.
954         (formula::branch): Insert a copy of m_current directly after
955         m_current instead of at the end of the list.
956         (formula::erase): Define.
957         (decompose_formula): Remove.
958         (decompose_antecedents): Remove.
959         (decompose_consequents): Remove.
960         (derive_proofs): Remove.
961         (max_problem_size): Remove.
962         (diagnose_constraint_size): Remove.
963         (subsumes_constraints_nonnull): Rewrite directly in terms of
964         decompose_clause and derive_proof, interleaving decomposition
965         with implication checking.  Remove limit on constraint complexity.
966         Use formula::erase to free the current clause before moving on to
967         the next one.
969 2021-07-31  Jason Merrill  <jason@redhat.com>
971         PR c++/96636
972         * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
973         after error.
975 2021-07-31  Jason Merrill  <jason@redhat.com>
977         * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
978         PACK_EXPANSION_PATTERN.
980 2021-07-31  Jakub Jelinek  <jakub@redhat.com>
982         * parser.c (cp_parser_declaration): Handle OpenMP directives
983         in attribute-declaration.
985 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
987         PR c++/101539
988         * cp-tree.h (enum cp_trait_kind): Add
989         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
990         (enum cp_built_in_function): Add
991         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
992         (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
993         * parser.c (cp_parser_primary_expression): Handle
994         RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
995         (cp_parser_trait_expr): Likewise.
996         * cp-objcp-common.c (names_builtin_p): Likewise.
997         * constraint.cc (diagnose_trait_expr): Handle
998         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
999         * decl.c (cxx_init_decl_processing): Register
1000         __builtin_is_pointer_interconvertible_with_class builtin.
1001         * constexpr.c (cxx_eval_builtin_function_call): Handle
1002         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
1003         * semantics.c (pointer_interconvertible_base_of_p,
1004         first_nonstatic_data_member_p,
1005         fold_builtin_is_pointer_inverconvertible_with_class): New functions.
1006         (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1007         (finish_trait_expr): Likewise.  Formatting fix.
1008         * cp-gimplify.c (cp_gimplify_expr): Fold
1009         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
1010         fndecl_built_in_p just once.
1011         (cp_fold): Likewise.
1012         * tree.c (builtin_valid_in_constant_expr_p): Handle
1013         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
1014         fndecl_built_in_p just once.
1015         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1016         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1018 2021-07-30  Jason Merrill  <jason@redhat.com>
1020         * class.c (finish_struct_anon): Improve comment.
1021         * decl.c (fixup_anonymous_aggr): Reject anonymous struct
1022         with bases.
1024 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
1026         * parser.c (cp_parser_statement): Rollback attributes not just
1027         when std_attrs is non-NULL, but whenever
1028         cp_parser_std_attribute_spec_seq parsed any tokens.
1030 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
1032         PR c++/101582
1033         * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
1034         declaration.
1035         (cp_parser_declaration): Parse empty-declaration and
1036         attribute-declaration.
1037         (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
1039 2021-07-28  Martin Sebor  <msebor@redhat.com>
1041         * init.c: Include new header.
1043 2021-07-27  Marek Polacek  <polacek@redhat.com>
1045         DR 1512
1046         PR c++/99701
1047         * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
1048         a switch.
1049         * typeck.c (cp_build_binary_op): Reject ordered comparison
1050         of two null pointers.
1052 2021-07-26  Jakub Jelinek  <jakub@redhat.com>
1054         * parser.h (struct cp_lexer): Add orphan_p member.
1055         * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
1056         upon restart from CPP_PRAGMA handling.  Fix up condition when a lexer
1057         should be destroyed and adjust saved_tokens if it records tokens from
1058         the to be destroyed lexer.
1059         (cp_parser_omp_section_scan): New function.
1060         (cp_parser_omp_scan_loop_body): Use it.  If
1061         parser->lexer->in_omp_attribute_pragma, allow optional comma
1062         after scan.
1063         (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
1065 2021-07-23  Jakub Jelinek  <jakub@redhat.com>
1067         * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
1068         * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
1069         mixing of attribute and pragma syntax directives when seeing
1070         omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
1071         directives are followed by OpenMP pragma.
1072         (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
1073         the cp_parser_handle_statement_omp_attributes call.
1074         (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
1075         if true, set parser->omp_attrs_forbidden_p.
1076         (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
1077         false as disallow_omp_attrs to cp_parser_omp_structured_block.
1078         (cp_parser_omp_parallel, cp_parser_omp_task): Set
1079         parser->omp_attrs_forbidden_p.
1081 2021-07-21  Thomas Schwinge  <thomas@codesourcery.com>
1082             Joseph Myers  <joseph@codesourcery.com>
1083             Cesar Philippidis  <cesar@codesourcery.com>
1085         * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
1086         (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
1087         (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
1088         * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
1089         * semantics.c (finish_omp_clauses): Likewise.
1091 2021-07-21  Jakub Jelinek  <jakub@redhat.com>
1093         PR c++/101516
1094         * semantics.c (finish_omp_reduction_clause): Also call
1095         complete_type_or_else and return true if it fails.
1097 2021-07-19  Iain Sandoe  <iain@sandoe.co.uk>
1099         PR c++/95520
1100         * coroutines.cc (struct coroutine_info): Add fields for
1101         actor and destroy function decls.
1102         (to_ramp): New.
1103         (coro_get_ramp_function): New.
1104         (coro_get_actor_function): New.
1105         (coro_get_destroy_function): New.
1106         (act_des_fn): Set up mapping between ramp, actor and
1107         destroy functions.
1108         (morph_fn_to_coro): Adjust interface to the builder for
1109         helper function decls.
1110         * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
1111         JOIN_STR): New.
1112         * mangle.c (write_encoding): Handle coroutine helpers.
1113         (write_unqualified_name): Handle lambda coroutine helpers.
1115 2021-07-16  Patrick Palka  <ppalka@redhat.com>
1117         PR c++/101233
1118         * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
1119         substituting DECL_ARGUMENTS.
1121 2021-07-16  Patrick Palka  <ppalka@redhat.com>
1123         DR 960
1124         PR c++/99664
1125         * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
1126         when the return types are references.
1128 2021-07-16  Marek Polacek  <polacek@redhat.com>
1130         * typeck2.c (check_narrowing): Don't suppress the pedantic error
1131         in system headers.
1133 2021-07-15  Jakub Jelinek  <jakub@redhat.com>
1135         PR c++/101443
1136         * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
1137         operands, fold them right away to true or false.
1139 2021-07-15  Jason Merrill  <jason@redhat.com>
1141         PR c++/101095
1142         * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
1143         (cp_tree_size): Remove redundant entries.
1145 2021-07-14  Patrick Palka  <ppalka@redhat.com>
1147         PR c++/88252
1148         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
1149         * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1150         handling.
1151         (redeclare_class_template): Likewise.
1152         (forwarding_reference_p): Define.
1153         (maybe_adjust_types_for_deduction): Use it instead.  Add 'tparms'
1154         parameter.
1155         (unify_one_argument): Pass tparms to
1156         maybe_adjust_types_for_deduction.
1157         (try_one_overload): Likewise.
1158         (unify): Likewise.
1159         (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1160         handling.
1162 2021-07-14  Jason Merrill  <jason@redhat.com>
1164         * class.c (struct find_final_overrider_data): Use auto_vec.
1165         (find_final_overrider): Remove explicit release.
1166         * coroutines.cc (process_conditional): Use auto_vec.
1167         * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
1168         (cp_genericize_tree): Remove explicit release.
1169         * parser.c (cp_parser_objc_at_property_declaration): Use
1170         auto_delete_vec.
1171         * semantics.c (omp_reduction_lookup): Use auto_vec.
1173 2021-07-14  Marek Polacek  <polacek@redhat.com>
1175         PR c++/101371
1176         * constexpr.c (cxx_eval_array_reference): Create a new .object
1177         and .ctor for the non-aggregate non-scalar case too when
1178         value-initializing.
1180 2021-07-12  Patrick Palka  <ppalka@redhat.com>
1182         PR c++/79501
1183         PR c++/100983
1184         * decl.c (grokfndecl): Don't require that deduction guides are
1185         declared at namespace scope.  Check that class-scope deduction
1186         guides have the same access as the member class template.
1187         (grokdeclarator): Pretend class-scope deduction guides are static.
1188         * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1189         deduction guides.
1191 2021-07-10  Patrick Palka  <ppalka@redhat.com>
1193         PR c++/82110
1194         * init.c (build_aggr_init): Return error_mark_node if
1195         expand_aggr_init_1 returns false.
1196         (expand_default_init): Change return type to bool.  Return false
1197         on error, true on success.
1198         (expand_aggr_init_1): Likewise.
1200 2021-07-09  Jason Merrill  <jason@redhat.com>
1202         PR c++/101098
1203         * decl.c (function_requirements_equivalent_p): Only compare
1204         trailing requirements on a specialization.
1206 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1208         * coroutines.cc (build_actor_fn): Move common code to
1209         act_des_fn.
1210         (build_destroy_fn): Likewise.
1211         (act_des_fn): Build the void return here.  Ensure that the
1212         source location matches the original function.
1214 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1216         * coroutines.cc
1217         (coro_rewrite_function_body): Connect the replacement
1218         function block to the block nest correctly.
1220 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1222         PR c++/101181
1223         * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1224         add_extra_args.
1225         * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1226         * pt.c (build_extra_args): Make a copy of args.
1227         (add_extra_args): Add complain/in_decl parameters.  Enable the
1228         code for handling the case where the extra arguments are
1229         dependent.
1230         (tsubst_pack_expansion): Pass complain/in_decl to
1231         add_extra_args.
1232         (tsubst_template_args): Handle missing template arguments.
1233         (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1234         add_extra_args.
1236 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1238         PR c++/101247
1239         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1240         DECL_CONTEXT.
1242 2021-07-08  Martin Sebor  <msebor@redhat.com>
1244         PR bootstrap/101372
1245         * module.cc (identifier): Suppress warning.
1246         (module_state::read_macro_maps): Remove warning suppression.
1247         (module_state::install_macros): Ditto.
1249 2021-07-08  Marek Polacek  <polacek@redhat.com>
1251         PR c++/101087
1252         * cp-tree.h (unevaluated_p): New.
1253         * except.c (check_noexcept_r): Use it.  Don't walk into
1254         unevaluated operands.
1256 2021-07-08  Martin Sebor  <msebor@redhat.com>
1258         PR bootstrap/101374
1259         * module.cc (module_state::read_macro_maps): Temporarily disable
1260         -Warray-bounds.
1261         (module_state::install_macros): Same.
1263 2021-07-06  Martin Sebor  <msebor@redhat.com>
1265         * error.c (cp_printer):  Remove support for %G and %K.
1267 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1269         * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1270         (struct cp_omp_declare_simd_data): Likewise.
1271         * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1272         (omp_identifier): Define.
1273         * parser.c (cp_parser_skip_to_pragma_eol): Handle
1274         in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1275         (cp_parser_require_pragma_eol): Likewise.
1276         (struct cp_omp_attribute_data): New type.
1277         (cp_parser_handle_statement_omp_attributes): New function.
1278         (cp_parser_statement): Handle OpenMP directives in statement's
1279         attribute-specifier-seq.
1280         (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1281         functions.
1282         (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1283         attributes.
1284         (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1285         a comma also before the first clause.
1286         (cp_parser_omp_allocate): Likewise.
1287         (cp_parser_omp_atomic): Likewise.
1288         (cp_parser_omp_depobj): Likewise.
1289         (cp_parser_omp_flush): Likewise.
1290         (cp_parser_omp_ordered): Likewise.
1291         (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1292         into struct cp_omp_declare_simd_data.
1293         (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1294         argument.  If set, allow a comma also before match clause.
1295         (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1296         allow a comma also before the first clause.  Adjust
1297         cp_finish_omp_declare_variant caller.
1298         (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1299         a comma also before the first clause.
1300         (cp_parser_omp_declare_reduction_exprs): Likewise.
1301         (cp_parser_omp_requires): Likewise.
1302         * decl.c (initialize_predefined_identifiers): Initialize
1303         omp_identifier.
1304         * decl2.c (cplus_decl_attributes): Reject omp::directive and
1305         omp::sequence attributes.
1307 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1309         PR c/101297
1310         * parser.c (cp_parser_omp_atomic): Consume comma only if it
1311         appears before a CPP_NAME.
1313 2021-07-02  Patrick Palka  <ppalka@redhat.com>
1315         PR c++/101247
1316         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1317         use common_enclosing_class and to not depend on the TREE_TYPE
1318         of outer levels pointing to the corresponding primary template.
1320 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1322         PR c++/101194
1323         * constexpr.c (cxx_eval_array_reference): When the element type
1324         is an empty type and the corresponding element is omitted, just
1325         return an empty CONSTRUCTOR instead of attempting value
1326         initialization.
1328 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1330         PR c++/96204
1331         * pt.c (finish_template_variable): Pass the partially
1332         instantiated template and its args to instantiate_template.
1333         (instantiate_class_template_1): No need to call
1334         push_nested_class and pop_nested_class around the call to
1335         most_specialized_partial_spec.
1336         (instantiate_template_1): Pass the partially instantiated
1337         template to lookup_template_variable.
1338         (most_specialized_partial_spec):  Use push_access_scope_guard
1339         to set the access scope appropriately.  Use
1340         deferring_access_check_sentinel to force access to get checked
1341         immediately.
1342         (instantiate_decl): Just pass the VAR_DECL to
1343         most_specialized_partial_spec.
1345 2021-06-30  Patrick Palka  <ppalka@redhat.com>
1347         * constraint.cc (get_normalized_constraints_from_decl): Use
1348         push_access_scope_guard instead of push_nested_class_guard.
1349         * cp-tree.h (struct push_nested_class_guard): Replace with ...
1350         (struct push_access_scope_guard): ... this.
1351         * pt.c (push_access_scope): When the argument corresponds to
1352         a class type, push the class instead of its context.
1353         (pop_access_scope): Adjust accordingly.
1355 2021-06-30  Marek Polacek  <polacek@redhat.com>
1357         PR c++/100975
1358         DR 2397
1359         * decl.c (create_array_type_for_decl): Allow array of auto.
1361 2021-06-29  Jason Merrill  <jason@redhat.com>
1363         * pt.c (instantiate_decl): Only consider partial specializations of
1364         actual variable templates.
1366 2021-06-26  Patrick Palka  <ppalka@redhat.com>
1368         PR c++/96204
1369         * pt.c (instantiate_class_template_1): Enter the scope of the
1370         type when calling most_specialized_partial_spec.
1372 2021-06-26  Jason Merrill  <jason@redhat.com>
1374         PR c++/101040
1375         PR c++/97566
1376         * class.c (is_empty_field): Handle null argument.
1377         * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1378         for empty field.
1380 2021-06-26  Marek Polacek  <polacek@redhat.com>
1382         PR c++/100752
1383         * parser.c (cp_parser_declarator): Pass flags down to
1384         cp_parser_declarator.  Also pass static_p/member_p.
1386 2021-06-25  Martin Sebor  <msebor@redhat.com>
1388         * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1389         with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1390         nothing if not necessary.
1391         (set_up_extended_ref_temp): Same.
1392         * class.c (layout_class_type): Same.
1393         * constraint.cc (constraint_satisfaction_value): Same.
1394         * coroutines.cc (finish_co_await_expr): Same.
1395         (finish_co_yield_expr): Same.
1396         (finish_co_return_stmt): Same.
1397         (build_actor_fn): Same.
1398         (coro_rewrite_function_body): Same.
1399         (morph_fn_to_coro): Same.
1400         * cp-gimplify.c (genericize_eh_spec_block): Same.
1401         (gimplify_expr_stmt): Same.
1402         (cp_genericize_r): Same.
1403         (cp_fold): Same.
1404         * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1405         * cvt.c (cp_fold_convert): Same.
1406         (convert_to_void): Same.
1407         * decl.c (wrapup_namespace_globals): Same.
1408         (grokdeclarator): Same.
1409         (finish_function): Same.
1410         (require_deduced_type): Same.
1411         * decl2.c (no_linkage_error): Same.
1412         (c_parse_final_cleanups): Same.
1413         * except.c (expand_end_catch_block): Same.
1414         * init.c (build_new_1): Same.
1415         (build_new): Same.
1416         (build_vec_delete_1): Same.
1417         (build_vec_init): Same.
1418         (build_delete): Same.
1419         * method.c (defaultable_fn_check): Same.
1420         * parser.c (cp_parser_fold_expression): Same.
1421         (cp_parser_primary_expression): Same.
1422         * pt.c (push_tinst_level_loc): Same.
1423         (tsubst_copy): Same.
1424         (tsubst_omp_udr): Same.
1425         (tsubst_copy_and_build): Same.
1426         * rtti.c (build_if_nonnull): Same.
1427         * semantics.c (maybe_convert_cond): Same.
1428         (finish_return_stmt): Same.
1429         (finish_parenthesized_expr): Same.
1430         (cp_check_omp_declare_reduction): Same.
1431         * tree.c (build_cplus_array_type): Same.
1432         * typeck.c (build_ptrmemfunc_access_expr): Same.
1433         (cp_build_indirect_ref_1): Same.
1434         (cp_build_function_call_vec): Same.
1435         (warn_for_null_address): Same.
1436         (cp_build_binary_op): Same.
1437         (unary_complex_lvalue): Same.
1438         (cp_build_modify_expr): Same.
1439         (build_x_modify_expr): Same.
1440         (convert_for_assignment): Same.
1442 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1444         PR c++/98832
1445         * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1447 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1449         PR c++/101182
1450         * constraint.cc (evaluate_requires_expr): Adjust function comment.
1451         * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1452         (cp_fold) <case REQUIRES_EXPR>: ... here.
1454 2021-06-24  Jakub Jelinek  <jakub@redhat.com>
1456         * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1457         C_ORT_OMP for clauses on target construct.
1458         (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1459         (cp_parser_omp_target): For non-combined target add
1460         map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION.  Pass
1461         C_ORT_OMP_TARGET to finish_omp_clauses.
1462         * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1463         for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1464         never present on C_ORT_*DECLARE_SIMD.
1465         (handle_omp_array_sections): Likewise.
1466         (finish_omp_clauses): Likewise.  Handle OMP_CLAUSE_IN_REDUCTION
1467         on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1468         corresponding map clauses.
1469         * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1470         clauses on target construct.
1472 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1474         PR c++/101174
1475         * pt.c (push_access_scope): For artificial deduction guides,
1476         set the access scope to that of the constructor.
1477         (pop_access_scope): Likewise.
1478         (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1480 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1482         PR c++/86439
1483         * call.c (print_error_for_call_failure): Constify 'args' parameter.
1484         (perform_dguide_overload_resolution): Define.
1485         * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1486         * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1487         instead of build_new_function_call.  Don't use tf_decltype or
1488         set cp_unevaluated_operand.  Remove unnecessary NULL_TREE tests.
1490 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1492         PR c++/67302
1493         * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1494         sooner, before the NRVO handling.
1496 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1498         PR c++/80431
1499         * tree.c (bot_replace): Use convert_to_base to build the
1500         conversion to the (morally) virtual base.
1502 2021-06-21  Jakub Jelinek  <jakub@redhat.com>
1504         PR inline-asm/100785
1505         * typeck.c (cxx_mark_addressable): Diagnose trying to make
1506         bit-fields addressable.
1508 2021-06-17  Jason Merrill  <jason@redhat.com>
1510         PR c++/101106
1511         * decl.c (duplicate_decls): Make 'deleted after first declaration'
1512         pedwarn on by default.
1514 2021-06-17  Jason Merrill  <jason@redhat.com>
1516         PR c++/101029
1517         * init.c (build_vec_init): Preserve the type of base.
1519 2021-06-16  Jason Merrill  <jason@redhat.com>
1521         PR c++/101078
1522         PR c++/91706
1523         * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1525 2021-06-15  Robin Dapp  <rdapp@linux.ibm.com>
1527         * decl.c (duplicate_decls): Likewise.
1529 2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
1531         PR c/100913
1532         * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1533         var in the error case.
1535 2021-06-13  Trevor Saunders  <tbsaunde@tbsaunde.org>
1537         * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1538         with range based for.
1539         (cxx_eval_store_expression): Likewise.
1540         (cxx_eval_loop_expr): Likewise.
1541         * decl.c (wrapup_namespace_globals): Likewise.
1542         (cp_finish_decl): Likewise.
1543         (cxx_simulate_enum_decl): Likewise.
1544         * parser.c (cp_parser_postfix_expression): Likewise.
1546 2021-06-12  Jason Merrill  <jason@redhat.com>
1548         PR c++/101029
1549         * init.c (build_vec_init): Shortcut [0] case.
1551 2021-06-12  Jason Merrill  <jason@redhat.com>
1553         * pt.c (lookup_template_class_1): Shortcut current_class_type.
1555 2021-06-11  Patrick Palka  <ppalka@redhat.com>
1557         DR 1227
1558         PR c++/96560
1559         * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1560         TYPE_ARG_TYPES in forward order while short circuiting
1561         appropriately.  Adjust formatting.
1563 2021-06-11  Jakub Jelinek  <jakub@redhat.com>
1565         PR c++/100974
1566         * cp-tree.h (struct saved_scope): Add consteval_if_p
1567         member.  Formatting fix for the discarded_stmt comment.
1568         (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1569         * parser.c (cp_parser_lambda_expression): Temporarily disable
1570         in_consteval_if_p when parsing lambda body.
1571         (cp_parser_selection_statement): Parse consteval if.
1572         * decl.c (struct named_label_entry): Add in_consteval_if member.
1573         (level_for_consteval_if): New function.
1574         (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1575         consteval if.
1576         * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1577         why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1578         for !ctx->manifestly_const_eval.
1579         (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1580         condition as if it was __builtin_is_constant_evaluated call.
1581         (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1582         recurse on both branches.
1583         * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1584         as the else branch.
1585         * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1586         Temporarily set in_consteval_if_p when recursing on
1587         IF_STMT_CONSTEVAL_P then branch.
1588         (tsubst_lambda_expr): Temporarily disable
1589         in_consteval_if_p when instantiating lambda body.
1590         * call.c (immediate_invocation_p): Return false when
1591         in_consteval_if_p.
1593 2021-06-11  Marek Polacek  <polacek@redhat.com>
1595         PR c++/100995
1596         * constexpr.c (maybe_constexpr_fn): New.
1597         * cp-tree.h (maybe_constexpr_fn): Declare.
1598         * semantics.c (find_std_constant_evaluated_r): New.
1599         (maybe_warn_for_constant_evaluated): New.
1600         (finish_if_stmt_cond): Call it.
1602 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1604         PR c++/67829
1605         * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1606         the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1607         a template template parameter, adjust to the
1608         TEMPLATE_TEMPLATE_PARAMETER before falling through.
1610 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1612         PR c++/100946
1613         * constraint.cc (normalize_placeholder_type_constraints): When
1614         normalizing a non-templated return-type-requirement, add a dummy
1615         level to initial_parms.
1617 2021-06-08  Marek Polacek  <polacek@redhat.com>
1619         PR c++/100065
1620         * decl.c (grokdeclarator): Store a value-dependent
1621         explicit-specifier even for deduction guides.
1623 2021-06-08  Jason Merrill  <jason@redhat.com>
1625         * parser.c (cp_parser_string_literal): Adjust diagnostic.
1627 2021-06-08  Jason Merrill  <jason@redhat.com>
1629         PR c++/100963
1630         * call.c (perfect_conversion_p): Check check_narrowing.
1632 2021-06-08  Jason Merrill  <jason@redhat.com>
1634         PR c++/91706
1635         * name-lookup.c (get_class_binding): Keep a BASELINK.
1636         (set_inherited_value_binding_p): Adjust.
1637         * lambda.c (is_lambda_ignored_entity): Adjust.
1638         * pt.c (lookup_template_function): Copy a BASELINK before
1639         modifying it.
1641 2021-06-08  Jason Merrill  <jason@redhat.com>
1643         PR c++/91706
1644         * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1646 2021-06-08  Jason Merrill  <jason@redhat.com>
1648         * module.cc (duplicate_hash::hash): Comment out.
1649         (trees_in::tree_value): Adjust loop counter.
1651 2021-06-08  Jason Merrill  <jason@redhat.com>
1653         PR c++/100102
1654         * init.c (build_offset_ref): Return the BASELINK for a static
1655         member function.
1657 2021-06-07  Patrick Palka  <ppalka@redhat.com>
1659         PR c++/100918
1660         * parser.c (cp_parser_lookup_name): Check access of the lookup
1661         result before we potentially adjust an injected-class-name to
1662         its TEMPLATE_DECL.
1664 2021-06-06  Jakub Jelinek  <jakub@redhat.com>
1666         PR c/100902
1667         * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1668         even when target is combined with other constructs.
1670 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1672         PR c++/100893
1673         * pt.c (convert_template_argument): Strip top-level cv-quals
1674         on the substituted type of a non-type template parameter.
1676 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1678         PR c++/100102
1679         * pt.c (tsubst_function_decl): Remove old code for reducing
1680         args when it has excess levels.
1682 2021-06-04  Jakub Jelinek  <jakub@redhat.com>
1684         PR c++/100872
1685         * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1686         ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1687         to the start.
1689 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1691         PR c++/100592
1692         * decl.c (make_typename_type): After calling
1693         lookup_template_class, adjust the result to its TYPE_NAME and
1694         then consider the tf_keep_type_decl flag.
1696 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1698         PR c++/100862
1699         * pt.c (set_current_access_from_decl): Move to ...
1700         * class.c (set_current_access_from_decl): ... here.
1701         (handle_using_decl): Use it to propagate the access of the
1702         using-enum decl to the copy of the imported enumerator.
1703         * cp-tree.h (set_current_access_from_decl): Declare.
1704         * decl.c (build_enumerator): Simplify using make_temp_override
1705         and set_current_access_from_decl.
1707 2021-06-03  Jakub Jelinek  <jakub@redhat.com>
1709         PR c++/100859
1710         * semantics.c (handle_omp_array_sections_1): For
1711         OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1712         finish_non_static_data_member and allow this as base.
1713         (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1714         after depend only cases.  Let this be diagnosed by !lvalue_p
1715         case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1716         assert.
1717         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1719 2021-06-02  Jason Merrill  <jason@redhat.com>
1721         PR c++/100838
1722         * call.c (convert_like_internal): Clear tf_no_cleanup when
1723         recursing.
1724         (build_user_type_conversion_1): Only add ck_rvalue if
1725         LOOKUP_ONLYCONVERTING.
1727 2021-06-01  Patrick Palka  <ppalka@redhat.com>
1729         PR c++/65816
1730         * init.c (expand_aggr_init_1): Check
1731         type_has_non_user_provided_default_constructor instead of
1732         type_has_user_provided_constructor.
1734 2021-06-01  Jason Merrill  <jason@redhat.com>
1736         PR c++/91859
1737         * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1738         for destroying delete.
1739         * init.c (build_delete): Don't clobber before destroying delete.
1741 2021-06-01  Jason Merrill  <jason@redhat.com>
1743         PR c++/94492
1744         * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1746 2021-05-31  Richard Biener  <rguenther@suse.de>
1748         PR c++/88601
1749         * cp-objcp-common.c (names_builtin_p): Handle
1750         RID_BUILTIN_SHUFFLEVECTOR.
1751         * cp-tree.h (build_x_shufflevector): Declare.
1752         * parser.c (cp_parser_postfix_expression): Handle
1753         RID_BUILTIN_SHUFFLEVECTOR.
1754         * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1755         * typeck.c (build_x_shufflevector): Build either a lowered
1756         VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1757         internal function IFN_SHUFFLEVECTOR.
1759 2021-05-28  Jason Merrill  <jason@redhat.com>
1761         * constexpr.c (build_data_member_initialization): Use tsi_range.
1762         (build_constexpr_constructor_member_initializers): Likewise.
1763         (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1764         (potential_constant_expression_1): Likewise.
1765         * coroutines.cc (await_statement_expander): Likewise.
1766         (await_statement_walker): Likewise.
1767         * module.cc (trees_out::core_vals): Likewise.
1768         * pt.c (tsubst_expr): Likewise.
1769         * semantics.c (set_cleanup_locs): Likewise.
1771 2021-05-28  Jason Merrill  <jason@redhat.com>
1773         PR c++/100797
1774         PR c++/95719
1775         * call.c (build_over_call): Adjust base_binfo in
1776         resolves_to_fixed_type_p case.
1778 2021-05-28  Jakub Jelinek  <jakub@redhat.com>
1780         PR middle-end/99928
1781         * semantics.c (handle_omp_array_sections): Copy
1782         OMP_CLAUSE_MAP_IMPLICIT.
1783         (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1784         marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT.  Add
1785         map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1786         maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1787         present too.  For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1788         if present in map_head, map_field_head or map_firstprivate_head
1789         bitmaps.
1791 2021-05-28  Tobias Burnus  <tobias@codesourcery.com>
1793         * parser.c (cp_parser_omp_clause_affinity): New.
1794         (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1795         cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1796         clause.
1797         * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1798         finish_omp_clauses): Likewise.
1800 2021-05-27  Matthias Kretz  <kretz@kde.org>
1802         PR c++/100716
1803         * error.c (dump_template_bindings): Include code to print
1804         "[with" and ']', conditional on whether anything is printed at
1805         all. This is tied to whether a semicolon is needed to separate
1806         multiple template parameters. If the template argument repeats
1807         the template parameter (T = T), then skip the parameter.
1808         (dump_substitution): Moved code to print "[with" and ']' to
1809         dump_template_bindings.
1810         (dump_function_decl): Partial revert of PR50828, which masked
1811         TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1812         TFF_TEMPLATE_NAME is masked for the scope of the function and
1813         only carries through to dump_function_name.
1814         (dump_function_name): Avoid calling dump_template_parms if
1815         TFF_TEMPLATE_NAME is set.
1817 2021-05-27  Matthias Kretz  <kretz@kde.org>
1819         PR c++/100763
1820         * error.c: Call dump_scope when printing a typedef.
1822 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1824         PR c++/99893
1825         * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1827 2021-05-27  Jason Merrill  <jason@redhat.com>
1829         PR c++/86355
1830         * pt.c (use_pack_expansion_extra_args_p): Don't compare
1831         args from the same argument pack.
1833 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1835         DR 1315
1836         PR c++/67593
1837         PR c++/96555
1838         * pt.c (process_partial_specialization): Don't error on a
1839         non-simple non-type template argument that involves template
1840         parameters.
1841         (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1842         MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1844 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1846         PR c++/100502
1847         * typeck.c (finish_class_member_access_expr): Disable ahead
1848         of time access checking during the member lookup.
1850 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1852         PR c++/100368
1853         * tree.c (build_target_expr_with_type): Don't call force_rvalue
1854         on CALL_EXPR initializer.  Simplify now that bot_manip is no
1855         longer a caller.
1856         (bot_manip): Use force_target_expr instead of
1857         build_target_expr_with_type.
1859 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1861         PR c++/97420
1862         * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1863         (fnptr_conv_p): Don't call non_reference.  Use INDIRECT_TYPE_P
1864         instead of TYPE_PTR_P.
1865         * pt.c (convert_nontype_argument_function): Look through
1866         implicit INDIRECT_REFs before calling strip_fnptr_conv.
1868 2021-05-25  Jakub Jelinek  <jakub@redhat.com>
1870         PR c++/100666
1871         * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1872         and side-effects, temporarily disable -Wunused-result warning when
1873         building COMPOUND_EXPR.
1875 2021-05-21  Jakub Jelinek  <jakub@redhat.com>
1877         PR middle-end/99928
1878         * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1879         OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't error
1880         if a decl is mentioned both in map clause and in such firstprivate
1881         clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1883 2021-05-20  Jason Merrill  <jason@redhat.com>
1885         * call.c (reference_binding): Check for designator.
1886         (implicit_conversion_1, build_special_member_call): Likewise.
1887         * decl.c (reshape_init_r): Likewise.
1888         * pt.c (do_class_deduction): Likewise.
1889         * typeck2.c (digest_init_r): Likewise.
1891 2021-05-20  Jason Merrill  <jason@redhat.com>
1893         PR c++/100489
1894         * decl.c (reshape_init_class): Handle designator for
1895         member of anonymous aggregate here.
1896         * typeck2.c (process_init_constructor_record): Not here.
1898 2021-05-20  Jonathan Wakely  <jwakely@redhat.com>
1900         * call.c (maybe_warn_array_conv): Use new warning option.
1901         * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1902         * error.c (maybe_warn_cpp0x): Likewise.
1903         * parser.c (cp_parser_primary_expression)
1904         (cp_parser_unqualified_id)
1905         (cp_parser_pseudo_destructor_name)
1906         (cp_parser_lambda_introducer)
1907         (cp_parser_lambda_declarator_opt)
1908         (cp_parser_selection_statement)
1909         (cp_parser_init_statement)
1910         (cp_parser_decomposition_declaration)
1911         (cp_parser_function_specifier_opt)
1912         (cp_parser_static_assert)
1913         (cp_parser_namespace_definition)
1914         (cp_parser_using_declaration)
1915         (cp_parser_asm_definition)
1916         (cp_parser_ctor_initializer_opt_and_function_body)
1917         (cp_parser_initializer_list)
1918         (cp_parser_type_parameter_key)
1919         (cp_parser_member_declaration)
1920         (cp_parser_try_block)
1921         (cp_parser_std_attribute_spec): Likewise.
1922         * pt.c (check_template_variable): Likewise.
1924 2021-05-20  Jason Merrill  <jason@redhat.com>
1926         PR c++/100634
1927         * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1929 2021-05-20  Jason Merrill  <jason@redhat.com>
1931         PR c++/100659
1932         * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1934 2021-05-19  Jason Merrill  <jason@redhat.com>
1936         PR c++/100367
1937         PR c++/96299
1938         * method.c (genericize_spaceship): Use fold_build2 for scalar
1939         operands.
1941 2021-05-19  Jason Merrill  <jason@redhat.com>
1943         * pt.c (build_deduction_guide): Treat the implicit deduction guide
1944         as a member of the class.
1946 2021-05-19  Marek Polacek  <polacek@redhat.com>
1948         PR c++/100596
1949         * cp-tree.h (any_non_type_attribute_p): Remove.
1950         * decl.c (grokdeclarator): Turn an error into a warning and only
1951         warn for standard attributes.
1952         * decl2.c (any_non_type_attribute_p): Remove.
1953         * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1954         into a warning and only warn for standard attributes.
1955         (cp_parser_member_declaration): Likewise.
1957 2021-05-19  Martin Liska  <mliska@suse.cz>
1959         PR testsuite/100658
1960         * mangle.c (write_encoding): Fix typos.
1962 2021-05-19  Jakub Jelinek  <jakub@redhat.com>
1964         PR middle-end/99928
1965         * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1966         master when combined with taskloop.
1967         (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1968         parallel master when not combined with taskloop.
1970 2021-05-19  Jason Merrill  <jason@redhat.com>
1972         PR c++/100261
1973         * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1975 2021-05-19  Jason Merrill  <jason@redhat.com>
1977         PR c++/100372
1978         * tree.c (strip_typedefs): Only look at the pattern of a
1979         TYPE_PACK_EXPANSION if it's a type.
1981 2021-05-18  Marek Polacek  <polacek@redhat.com>
1983         * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1984         * constraint.cc (contains_wildcard_p): Likewise.
1985         (get_template_head_requirements): Likewise.
1986         (check_constrained_friend): Likewise.
1987         (subsumes_constraints): Likewise.
1988         * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1989         (push_void_library_fn): Likewise.
1990         (get_pattern_parm): Likewise.
1991         (get_template_parms_at_level): Likewise.
1992         (lambda_return_type): Likewise.
1993         (get_template_head_requirements): Likewise.
1994         (check_constrained_friend): Likewise.
1995         (subsumes_constraints): Likewise.
1996         * decl.c (push_void_library_fn): Likewise.
1997         * lambda.c (lambda_return_type): Likewise.
1998         * pt.c (get_template_parms_at_level): Likewise.
1999         (get_pattern_parm): Likewise.
2001 2021-05-18  Jason Merrill  <jason@redhat.com>
2003         PR c++/100644
2004         * call.c (perfect_candidate_p): An implicitly deleted move
2005         is not perfect.
2007 2021-05-18  Andreas Krebbel  <krebbel@linux.ibm.com>
2009         PR c++/100281
2010         * cvt.c (cp_convert_to_pointer): Use the size of the target
2011         pointer type.
2012         * tree.c (cp_build_reference_type): Call
2013         cp_build_reference_type_for_mode with VOIDmode.
2014         (cp_build_reference_type_for_mode): Rename from
2015         cp_build_reference_type.  Add MODE argument and invoke
2016         build_reference_type_for_mode.
2017         (strip_typedefs): Use build_pointer_type_for_mode and
2018         cp_build_reference_type_for_mode for pointers and references.
2020 2021-05-17  Jonathan Wakely  <jwakely@redhat.com>
2022         PR c++/100635
2023         * call.c (convert_like_internal): Print different diagnostic if
2024         the lvalue reference is const.
2026 2021-05-14  Jason Merrill  <jason@redhat.com>
2028         PR c++/95870
2029         * pt.c (enclosing_instantiation_of): Just compare
2030         DECL_SOURCE_LOCATION.
2031         (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
2033 2021-05-14  Marek Polacek  <polacek@redhat.com>
2034             Jason Merrill  <jason@redhat.com>
2036         PR c++/99032
2037         * cp-tree.h (any_non_type_attribute_p): Declare.
2038         * decl.c (grokdeclarator): Diagnose when an attribute appertains to
2039         a friend declaration that is not a definition.
2040         * decl2.c (any_non_type_attribute_p): New.
2041         * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
2042         in the middle of decl-specifiers.
2043         (cp_parser_elaborated_type_specifier): Diagnose when an attribute
2044         appertains to a friend declaration that is not a definition.
2045         (cp_parser_member_declaration): Likewise.
2047 2021-05-12  Marek Polacek  <polacek@redhat.com>
2049         * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
2050         sentinel.
2052 2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>
2054         * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
2055         'close'.
2057 2021-05-11  Jason Merrill  <jason@redhat.com>
2059         PR c++/100517
2060         * typeck.c (build_reinterpret_cast_1): Check intype on
2061         cast to vector.
2063 2021-05-11  Patrick Palka  <ppalka@redhat.com>
2065         PR c++/51577
2066         * name-lookup.c (maybe_save_operator_binding): Unconditionally
2067         enable for all function templates, not just generic lambdas.
2068         Handle compound-assignment operator expressions.
2069         * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
2070         in the type-dependent case.
2071         (build_x_modify_expr): Likewise.  Move declaration of 'op' closer
2072         to its first use.
2074 2021-05-11  Patrick Palka  <ppalka@redhat.com>
2076         PR c++/100138
2077         * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
2078         (satisfy_atom): Set up iloc_sentinel before calling
2079         cxx_constant_value.
2080         * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
2081         expansion, carry over PACK_EXPANSION_LOCAL_P and
2082         PACK_EXPANSION_SIZEOF_P from the original pack expansion.
2084 2021-05-10  Richard Biener  <rguenther@suse.de>
2086         PR middle-end/100464
2087         PR c++/100468
2088         * call.c (set_up_extended_ref_temp): Mark the temporary
2089         addressable if the TARGET_EXPR was.
2091 2021-05-10  Martin Liska  <mliska@suse.cz>
2093         * decl.c (duplicate_decls): Use startswith
2094         function instead of strncmp.
2095         (cxx_builtin_function): Likewise.
2096         (omp_declare_variant_finalize_one): Likewise.
2097         (grokfndecl): Likewise.
2098         * error.c (dump_decl_name): Likewise.
2099         * mangle.c (find_decomp_unqualified_name): Likewise.
2100         (write_guarded_var_name): Likewise.
2101         (decl_tls_wrapper_p): Likewise.
2102         * parser.c (cp_parser_simple_type_specifier): Likewise.
2103         (cp_parser_tx_qualifier_opt): Likewise.
2104         * pt.c (template_parm_object_p): Likewise.
2105         (dguide_name_p): Likewise.
2107 2021-05-10  Martin Liska  <mliska@suse.cz>
2109         PR c++/99616
2110         * decl.c (grokdeclarator): Remove redundant NULL check.
2112 2021-05-07  Jason Merrill  <jason@redhat.com>
2114         * tree.c (rvalue): Assert expr is not a class lvalue.
2116 2021-05-07  Jason Merrill  <jason@redhat.com>
2118         * cp-tree.h (build_stub_object): Declare.
2119         * method.c (build_stub_object): No longer static.
2120         * call.c (can_convert): Use it.
2121         * tree.c (build_dummy_object): Adjust comment.
2122         * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
2123         TARGET_EXPR.
2125 2021-05-07  Jason Merrill  <jason@redhat.com>
2127         * coroutines.cc (build_co_await): Don't call 'rvalue'.
2128         (flatten_await_stmt): Simplify initialization.
2129         (morph_fn_to_coro): Change 'rvalue' to 'move'.  Simplify.
2131 2021-05-04  Tobias Burnus  <tobias@codesourcery.com>
2133         * semantics.c (finish_omp_reduction_clause): Accept float + complex
2134         for || and && reductions.
2136 2021-05-03  Patrick Palka  <ppalka@redhat.com>
2138         PR c++/100362
2139         * parser.c (cp_parser_class_head): Reinstate calls to pushclass
2140         and popclass when parsing the base-clause that were removed in
2141         r11-6815.
2143 2021-05-03  Patrick Palka  <ppalka@redhat.com>
2145         PR c++/68942
2146         PR c++/100344
2147         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
2148         only when the callee is a FUNCTION_DECL.
2150 2021-05-03  Marek Polacek  <polacek@redhat.com>
2152         PR c++/100055
2153         * decl.c (grokfndecl): Check current_template_parms.
2155 2021-05-03  Marek Polacek  <polacek@redhat.com>
2157         DR 1312
2158         * constexpr.c (cxx_eval_constant_expression): Don't check
2159         integer_zerop.
2161 2021-05-01  Jason Merrill  <jason@redhat.com>
2163         * cp-tree.h (class ovl_iterator): Allow copying.  Add op==.
2164         (class ovl_range, class lkp_range): New.
2165         * call.c (build_op_call_1, add_candidates): Use them.
2166         (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
2167         (has_trivial_copy_p): Likewise.
2168         * class.c (handle_using_decl, get_basefndecls): Likewise.
2169         (maybe_warn_about_overly_private_class): Likewise.
2170         (warn_hidden, add_implicitly_declared_members): Likewise.
2171         (check_methods, clone_constructors_and_destructors): Likewise.
2172         (type_has_user_nondefault_constructor): Likewise.
2174 2021-04-29  Jason Merrill  <jason@redhat.com>
2176         * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
2177         don't find a field.
2179 2021-04-29  Jason Merrill  <jason@redhat.com>
2181         PR c++/51344
2182         * decl2.c (grokfield): Call cplus_decl_attributes for friend.
2183         (save_template_attributes): Use chainon.
2184         * friend.c (do_friend): Remove attrlist parm.
2185         * cp-tree.h (do_friend): Adjust.
2186         * class.c (add_implicitly_declared_members): Adjust.
2187         * decl.c (grokdeclarator): Adjust.
2188         * pt.c (apply_late_template_attributes): Optimize.
2190 2021-04-29  Jason Merrill  <jason@redhat.com>
2192         PR c++/97974
2193         * class.c (finish_struct_anon_r): Drop complain parm.
2194         Remove non-field diagnostic.
2195         (finish_struct_anon): Adjust.
2196         * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2198 2021-04-29  Jason Merrill  <jason@redhat.com>
2200         * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2201         * parser.c (cp_parser_constant_expression): Change
2202         allow_non_constant_p to int.  Use cp_evaluated.
2203         (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2204         * semantics.c (finish_id_expression_1): Don't mess with
2205         cp_unevaluated_operand here.
2207 2021-04-29  Jason Merrill  <jason@redhat.com>
2209         * cp-tree.h: Clarify comments.
2210         * pt.c (get_template_parm_object): Add assert.
2211         * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2212         * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2213         * typeck2.c (store_init_value): Likewise.
2215 2021-04-29  Patrick Palka  <ppalka@redhat.com>
2217         PR c++/68942
2218         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2219         set tf_conv during the initial substitution into the function.
2221 2021-04-29  Jakub Jelinek  <jakub@redhat.com>
2223         PR c++/100319
2224         * semantics.c (finish_omp_clauses): Fix up check that variable
2225         mentioned in detach clause doesn't appear in data-sharing clauses.
2227 2021-04-28  Jakub Jelinek  <jakub@redhat.com>
2229         * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2231 2021-04-27  Jason Merrill  <jason@redhat.com>
2233         PR c++/92145
2234         * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2235         of operator=.
2237 2021-04-27  Patrick Palka  <ppalka@redhat.com>
2239         PR c++/88580
2240         * pt.c (tsubst_initializer_list): Correctly handle the case
2241         where an argument inside a base initializer pack expansion is
2242         itself a pack expansion.
2244 2021-04-26  Patrick Palka  <ppalka@redhat.com>
2246         PR c++/100209
2247         * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2248         object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2249         with a negative offset into one whose offset is nonnegative
2250         before calling cxx_fold_indirect_ref_1.
2252 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2254         PR c++/89565
2255         PR c++/93383
2256         PR c++/95291
2257         PR c++/99200
2258         PR c++/99683
2259         * pt.c (do_class_deduction): Punt if the initializer is
2260         type-dependent.
2262 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2264         PR c++/87709
2265         * parser.c (cp_parser_type_id_1): If we see a template
2266         placeholder, first try simulating an error before issuing
2267         a real error.
2269 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2271         PR c++/98767
2272         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2273         Adjust parameter list loop to iterate over 'types' instead of
2274         'args'.  Output the trailing '...' for a variadic function.
2275         Remove PARM_DECL support.
2276         (pp_cxx_requires_expr): Pretty print the parameter list directly
2277         instead of going through pp_cxx_parameter_declaration_clause.
2279 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2281         DR 2374
2282         * decl.c (is_direct_enum_init): Check the implicit
2283         convertibility requirement added by CWG 2374.
2285 2021-04-23  Martin Liska  <mliska@suse.cz>
2287         * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2288         * lex.c (init_operators): Remove run-time check.
2290 2021-04-22  Marek Polacek  <polacek@redhat.com>
2292         PR c++/100161
2293         * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2294         op1 separately for value- or type-dependence.
2296 2021-04-21  Marek Polacek  <polacek@redhat.com>
2298         PR c++/96380
2299         * parser.c (cp_parser_enum_specifier): Don't allow defining
2300         types in enum-base.
2302 2021-04-21  Martin Liska  <mliska@suse.cz>
2304         Revert:
2305         2021-04-21  Martin Liska  <mliska@suse.cz>
2307         * error.c (dump_decl): Use flags in dump_generic_node call.
2309 2021-04-21  Martin Liska  <mliska@suse.cz>
2311         * error.c (dump_decl): Use flags in dump_generic_node call.
2313 2021-04-21  Martin Liska  <mliska@suse.cz>
2315         * error.c (dump_decl): Support anonymous labels.
2317 2021-04-20  Jason Merrill  <jason@redhat.com>
2319         PR c++/100109
2320         * pt.c (find_parameter_packs_r): Look into enum initializers.
2322 2021-04-19  Marek Polacek  <polacek@redhat.com>
2324         PR c++/97536
2325         * decl.c (grokvardecl): Given an error when a concept is not defined
2326         at namespace scope.
2328 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2330         PR c++/100111
2331         * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2332         for empty classes into *valp when types don't match even when *valp
2333         is NULL.
2335 2021-04-16  Marek Polacek  <polacek@redhat.com>
2337         PR c++/99803
2338         * decl.c (make_typename_type): Give an error and return when
2339         name is is_overloaded_fn.
2340         * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2341         before calling make_typename_type.
2343 2021-04-16  Patrick Palka  <ppalka@redhat.com>
2345         PR c++/99700
2346         * constexpr.c (reduced_constant_expression_p): For array
2347         CONSTRUCTORs, use a dedicated loop that additionally verifies
2348         the CONSTRUCTOR spans the entire array.
2350 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2352         PR c++/99850
2353         * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2354         If lambda_p, return pce_ok instead of pce_maybe_postfix.
2356 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2358         PR c++/99833
2359         * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2360         binding, add to data.internal also all corresponding structured
2361         binding decls.
2363 2021-04-16  Jason Merrill  <jason@redhat.com>
2365         PR c++/100079
2366         * cp-tree.h (first_field): Declare.
2367         * mangle.c (range_expr_nelts): New.
2368         (write_expression): Improve class NTTP mangling.
2369         * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2370         * tree.c (zero_init_expr_p): Improve class NTTP handling.
2371         * decl.c: Adjust comment.
2373 2021-04-15  Jason Merrill  <jason@redhat.com>
2375         PR c++/80456
2376         * call.c (build_new_method_call_1): Check again for side-effects
2377         with a volatile object.
2379 2021-04-15  Jason Merrill  <jason@redhat.com>
2381         PR c++/100101
2382         PR c++/99583
2383         * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2384         TYPE_RAISES_EXCEPTIONS here.
2385         * tree.c (cp_walk_subtrees): Not here.
2387 2021-04-15  Jason Merrill  <jason@redhat.com>
2389         PR c++/100091
2390         PR c++/99478
2391         * parser.c (cp_parser_default_type_template_argument): Set
2392         parser->local_variables_forbidden_p.
2394 2021-04-15  Richard Sandiford  <richard.sandiford@arm.com>
2396         PR c++/98852
2397         * typeck.c (merge_type_attributes_from): New function.
2398         (cp_common_type): Use it for vector types.
2400 2021-04-14  Jason Merrill  <jason@redhat.com>
2402         PR c++/100078
2403         PR c++/93085
2404         * pt.c (uses_outer_template_parms): Also look at default
2405         template argument.
2407 2021-04-14  Jason Merrill  <jason@redhat.com>
2409         PR c++/93314
2410         * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2411         for a non-static data member in a constant-expression.
2413 2021-04-14  Patrick Palka  <ppalka@redhat.com>
2415         PR c++/83476
2416         PR c++/99885
2417         * pt.c (deducible_expression): Look through implicit
2418         INDIRECT_REFs as well.
2420 2021-04-14  Jason Merrill  <jason@redhat.com>
2422         PR c++/99478
2423         * parser.c (cp_parser_lambda_expression): Reject lambda
2424         in template parameter type.
2426 2021-04-14  Jason Merrill  <jason@redhat.com>
2428         PR c++/90674
2429         * decl.c (duplicate_decls): Don't propagate
2430         DECL_INITIALIZED_IN_CLASS_P to a specialization.
2432 2021-04-14  Jason Merrill  <jason@redhat.com>
2434         PR c++/88742
2435         PR c++/49951
2436         PR c++/58123
2437         * semantics.c (set_cleanup_locs): New.
2438         (do_poplevel): Call it.
2439         * parser.c (cp_parser_compound_statement): Consume the }
2440         before finish_compound_stmt.
2442 2021-04-13  Jason Merrill  <jason@redhat.com>
2444         PR c++/100032
2445         * pt.c (get_underlying_template): Compare TYPE_QUALS.
2447 2021-04-13  Jason Merrill  <jason@redhat.com>
2449         PR c++/100054
2450         PR c++/90479
2451         * init.c (get_nsdmi): Do more context adjustment for local classes.
2453 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2455         PR c++/99008
2456         * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2457         rather than issuing a pedwarn.
2458         * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2459         for consistent diagnostics.
2461 2021-04-13  Jason Merrill  <jason@redhat.com>
2463         PR c++/91933
2464         * class.c (build_base_path): Shortcut simple non-pointer case.
2466 2021-04-13  Eric Botcazou  <ebotcazou@adacore.com>
2468         * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2469         of the linemap.
2470         (module_state::write_location): Likewise.
2472 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2474         PR c++/97134
2475         * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2476         when checking if the initializer is an equivalent class
2477         placeholder template parameter.
2479 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2481         PR c++/99961
2482         PR c++/99994
2483         * constraint.cc (satisfy_normalized_constraints): Set
2484         cp_unevaluated.
2485         * parser.c (cp_parser_concept_definition): Likewise.
2486         (cp_parser_requires_clause_opt): Likewise.
2488 2021-04-12  Jason Merrill  <jason@redhat.com>
2490         PR c++/93085
2491         * pt.c (uses_outer_template_parms): Handle non-type and template
2492         template parameters specifically.
2494 2021-04-11  Jason Merrill  <jason@redhat.com>
2496         PR c++/97974
2497         * decl.c (fixup_anonymous_aggr): Prune all functions from
2498         CLASSTYPE_MEMBER_VEC.
2500 2021-04-10  Jason Merrill  <jason@redhat.com>
2502         PR c++/98800
2503         PR c++/97399
2504         * parser.c (cp_parser_direct_declarator): Don't
2505         inject_this_parameter if static_p.
2506         (cp_parser_omp_var_list_no_open): Parse 'this' even if
2507         current_class_ptr isn't set for a better diagnostic.
2509 2021-04-10  Jason Merrill  <jason@redhat.com>
2511         PR c++/99180
2512         PR c++/93295
2513         PR c++/93867
2514         PR c++/99118
2515         PR c++/96873
2516         * pt.c (alias_ctad_tweaks): Handle failure better.
2518 2021-04-10  Jason Merrill  <jason@redhat.com>
2520         PR c++/100006
2521         * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2523 2021-04-09  Patrick Palka  <ppalka@redhat.com>
2525         * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2526         (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2527         (LAMBDA_EXPR_REGEN_INFO): ... this.
2528         (tree_lambda_expr::regenerated_from)
2529         (tree_lambda_expr::regenerating_targs): Replace these with ...
2530         (tree_lambda_expr::regen_info): ... this.
2531         * constraint.cc (satisfy_declaration_constraints): Adjust
2532         accordingly.
2533         * lambda.c (build_lambda_expr): Likewise.
2534         * pt.c (regenerated_lambda_fn_p): Likewise.
2535         (most_general_lambda): Likewise.
2536         (tsubst_lambda_expr): Likewise.
2538 2021-04-09  Marek Polacek  <polacek@redhat.com>
2540         PR c++/99806
2541         * parser.c (cp_parser_member_declaration): Call
2542         cp_parser_save_default_args even for function templates.  Use
2543         STRIP_TEMPLATE on the declaration we're passing.
2545 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2547         PR c++/99874
2548         * constraint.cc (get_normalized_constraints_from_decl): Handle
2549         regenerated lambdas.
2550         (satisfy_declaration_constraints): Likewise.  Check for
2551         dependent args later.
2552         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2553         (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2554         (LAMBDA_EXPR_REGENERATING_TARGS): New.
2555         (tree_lambda_expr::regenerated_from): New data member.
2556         (tree_lambda_expr::regenerating_targs): New data member.
2557         (add_to_template_args): Declare.
2558         (regenerated_lambda_fn_p): Likewise.
2559         (most_general_lambda): Likewise.
2560         * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2561         and LAMBDA_EXPR_REGENERATING_TARGS.
2562         * pt.c (add_to_template_args): No longer static.
2563         (tsubst_function_decl): Unconditionally propagate constraints on
2564         the substituted function decl.
2565         (instantiated_lambda_fn_p): Rename to ...
2566         (regenerated_lambda_fn_p): ... this.  Check
2567         LAMBDA_EXPR_REGENERATED_FROM instead of
2568         LAMBDA_EXPR_INSTANTIATED.
2569         (most_general_lambda): Define.
2570         (enclosing_instantiation_of): Adjust after renaming
2571         instantiated_lambda_fn_p.
2572         (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED.  Set
2573         LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2574         Don't substitute or set constraints on the regenerated lambda.
2576 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2578         PR c++/97679
2579         * pt.c (build_deduction_guide): Document OUTER_ARGS.  Substitute
2580         them into the propagated constraints.
2582 2021-04-08  Jason Merrill  <jason@redhat.com>
2584         PR c++/91849
2585         * call.c (convert_like_internal): Improve reference diagnostic.
2587 2021-04-08  Jakub Jelinek  <jakub@redhat.com>
2589         PR c++/99859
2590         * constexpr.c (addr_of_non_const_var): New function.
2591         (cxx_bind_parameters_in_call): Set *non_constant_args to true
2592         even if cp_walk_tree on arg with addr_of_non_const_var callback
2593         returns true.
2595 2021-04-08  Jason Merrill  <jason@redhat.com>
2597         PR c++/94529
2598         * pt.c (determine_specialization): Improve diagnostic.
2600 2021-04-08  Marek Polacek  <polacek@redhat.com>
2602         PR c++/99844
2603         * decl.c (build_explicit_specifier): Call
2604         check_for_bare_parameter_packs.
2605         * except.c (build_noexcept_spec): Likewise.
2607 2021-04-07  Jason Merrill  <jason@redhat.com>
2609         PR c++/41723
2610         * parser.c (cp_parser_class_name): Check dependent_scope_p.
2612 2021-04-07  Jason Merrill  <jason@redhat.com>
2614         PR c++/52625
2615         * pt.c (maybe_process_partial_specialization): Check
2616         DECL_SELF_REFERENCE_P.
2618 2021-04-07  Jason Merrill  <jason@redhat.com>
2620         PR c++/92918
2621         * name-lookup.c (push_class_level_binding_1): Do overload a new
2622         function with a previous using-declaration.
2624 2021-04-06  Jason Merrill  <jason@redhat.com>
2626         PR c++/96673
2627         * init.c (get_nsdmi): Don't defer access checking.
2629 2021-04-06  Jason Merrill  <jason@redhat.com>
2631         PR c++/99901
2632         * decl.c (cp_finish_decl): mark_needed an implicitly inline
2633         static data member with an out-of-class redeclaration.
2635 2021-04-06  Jason Merrill  <jason@redhat.com>
2637         PR c++/91241
2638         * mangle.c (write_compact_number): Add sanity check.
2639         (write_local_name): Use list_length for parm number.
2641 2021-04-06  Patrick Palka  <ppalka@redhat.com>
2643         PR c++/99899
2644         * pt.c (do_auto_deduction): Don't exit early when deducing the
2645         array type of a structured binding.  Also handle adc_decomp_type
2646         during constraint checking.
2648 2021-04-05  Jason Merrill  <jason@redhat.com>
2650         PR c++/96311
2651         * typeck.c (check_return_expr): Call mark_exp_read in dependent
2652         case.
2654 2021-04-05  Jason Merrill  <jason@redhat.com>
2656         PR c++/98440
2657         * typeck.c (build_reinterpret_cast_1): Don't perform
2658         temporary materialization.
2660 2021-04-05  Jason Merrill  <jason@redhat.com>
2662         PR c++/95317
2663         * pt.c (lookup_template_class_1): Do tsubst_enum when
2664         tsubsting a generic lambda.
2666 2021-04-05  Jason Merrill  <jason@redhat.com>
2668         PR c++/95870
2669         * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2670         there is no enclosing non-lambda function.
2672 2021-04-05  Nathan Sidwell  <nathan@acm.org>
2674         PR c++/99380
2675         * module.cc (name_pending_imports): Drop 'atend' parm.  Don't
2676         query export when not needed.
2677         (preprocess_module, preprocessed_module): Adjust.
2679 2021-04-05  Jason Merrill  <jason@redhat.com>
2681         PR c++/99066
2682         * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2684 2021-04-05  Jason Merrill  <jason@redhat.com>
2686         PR c++/99201
2687         * pt.c (class el_data): Add visited field.
2688         (extract_local_specs): Pass it to cp_walk_tree.
2689         (extract_locals_r): Walk into the body of a lambda.
2691 2021-04-05  Jason Merrill  <jason@redhat.com>
2693         * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2694         template result.
2696 2021-04-04  Jason Merrill  <jason@redhat.com>
2698         PR c++/99643
2699         * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2701 2021-04-03  Marek Polacek  <polacek@redhat.com>
2703         PR c++/91416
2704         * parser.c: Create a GC root for attributes in a decl specifier.
2705         (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2707 2021-04-03  Jason Merrill  <jason@redhat.com>
2709         PR c++/91217
2710         * pt.c (tsubst_lambda_expr): Skip the body block from
2711         DECL_SAVED_TREE.
2713 2021-04-03  Jason Merrill  <jason@redhat.com>
2715         PR c++/90664
2716         * cvt.c (can_convert_qual): Check fnptr_conv_p.
2718 2021-04-03  Jason Merrill  <jason@redhat.com>
2720         PR c++/97900
2721         * pt.c (regenerate_decl_from_template): tsubst_decl
2722         the parms.
2724 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2726         PR c++/99869
2727         * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2728         to do_auto_deduction.
2730 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2732         PR c++/99586
2733         * semantics.c (finish_compound_literal): Check
2734         template_placeholder_p instead of type_uses_auto.
2736 2021-04-02  Jason Merrill  <jason@redhat.com>
2738         PR c++/97938
2739         * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2740         * lambda.c (add_capture): Set it.
2741         * pt.c (tsubst_pack_expansion): Handle it.
2743 2021-04-02  Nathan Sidwell  <nathan@acm.org>
2745         * cp-tree.h (lang_decl_base): Correct module flag comment.
2746         * module.cc (trees_in::assert_definition): Break out
2747         not_tmpl var.
2748         (trees_out::lang_decl_bools): Do not write purview for header units.
2750 2021-04-01  Marek Polacek  <polacek@redhat.com>
2752         PR c++/99831
2753         * method.c (defaulted_late_check): ++ and -- function_depth around
2754         the call to synthesize_method.
2755         * pt.c: Remove the saved_trees global.
2757 2021-04-01  Jason Merrill  <jason@redhat.com>
2759         PR c++/99583
2760         PR c++/99584
2761         * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2762         TYPE_RAISES_EXCEPTIONS.
2764 2021-04-01  Iain Sandoe  <iain@sandoe.co.uk>
2766         * mapper-client.cc (INCLUDE_MAP): New; require map to be
2767         included from system.h.
2768         * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2770 2021-04-01  Jason Merrill  <jason@redhat.com>
2772         PR c++/98481
2773         * mangle.c (write_expression): Adjust.
2774         * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2775         (mark_abi_tags_r): Likewise.
2777 2021-04-01  Nathan Sidwell  <nathan@acm.org>
2779         PR c++/99283
2780         * module.cc (trees_out::decl_node): Adjust importedness reference
2781         assert.
2782         (module_state::intercluster_seed): New.  Seed both imports and
2783         inter-cluster references.  Broken out of ...
2784         (module_state::write_cluster): ... here.  Call it.
2786 2021-03-31  Jason Merrill  <jason@redhat.com>
2788         PR c++/99445
2789         * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2791 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2793         PR c++/88115
2794         * mangle.c (write_expression): Adjust the mangling of
2795         __alignof__.
2797 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2799         PR c++/99815
2800         * pt.c (placeholder_type_constraint_dependent_p): Expand
2801         argument packs to separate the first non-pack argument
2802         from the rest.
2804 2021-03-30  Nathan Sidwell  <nathan@acm.org>
2806         PR c++/99283
2807         * module.cc (dumper::operator): Make less brittle.
2808         (trees_out::core_bools): VAR_DECLs always have a context.
2809         (trees_out::key_mergeable): Use same_type_p for asserting.
2810         (trees_in::read_var_def): Propagate
2811         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2813 2021-03-30  Jakub Jelinek  <jakub@redhat.com>
2815         PR c++/99790
2816         * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2818 2021-03-26  Marek Polacek  <polacek@redhat.com>
2820         PR c++/98352
2821         * method.c (implicitly_declare_fn): Pass &raises to
2822         synthesized_method_walk.
2824 2021-03-26  Nathan Sidwell  <nathan@acm.org>
2826         PR c++/99283
2827         * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2828         (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2829         * decl.c (duplicate_decls): Remove template_decl module flag
2830         propagation.
2831         * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2832         (dumper::impl::nested_name): Adjust for template-decl module flag
2833         change.
2834         (trees_in::assert_definition): Likewise.
2835         (trees_in::install_entity): Likewise.
2836         (trees_out::decl_value): Likewise.  Remove alias template
2837         separation of template and type_decl.
2838         (trees_in::decl_value): Likewise.
2839         (trees_out::key_mergeable): Likewise,
2840         (trees_in::key_mergeable): Likewise.
2841         (trees_out::decl_node): Adjust for template-decl module flag
2842         change.
2843         (depset::hash::make_dependency): Likewise.
2844         (get_originating_module, module_may_redeclare): Likewise.
2845         (set_instantiating_module, set_defining_module): Likewise.
2846         * name-lookup.c (name_lookup::search_adl): Likewise.
2847         (do_pushdecl): Likewise.
2848         * pt.c (build_template_decl): Likewise.
2849         (lookup_template_class_1): Remove special alias_template handling
2850         of DECL_TI_TEMPLATE.
2851         (tsubst_template_decl): Likewise.
2853 2021-03-26  Jakub Jelinek  <jakub@redhat.com>
2855         PR c++/99705
2856         * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2857         in DECL_EXPR or in BIND_EXPR_VARS.
2859 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2861         PR c++/99672
2862         * parser.c (cp_parser_postfix_expression): For calls, create
2863         combined_loc and temporarily set input_location to it before
2864         calling finish_call_expr.
2866 2021-03-25  Marek Polacek  <polacek@redhat.com>
2868         PR c++/94751
2869         * call.c (build_over_call): Maybe call mark_used in case
2870         deduce_inheriting_ctor fails and return error_mark_node.
2871         * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2872         * method.c (deduce_inheriting_ctor): Return bool if the deduction
2873         fails.
2874         (implicitly_declare_fn): If raises is error_mark_node, call
2875         synthesized_method_walk with diag being true.
2877 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2879         PR c++/99745
2880         * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2881         packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2883 2021-03-25  Marek Polacek  <polacek@redhat.com>
2885         PR c++/99331
2886         * call.c (build_converted_constant_expr_internal): Don't emit
2887         -Wconversion warnings.
2889 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2891         PR c++/99565
2892         * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2893         to operand_equal_p.
2894         * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2895         or COMPOUND_EXPR.
2897 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2899         PR c++/99283
2900         * name-lookup.c (check_module_override): Set global or partition
2901         DUP on the binding vector.
2903 2021-03-23  Marek Polacek  <polacek@redhat.com>
2905         PR c++/99318
2906         * decl2.c (cp_warn_deprecated_use_scopes): Only call
2907         cp_warn_deprecated_use when decl is a namespace, class, or enum.
2909 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2911         PR c++/99239
2912         * decl.c (duplicate_decls): Remove assert about maybe-imported
2913         artificial decls.
2915 2021-03-23  Jakub Jelinek  <jakub@redhat.com>
2917         PR c++/99650
2918         * decl.c (cp_finish_decomp): Diagnose void initializers when
2919         using tuple_element and get.
2921 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2923         PR c++/99480
2924         * module.cc (depset::hash::make_dependency): Propagate flags for
2925         partial specialization.
2926         (module_may_redeclare): Handle partial specialization.
2928 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2930         PR c++/99425
2931         * cp-tree.h (map_context_from, map_context_to): Delete.
2932         (add_mergeable_specialization): Add is_alias parm.
2933         * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2934         * module.cc (map_context_from, map_context_to): Delete.
2935         (trees_in::decl_value): Add specializations later, adjust call.
2936         Drop useless alias lookup. Set duplicate fn parm context.
2937         (check_mergeable_decl): Drop context mapping.
2938         (trees_in::is_matching_decl): Likewise.
2939         (trees_in::read_function_def): Drop parameter context adjustment
2940         here.
2942 2021-03-22  Martin Liska  <mliska@suse.cz>
2944         PR c++/99687
2945         * module.cc (fini_modules): Call vec_free instead of delete.
2947 2021-03-20  Jakub Jelinek  <jakub@redhat.com>
2949         PR debug/99230
2950         * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2951         special code, instead call c_genericize_control_stmt.
2953 2021-03-19  Jakub Jelinek  <jakub@redhat.com>
2955         PR c++/99456
2956         * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2957         INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2958         don't diagnose it, set *non_constant_p nor return t.
2960 2021-03-19  Marek Polacek  <polacek@redhat.com>
2962         PR c++/99500
2963         * parser.c (cp_parser_requirement_parameter_list): Handle
2964         error_mark_node.
2966 2021-03-18  Marek Polacek  <polacek@redhat.com>
2968         * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2970 2021-03-18  Marek Polacek  <polacek@redhat.com>
2972         * pt.c (tsubst_copy_and_build): Add assert.
2974 2021-03-18  Iain Sandoe  <iain@sandoe.co.uk>
2976         PR objc++/49070
2977         * parser.c (cp_debug_parser): Add Objective-C++ message
2978         state flag.
2979         (cp_parser_nested_name_specifier_opt): Allow colon to
2980         terminate an assignment-expression when parsing Objective-
2981         C++ messages.
2982         (cp_parser_objc_message_expression): Set and clear message
2983         parsing state on entry and exit.
2984         * parser.h (struct cp_parser): Add a context flag for
2985         Objective-C++ message state.
2987 2021-03-18  Martin Liska  <mliska@suse.cz>
2989         PR c++/99617
2990         * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2991         to NULL.
2993 2021-03-17  Marek Polacek  <polacek@redhat.com>
2995         PR c++/97973
2996         * call.c (conv_unsafe_in_template_p): New.
2997         (convert_like): Use it.
2999 2021-03-17  Anthony Sharp  <anthonysharp15@gmail.com>
3000             Jason Merrill  <jason@redhat.com>
3002         * semantics.c (get_class_access_diagnostic_decl): New
3003         function that examines special cases when a parent
3004         class causes a private access failure.
3005         (enforce_access): Slightly modified to call function
3006         above.
3008 2021-03-16  Jason Merrill  <jason@redhat.com>
3010         * tree.c (cp_tree_equal): Use real_identical.
3012 2021-03-16  Jakub Jelinek  <jakub@redhat.com>
3014         PR c++/99613
3015         * decl.c (expand_static_init): For thread guards, call __cxa_atexit
3016         before calling __cxa_guard_release rather than after it.  Formatting
3017         fixes.
3019 2021-03-16  Martin Liska  <mliska@suse.cz>
3020             Jason Merrill  <jason@redhat.com>
3022         PR c++/99108
3023         * call.c (get_function_version_dispatcher): Handle
3024         DECL_LOCAL_DECL_P.
3025         * decl.c (maybe_version_functions): Likewise.
3026         (maybe_mark_function_versioned): New.
3027         * name-lookup.c (push_local_extern_decl_alias): No longer static.
3028         * name-lookup.h (push_local_extern_decl_alias): Adjust.
3030 2021-03-16  Nathan Sidwell  <nathan@acm.org>
3032         PR c++/99496
3033         * module.cc (trees_out::decl_value): Adjust typedef streaming,
3034         indicate whether it is a dependent alias.
3035         (trees_in::decl_value): Likewise.  Set as dependent alias, if it
3036         is one.
3038 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
3040         PR c++/99047
3041         * coroutines.cc (expand_one_await_expression): If the
3042         await_ready() expression is not a boolean then convert it
3043         as required.
3045 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
3047         PR c++/98704
3048         * coroutines.cc (build_actor_fn): Make destroy index 1
3049         correspond to the abnormal unhandled_exception() exit.
3050         Substitute the proxy for the resume index.
3051         (coro_rewrite_function_body): Arrange to reset the resume
3052         index and make done = true for a rethrown exception from
3053         unhandled_exception ().
3054         (morph_fn_to_coro): Adjust calls to build_actor_fn and
3055         coro_rewrite_function_body.
3057 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
3059         PR c++/98480
3060         * coroutines.cc (replace_continue): Rewrite continue into
3061         'goto label'.
3062         (await_statement_walker): Handle await expressions in the
3063         initializer, condition and iteration expressions of for
3064         loops.
3066 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
3068         PR c++/96749
3069         * coroutines.cc (flatten_await_stmt): Allow for the case
3070         where a target expression variable only has uses in the
3071         second part of a compound expression.
3072         (maybe_promote_temps): Avoid emiting empty statements.
3074 2021-03-15  Tobias Burnus  <tobias@codesourcery.com>
3076         PR c++/99509
3077         * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
3078         ensure that the varpool node is marked as offloadable.
3080 2021-03-12  Nathan Sidwell  <nathan@acm.org>
3082         PR c++/99238
3083         * module.cc (depset::hash::add_binding_entity): Assert not
3084         visited.
3085         (depset::add::add_specializations): Likewise.
3086         * name-lookup.c (name_lookup::dedup): New.
3087         (name_lookup::~name_lookup): Assert not deduping.
3088         (name_lookup::restore_state): Likewise.
3089         (name_lookup::add_overload): Replace outlined code with dedup
3090         call.
3091         (name_lookup::add_value): Likewise.
3092         (name_lookup::search_namespace_only): Likewise.
3093         (name_lookup::adl_namespace_fns): Likewise.
3094         (name_lookup::adl_class_fns): Likewise.
3095         (name_lookup::search_adl): Likewise.  Add clearing dedup call.
3096         (name_lookup::search_qualified): Likewise.
3097         (name_lookup::search_unqualified): Likewise.
3099 2021-03-12  Jakub Jelinek  <jakub@redhat.com>
3101         PR c++/99507
3102         * call.c (build_over_call): For immediate evaluation of functions
3103         that return references, undo convert_from_reference effects before
3104         calling cxx_constant_value and call convert_from_reference
3105         afterwards.
3107 2021-03-11  Nathan Sidwell  <nathan@acm.org>
3109         PR c++/99248
3110         * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
3111         when there's a binding vector.
3112         * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
3114 2021-03-11  Nathan Sidwell  <nathan@acm.org>
3116         PR c++/99528
3117         * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
3118         MK_decl_tmpl_spec.
3119         (trees_in::decl_value): Adjust add_mergeable_specialization call.
3120         (trees_out::get_merge_kind): Adjust detecting a partial template
3121         instantiation.
3122         (trees_out::key_mergeable): Adjust handling same.
3123         (trees_in::key_mergeabvle): Likewise.
3125 2021-03-10  Nathan Sidwell  <nathan@acm.org>
3127         PR c++/99423
3128         * module.cc (post_load_processing): Assert not gcable.
3129         (laxy_load_pendings): Extend no-gc region around
3130         post_load_processing.
3132 2021-03-10  Nathan Sidwell  <nathan@acm.org>
3134         PR c++/99508
3135         * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
3136         assembler name to the ns alias.
3138 2021-03-09  Jakub Jelinek  <jakub@redhat.com>
3140         PR c++/99459
3141         * coroutines.cc (build_co_await): Look through NOP_EXPRs in
3142         build_special_member_call return value to find the CALL_EXPR.
3143         Simplify.
3145 2021-03-09  Nathan Sidwell  <nathan@acm.org>
3147         PR c++/99472
3148         * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
3149         that C++20 does not yet imply modules.
3151 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3153         PR c++/99436
3154         * name-lookup.c (get_cxx_dialect_name): Add cxx23.
3156 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3158         * lex.c (module_token_filter::resume): Ignore module-decls inside
3159         header-unit.
3160         * parser.c (cp_parser_module_declaration): Reject in header-unit.
3162 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3164         PR c++/99285
3165         * cp-tree.h (match_mergeable_specialization)
3166         (add_mergeable_specialization): Adjust parms.
3167         * module.cc (trees_in::decl_value): Adjust
3168         add_mergeable_specialization calls.
3169         (trees_out::key_mergeable): Adjust match_mergeable_specialization
3170         calls.
3171         (specialization_add): Likewise.
3172         * pt.c (match_mergeable_specialization): Do not insert.
3173         (add_mergeable_specialization): Add to hash table here.
3175 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3176             Jakub Jelinek  <jakub@redhat.com>
3178         PR c++/99287
3179         * constexpr.c (cxx_eval_increment_expression): Pass lval when
3180         evaluating the MODIFY_EXPR, and update 'mod' with the result of
3181         this evaluation.  Check *non_constant_p afterwards.  For prefix
3182         ops, just return 'mod'.
3184 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3185             Jakub Jelinek  <jakub@redhat.com>
3187         PR c++/96330
3188         * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3189         variable 'fn' to 'tmpl'.  Handle a variable template-id by
3190         calling lookup_template_variable.
3192 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3194         PR c++/99365
3195         * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3196         outer_targs to do_auto_deduction.
3197         (placeholder_type_constraint_dependent_p): Define.
3198         (do_auto_deduction): When processing_template_decl != 0
3199         and context is adc_unify and we have constraints, pretend the
3200         constraints are satisfied instead of punting.  Otherwise don't
3201         punt unless placeholder_type_constraint_dependent_p holds.
3202         Add some clarifying sanity checks.  Add a hack to add missing
3203         outermost template levels to outer_args before checking
3204         satisfaction.  Don't substitute outer_targs into type if it's
3205         already been done.
3207 2021-03-05  Marek Polacek  <polacek@redhat.com>
3209         PR c++/99374
3210         * call.c (standard_conversion): When converting pointers to
3211         member, don't return NULL when the bases are equivalent but
3212         incomplete.
3214 2021-03-05  Marek Polacek  <polacek@redhat.com>
3216         PR c++/99120
3217         * name-lookup.c (check_local_shadow): Check if the type of decl
3218         is non-null before checking TYPE_PTR*.
3220 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3222         PR c++/99245
3223         * module.cc (module_state::write_cluster): Relax binding assert.
3225 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3227         PR c++/99377
3228         * pt.c (instantiate_decl): Call set_instantiating_module.
3230 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3232         PR c++/98118
3233         * coroutines.cc (build_co_await): Use type_build_ctor_call()
3234         to determine cases when a CTOR needs to be built.
3235         (flatten_await_stmt): Likewise.
3236         (morph_fn_to_coro): Likewise.
3238 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3240         PR c++/95616
3241         * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3242         (coro_diagnose_throwing_final_aw_expr): New helper.
3243         (build_co_await): Diagnose throwing final await expression
3244         components.
3245         (build_init_or_final_await): Diagnose a throwing promise
3246         final_suspend() call.
3248 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3250         PR c++/95615
3251         * coroutines.cc (struct param_info): Track parameter copies that need
3252         a DTOR.
3253         (coro_get_frame_dtor): New helper function factored from build_actor().
3254         (build_actor_fn): Use coro_get_frame_dtor().
3255         (morph_fn_to_coro): Track parameters that need DTORs on exception,
3256         likewise the frame promise and the return object.  On exception, run the
3257         DTORs for these, destroy the frame and then rethrow the exception.
3259 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3261         PR c++/99389
3262         * pt.c (instantiate_class_template_1): Set instantiating module
3263         here.
3265 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
3267         PR c/99137
3268         * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3270 2021-03-04  Jakub Jelinek  <jakub@redhat.com>
3272         PR c++/88146
3273         PR c++/99362
3274         * cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
3275         comment.
3277 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3279         PR c++/99170
3280         * module.cc (class uintset): Delete.
3281         (typedef attached_map_t): A hash map.
3282         (attached_table): Use attached_map_t.  Adjust uses ...
3283         (trees_out::decl_value, trees_in::decl_value): ... here ...
3284         (trees_out::key_mergeable): ... here ...
3285         (trees_in::key_mergeable): ... here ...
3286         (maybe_attach_decl): ... here ...
3287         (direct_import): ... and here.
3289 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3291         PR c++/99170
3292         * cp-tree.h
3293         * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3294         rename.
3295         * module.cc (class pending_key): New.
3296         (default_hash_traits<pending_key>): New specialization.
3297         (pending_map_t): New typedef.
3298         (pending_table): Replace old table.
3299         (trees_out::lang_decl_bools): Adjust.
3300         (trees_in::lang_decl_bools): Adjust.
3301         (trees_in::install_entity): Drop pending member and specialization
3302         handling.
3303         (find_pending_key): New.
3304         (depset::hash::fiund_dependencies): Use it.
3305         (pendset_lazy_load): Delete.
3306         (module_state::write_cluster): Don't count pendings here.  Bye
3307         Duff's device-like thing.
3308         (module_state::write_pendings): Reimplement.
3309         (module_state::read_pendings): Reimplement.
3310         (lazy_specializations_p): Delete.
3311         (module_state::write): Adjust write_pendings call.
3312         (lazy_load_pendings): New.
3313         (lazy_load_specializations): Delete.
3314         (lazy_load_members): Delete.
3315         (init_modules): Adjust.
3316         * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3317         not lazy_load_members.
3318         (note_pending_specializations): Delete.
3319         (load_pending_specializations): Delete.
3320         * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3321         (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3322         (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3323         (note_pending_specializations): Delete.
3324         (load_pending_specializations): Delete.
3325         * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3326         lazy_load_specializations.
3327         (instantiate_template_class_1): Likewise.
3328         (instantiate_decl): Call lazy_load_pendings.
3329         * typeck.c (complete_type): Likewise.
3331 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3333         PR c++/99170
3334         * module.cc (post_load_decls): New.
3335         (lazy_snum, recursive_lazy): Move earlier.
3336         (module_state::read_cluster): Push cloning onto post_load_decls.
3337         (post_load_processing): New.  Do the cloning here.
3338         (module_state::read_inits): Call post_load_processing.
3339         (module_state::read_language): Likewise.
3340         (lazy_load_binding, lazy_load_specializations): Likewise
3341         (lazy_load_members): Likewise
3343 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3345         PR c++/99170
3346         * module.cc (trees_out::decl_value): Stream specialization keys
3347         after decl.
3348         (trees_in::decl_value): Stream them back and insert after
3349         completing the decl.
3350         (trees_out::key_mergeable): Drop some streaming here ...
3351         (trees_in::key_mergeable): ... and here.  Don't insert into
3352         specialization tables.
3354 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3356         * constraint.cc (struct sat_info): Document the different
3357         meanings of noisy() and diagnose_unsatisfaction_p() during
3358         satisfaction and requires-expression evaluation.
3359         (tsubst_valid_expression_requirement): Take a sat_info instead
3360         of a subst_info.  Perform the substitution quietly first.  Fold
3361         in error-replaying code from diagnose_valid_expression.
3362         (tsubst_simple_requirement): Take a sat_info instead of a
3363         subst_info.
3364         (tsubst_type_requirement_1): New.  Fold in error-replaying code
3365         from diagnose_valid_type.
3366         (tsubst_type_requirement): Use the above.  Take a sat_info
3367         instead of a subst_info.
3368         (tsubst_compound_requirement): Likewise.  Fold in
3369         error-replaying code from diagnose_compound_requirement.
3370         (tsubst_nested_requirement): Take a sat_info instead of a
3371         subst_info.  Fold in error-replaying code from
3372         diagnose_nested_requirement.
3373         (tsubst_requirement): Take a sat_info instead of a subst_info.
3374         (tsubst_requires_expr): Split into two versions, one that takes
3375         a sat_info argument and another that takes a complain and
3376         in_decl argument.  Remove outdated documentation.  Document the
3377         effects of the sat_info argument.  Don't short-circuit
3378         processing of requirements when diagnosing unsatisfaction,
3379         mirroring diagnose_requires_expr.
3380         (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3381         assert, and se the three-parameter version of tsubst_requires_expr.
3382         (diagnose_trait_expr): Make static.  Take a template argument
3383         vector instead of a parameter mapping.
3384         (diagnose_valid_expression): Remove.
3385         (diagnose_valid_type): Remove.
3386         (diagnose_simple_requirement): Remove.
3387         (diagnose_compound_requirement): Remove.
3388         (diagnose_type_requirement): Remove.
3389         (diagnose_nested_requirement): Remove.
3390         (diagnose_requirement): Remove.
3391         (diagnose_requires_expr): Remove.
3392         (diagnose_atomic_constraint): Take a sat_info instead of a
3393         subst_info.  Adjust call to diagnose_trait_expr.  Call
3394         tsubst_requires_expr instead of diagnose_requires_expr.
3395         (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3396         and just always call constraint_satisfaction_value.
3398 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3400         * constexpr.c (cxx_eval_call_expression): Adjust call to
3401         evaluate_concept_check.
3402         (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3403         evaluate_requires_expression instead of
3404         satisfy_constraint_expression.
3405         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3406         * constraint.cc (struct sat_info): Adjust comment about which
3407         satisfaction entrypoints use noisy-unsat.
3408         (normalize_template_requirements): Remove (and adjust callers
3409         appropriately).
3410         (normalize_nontemplate_requirements): Likewise.
3411         (tsubst_nested_requirement): Use constraint_satisfaction_value
3412         instead of satisfy_constraint_expression, which'll do the
3413         noisy replaying of ill-formed quiet satisfaction for us.
3414         (decl_satisfied_cache): Adjust comment.
3415         (satisfy_constraint): Rename to ...
3416         (satisfy_normalized_constraints): ... this.
3417         (satisfy_associated_constraints): Remove (and make its
3418         callers check for dependent arguments).
3419         (satisfy_constraint_expression): Rename to ...
3420         (satisfy_nondeclaration_constraints): ... this.  Assert that
3421         'args' is empty when 't' is a concept-id.  Removing handling
3422         bare constraint-expressions, and handle REQUIRES_EXPRs
3423         specially.  Adjust comment accordingly.
3424         (satisfy_declaration_constraints): Assert in the two-parameter
3425         version that 't' is not a TEMPLATE_DECL.  Adjust following
3426         removal of normalize_(non)?template_requirements and
3427         satisfy_asociated_constraints.
3428         (constraint_satisfaction_value): Combine the two- and
3429         three-parameter versions in the natural way.
3430         (constraints_satisfied_p): Combine the one- and two-parameter
3431         versions in the natural way.  Improve documentation.
3432         (evaluate_requires_expr): Define.
3433         (evaluate_concept_check): Remove 'complain' parameter.  Use
3434         constraint_satisfaction_value instead of
3435         satisfy_constraint_expression.
3436         (diagnose_nested_requirement): Adjust following renaming of
3437         satisfy_constraint_expression.
3438         (diagnose_constraints): Handle REQUIRES_EXPR by going through
3439         diagnose_requires_expr directly instead of treating it as a
3440         constraint-expression.  Improve documentation.
3441         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3442         to evaluate_concept_check.
3443         <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3444         constraints_satisfied_p.
3445         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3446         * cp-tree.h (evaluate_requires_expr): Declare.
3447         (evaluate_concept_check): Remove tsubst_flag_t parameter.
3448         (satisfy_constraint_expression): Remove declaration.
3449         (constraints_satisfied_p): Remove one-parameter declaration.
3450         Add a default argument to the two-parameter declaration.
3451         * cvt.c (convert_to_void): Adjust call to
3452         evaluate_concept_check.
3454 2021-03-03  Jakub Jelinek  <jakub@redhat.com>
3456         PR c++/82959
3457         * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3458         and COMPOUND_EXPR.
3460 2021-03-03  Marek Polacek  <polacek@redhat.com>
3462         PR c++/97034
3463         PR c++/99009
3464         * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3465         (maybe_aggr_guide): Use the original template type where needed.  In
3466         a class member template, partially instantiate the result of
3467         collect_ctor_idx_types.
3468         (do_class_deduction): Defer the deduction until the enclosing
3469         scope is non-dependent.
3471 2021-03-03  Jason Merrill  <jason@redhat.com>
3473         PR c++/95675
3474         * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3475         if it didn't get one before.
3477 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3479         PR c++/99344
3480         * module.cc (trees_out::decl_node): Small refactor.
3481         (depset::hash::add_binding_entity): Return true on meeting an
3482         import.  Set namespace's import here.
3483         (module_state:write_namespaces): Inform of purview too.
3484         (module_state:read_namespaces): Adjust.
3485         * name-lookup.c (implicitly_export_namespace): Delete.
3486         (do_pushdecl): Don't call it.
3487         (push_namespace): Likewise, set purview.
3488         (add_imported_namespace): Reorder parms.
3489         * name-lookup.h (add_imported_namespace): Alter param ordering.
3491 2021-03-02  Martin Sebor  <msebor@redhat.com>
3493         PR c++/99251
3494         * class.c (build_base_path): Call build_if_nonnull.
3495         * cp-tree.h (build_if_nonnull): Declare.
3496         * rtti.c (ifnonnull): Rename...
3497         (build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
3498         (build_dynamic_cast_1): Adjust to name change.
3500 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3502         PR c++/96443
3503         PR c++/96960
3504         * constraint.cc (type_deducible_p): Don't substitute into the
3505         constraints, and instead just pass 'args' to do_auto_deduction
3506         as the outer template arguments.
3507         (tsubst_parameter_mapping): Remove confused code for handling
3508         placeholder type arguments.
3509         (normalize_placeholder_type_constraint): Define.
3510         (satisfy_constraint_expression): Use it to handle placeholder
3511         'auto' types.
3512         * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3513         (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3514         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3515         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3516         (make_constrained_placeholder_type): Set
3517         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3518         (do_auto_deduction): Clarify comments about the outer_targs
3519         parameter.  Rework satisfaction of a placeholder type constraint
3520         to pass in the complete set of template arguments directly to
3521         constraints_satisfied_p.
3522         (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3523         instead.  Also rebuild the the constraint info on the new auto.
3525 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3527         * constraint.cc (build_parameter_mapping): Rely on the caller to
3528         determine the in-scope template parameters.
3529         (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3530         to the two-parameter constructor.  In the two-parameter
3531         constructor, fold in the definition of make_context, set
3532         initial_parms appropriately, and don't set the now-removed
3533         orig_decl member.
3534         (norm_info::make_context): Remove, now that its only use is
3535         inlined into the caller.
3536         (norm_info::update_context): Adjust call to
3537         build_parameter_mapping to pass in the relevant set of in-scope
3538         template parameters.
3539         (norm_info::ctx_parms): Define this member function.
3540         (norm_info::context): Initialize to NULL_TREE.
3541         (norm_info::orig_decl): Remove this data member.
3542         (norm_info::initial_parms): Define this data member.
3543         (normalize_atom): Adjust call to build_parameter_mapping to pass
3544         in the relevant set of in-scope template parameters.  Use
3545         info.initial_parms instead of info.orig_decl.
3546         (normalize_constraint_expression): Take a norm_info object
3547         instead of a bool.  Cache the result of normalization.
3548         (tsubst_nested_requirement): Call satisfy_constraint_expression
3549         instead of satisfy_constraint, so that we normalize on demand.
3550         (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3551         Adjust call to normalize_constraint_expression.
3552         (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3553         to current_template_parms.
3554         (diagnose_nested_requirements): Go through
3555         satisfy_constraint_expression, as with tsubst_nested_requirement.
3557 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3559         * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3560         arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3561         started with a TYPE_ARGUMENT_PACK.
3562         (finish_requires_expr): Don't set DECL_CONTEXT and
3563         CONSTRAINT_VAR_P on each of the introduced parameters here.
3564         * parser.c (cp_parser_requirement_parameter_list): Instead set
3565         these fields earlier, here.
3566         * pt.c (do_auto_deduction): Canonicalize the result of
3567         do_auto_deduction.  Pass 'complain' to finish_decltype_type.
3569 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3571         * constraint.cc (tsubst_simple_requirement): Just return
3572         boolean_true_node on success.
3573         (tsubst_type_requirement): Likewise.
3574         (tsubst_compound_requirement): Likewise.
3575         (tsubst_nested_requirement): Likewise.
3576         (tsubst_requirement_body): Remove.
3577         (check_constaint_variables): Rename to ...
3578         (check_constraint_variables): ... this.
3579         (tsubst_constraint_variables): Adjust.
3580         (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3582 2021-03-01  Nathan Sidwell  <nathan@acm.org>
3584         PR c++/99294
3585         * class.c (fixup_type_variants): Propagate mode, precision,
3586         alignment & emptiness.
3587         * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3588         (trees_in::tree_node): Rematerialize alignment here.
3590 2021-02-27  Jason Merrill  <jason@redhat.com>
3592         PR c++/90333
3593         * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3594         between () and ->.
3596 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3598         * parser.c (cp_parser_lambda_declarator_opt): Implement
3599         P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3600         for -std={c,gnu}++2b or with pedwarn in earlier versions.
3602 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3604         PR c++/95451
3605         * lambda.c (is_lambda_ignored_entity): Before checking for
3606         LAMBDA_FUNCTION_P, use OVL_FIRST.  Drop FUNCTION_DECL check.
3608 2021-02-26  Jason Merrill  <jason@redhat.com>
3610         PR c++/98810
3611         * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3612         to a class non-type template argument that needs it.
3614 2021-02-26  Patrick Palka  <ppalka@redhat.com>
3616         PR c++/98990
3617         * pt.c (splice_late_return_type): Rebuild the entire return type
3618         if we have to adjust the level of an auto within.
3619         (type_uses_auto): Adjust call to find_type_usage.
3620         * type-utils.h (find_type_usage): Revert r10-6571 change that
3621         made this function return a pointer to the auto node.
3623 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3625         PR c++/99213
3626         PR c++/94521
3627         * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3628         TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3630 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3632         PR c++/99103
3633         * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3634         (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3636 2021-02-25  Marek Polacek  <polacek@redhat.com>
3638         DR 1312
3639         PR c++/99176
3640         * constexpr.c (is_std_construct_at): New overload.
3641         (is_std_allocator_allocate): New overload.
3642         (cxx_eval_call_expression): Use the new overloads.
3643         (cxx_eval_constant_expression): Reject casting
3644         from void * as per DR 1312.  Don't check can_convert.
3646 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3648         PR c++/97587
3649         * coroutines.cc (struct param_info): Track rvalue refs.
3650         (morph_fn_to_coro): Track rvalue refs, and call the promise
3651         CTOR with the frame copy of passed parms.
3653 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3655         PR c++/95822
3656         * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3657         set throwing_cleanup marker.
3659 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3661         PR c++/99166
3662         * module.cc (module_state::inform_cmi_p): Renamed field.
3663         (module_state::do_import): Adjust.
3664         (init_modules, finish_module_processing): Likewise.
3665         (handle_module_option): Likewise.
3667 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3669         PR c++/98318
3670         * mapper-client.cc (module_client::open_module_client): Fix typo
3671         of fd init.
3673 2021-02-24  Nathan Sidwell  <nathan@acm.org>
3675         PR c++/98718
3676         * module.cc (ool): New indirection vector.
3677         (loc_spans::maybe_propagate): Location is not optional.
3678         (loc_spans::open): Likewise.  Assert monotonically advancing.
3679         (module_for_ordinary_loc): Use ool indirection vector.
3680         (module_state::write_prepare_maps): Do not count empty macro
3681         expansions.  Elide empty spans.
3682         (module_state::write_macro_maps): Skip empty expansions.
3683         (ool_cmp): New qsort comparator.
3684         (module_state::write): Create and destroy ool vector.
3685         (name_pending_imports): Fix dump push/pop.
3686         (preprocess_module): Likewise.  Add more dumping.
3687         (preprocessed_module): Likewise.
3689 2021-02-24  Iain Sandoe  <iain@sandoe.co.uk>
3691         PR c++/96251
3692         * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3693         error reporting when instantiating for a constexpr.
3695 2021-02-23  Nathan Sidwell  <nathan@acm.org>
3697         PR c++/99208
3698         * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3699         identity.
3701 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3703         PR c++/95468
3704         * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3705         over from tsubst_copy.
3707 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3709         * pt.c (instantiation_dependent_expression_p): Check
3710         processing_template_decl before calling
3711         potential_constant_expression.
3713 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3715         PR c++/99174
3716         * module.cc (struct module_state): Add visited_p flag.
3717         (name_pending_imports): Use it to avoid duplicate requests.
3718         (preprocess_module): Don't read preprocessor state if we failed to
3719         load a module's config.
3721 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3723         PR c++/99153
3724         * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3725         to common-path.
3726         * module.cc (set_defining_module): Add assert.
3728 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3730         PR c++/98741
3731         * module.cc (pending_imports): New.
3732         (declare_module): Adjust test condition.
3733         (name_pending_imports): New.
3734         (preprocess_module): Reimplement using pending_imports.
3735         (preprocessed_module): Move name-getting to name_pending_imports.
3736         * name-lookup.c (append_imported_binding_slot): Assert module
3737         ordering is increasing.
3739 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3741         * module.cc (note_cmis): New.
3742         (struct module_state): Add inform_read_p bit.
3743         (module_state::do_import): Inform of CMI location, if enabled.
3744         (init_modules): Canonicalize note_cmis entries.
3745         (handle_module_option): Handle -flang-info-module-read=FOO.
3747 2021-02-19  Jason Merrill  <jason@redhat.com>
3749         PR c++/96926
3750         * call.c (perfect_conversion_p): Limit rvalueness
3751         test to reference bindings.
3753 2021-02-19  Jason Merrill  <jason@redhat.com>
3755         PR c++/96926
3756         * call.c (perfect_conversion_p): New.
3757         (perfect_candidate_p): New.
3758         (add_candidates): Ignore templates after a perfect non-template.
3760 2021-02-18  Nathan Sidwell  <nathan@acm.org>
3762         PR c++/99023
3763         * module.cc (canonicalize_header_name): Use
3764         cpp_probe_header_unit.
3765         (maybe_translate_include): Fix note_includes comparison.
3766         (init_modules): Fix note_includes string termination.
3768 2021-02-18  Jakub Jelinek  <jakub@redhat.com>
3770         PR c++/99132
3771         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3772         cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3773         for immediate function calls.
3775 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3777         PR c++/99023
3778         * module.cc (struct macro_export): Add GTY markers.
3779         (macro_exports): Likewise, us a va_gc Vector.
3781 2021-02-17  Jakub Jelinek  <jakub@redhat.com>
3783         PR sanitizer/99106
3784         * init.c (build_zero_init_1): For flexible array members just return
3785         NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3786         ARRAY_TYPE.
3788 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3790         PR c++/99116
3791         * name-lookup.c (do_pushdecl): Don't peek under template_parm
3792         bindings here ...
3793         (set_identifier_type_value_with_scope): ... or here.
3794         (do_pushtag): Only set_identifier_type_value_with_scope at
3795         non-class template parm scope, and use parent scope.
3797 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3799         PR c++/99071
3800         * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3801         pointer.
3803 2021-02-17  Patrick Palka  <ppalka@redhat.com>
3805         PR debug/96997
3806         PR c++/94034
3807         * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3809 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3811         * module.cc (module_state::write_cluster): Check bindings for
3812         imported using-decls.
3814 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3816         PR c++/99040
3817         * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3818         for new namespace-scope entities.
3819         (module_state::read_cluster): Don't call add_module_decl here.
3820         * name-lookup.h (add_module_decl): Rename to ...
3821         (add_module_namespace_decl): ... this.
3822         * name-lookup.c (newbinding_bookkeeping): Move into ...
3823         (do_pushdecl): ... here.  Its only remaining caller.
3824         (add_module_decl): Rename to ...
3825         (add_module_namespace_decl): ... here.  Add checking-assert for
3826         circularity. Don't call newbinding_bookkeeping, just extern_c
3827         checking and incomplete var checking.
3829 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3831         PR c++/99039
3832         PR c++/99040
3833         * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3834         (global_type_node): Delete.
3835         (IDENTIFIER_TYPE_VALUE): Delete.
3836         (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3837         (get_type_value): Delete.
3838         * name-lookup.h (identifier_type_value): Delete.
3839         * name-lookup.c (check_module_override): Don't
3840         SET_IDENTIFIER_TYPE_VALUE here.
3841         (do_pushdecl): Nor here.
3842         (identifier_type_value_1, identifier_type_value): Delete.
3843         (set_identifier_type_value_with_scope): Only
3844         SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3845         (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3846         (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3847         * call.c (check_dtor_name): Use lookup_name.
3848         * decl.c (cxx_init_decl_processing): Drop global_type_node.
3849         * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3850         here.
3851         * init.c (get_type_value): Delete.
3852         * pt.c (instantiate_class_template_1): Don't call pushtag or
3853         SET_IDENTIFIER_TYPE_VALUE here.
3854         (tsubst): Assert never an identifier.
3855         (dependent_type_p): Drop global_type_node assert.
3856         * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3857         to determine ctorness.
3859 2021-02-12  Jakub Jelinek  <jakub@redhat.com>
3861         PR c++/97742
3862         * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3863         CPP_EOF.
3865 2021-02-12  Jason Merrill  <jason@redhat.com>
3867         PR c++/97246
3868         PR c++/94546
3869         * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3870         (register_parameter_specializations): Not here.
3872 2021-02-11  Marek Polacek  <polacek@redhat.com>
3874         PR c++/95888
3875         * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3876         for the partial instantiation.
3878 2021-02-11  Jakub Jelinek  <jakub@redhat.com>
3880         PR c++/99033
3881         * init.c (build_zero_init_1): Handle zero initialiation of
3882         flexible array members like initialization of [0] arrays.
3883         Use integer_minus_onep instead of comparison to integer_minus_one_node
3884         and integer_zerop instead of comparison against size_zero_node.
3885         Formatting fixes.
3887 2021-02-11  Marek Polacek  <polacek@redhat.com>
3889         PR c++/99063
3890         * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3892 2021-02-11  Patrick Palka  <ppalka@redhat.com>
3894         PR c++/97582
3895         * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3896         lookup result by discarding it if the first element is a
3897         class-scope declaration, otherwise return it.
3898         (push_operator_bindings): Handle an ambiguous lookup result by
3899         doing push_local_binding on each element in the list.
3901 2021-02-11  Marek Polacek  <polacek@redhat.com>
3903         * parser.c (cp_parser_selection_statement): Use vec_free.
3905 2021-02-10  Jakub Jelinek  <jakub@redhat.com>
3907         PR c++/98988
3908         PR c++/99031
3909         * constexpr.c: Include cgraph.h.
3910         (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3911         heap artificial vars.
3912         (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3913         heap artificial vars.
3915 2021-02-10  Nathan Sidwell  <nathan@acm.org>
3917         PR c++/99030
3918         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3919         answer if there's no local specialization.
3921 2021-02-09  Nathan Sidwell  <nathan@acm.org>
3923         PR c++/98944
3924         * module.cc (module_state::is_rooted): Rename to ...
3925         (module_state::has_location): ... here.  Adjust callers.
3926         (module_state::read_partitions): Adjust validity check.
3927         Don't overwrite a known location.
3929 2021-02-09  Jason Merrill  <jason@redhat.com>
3931         PR c++/96905
3932         * pt.c (mark_decl_instantiated): Exit early if consteval.
3934 2021-02-09  Jason Merrill  <jason@redhat.com>
3936         PR c++/98326
3937         PR c++/20408
3938         * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3939         parm.
3941 2021-02-09  Jason Merrill  <jason@redhat.com>
3943         PR c++/98994
3944         PR c++/97566
3945         * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3946         RECORD_TYPE.
3948 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3950         * decl.c (start_cleanup_fn): Push function into
3951         namespace.
3953 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3955         PR c++/98531
3956         * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3957         * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3958         from rtti.c, add default namespace arg.
3959         (check_redeclaration_exception_specification): Allow a lazy
3960         builtin's eh spec to differ from an lready-declared user
3961         declaration.
3962         (declare_global_var): Use push/pop_abi_namespace.
3963         (get_atexit_node): Push the fndecl into a namespace.
3964         * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3965         decl.c.
3967 2021-02-08  Marek Polacek  <polacek@redhat.com>
3969         * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3971 2021-02-05  Marek Polacek  <polacek@redhat.com>
3973         PR c++/98947
3974         * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3975         on arg2/arg3.
3976         * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3977         issuing the -Wvolatile warning.  Only set TREE_THIS_VOLATILE if
3978         a warning was emitted.
3980 2021-02-05  Marek Polacek  <polacek@redhat.com>
3982         PR c++/96462
3983         * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3985 2021-02-05  Jakub Jelinek  <jakub@redhat.com>
3987         PR c++/97878
3988         * decl.c (check_array_initializer): For structured bindings, require
3989         the array type to be complete.
3991 2021-02-04  Jason Merrill  <jason@redhat.com>
3993         PR c++/98717
3994         * constraint.cc (build_concept_check_arguments): Remove assert.
3995         (build_concept_check): Allow empty args.
3997 2021-02-04  Tom Greenslade (thomgree)  <thomgree@cisco.com>
3999         PR c++/90926
4000         * call.c (can_convert_array): Extend to handle all valid aggregate
4001         initializers of an array; including by string literals, not just by
4002         brace-init-list.
4003         (build_aggr_conv): Call can_convert_array more often, not just in
4004         brace-init-list case.
4005         * typeck2.c (array_string_literal_compatible_p): New function.
4006         (digest_init_r): call array_string_literal_compatible_p
4007         * cp-tree.h: (array_string_literal_compatible_p): Declare.
4009 2021-02-04  Jason Merrill  <jason@redhat.com>
4011         PR c++/98802
4012         * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
4014 2021-02-04  Jason Merrill  <jason@redhat.com>
4016         PR c++/95192
4017         * pt.c (tsubst_attribute): Handle error.
4018         (apply_late_template_attributes): Return false on error.
4019         (tsubst_function_decl): Check its return value.
4020         (tsubst_decl): Likewise.
4021         (push_template_decl): Assert current_template_parms.
4022         (tsubst_template_decl): Set current_template_parms.
4024 2021-02-03  Marek Polacek  <polacek@redhat.com>
4026         PR c++/98951
4027         * call.c (struct z_candidate): Mark rewritten and reversed as const.
4028         (struct NonPublicField): Mark operator() as const.
4029         (struct NonTrivialField): Likewise.
4031 2021-02-03  Jason Merrill  <jason@redhat.com>
4033         PR c++/98926
4034         PR c++/98570
4035         * pt.c (spec_hasher::equal): Set processing_template_decl.
4036         * Make-lang.in (check-g++-strict-gc): Add --param
4037         hash-table-verification-limit=10000.
4039 2021-02-03  Marek Polacek  <polacek@redhat.com>
4041         PR c++/98899
4042         * parser.c (cp_parser_class_specifier_1): Use any possible
4043         DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
4044         (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
4045         * pt.c (tsubst_exception_specification): Stash new_specs into
4046         DEFPARSE_INSTANTIATIONS.
4047         * tree.c (fixup_deferred_exception_variants): Use
4048         UNPARSED_NOEXCEPT_SPEC_P.
4050 2021-02-02  Jason Merrill  <jason@redhat.com>
4052         PR c++/98929
4053         PR c++/96199
4054         * error.c (dump_expr): Ignore dummy object.
4055         * pt.c (tsubst_baselink): Handle dependent scope.
4057 2021-02-01  Patrick Palka  <ppalka@redhat.com>
4059         PR c++/98295
4060         * constexpr.c (cxx_eval_array_reference): Also set
4061         new_ctx.object when setting new_ctx.ctor.
4063 2021-02-01  Marek Polacek  <polacek@redhat.com>
4065         PR c++/98355
4066         * parser.c (cp_parser_has_attribute_expression): Use
4067         uses_template_parms instead of type_dependent_expression_p.
4069 2021-02-01  Jason Merrill  <jason@redhat.com>
4071         PR c++/98570
4072         * cp-tree.h: Declare it.
4073         * pt.c (comparing_dependent_aliases): New flag.
4074         (template_args_equal, spec_hasher::equal): Set it.
4075         (dependent_alias_template_spec_p): Assert that we don't
4076         get non-types other than error_mark_node.
4077         (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
4078         on complex alias specializations.  Set TYPE_DEPENDENT_P here.
4079         (tsubst_decl): Not here.
4080         * module.cc (module_state::read_cluster): Set
4081         comparing_dependent_aliases instead of
4082         comparing_specializations.
4083         * tree.c (cp_tree_equal): Remove comparing_specializations
4084         module handling.
4085         * typeck.c (structural_comptypes): Adjust.
4086         (comptypes): Remove comparing_specializations handling.
4088 2021-01-29  Nathan Sidwell  <nathan@acm.org>
4090         PR c++/98843
4091         * module.cc (module_state_config): Add num_entities field.
4092         (module_state::read_entities): The entity_ary span is
4093         already allocated.
4094         (module_state::write_config): Write num_entities.
4095         (module_state::read_config): Read num_entities.
4096         (module_state::write): Set config's num_entities.
4097         (module_state::read_initial): Allocate the entity ary
4098         span here.
4099         (module_state::read_language): Do not set entity_lwm
4100         here.
4102 2021-01-29  Marek Polacek  <polacek@redhat.com>
4104         PR c++/96137
4105         * parser.c (cp_parser_class_name): If parser->scope is
4106         error_mark_node, return it, otherwise continue.
4108 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
4110         PR c++/98841
4111         * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
4113 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
4115         PR c++/33661
4116         PR c++/98847
4117         * decl.c (cp_finish_decl): For register vars with asmspec in templates
4118         call set_user_assembler_name and set DECL_HARD_REGISTER.
4119         * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
4120         pass asmspec_tree to cp_finish_decl.
4122 2021-01-28  Nathan Sidwell  <nathan@acm.org>
4124         PR c++/98770
4125         * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
4126         check order.
4127         (trees_in::decl_value): Do typedef frobbing only when installing
4128         a new typedef, adjust is_matching_decl call.  Swap is_typedef
4129         & TYPE_NAME check.
4130         (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
4131         names and deal with typedef checking.
4133 2021-01-27  Jason Merrill  <jason@redhat.com>
4135         PR c++/97874
4136         * name-lookup.c (lookup_using_decl): Clean up handling
4137         of dependency and inherited constructors.
4138         (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
4139         * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
4141 2021-01-26  Jason Merrill  <jason@redhat.com>
4143         PR c++/97474
4144         * call.c (type_passed_as): Don't mark invisiref restrict.
4146 2021-01-26  Jason Merrill  <jason@redhat.com>
4148         PR c++/97566
4149         PR c++/98463
4150         * class.c (layout_class_type): An empty field gets size 0.
4151         (is_empty_field): New.
4152         (check_bases): Check it.
4153         * cp-tree.h (is_empty_field): Declare it.
4154         * constexpr.c (cxx_eval_store_expression): Check it.
4155         (cx_check_missing_mem_inits): Likewise.
4156         * init.c (perform_member_init): Likewise.
4157         * typeck2.c (process_init_constructor_record): Likewise.
4159 2021-01-25  Martin Sebor  <msebor@redhat.com>
4161         PR c++/98646
4162         * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
4164 2021-01-25  Jason Merrill  <jason@redhat.com>
4166         PR c++/98463
4167         * constexpr.c (get_or_insert_ctor_field): Add check.
4168         (cxx_eval_store_expression): Handle discontinuity of refs.
4170 2021-01-23  Anthony Sharp  <anthonysharp15@gmail.com>
4172         * call.c (complain_about_access): Altered function.
4173         * cp-tree.h (complain_about_access): Changed parameters of function.
4174         (get_parent_with_private_access): Declared new function.
4175         * search.c (get_parent_with_private_access): Defined new function.
4176         * semantics.c (enforce_access): Modified function.
4177         * typeck.c (complain_about_unrecognized_member): Updated function
4178         arguments in complain_about_access.
4180 2021-01-23  Patrick Palka  <ppalka@redhat.com>
4182         PR c++/97399
4183         * cp-tree.h (shared_member_p): Adjust declaration.
4184         * parser.c (cp_parser_init_declarator): If the storage class
4185         specifier is sc_static, pass true for static_p to
4186         cp_parser_declarator.
4187         (cp_parser_direct_declarator): Don't do inject_this_parm when
4188         the declarator is a friend.
4189         * search.c (shared_member_p): Change return type to bool and
4190         adjust function body accordingly.  Return false for a dependent
4191         USING_DECL instead of aborting.
4192         * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4193         even when type-dependent.
4195 2021-01-22  Marek Polacek  <polacek@redhat.com>
4197         PR c++/96623
4198         * parser.c (inject_parm_decls): Remove a redundant assignment.
4199         (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4200         before calling inject_parm_decls.
4202 2021-01-22  Jason Merrill  <jason@redhat.com>
4204         PR c++/98744
4205         * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4207 2021-01-22  Jakub Jelinek  <jakub@redhat.com>
4209         PR sanitizer/95693
4210         * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4211         return build_zero_cst for reference types.
4212         * typeck2.c (process_init_constructor_record): Instead call
4213         build_zero_cst here during error recovery instead of build_zero_init.
4215 2021-01-22  Marek Polacek  <polacek@redhat.com>
4217         PR c++/98545
4218         * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4219         warnings regardless of abi_version_at_least.
4220         (write_expression): When the expression is a dependent name
4221         and an operator name, write "on" before writing its name.
4223 2021-01-22  Marek Polacek  <polacek@redhat.com>
4225         PR c++/97966
4226         * pt.c (instantiate_class_template_1): Instantiate members
4227         marked with attribute used only after we're done instantiating
4228         the class.
4230 2021-01-21  Patrick Palka  <ppalka@redhat.com>
4232         PR c++/71879
4233         * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4234         sentinel at the start of the function.  Remove a now-redundant
4235         manual adjustment of cp_unevaluated_operand.
4237 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4239         PR c++/98624
4240         * module.cc (depset::hash::find_dependencies): Add
4241         module arg.
4242         (trees_out::core_vals): Check state before calling
4243         write_location.
4244         (sort_cluster, module_state::write): Adjust
4245         find_dependencies call.
4247 2021-01-21  Jakub Jelinek  <jakub@redhat.com>
4249         PR c++/98672
4250         * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4251         (check_for_return_continue): Also look for BREAK_STMT.  Handle
4252         SWITCH_STMT by ignoring break_stmt from its body.
4253         (potential_constant_expression_1) <case FOR_STMT>,
4254         <case WHILE_STMT>: If the condition isn't constant true, check if
4255         the loop body can contain a return stmt.
4256         <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4257         <case IF_STMT>: If recursion with tf_none is successful,
4258         merge *jump_target from the branches - returns with highest priority,
4259         breaks or continues lower.  If then branch is potentially constant and
4260         doesn't return, check the else branch if it could return, break or
4261         continue.
4263 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4265         PR c++/98530
4266         * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4268 2021-01-20  Nathan Sidwell  <nathan@acm.org>
4270         * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4271         signed type.
4273 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4275         PR c++/95434
4276         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4277         CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4278         adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4280 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4282         PR c++/82613
4283         * parser.c (cp_parser_class_head): Defer access checking when
4284         parsing the base-clause until all bases are seen and attached
4285         to the class type.
4286         * pt.c (instantiate_class_template): Likewise when substituting
4287         into dependent bases.
4289 2021-01-20  Jakub Jelinek  <jakub@redhat.com>
4291         PR c++/98742
4292         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4293         error_operand_p, remove clause without further checking.  Check
4294         for non-NULL TYPE_NAME.
4296 2021-01-19  Marek Polacek  <polacek@redhat.com>
4298         PR c++/98659
4299         * pt.c (maybe_instantiate_noexcept): Return false if FN is
4300         error_mark_node.
4302 2021-01-19  Marek Polacek  <polacek@redhat.com>
4304         PR c++/98687
4305         * name-lookup.c (push_using_decl_bindings): New, broken out of...
4306         (finish_nonmember_using_decl): ...here.
4307         * name-lookup.h (push_using_decl_bindings): Update declaration.
4308         * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4310 2021-01-19  Patrick Palka  <ppalka@redhat.com>
4312         PR c++/41437
4313         PR c++/58993
4314         * search.c (friend_accessible_p): If scope is a hidden friend
4315         defined inside a dependent class, consider access from the
4316         class.
4317         * parser.c (cp_parser_late_parsing_for_member): Don't push a
4318         dk_no_check access state.
4320 2021-01-19  Marek Polacek  <polacek@redhat.com>
4322         PR c++/98333
4323         * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4324         of NSDMIs before late-parsing of noexcept-specifiers.
4326 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4328         * module.cc (identifier): Merge overloads.
4330 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4332         PR c++/98624
4333         * module.cc (trees_out::write_location): Make static.
4335 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
4337         * parser.c (cp_parser_omp_clause_detach): New.
4338         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4339         (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4340         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4341         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4342         Prevent use of detach with mergeable and overriding the data sharing
4343         mode of the event handle.
4345 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4347         PR c++/98538
4348         * tree.c (cp_build_qualified_type_real): Propagate an array's
4349         dependentness to the copy, if known.
4351 2021-01-15  Jason Merrill  <jason@redhat.com>
4353         PR c++/98642
4354         * call.c (unsafe_return_slot_p): Return int.
4355         (init_by_return_slot_p): Split out from...
4356         (unsafe_copy_elision_p): ...here.
4357         (unsafe_copy_elision_p_opt): New name for old meaning.
4358         (build_over_call): Adjust.
4359         (make_safe_copy_elision): New.
4360         * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4361         list-initialization.
4362         * cp-tree.h: Adjust.
4364 2021-01-15  Jason Merrill  <jason@redhat.com>
4366         * call.c (base_ctor_for, make_base_init_ok): New.
4367         (build_over_call): Use make_base_init_ok.
4369 2021-01-15  Jason Merrill  <jason@redhat.com>
4371         PR c++/63707
4372         * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4373         if we got a CONSTRUCTOR.
4375 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4377         PR c++/98591
4378         * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4380 2021-01-14  Jason Merrill  <jason@redhat.com>
4382         * typeck2.c (process_init_constructor_record): Use fldtype
4383         variable consistently.
4385 2021-01-14  Nathan Sidwell  <nathan@acm.org>
4387         PR c++/98372
4388         * tree.c (cp_tree_equal): Correct map_context logic.
4390 2021-01-13  Marek Polacek  <polacek@redhat.com>
4392         PR c++/98231
4393         * name-lookup.c (push_using_decl_bindings): New.
4394         * name-lookup.h (push_using_decl_bindings): Declare.
4395         * pt.c (tsubst_expr): Call push_using_decl_bindings.
4397 2021-01-13  Nathan Sidwell  <nathan@acm.org>
4399         PR c++/98626
4400         * module.cc (module_add_import_initializers):  Pass a
4401         zero-element argument vector.
4403 2021-01-12  Patrick Palka  <ppalka@redhat.com>
4405         PR c++/98611
4406         * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4407         the template of a CTAD placeholder.
4409 2021-01-12  Marek Polacek  <polacek@redhat.com>
4411         PR c++/98620
4412         * typeck2.c (process_init_constructor_record): Don't emit
4413         -Wmissing-field-initializers warnings in unevaluated contexts.
4415 2021-01-11  Jakub Jelinek  <jakub@redhat.com>
4417         PR c++/98481
4418         * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4419         for types.
4420         (mark_abi_tags_r): Likewise.
4421         * decl2.c (min_vis_r): Likewise.
4422         * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4423         typedefs.
4425 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4427         PR c++/98551
4428         * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4429         instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4431 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4433         PR c++/98515
4434         * semantics.c (check_accessibility_of_qualified_id): Punt if
4435         we're checking access of a scoped non-static member inside a
4436         class template.
4438 2021-01-07  Jakub Jelinek  <jakub@redhat.com>
4440         PR c++/98329
4441         * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4442         cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4443         its location.
4444         (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4446 2021-01-07  Marek Polacek  <polacek@redhat.com>
4448         PR c++/98441
4449         * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4450         !late_return_type block.
4452 2021-01-07  Jason Merrill  <jason@redhat.com>
4454         * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4455         (cxx_eval_store_expression): Add comment.
4457 2021-01-07  Jason Merrill  <jason@redhat.com>
4459         * call.c (has_next): Factor out from...
4460         (next_conversion): ...here.
4461         (strip_standard_conversion): And here.
4462         (is_subseq): And here.
4463         (build_conv): Check it.
4464         (standard_conversion): Don't call build_conv
4465         for ck_identity.
4467 2021-01-06  Martin Sebor  <msebor@redhat.com>
4469         PR c++/95768
4470         * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4472 2021-01-05  Patrick Palka  <ppalka@redhat.com>
4474         * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4475         the type of the NTTP, substitute into the type again.  If the
4476         type is still dependent, don't unify the NTTP.
4478 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4480         * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4481         $(CODYLIB) after $(BACKEND).
4483 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4485         PR c++/98469
4486         * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4487         Punt if lval is true.
4488         * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4489         the result if it has a class type.
4491 2021-01-05  Marek Polacek  <polacek@redhat.com>
4493         PR c++/82099
4494         * pt.c (resolve_overloaded_unification): Call
4495         maybe_instantiate_noexcept after instantiating the function
4496         decl.
4498 2021-01-05  Nathan Sidwell  <nathan@acm.org>
4500         * parser.c (cp_parser_module_declaration): Alter diagnostic
4501         text to say where is permissable.
4503 2021-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4505         PR c++/98316
4506         * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4508 2021-01-02  Jan Hubicka  <jh@suse.cz>
4510         * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4511         * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4512         * tree.c (cp_tree_c_finish_parsing): New function.
4514 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
4516         * ChangeLog-2020: Rotate ChangeLog.  New file.
4519 Copyright (C) 2021 Free Software Foundation, Inc.
4521 Copying and distribution of this file, with or without modification,
4522 are permitted in any medium without royalty provided the copyright
4523 notice and this notice are preserved.