Daily bump.
[official-gcc.git] / gcc / cp / ChangeLog
blob7378dfa609ba4968f123b8f4a9cf9edd38f60fa1
1 2021-09-28  Patrick Palka  <ppalka@redhat.com>
3         PR c++/99909
4         * pt.c (coerce_template_template_parms): Keep
5         processing_template_decl set around the call to unify as well.
7 2021-09-28  Iain Sandoe  <iain@sandoe.co.uk>
9         PR c++/102454
10         * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
11         unnamed function params.
12         (morph_fn_to_coro): Do not try to set a guard variable for param
13         DTORs in the ramp, unless we have exceptions active.
15 2021-09-27  Patrick Palka  <ppalka@redhat.com>
17         PR c++/102479
18         * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
19         Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
20         rewritten ttp.
21         (alias_ctad_tweaks): Set current_template_parms accordingly.
23 2021-09-23  Michel Morin  <mimomorin@gmail.com>
25         * parser.c (cp_keyword_starts_decl_specifier_p): Do not
26         handle RID_ATTRIBUTE.
27         (cp_parser_constructor_declarator_p): Remove now-redundant
28         checks.
29         (cp_parser_lambda_declarator_opt): Likewise.
31 2021-09-23  Michel Morin  <mimomorin@gmail.com>
33         PR c++/77565
34         * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
35         decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
37 2021-09-23  Patrick Palka  <ppalka@redhat.com>
39         * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
40         a TEMPLATE_DECL.  Dump the DECL_TEMPLATE_INFO rather than just
41         printing its pointer value.
43 2021-09-23  Jakub Jelinek  <jakub@redhat.com>
45         PR c++/102413
46         * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
47         is not followed by a balanced token sequence starting with open paren.
49 2021-09-22  Patrick Palka  <ppalka@redhat.com>
51         DR 2446
52         PR c++/102412
53         * constexpr.c (cxx_eval_constant_expression)
54         <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
55         instead of processing_template_decl.
56         * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
57         Return true only if any_dependent_template_arguments_p.
58         (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
59         <case TEMPLATE_ID_EXPR>: Likewise.
61 2021-09-22  Jakub Jelinek  <jakub@redhat.com>
63         * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
64         modifiers.
65         * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
66         semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
67         * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
68         also OMP_CLAUSE_ALLOCATE_ALIGN.
70 2021-09-22  Barrett Adair  <barrettellisadair@gmail.com>
72         * pt.c (find_parm_usage_r): New walk_tree callback to find func
73         parms.
74         (any_template_arguments_need_structural_equality_p): New special
75         case.
77 2021-09-21  wangpc  <pc.wang@linux.alibaba.com>
79         * decl.c (start_decl_1): Move verify_type_context to ...
80         (cp_finish_decl): ... to here.
82 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
84         * parser.c (cp_parser_omp_clause_order): Parse unconstrained
85         and reproducible modifiers.
86         (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
88 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
90         * parser.c (cp_parser_omp_clause_default): Handle private and
91         firstprivate arguments, adjust diagnostics on unknown argument.
92         * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
94 2021-09-18  Jason Merrill  <jason@redhat.com>
96         * cp-tree.h (dependentish_scope_p): Declare.
97         * pt.c (dependentish_scope_p): New.
98         * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
99         for lookup of a type in a dependent object.
100         (cp_parser_template_id): Handle TYPENAME_TYPE.
101         (cp_parser_template_name): If we're looking for a type,
102         a name followed by < names a template.
104 2021-09-18  Jason Merrill  <jason@redhat.com>
106         * cp-tree.h: Fix typo in LANG_FLAG list.
108 2021-09-17  Jakub Jelinek  <jakub@redhat.com>
110         * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
111         * parser.c (cp_parser_omp_atomic): Update function comment for
112         OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
113         weak clauses.
114         * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
115         them, handle COND_EXPRs.
116         * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
117         finish_omp_atomic can now produce.
119 2021-09-16  Patrick Palka  <ppalka@redhat.com>
121         PR c++/98486
122         * constraint.cc (get_normalized_constraints_from_decl): Always
123         look up constraints using the most general template.
124         * decl.c (grokdeclarator): Set constraints on a static data
125         member template.
126         * pt.c (determine_specialization): Check constraints on a
127         variable template.
129 2021-09-16  Iain Sandoe  <iain@sandoe.co.uk>
131         * coroutines.cc (await_statement_walker): Code cleanups.
133 2021-09-16  Jason Merrill  <jason@redhat.com>
135         * constexpr.c (cxx_eval_outermost_constant_expr): Use
136         protected_set_expr_location.
138 2021-09-15  Patrick Palka  <ppalka@redhat.com>
140         PR c++/101904
141         * call.c (build_user_type_conversion_1): Add tf_conv to complain.
142         (add_candidates): When in a SFINAE context, instead of adding a
143         candidate to bad_fns just mark it unviable.
145 2021-09-15  Jason Merrill  <jason@redhat.com>
147         * cp-tree.h (parsing_function_declarator): Declare.
148         * name-lookup.c (set_decl_context_in_fn): Use it.
149         * parser.c (cp_parser_direct_declarator): Use it.
150         (parsing_function_declarator): New.
152 2021-09-15  Jakub Jelinek  <jakub@redhat.com>
154         PR c++/88578
155         PR c++/102295
156         * typeck2.c (split_nonconstant_init_1): Don't throw away empty
157         initializers of flexible array members if they have non-zero type
158         size.
160 2021-09-15  Patrick Palka  <ppalka@redhat.com>
162         PR c++/102050
163         * decl.c (grok_special_member_properties): Set
164         TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
165         and TYPE_HAS_LIST_CTOR independently from each other.
167 2021-09-15  Jason Merrill  <jason@redhat.com>
169         * decl.c (cxx_init_decl_processing): Only warn about odd
170         interference sizes if they were specified with --param.
172 2021-09-15  Jason Merrill  <jason@redhat.com>
174         PR c++/48396
175         * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
176         (type_info_ptr_type): Remove.
177         * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
178         (typeid_ok_p): Check for null const_type_info_type_node.
179         (type_info_ptr_type, get_void_tinfo_ptr): New fns.
180         (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
181         (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
182         (get_tinfo_desc): Use const_ptr_type_node.
184 2021-09-15  Jason Merrill  <jason@redhat.com>
186         * parser.c (cp_parser_template_name): Move object type.
187         (cp_parser_pre_parsed_nested_name_specifier): Likewise.
189 2021-09-15  Jason Merrill  <jason@redhat.com>
191         * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
192         a declarator.
194 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
196         * coroutines.cc (struct param_info): Add copy_var.
197         (build_actor_fn): Use simplified param references.
198         (register_param_uses): Likewise.
199         (rewrite_param_uses): Likewise.
200         (analyze_fn_parms): New function.
201         (coro_rewrite_function_body): Add proxies for the fn
202         parameters to the outer bind scope of the rewritten code.
203         (morph_fn_to_coro): Use simplified version of param ref.
205 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
207         * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
208         coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
209         coro_self_handle_id, coro_actor_continue_id,
210         coro_frame_i_a_r_c_id): New.
211         (coro_init_identifiers): Initialize new name identifiers.
212         (coro_promise_type_found_p): Use pre-built identifiers.
213         (struct await_xform_data): Remove unused fields.
214         (transform_await_expr): Delete code that is now unused.
215         (build_actor_fn): Simplify interface, use pre-built identifiers and
216         remove transforms that are no longer needed.
217         (build_destroy_fn): Use revised field names.
218         (register_local_var_uses): Use pre-built identifiers.
219         (coro_rewrite_function_body): Simplify interface, use pre-built
220         identifiers.  Generate proxy vars in the outer bind expr scope for the
221         implementation state that we wish to expose.
222         (morph_fn_to_coro): Adjust comments for new variable names, use pre-
223         built identifiers.  Remove unused code to generate frame entries for
224         the implementation state.  Adjust call for build_actor_fn.
226 2021-09-14  Patrick Palka  <ppalka@redhat.com>
228         PR c++/102163
229         * constexpr.c (cxx_eval_call_expression): After evaluating a
230         subobject constructor call for an empty union member, produce a
231         side effect that makes sure the member gets activated.
233 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
235         PR c++/102295
236         * decl.c (layout_var_decl): For aggregates ending with a flexible
237         array member, add the size of the initializer for that member to
238         DECL_SIZE and DECL_SIZE_UNIT.
240 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
242         PR c++/102305
243         * method.c (is_xible_helper): Call complete_type on to.
245 2021-09-14  Jason Merrill  <jason@redhat.com>
247         * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
248         size is smaller than maxalign.
250 2021-09-13  Jason Merrill  <jason@redhat.com>
252         * constexpr.c (maybe_warn_about_constant_value):
253         Complain about std::hardware_destructive_interference_size.
254         (cxx_eval_constant_expression): Call it.
255         * decl.c (cxx_init_decl_processing): Check
256         --param *-interference-size values.
258 2021-09-13  Patrick Palka  <ppalka@redhat.com>
260         PR c++/101764
261         * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
262         macro.
263         * pt.c (has_extra_args_mechanism_p): New function.
264         (find_parameter_pack_data::found_extra_args_tree_p): New data
265         member.
266         (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
267         appropriately.
268         (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
269         ppd.found_extra_args_tree_p.
270         (use_pack_expansion_extra_args_p): Return true if there were
271         unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
272         (tsubst_pack_expansion): Pass the pack expansion to
273         use_pack_expansion_extra_args_p.
275 2021-09-10  Jakub Jelinek  <jakub@redhat.com>
277         * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
278         and acq_rel/acquire clauses on update.
279         * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
281 2021-09-08  Richard Biener  <rguenther@suse.de>
283         PR c++/102228
284         * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
285         * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
286         place on invalid code.
287         * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
288         access.
289         * module.cc (trees_in::read_class_def): Likewise.  Reconstruct
290         ANON_AGGR_TYPE_FIELD.
291         * semantics.c (finish_member_declaration): Populate
292         ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
293         * typeck.c (lookup_anon_field): Remove DFS search and return
294         ANON_AGGR_TYPE_FIELD directly.
296 2021-09-07  Jakub Jelinek  <jakub@redhat.com>
298         PR c++/100495
299         * constexpr.c (maybe_save_constexpr_fundef): Save body even for
300         constexpr deleting dtors.
301         (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
302         deleting dtors.
304 2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>
306         * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
307         directive.
308         * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
310 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
312         * coroutines.cc (register_local_var_uses): Do not mangle
313         frame entries for the outermost scope.  Record the outer
314         scope as nesting depth 0.
316 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
318         * coroutines.cc (coro_build_artificial_var): New.
319         (build_actor_fn): Use var builder, rename vars to use
320         implementation namespace.
321         (coro_rewrite_function_body): Likewise.
322         (morph_fn_to_coro): Likewise.
324 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
326         * coroutines.cc (transform_local_var_uses): Record
327         frame offset expressions as DECL_VALUE_EXPRs instead of
328         rewriting them.
330 2021-09-03  Patrick Palka  <ppalka@redhat.com>
332         PR c++/101904
333         * call.c (build_this_conversion): New function, split out from
334         add_function_candidate.
335         (add_function_candidate): New parameter shortcut_bad_convs.
336         Document it.  Use build_this_conversion.  Stop at the first bad
337         argument conversion when shortcut_bad_convs is true.
338         (add_template_candidate_real): New parameter shortcut_bad_convs.
339         Use build_this_conversion to check the 'this' conversion before
340         attempting deduction.  When the rejection reason code is
341         rr_bad_arg_conversion, pass -1 instead of 0 as the viable
342         parameter to add_candidate.  Pass 'convs' to add_candidate.
343         (add_template_candidate): New parameter shortcut_bad_convs.
344         (add_template_conv_candidate): Pass false as shortcut_bad_convs
345         to add_template_candidate_real.
346         (add_candidates): Prefer to shortcut bad conversions during
347         overload resolution under the assumption that we'll eventually
348         see a strictly viable candidate.  If this assumption turns out
349         to be false, re-process the non-strictly viable candidates
350         without shortcutting those bad conversions.
352 2021-09-03  Jason Merrill  <jason@redhat.com>
354         * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
355         we decide not to instantiate.
357 2021-09-03  Jakub Jelinek  <jakub@redhat.com>
359         PR target/102024
360         * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
361         instead of writing to DECL_FIELD_ABI_IGNORED.
362         (layout_class_type): Likewise.  In the place where zero-width
363         bitfields used to be removed, use
364         SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
366 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
368         * call.c (build_over_call): Handle unavailable state in addition to
369         deprecation.
370         * class.c (type_build_ctor_call): Likewise.
371         (type_build_dtor_call): Likewise.
372         * cp-tree.h: Rename cp_warn_deprecated_use to
373         cp_handle_deprecated_or_unavailable.
374         * decl.c (duplicate_decls): Merge unavailability.
375         (grokdeclarator): Handle unavailability in addition to deprecation.
376         (type_is_unavailable): New.
377         (grokparms): Handle unavailability in addition to deprecation.
378         * decl.h (enum deprecated_states): Add
379         UNAVAILABLE_DEPRECATED_SUPPRESS.
380         * decl2.c (cplus_decl_attributes): Propagate unavailability to
381         templates.
382         (cp_warn_deprecated_use): Rename to ...
383         (cp_handle_deprecated_or_unavailable): ... this and amend to handle
384         the unavailable case. It remains a warning in the case of deprecation
385         but becomes an error in the case of unavailability.
386         (cp_warn_deprecated_use_scopes): Handle unavailability.
387         (mark_used): Likewise.
388         * parser.c (cp_parser_template_name): Likewise.
389         (cp_parser_template_argument): Likewise.
390         (cp_parser_parameter_declaration_list): Likewise.
391         * typeck.c (build_class_member_access_expr): Likewise.
392         (finish_class_member_access_expr): Likewise.
393         * typeck2.c (build_functional_cast_1): Likewise.
395 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
397         * coroutines.cc (build_actor_fn): Add begin/finish clauses
398         to the initial test in the actor function.
400 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
402         * coroutines.cc (await_statement_walker): Use build_stmt and
403         add_stmt instead of build1 and finish_expr_stmt.
405 2021-08-31  Jason Merrill  <jason@redhat.com>
407         * coroutines.cc (flatten_await_stmt): Fix copyo.
408         * decl.c (reshape_init_class): Simplify.
409         * module.cc (module_state::read_language): Add null check.
410         * parser.c (build_range_temp): Avoid type_uses_auto.
411         (cp_parser_class_specifier_1): Add null check.
413 2021-08-31  Patrick Palka  <ppalka@redhat.com>
415         PR c++/12672
416         * call.c (rejection_reason::call_varargs_p): Rename this
417         previously unused member to ...
418         (rejection_reason::least_p): ... this.
419         (arity_rejection): Add least_p parameter.
420         (add_template_candidate_real): When there are explicit
421         template arguments, check that the arity of the call agrees with
422         the arity of the function before attempting deduction.
423         (print_arity_information): Add least_p parameter.
424         (print_z_candidate): Adjust call to print_arity_information.
426 2021-08-31  Martin Sebor  <msebor@redhat.com>
428         * parser.c (cp_parser_selection_statement): Use direct initialization
429         instead of copy.
431 2021-08-31  Jason Merrill  <jason@redhat.com>
433         * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
435 2021-08-31  Jason Merrill  <jason@redhat.com>
437         PR c++/92193
438         * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
439         * constexpr.c (cxx_eval_call_expression): Set it.
440         * pt.c (neglectable_inst_p): Check it.
442 2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>
444         * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
445         and 'ancestor' in 'target device' clauses.
446         * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
447         evaluate to '1' if 'ancestor' is used.
449 2021-08-30  Jason Merrill  <jason@redhat.com>
451         PR c++/96286
452         * cp-tree.h (struct lang_type): Add erroneous bit-field.
453         (CLASSTYPE_ERRONEOUS): New.
454         * pt.c (limit_bad_template_recursion): Check it.
455         (instantiate_class_template_1): Set it.
457 2021-08-30  Jason Merrill  <jason@redhat.com>
459         * constexpr.c (cxx_eval_outermost_constant_expr): Copy
460         expr location to result.
462 2021-08-30  Jason Merrill  <jason@redhat.com>
464         PR c++/101460
465         * cp-tree.h (cxx_constant_value_sfinae): Declare.
466         * constexpr.c (cxx_constant_value_sfinae): New.
467         * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
468         (tsubst_copy_and_build) [CALL_EXPR]: Call
469         maybe_fold_fn_template_args.
471 2021-08-30  Jason Merrill  <jason@redhat.com>
473         * parser.c (cp_parser_simple_requirement): Warn about missing
474         requires.
476 2021-08-27  Jason Merrill  <jason@redhat.com>
478         * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
479         a dependent pointer.
481 2021-08-25  Andrew Pinski  <apinski@marvell.com>
483         PR c++/66590
484         * cp-objcp-common.c (cxx_block_may_fallthru): Handle
485         CLEANUP_STMT for the case which will be try/finally.
487 2021-08-25  Jakub Jelinek  <jakub@redhat.com>
489         PR c++/102019
490         * init.c (build_value_init_noctor): Ignore unnamed zero-width
491         bitfields.
493 2021-08-23  Jakub Jelinek  <jakub@redhat.com>
495         * parser.c (cp_parser_omp_clause_num_tasks,
496         cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
498 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
500         * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
501         PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
502         (cp_parser_omp_error): New function.
503         (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
505 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
507         * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
508         comma at the end of list.  Don't parse closing paren here...
509         (cp_parser_omp_clause_depend): ... but here instead.
511 2021-08-19  Patrick Palka  <ppalka@redhat.com>
513         PR c++/101803
514         * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
516 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
518         * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
519         and optionally consume token if current token is CPP_EOF,
520         CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
522 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
524         * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
525         instead of cp_parser_skip_to_pragma_eol.
527 2021-08-18  Patrick Palka  <ppalka@redhat.com>
529         PR c++/101344
530         PR c++/101803
531         * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
532         * decl.c (reshape_init_r): Set it.
533         * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
534         iff CONSTRUCTOR_BRACES_ELIDED_P.
536 2021-08-18  Patrick Palka  <ppalka@redhat.com>
538         PR c++/101883
539         * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
540         do_auto_deduction.
542 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
544         * parser.c (cp_parser_omp_nothing): New function.
545         (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
547 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
549         * parser.c (cp_parser_omp_ordered): Return true instead of
550         false after emitting errors that the directive is not allowed in
551         pragma_stmt context.
552         (cp_parser_omp_target_update): Likewise.
553         (cp_parser_omp_cancellation_point): Change return type from void to
554         bool, return false if the directive should be ignored in pragma_stmt
555         contexts.
556         (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
557         Change return type from tree to bool, return false if the
558         directive should be ignored in pragma_stmt contexts.
559         (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
560         return their result directly.
561         (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
562         cp_parser_omp_cancellation_point returned.  Return true instead of
563         false after emitting errors that the directive is not allowed in
564         pragma_stmt context.
566 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
568         PR c++/101539
569         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
570         (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
571         (fold_builtin_is_corresponding_member, next_common_initial_seqence,
572         layout_compatible_type_p): Declare.
573         * parser.c (cp_parser_primary_expression): Handle
574         RID_IS_LAYOUT_COMPATIBLE.
575         (cp_parser_trait_expr): Likewise.
576         * cp-objcp-common.c (names_builtin_p): Likewise.
577         * constraint.cc (diagnose_trait_expr): Handle
578         CPTK_IS_LAYOUT_COMPATIBLE.
579         * decl.c (cxx_init_decl_processing): Register
580         __builtin_is_corresponding_member builtin.
581         * constexpr.c (cxx_eval_builtin_function_call): Handle
582         CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
583         * semantics.c (is_corresponding_member_union,
584         is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
585         New functions.
586         (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
587         (finish_trait_expr): Likewise.
588         * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
589         New functions.
590         * cp-gimplify.c (cp_gimplify_expr): Fold
591         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
592         (cp_fold): Likewise.
593         * tree.c (builtin_valid_in_constant_expr_p): Handle
594         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
595         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
596         CPTK_IS_LAYOUT_COMPATIBLE.
597         * class.c (remove_zero_width_bit_fields): Remove.
598         (layout_class_type): Don't call it.
600 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
602         * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
603         (cp_parser_omp_scope): New function.
604         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
605         * pt.c (tsubst_expr): Handle OMP_SCOPE.
607 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
609         * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
610         (cp_parser_omp_clause_filter): New function.
611         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
612         (OMP_MASKED_CLAUSE_MASK): Define.
613         (cp_parser_omp_masked): New function.
614         (cp_parser_omp_parallel): Handle parallel masked.
615         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
616         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
617         * pt.c (tsubst_omp_clauses): Likewise.
618         (tsubst_expr): Handle OMP_MASKED.
620 2021-08-12  Sergei Trofimovich  <siarheit@google.com>
622         PR c++/101219
623         * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
624         to construct ptrmemfunc expression instantiation.
626 2021-08-12  Tobias Burnus  <tobias@codesourcery.com>
628         * parser.c (cp_parser_omp_clause_proc_bind): Accept
629         'primary' as alias for 'master'.
631 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
633         * cp-tree.h (omp_declare_target_attr): New type.
634         (struct saved_scope): Change type of omp_declare_target_attribute
635         from int to vec<omp_declare_target_attr, va_gc> * and move it.
636         * parser.c (cp_parser_omp_declare_target): Instead of
637         incrementing scope_chain->omp_declare_target_attribute, push
638         a struct containing parser->lexer->in_omp_attribute_pragma to
639         the vector.
640         (cp_parser_omp_end_declare_target): Instead of decrementing
641         scope_chain->omp_declare_target_attribute, pop a structure
642         from it.  Diagnose mismatching declare target vs.
643         end declare target syntax.
644         * semantics.c (finish_translation_unit): Use vec_safe_length
645         and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
646         * decl2.c (cplus_decl_attributes): Use vec_safe_length
647         on scope_chain->omp_declare_target_attributes.
649 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
651         * parser.c (cp_parser_lambda_body): Add temp overrides
652         for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
653         (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
654         cp_parser_declaration_statement.
655         (cp_parser_default_argument): Add temp override for
656         parser->omp_attrs_forbidden_p.
657         (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
658         or declare variant in attribute syntax on a declaration immediately
659         following an OpenMP construct in pragma syntax.
661 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
663         PR c++/94162
664         * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
665         or for classes not in std namespace.
667 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
669         * name-lookup.c (finish_using_directive): Diagnose omp::directive
670         or omp::sequence attributes on using-directive.
672 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
674         * parser.c (cp_parser_block_declaration): Call
675         cp_parser_using_directive for C++11 attributes followed by
676         using namespace tokens.
677         (cp_parser_using_directive): Parse C++11 attributes at the start
678         of the directive rather than at the end, only parse GNU attributes
679         at the end.
681 2021-08-12  Patrick Palka  <ppalka@redhat.com>
683         PR c++/101663
684         * constexpr.c (cxx_eval_store_expression): Handle the lval=true
685         case in the early exit code path for empty stores with mismatched
686         types.
688 2021-08-11  Patrick Palka  <ppalka@redhat.com>
690         PR c++/101725
691         DR 2082
692         * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
693         * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
694         operands.
695         * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
696         reject uses of local variables in unevaluated contexts.
697         * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
698         cp_unevaluated_operand.  Use cp_walk_tree directly instead of
699         WALK_SUBTREE to avoid the goto.  Use REQUIRES_EXPR_REQS instead
700         of TREE_OPERAND directly.
702 2021-08-11  Jakub Jelinek  <jakub@redhat.com>
704         PR c++/101786
705         * decl2.c (var_defined_without_dynamic_init): Return true for
706         DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
708 2021-08-11  Patrick Palka  <ppalka@redhat.com>
710         PR c++/79501
711         * parser.c (maybe_adjust_declarator_for_dguide): New, split
712         out from ...
713         (cp_parser_init_declarator): ... here.
714         (cp_parser_member_declaration): Use it.
716 2021-08-11  Patrick Palka  <ppalka@redhat.com>
718         PR c++/89062
719         * parser.c (cp_parser_parameter_declaration_list): Don't call
720         grokdeclarator if cp_parser_error_occurred.
721         (cp_parser_parameter_declaration): Simulate an error if we see
722         the beginning of a CTAD form, i.e. if we see an opening brace
723         after the decl-specifier-seq and the type is a CTAD placeholder.
725 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
727         * parser.c (cp_parser_member_declaration): Move odsd declaration
728         before cp_parser_using_declaration call to avoid errors with
729         GCC 4.8 to 6.
731 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
733         * parser.h (struct cp_omp_declare_simd_data): Remove
734         in_omp_attribute_pragma and clauses members, add loc and attribs.
735         (struct cp_oacc_routine_data): Remove loc member, add clauses
736         member.
737         * parser.c (cp_finalize_omp_declare_simd): New function.
738         (cp_parser_handle_statement_omp_attributes): Mention in
739         function comment the function is used also for
740         attribute-declaration.
741         (cp_parser_handle_directive_omp_attributes): New function.
742         (cp_parser_statement): Don't call
743         cp_parser_handle_statement_omp_attributes if statement doesn't
744         have attribute-specifier-seq at the beginning at all or if
745         if those attributes don't appertain to the statement.
746         (cp_parser_simple_declaration): Call
747         cp_parser_handle_directive_omp_attributes and
748         cp_finalize_omp_declare_simd.
749         (cp_parser_explicit_instantiation): Likewise.
750         (cp_parser_init_declarator): Initialize prefix_attributes
751         only after parsing declarators.
752         (cp_parser_direct_declarator): Call
753         cp_parser_handle_directive_omp_attributes and
754         cp_finalize_omp_declare_simd.
755         (cp_parser_member_declaration): Likewise.
756         (cp_parser_single_declaration): Likewise.
757         (cp_parser_omp_declare_simd): Don't initialize
758         data.in_omp_attribute_pragma, instead initialize
759         data.attribs[0] and data.attribs[1].
760         (cp_finish_omp_declare_variant): Remove
761         in_omp_attribute_pragma argument, instead use
762         parser->lexer->in_omp_attribute_pragma.
763         (cp_parser_late_parsing_omp_declare_simd): Adjust
764         cp_finish_omp_declare_variant caller.  Handle attribute-syntax
765         declare simd/variant.
767 2021-08-06  Tamar Christina  <tamar.christina@arm.com>
769         * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
770         * decl.c (cxx_simulate_enum_decl): Likewise.
772 2021-08-04  Jakub Jelinek  <jakub@redhat.com>
774         PR c++/101759
775         * parser.c (cp_parser_default_argument): Temporarily override
776         parser->omp_declare_simd and parser->oacc_routine to NULL.
778 2021-08-02  Patrick Palka  <ppalka@redhat.com>
780         PR c++/100828
781         * logic.cc (formula::formula): Use emplace_back instead of
782         push_back.
783         (formula::branch): Insert a copy of m_current directly after
784         m_current instead of at the end of the list.
785         (formula::erase): Define.
786         (decompose_formula): Remove.
787         (decompose_antecedents): Remove.
788         (decompose_consequents): Remove.
789         (derive_proofs): Remove.
790         (max_problem_size): Remove.
791         (diagnose_constraint_size): Remove.
792         (subsumes_constraints_nonnull): Rewrite directly in terms of
793         decompose_clause and derive_proof, interleaving decomposition
794         with implication checking.  Remove limit on constraint complexity.
795         Use formula::erase to free the current clause before moving on to
796         the next one.
798 2021-07-31  Jason Merrill  <jason@redhat.com>
800         PR c++/96636
801         * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
802         after error.
804 2021-07-31  Jason Merrill  <jason@redhat.com>
806         * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
807         PACK_EXPANSION_PATTERN.
809 2021-07-31  Jakub Jelinek  <jakub@redhat.com>
811         * parser.c (cp_parser_declaration): Handle OpenMP directives
812         in attribute-declaration.
814 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
816         PR c++/101539
817         * cp-tree.h (enum cp_trait_kind): Add
818         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
819         (enum cp_built_in_function): Add
820         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
821         (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
822         * parser.c (cp_parser_primary_expression): Handle
823         RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
824         (cp_parser_trait_expr): Likewise.
825         * cp-objcp-common.c (names_builtin_p): Likewise.
826         * constraint.cc (diagnose_trait_expr): Handle
827         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
828         * decl.c (cxx_init_decl_processing): Register
829         __builtin_is_pointer_interconvertible_with_class builtin.
830         * constexpr.c (cxx_eval_builtin_function_call): Handle
831         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
832         * semantics.c (pointer_interconvertible_base_of_p,
833         first_nonstatic_data_member_p,
834         fold_builtin_is_pointer_inverconvertible_with_class): New functions.
835         (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
836         (finish_trait_expr): Likewise.  Formatting fix.
837         * cp-gimplify.c (cp_gimplify_expr): Fold
838         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
839         fndecl_built_in_p just once.
840         (cp_fold): Likewise.
841         * tree.c (builtin_valid_in_constant_expr_p): Handle
842         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
843         fndecl_built_in_p just once.
844         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
845         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
847 2021-07-30  Jason Merrill  <jason@redhat.com>
849         * class.c (finish_struct_anon): Improve comment.
850         * decl.c (fixup_anonymous_aggr): Reject anonymous struct
851         with bases.
853 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
855         * parser.c (cp_parser_statement): Rollback attributes not just
856         when std_attrs is non-NULL, but whenever
857         cp_parser_std_attribute_spec_seq parsed any tokens.
859 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
861         PR c++/101582
862         * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
863         declaration.
864         (cp_parser_declaration): Parse empty-declaration and
865         attribute-declaration.
866         (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
868 2021-07-28  Martin Sebor  <msebor@redhat.com>
870         * init.c: Include new header.
872 2021-07-27  Marek Polacek  <polacek@redhat.com>
874         DR 1512
875         PR c++/99701
876         * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
877         a switch.
878         * typeck.c (cp_build_binary_op): Reject ordered comparison
879         of two null pointers.
881 2021-07-26  Jakub Jelinek  <jakub@redhat.com>
883         * parser.h (struct cp_lexer): Add orphan_p member.
884         * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
885         upon restart from CPP_PRAGMA handling.  Fix up condition when a lexer
886         should be destroyed and adjust saved_tokens if it records tokens from
887         the to be destroyed lexer.
888         (cp_parser_omp_section_scan): New function.
889         (cp_parser_omp_scan_loop_body): Use it.  If
890         parser->lexer->in_omp_attribute_pragma, allow optional comma
891         after scan.
892         (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
894 2021-07-23  Jakub Jelinek  <jakub@redhat.com>
896         * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
897         * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
898         mixing of attribute and pragma syntax directives when seeing
899         omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
900         directives are followed by OpenMP pragma.
901         (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
902         the cp_parser_handle_statement_omp_attributes call.
903         (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
904         if true, set parser->omp_attrs_forbidden_p.
905         (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
906         false as disallow_omp_attrs to cp_parser_omp_structured_block.
907         (cp_parser_omp_parallel, cp_parser_omp_task): Set
908         parser->omp_attrs_forbidden_p.
910 2021-07-21  Thomas Schwinge  <thomas@codesourcery.com>
911             Joseph Myers  <joseph@codesourcery.com>
912             Cesar Philippidis  <cesar@codesourcery.com>
914         * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
915         (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
916         (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
917         * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
918         * semantics.c (finish_omp_clauses): Likewise.
920 2021-07-21  Jakub Jelinek  <jakub@redhat.com>
922         PR c++/101516
923         * semantics.c (finish_omp_reduction_clause): Also call
924         complete_type_or_else and return true if it fails.
926 2021-07-19  Iain Sandoe  <iain@sandoe.co.uk>
928         PR c++/95520
929         * coroutines.cc (struct coroutine_info): Add fields for
930         actor and destroy function decls.
931         (to_ramp): New.
932         (coro_get_ramp_function): New.
933         (coro_get_actor_function): New.
934         (coro_get_destroy_function): New.
935         (act_des_fn): Set up mapping between ramp, actor and
936         destroy functions.
937         (morph_fn_to_coro): Adjust interface to the builder for
938         helper function decls.
939         * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
940         JOIN_STR): New.
941         * mangle.c (write_encoding): Handle coroutine helpers.
942         (write_unqualified_name): Handle lambda coroutine helpers.
944 2021-07-16  Patrick Palka  <ppalka@redhat.com>
946         PR c++/101233
947         * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
948         substituting DECL_ARGUMENTS.
950 2021-07-16  Patrick Palka  <ppalka@redhat.com>
952         DR 960
953         PR c++/99664
954         * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
955         when the return types are references.
957 2021-07-16  Marek Polacek  <polacek@redhat.com>
959         * typeck2.c (check_narrowing): Don't suppress the pedantic error
960         in system headers.
962 2021-07-15  Jakub Jelinek  <jakub@redhat.com>
964         PR c++/101443
965         * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
966         operands, fold them right away to true or false.
968 2021-07-15  Jason Merrill  <jason@redhat.com>
970         PR c++/101095
971         * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
972         (cp_tree_size): Remove redundant entries.
974 2021-07-14  Patrick Palka  <ppalka@redhat.com>
976         PR c++/88252
977         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
978         * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
979         handling.
980         (redeclare_class_template): Likewise.
981         (forwarding_reference_p): Define.
982         (maybe_adjust_types_for_deduction): Use it instead.  Add 'tparms'
983         parameter.
984         (unify_one_argument): Pass tparms to
985         maybe_adjust_types_for_deduction.
986         (try_one_overload): Likewise.
987         (unify): Likewise.
988         (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
989         handling.
991 2021-07-14  Jason Merrill  <jason@redhat.com>
993         * class.c (struct find_final_overrider_data): Use auto_vec.
994         (find_final_overrider): Remove explicit release.
995         * coroutines.cc (process_conditional): Use auto_vec.
996         * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
997         (cp_genericize_tree): Remove explicit release.
998         * parser.c (cp_parser_objc_at_property_declaration): Use
999         auto_delete_vec.
1000         * semantics.c (omp_reduction_lookup): Use auto_vec.
1002 2021-07-14  Marek Polacek  <polacek@redhat.com>
1004         PR c++/101371
1005         * constexpr.c (cxx_eval_array_reference): Create a new .object
1006         and .ctor for the non-aggregate non-scalar case too when
1007         value-initializing.
1009 2021-07-12  Patrick Palka  <ppalka@redhat.com>
1011         PR c++/79501
1012         PR c++/100983
1013         * decl.c (grokfndecl): Don't require that deduction guides are
1014         declared at namespace scope.  Check that class-scope deduction
1015         guides have the same access as the member class template.
1016         (grokdeclarator): Pretend class-scope deduction guides are static.
1017         * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1018         deduction guides.
1020 2021-07-10  Patrick Palka  <ppalka@redhat.com>
1022         PR c++/82110
1023         * init.c (build_aggr_init): Return error_mark_node if
1024         expand_aggr_init_1 returns false.
1025         (expand_default_init): Change return type to bool.  Return false
1026         on error, true on success.
1027         (expand_aggr_init_1): Likewise.
1029 2021-07-09  Jason Merrill  <jason@redhat.com>
1031         PR c++/101098
1032         * decl.c (function_requirements_equivalent_p): Only compare
1033         trailing requirements on a specialization.
1035 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1037         * coroutines.cc (build_actor_fn): Move common code to
1038         act_des_fn.
1039         (build_destroy_fn): Likewise.
1040         (act_des_fn): Build the void return here.  Ensure that the
1041         source location matches the original function.
1043 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1045         * coroutines.cc
1046         (coro_rewrite_function_body): Connect the replacement
1047         function block to the block nest correctly.
1049 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1051         PR c++/101181
1052         * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1053         add_extra_args.
1054         * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1055         * pt.c (build_extra_args): Make a copy of args.
1056         (add_extra_args): Add complain/in_decl parameters.  Enable the
1057         code for handling the case where the extra arguments are
1058         dependent.
1059         (tsubst_pack_expansion): Pass complain/in_decl to
1060         add_extra_args.
1061         (tsubst_template_args): Handle missing template arguments.
1062         (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1063         add_extra_args.
1065 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1067         PR c++/101247
1068         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1069         DECL_CONTEXT.
1071 2021-07-08  Martin Sebor  <msebor@redhat.com>
1073         PR bootstrap/101372
1074         * module.cc (identifier): Suppress warning.
1075         (module_state::read_macro_maps): Remove warning suppression.
1076         (module_state::install_macros): Ditto.
1078 2021-07-08  Marek Polacek  <polacek@redhat.com>
1080         PR c++/101087
1081         * cp-tree.h (unevaluated_p): New.
1082         * except.c (check_noexcept_r): Use it.  Don't walk into
1083         unevaluated operands.
1085 2021-07-08  Martin Sebor  <msebor@redhat.com>
1087         PR bootstrap/101374
1088         * module.cc (module_state::read_macro_maps): Temporarily disable
1089         -Warray-bounds.
1090         (module_state::install_macros): Same.
1092 2021-07-06  Martin Sebor  <msebor@redhat.com>
1094         * error.c (cp_printer):  Remove support for %G and %K.
1096 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1098         * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1099         (struct cp_omp_declare_simd_data): Likewise.
1100         * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1101         (omp_identifier): Define.
1102         * parser.c (cp_parser_skip_to_pragma_eol): Handle
1103         in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1104         (cp_parser_require_pragma_eol): Likewise.
1105         (struct cp_omp_attribute_data): New type.
1106         (cp_parser_handle_statement_omp_attributes): New function.
1107         (cp_parser_statement): Handle OpenMP directives in statement's
1108         attribute-specifier-seq.
1109         (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1110         functions.
1111         (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1112         attributes.
1113         (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1114         a comma also before the first clause.
1115         (cp_parser_omp_allocate): Likewise.
1116         (cp_parser_omp_atomic): Likewise.
1117         (cp_parser_omp_depobj): Likewise.
1118         (cp_parser_omp_flush): Likewise.
1119         (cp_parser_omp_ordered): Likewise.
1120         (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1121         into struct cp_omp_declare_simd_data.
1122         (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1123         argument.  If set, allow a comma also before match clause.
1124         (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1125         allow a comma also before the first clause.  Adjust
1126         cp_finish_omp_declare_variant caller.
1127         (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1128         a comma also before the first clause.
1129         (cp_parser_omp_declare_reduction_exprs): Likewise.
1130         (cp_parser_omp_requires): Likewise.
1131         * decl.c (initialize_predefined_identifiers): Initialize
1132         omp_identifier.
1133         * decl2.c (cplus_decl_attributes): Reject omp::directive and
1134         omp::sequence attributes.
1136 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1138         PR c/101297
1139         * parser.c (cp_parser_omp_atomic): Consume comma only if it
1140         appears before a CPP_NAME.
1142 2021-07-02  Patrick Palka  <ppalka@redhat.com>
1144         PR c++/101247
1145         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1146         use common_enclosing_class and to not depend on the TREE_TYPE
1147         of outer levels pointing to the corresponding primary template.
1149 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1151         PR c++/101194
1152         * constexpr.c (cxx_eval_array_reference): When the element type
1153         is an empty type and the corresponding element is omitted, just
1154         return an empty CONSTRUCTOR instead of attempting value
1155         initialization.
1157 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1159         PR c++/96204
1160         * pt.c (finish_template_variable): Pass the partially
1161         instantiated template and its args to instantiate_template.
1162         (instantiate_class_template_1): No need to call
1163         push_nested_class and pop_nested_class around the call to
1164         most_specialized_partial_spec.
1165         (instantiate_template_1): Pass the partially instantiated
1166         template to lookup_template_variable.
1167         (most_specialized_partial_spec):  Use push_access_scope_guard
1168         to set the access scope appropriately.  Use
1169         deferring_access_check_sentinel to force access to get checked
1170         immediately.
1171         (instantiate_decl): Just pass the VAR_DECL to
1172         most_specialized_partial_spec.
1174 2021-06-30  Patrick Palka  <ppalka@redhat.com>
1176         * constraint.cc (get_normalized_constraints_from_decl): Use
1177         push_access_scope_guard instead of push_nested_class_guard.
1178         * cp-tree.h (struct push_nested_class_guard): Replace with ...
1179         (struct push_access_scope_guard): ... this.
1180         * pt.c (push_access_scope): When the argument corresponds to
1181         a class type, push the class instead of its context.
1182         (pop_access_scope): Adjust accordingly.
1184 2021-06-30  Marek Polacek  <polacek@redhat.com>
1186         PR c++/100975
1187         DR 2397
1188         * decl.c (create_array_type_for_decl): Allow array of auto.
1190 2021-06-29  Jason Merrill  <jason@redhat.com>
1192         * pt.c (instantiate_decl): Only consider partial specializations of
1193         actual variable templates.
1195 2021-06-26  Patrick Palka  <ppalka@redhat.com>
1197         PR c++/96204
1198         * pt.c (instantiate_class_template_1): Enter the scope of the
1199         type when calling most_specialized_partial_spec.
1201 2021-06-26  Jason Merrill  <jason@redhat.com>
1203         PR c++/101040
1204         PR c++/97566
1205         * class.c (is_empty_field): Handle null argument.
1206         * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1207         for empty field.
1209 2021-06-26  Marek Polacek  <polacek@redhat.com>
1211         PR c++/100752
1212         * parser.c (cp_parser_declarator): Pass flags down to
1213         cp_parser_declarator.  Also pass static_p/member_p.
1215 2021-06-25  Martin Sebor  <msebor@redhat.com>
1217         * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1218         with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1219         nothing if not necessary.
1220         (set_up_extended_ref_temp): Same.
1221         * class.c (layout_class_type): Same.
1222         * constraint.cc (constraint_satisfaction_value): Same.
1223         * coroutines.cc (finish_co_await_expr): Same.
1224         (finish_co_yield_expr): Same.
1225         (finish_co_return_stmt): Same.
1226         (build_actor_fn): Same.
1227         (coro_rewrite_function_body): Same.
1228         (morph_fn_to_coro): Same.
1229         * cp-gimplify.c (genericize_eh_spec_block): Same.
1230         (gimplify_expr_stmt): Same.
1231         (cp_genericize_r): Same.
1232         (cp_fold): Same.
1233         * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1234         * cvt.c (cp_fold_convert): Same.
1235         (convert_to_void): Same.
1236         * decl.c (wrapup_namespace_globals): Same.
1237         (grokdeclarator): Same.
1238         (finish_function): Same.
1239         (require_deduced_type): Same.
1240         * decl2.c (no_linkage_error): Same.
1241         (c_parse_final_cleanups): Same.
1242         * except.c (expand_end_catch_block): Same.
1243         * init.c (build_new_1): Same.
1244         (build_new): Same.
1245         (build_vec_delete_1): Same.
1246         (build_vec_init): Same.
1247         (build_delete): Same.
1248         * method.c (defaultable_fn_check): Same.
1249         * parser.c (cp_parser_fold_expression): Same.
1250         (cp_parser_primary_expression): Same.
1251         * pt.c (push_tinst_level_loc): Same.
1252         (tsubst_copy): Same.
1253         (tsubst_omp_udr): Same.
1254         (tsubst_copy_and_build): Same.
1255         * rtti.c (build_if_nonnull): Same.
1256         * semantics.c (maybe_convert_cond): Same.
1257         (finish_return_stmt): Same.
1258         (finish_parenthesized_expr): Same.
1259         (cp_check_omp_declare_reduction): Same.
1260         * tree.c (build_cplus_array_type): Same.
1261         * typeck.c (build_ptrmemfunc_access_expr): Same.
1262         (cp_build_indirect_ref_1): Same.
1263         (cp_build_function_call_vec): Same.
1264         (warn_for_null_address): Same.
1265         (cp_build_binary_op): Same.
1266         (unary_complex_lvalue): Same.
1267         (cp_build_modify_expr): Same.
1268         (build_x_modify_expr): Same.
1269         (convert_for_assignment): Same.
1271 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1273         PR c++/98832
1274         * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1276 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1278         PR c++/101182
1279         * constraint.cc (evaluate_requires_expr): Adjust function comment.
1280         * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1281         (cp_fold) <case REQUIRES_EXPR>: ... here.
1283 2021-06-24  Jakub Jelinek  <jakub@redhat.com>
1285         * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1286         C_ORT_OMP for clauses on target construct.
1287         (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1288         (cp_parser_omp_target): For non-combined target add
1289         map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION.  Pass
1290         C_ORT_OMP_TARGET to finish_omp_clauses.
1291         * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1292         for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1293         never present on C_ORT_*DECLARE_SIMD.
1294         (handle_omp_array_sections): Likewise.
1295         (finish_omp_clauses): Likewise.  Handle OMP_CLAUSE_IN_REDUCTION
1296         on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1297         corresponding map clauses.
1298         * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1299         clauses on target construct.
1301 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1303         PR c++/101174
1304         * pt.c (push_access_scope): For artificial deduction guides,
1305         set the access scope to that of the constructor.
1306         (pop_access_scope): Likewise.
1307         (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1309 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1311         PR c++/86439
1312         * call.c (print_error_for_call_failure): Constify 'args' parameter.
1313         (perform_dguide_overload_resolution): Define.
1314         * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1315         * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1316         instead of build_new_function_call.  Don't use tf_decltype or
1317         set cp_unevaluated_operand.  Remove unnecessary NULL_TREE tests.
1319 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1321         PR c++/67302
1322         * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1323         sooner, before the NRVO handling.
1325 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1327         PR c++/80431
1328         * tree.c (bot_replace): Use convert_to_base to build the
1329         conversion to the (morally) virtual base.
1331 2021-06-21  Jakub Jelinek  <jakub@redhat.com>
1333         PR inline-asm/100785
1334         * typeck.c (cxx_mark_addressable): Diagnose trying to make
1335         bit-fields addressable.
1337 2021-06-17  Jason Merrill  <jason@redhat.com>
1339         PR c++/101106
1340         * decl.c (duplicate_decls): Make 'deleted after first declaration'
1341         pedwarn on by default.
1343 2021-06-17  Jason Merrill  <jason@redhat.com>
1345         PR c++/101029
1346         * init.c (build_vec_init): Preserve the type of base.
1348 2021-06-16  Jason Merrill  <jason@redhat.com>
1350         PR c++/101078
1351         PR c++/91706
1352         * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1354 2021-06-15  Robin Dapp  <rdapp@linux.ibm.com>
1356         * decl.c (duplicate_decls): Likewise.
1358 2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
1360         PR c/100913
1361         * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1362         var in the error case.
1364 2021-06-13  Trevor Saunders  <tbsaunde@tbsaunde.org>
1366         * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1367         with range based for.
1368         (cxx_eval_store_expression): Likewise.
1369         (cxx_eval_loop_expr): Likewise.
1370         * decl.c (wrapup_namespace_globals): Likewise.
1371         (cp_finish_decl): Likewise.
1372         (cxx_simulate_enum_decl): Likewise.
1373         * parser.c (cp_parser_postfix_expression): Likewise.
1375 2021-06-12  Jason Merrill  <jason@redhat.com>
1377         PR c++/101029
1378         * init.c (build_vec_init): Shortcut [0] case.
1380 2021-06-12  Jason Merrill  <jason@redhat.com>
1382         * pt.c (lookup_template_class_1): Shortcut current_class_type.
1384 2021-06-11  Patrick Palka  <ppalka@redhat.com>
1386         DR 1227
1387         PR c++/96560
1388         * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1389         TYPE_ARG_TYPES in forward order while short circuiting
1390         appropriately.  Adjust formatting.
1392 2021-06-11  Jakub Jelinek  <jakub@redhat.com>
1394         PR c++/100974
1395         * cp-tree.h (struct saved_scope): Add consteval_if_p
1396         member.  Formatting fix for the discarded_stmt comment.
1397         (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1398         * parser.c (cp_parser_lambda_expression): Temporarily disable
1399         in_consteval_if_p when parsing lambda body.
1400         (cp_parser_selection_statement): Parse consteval if.
1401         * decl.c (struct named_label_entry): Add in_consteval_if member.
1402         (level_for_consteval_if): New function.
1403         (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1404         consteval if.
1405         * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1406         why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1407         for !ctx->manifestly_const_eval.
1408         (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1409         condition as if it was __builtin_is_constant_evaluated call.
1410         (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1411         recurse on both branches.
1412         * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1413         as the else branch.
1414         * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1415         Temporarily set in_consteval_if_p when recursing on
1416         IF_STMT_CONSTEVAL_P then branch.
1417         (tsubst_lambda_expr): Temporarily disable
1418         in_consteval_if_p when instantiating lambda body.
1419         * call.c (immediate_invocation_p): Return false when
1420         in_consteval_if_p.
1422 2021-06-11  Marek Polacek  <polacek@redhat.com>
1424         PR c++/100995
1425         * constexpr.c (maybe_constexpr_fn): New.
1426         * cp-tree.h (maybe_constexpr_fn): Declare.
1427         * semantics.c (find_std_constant_evaluated_r): New.
1428         (maybe_warn_for_constant_evaluated): New.
1429         (finish_if_stmt_cond): Call it.
1431 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1433         PR c++/67829
1434         * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1435         the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1436         a template template parameter, adjust to the
1437         TEMPLATE_TEMPLATE_PARAMETER before falling through.
1439 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1441         PR c++/100946
1442         * constraint.cc (normalize_placeholder_type_constraints): When
1443         normalizing a non-templated return-type-requirement, add a dummy
1444         level to initial_parms.
1446 2021-06-08  Marek Polacek  <polacek@redhat.com>
1448         PR c++/100065
1449         * decl.c (grokdeclarator): Store a value-dependent
1450         explicit-specifier even for deduction guides.
1452 2021-06-08  Jason Merrill  <jason@redhat.com>
1454         * parser.c (cp_parser_string_literal): Adjust diagnostic.
1456 2021-06-08  Jason Merrill  <jason@redhat.com>
1458         PR c++/100963
1459         * call.c (perfect_conversion_p): Check check_narrowing.
1461 2021-06-08  Jason Merrill  <jason@redhat.com>
1463         PR c++/91706
1464         * name-lookup.c (get_class_binding): Keep a BASELINK.
1465         (set_inherited_value_binding_p): Adjust.
1466         * lambda.c (is_lambda_ignored_entity): Adjust.
1467         * pt.c (lookup_template_function): Copy a BASELINK before
1468         modifying it.
1470 2021-06-08  Jason Merrill  <jason@redhat.com>
1472         PR c++/91706
1473         * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1475 2021-06-08  Jason Merrill  <jason@redhat.com>
1477         * module.cc (duplicate_hash::hash): Comment out.
1478         (trees_in::tree_value): Adjust loop counter.
1480 2021-06-08  Jason Merrill  <jason@redhat.com>
1482         PR c++/100102
1483         * init.c (build_offset_ref): Return the BASELINK for a static
1484         member function.
1486 2021-06-07  Patrick Palka  <ppalka@redhat.com>
1488         PR c++/100918
1489         * parser.c (cp_parser_lookup_name): Check access of the lookup
1490         result before we potentially adjust an injected-class-name to
1491         its TEMPLATE_DECL.
1493 2021-06-06  Jakub Jelinek  <jakub@redhat.com>
1495         PR c/100902
1496         * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1497         even when target is combined with other constructs.
1499 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1501         PR c++/100893
1502         * pt.c (convert_template_argument): Strip top-level cv-quals
1503         on the substituted type of a non-type template parameter.
1505 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1507         PR c++/100102
1508         * pt.c (tsubst_function_decl): Remove old code for reducing
1509         args when it has excess levels.
1511 2021-06-04  Jakub Jelinek  <jakub@redhat.com>
1513         PR c++/100872
1514         * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1515         ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1516         to the start.
1518 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1520         PR c++/100592
1521         * decl.c (make_typename_type): After calling
1522         lookup_template_class, adjust the result to its TYPE_NAME and
1523         then consider the tf_keep_type_decl flag.
1525 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1527         PR c++/100862
1528         * pt.c (set_current_access_from_decl): Move to ...
1529         * class.c (set_current_access_from_decl): ... here.
1530         (handle_using_decl): Use it to propagate the access of the
1531         using-enum decl to the copy of the imported enumerator.
1532         * cp-tree.h (set_current_access_from_decl): Declare.
1533         * decl.c (build_enumerator): Simplify using make_temp_override
1534         and set_current_access_from_decl.
1536 2021-06-03  Jakub Jelinek  <jakub@redhat.com>
1538         PR c++/100859
1539         * semantics.c (handle_omp_array_sections_1): For
1540         OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1541         finish_non_static_data_member and allow this as base.
1542         (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1543         after depend only cases.  Let this be diagnosed by !lvalue_p
1544         case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1545         assert.
1546         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1548 2021-06-02  Jason Merrill  <jason@redhat.com>
1550         PR c++/100838
1551         * call.c (convert_like_internal): Clear tf_no_cleanup when
1552         recursing.
1553         (build_user_type_conversion_1): Only add ck_rvalue if
1554         LOOKUP_ONLYCONVERTING.
1556 2021-06-01  Patrick Palka  <ppalka@redhat.com>
1558         PR c++/65816
1559         * init.c (expand_aggr_init_1): Check
1560         type_has_non_user_provided_default_constructor instead of
1561         type_has_user_provided_constructor.
1563 2021-06-01  Jason Merrill  <jason@redhat.com>
1565         PR c++/91859
1566         * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1567         for destroying delete.
1568         * init.c (build_delete): Don't clobber before destroying delete.
1570 2021-06-01  Jason Merrill  <jason@redhat.com>
1572         PR c++/94492
1573         * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1575 2021-05-31  Richard Biener  <rguenther@suse.de>
1577         PR c++/88601
1578         * cp-objcp-common.c (names_builtin_p): Handle
1579         RID_BUILTIN_SHUFFLEVECTOR.
1580         * cp-tree.h (build_x_shufflevector): Declare.
1581         * parser.c (cp_parser_postfix_expression): Handle
1582         RID_BUILTIN_SHUFFLEVECTOR.
1583         * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1584         * typeck.c (build_x_shufflevector): Build either a lowered
1585         VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1586         internal function IFN_SHUFFLEVECTOR.
1588 2021-05-28  Jason Merrill  <jason@redhat.com>
1590         * constexpr.c (build_data_member_initialization): Use tsi_range.
1591         (build_constexpr_constructor_member_initializers): Likewise.
1592         (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1593         (potential_constant_expression_1): Likewise.
1594         * coroutines.cc (await_statement_expander): Likewise.
1595         (await_statement_walker): Likewise.
1596         * module.cc (trees_out::core_vals): Likewise.
1597         * pt.c (tsubst_expr): Likewise.
1598         * semantics.c (set_cleanup_locs): Likewise.
1600 2021-05-28  Jason Merrill  <jason@redhat.com>
1602         PR c++/100797
1603         PR c++/95719
1604         * call.c (build_over_call): Adjust base_binfo in
1605         resolves_to_fixed_type_p case.
1607 2021-05-28  Jakub Jelinek  <jakub@redhat.com>
1609         PR middle-end/99928
1610         * semantics.c (handle_omp_array_sections): Copy
1611         OMP_CLAUSE_MAP_IMPLICIT.
1612         (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1613         marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT.  Add
1614         map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1615         maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1616         present too.  For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1617         if present in map_head, map_field_head or map_firstprivate_head
1618         bitmaps.
1620 2021-05-28  Tobias Burnus  <tobias@codesourcery.com>
1622         * parser.c (cp_parser_omp_clause_affinity): New.
1623         (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1624         cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1625         clause.
1626         * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1627         finish_omp_clauses): Likewise.
1629 2021-05-27  Matthias Kretz  <kretz@kde.org>
1631         PR c++/100716
1632         * error.c (dump_template_bindings): Include code to print
1633         "[with" and ']', conditional on whether anything is printed at
1634         all. This is tied to whether a semicolon is needed to separate
1635         multiple template parameters. If the template argument repeats
1636         the template parameter (T = T), then skip the parameter.
1637         (dump_substitution): Moved code to print "[with" and ']' to
1638         dump_template_bindings.
1639         (dump_function_decl): Partial revert of PR50828, which masked
1640         TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1641         TFF_TEMPLATE_NAME is masked for the scope of the function and
1642         only carries through to dump_function_name.
1643         (dump_function_name): Avoid calling dump_template_parms if
1644         TFF_TEMPLATE_NAME is set.
1646 2021-05-27  Matthias Kretz  <kretz@kde.org>
1648         PR c++/100763
1649         * error.c: Call dump_scope when printing a typedef.
1651 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1653         PR c++/99893
1654         * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1656 2021-05-27  Jason Merrill  <jason@redhat.com>
1658         PR c++/86355
1659         * pt.c (use_pack_expansion_extra_args_p): Don't compare
1660         args from the same argument pack.
1662 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1664         DR 1315
1665         PR c++/67593
1666         PR c++/96555
1667         * pt.c (process_partial_specialization): Don't error on a
1668         non-simple non-type template argument that involves template
1669         parameters.
1670         (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1671         MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1673 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1675         PR c++/100502
1676         * typeck.c (finish_class_member_access_expr): Disable ahead
1677         of time access checking during the member lookup.
1679 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1681         PR c++/100368
1682         * tree.c (build_target_expr_with_type): Don't call force_rvalue
1683         on CALL_EXPR initializer.  Simplify now that bot_manip is no
1684         longer a caller.
1685         (bot_manip): Use force_target_expr instead of
1686         build_target_expr_with_type.
1688 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1690         PR c++/97420
1691         * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1692         (fnptr_conv_p): Don't call non_reference.  Use INDIRECT_TYPE_P
1693         instead of TYPE_PTR_P.
1694         * pt.c (convert_nontype_argument_function): Look through
1695         implicit INDIRECT_REFs before calling strip_fnptr_conv.
1697 2021-05-25  Jakub Jelinek  <jakub@redhat.com>
1699         PR c++/100666
1700         * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1701         and side-effects, temporarily disable -Wunused-result warning when
1702         building COMPOUND_EXPR.
1704 2021-05-21  Jakub Jelinek  <jakub@redhat.com>
1706         PR middle-end/99928
1707         * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1708         OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't error
1709         if a decl is mentioned both in map clause and in such firstprivate
1710         clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1712 2021-05-20  Jason Merrill  <jason@redhat.com>
1714         * call.c (reference_binding): Check for designator.
1715         (implicit_conversion_1, build_special_member_call): Likewise.
1716         * decl.c (reshape_init_r): Likewise.
1717         * pt.c (do_class_deduction): Likewise.
1718         * typeck2.c (digest_init_r): Likewise.
1720 2021-05-20  Jason Merrill  <jason@redhat.com>
1722         PR c++/100489
1723         * decl.c (reshape_init_class): Handle designator for
1724         member of anonymous aggregate here.
1725         * typeck2.c (process_init_constructor_record): Not here.
1727 2021-05-20  Jonathan Wakely  <jwakely@redhat.com>
1729         * call.c (maybe_warn_array_conv): Use new warning option.
1730         * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1731         * error.c (maybe_warn_cpp0x): Likewise.
1732         * parser.c (cp_parser_primary_expression)
1733         (cp_parser_unqualified_id)
1734         (cp_parser_pseudo_destructor_name)
1735         (cp_parser_lambda_introducer)
1736         (cp_parser_lambda_declarator_opt)
1737         (cp_parser_selection_statement)
1738         (cp_parser_init_statement)
1739         (cp_parser_decomposition_declaration)
1740         (cp_parser_function_specifier_opt)
1741         (cp_parser_static_assert)
1742         (cp_parser_namespace_definition)
1743         (cp_parser_using_declaration)
1744         (cp_parser_asm_definition)
1745         (cp_parser_ctor_initializer_opt_and_function_body)
1746         (cp_parser_initializer_list)
1747         (cp_parser_type_parameter_key)
1748         (cp_parser_member_declaration)
1749         (cp_parser_try_block)
1750         (cp_parser_std_attribute_spec): Likewise.
1751         * pt.c (check_template_variable): Likewise.
1753 2021-05-20  Jason Merrill  <jason@redhat.com>
1755         PR c++/100634
1756         * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1758 2021-05-20  Jason Merrill  <jason@redhat.com>
1760         PR c++/100659
1761         * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1763 2021-05-19  Jason Merrill  <jason@redhat.com>
1765         PR c++/100367
1766         PR c++/96299
1767         * method.c (genericize_spaceship): Use fold_build2 for scalar
1768         operands.
1770 2021-05-19  Jason Merrill  <jason@redhat.com>
1772         * pt.c (build_deduction_guide): Treat the implicit deduction guide
1773         as a member of the class.
1775 2021-05-19  Marek Polacek  <polacek@redhat.com>
1777         PR c++/100596
1778         * cp-tree.h (any_non_type_attribute_p): Remove.
1779         * decl.c (grokdeclarator): Turn an error into a warning and only
1780         warn for standard attributes.
1781         * decl2.c (any_non_type_attribute_p): Remove.
1782         * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1783         into a warning and only warn for standard attributes.
1784         (cp_parser_member_declaration): Likewise.
1786 2021-05-19  Martin Liska  <mliska@suse.cz>
1788         PR testsuite/100658
1789         * mangle.c (write_encoding): Fix typos.
1791 2021-05-19  Jakub Jelinek  <jakub@redhat.com>
1793         PR middle-end/99928
1794         * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1795         master when combined with taskloop.
1796         (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1797         parallel master when not combined with taskloop.
1799 2021-05-19  Jason Merrill  <jason@redhat.com>
1801         PR c++/100261
1802         * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1804 2021-05-19  Jason Merrill  <jason@redhat.com>
1806         PR c++/100372
1807         * tree.c (strip_typedefs): Only look at the pattern of a
1808         TYPE_PACK_EXPANSION if it's a type.
1810 2021-05-18  Marek Polacek  <polacek@redhat.com>
1812         * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1813         * constraint.cc (contains_wildcard_p): Likewise.
1814         (get_template_head_requirements): Likewise.
1815         (check_constrained_friend): Likewise.
1816         (subsumes_constraints): Likewise.
1817         * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1818         (push_void_library_fn): Likewise.
1819         (get_pattern_parm): Likewise.
1820         (get_template_parms_at_level): Likewise.
1821         (lambda_return_type): Likewise.
1822         (get_template_head_requirements): Likewise.
1823         (check_constrained_friend): Likewise.
1824         (subsumes_constraints): Likewise.
1825         * decl.c (push_void_library_fn): Likewise.
1826         * lambda.c (lambda_return_type): Likewise.
1827         * pt.c (get_template_parms_at_level): Likewise.
1828         (get_pattern_parm): Likewise.
1830 2021-05-18  Jason Merrill  <jason@redhat.com>
1832         PR c++/100644
1833         * call.c (perfect_candidate_p): An implicitly deleted move
1834         is not perfect.
1836 2021-05-18  Andreas Krebbel  <krebbel@linux.ibm.com>
1838         PR c++/100281
1839         * cvt.c (cp_convert_to_pointer): Use the size of the target
1840         pointer type.
1841         * tree.c (cp_build_reference_type): Call
1842         cp_build_reference_type_for_mode with VOIDmode.
1843         (cp_build_reference_type_for_mode): Rename from
1844         cp_build_reference_type.  Add MODE argument and invoke
1845         build_reference_type_for_mode.
1846         (strip_typedefs): Use build_pointer_type_for_mode and
1847         cp_build_reference_type_for_mode for pointers and references.
1849 2021-05-17  Jonathan Wakely  <jwakely@redhat.com>
1851         PR c++/100635
1852         * call.c (convert_like_internal): Print different diagnostic if
1853         the lvalue reference is const.
1855 2021-05-14  Jason Merrill  <jason@redhat.com>
1857         PR c++/95870
1858         * pt.c (enclosing_instantiation_of): Just compare
1859         DECL_SOURCE_LOCATION.
1860         (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1862 2021-05-14  Marek Polacek  <polacek@redhat.com>
1863             Jason Merrill  <jason@redhat.com>
1865         PR c++/99032
1866         * cp-tree.h (any_non_type_attribute_p): Declare.
1867         * decl.c (grokdeclarator): Diagnose when an attribute appertains to
1868         a friend declaration that is not a definition.
1869         * decl2.c (any_non_type_attribute_p): New.
1870         * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
1871         in the middle of decl-specifiers.
1872         (cp_parser_elaborated_type_specifier): Diagnose when an attribute
1873         appertains to a friend declaration that is not a definition.
1874         (cp_parser_member_declaration): Likewise.
1876 2021-05-12  Marek Polacek  <polacek@redhat.com>
1878         * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1879         sentinel.
1881 2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>
1883         * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1884         'close'.
1886 2021-05-11  Jason Merrill  <jason@redhat.com>
1888         PR c++/100517
1889         * typeck.c (build_reinterpret_cast_1): Check intype on
1890         cast to vector.
1892 2021-05-11  Patrick Palka  <ppalka@redhat.com>
1894         PR c++/51577
1895         * name-lookup.c (maybe_save_operator_binding): Unconditionally
1896         enable for all function templates, not just generic lambdas.
1897         Handle compound-assignment operator expressions.
1898         * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
1899         in the type-dependent case.
1900         (build_x_modify_expr): Likewise.  Move declaration of 'op' closer
1901         to its first use.
1903 2021-05-11  Patrick Palka  <ppalka@redhat.com>
1905         PR c++/100138
1906         * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1907         (satisfy_atom): Set up iloc_sentinel before calling
1908         cxx_constant_value.
1909         * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
1910         expansion, carry over PACK_EXPANSION_LOCAL_P and
1911         PACK_EXPANSION_SIZEOF_P from the original pack expansion.
1913 2021-05-10  Richard Biener  <rguenther@suse.de>
1915         PR middle-end/100464
1916         PR c++/100468
1917         * call.c (set_up_extended_ref_temp): Mark the temporary
1918         addressable if the TARGET_EXPR was.
1920 2021-05-10  Martin Liska  <mliska@suse.cz>
1922         * decl.c (duplicate_decls): Use startswith
1923         function instead of strncmp.
1924         (cxx_builtin_function): Likewise.
1925         (omp_declare_variant_finalize_one): Likewise.
1926         (grokfndecl): Likewise.
1927         * error.c (dump_decl_name): Likewise.
1928         * mangle.c (find_decomp_unqualified_name): Likewise.
1929         (write_guarded_var_name): Likewise.
1930         (decl_tls_wrapper_p): Likewise.
1931         * parser.c (cp_parser_simple_type_specifier): Likewise.
1932         (cp_parser_tx_qualifier_opt): Likewise.
1933         * pt.c (template_parm_object_p): Likewise.
1934         (dguide_name_p): Likewise.
1936 2021-05-10  Martin Liska  <mliska@suse.cz>
1938         PR c++/99616
1939         * decl.c (grokdeclarator): Remove redundant NULL check.
1941 2021-05-07  Jason Merrill  <jason@redhat.com>
1943         * tree.c (rvalue): Assert expr is not a class lvalue.
1945 2021-05-07  Jason Merrill  <jason@redhat.com>
1947         * cp-tree.h (build_stub_object): Declare.
1948         * method.c (build_stub_object): No longer static.
1949         * call.c (can_convert): Use it.
1950         * tree.c (build_dummy_object): Adjust comment.
1951         * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
1952         TARGET_EXPR.
1954 2021-05-07  Jason Merrill  <jason@redhat.com>
1956         * coroutines.cc (build_co_await): Don't call 'rvalue'.
1957         (flatten_await_stmt): Simplify initialization.
1958         (morph_fn_to_coro): Change 'rvalue' to 'move'.  Simplify.
1960 2021-05-04  Tobias Burnus  <tobias@codesourcery.com>
1962         * semantics.c (finish_omp_reduction_clause): Accept float + complex
1963         for || and && reductions.
1965 2021-05-03  Patrick Palka  <ppalka@redhat.com>
1967         PR c++/100362
1968         * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1969         and popclass when parsing the base-clause that were removed in
1970         r11-6815.
1972 2021-05-03  Patrick Palka  <ppalka@redhat.com>
1974         PR c++/68942
1975         PR c++/100344
1976         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1977         only when the callee is a FUNCTION_DECL.
1979 2021-05-03  Marek Polacek  <polacek@redhat.com>
1981         PR c++/100055
1982         * decl.c (grokfndecl): Check current_template_parms.
1984 2021-05-03  Marek Polacek  <polacek@redhat.com>
1986         DR 1312
1987         * constexpr.c (cxx_eval_constant_expression): Don't check
1988         integer_zerop.
1990 2021-05-01  Jason Merrill  <jason@redhat.com>
1992         * cp-tree.h (class ovl_iterator): Allow copying.  Add op==.
1993         (class ovl_range, class lkp_range): New.
1994         * call.c (build_op_call_1, add_candidates): Use them.
1995         (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
1996         (has_trivial_copy_p): Likewise.
1997         * class.c (handle_using_decl, get_basefndecls): Likewise.
1998         (maybe_warn_about_overly_private_class): Likewise.
1999         (warn_hidden, add_implicitly_declared_members): Likewise.
2000         (check_methods, clone_constructors_and_destructors): Likewise.
2001         (type_has_user_nondefault_constructor): Likewise.
2003 2021-04-29  Jason Merrill  <jason@redhat.com>
2005         * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
2006         don't find a field.
2008 2021-04-29  Jason Merrill  <jason@redhat.com>
2010         PR c++/51344
2011         * decl2.c (grokfield): Call cplus_decl_attributes for friend.
2012         (save_template_attributes): Use chainon.
2013         * friend.c (do_friend): Remove attrlist parm.
2014         * cp-tree.h (do_friend): Adjust.
2015         * class.c (add_implicitly_declared_members): Adjust.
2016         * decl.c (grokdeclarator): Adjust.
2017         * pt.c (apply_late_template_attributes): Optimize.
2019 2021-04-29  Jason Merrill  <jason@redhat.com>
2021         PR c++/97974
2022         * class.c (finish_struct_anon_r): Drop complain parm.
2023         Remove non-field diagnostic.
2024         (finish_struct_anon): Adjust.
2025         * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2027 2021-04-29  Jason Merrill  <jason@redhat.com>
2029         * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2030         * parser.c (cp_parser_constant_expression): Change
2031         allow_non_constant_p to int.  Use cp_evaluated.
2032         (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2033         * semantics.c (finish_id_expression_1): Don't mess with
2034         cp_unevaluated_operand here.
2036 2021-04-29  Jason Merrill  <jason@redhat.com>
2038         * cp-tree.h: Clarify comments.
2039         * pt.c (get_template_parm_object): Add assert.
2040         * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2041         * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2042         * typeck2.c (store_init_value): Likewise.
2044 2021-04-29  Patrick Palka  <ppalka@redhat.com>
2046         PR c++/68942
2047         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2048         set tf_conv during the initial substitution into the function.
2050 2021-04-29  Jakub Jelinek  <jakub@redhat.com>
2052         PR c++/100319
2053         * semantics.c (finish_omp_clauses): Fix up check that variable
2054         mentioned in detach clause doesn't appear in data-sharing clauses.
2056 2021-04-28  Jakub Jelinek  <jakub@redhat.com>
2058         * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2060 2021-04-27  Jason Merrill  <jason@redhat.com>
2062         PR c++/92145
2063         * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2064         of operator=.
2066 2021-04-27  Patrick Palka  <ppalka@redhat.com>
2068         PR c++/88580
2069         * pt.c (tsubst_initializer_list): Correctly handle the case
2070         where an argument inside a base initializer pack expansion is
2071         itself a pack expansion.
2073 2021-04-26  Patrick Palka  <ppalka@redhat.com>
2075         PR c++/100209
2076         * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2077         object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2078         with a negative offset into one whose offset is nonnegative
2079         before calling cxx_fold_indirect_ref_1.
2081 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2083         PR c++/89565
2084         PR c++/93383
2085         PR c++/95291
2086         PR c++/99200
2087         PR c++/99683
2088         * pt.c (do_class_deduction): Punt if the initializer is
2089         type-dependent.
2091 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2093         PR c++/87709
2094         * parser.c (cp_parser_type_id_1): If we see a template
2095         placeholder, first try simulating an error before issuing
2096         a real error.
2098 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2100         PR c++/98767
2101         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2102         Adjust parameter list loop to iterate over 'types' instead of
2103         'args'.  Output the trailing '...' for a variadic function.
2104         Remove PARM_DECL support.
2105         (pp_cxx_requires_expr): Pretty print the parameter list directly
2106         instead of going through pp_cxx_parameter_declaration_clause.
2108 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2110         DR 2374
2111         * decl.c (is_direct_enum_init): Check the implicit
2112         convertibility requirement added by CWG 2374.
2114 2021-04-23  Martin Liska  <mliska@suse.cz>
2116         * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2117         * lex.c (init_operators): Remove run-time check.
2119 2021-04-22  Marek Polacek  <polacek@redhat.com>
2121         PR c++/100161
2122         * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2123         op1 separately for value- or type-dependence.
2125 2021-04-21  Marek Polacek  <polacek@redhat.com>
2127         PR c++/96380
2128         * parser.c (cp_parser_enum_specifier): Don't allow defining
2129         types in enum-base.
2131 2021-04-21  Martin Liska  <mliska@suse.cz>
2133         Revert:
2134         2021-04-21  Martin Liska  <mliska@suse.cz>
2136         * error.c (dump_decl): Use flags in dump_generic_node call.
2138 2021-04-21  Martin Liska  <mliska@suse.cz>
2140         * error.c (dump_decl): Use flags in dump_generic_node call.
2142 2021-04-21  Martin Liska  <mliska@suse.cz>
2144         * error.c (dump_decl): Support anonymous labels.
2146 2021-04-20  Jason Merrill  <jason@redhat.com>
2148         PR c++/100109
2149         * pt.c (find_parameter_packs_r): Look into enum initializers.
2151 2021-04-19  Marek Polacek  <polacek@redhat.com>
2153         PR c++/97536
2154         * decl.c (grokvardecl): Given an error when a concept is not defined
2155         at namespace scope.
2157 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2159         PR c++/100111
2160         * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2161         for empty classes into *valp when types don't match even when *valp
2162         is NULL.
2164 2021-04-16  Marek Polacek  <polacek@redhat.com>
2166         PR c++/99803
2167         * decl.c (make_typename_type): Give an error and return when
2168         name is is_overloaded_fn.
2169         * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2170         before calling make_typename_type.
2172 2021-04-16  Patrick Palka  <ppalka@redhat.com>
2174         PR c++/99700
2175         * constexpr.c (reduced_constant_expression_p): For array
2176         CONSTRUCTORs, use a dedicated loop that additionally verifies
2177         the CONSTRUCTOR spans the entire array.
2179 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2181         PR c++/99850
2182         * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2183         If lambda_p, return pce_ok instead of pce_maybe_postfix.
2185 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2187         PR c++/99833
2188         * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2189         binding, add to data.internal also all corresponding structured
2190         binding decls.
2192 2021-04-16  Jason Merrill  <jason@redhat.com>
2194         PR c++/100079
2195         * cp-tree.h (first_field): Declare.
2196         * mangle.c (range_expr_nelts): New.
2197         (write_expression): Improve class NTTP mangling.
2198         * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2199         * tree.c (zero_init_expr_p): Improve class NTTP handling.
2200         * decl.c: Adjust comment.
2202 2021-04-15  Jason Merrill  <jason@redhat.com>
2204         PR c++/80456
2205         * call.c (build_new_method_call_1): Check again for side-effects
2206         with a volatile object.
2208 2021-04-15  Jason Merrill  <jason@redhat.com>
2210         PR c++/100101
2211         PR c++/99583
2212         * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2213         TYPE_RAISES_EXCEPTIONS here.
2214         * tree.c (cp_walk_subtrees): Not here.
2216 2021-04-15  Jason Merrill  <jason@redhat.com>
2218         PR c++/100091
2219         PR c++/99478
2220         * parser.c (cp_parser_default_type_template_argument): Set
2221         parser->local_variables_forbidden_p.
2223 2021-04-15  Richard Sandiford  <richard.sandiford@arm.com>
2225         PR c++/98852
2226         * typeck.c (merge_type_attributes_from): New function.
2227         (cp_common_type): Use it for vector types.
2229 2021-04-14  Jason Merrill  <jason@redhat.com>
2231         PR c++/100078
2232         PR c++/93085
2233         * pt.c (uses_outer_template_parms): Also look at default
2234         template argument.
2236 2021-04-14  Jason Merrill  <jason@redhat.com>
2238         PR c++/93314
2239         * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2240         for a non-static data member in a constant-expression.
2242 2021-04-14  Patrick Palka  <ppalka@redhat.com>
2244         PR c++/83476
2245         PR c++/99885
2246         * pt.c (deducible_expression): Look through implicit
2247         INDIRECT_REFs as well.
2249 2021-04-14  Jason Merrill  <jason@redhat.com>
2251         PR c++/99478
2252         * parser.c (cp_parser_lambda_expression): Reject lambda
2253         in template parameter type.
2255 2021-04-14  Jason Merrill  <jason@redhat.com>
2257         PR c++/90674
2258         * decl.c (duplicate_decls): Don't propagate
2259         DECL_INITIALIZED_IN_CLASS_P to a specialization.
2261 2021-04-14  Jason Merrill  <jason@redhat.com>
2263         PR c++/88742
2264         PR c++/49951
2265         PR c++/58123
2266         * semantics.c (set_cleanup_locs): New.
2267         (do_poplevel): Call it.
2268         * parser.c (cp_parser_compound_statement): Consume the }
2269         before finish_compound_stmt.
2271 2021-04-13  Jason Merrill  <jason@redhat.com>
2273         PR c++/100032
2274         * pt.c (get_underlying_template): Compare TYPE_QUALS.
2276 2021-04-13  Jason Merrill  <jason@redhat.com>
2278         PR c++/100054
2279         PR c++/90479
2280         * init.c (get_nsdmi): Do more context adjustment for local classes.
2282 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2284         PR c++/99008
2285         * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2286         rather than issuing a pedwarn.
2287         * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2288         for consistent diagnostics.
2290 2021-04-13  Jason Merrill  <jason@redhat.com>
2292         PR c++/91933
2293         * class.c (build_base_path): Shortcut simple non-pointer case.
2295 2021-04-13  Eric Botcazou  <ebotcazou@adacore.com>
2297         * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2298         of the linemap.
2299         (module_state::write_location): Likewise.
2301 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2303         PR c++/97134
2304         * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2305         when checking if the initializer is an equivalent class
2306         placeholder template parameter.
2308 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2310         PR c++/99961
2311         PR c++/99994
2312         * constraint.cc (satisfy_normalized_constraints): Set
2313         cp_unevaluated.
2314         * parser.c (cp_parser_concept_definition): Likewise.
2315         (cp_parser_requires_clause_opt): Likewise.
2317 2021-04-12  Jason Merrill  <jason@redhat.com>
2319         PR c++/93085
2320         * pt.c (uses_outer_template_parms): Handle non-type and template
2321         template parameters specifically.
2323 2021-04-11  Jason Merrill  <jason@redhat.com>
2325         PR c++/97974
2326         * decl.c (fixup_anonymous_aggr): Prune all functions from
2327         CLASSTYPE_MEMBER_VEC.
2329 2021-04-10  Jason Merrill  <jason@redhat.com>
2331         PR c++/98800
2332         PR c++/97399
2333         * parser.c (cp_parser_direct_declarator): Don't
2334         inject_this_parameter if static_p.
2335         (cp_parser_omp_var_list_no_open): Parse 'this' even if
2336         current_class_ptr isn't set for a better diagnostic.
2338 2021-04-10  Jason Merrill  <jason@redhat.com>
2340         PR c++/99180
2341         PR c++/93295
2342         PR c++/93867
2343         PR c++/99118
2344         PR c++/96873
2345         * pt.c (alias_ctad_tweaks): Handle failure better.
2347 2021-04-10  Jason Merrill  <jason@redhat.com>
2349         PR c++/100006
2350         * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2352 2021-04-09  Patrick Palka  <ppalka@redhat.com>
2354         * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2355         (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2356         (LAMBDA_EXPR_REGEN_INFO): ... this.
2357         (tree_lambda_expr::regenerated_from)
2358         (tree_lambda_expr::regenerating_targs): Replace these with ...
2359         (tree_lambda_expr::regen_info): ... this.
2360         * constraint.cc (satisfy_declaration_constraints): Adjust
2361         accordingly.
2362         * lambda.c (build_lambda_expr): Likewise.
2363         * pt.c (regenerated_lambda_fn_p): Likewise.
2364         (most_general_lambda): Likewise.
2365         (tsubst_lambda_expr): Likewise.
2367 2021-04-09  Marek Polacek  <polacek@redhat.com>
2369         PR c++/99806
2370         * parser.c (cp_parser_member_declaration): Call
2371         cp_parser_save_default_args even for function templates.  Use
2372         STRIP_TEMPLATE on the declaration we're passing.
2374 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2376         PR c++/99874
2377         * constraint.cc (get_normalized_constraints_from_decl): Handle
2378         regenerated lambdas.
2379         (satisfy_declaration_constraints): Likewise.  Check for
2380         dependent args later.
2381         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2382         (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2383         (LAMBDA_EXPR_REGENERATING_TARGS): New.
2384         (tree_lambda_expr::regenerated_from): New data member.
2385         (tree_lambda_expr::regenerating_targs): New data member.
2386         (add_to_template_args): Declare.
2387         (regenerated_lambda_fn_p): Likewise.
2388         (most_general_lambda): Likewise.
2389         * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2390         and LAMBDA_EXPR_REGENERATING_TARGS.
2391         * pt.c (add_to_template_args): No longer static.
2392         (tsubst_function_decl): Unconditionally propagate constraints on
2393         the substituted function decl.
2394         (instantiated_lambda_fn_p): Rename to ...
2395         (regenerated_lambda_fn_p): ... this.  Check
2396         LAMBDA_EXPR_REGENERATED_FROM instead of
2397         LAMBDA_EXPR_INSTANTIATED.
2398         (most_general_lambda): Define.
2399         (enclosing_instantiation_of): Adjust after renaming
2400         instantiated_lambda_fn_p.
2401         (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED.  Set
2402         LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2403         Don't substitute or set constraints on the regenerated lambda.
2405 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2407         PR c++/97679
2408         * pt.c (build_deduction_guide): Document OUTER_ARGS.  Substitute
2409         them into the propagated constraints.
2411 2021-04-08  Jason Merrill  <jason@redhat.com>
2413         PR c++/91849
2414         * call.c (convert_like_internal): Improve reference diagnostic.
2416 2021-04-08  Jakub Jelinek  <jakub@redhat.com>
2418         PR c++/99859
2419         * constexpr.c (addr_of_non_const_var): New function.
2420         (cxx_bind_parameters_in_call): Set *non_constant_args to true
2421         even if cp_walk_tree on arg with addr_of_non_const_var callback
2422         returns true.
2424 2021-04-08  Jason Merrill  <jason@redhat.com>
2426         PR c++/94529
2427         * pt.c (determine_specialization): Improve diagnostic.
2429 2021-04-08  Marek Polacek  <polacek@redhat.com>
2431         PR c++/99844
2432         * decl.c (build_explicit_specifier): Call
2433         check_for_bare_parameter_packs.
2434         * except.c (build_noexcept_spec): Likewise.
2436 2021-04-07  Jason Merrill  <jason@redhat.com>
2438         PR c++/41723
2439         * parser.c (cp_parser_class_name): Check dependent_scope_p.
2441 2021-04-07  Jason Merrill  <jason@redhat.com>
2443         PR c++/52625
2444         * pt.c (maybe_process_partial_specialization): Check
2445         DECL_SELF_REFERENCE_P.
2447 2021-04-07  Jason Merrill  <jason@redhat.com>
2449         PR c++/92918
2450         * name-lookup.c (push_class_level_binding_1): Do overload a new
2451         function with a previous using-declaration.
2453 2021-04-06  Jason Merrill  <jason@redhat.com>
2455         PR c++/96673
2456         * init.c (get_nsdmi): Don't defer access checking.
2458 2021-04-06  Jason Merrill  <jason@redhat.com>
2460         PR c++/99901
2461         * decl.c (cp_finish_decl): mark_needed an implicitly inline
2462         static data member with an out-of-class redeclaration.
2464 2021-04-06  Jason Merrill  <jason@redhat.com>
2466         PR c++/91241
2467         * mangle.c (write_compact_number): Add sanity check.
2468         (write_local_name): Use list_length for parm number.
2470 2021-04-06  Patrick Palka  <ppalka@redhat.com>
2472         PR c++/99899
2473         * pt.c (do_auto_deduction): Don't exit early when deducing the
2474         array type of a structured binding.  Also handle adc_decomp_type
2475         during constraint checking.
2477 2021-04-05  Jason Merrill  <jason@redhat.com>
2479         PR c++/96311
2480         * typeck.c (check_return_expr): Call mark_exp_read in dependent
2481         case.
2483 2021-04-05  Jason Merrill  <jason@redhat.com>
2485         PR c++/98440
2486         * typeck.c (build_reinterpret_cast_1): Don't perform
2487         temporary materialization.
2489 2021-04-05  Jason Merrill  <jason@redhat.com>
2491         PR c++/95317
2492         * pt.c (lookup_template_class_1): Do tsubst_enum when
2493         tsubsting a generic lambda.
2495 2021-04-05  Jason Merrill  <jason@redhat.com>
2497         PR c++/95870
2498         * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2499         there is no enclosing non-lambda function.
2501 2021-04-05  Nathan Sidwell  <nathan@acm.org>
2503         PR c++/99380
2504         * module.cc (name_pending_imports): Drop 'atend' parm.  Don't
2505         query export when not needed.
2506         (preprocess_module, preprocessed_module): Adjust.
2508 2021-04-05  Jason Merrill  <jason@redhat.com>
2510         PR c++/99066
2511         * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2513 2021-04-05  Jason Merrill  <jason@redhat.com>
2515         PR c++/99201
2516         * pt.c (class el_data): Add visited field.
2517         (extract_local_specs): Pass it to cp_walk_tree.
2518         (extract_locals_r): Walk into the body of a lambda.
2520 2021-04-05  Jason Merrill  <jason@redhat.com>
2522         * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2523         template result.
2525 2021-04-04  Jason Merrill  <jason@redhat.com>
2527         PR c++/99643
2528         * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2530 2021-04-03  Marek Polacek  <polacek@redhat.com>
2532         PR c++/91416
2533         * parser.c: Create a GC root for attributes in a decl specifier.
2534         (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2536 2021-04-03  Jason Merrill  <jason@redhat.com>
2538         PR c++/91217
2539         * pt.c (tsubst_lambda_expr): Skip the body block from
2540         DECL_SAVED_TREE.
2542 2021-04-03  Jason Merrill  <jason@redhat.com>
2544         PR c++/90664
2545         * cvt.c (can_convert_qual): Check fnptr_conv_p.
2547 2021-04-03  Jason Merrill  <jason@redhat.com>
2549         PR c++/97900
2550         * pt.c (regenerate_decl_from_template): tsubst_decl
2551         the parms.
2553 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2555         PR c++/99869
2556         * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2557         to do_auto_deduction.
2559 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2561         PR c++/99586
2562         * semantics.c (finish_compound_literal): Check
2563         template_placeholder_p instead of type_uses_auto.
2565 2021-04-02  Jason Merrill  <jason@redhat.com>
2567         PR c++/97938
2568         * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2569         * lambda.c (add_capture): Set it.
2570         * pt.c (tsubst_pack_expansion): Handle it.
2572 2021-04-02  Nathan Sidwell  <nathan@acm.org>
2574         * cp-tree.h (lang_decl_base): Correct module flag comment.
2575         * module.cc (trees_in::assert_definition): Break out
2576         not_tmpl var.
2577         (trees_out::lang_decl_bools): Do not write purview for header units.
2579 2021-04-01  Marek Polacek  <polacek@redhat.com>
2581         PR c++/99831
2582         * method.c (defaulted_late_check): ++ and -- function_depth around
2583         the call to synthesize_method.
2584         * pt.c: Remove the saved_trees global.
2586 2021-04-01  Jason Merrill  <jason@redhat.com>
2588         PR c++/99583
2589         PR c++/99584
2590         * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2591         TYPE_RAISES_EXCEPTIONS.
2593 2021-04-01  Iain Sandoe  <iain@sandoe.co.uk>
2595         * mapper-client.cc (INCLUDE_MAP): New; require map to be
2596         included from system.h.
2597         * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2599 2021-04-01  Jason Merrill  <jason@redhat.com>
2601         PR c++/98481
2602         * mangle.c (write_expression): Adjust.
2603         * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2604         (mark_abi_tags_r): Likewise.
2606 2021-04-01  Nathan Sidwell  <nathan@acm.org>
2608         PR c++/99283
2609         * module.cc (trees_out::decl_node): Adjust importedness reference
2610         assert.
2611         (module_state::intercluster_seed): New.  Seed both imports and
2612         inter-cluster references.  Broken out of ...
2613         (module_state::write_cluster): ... here.  Call it.
2615 2021-03-31  Jason Merrill  <jason@redhat.com>
2617         PR c++/99445
2618         * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2620 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2622         PR c++/88115
2623         * mangle.c (write_expression): Adjust the mangling of
2624         __alignof__.
2626 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2628         PR c++/99815
2629         * pt.c (placeholder_type_constraint_dependent_p): Expand
2630         argument packs to separate the first non-pack argument
2631         from the rest.
2633 2021-03-30  Nathan Sidwell  <nathan@acm.org>
2635         PR c++/99283
2636         * module.cc (dumper::operator): Make less brittle.
2637         (trees_out::core_bools): VAR_DECLs always have a context.
2638         (trees_out::key_mergeable): Use same_type_p for asserting.
2639         (trees_in::read_var_def): Propagate
2640         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2642 2021-03-30  Jakub Jelinek  <jakub@redhat.com>
2644         PR c++/99790
2645         * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2647 2021-03-26  Marek Polacek  <polacek@redhat.com>
2649         PR c++/98352
2650         * method.c (implicitly_declare_fn): Pass &raises to
2651         synthesized_method_walk.
2653 2021-03-26  Nathan Sidwell  <nathan@acm.org>
2655         PR c++/99283
2656         * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2657         (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2658         * decl.c (duplicate_decls): Remove template_decl module flag
2659         propagation.
2660         * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2661         (dumper::impl::nested_name): Adjust for template-decl module flag
2662         change.
2663         (trees_in::assert_definition): Likewise.
2664         (trees_in::install_entity): Likewise.
2665         (trees_out::decl_value): Likewise.  Remove alias template
2666         separation of template and type_decl.
2667         (trees_in::decl_value): Likewise.
2668         (trees_out::key_mergeable): Likewise,
2669         (trees_in::key_mergeable): Likewise.
2670         (trees_out::decl_node): Adjust for template-decl module flag
2671         change.
2672         (depset::hash::make_dependency): Likewise.
2673         (get_originating_module, module_may_redeclare): Likewise.
2674         (set_instantiating_module, set_defining_module): Likewise.
2675         * name-lookup.c (name_lookup::search_adl): Likewise.
2676         (do_pushdecl): Likewise.
2677         * pt.c (build_template_decl): Likewise.
2678         (lookup_template_class_1): Remove special alias_template handling
2679         of DECL_TI_TEMPLATE.
2680         (tsubst_template_decl): Likewise.
2682 2021-03-26  Jakub Jelinek  <jakub@redhat.com>
2684         PR c++/99705
2685         * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2686         in DECL_EXPR or in BIND_EXPR_VARS.
2688 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2690         PR c++/99672
2691         * parser.c (cp_parser_postfix_expression): For calls, create
2692         combined_loc and temporarily set input_location to it before
2693         calling finish_call_expr.
2695 2021-03-25  Marek Polacek  <polacek@redhat.com>
2697         PR c++/94751
2698         * call.c (build_over_call): Maybe call mark_used in case
2699         deduce_inheriting_ctor fails and return error_mark_node.
2700         * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2701         * method.c (deduce_inheriting_ctor): Return bool if the deduction
2702         fails.
2703         (implicitly_declare_fn): If raises is error_mark_node, call
2704         synthesized_method_walk with diag being true.
2706 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2708         PR c++/99745
2709         * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2710         packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2712 2021-03-25  Marek Polacek  <polacek@redhat.com>
2714         PR c++/99331
2715         * call.c (build_converted_constant_expr_internal): Don't emit
2716         -Wconversion warnings.
2718 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2720         PR c++/99565
2721         * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2722         to operand_equal_p.
2723         * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2724         or COMPOUND_EXPR.
2726 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2728         PR c++/99283
2729         * name-lookup.c (check_module_override): Set global or partition
2730         DUP on the binding vector.
2732 2021-03-23  Marek Polacek  <polacek@redhat.com>
2734         PR c++/99318
2735         * decl2.c (cp_warn_deprecated_use_scopes): Only call
2736         cp_warn_deprecated_use when decl is a namespace, class, or enum.
2738 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2740         PR c++/99239
2741         * decl.c (duplicate_decls): Remove assert about maybe-imported
2742         artificial decls.
2744 2021-03-23  Jakub Jelinek  <jakub@redhat.com>
2746         PR c++/99650
2747         * decl.c (cp_finish_decomp): Diagnose void initializers when
2748         using tuple_element and get.
2750 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2752         PR c++/99480
2753         * module.cc (depset::hash::make_dependency): Propagate flags for
2754         partial specialization.
2755         (module_may_redeclare): Handle partial specialization.
2757 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2759         PR c++/99425
2760         * cp-tree.h (map_context_from, map_context_to): Delete.
2761         (add_mergeable_specialization): Add is_alias parm.
2762         * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2763         * module.cc (map_context_from, map_context_to): Delete.
2764         (trees_in::decl_value): Add specializations later, adjust call.
2765         Drop useless alias lookup. Set duplicate fn parm context.
2766         (check_mergeable_decl): Drop context mapping.
2767         (trees_in::is_matching_decl): Likewise.
2768         (trees_in::read_function_def): Drop parameter context adjustment
2769         here.
2771 2021-03-22  Martin Liska  <mliska@suse.cz>
2773         PR c++/99687
2774         * module.cc (fini_modules): Call vec_free instead of delete.
2776 2021-03-20  Jakub Jelinek  <jakub@redhat.com>
2778         PR debug/99230
2779         * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2780         special code, instead call c_genericize_control_stmt.
2782 2021-03-19  Jakub Jelinek  <jakub@redhat.com>
2784         PR c++/99456
2785         * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2786         INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2787         don't diagnose it, set *non_constant_p nor return t.
2789 2021-03-19  Marek Polacek  <polacek@redhat.com>
2791         PR c++/99500
2792         * parser.c (cp_parser_requirement_parameter_list): Handle
2793         error_mark_node.
2795 2021-03-18  Marek Polacek  <polacek@redhat.com>
2797         * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2799 2021-03-18  Marek Polacek  <polacek@redhat.com>
2801         * pt.c (tsubst_copy_and_build): Add assert.
2803 2021-03-18  Iain Sandoe  <iain@sandoe.co.uk>
2805         PR objc++/49070
2806         * parser.c (cp_debug_parser): Add Objective-C++ message
2807         state flag.
2808         (cp_parser_nested_name_specifier_opt): Allow colon to
2809         terminate an assignment-expression when parsing Objective-
2810         C++ messages.
2811         (cp_parser_objc_message_expression): Set and clear message
2812         parsing state on entry and exit.
2813         * parser.h (struct cp_parser): Add a context flag for
2814         Objective-C++ message state.
2816 2021-03-18  Martin Liska  <mliska@suse.cz>
2818         PR c++/99617
2819         * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2820         to NULL.
2822 2021-03-17  Marek Polacek  <polacek@redhat.com>
2824         PR c++/97973
2825         * call.c (conv_unsafe_in_template_p): New.
2826         (convert_like): Use it.
2828 2021-03-17  Anthony Sharp  <anthonysharp15@gmail.com>
2829             Jason Merrill  <jason@redhat.com>
2831         * semantics.c (get_class_access_diagnostic_decl): New
2832         function that examines special cases when a parent
2833         class causes a private access failure.
2834         (enforce_access): Slightly modified to call function
2835         above.
2837 2021-03-16  Jason Merrill  <jason@redhat.com>
2839         * tree.c (cp_tree_equal): Use real_identical.
2841 2021-03-16  Jakub Jelinek  <jakub@redhat.com>
2843         PR c++/99613
2844         * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2845         before calling __cxa_guard_release rather than after it.  Formatting
2846         fixes.
2848 2021-03-16  Martin Liska  <mliska@suse.cz>
2849             Jason Merrill  <jason@redhat.com>
2851         PR c++/99108
2852         * call.c (get_function_version_dispatcher): Handle
2853         DECL_LOCAL_DECL_P.
2854         * decl.c (maybe_version_functions): Likewise.
2855         (maybe_mark_function_versioned): New.
2856         * name-lookup.c (push_local_extern_decl_alias): No longer static.
2857         * name-lookup.h (push_local_extern_decl_alias): Adjust.
2859 2021-03-16  Nathan Sidwell  <nathan@acm.org>
2861         PR c++/99496
2862         * module.cc (trees_out::decl_value): Adjust typedef streaming,
2863         indicate whether it is a dependent alias.
2864         (trees_in::decl_value): Likewise.  Set as dependent alias, if it
2865         is one.
2867 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2869         PR c++/99047
2870         * coroutines.cc (expand_one_await_expression): If the
2871         await_ready() expression is not a boolean then convert it
2872         as required.
2874 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2876         PR c++/98704
2877         * coroutines.cc (build_actor_fn): Make destroy index 1
2878         correspond to the abnormal unhandled_exception() exit.
2879         Substitute the proxy for the resume index.
2880         (coro_rewrite_function_body): Arrange to reset the resume
2881         index and make done = true for a rethrown exception from
2882         unhandled_exception ().
2883         (morph_fn_to_coro): Adjust calls to build_actor_fn and
2884         coro_rewrite_function_body.
2886 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2888         PR c++/98480
2889         * coroutines.cc (replace_continue): Rewrite continue into
2890         'goto label'.
2891         (await_statement_walker): Handle await expressions in the
2892         initializer, condition and iteration expressions of for
2893         loops.
2895 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2897         PR c++/96749
2898         * coroutines.cc (flatten_await_stmt): Allow for the case
2899         where a target expression variable only has uses in the
2900         second part of a compound expression.
2901         (maybe_promote_temps): Avoid emiting empty statements.
2903 2021-03-15  Tobias Burnus  <tobias@codesourcery.com>
2905         PR c++/99509
2906         * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2907         ensure that the varpool node is marked as offloadable.
2909 2021-03-12  Nathan Sidwell  <nathan@acm.org>
2911         PR c++/99238
2912         * module.cc (depset::hash::add_binding_entity): Assert not
2913         visited.
2914         (depset::add::add_specializations): Likewise.
2915         * name-lookup.c (name_lookup::dedup): New.
2916         (name_lookup::~name_lookup): Assert not deduping.
2917         (name_lookup::restore_state): Likewise.
2918         (name_lookup::add_overload): Replace outlined code with dedup
2919         call.
2920         (name_lookup::add_value): Likewise.
2921         (name_lookup::search_namespace_only): Likewise.
2922         (name_lookup::adl_namespace_fns): Likewise.
2923         (name_lookup::adl_class_fns): Likewise.
2924         (name_lookup::search_adl): Likewise.  Add clearing dedup call.
2925         (name_lookup::search_qualified): Likewise.
2926         (name_lookup::search_unqualified): Likewise.
2928 2021-03-12  Jakub Jelinek  <jakub@redhat.com>
2930         PR c++/99507
2931         * call.c (build_over_call): For immediate evaluation of functions
2932         that return references, undo convert_from_reference effects before
2933         calling cxx_constant_value and call convert_from_reference
2934         afterwards.
2936 2021-03-11  Nathan Sidwell  <nathan@acm.org>
2938         PR c++/99248
2939         * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
2940         when there's a binding vector.
2941         * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
2943 2021-03-11  Nathan Sidwell  <nathan@acm.org>
2945         PR c++/99528
2946         * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2947         MK_decl_tmpl_spec.
2948         (trees_in::decl_value): Adjust add_mergeable_specialization call.
2949         (trees_out::get_merge_kind): Adjust detecting a partial template
2950         instantiation.
2951         (trees_out::key_mergeable): Adjust handling same.
2952         (trees_in::key_mergeabvle): Likewise.
2954 2021-03-10  Nathan Sidwell  <nathan@acm.org>
2956         PR c++/99423
2957         * module.cc (post_load_processing): Assert not gcable.
2958         (laxy_load_pendings): Extend no-gc region around
2959         post_load_processing.
2961 2021-03-10  Nathan Sidwell  <nathan@acm.org>
2963         PR c++/99508
2964         * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2965         assembler name to the ns alias.
2967 2021-03-09  Jakub Jelinek  <jakub@redhat.com>
2969         PR c++/99459
2970         * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2971         build_special_member_call return value to find the CALL_EXPR.
2972         Simplify.
2974 2021-03-09  Nathan Sidwell  <nathan@acm.org>
2976         PR c++/99472
2977         * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2978         that C++20 does not yet imply modules.
2980 2021-03-08  Nathan Sidwell  <nathan@acm.org>
2982         PR c++/99436
2983         * name-lookup.c (get_cxx_dialect_name): Add cxx23.
2985 2021-03-08  Nathan Sidwell  <nathan@acm.org>
2987         * lex.c (module_token_filter::resume): Ignore module-decls inside
2988         header-unit.
2989         * parser.c (cp_parser_module_declaration): Reject in header-unit.
2991 2021-03-08  Nathan Sidwell  <nathan@acm.org>
2993         PR c++/99285
2994         * cp-tree.h (match_mergeable_specialization)
2995         (add_mergeable_specialization): Adjust parms.
2996         * module.cc (trees_in::decl_value): Adjust
2997         add_mergeable_specialization calls.
2998         (trees_out::key_mergeable): Adjust match_mergeable_specialization
2999         calls.
3000         (specialization_add): Likewise.
3001         * pt.c (match_mergeable_specialization): Do not insert.
3002         (add_mergeable_specialization): Add to hash table here.
3004 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3005             Jakub Jelinek  <jakub@redhat.com>
3007         PR c++/99287
3008         * constexpr.c (cxx_eval_increment_expression): Pass lval when
3009         evaluating the MODIFY_EXPR, and update 'mod' with the result of
3010         this evaluation.  Check *non_constant_p afterwards.  For prefix
3011         ops, just return 'mod'.
3013 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3014             Jakub Jelinek  <jakub@redhat.com>
3016         PR c++/96330
3017         * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3018         variable 'fn' to 'tmpl'.  Handle a variable template-id by
3019         calling lookup_template_variable.
3021 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3023         PR c++/99365
3024         * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3025         outer_targs to do_auto_deduction.
3026         (placeholder_type_constraint_dependent_p): Define.
3027         (do_auto_deduction): When processing_template_decl != 0
3028         and context is adc_unify and we have constraints, pretend the
3029         constraints are satisfied instead of punting.  Otherwise don't
3030         punt unless placeholder_type_constraint_dependent_p holds.
3031         Add some clarifying sanity checks.  Add a hack to add missing
3032         outermost template levels to outer_args before checking
3033         satisfaction.  Don't substitute outer_targs into type if it's
3034         already been done.
3036 2021-03-05  Marek Polacek  <polacek@redhat.com>
3038         PR c++/99374
3039         * call.c (standard_conversion): When converting pointers to
3040         member, don't return NULL when the bases are equivalent but
3041         incomplete.
3043 2021-03-05  Marek Polacek  <polacek@redhat.com>
3045         PR c++/99120
3046         * name-lookup.c (check_local_shadow): Check if the type of decl
3047         is non-null before checking TYPE_PTR*.
3049 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3051         PR c++/99245
3052         * module.cc (module_state::write_cluster): Relax binding assert.
3054 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3056         PR c++/99377
3057         * pt.c (instantiate_decl): Call set_instantiating_module.
3059 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3061         PR c++/98118
3062         * coroutines.cc (build_co_await): Use type_build_ctor_call()
3063         to determine cases when a CTOR needs to be built.
3064         (flatten_await_stmt): Likewise.
3065         (morph_fn_to_coro): Likewise.
3067 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3069         PR c++/95616
3070         * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3071         (coro_diagnose_throwing_final_aw_expr): New helper.
3072         (build_co_await): Diagnose throwing final await expression
3073         components.
3074         (build_init_or_final_await): Diagnose a throwing promise
3075         final_suspend() call.
3077 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3079         PR c++/95615
3080         * coroutines.cc (struct param_info): Track parameter copies that need
3081         a DTOR.
3082         (coro_get_frame_dtor): New helper function factored from build_actor().
3083         (build_actor_fn): Use coro_get_frame_dtor().
3084         (morph_fn_to_coro): Track parameters that need DTORs on exception,
3085         likewise the frame promise and the return object.  On exception, run the
3086         DTORs for these, destroy the frame and then rethrow the exception.
3088 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3090         PR c++/99389
3091         * pt.c (instantiate_class_template_1): Set instantiating module
3092         here.
3094 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
3096         PR c/99137
3097         * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3099 2021-03-04  Jakub Jelinek  <jakub@redhat.com>
3101         PR c++/88146
3102         PR c++/99362
3103         * cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
3104         comment.
3106 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3108         PR c++/99170
3109         * module.cc (class uintset): Delete.
3110         (typedef attached_map_t): A hash map.
3111         (attached_table): Use attached_map_t.  Adjust uses ...
3112         (trees_out::decl_value, trees_in::decl_value): ... here ...
3113         (trees_out::key_mergeable): ... here ...
3114         (trees_in::key_mergeable): ... here ...
3115         (maybe_attach_decl): ... here ...
3116         (direct_import): ... and here.
3118 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3120         PR c++/99170
3121         * cp-tree.h
3122         * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3123         rename.
3124         * module.cc (class pending_key): New.
3125         (default_hash_traits<pending_key>): New specialization.
3126         (pending_map_t): New typedef.
3127         (pending_table): Replace old table.
3128         (trees_out::lang_decl_bools): Adjust.
3129         (trees_in::lang_decl_bools): Adjust.
3130         (trees_in::install_entity): Drop pending member and specialization
3131         handling.
3132         (find_pending_key): New.
3133         (depset::hash::fiund_dependencies): Use it.
3134         (pendset_lazy_load): Delete.
3135         (module_state::write_cluster): Don't count pendings here.  Bye
3136         Duff's device-like thing.
3137         (module_state::write_pendings): Reimplement.
3138         (module_state::read_pendings): Reimplement.
3139         (lazy_specializations_p): Delete.
3140         (module_state::write): Adjust write_pendings call.
3141         (lazy_load_pendings): New.
3142         (lazy_load_specializations): Delete.
3143         (lazy_load_members): Delete.
3144         (init_modules): Adjust.
3145         * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3146         not lazy_load_members.
3147         (note_pending_specializations): Delete.
3148         (load_pending_specializations): Delete.
3149         * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3150         (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3151         (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3152         (note_pending_specializations): Delete.
3153         (load_pending_specializations): Delete.
3154         * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3155         lazy_load_specializations.
3156         (instantiate_template_class_1): Likewise.
3157         (instantiate_decl): Call lazy_load_pendings.
3158         * typeck.c (complete_type): Likewise.
3160 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3162         PR c++/99170
3163         * module.cc (post_load_decls): New.
3164         (lazy_snum, recursive_lazy): Move earlier.
3165         (module_state::read_cluster): Push cloning onto post_load_decls.
3166         (post_load_processing): New.  Do the cloning here.
3167         (module_state::read_inits): Call post_load_processing.
3168         (module_state::read_language): Likewise.
3169         (lazy_load_binding, lazy_load_specializations): Likewise
3170         (lazy_load_members): Likewise
3172 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3174         PR c++/99170
3175         * module.cc (trees_out::decl_value): Stream specialization keys
3176         after decl.
3177         (trees_in::decl_value): Stream them back and insert after
3178         completing the decl.
3179         (trees_out::key_mergeable): Drop some streaming here ...
3180         (trees_in::key_mergeable): ... and here.  Don't insert into
3181         specialization tables.
3183 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3185         * constraint.cc (struct sat_info): Document the different
3186         meanings of noisy() and diagnose_unsatisfaction_p() during
3187         satisfaction and requires-expression evaluation.
3188         (tsubst_valid_expression_requirement): Take a sat_info instead
3189         of a subst_info.  Perform the substitution quietly first.  Fold
3190         in error-replaying code from diagnose_valid_expression.
3191         (tsubst_simple_requirement): Take a sat_info instead of a
3192         subst_info.
3193         (tsubst_type_requirement_1): New.  Fold in error-replaying code
3194         from diagnose_valid_type.
3195         (tsubst_type_requirement): Use the above.  Take a sat_info
3196         instead of a subst_info.
3197         (tsubst_compound_requirement): Likewise.  Fold in
3198         error-replaying code from diagnose_compound_requirement.
3199         (tsubst_nested_requirement): Take a sat_info instead of a
3200         subst_info.  Fold in error-replaying code from
3201         diagnose_nested_requirement.
3202         (tsubst_requirement): Take a sat_info instead of a subst_info.
3203         (tsubst_requires_expr): Split into two versions, one that takes
3204         a sat_info argument and another that takes a complain and
3205         in_decl argument.  Remove outdated documentation.  Document the
3206         effects of the sat_info argument.  Don't short-circuit
3207         processing of requirements when diagnosing unsatisfaction,
3208         mirroring diagnose_requires_expr.
3209         (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3210         assert, and se the three-parameter version of tsubst_requires_expr.
3211         (diagnose_trait_expr): Make static.  Take a template argument
3212         vector instead of a parameter mapping.
3213         (diagnose_valid_expression): Remove.
3214         (diagnose_valid_type): Remove.
3215         (diagnose_simple_requirement): Remove.
3216         (diagnose_compound_requirement): Remove.
3217         (diagnose_type_requirement): Remove.
3218         (diagnose_nested_requirement): Remove.
3219         (diagnose_requirement): Remove.
3220         (diagnose_requires_expr): Remove.
3221         (diagnose_atomic_constraint): Take a sat_info instead of a
3222         subst_info.  Adjust call to diagnose_trait_expr.  Call
3223         tsubst_requires_expr instead of diagnose_requires_expr.
3224         (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3225         and just always call constraint_satisfaction_value.
3227 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3229         * constexpr.c (cxx_eval_call_expression): Adjust call to
3230         evaluate_concept_check.
3231         (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3232         evaluate_requires_expression instead of
3233         satisfy_constraint_expression.
3234         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3235         * constraint.cc (struct sat_info): Adjust comment about which
3236         satisfaction entrypoints use noisy-unsat.
3237         (normalize_template_requirements): Remove (and adjust callers
3238         appropriately).
3239         (normalize_nontemplate_requirements): Likewise.
3240         (tsubst_nested_requirement): Use constraint_satisfaction_value
3241         instead of satisfy_constraint_expression, which'll do the
3242         noisy replaying of ill-formed quiet satisfaction for us.
3243         (decl_satisfied_cache): Adjust comment.
3244         (satisfy_constraint): Rename to ...
3245         (satisfy_normalized_constraints): ... this.
3246         (satisfy_associated_constraints): Remove (and make its
3247         callers check for dependent arguments).
3248         (satisfy_constraint_expression): Rename to ...
3249         (satisfy_nondeclaration_constraints): ... this.  Assert that
3250         'args' is empty when 't' is a concept-id.  Removing handling
3251         bare constraint-expressions, and handle REQUIRES_EXPRs
3252         specially.  Adjust comment accordingly.
3253         (satisfy_declaration_constraints): Assert in the two-parameter
3254         version that 't' is not a TEMPLATE_DECL.  Adjust following
3255         removal of normalize_(non)?template_requirements and
3256         satisfy_asociated_constraints.
3257         (constraint_satisfaction_value): Combine the two- and
3258         three-parameter versions in the natural way.
3259         (constraints_satisfied_p): Combine the one- and two-parameter
3260         versions in the natural way.  Improve documentation.
3261         (evaluate_requires_expr): Define.
3262         (evaluate_concept_check): Remove 'complain' parameter.  Use
3263         constraint_satisfaction_value instead of
3264         satisfy_constraint_expression.
3265         (diagnose_nested_requirement): Adjust following renaming of
3266         satisfy_constraint_expression.
3267         (diagnose_constraints): Handle REQUIRES_EXPR by going through
3268         diagnose_requires_expr directly instead of treating it as a
3269         constraint-expression.  Improve documentation.
3270         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3271         to evaluate_concept_check.
3272         <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3273         constraints_satisfied_p.
3274         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3275         * cp-tree.h (evaluate_requires_expr): Declare.
3276         (evaluate_concept_check): Remove tsubst_flag_t parameter.
3277         (satisfy_constraint_expression): Remove declaration.
3278         (constraints_satisfied_p): Remove one-parameter declaration.
3279         Add a default argument to the two-parameter declaration.
3280         * cvt.c (convert_to_void): Adjust call to
3281         evaluate_concept_check.
3283 2021-03-03  Jakub Jelinek  <jakub@redhat.com>
3285         PR c++/82959
3286         * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3287         and COMPOUND_EXPR.
3289 2021-03-03  Marek Polacek  <polacek@redhat.com>
3291         PR c++/97034
3292         PR c++/99009
3293         * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3294         (maybe_aggr_guide): Use the original template type where needed.  In
3295         a class member template, partially instantiate the result of
3296         collect_ctor_idx_types.
3297         (do_class_deduction): Defer the deduction until the enclosing
3298         scope is non-dependent.
3300 2021-03-03  Jason Merrill  <jason@redhat.com>
3302         PR c++/95675
3303         * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3304         if it didn't get one before.
3306 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3308         PR c++/99344
3309         * module.cc (trees_out::decl_node): Small refactor.
3310         (depset::hash::add_binding_entity): Return true on meeting an
3311         import.  Set namespace's import here.
3312         (module_state:write_namespaces): Inform of purview too.
3313         (module_state:read_namespaces): Adjust.
3314         * name-lookup.c (implicitly_export_namespace): Delete.
3315         (do_pushdecl): Don't call it.
3316         (push_namespace): Likewise, set purview.
3317         (add_imported_namespace): Reorder parms.
3318         * name-lookup.h (add_imported_namespace): Alter param ordering.
3320 2021-03-02  Martin Sebor  <msebor@redhat.com>
3322         PR c++/99251
3323         * class.c (build_base_path): Call build_if_nonnull.
3324         * cp-tree.h (build_if_nonnull): Declare.
3325         * rtti.c (ifnonnull): Rename...
3326         (build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
3327         (build_dynamic_cast_1): Adjust to name change.
3329 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3331         PR c++/96443
3332         PR c++/96960
3333         * constraint.cc (type_deducible_p): Don't substitute into the
3334         constraints, and instead just pass 'args' to do_auto_deduction
3335         as the outer template arguments.
3336         (tsubst_parameter_mapping): Remove confused code for handling
3337         placeholder type arguments.
3338         (normalize_placeholder_type_constraint): Define.
3339         (satisfy_constraint_expression): Use it to handle placeholder
3340         'auto' types.
3341         * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3342         (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3343         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3344         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3345         (make_constrained_placeholder_type): Set
3346         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3347         (do_auto_deduction): Clarify comments about the outer_targs
3348         parameter.  Rework satisfaction of a placeholder type constraint
3349         to pass in the complete set of template arguments directly to
3350         constraints_satisfied_p.
3351         (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3352         instead.  Also rebuild the the constraint info on the new auto.
3354 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3356         * constraint.cc (build_parameter_mapping): Rely on the caller to
3357         determine the in-scope template parameters.
3358         (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3359         to the two-parameter constructor.  In the two-parameter
3360         constructor, fold in the definition of make_context, set
3361         initial_parms appropriately, and don't set the now-removed
3362         orig_decl member.
3363         (norm_info::make_context): Remove, now that its only use is
3364         inlined into the caller.
3365         (norm_info::update_context): Adjust call to
3366         build_parameter_mapping to pass in the relevant set of in-scope
3367         template parameters.
3368         (norm_info::ctx_parms): Define this member function.
3369         (norm_info::context): Initialize to NULL_TREE.
3370         (norm_info::orig_decl): Remove this data member.
3371         (norm_info::initial_parms): Define this data member.
3372         (normalize_atom): Adjust call to build_parameter_mapping to pass
3373         in the relevant set of in-scope template parameters.  Use
3374         info.initial_parms instead of info.orig_decl.
3375         (normalize_constraint_expression): Take a norm_info object
3376         instead of a bool.  Cache the result of normalization.
3377         (tsubst_nested_requirement): Call satisfy_constraint_expression
3378         instead of satisfy_constraint, so that we normalize on demand.
3379         (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3380         Adjust call to normalize_constraint_expression.
3381         (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3382         to current_template_parms.
3383         (diagnose_nested_requirements): Go through
3384         satisfy_constraint_expression, as with tsubst_nested_requirement.
3386 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3388         * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3389         arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3390         started with a TYPE_ARGUMENT_PACK.
3391         (finish_requires_expr): Don't set DECL_CONTEXT and
3392         CONSTRAINT_VAR_P on each of the introduced parameters here.
3393         * parser.c (cp_parser_requirement_parameter_list): Instead set
3394         these fields earlier, here.
3395         * pt.c (do_auto_deduction): Canonicalize the result of
3396         do_auto_deduction.  Pass 'complain' to finish_decltype_type.
3398 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3400         * constraint.cc (tsubst_simple_requirement): Just return
3401         boolean_true_node on success.
3402         (tsubst_type_requirement): Likewise.
3403         (tsubst_compound_requirement): Likewise.
3404         (tsubst_nested_requirement): Likewise.
3405         (tsubst_requirement_body): Remove.
3406         (check_constaint_variables): Rename to ...
3407         (check_constraint_variables): ... this.
3408         (tsubst_constraint_variables): Adjust.
3409         (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3411 2021-03-01  Nathan Sidwell  <nathan@acm.org>
3413         PR c++/99294
3414         * class.c (fixup_type_variants): Propagate mode, precision,
3415         alignment & emptiness.
3416         * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3417         (trees_in::tree_node): Rematerialize alignment here.
3419 2021-02-27  Jason Merrill  <jason@redhat.com>
3421         PR c++/90333
3422         * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3423         between () and ->.
3425 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3427         * parser.c (cp_parser_lambda_declarator_opt): Implement
3428         P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3429         for -std={c,gnu}++2b or with pedwarn in earlier versions.
3431 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3433         PR c++/95451
3434         * lambda.c (is_lambda_ignored_entity): Before checking for
3435         LAMBDA_FUNCTION_P, use OVL_FIRST.  Drop FUNCTION_DECL check.
3437 2021-02-26  Jason Merrill  <jason@redhat.com>
3439         PR c++/98810
3440         * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3441         to a class non-type template argument that needs it.
3443 2021-02-26  Patrick Palka  <ppalka@redhat.com>
3445         PR c++/98990
3446         * pt.c (splice_late_return_type): Rebuild the entire return type
3447         if we have to adjust the level of an auto within.
3448         (type_uses_auto): Adjust call to find_type_usage.
3449         * type-utils.h (find_type_usage): Revert r10-6571 change that
3450         made this function return a pointer to the auto node.
3452 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3454         PR c++/99213
3455         PR c++/94521
3456         * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3457         TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3459 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3461         PR c++/99103
3462         * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3463         (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3465 2021-02-25  Marek Polacek  <polacek@redhat.com>
3467         DR 1312
3468         PR c++/99176
3469         * constexpr.c (is_std_construct_at): New overload.
3470         (is_std_allocator_allocate): New overload.
3471         (cxx_eval_call_expression): Use the new overloads.
3472         (cxx_eval_constant_expression): Reject casting
3473         from void * as per DR 1312.  Don't check can_convert.
3475 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3477         PR c++/97587
3478         * coroutines.cc (struct param_info): Track rvalue refs.
3479         (morph_fn_to_coro): Track rvalue refs, and call the promise
3480         CTOR with the frame copy of passed parms.
3482 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3484         PR c++/95822
3485         * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3486         set throwing_cleanup marker.
3488 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3490         PR c++/99166
3491         * module.cc (module_state::inform_cmi_p): Renamed field.
3492         (module_state::do_import): Adjust.
3493         (init_modules, finish_module_processing): Likewise.
3494         (handle_module_option): Likewise.
3496 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3498         PR c++/98318
3499         * mapper-client.cc (module_client::open_module_client): Fix typo
3500         of fd init.
3502 2021-02-24  Nathan Sidwell  <nathan@acm.org>
3504         PR c++/98718
3505         * module.cc (ool): New indirection vector.
3506         (loc_spans::maybe_propagate): Location is not optional.
3507         (loc_spans::open): Likewise.  Assert monotonically advancing.
3508         (module_for_ordinary_loc): Use ool indirection vector.
3509         (module_state::write_prepare_maps): Do not count empty macro
3510         expansions.  Elide empty spans.
3511         (module_state::write_macro_maps): Skip empty expansions.
3512         (ool_cmp): New qsort comparator.
3513         (module_state::write): Create and destroy ool vector.
3514         (name_pending_imports): Fix dump push/pop.
3515         (preprocess_module): Likewise.  Add more dumping.
3516         (preprocessed_module): Likewise.
3518 2021-02-24  Iain Sandoe  <iain@sandoe.co.uk>
3520         PR c++/96251
3521         * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3522         error reporting when instantiating for a constexpr.
3524 2021-02-23  Nathan Sidwell  <nathan@acm.org>
3526         PR c++/99208
3527         * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3528         identity.
3530 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3532         PR c++/95468
3533         * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3534         over from tsubst_copy.
3536 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3538         * pt.c (instantiation_dependent_expression_p): Check
3539         processing_template_decl before calling
3540         potential_constant_expression.
3542 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3544         PR c++/99174
3545         * module.cc (struct module_state): Add visited_p flag.
3546         (name_pending_imports): Use it to avoid duplicate requests.
3547         (preprocess_module): Don't read preprocessor state if we failed to
3548         load a module's config.
3550 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3552         PR c++/99153
3553         * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3554         to common-path.
3555         * module.cc (set_defining_module): Add assert.
3557 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3559         PR c++/98741
3560         * module.cc (pending_imports): New.
3561         (declare_module): Adjust test condition.
3562         (name_pending_imports): New.
3563         (preprocess_module): Reimplement using pending_imports.
3564         (preprocessed_module): Move name-getting to name_pending_imports.
3565         * name-lookup.c (append_imported_binding_slot): Assert module
3566         ordering is increasing.
3568 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3570         * module.cc (note_cmis): New.
3571         (struct module_state): Add inform_read_p bit.
3572         (module_state::do_import): Inform of CMI location, if enabled.
3573         (init_modules): Canonicalize note_cmis entries.
3574         (handle_module_option): Handle -flang-info-module-read=FOO.
3576 2021-02-19  Jason Merrill  <jason@redhat.com>
3578         PR c++/96926
3579         * call.c (perfect_conversion_p): Limit rvalueness
3580         test to reference bindings.
3582 2021-02-19  Jason Merrill  <jason@redhat.com>
3584         PR c++/96926
3585         * call.c (perfect_conversion_p): New.
3586         (perfect_candidate_p): New.
3587         (add_candidates): Ignore templates after a perfect non-template.
3589 2021-02-18  Nathan Sidwell  <nathan@acm.org>
3591         PR c++/99023
3592         * module.cc (canonicalize_header_name): Use
3593         cpp_probe_header_unit.
3594         (maybe_translate_include): Fix note_includes comparison.
3595         (init_modules): Fix note_includes string termination.
3597 2021-02-18  Jakub Jelinek  <jakub@redhat.com>
3599         PR c++/99132
3600         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3601         cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3602         for immediate function calls.
3604 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3606         PR c++/99023
3607         * module.cc (struct macro_export): Add GTY markers.
3608         (macro_exports): Likewise, us a va_gc Vector.
3610 2021-02-17  Jakub Jelinek  <jakub@redhat.com>
3612         PR sanitizer/99106
3613         * init.c (build_zero_init_1): For flexible array members just return
3614         NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3615         ARRAY_TYPE.
3617 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3619         PR c++/99116
3620         * name-lookup.c (do_pushdecl): Don't peek under template_parm
3621         bindings here ...
3622         (set_identifier_type_value_with_scope): ... or here.
3623         (do_pushtag): Only set_identifier_type_value_with_scope at
3624         non-class template parm scope, and use parent scope.
3626 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3628         PR c++/99071
3629         * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3630         pointer.
3632 2021-02-17  Patrick Palka  <ppalka@redhat.com>
3634         PR debug/96997
3635         PR c++/94034
3636         * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3638 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3640         * module.cc (module_state::write_cluster): Check bindings for
3641         imported using-decls.
3643 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3645         PR c++/99040
3646         * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3647         for new namespace-scope entities.
3648         (module_state::read_cluster): Don't call add_module_decl here.
3649         * name-lookup.h (add_module_decl): Rename to ...
3650         (add_module_namespace_decl): ... this.
3651         * name-lookup.c (newbinding_bookkeeping): Move into ...
3652         (do_pushdecl): ... here.  Its only remaining caller.
3653         (add_module_decl): Rename to ...
3654         (add_module_namespace_decl): ... here.  Add checking-assert for
3655         circularity. Don't call newbinding_bookkeeping, just extern_c
3656         checking and incomplete var checking.
3658 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3660         PR c++/99039
3661         PR c++/99040
3662         * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3663         (global_type_node): Delete.
3664         (IDENTIFIER_TYPE_VALUE): Delete.
3665         (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3666         (get_type_value): Delete.
3667         * name-lookup.h (identifier_type_value): Delete.
3668         * name-lookup.c (check_module_override): Don't
3669         SET_IDENTIFIER_TYPE_VALUE here.
3670         (do_pushdecl): Nor here.
3671         (identifier_type_value_1, identifier_type_value): Delete.
3672         (set_identifier_type_value_with_scope): Only
3673         SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3674         (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3675         (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3676         * call.c (check_dtor_name): Use lookup_name.
3677         * decl.c (cxx_init_decl_processing): Drop global_type_node.
3678         * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3679         here.
3680         * init.c (get_type_value): Delete.
3681         * pt.c (instantiate_class_template_1): Don't call pushtag or
3682         SET_IDENTIFIER_TYPE_VALUE here.
3683         (tsubst): Assert never an identifier.
3684         (dependent_type_p): Drop global_type_node assert.
3685         * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3686         to determine ctorness.
3688 2021-02-12  Jakub Jelinek  <jakub@redhat.com>
3690         PR c++/97742
3691         * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3692         CPP_EOF.
3694 2021-02-12  Jason Merrill  <jason@redhat.com>
3696         PR c++/97246
3697         PR c++/94546
3698         * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3699         (register_parameter_specializations): Not here.
3701 2021-02-11  Marek Polacek  <polacek@redhat.com>
3703         PR c++/95888
3704         * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3705         for the partial instantiation.
3707 2021-02-11  Jakub Jelinek  <jakub@redhat.com>
3709         PR c++/99033
3710         * init.c (build_zero_init_1): Handle zero initialiation of
3711         flexible array members like initialization of [0] arrays.
3712         Use integer_minus_onep instead of comparison to integer_minus_one_node
3713         and integer_zerop instead of comparison against size_zero_node.
3714         Formatting fixes.
3716 2021-02-11  Marek Polacek  <polacek@redhat.com>
3718         PR c++/99063
3719         * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3721 2021-02-11  Patrick Palka  <ppalka@redhat.com>
3723         PR c++/97582
3724         * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3725         lookup result by discarding it if the first element is a
3726         class-scope declaration, otherwise return it.
3727         (push_operator_bindings): Handle an ambiguous lookup result by
3728         doing push_local_binding on each element in the list.
3730 2021-02-11  Marek Polacek  <polacek@redhat.com>
3732         * parser.c (cp_parser_selection_statement): Use vec_free.
3734 2021-02-10  Jakub Jelinek  <jakub@redhat.com>
3736         PR c++/98988
3737         PR c++/99031
3738         * constexpr.c: Include cgraph.h.
3739         (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3740         heap artificial vars.
3741         (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3742         heap artificial vars.
3744 2021-02-10  Nathan Sidwell  <nathan@acm.org>
3746         PR c++/99030
3747         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3748         answer if there's no local specialization.
3750 2021-02-09  Nathan Sidwell  <nathan@acm.org>
3752         PR c++/98944
3753         * module.cc (module_state::is_rooted): Rename to ...
3754         (module_state::has_location): ... here.  Adjust callers.
3755         (module_state::read_partitions): Adjust validity check.
3756         Don't overwrite a known location.
3758 2021-02-09  Jason Merrill  <jason@redhat.com>
3760         PR c++/96905
3761         * pt.c (mark_decl_instantiated): Exit early if consteval.
3763 2021-02-09  Jason Merrill  <jason@redhat.com>
3765         PR c++/98326
3766         PR c++/20408
3767         * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3768         parm.
3770 2021-02-09  Jason Merrill  <jason@redhat.com>
3772         PR c++/98994
3773         PR c++/97566
3774         * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3775         RECORD_TYPE.
3777 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3779         * decl.c (start_cleanup_fn): Push function into
3780         namespace.
3782 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3784         PR c++/98531
3785         * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3786         * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3787         from rtti.c, add default namespace arg.
3788         (check_redeclaration_exception_specification): Allow a lazy
3789         builtin's eh spec to differ from an lready-declared user
3790         declaration.
3791         (declare_global_var): Use push/pop_abi_namespace.
3792         (get_atexit_node): Push the fndecl into a namespace.
3793         * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3794         decl.c.
3796 2021-02-08  Marek Polacek  <polacek@redhat.com>
3798         * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3800 2021-02-05  Marek Polacek  <polacek@redhat.com>
3802         PR c++/98947
3803         * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3804         on arg2/arg3.
3805         * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3806         issuing the -Wvolatile warning.  Only set TREE_THIS_VOLATILE if
3807         a warning was emitted.
3809 2021-02-05  Marek Polacek  <polacek@redhat.com>
3811         PR c++/96462
3812         * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3814 2021-02-05  Jakub Jelinek  <jakub@redhat.com>
3816         PR c++/97878
3817         * decl.c (check_array_initializer): For structured bindings, require
3818         the array type to be complete.
3820 2021-02-04  Jason Merrill  <jason@redhat.com>
3822         PR c++/98717
3823         * constraint.cc (build_concept_check_arguments): Remove assert.
3824         (build_concept_check): Allow empty args.
3826 2021-02-04  Tom Greenslade (thomgree)  <thomgree@cisco.com>
3828         PR c++/90926
3829         * call.c (can_convert_array): Extend to handle all valid aggregate
3830         initializers of an array; including by string literals, not just by
3831         brace-init-list.
3832         (build_aggr_conv): Call can_convert_array more often, not just in
3833         brace-init-list case.
3834         * typeck2.c (array_string_literal_compatible_p): New function.
3835         (digest_init_r): call array_string_literal_compatible_p
3836         * cp-tree.h: (array_string_literal_compatible_p): Declare.
3838 2021-02-04  Jason Merrill  <jason@redhat.com>
3840         PR c++/98802
3841         * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3843 2021-02-04  Jason Merrill  <jason@redhat.com>
3845         PR c++/95192
3846         * pt.c (tsubst_attribute): Handle error.
3847         (apply_late_template_attributes): Return false on error.
3848         (tsubst_function_decl): Check its return value.
3849         (tsubst_decl): Likewise.
3850         (push_template_decl): Assert current_template_parms.
3851         (tsubst_template_decl): Set current_template_parms.
3853 2021-02-03  Marek Polacek  <polacek@redhat.com>
3855         PR c++/98951
3856         * call.c (struct z_candidate): Mark rewritten and reversed as const.
3857         (struct NonPublicField): Mark operator() as const.
3858         (struct NonTrivialField): Likewise.
3860 2021-02-03  Jason Merrill  <jason@redhat.com>
3862         PR c++/98926
3863         PR c++/98570
3864         * pt.c (spec_hasher::equal): Set processing_template_decl.
3865         * Make-lang.in (check-g++-strict-gc): Add --param
3866         hash-table-verification-limit=10000.
3868 2021-02-03  Marek Polacek  <polacek@redhat.com>
3870         PR c++/98899
3871         * parser.c (cp_parser_class_specifier_1): Use any possible
3872         DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
3873         (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
3874         * pt.c (tsubst_exception_specification): Stash new_specs into
3875         DEFPARSE_INSTANTIATIONS.
3876         * tree.c (fixup_deferred_exception_variants): Use
3877         UNPARSED_NOEXCEPT_SPEC_P.
3879 2021-02-02  Jason Merrill  <jason@redhat.com>
3881         PR c++/98929
3882         PR c++/96199
3883         * error.c (dump_expr): Ignore dummy object.
3884         * pt.c (tsubst_baselink): Handle dependent scope.
3886 2021-02-01  Patrick Palka  <ppalka@redhat.com>
3888         PR c++/98295
3889         * constexpr.c (cxx_eval_array_reference): Also set
3890         new_ctx.object when setting new_ctx.ctor.
3892 2021-02-01  Marek Polacek  <polacek@redhat.com>
3894         PR c++/98355
3895         * parser.c (cp_parser_has_attribute_expression): Use
3896         uses_template_parms instead of type_dependent_expression_p.
3898 2021-02-01  Jason Merrill  <jason@redhat.com>
3900         PR c++/98570
3901         * cp-tree.h: Declare it.
3902         * pt.c (comparing_dependent_aliases): New flag.
3903         (template_args_equal, spec_hasher::equal): Set it.
3904         (dependent_alias_template_spec_p): Assert that we don't
3905         get non-types other than error_mark_node.
3906         (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
3907         on complex alias specializations.  Set TYPE_DEPENDENT_P here.
3908         (tsubst_decl): Not here.
3909         * module.cc (module_state::read_cluster): Set
3910         comparing_dependent_aliases instead of
3911         comparing_specializations.
3912         * tree.c (cp_tree_equal): Remove comparing_specializations
3913         module handling.
3914         * typeck.c (structural_comptypes): Adjust.
3915         (comptypes): Remove comparing_specializations handling.
3917 2021-01-29  Nathan Sidwell  <nathan@acm.org>
3919         PR c++/98843
3920         * module.cc (module_state_config): Add num_entities field.
3921         (module_state::read_entities): The entity_ary span is
3922         already allocated.
3923         (module_state::write_config): Write num_entities.
3924         (module_state::read_config): Read num_entities.
3925         (module_state::write): Set config's num_entities.
3926         (module_state::read_initial): Allocate the entity ary
3927         span here.
3928         (module_state::read_language): Do not set entity_lwm
3929         here.
3931 2021-01-29  Marek Polacek  <polacek@redhat.com>
3933         PR c++/96137
3934         * parser.c (cp_parser_class_name): If parser->scope is
3935         error_mark_node, return it, otherwise continue.
3937 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
3939         PR c++/98841
3940         * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
3942 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
3944         PR c++/33661
3945         PR c++/98847
3946         * decl.c (cp_finish_decl): For register vars with asmspec in templates
3947         call set_user_assembler_name and set DECL_HARD_REGISTER.
3948         * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
3949         pass asmspec_tree to cp_finish_decl.
3951 2021-01-28  Nathan Sidwell  <nathan@acm.org>
3953         PR c++/98770
3954         * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3955         check order.
3956         (trees_in::decl_value): Do typedef frobbing only when installing
3957         a new typedef, adjust is_matching_decl call.  Swap is_typedef
3958         & TYPE_NAME check.
3959         (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3960         names and deal with typedef checking.
3962 2021-01-27  Jason Merrill  <jason@redhat.com>
3964         PR c++/97874
3965         * name-lookup.c (lookup_using_decl): Clean up handling
3966         of dependency and inherited constructors.
3967         (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
3968         * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
3970 2021-01-26  Jason Merrill  <jason@redhat.com>
3972         PR c++/97474
3973         * call.c (type_passed_as): Don't mark invisiref restrict.
3975 2021-01-26  Jason Merrill  <jason@redhat.com>
3977         PR c++/97566
3978         PR c++/98463
3979         * class.c (layout_class_type): An empty field gets size 0.
3980         (is_empty_field): New.
3981         (check_bases): Check it.
3982         * cp-tree.h (is_empty_field): Declare it.
3983         * constexpr.c (cxx_eval_store_expression): Check it.
3984         (cx_check_missing_mem_inits): Likewise.
3985         * init.c (perform_member_init): Likewise.
3986         * typeck2.c (process_init_constructor_record): Likewise.
3988 2021-01-25  Martin Sebor  <msebor@redhat.com>
3990         PR c++/98646
3991         * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
3993 2021-01-25  Jason Merrill  <jason@redhat.com>
3995         PR c++/98463
3996         * constexpr.c (get_or_insert_ctor_field): Add check.
3997         (cxx_eval_store_expression): Handle discontinuity of refs.
3999 2021-01-23  Anthony Sharp  <anthonysharp15@gmail.com>
4001         * call.c (complain_about_access): Altered function.
4002         * cp-tree.h (complain_about_access): Changed parameters of function.
4003         (get_parent_with_private_access): Declared new function.
4004         * search.c (get_parent_with_private_access): Defined new function.
4005         * semantics.c (enforce_access): Modified function.
4006         * typeck.c (complain_about_unrecognized_member): Updated function
4007         arguments in complain_about_access.
4009 2021-01-23  Patrick Palka  <ppalka@redhat.com>
4011         PR c++/97399
4012         * cp-tree.h (shared_member_p): Adjust declaration.
4013         * parser.c (cp_parser_init_declarator): If the storage class
4014         specifier is sc_static, pass true for static_p to
4015         cp_parser_declarator.
4016         (cp_parser_direct_declarator): Don't do inject_this_parm when
4017         the declarator is a friend.
4018         * search.c (shared_member_p): Change return type to bool and
4019         adjust function body accordingly.  Return false for a dependent
4020         USING_DECL instead of aborting.
4021         * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4022         even when type-dependent.
4024 2021-01-22  Marek Polacek  <polacek@redhat.com>
4026         PR c++/96623
4027         * parser.c (inject_parm_decls): Remove a redundant assignment.
4028         (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4029         before calling inject_parm_decls.
4031 2021-01-22  Jason Merrill  <jason@redhat.com>
4033         PR c++/98744
4034         * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4036 2021-01-22  Jakub Jelinek  <jakub@redhat.com>
4038         PR sanitizer/95693
4039         * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4040         return build_zero_cst for reference types.
4041         * typeck2.c (process_init_constructor_record): Instead call
4042         build_zero_cst here during error recovery instead of build_zero_init.
4044 2021-01-22  Marek Polacek  <polacek@redhat.com>
4046         PR c++/98545
4047         * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4048         warnings regardless of abi_version_at_least.
4049         (write_expression): When the expression is a dependent name
4050         and an operator name, write "on" before writing its name.
4052 2021-01-22  Marek Polacek  <polacek@redhat.com>
4054         PR c++/97966
4055         * pt.c (instantiate_class_template_1): Instantiate members
4056         marked with attribute used only after we're done instantiating
4057         the class.
4059 2021-01-21  Patrick Palka  <ppalka@redhat.com>
4061         PR c++/71879
4062         * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4063         sentinel at the start of the function.  Remove a now-redundant
4064         manual adjustment of cp_unevaluated_operand.
4066 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4068         PR c++/98624
4069         * module.cc (depset::hash::find_dependencies): Add
4070         module arg.
4071         (trees_out::core_vals): Check state before calling
4072         write_location.
4073         (sort_cluster, module_state::write): Adjust
4074         find_dependencies call.
4076 2021-01-21  Jakub Jelinek  <jakub@redhat.com>
4078         PR c++/98672
4079         * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4080         (check_for_return_continue): Also look for BREAK_STMT.  Handle
4081         SWITCH_STMT by ignoring break_stmt from its body.
4082         (potential_constant_expression_1) <case FOR_STMT>,
4083         <case WHILE_STMT>: If the condition isn't constant true, check if
4084         the loop body can contain a return stmt.
4085         <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4086         <case IF_STMT>: If recursion with tf_none is successful,
4087         merge *jump_target from the branches - returns with highest priority,
4088         breaks or continues lower.  If then branch is potentially constant and
4089         doesn't return, check the else branch if it could return, break or
4090         continue.
4092 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4094         PR c++/98530
4095         * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4097 2021-01-20  Nathan Sidwell  <nathan@acm.org>
4099         * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4100         signed type.
4102 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4104         PR c++/95434
4105         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4106         CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4107         adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4109 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4111         PR c++/82613
4112         * parser.c (cp_parser_class_head): Defer access checking when
4113         parsing the base-clause until all bases are seen and attached
4114         to the class type.
4115         * pt.c (instantiate_class_template): Likewise when substituting
4116         into dependent bases.
4118 2021-01-20  Jakub Jelinek  <jakub@redhat.com>
4120         PR c++/98742
4121         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4122         error_operand_p, remove clause without further checking.  Check
4123         for non-NULL TYPE_NAME.
4125 2021-01-19  Marek Polacek  <polacek@redhat.com>
4127         PR c++/98659
4128         * pt.c (maybe_instantiate_noexcept): Return false if FN is
4129         error_mark_node.
4131 2021-01-19  Marek Polacek  <polacek@redhat.com>
4133         PR c++/98687
4134         * name-lookup.c (push_using_decl_bindings): New, broken out of...
4135         (finish_nonmember_using_decl): ...here.
4136         * name-lookup.h (push_using_decl_bindings): Update declaration.
4137         * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4139 2021-01-19  Patrick Palka  <ppalka@redhat.com>
4141         PR c++/41437
4142         PR c++/58993
4143         * search.c (friend_accessible_p): If scope is a hidden friend
4144         defined inside a dependent class, consider access from the
4145         class.
4146         * parser.c (cp_parser_late_parsing_for_member): Don't push a
4147         dk_no_check access state.
4149 2021-01-19  Marek Polacek  <polacek@redhat.com>
4151         PR c++/98333
4152         * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4153         of NSDMIs before late-parsing of noexcept-specifiers.
4155 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4157         * module.cc (identifier): Merge overloads.
4159 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4161         PR c++/98624
4162         * module.cc (trees_out::write_location): Make static.
4164 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
4166         * parser.c (cp_parser_omp_clause_detach): New.
4167         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4168         (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4169         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4170         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4171         Prevent use of detach with mergeable and overriding the data sharing
4172         mode of the event handle.
4174 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4176         PR c++/98538
4177         * tree.c (cp_build_qualified_type_real): Propagate an array's
4178         dependentness to the copy, if known.
4180 2021-01-15  Jason Merrill  <jason@redhat.com>
4182         PR c++/98642
4183         * call.c (unsafe_return_slot_p): Return int.
4184         (init_by_return_slot_p): Split out from...
4185         (unsafe_copy_elision_p): ...here.
4186         (unsafe_copy_elision_p_opt): New name for old meaning.
4187         (build_over_call): Adjust.
4188         (make_safe_copy_elision): New.
4189         * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4190         list-initialization.
4191         * cp-tree.h: Adjust.
4193 2021-01-15  Jason Merrill  <jason@redhat.com>
4195         * call.c (base_ctor_for, make_base_init_ok): New.
4196         (build_over_call): Use make_base_init_ok.
4198 2021-01-15  Jason Merrill  <jason@redhat.com>
4200         PR c++/63707
4201         * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4202         if we got a CONSTRUCTOR.
4204 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4206         PR c++/98591
4207         * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4209 2021-01-14  Jason Merrill  <jason@redhat.com>
4211         * typeck2.c (process_init_constructor_record): Use fldtype
4212         variable consistently.
4214 2021-01-14  Nathan Sidwell  <nathan@acm.org>
4216         PR c++/98372
4217         * tree.c (cp_tree_equal): Correct map_context logic.
4219 2021-01-13  Marek Polacek  <polacek@redhat.com>
4221         PR c++/98231
4222         * name-lookup.c (push_using_decl_bindings): New.
4223         * name-lookup.h (push_using_decl_bindings): Declare.
4224         * pt.c (tsubst_expr): Call push_using_decl_bindings.
4226 2021-01-13  Nathan Sidwell  <nathan@acm.org>
4228         PR c++/98626
4229         * module.cc (module_add_import_initializers):  Pass a
4230         zero-element argument vector.
4232 2021-01-12  Patrick Palka  <ppalka@redhat.com>
4234         PR c++/98611
4235         * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4236         the template of a CTAD placeholder.
4238 2021-01-12  Marek Polacek  <polacek@redhat.com>
4240         PR c++/98620
4241         * typeck2.c (process_init_constructor_record): Don't emit
4242         -Wmissing-field-initializers warnings in unevaluated contexts.
4244 2021-01-11  Jakub Jelinek  <jakub@redhat.com>
4246         PR c++/98481
4247         * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4248         for types.
4249         (mark_abi_tags_r): Likewise.
4250         * decl2.c (min_vis_r): Likewise.
4251         * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4252         typedefs.
4254 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4256         PR c++/98551
4257         * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4258         instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4260 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4262         PR c++/98515
4263         * semantics.c (check_accessibility_of_qualified_id): Punt if
4264         we're checking access of a scoped non-static member inside a
4265         class template.
4267 2021-01-07  Jakub Jelinek  <jakub@redhat.com>
4269         PR c++/98329
4270         * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4271         cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4272         its location.
4273         (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4275 2021-01-07  Marek Polacek  <polacek@redhat.com>
4277         PR c++/98441
4278         * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4279         !late_return_type block.
4281 2021-01-07  Jason Merrill  <jason@redhat.com>
4283         * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4284         (cxx_eval_store_expression): Add comment.
4286 2021-01-07  Jason Merrill  <jason@redhat.com>
4288         * call.c (has_next): Factor out from...
4289         (next_conversion): ...here.
4290         (strip_standard_conversion): And here.
4291         (is_subseq): And here.
4292         (build_conv): Check it.
4293         (standard_conversion): Don't call build_conv
4294         for ck_identity.
4296 2021-01-06  Martin Sebor  <msebor@redhat.com>
4298         PR c++/95768
4299         * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4301 2021-01-05  Patrick Palka  <ppalka@redhat.com>
4303         * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4304         the type of the NTTP, substitute into the type again.  If the
4305         type is still dependent, don't unify the NTTP.
4307 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4309         * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4310         $(CODYLIB) after $(BACKEND).
4312 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4314         PR c++/98469
4315         * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4316         Punt if lval is true.
4317         * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4318         the result if it has a class type.
4320 2021-01-05  Marek Polacek  <polacek@redhat.com>
4322         PR c++/82099
4323         * pt.c (resolve_overloaded_unification): Call
4324         maybe_instantiate_noexcept after instantiating the function
4325         decl.
4327 2021-01-05  Nathan Sidwell  <nathan@acm.org>
4329         * parser.c (cp_parser_module_declaration): Alter diagnostic
4330         text to say where is permissable.
4332 2021-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4334         PR c++/98316
4335         * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4337 2021-01-02  Jan Hubicka  <jh@suse.cz>
4339         * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4340         * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4341         * tree.c (cp_tree_c_finish_parsing): New function.
4343 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
4345         * ChangeLog-2020: Rotate ChangeLog.  New file.
4348 Copyright (C) 2021 Free Software Foundation, Inc.
4350 Copying and distribution of this file, with or without modification,
4351 are permitted in any medium without royalty provided the copyright
4352 notice and this notice are preserved.