Daily bump.
[official-gcc.git] / gcc / cp / ChangeLog
blob13559e2ae1456ac89647e188bdea5a936929a4cd
1 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
3         PR c++/101765
4         * coroutines.cc (register_local_var_uses): Emit a sorry if
5         we encounter a VLA in the coroutine local variables.
7 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
9         PR c++/99710
10         * coroutines.cc (await_statement_walker): Report an error if
11         an await expression is found in a handler body.
13 2021-10-03  John Eivind Helset  <jehelset@gmail.com>
15         PR c++/100673
16         * coroutines.cc (build_co_await): Guard against NULL
17         await_suspend types.
19 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
21         PR c++/101133
22         * coroutines.cc (build_co_await): Mark co_await_expr trees
23         with TREE_SIDE_EFFECTS, also mark any containing expression.
24         (finish_co_await_expr): Mark type-dependent co_await_expr
25         trees with TREE_SIDE_EFFECTS.
27 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
29         PR c++/99575
30         * coroutines.cc (build_co_await): Strip NOPs from
31         candidate awaiter expressions before testing to see
32         if they need a temporary.
34 2021-10-01  Martin Sebor  <msebor@redhat.com>
36         PR c/102103
37         * typeck.c (warn_for_null_address): Enhance.
38         (cp_build_binary_op): Call it also for member pointers.
40 2021-10-01  qingzhe huang  <nickhuang99@hotmail.com>
42         PR c++/101783
43         * tree.c (cp_build_qualified_type_real): Exclude typedef from
44         error.
46 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
47             Richard Biener  <rguenther@suse.de>
49         PR sanitizer/102515
50         * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
51         for division even for SANITIZE_SI_OVERFLOW.
53 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
55         * parser.c (cp_parser_omp_clause_order): Set
56         OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
58 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
60         PR c++/102496
61         * name-lookup.c (push_local_extern_decl_alias): Return early even for
62         tls vars with non-dependent type when processing_template_decl.  For
63         CP_DECL_THREAD_LOCAL_P vars call set_decl_tls_model on alias.
65 2021-09-30  Patrick Palka  <ppalka@redhat.com>
67         PR c++/102535
68         * method.c (is_xible_helper): Don't exit early for multi-arg
69         ctors in C++20.
71 2021-09-30  Patrick Palka  <ppalka@redhat.com>
73         * parser.c (cp_parser_trait_expr): Call nreverse on the reversed
74         list of trailing arguments.
76 2021-09-30  Patrick Palka  <ppalka@redhat.com>
78         PR c++/95567
79         * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields.
81 2021-09-28  Patrick Palka  <ppalka@redhat.com>
83         PR c++/99909
84         * pt.c (coerce_template_template_parms): Keep
85         processing_template_decl set around the call to unify as well.
87 2021-09-28  Iain Sandoe  <iain@sandoe.co.uk>
89         PR c++/102454
90         * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
91         unnamed function params.
92         (morph_fn_to_coro): Do not try to set a guard variable for param
93         DTORs in the ramp, unless we have exceptions active.
95 2021-09-27  Patrick Palka  <ppalka@redhat.com>
97         PR c++/102479
98         * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
99         Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
100         rewritten ttp.
101         (alias_ctad_tweaks): Set current_template_parms accordingly.
103 2021-09-23  Michel Morin  <mimomorin@gmail.com>
105         * parser.c (cp_keyword_starts_decl_specifier_p): Do not
106         handle RID_ATTRIBUTE.
107         (cp_parser_constructor_declarator_p): Remove now-redundant
108         checks.
109         (cp_parser_lambda_declarator_opt): Likewise.
111 2021-09-23  Michel Morin  <mimomorin@gmail.com>
113         PR c++/77565
114         * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
115         decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
117 2021-09-23  Patrick Palka  <ppalka@redhat.com>
119         * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
120         a TEMPLATE_DECL.  Dump the DECL_TEMPLATE_INFO rather than just
121         printing its pointer value.
123 2021-09-23  Jakub Jelinek  <jakub@redhat.com>
125         PR c++/102413
126         * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
127         is not followed by a balanced token sequence starting with open paren.
129 2021-09-22  Patrick Palka  <ppalka@redhat.com>
131         DR 2446
132         PR c++/102412
133         * constexpr.c (cxx_eval_constant_expression)
134         <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
135         instead of processing_template_decl.
136         * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
137         Return true only if any_dependent_template_arguments_p.
138         (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
139         <case TEMPLATE_ID_EXPR>: Likewise.
141 2021-09-22  Jakub Jelinek  <jakub@redhat.com>
143         * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
144         modifiers.
145         * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
146         semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
147         * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
148         also OMP_CLAUSE_ALLOCATE_ALIGN.
150 2021-09-22  Barrett Adair  <barrettellisadair@gmail.com>
152         * pt.c (find_parm_usage_r): New walk_tree callback to find func
153         parms.
154         (any_template_arguments_need_structural_equality_p): New special
155         case.
157 2021-09-21  wangpc  <pc.wang@linux.alibaba.com>
159         * decl.c (start_decl_1): Move verify_type_context to ...
160         (cp_finish_decl): ... to here.
162 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
164         * parser.c (cp_parser_omp_clause_order): Parse unconstrained
165         and reproducible modifiers.
166         (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
168 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
170         * parser.c (cp_parser_omp_clause_default): Handle private and
171         firstprivate arguments, adjust diagnostics on unknown argument.
172         * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
174 2021-09-18  Jason Merrill  <jason@redhat.com>
176         * cp-tree.h (dependentish_scope_p): Declare.
177         * pt.c (dependentish_scope_p): New.
178         * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
179         for lookup of a type in a dependent object.
180         (cp_parser_template_id): Handle TYPENAME_TYPE.
181         (cp_parser_template_name): If we're looking for a type,
182         a name followed by < names a template.
184 2021-09-18  Jason Merrill  <jason@redhat.com>
186         * cp-tree.h: Fix typo in LANG_FLAG list.
188 2021-09-17  Jakub Jelinek  <jakub@redhat.com>
190         * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
191         * parser.c (cp_parser_omp_atomic): Update function comment for
192         OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
193         weak clauses.
194         * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
195         them, handle COND_EXPRs.
196         * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
197         finish_omp_atomic can now produce.
199 2021-09-16  Patrick Palka  <ppalka@redhat.com>
201         PR c++/98486
202         * constraint.cc (get_normalized_constraints_from_decl): Always
203         look up constraints using the most general template.
204         * decl.c (grokdeclarator): Set constraints on a static data
205         member template.
206         * pt.c (determine_specialization): Check constraints on a
207         variable template.
209 2021-09-16  Iain Sandoe  <iain@sandoe.co.uk>
211         * coroutines.cc (await_statement_walker): Code cleanups.
213 2021-09-16  Jason Merrill  <jason@redhat.com>
215         * constexpr.c (cxx_eval_outermost_constant_expr): Use
216         protected_set_expr_location.
218 2021-09-15  Patrick Palka  <ppalka@redhat.com>
220         PR c++/101904
221         * call.c (build_user_type_conversion_1): Add tf_conv to complain.
222         (add_candidates): When in a SFINAE context, instead of adding a
223         candidate to bad_fns just mark it unviable.
225 2021-09-15  Jason Merrill  <jason@redhat.com>
227         * cp-tree.h (parsing_function_declarator): Declare.
228         * name-lookup.c (set_decl_context_in_fn): Use it.
229         * parser.c (cp_parser_direct_declarator): Use it.
230         (parsing_function_declarator): New.
232 2021-09-15  Jakub Jelinek  <jakub@redhat.com>
234         PR c++/88578
235         PR c++/102295
236         * typeck2.c (split_nonconstant_init_1): Don't throw away empty
237         initializers of flexible array members if they have non-zero type
238         size.
240 2021-09-15  Patrick Palka  <ppalka@redhat.com>
242         PR c++/102050
243         * decl.c (grok_special_member_properties): Set
244         TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
245         and TYPE_HAS_LIST_CTOR independently from each other.
247 2021-09-15  Jason Merrill  <jason@redhat.com>
249         * decl.c (cxx_init_decl_processing): Only warn about odd
250         interference sizes if they were specified with --param.
252 2021-09-15  Jason Merrill  <jason@redhat.com>
254         PR c++/48396
255         * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
256         (type_info_ptr_type): Remove.
257         * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
258         (typeid_ok_p): Check for null const_type_info_type_node.
259         (type_info_ptr_type, get_void_tinfo_ptr): New fns.
260         (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
261         (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
262         (get_tinfo_desc): Use const_ptr_type_node.
264 2021-09-15  Jason Merrill  <jason@redhat.com>
266         * parser.c (cp_parser_template_name): Move object type.
267         (cp_parser_pre_parsed_nested_name_specifier): Likewise.
269 2021-09-15  Jason Merrill  <jason@redhat.com>
271         * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
272         a declarator.
274 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
276         * coroutines.cc (struct param_info): Add copy_var.
277         (build_actor_fn): Use simplified param references.
278         (register_param_uses): Likewise.
279         (rewrite_param_uses): Likewise.
280         (analyze_fn_parms): New function.
281         (coro_rewrite_function_body): Add proxies for the fn
282         parameters to the outer bind scope of the rewritten code.
283         (morph_fn_to_coro): Use simplified version of param ref.
285 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
287         * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
288         coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
289         coro_self_handle_id, coro_actor_continue_id,
290         coro_frame_i_a_r_c_id): New.
291         (coro_init_identifiers): Initialize new name identifiers.
292         (coro_promise_type_found_p): Use pre-built identifiers.
293         (struct await_xform_data): Remove unused fields.
294         (transform_await_expr): Delete code that is now unused.
295         (build_actor_fn): Simplify interface, use pre-built identifiers and
296         remove transforms that are no longer needed.
297         (build_destroy_fn): Use revised field names.
298         (register_local_var_uses): Use pre-built identifiers.
299         (coro_rewrite_function_body): Simplify interface, use pre-built
300         identifiers.  Generate proxy vars in the outer bind expr scope for the
301         implementation state that we wish to expose.
302         (morph_fn_to_coro): Adjust comments for new variable names, use pre-
303         built identifiers.  Remove unused code to generate frame entries for
304         the implementation state.  Adjust call for build_actor_fn.
306 2021-09-14  Patrick Palka  <ppalka@redhat.com>
308         PR c++/102163
309         * constexpr.c (cxx_eval_call_expression): After evaluating a
310         subobject constructor call for an empty union member, produce a
311         side effect that makes sure the member gets activated.
313 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
315         PR c++/102295
316         * decl.c (layout_var_decl): For aggregates ending with a flexible
317         array member, add the size of the initializer for that member to
318         DECL_SIZE and DECL_SIZE_UNIT.
320 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
322         PR c++/102305
323         * method.c (is_xible_helper): Call complete_type on to.
325 2021-09-14  Jason Merrill  <jason@redhat.com>
327         * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
328         size is smaller than maxalign.
330 2021-09-13  Jason Merrill  <jason@redhat.com>
332         * constexpr.c (maybe_warn_about_constant_value):
333         Complain about std::hardware_destructive_interference_size.
334         (cxx_eval_constant_expression): Call it.
335         * decl.c (cxx_init_decl_processing): Check
336         --param *-interference-size values.
338 2021-09-13  Patrick Palka  <ppalka@redhat.com>
340         PR c++/101764
341         * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
342         macro.
343         * pt.c (has_extra_args_mechanism_p): New function.
344         (find_parameter_pack_data::found_extra_args_tree_p): New data
345         member.
346         (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
347         appropriately.
348         (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
349         ppd.found_extra_args_tree_p.
350         (use_pack_expansion_extra_args_p): Return true if there were
351         unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
352         (tsubst_pack_expansion): Pass the pack expansion to
353         use_pack_expansion_extra_args_p.
355 2021-09-10  Jakub Jelinek  <jakub@redhat.com>
357         * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
358         and acq_rel/acquire clauses on update.
359         * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
361 2021-09-08  Richard Biener  <rguenther@suse.de>
363         PR c++/102228
364         * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
365         * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
366         place on invalid code.
367         * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
368         access.
369         * module.cc (trees_in::read_class_def): Likewise.  Reconstruct
370         ANON_AGGR_TYPE_FIELD.
371         * semantics.c (finish_member_declaration): Populate
372         ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
373         * typeck.c (lookup_anon_field): Remove DFS search and return
374         ANON_AGGR_TYPE_FIELD directly.
376 2021-09-07  Jakub Jelinek  <jakub@redhat.com>
378         PR c++/100495
379         * constexpr.c (maybe_save_constexpr_fundef): Save body even for
380         constexpr deleting dtors.
381         (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
382         deleting dtors.
384 2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>
386         * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
387         directive.
388         * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
390 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
392         * coroutines.cc (register_local_var_uses): Do not mangle
393         frame entries for the outermost scope.  Record the outer
394         scope as nesting depth 0.
396 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
398         * coroutines.cc (coro_build_artificial_var): New.
399         (build_actor_fn): Use var builder, rename vars to use
400         implementation namespace.
401         (coro_rewrite_function_body): Likewise.
402         (morph_fn_to_coro): Likewise.
404 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
406         * coroutines.cc (transform_local_var_uses): Record
407         frame offset expressions as DECL_VALUE_EXPRs instead of
408         rewriting them.
410 2021-09-03  Patrick Palka  <ppalka@redhat.com>
412         PR c++/101904
413         * call.c (build_this_conversion): New function, split out from
414         add_function_candidate.
415         (add_function_candidate): New parameter shortcut_bad_convs.
416         Document it.  Use build_this_conversion.  Stop at the first bad
417         argument conversion when shortcut_bad_convs is true.
418         (add_template_candidate_real): New parameter shortcut_bad_convs.
419         Use build_this_conversion to check the 'this' conversion before
420         attempting deduction.  When the rejection reason code is
421         rr_bad_arg_conversion, pass -1 instead of 0 as the viable
422         parameter to add_candidate.  Pass 'convs' to add_candidate.
423         (add_template_candidate): New parameter shortcut_bad_convs.
424         (add_template_conv_candidate): Pass false as shortcut_bad_convs
425         to add_template_candidate_real.
426         (add_candidates): Prefer to shortcut bad conversions during
427         overload resolution under the assumption that we'll eventually
428         see a strictly viable candidate.  If this assumption turns out
429         to be false, re-process the non-strictly viable candidates
430         without shortcutting those bad conversions.
432 2021-09-03  Jason Merrill  <jason@redhat.com>
434         * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
435         we decide not to instantiate.
437 2021-09-03  Jakub Jelinek  <jakub@redhat.com>
439         PR target/102024
440         * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
441         instead of writing to DECL_FIELD_ABI_IGNORED.
442         (layout_class_type): Likewise.  In the place where zero-width
443         bitfields used to be removed, use
444         SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
446 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
448         * call.c (build_over_call): Handle unavailable state in addition to
449         deprecation.
450         * class.c (type_build_ctor_call): Likewise.
451         (type_build_dtor_call): Likewise.
452         * cp-tree.h: Rename cp_warn_deprecated_use to
453         cp_handle_deprecated_or_unavailable.
454         * decl.c (duplicate_decls): Merge unavailability.
455         (grokdeclarator): Handle unavailability in addition to deprecation.
456         (type_is_unavailable): New.
457         (grokparms): Handle unavailability in addition to deprecation.
458         * decl.h (enum deprecated_states): Add
459         UNAVAILABLE_DEPRECATED_SUPPRESS.
460         * decl2.c (cplus_decl_attributes): Propagate unavailability to
461         templates.
462         (cp_warn_deprecated_use): Rename to ...
463         (cp_handle_deprecated_or_unavailable): ... this and amend to handle
464         the unavailable case. It remains a warning in the case of deprecation
465         but becomes an error in the case of unavailability.
466         (cp_warn_deprecated_use_scopes): Handle unavailability.
467         (mark_used): Likewise.
468         * parser.c (cp_parser_template_name): Likewise.
469         (cp_parser_template_argument): Likewise.
470         (cp_parser_parameter_declaration_list): Likewise.
471         * typeck.c (build_class_member_access_expr): Likewise.
472         (finish_class_member_access_expr): Likewise.
473         * typeck2.c (build_functional_cast_1): Likewise.
475 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
477         * coroutines.cc (build_actor_fn): Add begin/finish clauses
478         to the initial test in the actor function.
480 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
482         * coroutines.cc (await_statement_walker): Use build_stmt and
483         add_stmt instead of build1 and finish_expr_stmt.
485 2021-08-31  Jason Merrill  <jason@redhat.com>
487         * coroutines.cc (flatten_await_stmt): Fix copyo.
488         * decl.c (reshape_init_class): Simplify.
489         * module.cc (module_state::read_language): Add null check.
490         * parser.c (build_range_temp): Avoid type_uses_auto.
491         (cp_parser_class_specifier_1): Add null check.
493 2021-08-31  Patrick Palka  <ppalka@redhat.com>
495         PR c++/12672
496         * call.c (rejection_reason::call_varargs_p): Rename this
497         previously unused member to ...
498         (rejection_reason::least_p): ... this.
499         (arity_rejection): Add least_p parameter.
500         (add_template_candidate_real): When there are explicit
501         template arguments, check that the arity of the call agrees with
502         the arity of the function before attempting deduction.
503         (print_arity_information): Add least_p parameter.
504         (print_z_candidate): Adjust call to print_arity_information.
506 2021-08-31  Martin Sebor  <msebor@redhat.com>
508         * parser.c (cp_parser_selection_statement): Use direct initialization
509         instead of copy.
511 2021-08-31  Jason Merrill  <jason@redhat.com>
513         * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
515 2021-08-31  Jason Merrill  <jason@redhat.com>
517         PR c++/92193
518         * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
519         * constexpr.c (cxx_eval_call_expression): Set it.
520         * pt.c (neglectable_inst_p): Check it.
522 2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>
524         * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
525         and 'ancestor' in 'target device' clauses.
526         * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
527         evaluate to '1' if 'ancestor' is used.
529 2021-08-30  Jason Merrill  <jason@redhat.com>
531         PR c++/96286
532         * cp-tree.h (struct lang_type): Add erroneous bit-field.
533         (CLASSTYPE_ERRONEOUS): New.
534         * pt.c (limit_bad_template_recursion): Check it.
535         (instantiate_class_template_1): Set it.
537 2021-08-30  Jason Merrill  <jason@redhat.com>
539         * constexpr.c (cxx_eval_outermost_constant_expr): Copy
540         expr location to result.
542 2021-08-30  Jason Merrill  <jason@redhat.com>
544         PR c++/101460
545         * cp-tree.h (cxx_constant_value_sfinae): Declare.
546         * constexpr.c (cxx_constant_value_sfinae): New.
547         * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
548         (tsubst_copy_and_build) [CALL_EXPR]: Call
549         maybe_fold_fn_template_args.
551 2021-08-30  Jason Merrill  <jason@redhat.com>
553         * parser.c (cp_parser_simple_requirement): Warn about missing
554         requires.
556 2021-08-27  Jason Merrill  <jason@redhat.com>
558         * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
559         a dependent pointer.
561 2021-08-25  Andrew Pinski  <apinski@marvell.com>
563         PR c++/66590
564         * cp-objcp-common.c (cxx_block_may_fallthru): Handle
565         CLEANUP_STMT for the case which will be try/finally.
567 2021-08-25  Jakub Jelinek  <jakub@redhat.com>
569         PR c++/102019
570         * init.c (build_value_init_noctor): Ignore unnamed zero-width
571         bitfields.
573 2021-08-23  Jakub Jelinek  <jakub@redhat.com>
575         * parser.c (cp_parser_omp_clause_num_tasks,
576         cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
578 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
580         * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
581         PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
582         (cp_parser_omp_error): New function.
583         (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
585 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
587         * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
588         comma at the end of list.  Don't parse closing paren here...
589         (cp_parser_omp_clause_depend): ... but here instead.
591 2021-08-19  Patrick Palka  <ppalka@redhat.com>
593         PR c++/101803
594         * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
596 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
598         * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
599         and optionally consume token if current token is CPP_EOF,
600         CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
602 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
604         * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
605         instead of cp_parser_skip_to_pragma_eol.
607 2021-08-18  Patrick Palka  <ppalka@redhat.com>
609         PR c++/101344
610         PR c++/101803
611         * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
612         * decl.c (reshape_init_r): Set it.
613         * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
614         iff CONSTRUCTOR_BRACES_ELIDED_P.
616 2021-08-18  Patrick Palka  <ppalka@redhat.com>
618         PR c++/101883
619         * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
620         do_auto_deduction.
622 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
624         * parser.c (cp_parser_omp_nothing): New function.
625         (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
627 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
629         * parser.c (cp_parser_omp_ordered): Return true instead of
630         false after emitting errors that the directive is not allowed in
631         pragma_stmt context.
632         (cp_parser_omp_target_update): Likewise.
633         (cp_parser_omp_cancellation_point): Change return type from void to
634         bool, return false if the directive should be ignored in pragma_stmt
635         contexts.
636         (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
637         Change return type from tree to bool, return false if the
638         directive should be ignored in pragma_stmt contexts.
639         (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
640         return their result directly.
641         (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
642         cp_parser_omp_cancellation_point returned.  Return true instead of
643         false after emitting errors that the directive is not allowed in
644         pragma_stmt context.
646 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
648         PR c++/101539
649         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
650         (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
651         (fold_builtin_is_corresponding_member, next_common_initial_seqence,
652         layout_compatible_type_p): Declare.
653         * parser.c (cp_parser_primary_expression): Handle
654         RID_IS_LAYOUT_COMPATIBLE.
655         (cp_parser_trait_expr): Likewise.
656         * cp-objcp-common.c (names_builtin_p): Likewise.
657         * constraint.cc (diagnose_trait_expr): Handle
658         CPTK_IS_LAYOUT_COMPATIBLE.
659         * decl.c (cxx_init_decl_processing): Register
660         __builtin_is_corresponding_member builtin.
661         * constexpr.c (cxx_eval_builtin_function_call): Handle
662         CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
663         * semantics.c (is_corresponding_member_union,
664         is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
665         New functions.
666         (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
667         (finish_trait_expr): Likewise.
668         * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
669         New functions.
670         * cp-gimplify.c (cp_gimplify_expr): Fold
671         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
672         (cp_fold): Likewise.
673         * tree.c (builtin_valid_in_constant_expr_p): Handle
674         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
675         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
676         CPTK_IS_LAYOUT_COMPATIBLE.
677         * class.c (remove_zero_width_bit_fields): Remove.
678         (layout_class_type): Don't call it.
680 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
682         * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
683         (cp_parser_omp_scope): New function.
684         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
685         * pt.c (tsubst_expr): Handle OMP_SCOPE.
687 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
689         * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
690         (cp_parser_omp_clause_filter): New function.
691         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
692         (OMP_MASKED_CLAUSE_MASK): Define.
693         (cp_parser_omp_masked): New function.
694         (cp_parser_omp_parallel): Handle parallel masked.
695         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
696         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
697         * pt.c (tsubst_omp_clauses): Likewise.
698         (tsubst_expr): Handle OMP_MASKED.
700 2021-08-12  Sergei Trofimovich  <siarheit@google.com>
702         PR c++/101219
703         * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
704         to construct ptrmemfunc expression instantiation.
706 2021-08-12  Tobias Burnus  <tobias@codesourcery.com>
708         * parser.c (cp_parser_omp_clause_proc_bind): Accept
709         'primary' as alias for 'master'.
711 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
713         * cp-tree.h (omp_declare_target_attr): New type.
714         (struct saved_scope): Change type of omp_declare_target_attribute
715         from int to vec<omp_declare_target_attr, va_gc> * and move it.
716         * parser.c (cp_parser_omp_declare_target): Instead of
717         incrementing scope_chain->omp_declare_target_attribute, push
718         a struct containing parser->lexer->in_omp_attribute_pragma to
719         the vector.
720         (cp_parser_omp_end_declare_target): Instead of decrementing
721         scope_chain->omp_declare_target_attribute, pop a structure
722         from it.  Diagnose mismatching declare target vs.
723         end declare target syntax.
724         * semantics.c (finish_translation_unit): Use vec_safe_length
725         and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
726         * decl2.c (cplus_decl_attributes): Use vec_safe_length
727         on scope_chain->omp_declare_target_attributes.
729 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
731         * parser.c (cp_parser_lambda_body): Add temp overrides
732         for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
733         (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
734         cp_parser_declaration_statement.
735         (cp_parser_default_argument): Add temp override for
736         parser->omp_attrs_forbidden_p.
737         (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
738         or declare variant in attribute syntax on a declaration immediately
739         following an OpenMP construct in pragma syntax.
741 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
743         PR c++/94162
744         * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
745         or for classes not in std namespace.
747 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
749         * name-lookup.c (finish_using_directive): Diagnose omp::directive
750         or omp::sequence attributes on using-directive.
752 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
754         * parser.c (cp_parser_block_declaration): Call
755         cp_parser_using_directive for C++11 attributes followed by
756         using namespace tokens.
757         (cp_parser_using_directive): Parse C++11 attributes at the start
758         of the directive rather than at the end, only parse GNU attributes
759         at the end.
761 2021-08-12  Patrick Palka  <ppalka@redhat.com>
763         PR c++/101663
764         * constexpr.c (cxx_eval_store_expression): Handle the lval=true
765         case in the early exit code path for empty stores with mismatched
766         types.
768 2021-08-11  Patrick Palka  <ppalka@redhat.com>
770         PR c++/101725
771         DR 2082
772         * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
773         * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
774         operands.
775         * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
776         reject uses of local variables in unevaluated contexts.
777         * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
778         cp_unevaluated_operand.  Use cp_walk_tree directly instead of
779         WALK_SUBTREE to avoid the goto.  Use REQUIRES_EXPR_REQS instead
780         of TREE_OPERAND directly.
782 2021-08-11  Jakub Jelinek  <jakub@redhat.com>
784         PR c++/101786
785         * decl2.c (var_defined_without_dynamic_init): Return true for
786         DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
788 2021-08-11  Patrick Palka  <ppalka@redhat.com>
790         PR c++/79501
791         * parser.c (maybe_adjust_declarator_for_dguide): New, split
792         out from ...
793         (cp_parser_init_declarator): ... here.
794         (cp_parser_member_declaration): Use it.
796 2021-08-11  Patrick Palka  <ppalka@redhat.com>
798         PR c++/89062
799         * parser.c (cp_parser_parameter_declaration_list): Don't call
800         grokdeclarator if cp_parser_error_occurred.
801         (cp_parser_parameter_declaration): Simulate an error if we see
802         the beginning of a CTAD form, i.e. if we see an opening brace
803         after the decl-specifier-seq and the type is a CTAD placeholder.
805 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
807         * parser.c (cp_parser_member_declaration): Move odsd declaration
808         before cp_parser_using_declaration call to avoid errors with
809         GCC 4.8 to 6.
811 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
813         * parser.h (struct cp_omp_declare_simd_data): Remove
814         in_omp_attribute_pragma and clauses members, add loc and attribs.
815         (struct cp_oacc_routine_data): Remove loc member, add clauses
816         member.
817         * parser.c (cp_finalize_omp_declare_simd): New function.
818         (cp_parser_handle_statement_omp_attributes): Mention in
819         function comment the function is used also for
820         attribute-declaration.
821         (cp_parser_handle_directive_omp_attributes): New function.
822         (cp_parser_statement): Don't call
823         cp_parser_handle_statement_omp_attributes if statement doesn't
824         have attribute-specifier-seq at the beginning at all or if
825         if those attributes don't appertain to the statement.
826         (cp_parser_simple_declaration): Call
827         cp_parser_handle_directive_omp_attributes and
828         cp_finalize_omp_declare_simd.
829         (cp_parser_explicit_instantiation): Likewise.
830         (cp_parser_init_declarator): Initialize prefix_attributes
831         only after parsing declarators.
832         (cp_parser_direct_declarator): Call
833         cp_parser_handle_directive_omp_attributes and
834         cp_finalize_omp_declare_simd.
835         (cp_parser_member_declaration): Likewise.
836         (cp_parser_single_declaration): Likewise.
837         (cp_parser_omp_declare_simd): Don't initialize
838         data.in_omp_attribute_pragma, instead initialize
839         data.attribs[0] and data.attribs[1].
840         (cp_finish_omp_declare_variant): Remove
841         in_omp_attribute_pragma argument, instead use
842         parser->lexer->in_omp_attribute_pragma.
843         (cp_parser_late_parsing_omp_declare_simd): Adjust
844         cp_finish_omp_declare_variant caller.  Handle attribute-syntax
845         declare simd/variant.
847 2021-08-06  Tamar Christina  <tamar.christina@arm.com>
849         * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
850         * decl.c (cxx_simulate_enum_decl): Likewise.
852 2021-08-04  Jakub Jelinek  <jakub@redhat.com>
854         PR c++/101759
855         * parser.c (cp_parser_default_argument): Temporarily override
856         parser->omp_declare_simd and parser->oacc_routine to NULL.
858 2021-08-02  Patrick Palka  <ppalka@redhat.com>
860         PR c++/100828
861         * logic.cc (formula::formula): Use emplace_back instead of
862         push_back.
863         (formula::branch): Insert a copy of m_current directly after
864         m_current instead of at the end of the list.
865         (formula::erase): Define.
866         (decompose_formula): Remove.
867         (decompose_antecedents): Remove.
868         (decompose_consequents): Remove.
869         (derive_proofs): Remove.
870         (max_problem_size): Remove.
871         (diagnose_constraint_size): Remove.
872         (subsumes_constraints_nonnull): Rewrite directly in terms of
873         decompose_clause and derive_proof, interleaving decomposition
874         with implication checking.  Remove limit on constraint complexity.
875         Use formula::erase to free the current clause before moving on to
876         the next one.
878 2021-07-31  Jason Merrill  <jason@redhat.com>
880         PR c++/96636
881         * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
882         after error.
884 2021-07-31  Jason Merrill  <jason@redhat.com>
886         * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
887         PACK_EXPANSION_PATTERN.
889 2021-07-31  Jakub Jelinek  <jakub@redhat.com>
891         * parser.c (cp_parser_declaration): Handle OpenMP directives
892         in attribute-declaration.
894 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
896         PR c++/101539
897         * cp-tree.h (enum cp_trait_kind): Add
898         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
899         (enum cp_built_in_function): Add
900         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
901         (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
902         * parser.c (cp_parser_primary_expression): Handle
903         RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
904         (cp_parser_trait_expr): Likewise.
905         * cp-objcp-common.c (names_builtin_p): Likewise.
906         * constraint.cc (diagnose_trait_expr): Handle
907         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
908         * decl.c (cxx_init_decl_processing): Register
909         __builtin_is_pointer_interconvertible_with_class builtin.
910         * constexpr.c (cxx_eval_builtin_function_call): Handle
911         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
912         * semantics.c (pointer_interconvertible_base_of_p,
913         first_nonstatic_data_member_p,
914         fold_builtin_is_pointer_inverconvertible_with_class): New functions.
915         (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
916         (finish_trait_expr): Likewise.  Formatting fix.
917         * cp-gimplify.c (cp_gimplify_expr): Fold
918         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
919         fndecl_built_in_p just once.
920         (cp_fold): Likewise.
921         * tree.c (builtin_valid_in_constant_expr_p): Handle
922         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
923         fndecl_built_in_p just once.
924         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
925         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
927 2021-07-30  Jason Merrill  <jason@redhat.com>
929         * class.c (finish_struct_anon): Improve comment.
930         * decl.c (fixup_anonymous_aggr): Reject anonymous struct
931         with bases.
933 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
935         * parser.c (cp_parser_statement): Rollback attributes not just
936         when std_attrs is non-NULL, but whenever
937         cp_parser_std_attribute_spec_seq parsed any tokens.
939 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
941         PR c++/101582
942         * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
943         declaration.
944         (cp_parser_declaration): Parse empty-declaration and
945         attribute-declaration.
946         (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
948 2021-07-28  Martin Sebor  <msebor@redhat.com>
950         * init.c: Include new header.
952 2021-07-27  Marek Polacek  <polacek@redhat.com>
954         DR 1512
955         PR c++/99701
956         * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
957         a switch.
958         * typeck.c (cp_build_binary_op): Reject ordered comparison
959         of two null pointers.
961 2021-07-26  Jakub Jelinek  <jakub@redhat.com>
963         * parser.h (struct cp_lexer): Add orphan_p member.
964         * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
965         upon restart from CPP_PRAGMA handling.  Fix up condition when a lexer
966         should be destroyed and adjust saved_tokens if it records tokens from
967         the to be destroyed lexer.
968         (cp_parser_omp_section_scan): New function.
969         (cp_parser_omp_scan_loop_body): Use it.  If
970         parser->lexer->in_omp_attribute_pragma, allow optional comma
971         after scan.
972         (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
974 2021-07-23  Jakub Jelinek  <jakub@redhat.com>
976         * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
977         * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
978         mixing of attribute and pragma syntax directives when seeing
979         omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
980         directives are followed by OpenMP pragma.
981         (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
982         the cp_parser_handle_statement_omp_attributes call.
983         (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
984         if true, set parser->omp_attrs_forbidden_p.
985         (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
986         false as disallow_omp_attrs to cp_parser_omp_structured_block.
987         (cp_parser_omp_parallel, cp_parser_omp_task): Set
988         parser->omp_attrs_forbidden_p.
990 2021-07-21  Thomas Schwinge  <thomas@codesourcery.com>
991             Joseph Myers  <joseph@codesourcery.com>
992             Cesar Philippidis  <cesar@codesourcery.com>
994         * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
995         (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
996         (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
997         * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
998         * semantics.c (finish_omp_clauses): Likewise.
1000 2021-07-21  Jakub Jelinek  <jakub@redhat.com>
1002         PR c++/101516
1003         * semantics.c (finish_omp_reduction_clause): Also call
1004         complete_type_or_else and return true if it fails.
1006 2021-07-19  Iain Sandoe  <iain@sandoe.co.uk>
1008         PR c++/95520
1009         * coroutines.cc (struct coroutine_info): Add fields for
1010         actor and destroy function decls.
1011         (to_ramp): New.
1012         (coro_get_ramp_function): New.
1013         (coro_get_actor_function): New.
1014         (coro_get_destroy_function): New.
1015         (act_des_fn): Set up mapping between ramp, actor and
1016         destroy functions.
1017         (morph_fn_to_coro): Adjust interface to the builder for
1018         helper function decls.
1019         * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
1020         JOIN_STR): New.
1021         * mangle.c (write_encoding): Handle coroutine helpers.
1022         (write_unqualified_name): Handle lambda coroutine helpers.
1024 2021-07-16  Patrick Palka  <ppalka@redhat.com>
1026         PR c++/101233
1027         * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
1028         substituting DECL_ARGUMENTS.
1030 2021-07-16  Patrick Palka  <ppalka@redhat.com>
1032         DR 960
1033         PR c++/99664
1034         * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
1035         when the return types are references.
1037 2021-07-16  Marek Polacek  <polacek@redhat.com>
1039         * typeck2.c (check_narrowing): Don't suppress the pedantic error
1040         in system headers.
1042 2021-07-15  Jakub Jelinek  <jakub@redhat.com>
1044         PR c++/101443
1045         * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
1046         operands, fold them right away to true or false.
1048 2021-07-15  Jason Merrill  <jason@redhat.com>
1050         PR c++/101095
1051         * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
1052         (cp_tree_size): Remove redundant entries.
1054 2021-07-14  Patrick Palka  <ppalka@redhat.com>
1056         PR c++/88252
1057         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
1058         * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1059         handling.
1060         (redeclare_class_template): Likewise.
1061         (forwarding_reference_p): Define.
1062         (maybe_adjust_types_for_deduction): Use it instead.  Add 'tparms'
1063         parameter.
1064         (unify_one_argument): Pass tparms to
1065         maybe_adjust_types_for_deduction.
1066         (try_one_overload): Likewise.
1067         (unify): Likewise.
1068         (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1069         handling.
1071 2021-07-14  Jason Merrill  <jason@redhat.com>
1073         * class.c (struct find_final_overrider_data): Use auto_vec.
1074         (find_final_overrider): Remove explicit release.
1075         * coroutines.cc (process_conditional): Use auto_vec.
1076         * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
1077         (cp_genericize_tree): Remove explicit release.
1078         * parser.c (cp_parser_objc_at_property_declaration): Use
1079         auto_delete_vec.
1080         * semantics.c (omp_reduction_lookup): Use auto_vec.
1082 2021-07-14  Marek Polacek  <polacek@redhat.com>
1084         PR c++/101371
1085         * constexpr.c (cxx_eval_array_reference): Create a new .object
1086         and .ctor for the non-aggregate non-scalar case too when
1087         value-initializing.
1089 2021-07-12  Patrick Palka  <ppalka@redhat.com>
1091         PR c++/79501
1092         PR c++/100983
1093         * decl.c (grokfndecl): Don't require that deduction guides are
1094         declared at namespace scope.  Check that class-scope deduction
1095         guides have the same access as the member class template.
1096         (grokdeclarator): Pretend class-scope deduction guides are static.
1097         * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1098         deduction guides.
1100 2021-07-10  Patrick Palka  <ppalka@redhat.com>
1102         PR c++/82110
1103         * init.c (build_aggr_init): Return error_mark_node if
1104         expand_aggr_init_1 returns false.
1105         (expand_default_init): Change return type to bool.  Return false
1106         on error, true on success.
1107         (expand_aggr_init_1): Likewise.
1109 2021-07-09  Jason Merrill  <jason@redhat.com>
1111         PR c++/101098
1112         * decl.c (function_requirements_equivalent_p): Only compare
1113         trailing requirements on a specialization.
1115 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1117         * coroutines.cc (build_actor_fn): Move common code to
1118         act_des_fn.
1119         (build_destroy_fn): Likewise.
1120         (act_des_fn): Build the void return here.  Ensure that the
1121         source location matches the original function.
1123 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1125         * coroutines.cc
1126         (coro_rewrite_function_body): Connect the replacement
1127         function block to the block nest correctly.
1129 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1131         PR c++/101181
1132         * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1133         add_extra_args.
1134         * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1135         * pt.c (build_extra_args): Make a copy of args.
1136         (add_extra_args): Add complain/in_decl parameters.  Enable the
1137         code for handling the case where the extra arguments are
1138         dependent.
1139         (tsubst_pack_expansion): Pass complain/in_decl to
1140         add_extra_args.
1141         (tsubst_template_args): Handle missing template arguments.
1142         (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1143         add_extra_args.
1145 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1147         PR c++/101247
1148         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1149         DECL_CONTEXT.
1151 2021-07-08  Martin Sebor  <msebor@redhat.com>
1153         PR bootstrap/101372
1154         * module.cc (identifier): Suppress warning.
1155         (module_state::read_macro_maps): Remove warning suppression.
1156         (module_state::install_macros): Ditto.
1158 2021-07-08  Marek Polacek  <polacek@redhat.com>
1160         PR c++/101087
1161         * cp-tree.h (unevaluated_p): New.
1162         * except.c (check_noexcept_r): Use it.  Don't walk into
1163         unevaluated operands.
1165 2021-07-08  Martin Sebor  <msebor@redhat.com>
1167         PR bootstrap/101374
1168         * module.cc (module_state::read_macro_maps): Temporarily disable
1169         -Warray-bounds.
1170         (module_state::install_macros): Same.
1172 2021-07-06  Martin Sebor  <msebor@redhat.com>
1174         * error.c (cp_printer):  Remove support for %G and %K.
1176 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1178         * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1179         (struct cp_omp_declare_simd_data): Likewise.
1180         * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1181         (omp_identifier): Define.
1182         * parser.c (cp_parser_skip_to_pragma_eol): Handle
1183         in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1184         (cp_parser_require_pragma_eol): Likewise.
1185         (struct cp_omp_attribute_data): New type.
1186         (cp_parser_handle_statement_omp_attributes): New function.
1187         (cp_parser_statement): Handle OpenMP directives in statement's
1188         attribute-specifier-seq.
1189         (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1190         functions.
1191         (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1192         attributes.
1193         (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1194         a comma also before the first clause.
1195         (cp_parser_omp_allocate): Likewise.
1196         (cp_parser_omp_atomic): Likewise.
1197         (cp_parser_omp_depobj): Likewise.
1198         (cp_parser_omp_flush): Likewise.
1199         (cp_parser_omp_ordered): Likewise.
1200         (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1201         into struct cp_omp_declare_simd_data.
1202         (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1203         argument.  If set, allow a comma also before match clause.
1204         (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1205         allow a comma also before the first clause.  Adjust
1206         cp_finish_omp_declare_variant caller.
1207         (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1208         a comma also before the first clause.
1209         (cp_parser_omp_declare_reduction_exprs): Likewise.
1210         (cp_parser_omp_requires): Likewise.
1211         * decl.c (initialize_predefined_identifiers): Initialize
1212         omp_identifier.
1213         * decl2.c (cplus_decl_attributes): Reject omp::directive and
1214         omp::sequence attributes.
1216 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1218         PR c/101297
1219         * parser.c (cp_parser_omp_atomic): Consume comma only if it
1220         appears before a CPP_NAME.
1222 2021-07-02  Patrick Palka  <ppalka@redhat.com>
1224         PR c++/101247
1225         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1226         use common_enclosing_class and to not depend on the TREE_TYPE
1227         of outer levels pointing to the corresponding primary template.
1229 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1231         PR c++/101194
1232         * constexpr.c (cxx_eval_array_reference): When the element type
1233         is an empty type and the corresponding element is omitted, just
1234         return an empty CONSTRUCTOR instead of attempting value
1235         initialization.
1237 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1239         PR c++/96204
1240         * pt.c (finish_template_variable): Pass the partially
1241         instantiated template and its args to instantiate_template.
1242         (instantiate_class_template_1): No need to call
1243         push_nested_class and pop_nested_class around the call to
1244         most_specialized_partial_spec.
1245         (instantiate_template_1): Pass the partially instantiated
1246         template to lookup_template_variable.
1247         (most_specialized_partial_spec):  Use push_access_scope_guard
1248         to set the access scope appropriately.  Use
1249         deferring_access_check_sentinel to force access to get checked
1250         immediately.
1251         (instantiate_decl): Just pass the VAR_DECL to
1252         most_specialized_partial_spec.
1254 2021-06-30  Patrick Palka  <ppalka@redhat.com>
1256         * constraint.cc (get_normalized_constraints_from_decl): Use
1257         push_access_scope_guard instead of push_nested_class_guard.
1258         * cp-tree.h (struct push_nested_class_guard): Replace with ...
1259         (struct push_access_scope_guard): ... this.
1260         * pt.c (push_access_scope): When the argument corresponds to
1261         a class type, push the class instead of its context.
1262         (pop_access_scope): Adjust accordingly.
1264 2021-06-30  Marek Polacek  <polacek@redhat.com>
1266         PR c++/100975
1267         DR 2397
1268         * decl.c (create_array_type_for_decl): Allow array of auto.
1270 2021-06-29  Jason Merrill  <jason@redhat.com>
1272         * pt.c (instantiate_decl): Only consider partial specializations of
1273         actual variable templates.
1275 2021-06-26  Patrick Palka  <ppalka@redhat.com>
1277         PR c++/96204
1278         * pt.c (instantiate_class_template_1): Enter the scope of the
1279         type when calling most_specialized_partial_spec.
1281 2021-06-26  Jason Merrill  <jason@redhat.com>
1283         PR c++/101040
1284         PR c++/97566
1285         * class.c (is_empty_field): Handle null argument.
1286         * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1287         for empty field.
1289 2021-06-26  Marek Polacek  <polacek@redhat.com>
1291         PR c++/100752
1292         * parser.c (cp_parser_declarator): Pass flags down to
1293         cp_parser_declarator.  Also pass static_p/member_p.
1295 2021-06-25  Martin Sebor  <msebor@redhat.com>
1297         * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1298         with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1299         nothing if not necessary.
1300         (set_up_extended_ref_temp): Same.
1301         * class.c (layout_class_type): Same.
1302         * constraint.cc (constraint_satisfaction_value): Same.
1303         * coroutines.cc (finish_co_await_expr): Same.
1304         (finish_co_yield_expr): Same.
1305         (finish_co_return_stmt): Same.
1306         (build_actor_fn): Same.
1307         (coro_rewrite_function_body): Same.
1308         (morph_fn_to_coro): Same.
1309         * cp-gimplify.c (genericize_eh_spec_block): Same.
1310         (gimplify_expr_stmt): Same.
1311         (cp_genericize_r): Same.
1312         (cp_fold): Same.
1313         * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1314         * cvt.c (cp_fold_convert): Same.
1315         (convert_to_void): Same.
1316         * decl.c (wrapup_namespace_globals): Same.
1317         (grokdeclarator): Same.
1318         (finish_function): Same.
1319         (require_deduced_type): Same.
1320         * decl2.c (no_linkage_error): Same.
1321         (c_parse_final_cleanups): Same.
1322         * except.c (expand_end_catch_block): Same.
1323         * init.c (build_new_1): Same.
1324         (build_new): Same.
1325         (build_vec_delete_1): Same.
1326         (build_vec_init): Same.
1327         (build_delete): Same.
1328         * method.c (defaultable_fn_check): Same.
1329         * parser.c (cp_parser_fold_expression): Same.
1330         (cp_parser_primary_expression): Same.
1331         * pt.c (push_tinst_level_loc): Same.
1332         (tsubst_copy): Same.
1333         (tsubst_omp_udr): Same.
1334         (tsubst_copy_and_build): Same.
1335         * rtti.c (build_if_nonnull): Same.
1336         * semantics.c (maybe_convert_cond): Same.
1337         (finish_return_stmt): Same.
1338         (finish_parenthesized_expr): Same.
1339         (cp_check_omp_declare_reduction): Same.
1340         * tree.c (build_cplus_array_type): Same.
1341         * typeck.c (build_ptrmemfunc_access_expr): Same.
1342         (cp_build_indirect_ref_1): Same.
1343         (cp_build_function_call_vec): Same.
1344         (warn_for_null_address): Same.
1345         (cp_build_binary_op): Same.
1346         (unary_complex_lvalue): Same.
1347         (cp_build_modify_expr): Same.
1348         (build_x_modify_expr): Same.
1349         (convert_for_assignment): Same.
1351 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1353         PR c++/98832
1354         * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1356 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1358         PR c++/101182
1359         * constraint.cc (evaluate_requires_expr): Adjust function comment.
1360         * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1361         (cp_fold) <case REQUIRES_EXPR>: ... here.
1363 2021-06-24  Jakub Jelinek  <jakub@redhat.com>
1365         * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1366         C_ORT_OMP for clauses on target construct.
1367         (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1368         (cp_parser_omp_target): For non-combined target add
1369         map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION.  Pass
1370         C_ORT_OMP_TARGET to finish_omp_clauses.
1371         * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1372         for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1373         never present on C_ORT_*DECLARE_SIMD.
1374         (handle_omp_array_sections): Likewise.
1375         (finish_omp_clauses): Likewise.  Handle OMP_CLAUSE_IN_REDUCTION
1376         on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1377         corresponding map clauses.
1378         * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1379         clauses on target construct.
1381 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1383         PR c++/101174
1384         * pt.c (push_access_scope): For artificial deduction guides,
1385         set the access scope to that of the constructor.
1386         (pop_access_scope): Likewise.
1387         (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1389 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1391         PR c++/86439
1392         * call.c (print_error_for_call_failure): Constify 'args' parameter.
1393         (perform_dguide_overload_resolution): Define.
1394         * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1395         * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1396         instead of build_new_function_call.  Don't use tf_decltype or
1397         set cp_unevaluated_operand.  Remove unnecessary NULL_TREE tests.
1399 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1401         PR c++/67302
1402         * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1403         sooner, before the NRVO handling.
1405 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1407         PR c++/80431
1408         * tree.c (bot_replace): Use convert_to_base to build the
1409         conversion to the (morally) virtual base.
1411 2021-06-21  Jakub Jelinek  <jakub@redhat.com>
1413         PR inline-asm/100785
1414         * typeck.c (cxx_mark_addressable): Diagnose trying to make
1415         bit-fields addressable.
1417 2021-06-17  Jason Merrill  <jason@redhat.com>
1419         PR c++/101106
1420         * decl.c (duplicate_decls): Make 'deleted after first declaration'
1421         pedwarn on by default.
1423 2021-06-17  Jason Merrill  <jason@redhat.com>
1425         PR c++/101029
1426         * init.c (build_vec_init): Preserve the type of base.
1428 2021-06-16  Jason Merrill  <jason@redhat.com>
1430         PR c++/101078
1431         PR c++/91706
1432         * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1434 2021-06-15  Robin Dapp  <rdapp@linux.ibm.com>
1436         * decl.c (duplicate_decls): Likewise.
1438 2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
1440         PR c/100913
1441         * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1442         var in the error case.
1444 2021-06-13  Trevor Saunders  <tbsaunde@tbsaunde.org>
1446         * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1447         with range based for.
1448         (cxx_eval_store_expression): Likewise.
1449         (cxx_eval_loop_expr): Likewise.
1450         * decl.c (wrapup_namespace_globals): Likewise.
1451         (cp_finish_decl): Likewise.
1452         (cxx_simulate_enum_decl): Likewise.
1453         * parser.c (cp_parser_postfix_expression): Likewise.
1455 2021-06-12  Jason Merrill  <jason@redhat.com>
1457         PR c++/101029
1458         * init.c (build_vec_init): Shortcut [0] case.
1460 2021-06-12  Jason Merrill  <jason@redhat.com>
1462         * pt.c (lookup_template_class_1): Shortcut current_class_type.
1464 2021-06-11  Patrick Palka  <ppalka@redhat.com>
1466         DR 1227
1467         PR c++/96560
1468         * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1469         TYPE_ARG_TYPES in forward order while short circuiting
1470         appropriately.  Adjust formatting.
1472 2021-06-11  Jakub Jelinek  <jakub@redhat.com>
1474         PR c++/100974
1475         * cp-tree.h (struct saved_scope): Add consteval_if_p
1476         member.  Formatting fix for the discarded_stmt comment.
1477         (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1478         * parser.c (cp_parser_lambda_expression): Temporarily disable
1479         in_consteval_if_p when parsing lambda body.
1480         (cp_parser_selection_statement): Parse consteval if.
1481         * decl.c (struct named_label_entry): Add in_consteval_if member.
1482         (level_for_consteval_if): New function.
1483         (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1484         consteval if.
1485         * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1486         why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1487         for !ctx->manifestly_const_eval.
1488         (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1489         condition as if it was __builtin_is_constant_evaluated call.
1490         (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1491         recurse on both branches.
1492         * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1493         as the else branch.
1494         * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1495         Temporarily set in_consteval_if_p when recursing on
1496         IF_STMT_CONSTEVAL_P then branch.
1497         (tsubst_lambda_expr): Temporarily disable
1498         in_consteval_if_p when instantiating lambda body.
1499         * call.c (immediate_invocation_p): Return false when
1500         in_consteval_if_p.
1502 2021-06-11  Marek Polacek  <polacek@redhat.com>
1504         PR c++/100995
1505         * constexpr.c (maybe_constexpr_fn): New.
1506         * cp-tree.h (maybe_constexpr_fn): Declare.
1507         * semantics.c (find_std_constant_evaluated_r): New.
1508         (maybe_warn_for_constant_evaluated): New.
1509         (finish_if_stmt_cond): Call it.
1511 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1513         PR c++/67829
1514         * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1515         the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1516         a template template parameter, adjust to the
1517         TEMPLATE_TEMPLATE_PARAMETER before falling through.
1519 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1521         PR c++/100946
1522         * constraint.cc (normalize_placeholder_type_constraints): When
1523         normalizing a non-templated return-type-requirement, add a dummy
1524         level to initial_parms.
1526 2021-06-08  Marek Polacek  <polacek@redhat.com>
1528         PR c++/100065
1529         * decl.c (grokdeclarator): Store a value-dependent
1530         explicit-specifier even for deduction guides.
1532 2021-06-08  Jason Merrill  <jason@redhat.com>
1534         * parser.c (cp_parser_string_literal): Adjust diagnostic.
1536 2021-06-08  Jason Merrill  <jason@redhat.com>
1538         PR c++/100963
1539         * call.c (perfect_conversion_p): Check check_narrowing.
1541 2021-06-08  Jason Merrill  <jason@redhat.com>
1543         PR c++/91706
1544         * name-lookup.c (get_class_binding): Keep a BASELINK.
1545         (set_inherited_value_binding_p): Adjust.
1546         * lambda.c (is_lambda_ignored_entity): Adjust.
1547         * pt.c (lookup_template_function): Copy a BASELINK before
1548         modifying it.
1550 2021-06-08  Jason Merrill  <jason@redhat.com>
1552         PR c++/91706
1553         * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1555 2021-06-08  Jason Merrill  <jason@redhat.com>
1557         * module.cc (duplicate_hash::hash): Comment out.
1558         (trees_in::tree_value): Adjust loop counter.
1560 2021-06-08  Jason Merrill  <jason@redhat.com>
1562         PR c++/100102
1563         * init.c (build_offset_ref): Return the BASELINK for a static
1564         member function.
1566 2021-06-07  Patrick Palka  <ppalka@redhat.com>
1568         PR c++/100918
1569         * parser.c (cp_parser_lookup_name): Check access of the lookup
1570         result before we potentially adjust an injected-class-name to
1571         its TEMPLATE_DECL.
1573 2021-06-06  Jakub Jelinek  <jakub@redhat.com>
1575         PR c/100902
1576         * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1577         even when target is combined with other constructs.
1579 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1581         PR c++/100893
1582         * pt.c (convert_template_argument): Strip top-level cv-quals
1583         on the substituted type of a non-type template parameter.
1585 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1587         PR c++/100102
1588         * pt.c (tsubst_function_decl): Remove old code for reducing
1589         args when it has excess levels.
1591 2021-06-04  Jakub Jelinek  <jakub@redhat.com>
1593         PR c++/100872
1594         * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1595         ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1596         to the start.
1598 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1600         PR c++/100592
1601         * decl.c (make_typename_type): After calling
1602         lookup_template_class, adjust the result to its TYPE_NAME and
1603         then consider the tf_keep_type_decl flag.
1605 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1607         PR c++/100862
1608         * pt.c (set_current_access_from_decl): Move to ...
1609         * class.c (set_current_access_from_decl): ... here.
1610         (handle_using_decl): Use it to propagate the access of the
1611         using-enum decl to the copy of the imported enumerator.
1612         * cp-tree.h (set_current_access_from_decl): Declare.
1613         * decl.c (build_enumerator): Simplify using make_temp_override
1614         and set_current_access_from_decl.
1616 2021-06-03  Jakub Jelinek  <jakub@redhat.com>
1618         PR c++/100859
1619         * semantics.c (handle_omp_array_sections_1): For
1620         OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1621         finish_non_static_data_member and allow this as base.
1622         (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1623         after depend only cases.  Let this be diagnosed by !lvalue_p
1624         case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1625         assert.
1626         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1628 2021-06-02  Jason Merrill  <jason@redhat.com>
1630         PR c++/100838
1631         * call.c (convert_like_internal): Clear tf_no_cleanup when
1632         recursing.
1633         (build_user_type_conversion_1): Only add ck_rvalue if
1634         LOOKUP_ONLYCONVERTING.
1636 2021-06-01  Patrick Palka  <ppalka@redhat.com>
1638         PR c++/65816
1639         * init.c (expand_aggr_init_1): Check
1640         type_has_non_user_provided_default_constructor instead of
1641         type_has_user_provided_constructor.
1643 2021-06-01  Jason Merrill  <jason@redhat.com>
1645         PR c++/91859
1646         * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1647         for destroying delete.
1648         * init.c (build_delete): Don't clobber before destroying delete.
1650 2021-06-01  Jason Merrill  <jason@redhat.com>
1652         PR c++/94492
1653         * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1655 2021-05-31  Richard Biener  <rguenther@suse.de>
1657         PR c++/88601
1658         * cp-objcp-common.c (names_builtin_p): Handle
1659         RID_BUILTIN_SHUFFLEVECTOR.
1660         * cp-tree.h (build_x_shufflevector): Declare.
1661         * parser.c (cp_parser_postfix_expression): Handle
1662         RID_BUILTIN_SHUFFLEVECTOR.
1663         * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1664         * typeck.c (build_x_shufflevector): Build either a lowered
1665         VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1666         internal function IFN_SHUFFLEVECTOR.
1668 2021-05-28  Jason Merrill  <jason@redhat.com>
1670         * constexpr.c (build_data_member_initialization): Use tsi_range.
1671         (build_constexpr_constructor_member_initializers): Likewise.
1672         (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1673         (potential_constant_expression_1): Likewise.
1674         * coroutines.cc (await_statement_expander): Likewise.
1675         (await_statement_walker): Likewise.
1676         * module.cc (trees_out::core_vals): Likewise.
1677         * pt.c (tsubst_expr): Likewise.
1678         * semantics.c (set_cleanup_locs): Likewise.
1680 2021-05-28  Jason Merrill  <jason@redhat.com>
1682         PR c++/100797
1683         PR c++/95719
1684         * call.c (build_over_call): Adjust base_binfo in
1685         resolves_to_fixed_type_p case.
1687 2021-05-28  Jakub Jelinek  <jakub@redhat.com>
1689         PR middle-end/99928
1690         * semantics.c (handle_omp_array_sections): Copy
1691         OMP_CLAUSE_MAP_IMPLICIT.
1692         (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1693         marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT.  Add
1694         map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1695         maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1696         present too.  For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1697         if present in map_head, map_field_head or map_firstprivate_head
1698         bitmaps.
1700 2021-05-28  Tobias Burnus  <tobias@codesourcery.com>
1702         * parser.c (cp_parser_omp_clause_affinity): New.
1703         (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1704         cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1705         clause.
1706         * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1707         finish_omp_clauses): Likewise.
1709 2021-05-27  Matthias Kretz  <kretz@kde.org>
1711         PR c++/100716
1712         * error.c (dump_template_bindings): Include code to print
1713         "[with" and ']', conditional on whether anything is printed at
1714         all. This is tied to whether a semicolon is needed to separate
1715         multiple template parameters. If the template argument repeats
1716         the template parameter (T = T), then skip the parameter.
1717         (dump_substitution): Moved code to print "[with" and ']' to
1718         dump_template_bindings.
1719         (dump_function_decl): Partial revert of PR50828, which masked
1720         TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1721         TFF_TEMPLATE_NAME is masked for the scope of the function and
1722         only carries through to dump_function_name.
1723         (dump_function_name): Avoid calling dump_template_parms if
1724         TFF_TEMPLATE_NAME is set.
1726 2021-05-27  Matthias Kretz  <kretz@kde.org>
1728         PR c++/100763
1729         * error.c: Call dump_scope when printing a typedef.
1731 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1733         PR c++/99893
1734         * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1736 2021-05-27  Jason Merrill  <jason@redhat.com>
1738         PR c++/86355
1739         * pt.c (use_pack_expansion_extra_args_p): Don't compare
1740         args from the same argument pack.
1742 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1744         DR 1315
1745         PR c++/67593
1746         PR c++/96555
1747         * pt.c (process_partial_specialization): Don't error on a
1748         non-simple non-type template argument that involves template
1749         parameters.
1750         (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1751         MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1753 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1755         PR c++/100502
1756         * typeck.c (finish_class_member_access_expr): Disable ahead
1757         of time access checking during the member lookup.
1759 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1761         PR c++/100368
1762         * tree.c (build_target_expr_with_type): Don't call force_rvalue
1763         on CALL_EXPR initializer.  Simplify now that bot_manip is no
1764         longer a caller.
1765         (bot_manip): Use force_target_expr instead of
1766         build_target_expr_with_type.
1768 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1770         PR c++/97420
1771         * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1772         (fnptr_conv_p): Don't call non_reference.  Use INDIRECT_TYPE_P
1773         instead of TYPE_PTR_P.
1774         * pt.c (convert_nontype_argument_function): Look through
1775         implicit INDIRECT_REFs before calling strip_fnptr_conv.
1777 2021-05-25  Jakub Jelinek  <jakub@redhat.com>
1779         PR c++/100666
1780         * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1781         and side-effects, temporarily disable -Wunused-result warning when
1782         building COMPOUND_EXPR.
1784 2021-05-21  Jakub Jelinek  <jakub@redhat.com>
1786         PR middle-end/99928
1787         * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1788         OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't error
1789         if a decl is mentioned both in map clause and in such firstprivate
1790         clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1792 2021-05-20  Jason Merrill  <jason@redhat.com>
1794         * call.c (reference_binding): Check for designator.
1795         (implicit_conversion_1, build_special_member_call): Likewise.
1796         * decl.c (reshape_init_r): Likewise.
1797         * pt.c (do_class_deduction): Likewise.
1798         * typeck2.c (digest_init_r): Likewise.
1800 2021-05-20  Jason Merrill  <jason@redhat.com>
1802         PR c++/100489
1803         * decl.c (reshape_init_class): Handle designator for
1804         member of anonymous aggregate here.
1805         * typeck2.c (process_init_constructor_record): Not here.
1807 2021-05-20  Jonathan Wakely  <jwakely@redhat.com>
1809         * call.c (maybe_warn_array_conv): Use new warning option.
1810         * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1811         * error.c (maybe_warn_cpp0x): Likewise.
1812         * parser.c (cp_parser_primary_expression)
1813         (cp_parser_unqualified_id)
1814         (cp_parser_pseudo_destructor_name)
1815         (cp_parser_lambda_introducer)
1816         (cp_parser_lambda_declarator_opt)
1817         (cp_parser_selection_statement)
1818         (cp_parser_init_statement)
1819         (cp_parser_decomposition_declaration)
1820         (cp_parser_function_specifier_opt)
1821         (cp_parser_static_assert)
1822         (cp_parser_namespace_definition)
1823         (cp_parser_using_declaration)
1824         (cp_parser_asm_definition)
1825         (cp_parser_ctor_initializer_opt_and_function_body)
1826         (cp_parser_initializer_list)
1827         (cp_parser_type_parameter_key)
1828         (cp_parser_member_declaration)
1829         (cp_parser_try_block)
1830         (cp_parser_std_attribute_spec): Likewise.
1831         * pt.c (check_template_variable): Likewise.
1833 2021-05-20  Jason Merrill  <jason@redhat.com>
1835         PR c++/100634
1836         * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1838 2021-05-20  Jason Merrill  <jason@redhat.com>
1840         PR c++/100659
1841         * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1843 2021-05-19  Jason Merrill  <jason@redhat.com>
1845         PR c++/100367
1846         PR c++/96299
1847         * method.c (genericize_spaceship): Use fold_build2 for scalar
1848         operands.
1850 2021-05-19  Jason Merrill  <jason@redhat.com>
1852         * pt.c (build_deduction_guide): Treat the implicit deduction guide
1853         as a member of the class.
1855 2021-05-19  Marek Polacek  <polacek@redhat.com>
1857         PR c++/100596
1858         * cp-tree.h (any_non_type_attribute_p): Remove.
1859         * decl.c (grokdeclarator): Turn an error into a warning and only
1860         warn for standard attributes.
1861         * decl2.c (any_non_type_attribute_p): Remove.
1862         * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1863         into a warning and only warn for standard attributes.
1864         (cp_parser_member_declaration): Likewise.
1866 2021-05-19  Martin Liska  <mliska@suse.cz>
1868         PR testsuite/100658
1869         * mangle.c (write_encoding): Fix typos.
1871 2021-05-19  Jakub Jelinek  <jakub@redhat.com>
1873         PR middle-end/99928
1874         * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1875         master when combined with taskloop.
1876         (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1877         parallel master when not combined with taskloop.
1879 2021-05-19  Jason Merrill  <jason@redhat.com>
1881         PR c++/100261
1882         * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1884 2021-05-19  Jason Merrill  <jason@redhat.com>
1886         PR c++/100372
1887         * tree.c (strip_typedefs): Only look at the pattern of a
1888         TYPE_PACK_EXPANSION if it's a type.
1890 2021-05-18  Marek Polacek  <polacek@redhat.com>
1892         * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1893         * constraint.cc (contains_wildcard_p): Likewise.
1894         (get_template_head_requirements): Likewise.
1895         (check_constrained_friend): Likewise.
1896         (subsumes_constraints): Likewise.
1897         * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1898         (push_void_library_fn): Likewise.
1899         (get_pattern_parm): Likewise.
1900         (get_template_parms_at_level): Likewise.
1901         (lambda_return_type): Likewise.
1902         (get_template_head_requirements): Likewise.
1903         (check_constrained_friend): Likewise.
1904         (subsumes_constraints): Likewise.
1905         * decl.c (push_void_library_fn): Likewise.
1906         * lambda.c (lambda_return_type): Likewise.
1907         * pt.c (get_template_parms_at_level): Likewise.
1908         (get_pattern_parm): Likewise.
1910 2021-05-18  Jason Merrill  <jason@redhat.com>
1912         PR c++/100644
1913         * call.c (perfect_candidate_p): An implicitly deleted move
1914         is not perfect.
1916 2021-05-18  Andreas Krebbel  <krebbel@linux.ibm.com>
1918         PR c++/100281
1919         * cvt.c (cp_convert_to_pointer): Use the size of the target
1920         pointer type.
1921         * tree.c (cp_build_reference_type): Call
1922         cp_build_reference_type_for_mode with VOIDmode.
1923         (cp_build_reference_type_for_mode): Rename from
1924         cp_build_reference_type.  Add MODE argument and invoke
1925         build_reference_type_for_mode.
1926         (strip_typedefs): Use build_pointer_type_for_mode and
1927         cp_build_reference_type_for_mode for pointers and references.
1929 2021-05-17  Jonathan Wakely  <jwakely@redhat.com>
1931         PR c++/100635
1932         * call.c (convert_like_internal): Print different diagnostic if
1933         the lvalue reference is const.
1935 2021-05-14  Jason Merrill  <jason@redhat.com>
1937         PR c++/95870
1938         * pt.c (enclosing_instantiation_of): Just compare
1939         DECL_SOURCE_LOCATION.
1940         (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1942 2021-05-14  Marek Polacek  <polacek@redhat.com>
1943             Jason Merrill  <jason@redhat.com>
1945         PR c++/99032
1946         * cp-tree.h (any_non_type_attribute_p): Declare.
1947         * decl.c (grokdeclarator): Diagnose when an attribute appertains to
1948         a friend declaration that is not a definition.
1949         * decl2.c (any_non_type_attribute_p): New.
1950         * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
1951         in the middle of decl-specifiers.
1952         (cp_parser_elaborated_type_specifier): Diagnose when an attribute
1953         appertains to a friend declaration that is not a definition.
1954         (cp_parser_member_declaration): Likewise.
1956 2021-05-12  Marek Polacek  <polacek@redhat.com>
1958         * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1959         sentinel.
1961 2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>
1963         * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1964         'close'.
1966 2021-05-11  Jason Merrill  <jason@redhat.com>
1968         PR c++/100517
1969         * typeck.c (build_reinterpret_cast_1): Check intype on
1970         cast to vector.
1972 2021-05-11  Patrick Palka  <ppalka@redhat.com>
1974         PR c++/51577
1975         * name-lookup.c (maybe_save_operator_binding): Unconditionally
1976         enable for all function templates, not just generic lambdas.
1977         Handle compound-assignment operator expressions.
1978         * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
1979         in the type-dependent case.
1980         (build_x_modify_expr): Likewise.  Move declaration of 'op' closer
1981         to its first use.
1983 2021-05-11  Patrick Palka  <ppalka@redhat.com>
1985         PR c++/100138
1986         * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1987         (satisfy_atom): Set up iloc_sentinel before calling
1988         cxx_constant_value.
1989         * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
1990         expansion, carry over PACK_EXPANSION_LOCAL_P and
1991         PACK_EXPANSION_SIZEOF_P from the original pack expansion.
1993 2021-05-10  Richard Biener  <rguenther@suse.de>
1995         PR middle-end/100464
1996         PR c++/100468
1997         * call.c (set_up_extended_ref_temp): Mark the temporary
1998         addressable if the TARGET_EXPR was.
2000 2021-05-10  Martin Liska  <mliska@suse.cz>
2002         * decl.c (duplicate_decls): Use startswith
2003         function instead of strncmp.
2004         (cxx_builtin_function): Likewise.
2005         (omp_declare_variant_finalize_one): Likewise.
2006         (grokfndecl): Likewise.
2007         * error.c (dump_decl_name): Likewise.
2008         * mangle.c (find_decomp_unqualified_name): Likewise.
2009         (write_guarded_var_name): Likewise.
2010         (decl_tls_wrapper_p): Likewise.
2011         * parser.c (cp_parser_simple_type_specifier): Likewise.
2012         (cp_parser_tx_qualifier_opt): Likewise.
2013         * pt.c (template_parm_object_p): Likewise.
2014         (dguide_name_p): Likewise.
2016 2021-05-10  Martin Liska  <mliska@suse.cz>
2018         PR c++/99616
2019         * decl.c (grokdeclarator): Remove redundant NULL check.
2021 2021-05-07  Jason Merrill  <jason@redhat.com>
2023         * tree.c (rvalue): Assert expr is not a class lvalue.
2025 2021-05-07  Jason Merrill  <jason@redhat.com>
2027         * cp-tree.h (build_stub_object): Declare.
2028         * method.c (build_stub_object): No longer static.
2029         * call.c (can_convert): Use it.
2030         * tree.c (build_dummy_object): Adjust comment.
2031         * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
2032         TARGET_EXPR.
2034 2021-05-07  Jason Merrill  <jason@redhat.com>
2036         * coroutines.cc (build_co_await): Don't call 'rvalue'.
2037         (flatten_await_stmt): Simplify initialization.
2038         (morph_fn_to_coro): Change 'rvalue' to 'move'.  Simplify.
2040 2021-05-04  Tobias Burnus  <tobias@codesourcery.com>
2042         * semantics.c (finish_omp_reduction_clause): Accept float + complex
2043         for || and && reductions.
2045 2021-05-03  Patrick Palka  <ppalka@redhat.com>
2047         PR c++/100362
2048         * parser.c (cp_parser_class_head): Reinstate calls to pushclass
2049         and popclass when parsing the base-clause that were removed in
2050         r11-6815.
2052 2021-05-03  Patrick Palka  <ppalka@redhat.com>
2054         PR c++/68942
2055         PR c++/100344
2056         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
2057         only when the callee is a FUNCTION_DECL.
2059 2021-05-03  Marek Polacek  <polacek@redhat.com>
2061         PR c++/100055
2062         * decl.c (grokfndecl): Check current_template_parms.
2064 2021-05-03  Marek Polacek  <polacek@redhat.com>
2066         DR 1312
2067         * constexpr.c (cxx_eval_constant_expression): Don't check
2068         integer_zerop.
2070 2021-05-01  Jason Merrill  <jason@redhat.com>
2072         * cp-tree.h (class ovl_iterator): Allow copying.  Add op==.
2073         (class ovl_range, class lkp_range): New.
2074         * call.c (build_op_call_1, add_candidates): Use them.
2075         (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
2076         (has_trivial_copy_p): Likewise.
2077         * class.c (handle_using_decl, get_basefndecls): Likewise.
2078         (maybe_warn_about_overly_private_class): Likewise.
2079         (warn_hidden, add_implicitly_declared_members): Likewise.
2080         (check_methods, clone_constructors_and_destructors): Likewise.
2081         (type_has_user_nondefault_constructor): Likewise.
2083 2021-04-29  Jason Merrill  <jason@redhat.com>
2085         * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
2086         don't find a field.
2088 2021-04-29  Jason Merrill  <jason@redhat.com>
2090         PR c++/51344
2091         * decl2.c (grokfield): Call cplus_decl_attributes for friend.
2092         (save_template_attributes): Use chainon.
2093         * friend.c (do_friend): Remove attrlist parm.
2094         * cp-tree.h (do_friend): Adjust.
2095         * class.c (add_implicitly_declared_members): Adjust.
2096         * decl.c (grokdeclarator): Adjust.
2097         * pt.c (apply_late_template_attributes): Optimize.
2099 2021-04-29  Jason Merrill  <jason@redhat.com>
2101         PR c++/97974
2102         * class.c (finish_struct_anon_r): Drop complain parm.
2103         Remove non-field diagnostic.
2104         (finish_struct_anon): Adjust.
2105         * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2107 2021-04-29  Jason Merrill  <jason@redhat.com>
2109         * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2110         * parser.c (cp_parser_constant_expression): Change
2111         allow_non_constant_p to int.  Use cp_evaluated.
2112         (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2113         * semantics.c (finish_id_expression_1): Don't mess with
2114         cp_unevaluated_operand here.
2116 2021-04-29  Jason Merrill  <jason@redhat.com>
2118         * cp-tree.h: Clarify comments.
2119         * pt.c (get_template_parm_object): Add assert.
2120         * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2121         * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2122         * typeck2.c (store_init_value): Likewise.
2124 2021-04-29  Patrick Palka  <ppalka@redhat.com>
2126         PR c++/68942
2127         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2128         set tf_conv during the initial substitution into the function.
2130 2021-04-29  Jakub Jelinek  <jakub@redhat.com>
2132         PR c++/100319
2133         * semantics.c (finish_omp_clauses): Fix up check that variable
2134         mentioned in detach clause doesn't appear in data-sharing clauses.
2136 2021-04-28  Jakub Jelinek  <jakub@redhat.com>
2138         * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2140 2021-04-27  Jason Merrill  <jason@redhat.com>
2142         PR c++/92145
2143         * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2144         of operator=.
2146 2021-04-27  Patrick Palka  <ppalka@redhat.com>
2148         PR c++/88580
2149         * pt.c (tsubst_initializer_list): Correctly handle the case
2150         where an argument inside a base initializer pack expansion is
2151         itself a pack expansion.
2153 2021-04-26  Patrick Palka  <ppalka@redhat.com>
2155         PR c++/100209
2156         * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2157         object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2158         with a negative offset into one whose offset is nonnegative
2159         before calling cxx_fold_indirect_ref_1.
2161 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2163         PR c++/89565
2164         PR c++/93383
2165         PR c++/95291
2166         PR c++/99200
2167         PR c++/99683
2168         * pt.c (do_class_deduction): Punt if the initializer is
2169         type-dependent.
2171 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2173         PR c++/87709
2174         * parser.c (cp_parser_type_id_1): If we see a template
2175         placeholder, first try simulating an error before issuing
2176         a real error.
2178 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2180         PR c++/98767
2181         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2182         Adjust parameter list loop to iterate over 'types' instead of
2183         'args'.  Output the trailing '...' for a variadic function.
2184         Remove PARM_DECL support.
2185         (pp_cxx_requires_expr): Pretty print the parameter list directly
2186         instead of going through pp_cxx_parameter_declaration_clause.
2188 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2190         DR 2374
2191         * decl.c (is_direct_enum_init): Check the implicit
2192         convertibility requirement added by CWG 2374.
2194 2021-04-23  Martin Liska  <mliska@suse.cz>
2196         * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2197         * lex.c (init_operators): Remove run-time check.
2199 2021-04-22  Marek Polacek  <polacek@redhat.com>
2201         PR c++/100161
2202         * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2203         op1 separately for value- or type-dependence.
2205 2021-04-21  Marek Polacek  <polacek@redhat.com>
2207         PR c++/96380
2208         * parser.c (cp_parser_enum_specifier): Don't allow defining
2209         types in enum-base.
2211 2021-04-21  Martin Liska  <mliska@suse.cz>
2213         Revert:
2214         2021-04-21  Martin Liska  <mliska@suse.cz>
2216         * error.c (dump_decl): Use flags in dump_generic_node call.
2218 2021-04-21  Martin Liska  <mliska@suse.cz>
2220         * error.c (dump_decl): Use flags in dump_generic_node call.
2222 2021-04-21  Martin Liska  <mliska@suse.cz>
2224         * error.c (dump_decl): Support anonymous labels.
2226 2021-04-20  Jason Merrill  <jason@redhat.com>
2228         PR c++/100109
2229         * pt.c (find_parameter_packs_r): Look into enum initializers.
2231 2021-04-19  Marek Polacek  <polacek@redhat.com>
2233         PR c++/97536
2234         * decl.c (grokvardecl): Given an error when a concept is not defined
2235         at namespace scope.
2237 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2239         PR c++/100111
2240         * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2241         for empty classes into *valp when types don't match even when *valp
2242         is NULL.
2244 2021-04-16  Marek Polacek  <polacek@redhat.com>
2246         PR c++/99803
2247         * decl.c (make_typename_type): Give an error and return when
2248         name is is_overloaded_fn.
2249         * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2250         before calling make_typename_type.
2252 2021-04-16  Patrick Palka  <ppalka@redhat.com>
2254         PR c++/99700
2255         * constexpr.c (reduced_constant_expression_p): For array
2256         CONSTRUCTORs, use a dedicated loop that additionally verifies
2257         the CONSTRUCTOR spans the entire array.
2259 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2261         PR c++/99850
2262         * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2263         If lambda_p, return pce_ok instead of pce_maybe_postfix.
2265 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2267         PR c++/99833
2268         * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2269         binding, add to data.internal also all corresponding structured
2270         binding decls.
2272 2021-04-16  Jason Merrill  <jason@redhat.com>
2274         PR c++/100079
2275         * cp-tree.h (first_field): Declare.
2276         * mangle.c (range_expr_nelts): New.
2277         (write_expression): Improve class NTTP mangling.
2278         * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2279         * tree.c (zero_init_expr_p): Improve class NTTP handling.
2280         * decl.c: Adjust comment.
2282 2021-04-15  Jason Merrill  <jason@redhat.com>
2284         PR c++/80456
2285         * call.c (build_new_method_call_1): Check again for side-effects
2286         with a volatile object.
2288 2021-04-15  Jason Merrill  <jason@redhat.com>
2290         PR c++/100101
2291         PR c++/99583
2292         * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2293         TYPE_RAISES_EXCEPTIONS here.
2294         * tree.c (cp_walk_subtrees): Not here.
2296 2021-04-15  Jason Merrill  <jason@redhat.com>
2298         PR c++/100091
2299         PR c++/99478
2300         * parser.c (cp_parser_default_type_template_argument): Set
2301         parser->local_variables_forbidden_p.
2303 2021-04-15  Richard Sandiford  <richard.sandiford@arm.com>
2305         PR c++/98852
2306         * typeck.c (merge_type_attributes_from): New function.
2307         (cp_common_type): Use it for vector types.
2309 2021-04-14  Jason Merrill  <jason@redhat.com>
2311         PR c++/100078
2312         PR c++/93085
2313         * pt.c (uses_outer_template_parms): Also look at default
2314         template argument.
2316 2021-04-14  Jason Merrill  <jason@redhat.com>
2318         PR c++/93314
2319         * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2320         for a non-static data member in a constant-expression.
2322 2021-04-14  Patrick Palka  <ppalka@redhat.com>
2324         PR c++/83476
2325         PR c++/99885
2326         * pt.c (deducible_expression): Look through implicit
2327         INDIRECT_REFs as well.
2329 2021-04-14  Jason Merrill  <jason@redhat.com>
2331         PR c++/99478
2332         * parser.c (cp_parser_lambda_expression): Reject lambda
2333         in template parameter type.
2335 2021-04-14  Jason Merrill  <jason@redhat.com>
2337         PR c++/90674
2338         * decl.c (duplicate_decls): Don't propagate
2339         DECL_INITIALIZED_IN_CLASS_P to a specialization.
2341 2021-04-14  Jason Merrill  <jason@redhat.com>
2343         PR c++/88742
2344         PR c++/49951
2345         PR c++/58123
2346         * semantics.c (set_cleanup_locs): New.
2347         (do_poplevel): Call it.
2348         * parser.c (cp_parser_compound_statement): Consume the }
2349         before finish_compound_stmt.
2351 2021-04-13  Jason Merrill  <jason@redhat.com>
2353         PR c++/100032
2354         * pt.c (get_underlying_template): Compare TYPE_QUALS.
2356 2021-04-13  Jason Merrill  <jason@redhat.com>
2358         PR c++/100054
2359         PR c++/90479
2360         * init.c (get_nsdmi): Do more context adjustment for local classes.
2362 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2364         PR c++/99008
2365         * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2366         rather than issuing a pedwarn.
2367         * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2368         for consistent diagnostics.
2370 2021-04-13  Jason Merrill  <jason@redhat.com>
2372         PR c++/91933
2373         * class.c (build_base_path): Shortcut simple non-pointer case.
2375 2021-04-13  Eric Botcazou  <ebotcazou@adacore.com>
2377         * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2378         of the linemap.
2379         (module_state::write_location): Likewise.
2381 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2383         PR c++/97134
2384         * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2385         when checking if the initializer is an equivalent class
2386         placeholder template parameter.
2388 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2390         PR c++/99961
2391         PR c++/99994
2392         * constraint.cc (satisfy_normalized_constraints): Set
2393         cp_unevaluated.
2394         * parser.c (cp_parser_concept_definition): Likewise.
2395         (cp_parser_requires_clause_opt): Likewise.
2397 2021-04-12  Jason Merrill  <jason@redhat.com>
2399         PR c++/93085
2400         * pt.c (uses_outer_template_parms): Handle non-type and template
2401         template parameters specifically.
2403 2021-04-11  Jason Merrill  <jason@redhat.com>
2405         PR c++/97974
2406         * decl.c (fixup_anonymous_aggr): Prune all functions from
2407         CLASSTYPE_MEMBER_VEC.
2409 2021-04-10  Jason Merrill  <jason@redhat.com>
2411         PR c++/98800
2412         PR c++/97399
2413         * parser.c (cp_parser_direct_declarator): Don't
2414         inject_this_parameter if static_p.
2415         (cp_parser_omp_var_list_no_open): Parse 'this' even if
2416         current_class_ptr isn't set for a better diagnostic.
2418 2021-04-10  Jason Merrill  <jason@redhat.com>
2420         PR c++/99180
2421         PR c++/93295
2422         PR c++/93867
2423         PR c++/99118
2424         PR c++/96873
2425         * pt.c (alias_ctad_tweaks): Handle failure better.
2427 2021-04-10  Jason Merrill  <jason@redhat.com>
2429         PR c++/100006
2430         * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2432 2021-04-09  Patrick Palka  <ppalka@redhat.com>
2434         * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2435         (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2436         (LAMBDA_EXPR_REGEN_INFO): ... this.
2437         (tree_lambda_expr::regenerated_from)
2438         (tree_lambda_expr::regenerating_targs): Replace these with ...
2439         (tree_lambda_expr::regen_info): ... this.
2440         * constraint.cc (satisfy_declaration_constraints): Adjust
2441         accordingly.
2442         * lambda.c (build_lambda_expr): Likewise.
2443         * pt.c (regenerated_lambda_fn_p): Likewise.
2444         (most_general_lambda): Likewise.
2445         (tsubst_lambda_expr): Likewise.
2447 2021-04-09  Marek Polacek  <polacek@redhat.com>
2449         PR c++/99806
2450         * parser.c (cp_parser_member_declaration): Call
2451         cp_parser_save_default_args even for function templates.  Use
2452         STRIP_TEMPLATE on the declaration we're passing.
2454 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2456         PR c++/99874
2457         * constraint.cc (get_normalized_constraints_from_decl): Handle
2458         regenerated lambdas.
2459         (satisfy_declaration_constraints): Likewise.  Check for
2460         dependent args later.
2461         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2462         (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2463         (LAMBDA_EXPR_REGENERATING_TARGS): New.
2464         (tree_lambda_expr::regenerated_from): New data member.
2465         (tree_lambda_expr::regenerating_targs): New data member.
2466         (add_to_template_args): Declare.
2467         (regenerated_lambda_fn_p): Likewise.
2468         (most_general_lambda): Likewise.
2469         * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2470         and LAMBDA_EXPR_REGENERATING_TARGS.
2471         * pt.c (add_to_template_args): No longer static.
2472         (tsubst_function_decl): Unconditionally propagate constraints on
2473         the substituted function decl.
2474         (instantiated_lambda_fn_p): Rename to ...
2475         (regenerated_lambda_fn_p): ... this.  Check
2476         LAMBDA_EXPR_REGENERATED_FROM instead of
2477         LAMBDA_EXPR_INSTANTIATED.
2478         (most_general_lambda): Define.
2479         (enclosing_instantiation_of): Adjust after renaming
2480         instantiated_lambda_fn_p.
2481         (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED.  Set
2482         LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2483         Don't substitute or set constraints on the regenerated lambda.
2485 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2487         PR c++/97679
2488         * pt.c (build_deduction_guide): Document OUTER_ARGS.  Substitute
2489         them into the propagated constraints.
2491 2021-04-08  Jason Merrill  <jason@redhat.com>
2493         PR c++/91849
2494         * call.c (convert_like_internal): Improve reference diagnostic.
2496 2021-04-08  Jakub Jelinek  <jakub@redhat.com>
2498         PR c++/99859
2499         * constexpr.c (addr_of_non_const_var): New function.
2500         (cxx_bind_parameters_in_call): Set *non_constant_args to true
2501         even if cp_walk_tree on arg with addr_of_non_const_var callback
2502         returns true.
2504 2021-04-08  Jason Merrill  <jason@redhat.com>
2506         PR c++/94529
2507         * pt.c (determine_specialization): Improve diagnostic.
2509 2021-04-08  Marek Polacek  <polacek@redhat.com>
2511         PR c++/99844
2512         * decl.c (build_explicit_specifier): Call
2513         check_for_bare_parameter_packs.
2514         * except.c (build_noexcept_spec): Likewise.
2516 2021-04-07  Jason Merrill  <jason@redhat.com>
2518         PR c++/41723
2519         * parser.c (cp_parser_class_name): Check dependent_scope_p.
2521 2021-04-07  Jason Merrill  <jason@redhat.com>
2523         PR c++/52625
2524         * pt.c (maybe_process_partial_specialization): Check
2525         DECL_SELF_REFERENCE_P.
2527 2021-04-07  Jason Merrill  <jason@redhat.com>
2529         PR c++/92918
2530         * name-lookup.c (push_class_level_binding_1): Do overload a new
2531         function with a previous using-declaration.
2533 2021-04-06  Jason Merrill  <jason@redhat.com>
2535         PR c++/96673
2536         * init.c (get_nsdmi): Don't defer access checking.
2538 2021-04-06  Jason Merrill  <jason@redhat.com>
2540         PR c++/99901
2541         * decl.c (cp_finish_decl): mark_needed an implicitly inline
2542         static data member with an out-of-class redeclaration.
2544 2021-04-06  Jason Merrill  <jason@redhat.com>
2546         PR c++/91241
2547         * mangle.c (write_compact_number): Add sanity check.
2548         (write_local_name): Use list_length for parm number.
2550 2021-04-06  Patrick Palka  <ppalka@redhat.com>
2552         PR c++/99899
2553         * pt.c (do_auto_deduction): Don't exit early when deducing the
2554         array type of a structured binding.  Also handle adc_decomp_type
2555         during constraint checking.
2557 2021-04-05  Jason Merrill  <jason@redhat.com>
2559         PR c++/96311
2560         * typeck.c (check_return_expr): Call mark_exp_read in dependent
2561         case.
2563 2021-04-05  Jason Merrill  <jason@redhat.com>
2565         PR c++/98440
2566         * typeck.c (build_reinterpret_cast_1): Don't perform
2567         temporary materialization.
2569 2021-04-05  Jason Merrill  <jason@redhat.com>
2571         PR c++/95317
2572         * pt.c (lookup_template_class_1): Do tsubst_enum when
2573         tsubsting a generic lambda.
2575 2021-04-05  Jason Merrill  <jason@redhat.com>
2577         PR c++/95870
2578         * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2579         there is no enclosing non-lambda function.
2581 2021-04-05  Nathan Sidwell  <nathan@acm.org>
2583         PR c++/99380
2584         * module.cc (name_pending_imports): Drop 'atend' parm.  Don't
2585         query export when not needed.
2586         (preprocess_module, preprocessed_module): Adjust.
2588 2021-04-05  Jason Merrill  <jason@redhat.com>
2590         PR c++/99066
2591         * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2593 2021-04-05  Jason Merrill  <jason@redhat.com>
2595         PR c++/99201
2596         * pt.c (class el_data): Add visited field.
2597         (extract_local_specs): Pass it to cp_walk_tree.
2598         (extract_locals_r): Walk into the body of a lambda.
2600 2021-04-05  Jason Merrill  <jason@redhat.com>
2602         * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2603         template result.
2605 2021-04-04  Jason Merrill  <jason@redhat.com>
2607         PR c++/99643
2608         * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2610 2021-04-03  Marek Polacek  <polacek@redhat.com>
2612         PR c++/91416
2613         * parser.c: Create a GC root for attributes in a decl specifier.
2614         (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2616 2021-04-03  Jason Merrill  <jason@redhat.com>
2618         PR c++/91217
2619         * pt.c (tsubst_lambda_expr): Skip the body block from
2620         DECL_SAVED_TREE.
2622 2021-04-03  Jason Merrill  <jason@redhat.com>
2624         PR c++/90664
2625         * cvt.c (can_convert_qual): Check fnptr_conv_p.
2627 2021-04-03  Jason Merrill  <jason@redhat.com>
2629         PR c++/97900
2630         * pt.c (regenerate_decl_from_template): tsubst_decl
2631         the parms.
2633 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2635         PR c++/99869
2636         * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2637         to do_auto_deduction.
2639 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2641         PR c++/99586
2642         * semantics.c (finish_compound_literal): Check
2643         template_placeholder_p instead of type_uses_auto.
2645 2021-04-02  Jason Merrill  <jason@redhat.com>
2647         PR c++/97938
2648         * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2649         * lambda.c (add_capture): Set it.
2650         * pt.c (tsubst_pack_expansion): Handle it.
2652 2021-04-02  Nathan Sidwell  <nathan@acm.org>
2654         * cp-tree.h (lang_decl_base): Correct module flag comment.
2655         * module.cc (trees_in::assert_definition): Break out
2656         not_tmpl var.
2657         (trees_out::lang_decl_bools): Do not write purview for header units.
2659 2021-04-01  Marek Polacek  <polacek@redhat.com>
2661         PR c++/99831
2662         * method.c (defaulted_late_check): ++ and -- function_depth around
2663         the call to synthesize_method.
2664         * pt.c: Remove the saved_trees global.
2666 2021-04-01  Jason Merrill  <jason@redhat.com>
2668         PR c++/99583
2669         PR c++/99584
2670         * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2671         TYPE_RAISES_EXCEPTIONS.
2673 2021-04-01  Iain Sandoe  <iain@sandoe.co.uk>
2675         * mapper-client.cc (INCLUDE_MAP): New; require map to be
2676         included from system.h.
2677         * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2679 2021-04-01  Jason Merrill  <jason@redhat.com>
2681         PR c++/98481
2682         * mangle.c (write_expression): Adjust.
2683         * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2684         (mark_abi_tags_r): Likewise.
2686 2021-04-01  Nathan Sidwell  <nathan@acm.org>
2688         PR c++/99283
2689         * module.cc (trees_out::decl_node): Adjust importedness reference
2690         assert.
2691         (module_state::intercluster_seed): New.  Seed both imports and
2692         inter-cluster references.  Broken out of ...
2693         (module_state::write_cluster): ... here.  Call it.
2695 2021-03-31  Jason Merrill  <jason@redhat.com>
2697         PR c++/99445
2698         * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2700 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2702         PR c++/88115
2703         * mangle.c (write_expression): Adjust the mangling of
2704         __alignof__.
2706 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2708         PR c++/99815
2709         * pt.c (placeholder_type_constraint_dependent_p): Expand
2710         argument packs to separate the first non-pack argument
2711         from the rest.
2713 2021-03-30  Nathan Sidwell  <nathan@acm.org>
2715         PR c++/99283
2716         * module.cc (dumper::operator): Make less brittle.
2717         (trees_out::core_bools): VAR_DECLs always have a context.
2718         (trees_out::key_mergeable): Use same_type_p for asserting.
2719         (trees_in::read_var_def): Propagate
2720         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2722 2021-03-30  Jakub Jelinek  <jakub@redhat.com>
2724         PR c++/99790
2725         * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2727 2021-03-26  Marek Polacek  <polacek@redhat.com>
2729         PR c++/98352
2730         * method.c (implicitly_declare_fn): Pass &raises to
2731         synthesized_method_walk.
2733 2021-03-26  Nathan Sidwell  <nathan@acm.org>
2735         PR c++/99283
2736         * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2737         (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2738         * decl.c (duplicate_decls): Remove template_decl module flag
2739         propagation.
2740         * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2741         (dumper::impl::nested_name): Adjust for template-decl module flag
2742         change.
2743         (trees_in::assert_definition): Likewise.
2744         (trees_in::install_entity): Likewise.
2745         (trees_out::decl_value): Likewise.  Remove alias template
2746         separation of template and type_decl.
2747         (trees_in::decl_value): Likewise.
2748         (trees_out::key_mergeable): Likewise,
2749         (trees_in::key_mergeable): Likewise.
2750         (trees_out::decl_node): Adjust for template-decl module flag
2751         change.
2752         (depset::hash::make_dependency): Likewise.
2753         (get_originating_module, module_may_redeclare): Likewise.
2754         (set_instantiating_module, set_defining_module): Likewise.
2755         * name-lookup.c (name_lookup::search_adl): Likewise.
2756         (do_pushdecl): Likewise.
2757         * pt.c (build_template_decl): Likewise.
2758         (lookup_template_class_1): Remove special alias_template handling
2759         of DECL_TI_TEMPLATE.
2760         (tsubst_template_decl): Likewise.
2762 2021-03-26  Jakub Jelinek  <jakub@redhat.com>
2764         PR c++/99705
2765         * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2766         in DECL_EXPR or in BIND_EXPR_VARS.
2768 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2770         PR c++/99672
2771         * parser.c (cp_parser_postfix_expression): For calls, create
2772         combined_loc and temporarily set input_location to it before
2773         calling finish_call_expr.
2775 2021-03-25  Marek Polacek  <polacek@redhat.com>
2777         PR c++/94751
2778         * call.c (build_over_call): Maybe call mark_used in case
2779         deduce_inheriting_ctor fails and return error_mark_node.
2780         * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2781         * method.c (deduce_inheriting_ctor): Return bool if the deduction
2782         fails.
2783         (implicitly_declare_fn): If raises is error_mark_node, call
2784         synthesized_method_walk with diag being true.
2786 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2788         PR c++/99745
2789         * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2790         packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2792 2021-03-25  Marek Polacek  <polacek@redhat.com>
2794         PR c++/99331
2795         * call.c (build_converted_constant_expr_internal): Don't emit
2796         -Wconversion warnings.
2798 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
2800         PR c++/99565
2801         * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2802         to operand_equal_p.
2803         * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2804         or COMPOUND_EXPR.
2806 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2808         PR c++/99283
2809         * name-lookup.c (check_module_override): Set global or partition
2810         DUP on the binding vector.
2812 2021-03-23  Marek Polacek  <polacek@redhat.com>
2814         PR c++/99318
2815         * decl2.c (cp_warn_deprecated_use_scopes): Only call
2816         cp_warn_deprecated_use when decl is a namespace, class, or enum.
2818 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2820         PR c++/99239
2821         * decl.c (duplicate_decls): Remove assert about maybe-imported
2822         artificial decls.
2824 2021-03-23  Jakub Jelinek  <jakub@redhat.com>
2826         PR c++/99650
2827         * decl.c (cp_finish_decomp): Diagnose void initializers when
2828         using tuple_element and get.
2830 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2832         PR c++/99480
2833         * module.cc (depset::hash::make_dependency): Propagate flags for
2834         partial specialization.
2835         (module_may_redeclare): Handle partial specialization.
2837 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2839         PR c++/99425
2840         * cp-tree.h (map_context_from, map_context_to): Delete.
2841         (add_mergeable_specialization): Add is_alias parm.
2842         * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2843         * module.cc (map_context_from, map_context_to): Delete.
2844         (trees_in::decl_value): Add specializations later, adjust call.
2845         Drop useless alias lookup. Set duplicate fn parm context.
2846         (check_mergeable_decl): Drop context mapping.
2847         (trees_in::is_matching_decl): Likewise.
2848         (trees_in::read_function_def): Drop parameter context adjustment
2849         here.
2851 2021-03-22  Martin Liska  <mliska@suse.cz>
2853         PR c++/99687
2854         * module.cc (fini_modules): Call vec_free instead of delete.
2856 2021-03-20  Jakub Jelinek  <jakub@redhat.com>
2858         PR debug/99230
2859         * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2860         special code, instead call c_genericize_control_stmt.
2862 2021-03-19  Jakub Jelinek  <jakub@redhat.com>
2864         PR c++/99456
2865         * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2866         INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2867         don't diagnose it, set *non_constant_p nor return t.
2869 2021-03-19  Marek Polacek  <polacek@redhat.com>
2871         PR c++/99500
2872         * parser.c (cp_parser_requirement_parameter_list): Handle
2873         error_mark_node.
2875 2021-03-18  Marek Polacek  <polacek@redhat.com>
2877         * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2879 2021-03-18  Marek Polacek  <polacek@redhat.com>
2881         * pt.c (tsubst_copy_and_build): Add assert.
2883 2021-03-18  Iain Sandoe  <iain@sandoe.co.uk>
2885         PR objc++/49070
2886         * parser.c (cp_debug_parser): Add Objective-C++ message
2887         state flag.
2888         (cp_parser_nested_name_specifier_opt): Allow colon to
2889         terminate an assignment-expression when parsing Objective-
2890         C++ messages.
2891         (cp_parser_objc_message_expression): Set and clear message
2892         parsing state on entry and exit.
2893         * parser.h (struct cp_parser): Add a context flag for
2894         Objective-C++ message state.
2896 2021-03-18  Martin Liska  <mliska@suse.cz>
2898         PR c++/99617
2899         * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2900         to NULL.
2902 2021-03-17  Marek Polacek  <polacek@redhat.com>
2904         PR c++/97973
2905         * call.c (conv_unsafe_in_template_p): New.
2906         (convert_like): Use it.
2908 2021-03-17  Anthony Sharp  <anthonysharp15@gmail.com>
2909             Jason Merrill  <jason@redhat.com>
2911         * semantics.c (get_class_access_diagnostic_decl): New
2912         function that examines special cases when a parent
2913         class causes a private access failure.
2914         (enforce_access): Slightly modified to call function
2915         above.
2917 2021-03-16  Jason Merrill  <jason@redhat.com>
2919         * tree.c (cp_tree_equal): Use real_identical.
2921 2021-03-16  Jakub Jelinek  <jakub@redhat.com>
2923         PR c++/99613
2924         * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2925         before calling __cxa_guard_release rather than after it.  Formatting
2926         fixes.
2928 2021-03-16  Martin Liska  <mliska@suse.cz>
2929             Jason Merrill  <jason@redhat.com>
2931         PR c++/99108
2932         * call.c (get_function_version_dispatcher): Handle
2933         DECL_LOCAL_DECL_P.
2934         * decl.c (maybe_version_functions): Likewise.
2935         (maybe_mark_function_versioned): New.
2936         * name-lookup.c (push_local_extern_decl_alias): No longer static.
2937         * name-lookup.h (push_local_extern_decl_alias): Adjust.
2939 2021-03-16  Nathan Sidwell  <nathan@acm.org>
2941         PR c++/99496
2942         * module.cc (trees_out::decl_value): Adjust typedef streaming,
2943         indicate whether it is a dependent alias.
2944         (trees_in::decl_value): Likewise.  Set as dependent alias, if it
2945         is one.
2947 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2949         PR c++/99047
2950         * coroutines.cc (expand_one_await_expression): If the
2951         await_ready() expression is not a boolean then convert it
2952         as required.
2954 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2956         PR c++/98704
2957         * coroutines.cc (build_actor_fn): Make destroy index 1
2958         correspond to the abnormal unhandled_exception() exit.
2959         Substitute the proxy for the resume index.
2960         (coro_rewrite_function_body): Arrange to reset the resume
2961         index and make done = true for a rethrown exception from
2962         unhandled_exception ().
2963         (morph_fn_to_coro): Adjust calls to build_actor_fn and
2964         coro_rewrite_function_body.
2966 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2968         PR c++/98480
2969         * coroutines.cc (replace_continue): Rewrite continue into
2970         'goto label'.
2971         (await_statement_walker): Handle await expressions in the
2972         initializer, condition and iteration expressions of for
2973         loops.
2975 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2977         PR c++/96749
2978         * coroutines.cc (flatten_await_stmt): Allow for the case
2979         where a target expression variable only has uses in the
2980         second part of a compound expression.
2981         (maybe_promote_temps): Avoid emiting empty statements.
2983 2021-03-15  Tobias Burnus  <tobias@codesourcery.com>
2985         PR c++/99509
2986         * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2987         ensure that the varpool node is marked as offloadable.
2989 2021-03-12  Nathan Sidwell  <nathan@acm.org>
2991         PR c++/99238
2992         * module.cc (depset::hash::add_binding_entity): Assert not
2993         visited.
2994         (depset::add::add_specializations): Likewise.
2995         * name-lookup.c (name_lookup::dedup): New.
2996         (name_lookup::~name_lookup): Assert not deduping.
2997         (name_lookup::restore_state): Likewise.
2998         (name_lookup::add_overload): Replace outlined code with dedup
2999         call.
3000         (name_lookup::add_value): Likewise.
3001         (name_lookup::search_namespace_only): Likewise.
3002         (name_lookup::adl_namespace_fns): Likewise.
3003         (name_lookup::adl_class_fns): Likewise.
3004         (name_lookup::search_adl): Likewise.  Add clearing dedup call.
3005         (name_lookup::search_qualified): Likewise.
3006         (name_lookup::search_unqualified): Likewise.
3008 2021-03-12  Jakub Jelinek  <jakub@redhat.com>
3010         PR c++/99507
3011         * call.c (build_over_call): For immediate evaluation of functions
3012         that return references, undo convert_from_reference effects before
3013         calling cxx_constant_value and call convert_from_reference
3014         afterwards.
3016 2021-03-11  Nathan Sidwell  <nathan@acm.org>
3018         PR c++/99248
3019         * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
3020         when there's a binding vector.
3021         * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
3023 2021-03-11  Nathan Sidwell  <nathan@acm.org>
3025         PR c++/99528
3026         * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
3027         MK_decl_tmpl_spec.
3028         (trees_in::decl_value): Adjust add_mergeable_specialization call.
3029         (trees_out::get_merge_kind): Adjust detecting a partial template
3030         instantiation.
3031         (trees_out::key_mergeable): Adjust handling same.
3032         (trees_in::key_mergeabvle): Likewise.
3034 2021-03-10  Nathan Sidwell  <nathan@acm.org>
3036         PR c++/99423
3037         * module.cc (post_load_processing): Assert not gcable.
3038         (laxy_load_pendings): Extend no-gc region around
3039         post_load_processing.
3041 2021-03-10  Nathan Sidwell  <nathan@acm.org>
3043         PR c++/99508
3044         * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
3045         assembler name to the ns alias.
3047 2021-03-09  Jakub Jelinek  <jakub@redhat.com>
3049         PR c++/99459
3050         * coroutines.cc (build_co_await): Look through NOP_EXPRs in
3051         build_special_member_call return value to find the CALL_EXPR.
3052         Simplify.
3054 2021-03-09  Nathan Sidwell  <nathan@acm.org>
3056         PR c++/99472
3057         * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
3058         that C++20 does not yet imply modules.
3060 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3062         PR c++/99436
3063         * name-lookup.c (get_cxx_dialect_name): Add cxx23.
3065 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3067         * lex.c (module_token_filter::resume): Ignore module-decls inside
3068         header-unit.
3069         * parser.c (cp_parser_module_declaration): Reject in header-unit.
3071 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3073         PR c++/99285
3074         * cp-tree.h (match_mergeable_specialization)
3075         (add_mergeable_specialization): Adjust parms.
3076         * module.cc (trees_in::decl_value): Adjust
3077         add_mergeable_specialization calls.
3078         (trees_out::key_mergeable): Adjust match_mergeable_specialization
3079         calls.
3080         (specialization_add): Likewise.
3081         * pt.c (match_mergeable_specialization): Do not insert.
3082         (add_mergeable_specialization): Add to hash table here.
3084 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3085             Jakub Jelinek  <jakub@redhat.com>
3087         PR c++/99287
3088         * constexpr.c (cxx_eval_increment_expression): Pass lval when
3089         evaluating the MODIFY_EXPR, and update 'mod' with the result of
3090         this evaluation.  Check *non_constant_p afterwards.  For prefix
3091         ops, just return 'mod'.
3093 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3094             Jakub Jelinek  <jakub@redhat.com>
3096         PR c++/96330
3097         * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3098         variable 'fn' to 'tmpl'.  Handle a variable template-id by
3099         calling lookup_template_variable.
3101 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3103         PR c++/99365
3104         * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3105         outer_targs to do_auto_deduction.
3106         (placeholder_type_constraint_dependent_p): Define.
3107         (do_auto_deduction): When processing_template_decl != 0
3108         and context is adc_unify and we have constraints, pretend the
3109         constraints are satisfied instead of punting.  Otherwise don't
3110         punt unless placeholder_type_constraint_dependent_p holds.
3111         Add some clarifying sanity checks.  Add a hack to add missing
3112         outermost template levels to outer_args before checking
3113         satisfaction.  Don't substitute outer_targs into type if it's
3114         already been done.
3116 2021-03-05  Marek Polacek  <polacek@redhat.com>
3118         PR c++/99374
3119         * call.c (standard_conversion): When converting pointers to
3120         member, don't return NULL when the bases are equivalent but
3121         incomplete.
3123 2021-03-05  Marek Polacek  <polacek@redhat.com>
3125         PR c++/99120
3126         * name-lookup.c (check_local_shadow): Check if the type of decl
3127         is non-null before checking TYPE_PTR*.
3129 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3131         PR c++/99245
3132         * module.cc (module_state::write_cluster): Relax binding assert.
3134 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3136         PR c++/99377
3137         * pt.c (instantiate_decl): Call set_instantiating_module.
3139 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3141         PR c++/98118
3142         * coroutines.cc (build_co_await): Use type_build_ctor_call()
3143         to determine cases when a CTOR needs to be built.
3144         (flatten_await_stmt): Likewise.
3145         (morph_fn_to_coro): Likewise.
3147 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3149         PR c++/95616
3150         * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3151         (coro_diagnose_throwing_final_aw_expr): New helper.
3152         (build_co_await): Diagnose throwing final await expression
3153         components.
3154         (build_init_or_final_await): Diagnose a throwing promise
3155         final_suspend() call.
3157 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3159         PR c++/95615
3160         * coroutines.cc (struct param_info): Track parameter copies that need
3161         a DTOR.
3162         (coro_get_frame_dtor): New helper function factored from build_actor().
3163         (build_actor_fn): Use coro_get_frame_dtor().
3164         (morph_fn_to_coro): Track parameters that need DTORs on exception,
3165         likewise the frame promise and the return object.  On exception, run the
3166         DTORs for these, destroy the frame and then rethrow the exception.
3168 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3170         PR c++/99389
3171         * pt.c (instantiate_class_template_1): Set instantiating module
3172         here.
3174 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
3176         PR c/99137
3177         * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3179 2021-03-04  Jakub Jelinek  <jakub@redhat.com>
3181         PR c++/88146
3182         PR c++/99362
3183         * cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
3184         comment.
3186 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3188         PR c++/99170
3189         * module.cc (class uintset): Delete.
3190         (typedef attached_map_t): A hash map.
3191         (attached_table): Use attached_map_t.  Adjust uses ...
3192         (trees_out::decl_value, trees_in::decl_value): ... here ...
3193         (trees_out::key_mergeable): ... here ...
3194         (trees_in::key_mergeable): ... here ...
3195         (maybe_attach_decl): ... here ...
3196         (direct_import): ... and here.
3198 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3200         PR c++/99170
3201         * cp-tree.h
3202         * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3203         rename.
3204         * module.cc (class pending_key): New.
3205         (default_hash_traits<pending_key>): New specialization.
3206         (pending_map_t): New typedef.
3207         (pending_table): Replace old table.
3208         (trees_out::lang_decl_bools): Adjust.
3209         (trees_in::lang_decl_bools): Adjust.
3210         (trees_in::install_entity): Drop pending member and specialization
3211         handling.
3212         (find_pending_key): New.
3213         (depset::hash::fiund_dependencies): Use it.
3214         (pendset_lazy_load): Delete.
3215         (module_state::write_cluster): Don't count pendings here.  Bye
3216         Duff's device-like thing.
3217         (module_state::write_pendings): Reimplement.
3218         (module_state::read_pendings): Reimplement.
3219         (lazy_specializations_p): Delete.
3220         (module_state::write): Adjust write_pendings call.
3221         (lazy_load_pendings): New.
3222         (lazy_load_specializations): Delete.
3223         (lazy_load_members): Delete.
3224         (init_modules): Adjust.
3225         * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3226         not lazy_load_members.
3227         (note_pending_specializations): Delete.
3228         (load_pending_specializations): Delete.
3229         * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3230         (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3231         (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3232         (note_pending_specializations): Delete.
3233         (load_pending_specializations): Delete.
3234         * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3235         lazy_load_specializations.
3236         (instantiate_template_class_1): Likewise.
3237         (instantiate_decl): Call lazy_load_pendings.
3238         * typeck.c (complete_type): Likewise.
3240 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3242         PR c++/99170
3243         * module.cc (post_load_decls): New.
3244         (lazy_snum, recursive_lazy): Move earlier.
3245         (module_state::read_cluster): Push cloning onto post_load_decls.
3246         (post_load_processing): New.  Do the cloning here.
3247         (module_state::read_inits): Call post_load_processing.
3248         (module_state::read_language): Likewise.
3249         (lazy_load_binding, lazy_load_specializations): Likewise
3250         (lazy_load_members): Likewise
3252 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3254         PR c++/99170
3255         * module.cc (trees_out::decl_value): Stream specialization keys
3256         after decl.
3257         (trees_in::decl_value): Stream them back and insert after
3258         completing the decl.
3259         (trees_out::key_mergeable): Drop some streaming here ...
3260         (trees_in::key_mergeable): ... and here.  Don't insert into
3261         specialization tables.
3263 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3265         * constraint.cc (struct sat_info): Document the different
3266         meanings of noisy() and diagnose_unsatisfaction_p() during
3267         satisfaction and requires-expression evaluation.
3268         (tsubst_valid_expression_requirement): Take a sat_info instead
3269         of a subst_info.  Perform the substitution quietly first.  Fold
3270         in error-replaying code from diagnose_valid_expression.
3271         (tsubst_simple_requirement): Take a sat_info instead of a
3272         subst_info.
3273         (tsubst_type_requirement_1): New.  Fold in error-replaying code
3274         from diagnose_valid_type.
3275         (tsubst_type_requirement): Use the above.  Take a sat_info
3276         instead of a subst_info.
3277         (tsubst_compound_requirement): Likewise.  Fold in
3278         error-replaying code from diagnose_compound_requirement.
3279         (tsubst_nested_requirement): Take a sat_info instead of a
3280         subst_info.  Fold in error-replaying code from
3281         diagnose_nested_requirement.
3282         (tsubst_requirement): Take a sat_info instead of a subst_info.
3283         (tsubst_requires_expr): Split into two versions, one that takes
3284         a sat_info argument and another that takes a complain and
3285         in_decl argument.  Remove outdated documentation.  Document the
3286         effects of the sat_info argument.  Don't short-circuit
3287         processing of requirements when diagnosing unsatisfaction,
3288         mirroring diagnose_requires_expr.
3289         (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3290         assert, and se the three-parameter version of tsubst_requires_expr.
3291         (diagnose_trait_expr): Make static.  Take a template argument
3292         vector instead of a parameter mapping.
3293         (diagnose_valid_expression): Remove.
3294         (diagnose_valid_type): Remove.
3295         (diagnose_simple_requirement): Remove.
3296         (diagnose_compound_requirement): Remove.
3297         (diagnose_type_requirement): Remove.
3298         (diagnose_nested_requirement): Remove.
3299         (diagnose_requirement): Remove.
3300         (diagnose_requires_expr): Remove.
3301         (diagnose_atomic_constraint): Take a sat_info instead of a
3302         subst_info.  Adjust call to diagnose_trait_expr.  Call
3303         tsubst_requires_expr instead of diagnose_requires_expr.
3304         (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3305         and just always call constraint_satisfaction_value.
3307 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3309         * constexpr.c (cxx_eval_call_expression): Adjust call to
3310         evaluate_concept_check.
3311         (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3312         evaluate_requires_expression instead of
3313         satisfy_constraint_expression.
3314         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3315         * constraint.cc (struct sat_info): Adjust comment about which
3316         satisfaction entrypoints use noisy-unsat.
3317         (normalize_template_requirements): Remove (and adjust callers
3318         appropriately).
3319         (normalize_nontemplate_requirements): Likewise.
3320         (tsubst_nested_requirement): Use constraint_satisfaction_value
3321         instead of satisfy_constraint_expression, which'll do the
3322         noisy replaying of ill-formed quiet satisfaction for us.
3323         (decl_satisfied_cache): Adjust comment.
3324         (satisfy_constraint): Rename to ...
3325         (satisfy_normalized_constraints): ... this.
3326         (satisfy_associated_constraints): Remove (and make its
3327         callers check for dependent arguments).
3328         (satisfy_constraint_expression): Rename to ...
3329         (satisfy_nondeclaration_constraints): ... this.  Assert that
3330         'args' is empty when 't' is a concept-id.  Removing handling
3331         bare constraint-expressions, and handle REQUIRES_EXPRs
3332         specially.  Adjust comment accordingly.
3333         (satisfy_declaration_constraints): Assert in the two-parameter
3334         version that 't' is not a TEMPLATE_DECL.  Adjust following
3335         removal of normalize_(non)?template_requirements and
3336         satisfy_asociated_constraints.
3337         (constraint_satisfaction_value): Combine the two- and
3338         three-parameter versions in the natural way.
3339         (constraints_satisfied_p): Combine the one- and two-parameter
3340         versions in the natural way.  Improve documentation.
3341         (evaluate_requires_expr): Define.
3342         (evaluate_concept_check): Remove 'complain' parameter.  Use
3343         constraint_satisfaction_value instead of
3344         satisfy_constraint_expression.
3345         (diagnose_nested_requirement): Adjust following renaming of
3346         satisfy_constraint_expression.
3347         (diagnose_constraints): Handle REQUIRES_EXPR by going through
3348         diagnose_requires_expr directly instead of treating it as a
3349         constraint-expression.  Improve documentation.
3350         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3351         to evaluate_concept_check.
3352         <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3353         constraints_satisfied_p.
3354         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3355         * cp-tree.h (evaluate_requires_expr): Declare.
3356         (evaluate_concept_check): Remove tsubst_flag_t parameter.
3357         (satisfy_constraint_expression): Remove declaration.
3358         (constraints_satisfied_p): Remove one-parameter declaration.
3359         Add a default argument to the two-parameter declaration.
3360         * cvt.c (convert_to_void): Adjust call to
3361         evaluate_concept_check.
3363 2021-03-03  Jakub Jelinek  <jakub@redhat.com>
3365         PR c++/82959
3366         * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3367         and COMPOUND_EXPR.
3369 2021-03-03  Marek Polacek  <polacek@redhat.com>
3371         PR c++/97034
3372         PR c++/99009
3373         * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3374         (maybe_aggr_guide): Use the original template type where needed.  In
3375         a class member template, partially instantiate the result of
3376         collect_ctor_idx_types.
3377         (do_class_deduction): Defer the deduction until the enclosing
3378         scope is non-dependent.
3380 2021-03-03  Jason Merrill  <jason@redhat.com>
3382         PR c++/95675
3383         * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3384         if it didn't get one before.
3386 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3388         PR c++/99344
3389         * module.cc (trees_out::decl_node): Small refactor.
3390         (depset::hash::add_binding_entity): Return true on meeting an
3391         import.  Set namespace's import here.
3392         (module_state:write_namespaces): Inform of purview too.
3393         (module_state:read_namespaces): Adjust.
3394         * name-lookup.c (implicitly_export_namespace): Delete.
3395         (do_pushdecl): Don't call it.
3396         (push_namespace): Likewise, set purview.
3397         (add_imported_namespace): Reorder parms.
3398         * name-lookup.h (add_imported_namespace): Alter param ordering.
3400 2021-03-02  Martin Sebor  <msebor@redhat.com>
3402         PR c++/99251
3403         * class.c (build_base_path): Call build_if_nonnull.
3404         * cp-tree.h (build_if_nonnull): Declare.
3405         * rtti.c (ifnonnull): Rename...
3406         (build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
3407         (build_dynamic_cast_1): Adjust to name change.
3409 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3411         PR c++/96443
3412         PR c++/96960
3413         * constraint.cc (type_deducible_p): Don't substitute into the
3414         constraints, and instead just pass 'args' to do_auto_deduction
3415         as the outer template arguments.
3416         (tsubst_parameter_mapping): Remove confused code for handling
3417         placeholder type arguments.
3418         (normalize_placeholder_type_constraint): Define.
3419         (satisfy_constraint_expression): Use it to handle placeholder
3420         'auto' types.
3421         * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3422         (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3423         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3424         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3425         (make_constrained_placeholder_type): Set
3426         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3427         (do_auto_deduction): Clarify comments about the outer_targs
3428         parameter.  Rework satisfaction of a placeholder type constraint
3429         to pass in the complete set of template arguments directly to
3430         constraints_satisfied_p.
3431         (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3432         instead.  Also rebuild the the constraint info on the new auto.
3434 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3436         * constraint.cc (build_parameter_mapping): Rely on the caller to
3437         determine the in-scope template parameters.
3438         (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3439         to the two-parameter constructor.  In the two-parameter
3440         constructor, fold in the definition of make_context, set
3441         initial_parms appropriately, and don't set the now-removed
3442         orig_decl member.
3443         (norm_info::make_context): Remove, now that its only use is
3444         inlined into the caller.
3445         (norm_info::update_context): Adjust call to
3446         build_parameter_mapping to pass in the relevant set of in-scope
3447         template parameters.
3448         (norm_info::ctx_parms): Define this member function.
3449         (norm_info::context): Initialize to NULL_TREE.
3450         (norm_info::orig_decl): Remove this data member.
3451         (norm_info::initial_parms): Define this data member.
3452         (normalize_atom): Adjust call to build_parameter_mapping to pass
3453         in the relevant set of in-scope template parameters.  Use
3454         info.initial_parms instead of info.orig_decl.
3455         (normalize_constraint_expression): Take a norm_info object
3456         instead of a bool.  Cache the result of normalization.
3457         (tsubst_nested_requirement): Call satisfy_constraint_expression
3458         instead of satisfy_constraint, so that we normalize on demand.
3459         (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3460         Adjust call to normalize_constraint_expression.
3461         (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3462         to current_template_parms.
3463         (diagnose_nested_requirements): Go through
3464         satisfy_constraint_expression, as with tsubst_nested_requirement.
3466 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3468         * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3469         arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3470         started with a TYPE_ARGUMENT_PACK.
3471         (finish_requires_expr): Don't set DECL_CONTEXT and
3472         CONSTRAINT_VAR_P on each of the introduced parameters here.
3473         * parser.c (cp_parser_requirement_parameter_list): Instead set
3474         these fields earlier, here.
3475         * pt.c (do_auto_deduction): Canonicalize the result of
3476         do_auto_deduction.  Pass 'complain' to finish_decltype_type.
3478 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3480         * constraint.cc (tsubst_simple_requirement): Just return
3481         boolean_true_node on success.
3482         (tsubst_type_requirement): Likewise.
3483         (tsubst_compound_requirement): Likewise.
3484         (tsubst_nested_requirement): Likewise.
3485         (tsubst_requirement_body): Remove.
3486         (check_constaint_variables): Rename to ...
3487         (check_constraint_variables): ... this.
3488         (tsubst_constraint_variables): Adjust.
3489         (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3491 2021-03-01  Nathan Sidwell  <nathan@acm.org>
3493         PR c++/99294
3494         * class.c (fixup_type_variants): Propagate mode, precision,
3495         alignment & emptiness.
3496         * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3497         (trees_in::tree_node): Rematerialize alignment here.
3499 2021-02-27  Jason Merrill  <jason@redhat.com>
3501         PR c++/90333
3502         * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3503         between () and ->.
3505 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3507         * parser.c (cp_parser_lambda_declarator_opt): Implement
3508         P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3509         for -std={c,gnu}++2b or with pedwarn in earlier versions.
3511 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3513         PR c++/95451
3514         * lambda.c (is_lambda_ignored_entity): Before checking for
3515         LAMBDA_FUNCTION_P, use OVL_FIRST.  Drop FUNCTION_DECL check.
3517 2021-02-26  Jason Merrill  <jason@redhat.com>
3519         PR c++/98810
3520         * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3521         to a class non-type template argument that needs it.
3523 2021-02-26  Patrick Palka  <ppalka@redhat.com>
3525         PR c++/98990
3526         * pt.c (splice_late_return_type): Rebuild the entire return type
3527         if we have to adjust the level of an auto within.
3528         (type_uses_auto): Adjust call to find_type_usage.
3529         * type-utils.h (find_type_usage): Revert r10-6571 change that
3530         made this function return a pointer to the auto node.
3532 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3534         PR c++/99213
3535         PR c++/94521
3536         * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3537         TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3539 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3541         PR c++/99103
3542         * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3543         (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3545 2021-02-25  Marek Polacek  <polacek@redhat.com>
3547         DR 1312
3548         PR c++/99176
3549         * constexpr.c (is_std_construct_at): New overload.
3550         (is_std_allocator_allocate): New overload.
3551         (cxx_eval_call_expression): Use the new overloads.
3552         (cxx_eval_constant_expression): Reject casting
3553         from void * as per DR 1312.  Don't check can_convert.
3555 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3557         PR c++/97587
3558         * coroutines.cc (struct param_info): Track rvalue refs.
3559         (morph_fn_to_coro): Track rvalue refs, and call the promise
3560         CTOR with the frame copy of passed parms.
3562 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3564         PR c++/95822
3565         * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3566         set throwing_cleanup marker.
3568 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3570         PR c++/99166
3571         * module.cc (module_state::inform_cmi_p): Renamed field.
3572         (module_state::do_import): Adjust.
3573         (init_modules, finish_module_processing): Likewise.
3574         (handle_module_option): Likewise.
3576 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3578         PR c++/98318
3579         * mapper-client.cc (module_client::open_module_client): Fix typo
3580         of fd init.
3582 2021-02-24  Nathan Sidwell  <nathan@acm.org>
3584         PR c++/98718
3585         * module.cc (ool): New indirection vector.
3586         (loc_spans::maybe_propagate): Location is not optional.
3587         (loc_spans::open): Likewise.  Assert monotonically advancing.
3588         (module_for_ordinary_loc): Use ool indirection vector.
3589         (module_state::write_prepare_maps): Do not count empty macro
3590         expansions.  Elide empty spans.
3591         (module_state::write_macro_maps): Skip empty expansions.
3592         (ool_cmp): New qsort comparator.
3593         (module_state::write): Create and destroy ool vector.
3594         (name_pending_imports): Fix dump push/pop.
3595         (preprocess_module): Likewise.  Add more dumping.
3596         (preprocessed_module): Likewise.
3598 2021-02-24  Iain Sandoe  <iain@sandoe.co.uk>
3600         PR c++/96251
3601         * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3602         error reporting when instantiating for a constexpr.
3604 2021-02-23  Nathan Sidwell  <nathan@acm.org>
3606         PR c++/99208
3607         * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3608         identity.
3610 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3612         PR c++/95468
3613         * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3614         over from tsubst_copy.
3616 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3618         * pt.c (instantiation_dependent_expression_p): Check
3619         processing_template_decl before calling
3620         potential_constant_expression.
3622 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3624         PR c++/99174
3625         * module.cc (struct module_state): Add visited_p flag.
3626         (name_pending_imports): Use it to avoid duplicate requests.
3627         (preprocess_module): Don't read preprocessor state if we failed to
3628         load a module's config.
3630 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3632         PR c++/99153
3633         * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3634         to common-path.
3635         * module.cc (set_defining_module): Add assert.
3637 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3639         PR c++/98741
3640         * module.cc (pending_imports): New.
3641         (declare_module): Adjust test condition.
3642         (name_pending_imports): New.
3643         (preprocess_module): Reimplement using pending_imports.
3644         (preprocessed_module): Move name-getting to name_pending_imports.
3645         * name-lookup.c (append_imported_binding_slot): Assert module
3646         ordering is increasing.
3648 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3650         * module.cc (note_cmis): New.
3651         (struct module_state): Add inform_read_p bit.
3652         (module_state::do_import): Inform of CMI location, if enabled.
3653         (init_modules): Canonicalize note_cmis entries.
3654         (handle_module_option): Handle -flang-info-module-read=FOO.
3656 2021-02-19  Jason Merrill  <jason@redhat.com>
3658         PR c++/96926
3659         * call.c (perfect_conversion_p): Limit rvalueness
3660         test to reference bindings.
3662 2021-02-19  Jason Merrill  <jason@redhat.com>
3664         PR c++/96926
3665         * call.c (perfect_conversion_p): New.
3666         (perfect_candidate_p): New.
3667         (add_candidates): Ignore templates after a perfect non-template.
3669 2021-02-18  Nathan Sidwell  <nathan@acm.org>
3671         PR c++/99023
3672         * module.cc (canonicalize_header_name): Use
3673         cpp_probe_header_unit.
3674         (maybe_translate_include): Fix note_includes comparison.
3675         (init_modules): Fix note_includes string termination.
3677 2021-02-18  Jakub Jelinek  <jakub@redhat.com>
3679         PR c++/99132
3680         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3681         cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3682         for immediate function calls.
3684 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3686         PR c++/99023
3687         * module.cc (struct macro_export): Add GTY markers.
3688         (macro_exports): Likewise, us a va_gc Vector.
3690 2021-02-17  Jakub Jelinek  <jakub@redhat.com>
3692         PR sanitizer/99106
3693         * init.c (build_zero_init_1): For flexible array members just return
3694         NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3695         ARRAY_TYPE.
3697 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3699         PR c++/99116
3700         * name-lookup.c (do_pushdecl): Don't peek under template_parm
3701         bindings here ...
3702         (set_identifier_type_value_with_scope): ... or here.
3703         (do_pushtag): Only set_identifier_type_value_with_scope at
3704         non-class template parm scope, and use parent scope.
3706 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3708         PR c++/99071
3709         * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3710         pointer.
3712 2021-02-17  Patrick Palka  <ppalka@redhat.com>
3714         PR debug/96997
3715         PR c++/94034
3716         * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3718 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3720         * module.cc (module_state::write_cluster): Check bindings for
3721         imported using-decls.
3723 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3725         PR c++/99040
3726         * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3727         for new namespace-scope entities.
3728         (module_state::read_cluster): Don't call add_module_decl here.
3729         * name-lookup.h (add_module_decl): Rename to ...
3730         (add_module_namespace_decl): ... this.
3731         * name-lookup.c (newbinding_bookkeeping): Move into ...
3732         (do_pushdecl): ... here.  Its only remaining caller.
3733         (add_module_decl): Rename to ...
3734         (add_module_namespace_decl): ... here.  Add checking-assert for
3735         circularity. Don't call newbinding_bookkeeping, just extern_c
3736         checking and incomplete var checking.
3738 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3740         PR c++/99039
3741         PR c++/99040
3742         * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3743         (global_type_node): Delete.
3744         (IDENTIFIER_TYPE_VALUE): Delete.
3745         (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3746         (get_type_value): Delete.
3747         * name-lookup.h (identifier_type_value): Delete.
3748         * name-lookup.c (check_module_override): Don't
3749         SET_IDENTIFIER_TYPE_VALUE here.
3750         (do_pushdecl): Nor here.
3751         (identifier_type_value_1, identifier_type_value): Delete.
3752         (set_identifier_type_value_with_scope): Only
3753         SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3754         (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3755         (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3756         * call.c (check_dtor_name): Use lookup_name.
3757         * decl.c (cxx_init_decl_processing): Drop global_type_node.
3758         * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3759         here.
3760         * init.c (get_type_value): Delete.
3761         * pt.c (instantiate_class_template_1): Don't call pushtag or
3762         SET_IDENTIFIER_TYPE_VALUE here.
3763         (tsubst): Assert never an identifier.
3764         (dependent_type_p): Drop global_type_node assert.
3765         * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3766         to determine ctorness.
3768 2021-02-12  Jakub Jelinek  <jakub@redhat.com>
3770         PR c++/97742
3771         * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3772         CPP_EOF.
3774 2021-02-12  Jason Merrill  <jason@redhat.com>
3776         PR c++/97246
3777         PR c++/94546
3778         * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3779         (register_parameter_specializations): Not here.
3781 2021-02-11  Marek Polacek  <polacek@redhat.com>
3783         PR c++/95888
3784         * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3785         for the partial instantiation.
3787 2021-02-11  Jakub Jelinek  <jakub@redhat.com>
3789         PR c++/99033
3790         * init.c (build_zero_init_1): Handle zero initialiation of
3791         flexible array members like initialization of [0] arrays.
3792         Use integer_minus_onep instead of comparison to integer_minus_one_node
3793         and integer_zerop instead of comparison against size_zero_node.
3794         Formatting fixes.
3796 2021-02-11  Marek Polacek  <polacek@redhat.com>
3798         PR c++/99063
3799         * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3801 2021-02-11  Patrick Palka  <ppalka@redhat.com>
3803         PR c++/97582
3804         * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3805         lookup result by discarding it if the first element is a
3806         class-scope declaration, otherwise return it.
3807         (push_operator_bindings): Handle an ambiguous lookup result by
3808         doing push_local_binding on each element in the list.
3810 2021-02-11  Marek Polacek  <polacek@redhat.com>
3812         * parser.c (cp_parser_selection_statement): Use vec_free.
3814 2021-02-10  Jakub Jelinek  <jakub@redhat.com>
3816         PR c++/98988
3817         PR c++/99031
3818         * constexpr.c: Include cgraph.h.
3819         (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3820         heap artificial vars.
3821         (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3822         heap artificial vars.
3824 2021-02-10  Nathan Sidwell  <nathan@acm.org>
3826         PR c++/99030
3827         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3828         answer if there's no local specialization.
3830 2021-02-09  Nathan Sidwell  <nathan@acm.org>
3832         PR c++/98944
3833         * module.cc (module_state::is_rooted): Rename to ...
3834         (module_state::has_location): ... here.  Adjust callers.
3835         (module_state::read_partitions): Adjust validity check.
3836         Don't overwrite a known location.
3838 2021-02-09  Jason Merrill  <jason@redhat.com>
3840         PR c++/96905
3841         * pt.c (mark_decl_instantiated): Exit early if consteval.
3843 2021-02-09  Jason Merrill  <jason@redhat.com>
3845         PR c++/98326
3846         PR c++/20408
3847         * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3848         parm.
3850 2021-02-09  Jason Merrill  <jason@redhat.com>
3852         PR c++/98994
3853         PR c++/97566
3854         * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3855         RECORD_TYPE.
3857 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3859         * decl.c (start_cleanup_fn): Push function into
3860         namespace.
3862 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3864         PR c++/98531
3865         * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3866         * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3867         from rtti.c, add default namespace arg.
3868         (check_redeclaration_exception_specification): Allow a lazy
3869         builtin's eh spec to differ from an lready-declared user
3870         declaration.
3871         (declare_global_var): Use push/pop_abi_namespace.
3872         (get_atexit_node): Push the fndecl into a namespace.
3873         * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3874         decl.c.
3876 2021-02-08  Marek Polacek  <polacek@redhat.com>
3878         * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3880 2021-02-05  Marek Polacek  <polacek@redhat.com>
3882         PR c++/98947
3883         * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3884         on arg2/arg3.
3885         * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3886         issuing the -Wvolatile warning.  Only set TREE_THIS_VOLATILE if
3887         a warning was emitted.
3889 2021-02-05  Marek Polacek  <polacek@redhat.com>
3891         PR c++/96462
3892         * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3894 2021-02-05  Jakub Jelinek  <jakub@redhat.com>
3896         PR c++/97878
3897         * decl.c (check_array_initializer): For structured bindings, require
3898         the array type to be complete.
3900 2021-02-04  Jason Merrill  <jason@redhat.com>
3902         PR c++/98717
3903         * constraint.cc (build_concept_check_arguments): Remove assert.
3904         (build_concept_check): Allow empty args.
3906 2021-02-04  Tom Greenslade (thomgree)  <thomgree@cisco.com>
3908         PR c++/90926
3909         * call.c (can_convert_array): Extend to handle all valid aggregate
3910         initializers of an array; including by string literals, not just by
3911         brace-init-list.
3912         (build_aggr_conv): Call can_convert_array more often, not just in
3913         brace-init-list case.
3914         * typeck2.c (array_string_literal_compatible_p): New function.
3915         (digest_init_r): call array_string_literal_compatible_p
3916         * cp-tree.h: (array_string_literal_compatible_p): Declare.
3918 2021-02-04  Jason Merrill  <jason@redhat.com>
3920         PR c++/98802
3921         * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3923 2021-02-04  Jason Merrill  <jason@redhat.com>
3925         PR c++/95192
3926         * pt.c (tsubst_attribute): Handle error.
3927         (apply_late_template_attributes): Return false on error.
3928         (tsubst_function_decl): Check its return value.
3929         (tsubst_decl): Likewise.
3930         (push_template_decl): Assert current_template_parms.
3931         (tsubst_template_decl): Set current_template_parms.
3933 2021-02-03  Marek Polacek  <polacek@redhat.com>
3935         PR c++/98951
3936         * call.c (struct z_candidate): Mark rewritten and reversed as const.
3937         (struct NonPublicField): Mark operator() as const.
3938         (struct NonTrivialField): Likewise.
3940 2021-02-03  Jason Merrill  <jason@redhat.com>
3942         PR c++/98926
3943         PR c++/98570
3944         * pt.c (spec_hasher::equal): Set processing_template_decl.
3945         * Make-lang.in (check-g++-strict-gc): Add --param
3946         hash-table-verification-limit=10000.
3948 2021-02-03  Marek Polacek  <polacek@redhat.com>
3950         PR c++/98899
3951         * parser.c (cp_parser_class_specifier_1): Use any possible
3952         DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
3953         (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
3954         * pt.c (tsubst_exception_specification): Stash new_specs into
3955         DEFPARSE_INSTANTIATIONS.
3956         * tree.c (fixup_deferred_exception_variants): Use
3957         UNPARSED_NOEXCEPT_SPEC_P.
3959 2021-02-02  Jason Merrill  <jason@redhat.com>
3961         PR c++/98929
3962         PR c++/96199
3963         * error.c (dump_expr): Ignore dummy object.
3964         * pt.c (tsubst_baselink): Handle dependent scope.
3966 2021-02-01  Patrick Palka  <ppalka@redhat.com>
3968         PR c++/98295
3969         * constexpr.c (cxx_eval_array_reference): Also set
3970         new_ctx.object when setting new_ctx.ctor.
3972 2021-02-01  Marek Polacek  <polacek@redhat.com>
3974         PR c++/98355
3975         * parser.c (cp_parser_has_attribute_expression): Use
3976         uses_template_parms instead of type_dependent_expression_p.
3978 2021-02-01  Jason Merrill  <jason@redhat.com>
3980         PR c++/98570
3981         * cp-tree.h: Declare it.
3982         * pt.c (comparing_dependent_aliases): New flag.
3983         (template_args_equal, spec_hasher::equal): Set it.
3984         (dependent_alias_template_spec_p): Assert that we don't
3985         get non-types other than error_mark_node.
3986         (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
3987         on complex alias specializations.  Set TYPE_DEPENDENT_P here.
3988         (tsubst_decl): Not here.
3989         * module.cc (module_state::read_cluster): Set
3990         comparing_dependent_aliases instead of
3991         comparing_specializations.
3992         * tree.c (cp_tree_equal): Remove comparing_specializations
3993         module handling.
3994         * typeck.c (structural_comptypes): Adjust.
3995         (comptypes): Remove comparing_specializations handling.
3997 2021-01-29  Nathan Sidwell  <nathan@acm.org>
3999         PR c++/98843
4000         * module.cc (module_state_config): Add num_entities field.
4001         (module_state::read_entities): The entity_ary span is
4002         already allocated.
4003         (module_state::write_config): Write num_entities.
4004         (module_state::read_config): Read num_entities.
4005         (module_state::write): Set config's num_entities.
4006         (module_state::read_initial): Allocate the entity ary
4007         span here.
4008         (module_state::read_language): Do not set entity_lwm
4009         here.
4011 2021-01-29  Marek Polacek  <polacek@redhat.com>
4013         PR c++/96137
4014         * parser.c (cp_parser_class_name): If parser->scope is
4015         error_mark_node, return it, otherwise continue.
4017 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
4019         PR c++/98841
4020         * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
4022 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
4024         PR c++/33661
4025         PR c++/98847
4026         * decl.c (cp_finish_decl): For register vars with asmspec in templates
4027         call set_user_assembler_name and set DECL_HARD_REGISTER.
4028         * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
4029         pass asmspec_tree to cp_finish_decl.
4031 2021-01-28  Nathan Sidwell  <nathan@acm.org>
4033         PR c++/98770
4034         * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
4035         check order.
4036         (trees_in::decl_value): Do typedef frobbing only when installing
4037         a new typedef, adjust is_matching_decl call.  Swap is_typedef
4038         & TYPE_NAME check.
4039         (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
4040         names and deal with typedef checking.
4042 2021-01-27  Jason Merrill  <jason@redhat.com>
4044         PR c++/97874
4045         * name-lookup.c (lookup_using_decl): Clean up handling
4046         of dependency and inherited constructors.
4047         (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
4048         * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
4050 2021-01-26  Jason Merrill  <jason@redhat.com>
4052         PR c++/97474
4053         * call.c (type_passed_as): Don't mark invisiref restrict.
4055 2021-01-26  Jason Merrill  <jason@redhat.com>
4057         PR c++/97566
4058         PR c++/98463
4059         * class.c (layout_class_type): An empty field gets size 0.
4060         (is_empty_field): New.
4061         (check_bases): Check it.
4062         * cp-tree.h (is_empty_field): Declare it.
4063         * constexpr.c (cxx_eval_store_expression): Check it.
4064         (cx_check_missing_mem_inits): Likewise.
4065         * init.c (perform_member_init): Likewise.
4066         * typeck2.c (process_init_constructor_record): Likewise.
4068 2021-01-25  Martin Sebor  <msebor@redhat.com>
4070         PR c++/98646
4071         * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
4073 2021-01-25  Jason Merrill  <jason@redhat.com>
4075         PR c++/98463
4076         * constexpr.c (get_or_insert_ctor_field): Add check.
4077         (cxx_eval_store_expression): Handle discontinuity of refs.
4079 2021-01-23  Anthony Sharp  <anthonysharp15@gmail.com>
4081         * call.c (complain_about_access): Altered function.
4082         * cp-tree.h (complain_about_access): Changed parameters of function.
4083         (get_parent_with_private_access): Declared new function.
4084         * search.c (get_parent_with_private_access): Defined new function.
4085         * semantics.c (enforce_access): Modified function.
4086         * typeck.c (complain_about_unrecognized_member): Updated function
4087         arguments in complain_about_access.
4089 2021-01-23  Patrick Palka  <ppalka@redhat.com>
4091         PR c++/97399
4092         * cp-tree.h (shared_member_p): Adjust declaration.
4093         * parser.c (cp_parser_init_declarator): If the storage class
4094         specifier is sc_static, pass true for static_p to
4095         cp_parser_declarator.
4096         (cp_parser_direct_declarator): Don't do inject_this_parm when
4097         the declarator is a friend.
4098         * search.c (shared_member_p): Change return type to bool and
4099         adjust function body accordingly.  Return false for a dependent
4100         USING_DECL instead of aborting.
4101         * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4102         even when type-dependent.
4104 2021-01-22  Marek Polacek  <polacek@redhat.com>
4106         PR c++/96623
4107         * parser.c (inject_parm_decls): Remove a redundant assignment.
4108         (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4109         before calling inject_parm_decls.
4111 2021-01-22  Jason Merrill  <jason@redhat.com>
4113         PR c++/98744
4114         * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4116 2021-01-22  Jakub Jelinek  <jakub@redhat.com>
4118         PR sanitizer/95693
4119         * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4120         return build_zero_cst for reference types.
4121         * typeck2.c (process_init_constructor_record): Instead call
4122         build_zero_cst here during error recovery instead of build_zero_init.
4124 2021-01-22  Marek Polacek  <polacek@redhat.com>
4126         PR c++/98545
4127         * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4128         warnings regardless of abi_version_at_least.
4129         (write_expression): When the expression is a dependent name
4130         and an operator name, write "on" before writing its name.
4132 2021-01-22  Marek Polacek  <polacek@redhat.com>
4134         PR c++/97966
4135         * pt.c (instantiate_class_template_1): Instantiate members
4136         marked with attribute used only after we're done instantiating
4137         the class.
4139 2021-01-21  Patrick Palka  <ppalka@redhat.com>
4141         PR c++/71879
4142         * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4143         sentinel at the start of the function.  Remove a now-redundant
4144         manual adjustment of cp_unevaluated_operand.
4146 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4148         PR c++/98624
4149         * module.cc (depset::hash::find_dependencies): Add
4150         module arg.
4151         (trees_out::core_vals): Check state before calling
4152         write_location.
4153         (sort_cluster, module_state::write): Adjust
4154         find_dependencies call.
4156 2021-01-21  Jakub Jelinek  <jakub@redhat.com>
4158         PR c++/98672
4159         * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4160         (check_for_return_continue): Also look for BREAK_STMT.  Handle
4161         SWITCH_STMT by ignoring break_stmt from its body.
4162         (potential_constant_expression_1) <case FOR_STMT>,
4163         <case WHILE_STMT>: If the condition isn't constant true, check if
4164         the loop body can contain a return stmt.
4165         <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4166         <case IF_STMT>: If recursion with tf_none is successful,
4167         merge *jump_target from the branches - returns with highest priority,
4168         breaks or continues lower.  If then branch is potentially constant and
4169         doesn't return, check the else branch if it could return, break or
4170         continue.
4172 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4174         PR c++/98530
4175         * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4177 2021-01-20  Nathan Sidwell  <nathan@acm.org>
4179         * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4180         signed type.
4182 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4184         PR c++/95434
4185         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4186         CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4187         adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4189 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4191         PR c++/82613
4192         * parser.c (cp_parser_class_head): Defer access checking when
4193         parsing the base-clause until all bases are seen and attached
4194         to the class type.
4195         * pt.c (instantiate_class_template): Likewise when substituting
4196         into dependent bases.
4198 2021-01-20  Jakub Jelinek  <jakub@redhat.com>
4200         PR c++/98742
4201         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4202         error_operand_p, remove clause without further checking.  Check
4203         for non-NULL TYPE_NAME.
4205 2021-01-19  Marek Polacek  <polacek@redhat.com>
4207         PR c++/98659
4208         * pt.c (maybe_instantiate_noexcept): Return false if FN is
4209         error_mark_node.
4211 2021-01-19  Marek Polacek  <polacek@redhat.com>
4213         PR c++/98687
4214         * name-lookup.c (push_using_decl_bindings): New, broken out of...
4215         (finish_nonmember_using_decl): ...here.
4216         * name-lookup.h (push_using_decl_bindings): Update declaration.
4217         * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4219 2021-01-19  Patrick Palka  <ppalka@redhat.com>
4221         PR c++/41437
4222         PR c++/58993
4223         * search.c (friend_accessible_p): If scope is a hidden friend
4224         defined inside a dependent class, consider access from the
4225         class.
4226         * parser.c (cp_parser_late_parsing_for_member): Don't push a
4227         dk_no_check access state.
4229 2021-01-19  Marek Polacek  <polacek@redhat.com>
4231         PR c++/98333
4232         * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4233         of NSDMIs before late-parsing of noexcept-specifiers.
4235 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4237         * module.cc (identifier): Merge overloads.
4239 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4241         PR c++/98624
4242         * module.cc (trees_out::write_location): Make static.
4244 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
4246         * parser.c (cp_parser_omp_clause_detach): New.
4247         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4248         (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4249         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4250         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4251         Prevent use of detach with mergeable and overriding the data sharing
4252         mode of the event handle.
4254 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4256         PR c++/98538
4257         * tree.c (cp_build_qualified_type_real): Propagate an array's
4258         dependentness to the copy, if known.
4260 2021-01-15  Jason Merrill  <jason@redhat.com>
4262         PR c++/98642
4263         * call.c (unsafe_return_slot_p): Return int.
4264         (init_by_return_slot_p): Split out from...
4265         (unsafe_copy_elision_p): ...here.
4266         (unsafe_copy_elision_p_opt): New name for old meaning.
4267         (build_over_call): Adjust.
4268         (make_safe_copy_elision): New.
4269         * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4270         list-initialization.
4271         * cp-tree.h: Adjust.
4273 2021-01-15  Jason Merrill  <jason@redhat.com>
4275         * call.c (base_ctor_for, make_base_init_ok): New.
4276         (build_over_call): Use make_base_init_ok.
4278 2021-01-15  Jason Merrill  <jason@redhat.com>
4280         PR c++/63707
4281         * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4282         if we got a CONSTRUCTOR.
4284 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4286         PR c++/98591
4287         * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4289 2021-01-14  Jason Merrill  <jason@redhat.com>
4291         * typeck2.c (process_init_constructor_record): Use fldtype
4292         variable consistently.
4294 2021-01-14  Nathan Sidwell  <nathan@acm.org>
4296         PR c++/98372
4297         * tree.c (cp_tree_equal): Correct map_context logic.
4299 2021-01-13  Marek Polacek  <polacek@redhat.com>
4301         PR c++/98231
4302         * name-lookup.c (push_using_decl_bindings): New.
4303         * name-lookup.h (push_using_decl_bindings): Declare.
4304         * pt.c (tsubst_expr): Call push_using_decl_bindings.
4306 2021-01-13  Nathan Sidwell  <nathan@acm.org>
4308         PR c++/98626
4309         * module.cc (module_add_import_initializers):  Pass a
4310         zero-element argument vector.
4312 2021-01-12  Patrick Palka  <ppalka@redhat.com>
4314         PR c++/98611
4315         * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4316         the template of a CTAD placeholder.
4318 2021-01-12  Marek Polacek  <polacek@redhat.com>
4320         PR c++/98620
4321         * typeck2.c (process_init_constructor_record): Don't emit
4322         -Wmissing-field-initializers warnings in unevaluated contexts.
4324 2021-01-11  Jakub Jelinek  <jakub@redhat.com>
4326         PR c++/98481
4327         * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4328         for types.
4329         (mark_abi_tags_r): Likewise.
4330         * decl2.c (min_vis_r): Likewise.
4331         * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4332         typedefs.
4334 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4336         PR c++/98551
4337         * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4338         instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4340 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4342         PR c++/98515
4343         * semantics.c (check_accessibility_of_qualified_id): Punt if
4344         we're checking access of a scoped non-static member inside a
4345         class template.
4347 2021-01-07  Jakub Jelinek  <jakub@redhat.com>
4349         PR c++/98329
4350         * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4351         cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4352         its location.
4353         (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4355 2021-01-07  Marek Polacek  <polacek@redhat.com>
4357         PR c++/98441
4358         * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4359         !late_return_type block.
4361 2021-01-07  Jason Merrill  <jason@redhat.com>
4363         * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4364         (cxx_eval_store_expression): Add comment.
4366 2021-01-07  Jason Merrill  <jason@redhat.com>
4368         * call.c (has_next): Factor out from...
4369         (next_conversion): ...here.
4370         (strip_standard_conversion): And here.
4371         (is_subseq): And here.
4372         (build_conv): Check it.
4373         (standard_conversion): Don't call build_conv
4374         for ck_identity.
4376 2021-01-06  Martin Sebor  <msebor@redhat.com>
4378         PR c++/95768
4379         * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4381 2021-01-05  Patrick Palka  <ppalka@redhat.com>
4383         * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4384         the type of the NTTP, substitute into the type again.  If the
4385         type is still dependent, don't unify the NTTP.
4387 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4389         * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4390         $(CODYLIB) after $(BACKEND).
4392 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4394         PR c++/98469
4395         * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4396         Punt if lval is true.
4397         * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4398         the result if it has a class type.
4400 2021-01-05  Marek Polacek  <polacek@redhat.com>
4402         PR c++/82099
4403         * pt.c (resolve_overloaded_unification): Call
4404         maybe_instantiate_noexcept after instantiating the function
4405         decl.
4407 2021-01-05  Nathan Sidwell  <nathan@acm.org>
4409         * parser.c (cp_parser_module_declaration): Alter diagnostic
4410         text to say where is permissable.
4412 2021-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4414         PR c++/98316
4415         * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4417 2021-01-02  Jan Hubicka  <jh@suse.cz>
4419         * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4420         * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4421         * tree.c (cp_tree_c_finish_parsing): New function.
4423 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
4425         * ChangeLog-2020: Rotate ChangeLog.  New file.
4428 Copyright (C) 2021 Free Software Foundation, Inc.
4430 Copying and distribution of this file, with or without modification,
4431 are permitted in any medium without royalty provided the copyright
4432 notice and this notice are preserved.