AVR: avr.cc - Drop a superfluous sub-condition in avr_out_compare.
[official-gcc.git] / gcc / cp / ChangeLog
blobb2a6681e81632f2e7625031f91e3e70244fc233b
1 2024-09-30  Marek Polacek  <polacek@redhat.com>
3         PR c++/109859
4         * parser.cc (cp_parser_lambda_declarator_opt): Temporarily clear
5         local_variables_forbidden_p.
6         (cp_parser_placeholder_type_specifier): Turn an assert into an
7         error.
9 2024-09-30  David Malcolm  <dmalcolm@redhat.com>
11         PR other/116613
12         * pt.cc: Include "pretty-print-markup.h".
13         (warn_spec_missing_attributes): Defer colorization choices by
14         replacing printing to a pretty_printer * param with appending
15         to a vec of strings.  Replace pretty_printer with usage of
16         pp_markup::comma_separated_quoted_strings and "%e".
18 2024-09-27  Nathaniel Shead  <nathanieloshead@gmail.com>
20         PR c++/116160
21         * name-lookup.cc (supplement_binding): Allow redeclaration via
22         USING_DECL if not in class scope.
23         (do_nonmember_using_decl): Remove function-scope exemption.
24         (push_using_decl_bindings): Remove outdated comment.
26 2024-09-27  Nathaniel Shead  <nathanieloshead@gmail.com>
28         PR c++/116748
29         * name-lookup.cc (update_binding): Maintain USING_DECLs in the
30         binding slots.
32 2024-09-27  Nathaniel Shead  <nathanieloshead@gmail.com>
34         PR c++/116803
35         * decl.cc (duplicate_decls): Propagate DECL_MODULE_PURVIEW_P and
36         DECL_MODULE_IMPORT_P for template redeclarations.
38 2024-09-27  Marek Polacek  <polacek@redhat.com>
40         PR c++/102594
41         * init.cc (build_vec_init): Build up a CONSTRUCTOR to signal
42         direct-initialization rather than a TREE_LIST.
44 2024-09-27  Arsen Arsenović  <arsen@aarsen.me>
46         PR c++/116793
47         * coroutines.cc (await_statement_expander): Just process
48         subtrees if encountering a CLEANUP_POINT_EXPR.
50 2024-09-27  Arsen Arsenović  <arsen@aarsen.me>
52         * coroutines.cc (co_await_get_resume_call): Return a tree
53         directly, rather than a tree pointer.
54         * cp-tree.h (co_await_get_resume_call): Adjust signature
55         accordingly.
56         * cvt.cc (convert_to_void): Do not alter CO_AWAIT_EXPRs when
57         discarding them.  Simplify handling implicit INDIRECT_REFs.
59 2024-09-27  Arsen Arsenović  <arsen@aarsen.me>
61         PR c++/116502
62         * coroutines.cc (maybe_promote_temps): Convert temporary
63         initializers to void without complaining.
65 2024-09-27  Nathaniel Shead  <nathanieloshead@gmail.com>
67         * module.cc (has_definition): Use decl_maybe_constant_var
68         instead of TREE_CONSTANT.
70 2024-09-27  Nathaniel Shead  <nathanieloshead@gmail.com>
72         * name-lookup.cc (check_can_export_using_decl): Handle internal
73         linkage GM entities (but ignore in header units); use linkage
74         of entity ultimately referred to by aliases.
76 2024-09-27  Nathaniel Shead  <nathanieloshead@gmail.com>
78         * name-lookup.cc (maybe_record_mergeable_decl): Use decl_linkage
79         instead of ad-hoc checks.
81 2024-09-27  Nathaniel Shead  <nathanieloshead@gmail.com>
83         * name-lookup.cc (do_namespace_alias): Propagate TREE_PUBLIC for
84         namespace aliases.
85         * tree.cc (decl_linkage): Update rules for C++11.
87 2024-09-26  Marek Polacek  <polacek@redhat.com>
89         PR c++/116731
90         * parser.cc (warn_for_range_copy): Check if TYPE is trivially
91         constructible, not copyable.
93 2024-09-25  Marek Polacek  <polacek@redhat.com>
95         * coroutines.cc (build_co_await): Use TARGET_EXPR accessors.
96         (finish_co_yield_expr): Likewise.
97         (register_awaits): Likewise.
98         (tmp_target_expr_p): Likewise.
99         (flatten_await_stmt): Likewise.
100         * error.cc (dump_expr): Likewise.
101         * semantics.cc (finish_omp_target_clauses): Likewise.
102         * tree.cc (bot_manip): Likewise.
103         (cp_tree_equal): Likewise.
104         * typeck.cc (cxx_mark_addressable): Likewise.
105         (cp_build_compound_expr): Likewise.
106         (cp_build_modify_expr): Likewise.
107         (check_return_expr): Likewise.
109 2024-09-25  Tobias Burnus  <tburnus@baylibre.com>
111         * parser.cc (cp_parser_omp_declare_target): Set target-used bit
112         in omp_requires_mask.
114 2024-09-24  Jakub Jelinek  <jakub@redhat.com>
116         PR c++/107637
117         * cp-tree.h: Implement C++23 P2718R0 - Wording for P2644R1 Fix for
118         Range-based for Loop.
119         (cp_convert_omp_range_for): Add bool tmpl_p argument.
120         (find_range_for_decls): Declare.
121         * parser.cc (cp_convert_range_for): For flag_range_for_ext_temps call
122         push_stmt_list () before cp_finish_decl for range_temp and save it
123         temporarily to FOR_INIT_STMT.
124         (cp_convert_omp_range_for): Add tmpl_p argument.  If set, remember
125         DECL_NAME of range_temp and for cp_finish_decl call restore it before
126         clearing it again, if unset, don't adjust DECL_NAME of range_temp at
127         all.
128         (cp_parser_omp_loop_nest): For flag_range_for_ext_temps range for add
129         CLEANUP_POINT_EXPR around sl.  Call find_range_for_decls and adjust
130         DECL_NAMEs for range fors if not processing_template_decl.  Adjust
131         cp_convert_omp_range_for caller.  Remove superfluous backslash at the
132         end of line.
133         * decl.cc (initialize_local_var): For flag_range_for_ext_temps
134         temporarily clear stmts_are_full_exprs_p rather than set for
135         for_range__identifier decls.
136         * call.cc (extend_ref_init_temps): For flag_range_for_ext_temps return
137         init early for for_range__identifier decls.
138         * semantics.cc (find_range_for_decls): New function.
139         (finish_for_stmt): Use it.  For flag_range_for_ext_temps if
140         cp_convert_range_for set FOR_INIT_STMT, pop_stmt_list it and wrap
141         into CLEANUP_POINT_EXPR.
142         * pt.cc (tsubst_omp_for_iterator): Adjust tsubst_omp_for_iterator
143         caller.
144         (tsubst_stmt) <case OMP_FOR>: For flag_range_for_ext_temps if there
145         are any range fors in the loop nest, add push_stmt_list starting
146         before the initializations, pop_stmt_list it after the body and wrap
147         into CLEANUP_POINT_EXPR.  Change DECL_NAME of range for temps from
148         NULL to for_range_identifier.
150 2024-09-24  Nina Dinka Ranns  <dinka.ranns@googlemail.com>
152         PR c++/116490
153         * contracts.cc (build_contract_condition_function): added
154         a check for comdat group of the guarded function. If set,
155         the condition check function is added to the same comdat
156         group.
158 2024-09-24  Tobias Burnus  <tburnus@baylibre.com>
160         * parser.cc (cp_parser_omp_requires): Handle self_maps clause.
162 2024-09-23  Marek Polacek  <polacek@redhat.com>
164         PR c++/116798
165         * parser.cc (cp_parser_parameter_declaration): Detect an explicit
166         object parameter in a requires expression.
168 2024-09-23  Simon Martin  <simon@nasilyan.com>
170         PR c++/109790
171         PR c++/100632
172         * mangle.cc (write_member_name): Handle members whose type is an
173         anonymous union member. Write missing "on" marker for operators
174         when ABI version is at least 16.
176 2024-09-23  Simon Martin  <simon@nasilyan.com>
178         PR c++/116722
179         * constexpr.cc (cxx_bind_parameters_in_call): Leave early for
180         {con,de}structors of classes with virtual bases.
182 2024-09-20  David Malcolm  <dmalcolm@redhat.com>
184         PR other/116613
185         * cp-tree.h (cxx_print_error_function): Convert first param
186         from diagnostic_context * to diagnostic_text_output_format &.
187         * error.cc: Include "diagnostic-format-text.h".
188         (cxx_initialize_diagnostics): Update for renamings.
189         (cxx_print_error_function): Convert first param from
190         diagnostic_context * to diagnostic_text_output_format & and update
191         accordingly
192         (cp_diagnostic_starter): Rename to...
193         (cp_diagnostic_text_starter): ...this.  Convert first
194         param from diagnostic_context * to diagnostic_text_output_format &
195         and update accordingly.
196         (cp_print_error_function): Likewise.
197         (print_instantiation_full_context): Likewise.
198         (print_instantiation_partial_context_line): Likewise.
199         (print_instantiation_partial_context): Likewise.
200         (maybe_print_instantiation_context): Likewise.
201         (maybe_print_constexpr_context): Likewise.
202         (print_location): Likewise.
203         (print_constrained_decl_info): Likewise.
204         (print_concept_check_info): Likewise.
205         (print_constraint_context_head): Likewise.
206         (print_requires_expression_info): Likewise.
207         (maybe_print_single_constraint_context): Likewise.
209 2024-09-20  Patrick Palka  <ppalka@redhat.com>
211         DR 2789
212         * call.cc (cand_parms_match): Check for matching class contexts
213         even in the reversed case.
215 2024-09-20  Patrick Palka  <ppalka@redhat.com>
217         PR c++/116492
218         DR 2789
219         * call.cc (object_parms_correspond): Remove.
220         (cand_parms_match): Return false for member functions that come
221         from different classes.  Adjust call to object_parms_correspond.
222         (joust): Update comment for the non-template "more constrained"
223         case.
225 2024-09-20  Patrick Palka  <ppalka@redhat.com>
227         DR 2273
228         * call.cc (joust): Restrict inheritedness tiebreaker to
229         constructors.
231 2024-09-20  Iain Sandoe  <iain@sandoe.co.uk>
233         * coroutines.cc (coro_build_artificial_var_with_dve): New.
234         (coro_build_and_push_artificial_var): New.
235         (coro_build_and_push_artificial_var_with_dve): New.
236         (analyze_fn_parms): Ensure that frame entries cannot clash
237         with local variables.
238         (build_coroutine_frame_delete_expr): Amend comment.
239         (cp_coroutine_transform::build_ramp_function): Rework to
240         avoid manual management of variables and scopes.
242 2024-09-19  Marek Polacek  <polacek@redhat.com>
244         PR c++/116162
245         * class.cc (check_bases_and_members): Don't set DECL_DELETED_FN here,
246         leave it to defaulted_late_check.
247         * cp-tree.h (maybe_delete_defaulted_fn): Declare.
248         (defaulted_late_check): Add a tristate parameter.
249         * method.cc (maybe_delete_defaulted_fn): New.
250         (defaulted_late_check): Add a tristate parameter.  Call
251         maybe_delete_defaulted_fn instead of giving an error.
253 2024-09-18  Patrick Palka  <ppalka@redhat.com>
255         PR c++/116714
256         PR c++/107390
257         * pt.cc (dependent_opaque_alias_p): Also return true for a
258         decltype(lambda) alias.
260 2024-09-18  Jason Merrill  <jason@redhat.com>
262         * call.cc (do_warn_dangling_reference): Return temporary
263         instead of the call it's passed to.
264         (maybe_warn_dangling_reference): Adjust diagnostic.
266 2024-09-18  Jason Merrill  <jason@redhat.com>
268         PR c++/115361
269         * call.cc (do_warn_dangling_reference): Check is_empty_class.
271 2024-09-17  Marek Polacek  <polacek@redhat.com>
273         PR c++/116741
274         * constexpr.cc (cxx_eval_constant_expression) <case CONVERT_EXPR>: If
275         the result of build_fold_indirect_ref is a COMPONENT_REF, use its op1.
276         Check DECL_P before calling inform.
278 2024-09-17  Marek Polacek  <polacek@redhat.com>
280         PR c++/116676
281         * constexpr.cc (maybe_warn_about_constant_value): Check DECL_NAME.
283 2024-09-15  Jason Merrill  <jason@redhat.com>
285         * parser.cc (cp_parser_unary_expression) [RID_EXTENSION]: Also
286         suppress -Wconditionally-supported.
288 2024-09-15  Jason Merrill  <jason@redhat.com>
290         * call.cc (convert_like_internal) [ck_user]: Use iloc_sentinel.
292 2024-09-15  Iain Sandoe  <iain@sandoe.co.uk>
294         PR c++/115905
295         * coroutines.cc (struct coro_aw_data): Add a member for the
296         restart dispatch label.
297         (expand_one_await_expression): Rework to modernise and to
298         handle the boolean await_suspend() case.
299         (build_actor_fn): Rework the dispatcher and allow for a jump
300         back to the dispatcher.
302 2024-09-14  Jason Merrill  <jason@redhat.com>
304         * tree.cc (handle_init_priority_attribute): Check
305         in_system_header_at.
307 2024-09-14  Simon Martin  <simon@nasilyan.com>
309         PR c++/116681
310         * name-lookup.cc (qualified_namespace_lookup): Use an
311         auto_cond_timer instead of using timevar_start and timevar_stop.
313 2024-09-13  Jason Merrill  <jason@redhat.com>
315         PR c++/116696
316         * constexpr.cc (explain_invalid_constexpr_fn): When
317         -fimplicit-constexpr, also explain inline functions, and point out
318         non-inline functions.
320 2024-09-13  Jakub Jelinek  <jakub@redhat.com>
322         PR c++/116678
323         * optimize.cc: Include decl.h.
324         (maybe_thunk_body): Temporarily change deprecated_state to
325         UNAVAILABLE_DEPRECATED_SUPPRESS.
327 2024-09-12  Jonathan Wakely  <jwakely@redhat.com>
329         PR c++/116673
330         * semantics.cc (finish_builtin_launder): Diagnose function
331         pointers and cv void pointers.
333 2024-09-12  Patrick Palka  <ppalka@redhat.com>
335         PR c++/116418
336         * tree.cc (strip_typedefs_expr) <case STATEMENT_LIST>: Replace
337         this error path with ...
338         <case STMT_EXPR>: ... this, returning the original tree.
340 2024-09-12  Jakub Jelinek  <jakub@redhat.com>
342         PR c++/116636
343         * method.cc: Include decl.h.
344         (use_thunk): Temporarily change deprecated_state to
345         UNAVAILABLE_DEPRECATED_SUPPRESS.
347 2024-09-12  Marek Polacek  <polacek@redhat.com>
349         PR c++/96097
350         * pt.cc (coerce_template_template_parm): Increment
351         processing_template_decl before calling tsubst.
353 2024-09-12  Simon Martin  <simon@nasilyan.com>
355         PR c++/116323
356         * search.cc (get_parent_with_private_access): Only call access_in_type
357         for RECORD_OR_UNION_TYPE_P base BINFOs.
359 2024-09-12  Nathaniel Shead  <nathanieloshead@gmail.com>
361         PR c++/116496
362         * module.cc (trees_in::decl_value): Don't call
363         set_defining_module_for_partial_spec here.
364         (depset::hash::add_partial_entities): Clarity assertions.
365         * pt.cc (add_mergeable_specialization): Always call
366         set_defining_module_for_partial_spec when adding a partial spec.
368 2024-09-11  Alex Coplan  <alex.coplan@arm.com>
370         PR libstdc++/116140
371         * semantics.cc (anotate_saver): New. Use it ...
372         (maybe_convert_cond): ... here, to ensure any ANNOTATE_EXPRs
373         remain the outermost expression(s) of the condition.
375 2024-09-10  Jakub Jelinek  <jakub@redhat.com>
377         PR c++/116449
378         * typeck.cc (get_member_function_from_ptrfunc): Use save_expr
379         on instance_ptr and function even if it doesn't have side-effects,
380         as long as it isn't a decl.
382 2024-09-10  Marek Polacek  <polacek@redhat.com>
384         PR c++/116369
385         * call.cc (set_up_extended_ref_temp): Don't mark a temporary
386         TREE_READONLY if its type is TYPE_HAS_MUTABLE_P.
388 2024-09-09  David Malcolm  <dmalcolm@redhat.com>
390         * constexpr.cc (constexpr_error): Update for renaming of
391         diagnostic_info field.
392         * cp-tree.h (pedwarn_cxx98): Use "diagnostic_option_id" rather
393         than "int".
394         * error.cc (cp_adjust_diagnostic_info): Update for renaming of
395         diagnostic_info field.
396         (pedwarn_cxx98): Use "diagnostic_option_id option_id" rather than
397         "int opt".  Update for renaming of diagnostic_info field.
398         (diagnostic_set_info): Likewise.
400 2024-09-09  David Malcolm  <dmalcolm@redhat.com>
402         PR other/116613
403         * error.cc (cxx_initialize_diagnostics): Rename
404         diagnostic_context's "printer" field to "m_printer".
405         (cxx_print_error_function): Likewise.
406         (cp_diagnostic_starter): Likewise.
407         (cp_print_error_function): Likewise.
408         (print_instantiation_full_context): Likewise.
409         (print_instantiation_partial_context_line): Likewise.
410         (maybe_print_constexpr_context): Likewise.
411         (print_location): Likewise.
412         (print_constrained_decl_info): Likewise.
413         (print_concept_check_info): Likewise.
414         (print_constraint_context_head): Likewise.
415         (print_requires_expression_info): Likewise.
416         * module.cc (noisy_p): Likewise.
418 2024-09-07  Jason Merrill  <jason@redhat.com>
420         * decl.cc (check_redeclaration_exception_specification): Remove
421         OPT_Wsystem_headers from pedwarn when the old declaration is
422         in a system header.  Also check std namespace.
424 2024-09-07  Patrick Palka  <ppalka@redhat.com>
426         PR c++/116567
427         * pt.cc (coerce_template_parms): Set tf_partial when substituting
428         into a default template argument in a template context.
429         (build_extra_args): Set TREE_STATIC on the deferred args if this
430         is a partial substitution.
431         (add_extra_args): Check TREE_STATIC instead of dependence of args.
432         Adjust merging behavior in that case.
433         (tsubst_lammda_expr): Check for tf_partial instead of dependence
434         of args when determining whether to defer substitution.
435         (tsubst_expr) <case LAMBDA_EXPR>: Remove tf_partial early exit.
437 2024-09-06  Jakub Jelinek  <jakub@redhat.com>
439         PR c++/115769
440         * cp-tree.h: Partially implement CWG 2867 - Order of initialization
441         for structured bindings.
442         (cp_finish_decomp): Add TEST_P argument defaulted to false.
443         * decl.cc (initialize_local_var): Add DECOMP argument, if true,
444         don't build cleanup and temporarily override stmts_are_full_exprs_p
445         to 0 rather than 1.  Formatting fix.
446         (cp_finish_decl): Invoke cp_finish_decomp for structured bindings
447         here, first with test_p.  For automatic structured binding bases
448         if the test cp_finish_decomp returned true wrap the initialization
449         together with what non-test cp_finish_decomp emits with a
450         CLEANUP_POINT_EXPR, and if there are any CLEANUP_STMTs needed, emit
451         them around the whole CLEANUP_POINT_EXPR with guard variables for the
452         cleanups.  Call cp_finish_decomp using RAII if not called with
453         decomp != NULL otherwise.
454         (cp_finish_decomp): Add TEST_P argument, change return type from
455         void to bool, if TEST_P is true, return true instead of emitting
456         actual code for the tuple case, otherwise return false.
457         * parser.cc (cp_convert_range_for): Don't call cp_finish_decomp
458         after cp_finish_decl.
459         (cp_parser_decomposition_declaration): Set DECL_DECOMP_BASE
460         before cp_finish_decl call.  Don't call cp_finish_decomp after
461         cp_finish_decl.
462         (cp_finish_omp_range_for): Don't call cp_finish_decomp after
463         cp_finish_decl.
464         * pt.cc (tsubst_stmt): Likewise.
466 2024-09-06  Jason Merrill  <jason@redhat.com>
468         PR c++/46457
469         PR c++/81665
470         * cp-objcp-common.h (cp_objcp_attribute_table): Add
471         c_common_clang_attribute_table.
473 2024-09-05  Marek Polacek  <polacek@redhat.com>
475         PR c++/116606
476         * decl2.cc (mark_vtable_entries): Temporarily override deprecated_state to
477         UNAVAILABLE_DEPRECATED_SUPPRESS.  Remove a warning_sentinel.
479 2024-09-05  Iain Sandoe  <iain@sandoe.co.uk>
481         * coroutines.cc
482         (cp_coroutine_transform::build_ramp_function): Separate the
483         build of promise constructor and destructor.  When evaluating
484         the constructor, check that build_special_member_call returns
485         an expression with side effects before adding it.
487 2024-09-05  Patrick Palka  <ppalka@redhat.com>
489         PR c++/113063
490         * name-lookup.cc (local_state_t): Clear and restore
491         cp_noexcept_operand as well.
493 2024-09-05  Marek Polacek  <polacek@redhat.com>
495         PR c++/116239
496         * cp-tree.h (validate_constexpr_redeclaration): Declare.
497         * decl.cc (validate_constexpr_redeclaration): No longer static.
498         * name-lookup.cc (push_local_extern_decl_alias): Call
499         validate_constexpr_redeclaration.
501 2024-09-05  Nathaniel Shead  <nathanieloshead@gmail.com>
503         * class.cc (add_method): Add missing auto_diagnostic_group.
504         (handle_using_decl): Likewise.
505         (maybe_warn_about_overly_private_class): Likewise.
506         (check_field_decl): Likewise.
507         (check_field_decls): Likewise.
508         (resolve_address_of_overloaded_function): Likewise.
509         (note_name_declared_in_class): Likewise.
510         * constraint.cc (associate_classtype_constraints): Likewise.
511         (diagnose_trait_expr): Clean up whitespace.
512         * coroutines.cc (find_coro_traits_template_decl): Add missing
513         auto_diagnostic_group.
514         (coro_promise_type_found_p): Likewise.
515         (coro_diagnose_throwing_fn): Likewise.
516         * cvt.cc (build_expr_type_conversion): Likewise.
517         * decl.cc (validate_constexpr_redeclaration): Likewise.
518         (duplicate_function_template_decls): Likewise.
519         (duplicate_decls): Likewise.
520         (lookup_label_1): Likewise.
521         (check_previous_goto_1): Likewise.
522         (check_goto_1): Likewise.
523         (make_typename_type): Likewise.
524         (make_unbound_class_template): Likewise.
525         (check_tag_decl): Likewise.
526         (start_decl): Likewise.
527         (maybe_commonize_var): Likewise.
528         (check_for_uninitialized_const_var): Likewise.
529         (reshape_init_class): Likewise.
530         (check_initializer): Likewise.
531         (cp_finish_decl): Likewise.
532         (find_decomp_class_base): Likewise.
533         (cp_finish_decomp): Likewise.
534         (expand_static_init): Likewise.
535         (grokfndecl): Likewise.
536         (grokdeclarator): Likewise.
537         (check_elaborated_type_specifier): Likewise.
538         (lookup_and_check_tag): Likewise.
539         (xref_tag): Likewise.
540         (cxx_simulate_enum_decl): Likewise.
541         (finish_function): Likewise.
542         * decl2.cc (check_classfn): Likewise.
543         (record_mangling): Likewise.
544         (mark_used): Likewise.
545         * error.cc (qualified_name_lookup_error): Likewise.
546         * except.cc (build_throw): Likewise.
547         * init.cc (get_nsdmi): Likewise.
548         (diagnose_uninitialized_cst_or_ref_member_1): Likewise.
549         (warn_placement_new_too_small): Likewise.
550         (build_new_1): Likewise.
551         (build_vec_delete_1): Likewise.
552         (build_delete): Likewise.
553         * lambda.cc (add_capture): Likewise.
554         (add_default_capture): Likewise.
555         * lex.cc (unqualified_fn_lookup_error): Likewise.
556         * method.cc (synthesize_method): Likewise.
557         (defaulted_late_check): Likewise.
558         * module.cc (trees_in::is_matching_decl): Likewise.
559         (trees_in::read_enum_def): Likewise.
560         (module_state::check_not_purview): Likewise.
561         (module_state::deferred_macro): Likewise.
562         (module_state::read_config): Likewise.
563         (module_state::check_read): Likewise.
564         (declare_module): Likewise.
565         (init_modules): Likewise.
566         * name-lookup.cc (diagnose_name_conflict): Likewise.
567         (lookup_using_decl): Likewise.
568         (set_decl_namespace): Likewise.
569         (finish_using_directive): Likewise.
570         (push_namespace): Likewise.
571         (add_imported_namespace): Likewise.
572         * parser.cc (cp_parser_check_for_definition_in_return_type): Likewise.
573         (cp_parser_userdef_numeric_literal): Likewise.
574         (cp_parser_nested_name_specifier_opt): Likewise.
575         (cp_parser_new_expression): Likewise.
576         (cp_parser_binary_expression): Likewise.
577         (cp_parser_lambda_introducer): Likewise.
578         (cp_parser_module_declaration): Likewise.
579         (cp_parser_import_declaration): Likewise, removing gotos to
580         support this.
581         (cp_parser_declaration): Add missing auto_diagnostic_group.
582         (cp_parser_decl_specifier_seq): Likewise.
583         (cp_parser_template_id): Likewise.
584         (cp_parser_template_name): Likewise.
585         (cp_parser_explicit_specialization): Likewise.
586         (cp_parser_placeholder_type_specifier): Likewise.
587         (cp_parser_elaborated_type_specifier): Likewise.
588         (cp_parser_enum_specifier): Likewise.
589         (cp_parser_asm_definition): Likewise.
590         (cp_parser_init_declarator): Likewise.
591         (cp_parser_direct_declarator): Likewise.
592         (cp_parser_class_head): Likewise.
593         (cp_parser_member_declaration): Likewise.
594         (cp_parser_lookup_name): Likewise.
595         (cp_parser_explicit_template_declaration): Likewise.
596         (cp_parser_check_class_key): Likewise.
597         * pt.cc (maybe_process_partial_specialization): Likewise.
598         (determine_specialization): Likewise.
599         (check_for_bare_parameter_packs): Likewise.
600         (check_template_shadow): Likewise.
601         (process_partial_specialization): Likewise.
602         (push_template_decl): Likewise.
603         (redeclare_class_template): Likewise.
604         (convert_nontype_argument_function): Likewise.
605         (check_valid_ptrmem_cst_expr): Likewise.
606         (convert_nontype_argument): Likewise.
607         (convert_template_argument): Likewise.
608         (coerce_template_parms): Likewise.
609         (tsubst_qualified_id): Likewise.
610         (tsubst_expr): Likewise.
611         (most_specialized_partial_spec): Likewise.
612         (do_class_deduction): Likewise.
613         (do_auto_deduction): Likewise.
614         * search.cc (lookup_member): Likewise.
615         * semantics.cc (finish_non_static_data_member): Likewise.
616         (process_outer_var_ref): Likewise.
617         (finish_id_expression_1): Likewise.
618         (finish_offsetof): Likewise.
619         (omp_reduction_lookup): Likewise.
620         (finish_omp_clauses): Likewise.
621         * tree.cc (check_abi_tag_redeclaration): Likewise.
622         (check_abi_tag_args): Likewise.
623         * typeck.cc (invalid_nonstatic_memfn_p): Likewise.
624         (complain_about_unrecognized_member): Likewise.
625         (finish_class_member_access_expr): Likewise.
626         (error_args_num): Likewise.
627         (warn_for_null_address): Likewise.
628         (cp_build_binary_op): Likewise.
629         (build_x_unary_op): Likewise.
630         (cp_build_unary_op): Likewise.
631         (build_static_cast): Likewise.
632         (cp_build_modify_expr): Likewise.
633         (get_delta_difference): Likewise.
634         (convert_for_assignment): Widen scope of auto_diagnostic_group.
635         (check_return_expr): Add missing auto_diagnostic_group.
636         * typeck2.cc (cxx_incomplete_type_diagnostic): Likewise.
638 2024-09-04  Marek Polacek  <polacek@redhat.com>
640         * pt.cc (coerce_template_template_parm): Return bool instead of int.
642 2024-09-04  Marek Polacek  <polacek@redhat.com>
644         PR c++/113108
645         * pt.cc (resolve_overloaded_unification): Call
646         maybe_instantiate_noexcept.
648 2024-09-03  Jason Merrill  <jason@redhat.com>
650         * parser.cc (cp_nth_tokens_can_be_std_attribute_p): Don't check
651         cxx_dialect.
652         * error.cc (maybe_warn_cpp0x): Only complain about C++11 attributes
653         if pedantic.
655 2024-09-03  David Malcolm  <dmalcolm@redhat.com>
657         * error.cc (type_to_string): Prefix all output_buffer fields with
658         "m_".
659         (append_formatted_chunk): Likewise.  Rename "chunk_info" to
660         "pp_formatted_chunks" and field cur_chunk_array with
661         m_cur_formatted_chunks.
663 2024-09-02  Richard Sandiford  <richard.sandiford@arm.com>
665         * pt.cc (tsubst_stmt): Rename ASM_INPUT_P to ASM_BASIC_P.
666         * parser.cc (cp_parser_asm_definition): Likewise.
668 2024-08-31  Iain Sandoe  <iain@sandoe.co.uk>
670         * coroutines.cc (coro_build_frame_access_expr): New.
671         (transform_await_expr): Use coro_build_frame_access_expr.
672         (transform_local_var_uses): Likewise.
673         (build_actor_fn): Likewise.
674         (build_destroy_fn): Likewise.
675         (cp_coroutine_transform::build_ramp_function): Likewise.
677 2024-08-30  Jason Merrill  <jason@redhat.com>
679         * decl2.cc (c_parse_final_cleanups): Also check
680         DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION.
682 2024-08-30  Jakub Jelinek  <jakub@redhat.com>
684         PR c++/110345
685         * parser.cc (make_array_declarator): Add STD_ATTRS argument, set
686         declarator->std_attributes to it.
687         (cp_parser_new_type_id): Warn on non-ignored std_attributes on the
688         array declarator which is being omitted.
689         (cp_parser_direct_new_declarator): Parse standard attributes after
690         closing square bracket, pass it to make_array_declarator.
691         (cp_parser_direct_declarator): Pass std_attrs to make_array_declarator
692         instead of setting declarator->std_attributes manually.
694 2024-08-29  David Malcolm  <dmalcolm@redhat.com>
696         * error.cc: Include "make-unique.h".
697         (deferred_printed_type::m_buffer_ptr): Replace with...
698         (deferred_printed_type::m_printed_text): ...this and...
699         (deferred_printed_type::m_token_list): ...this.
700         (deferred_printed_type::deferred_printed_type): Update ctors for
701         above changes.
702         (deferred_printed_type::set_text_for_token_list): New.
703         (append_formatted_chunk): Pass chunk_obstack to
704         append_formatted_chunk.
705         (add_quotes): Delete.
706         (cxx_format_postprocessor::handle): Reimplement to call
707         deferred_printed_type::set_text_for_token_list, rather than store
708         buffer pointers.
709         (defer_phase_2_of_type_diff): Replace param "buffer_ptr"
710         with "formatted_token_list".  Reimplement by storing
711         a pointer to formatted_token_list so that the postprocessor can
712         put its text there.
713         (cp_printer): Convert param "buffer_ptr" to
714         "formatted_token_list".  Update calls to
715         defer_phase_2_of_type_diff accordingly.
717 2024-08-29  David Malcolm  <dmalcolm@redhat.com>
719         * error.cc: Include "pretty-print-format-impl.h".
721 2024-08-28  Marek Polacek  <polacek@redhat.com>
723         PR c++/116476
724         * call.cc (maybe_init_list_as_array): Try convert_like and see if it
725         worked.
727 2024-08-28  Marek Polacek  <polacek@redhat.com>
729         PR c++/116424
730         * typeck2.cc (process_init_constructor_record): Move the clearing of
731         TARGET_EXPR_ELIDING_P down.
733 2024-08-28  Jason Merrill  <jason@redhat.com>
735         * parser.cc (cp_parser_simple_type_specifier): Use
736         -Wc++20-extensions for auto parameter pedwarn.
737         * pt.cc (do_decl_instantiation, do_type_instantiation): Use
738         -Wc++11-extensions for 'extern template'.
740 2024-08-27  Arsen Arsenović  <arsen@aarsen.me>
742         PR c++/109867
743         * coroutines.cc (expand_one_await_expression): Replace uses of
744         build_case_label with finish_case_label.
745         (build_actor_fn): Ditto.
746         (create_anon_label_with_ctx): Remove now-unused function.
748 2024-08-27  Simon Martin  <simon@nasilyan.com>
750         PR c++/105483
751         * parser.cc (cp_parser_expression_statement): Use %qE instead of
752         incorrect %<%T::%D%>. Skip to end of statement and return
753         error_mark_node in case of error.
755 2024-08-27  Jonathan Wakely  <jwakely@redhat.com>
757         * cxxapi-data.csv: Add C++20 and C++23 names from <chrono>,
758         <format>, <generator>, <iterator>, <print>, and <stdfloat>.
759         Set cxx11 dialect for std::ignore in <tuple>. Uncomment
760         atomic_flag functions from <atomic>.
761         * std-name-hint.gperf: Regenerate.
762         * std-name-hint.h: Regenerate.
764 2024-08-27  Jonathan Wakely  <jwakely@redhat.com>
766         * gen-cxxapi-file.py: Fix copyright dates in generated output.
768 2024-08-27  Iain Sandoe  <iain@sandoe.co.uk>
770         PR c++/116482
771         * coroutines.cc
772         (coro_build_actor_or_destroy_function): Make the parameter
773         decls DECL_ARTIFICIAL.
775 2024-08-27  Nathaniel Shead  <nathanieloshead@gmail.com>
777         PR c++/99243
778         * module.cc (module_state::set_filename): Handle repeated calls
779         to 'set_filename' as long as the CMI path matches.
780         (maybe_translate_include): Adjust comment.
782 2024-08-27  Nathaniel Shead  <nathanieloshead@gmail.com>
784         PR c++/110980
785         * module.cc (maybe_translate_include): Clean up.
787 2024-08-26  Arsen Arsenović  <arsen@aarsen.me>
789         PR c++/113457
790         * coroutines.cc (struct coroutine_info): Add integer field
791         awaitable_number.  This is a counter used for assigning unique
792         names to awaitable temporaries.
793         (get_awaitable_var): Use awaitable_number from coroutine_info
794         instead of the static int awn.
796 2024-08-26  Simon Martin  <simon@nasilyan.com>
798         PR c++/115716
799         * pt.cc (maybe_process_partial_specialization): Call
800         redeclare_class_template.
802 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
804         PR c++/110635
805         * coroutines.cc
806         (cp_coroutine_transform::wrap_original_function_body): Look through
807         initial await target expressions to find the actual co_await_expr
808         that we need to update.
810 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
812         PR c++/102051
813         * coroutines.cc
814         (cp_coroutine_transform::build_ramp_function): Handle
815         "throwing_cleanup" here instead of ...
816         (cp_coroutine_transform::apply_transforms): ... here.
818 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
820         PR c++/115908
821         * coroutines.cc
822         (cp_coroutine_transform::build_ramp_function): Rework the return
823         value initialisation to initialise the return slot always from
824         get_return_object,  even if that implies carrying out conversions
825         to do so.
827 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
829         PR c++/109682
830         * coroutines.cc
831         (cp_coroutine_transform::build_ramp_function): Allow for cases where
832         get_return_on_allocation_fail has a type convertible to the ramp
833         return type.
835 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
837         PR c++/100476
838         * coroutines.cc
839         (cp_coroutine_transform::build_ramp_function): Remove special
840         handling of void get_return_object expressions.
842 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
844         PR c++/113773
845         * coroutines.cc
846         (cp_coroutine_transform::build_ramp_function): Only cleanup the
847         frame state on exceptions that occur before the initial await
848         resume has begun.
850 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
852         * call.cc (build_op_delete_call_1): Renamed and added a param
853         to allow the caller to prioritize two argument usual deleters.
854         (build_op_delete_call): New.
855         (build_coroutine_op_delete_call): New.
856         * coroutines.cc (coro_get_frame_dtor): Rename...
857         (build_coroutine_frame_delete_expr):... to this; simplify to
858         use build_op_delete_call for all cases.
859         (build_actor_fn): Use revised frame delete function.
860         (build_coroutine_frame_alloc_expr): New.
861         (cp_coroutine_transform::complete_ramp_function): Rename...
862         (cp_coroutine_transform::build_ramp_function): ... to this.
863         Reorder code to carry out checks for prerequisites before the
864         codegen. Split out the allocation/delete code.
865         (cp_coroutine_transform::apply_transforms): Use revised name.
866         * coroutines.h: Rename function.
867         * cp-tree.h (build_coroutine_op_delete_call): New.
869 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
870             Arsen Arsenović  <arsen@aarsen.me>
872         * coroutines.cc (struct suspend_point_info, struct param_info,
873         struct local_var_info, struct susp_frame_data,
874         struct local_vars_frame_data): Move to coroutines.h.
875         (build_actor_fn): Use start/finish function APIs.
876         (build_destroy_fn): Likewise.
877         (coro_build_actor_or_destroy_function): No longer mark the
878         actor / destroyer as DECL_COROUTINE_P.
879         (coro_rewrite_function_body): Use class members.
880         (cp_coroutine_transform::wrap_original_function_body): Likewise.
881         (build_ramp_function): Replace by...
882         (cp_coroutine_transform::complete_ramp_function): ...this.
883         (cp_coroutine_transform::cp_coroutine_transform): New.
884         (cp_coroutine_transform::~cp_coroutine_transform): New
885         (morph_fn_to_coro): Replace by...
886         (cp_coroutine_transform::apply_transforms): ...this.
887         (cp_coroutine_transform::finish_transforms): New.
888         * cp-tree.h (morph_fn_to_coro): Remove.
889         * decl.cc (emit_coro_helper): Remove.
890         (finish_function): Revise handling of coroutine transforms.
891         * coroutines.h: New file.
893 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
895         * coroutines.cc (build_actor_fn): Arrange to apply any
896         required parameter copy DTORs in reverse order to their
897         creation.
898         (coro_rewrite_function_body): Handle revised param uses.
899         (morph_fn_to_coro): Split the ramp function completion
900         into a separate function.
901         (build_ramp_function): New.
903 2024-08-24  Iain Sandoe  <iain@sandoe.co.uk>
905         * coroutines.cc (build_co_await): Simplify checks for the cases that
906         we need to materialise an awaiter.
908 2024-08-21  Iain Sandoe  <iain@sandoe.co.uk>
910         * coroutines.cc (split_coroutine_body_from_ramp): Check
911         that the binding level is as expected before attempting
912         to outline the function body.
914 2024-08-20  Nathaniel Shead  <nathanieloshead@gmail.com>
916         * module.cc (module_state::write_begin): Return a boolean to
917         indicate errors rather than just doing set_error().
918         (finish_module_processing): Prevent emission of unnecessary
919         errors; only indicate module writing occurred if write_begin
920         succeeds.
922 2024-08-20  Jakub Jelinek  <jakub@redhat.com>
924         PR c++/110345
925         * decl.cc (grokdeclarator): Apply declarator->std_attributes
926         for cdk_array to type, rather than chaining it to returned_attrs.
928 2024-08-20  Jakub Jelinek  <jakub@redhat.com>
930         PR c++/110345
931         * parser.cc (cp_parser_base_specifier): Parse standard attributes
932         at the start and emit a warning if there are any non-ignored ones.
934 2024-08-20  Franciszek Witt  <franek.witt@gmail.com>
936         PR c++/101232
937         * parser.cc (cp_parser_postfix_expression): Commit to the
938         parse in case we know its either a cast or invalid syntax.
939         (cp_parser_braced_list): Add a heuristic to inform about
940         missing comma or operator.
942 2024-08-20  Patrick Palka  <ppalka@redhat.com>
944         PR c++/101463
945         * pt.cc (type_unification_real): Directly look for undeduced
946         parameters in the default argument instead of doing a trial
947         substitution.
949 2024-08-20  Nathaniel Shead  <nathanieloshead@gmail.com>
951         PR c++/115020
952         * module.cc (has_definition): Only force writing definitions for
953         header_module_p.
955 2024-08-20  Nathaniel Shead  <nathanieloshead@gmail.com>
957         PR c++/116403
958         * pt.cc (deduction_guides_for): Use ANY_REACHABLE for lookup of
959         deduction guides.
960         * module.cc (depset::hash::add_deduction_guides): Likewise.
961         (module_state::write_cluster): No longer override deduction
962         guides as exported.
963         * name-lookup.cc (name_lookup::search_namespace_only): Ignore
964         visibility when LOOK_want::ANY_REACHABLE is specified.
965         (check_module_override): Ignore visibility when checking for
966         ambiguating deduction guides.
967         * name-lookup.h (LOOK_want): New flag 'ANY_REACHABLE'.
969 2024-08-20  Nathaniel Shead  <nathanieloshead@gmail.com>
971         PR c++/116382
972         * cp-tree.h (get_template_parm_object): Add check_init param.
973         * module.cc (trees_in::tree_node): Pass check_init=false when
974         building NTTPs.
975         * pt.cc (get_template_parm_object): Prevent cp_finish_decl from
976         validating the initializer when check_init=false.
978 2024-08-20  Nathaniel Shead  <nathanieloshead@gmail.com>
980         PR c++/116364
981         * cp-tree.h (get_mergeable_specialization_flags): Adjust
982         signature.
983         * module.cc (trees_out::decl_value): Indicate whether this is a
984         type or decl specialisation.
985         * pt.cc (get_mergeable_specialization_flags): Match against the
986         type of a non-decl specialisation.
987         (add_mergeable_specialization): Use the already calculated spec
988         instead of always adding decl to DECL_TEMPLATE_INSTANTIATIONS.
990 2024-08-19  Marek Polacek  <polacek@redhat.com>
992         PR c++/115657
993         * decl.cc (build_enumerator): Call maybe_fold_non_dependent_expr
994         instead of fold_non_dependent_expr.
996 2024-08-19  Marek Polacek  <polacek@redhat.com>
998         PR c++/116384
999         * pt.cc (tsubst_expr) <case IMPLICIT_CONV_EXPR>: Bail if tsubst
1000         returns error_mark_node.
1002 2024-08-16  Jakub Jelinek  <jakub@redhat.com>
1004         PR c++/110345
1005         * parser.cc (cp_parser_member_declaration): Call maybe_warn_extra_semi
1006         only if it is empty-declaration, if there are some tokens like
1007         attribute, pedwarn that the declaration doesn't declare anything.
1009 2024-08-15  Patrick Palka  <ppalka@redhat.com>
1011         PR c++/116320
1012         * semantics.cc (check_accessibility_of_qualified_id): Try
1013         currently_open_class when using the object type as the
1014         effective qualifying type.
1016 2024-08-15  Patrick Palka  <ppalka@redhat.com>
1018         PR c++/116327
1019         PR c++/104981
1020         PR c++/115550
1021         * coroutines.cc (morph_fn_to_coro): Use build_fold_indirect_ref
1022         instead of cp_build_fold_indirect_ref.
1024 2024-08-14  Marek Polacek  <polacek@redhat.com>
1026         PR c++/116015
1027         * call.cc (convert_for_arg_passing): Don't set_target_expr_eliding
1028         when the TARGET_EXPR initializer is a CONSTRUCTOR.
1030 2024-08-10  Patrick Palka  <ppalka@redhat.com>
1032         PR c++/116276
1033         * call.cc (joust): Implement P2582R1 inherited vs non-inherited
1034         guide tiebreaker.
1035         * cp-tree.h (lang_decl_fn::context): Document usage in
1036         deduction_guide_p FUNCTION_DECLs.
1037         (inherited_guide_p): Declare.
1038         * pt.cc (inherited_guide_p): Define.
1039         (set_inherited_guide_context): Define.
1040         (alias_ctad_tweaks): Use set_inherited_guide_context.
1041         (inherited_ctad_tweaks): Recognize some inherited constructors
1042         whose scope is a TYPENAME_TYPE.
1043         (ctor_deduction_guides_for): For C++23 inherited CTAD, iterate
1044         over TYPE_FIELDS instead of CLASSTYPE_CONSTRUCTORS to recognize
1045         all inherited constructors.
1047 2024-08-10  Patrick Palka  <ppalka@redhat.com>
1049         * pt.cc (tsubst_friend_class): Simplify depth comparison test
1050         in the redeclaration code path to
1051         DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P.  Clear the flag after
1052         partial instantiation here ...
1053         (tsubst_template_decl): ... instead of here.
1055 2024-08-10  Patrick Palka  <ppalka@redhat.com>
1057         * cp-tree.h (get_identifier_kind): Define.
1058         (IDENTIFIER_KEYWORD_P): Redefine in terms of get_identifier_kind.
1059         (IDENTIFIER_CDTOR_P): Likewise.
1060         (IDENTIFIER_CTOR_P): Likewise.
1061         (IDENTIFIER_DTOR_P): Likewise.
1062         (IDENTIFIER_ANY_OP_P): Likewise.
1063         (IDENTIFIER_OVL_OP_P): Likewise.
1064         (IDENTIFIER_ASSIGN_OP_P): Likewise.
1065         (IDENTIFIER_CONV_OP_P): Likewise.
1066         (IDENTIFIER_TRAIT_P): Likewise.
1067         * parser.cc (cp_lexer_peek_trait): Mark IDENTIFIER_TRAIT_P
1068         check UNLIKELY.
1070 2024-08-09  Simon Martin  <simon@nasilyan.com>
1072         PR c++/115806
1073         * decl.cc (start_enum): Only set OPAQUE_ENUM_P and
1074         ENUM_FIXED_UNDERLYING_TYPE_P when pushing a new tag.
1076 2024-08-08  Nathaniel Shead  <nathanieloshead@gmail.com>
1078         PR c++/115062
1079         * class.cc (fixup_type_variants): Propagate TREE_ADDRESSABLE.
1080         (finish_struct_bits): Cleanup now that TREE_ADDRESSABLE is
1081         propagated by fixup_type_variants.
1083 2024-08-08  Nathaniel Shead  <nathanieloshead@gmail.com>
1085         * module.cc (module_state::read_cluster): Assume header module
1086         declarations will require GM merging.
1088 2024-08-08  Nathaniel Shead  <nathanieloshead@gmail.com>
1090         PR c++/115801
1091         * pt.cc (tsubst_friend_class): Return the type immediately when
1092         no tsubsting or name lookup is required.
1094 2024-08-08  Nathaniel Shead  <nathanieloshead@gmail.com>
1096         PR c++/114950
1097         * module.cc (trees_out::decl_value): Stream bit indicating
1098         imported temploid friends early.
1099         (trees_in::decl_value): Use this bit with key_mergeable.
1100         (trees_in::key_mergeable): Allow merging attached declarations
1101         if they're imported temploid friends (which must be namespace
1102         scope).
1103         (module_state::read_cluster): Check for GM entities that may
1104         require merging even when importing from partitions.
1105         * name-lookup.cc (enum binding_slots): Adjust comment.
1106         (get_fixed_binding_slot): Always create partition slot.
1107         (name_lookup::search_namespace_only): Support binding vectors
1108         with both partition and GM entities to dedup.
1109         (walk_module_binding): Likewise.
1110         (name_lookup::adl_namespace_fns): Likewise.
1111         (set_module_binding): Likewise.
1112         (check_module_override): Use attachment of the decl when
1113         checking overrides rather than named_module_p.
1114         (lookup_imported_hidden_friend): Use partition slot for finding
1115         mergeable template bindings.
1116         * name-lookup.h (set_module_binding): Split mod_glob_flag
1117         parameter into separate global_p and partition_p params.
1119 2024-08-08  Nathaniel Shead  <nathanieloshead@gmail.com>
1121         * module.cc (trees_in::read_enum_def): Clarify error.
1123 2024-08-07  Patrick Palka  <ppalka@redhat.com>
1125         PR c++/116064
1126         * error.cc (get_current_template): If the current scope is
1127         a partial specialization, return it instead of the primary
1128         template.
1129         * pt.cc (instantiate_class_template): Pass the partial
1130         specialization if any to maybe_diagnose_erroneous_template
1131         instead of the primary template.
1133 2024-08-07  Julian Brown  <julian@codesourcery.com>
1134             Tobias Burnus  <tobias@baylibre.com>
1136         * decl2.cc (tree-inline.h): Include.
1137         (static_init_fini_fns): Bump to four entries. Update comment.
1138         (start_objects, start_partial_init_fini_fn): Add 'omp_target'
1139         parameter. Support "declare target" decls. Update forward declaration.
1140         (emit_partial_init_fini_fn): Add 'host_fn' parameter. Return tree for
1141         the created function. Support "declare target".
1142         (OMP_SSDF_IDENTIFIER): New macro.
1143         (partition_vars_for_init_fini): Support partitioning "declare target"
1144         variables also.
1145         (generate_ctor_or_dtor_function): Add 'omp_target' parameter. Support
1146         "declare target" decls.
1147         (c_parse_final_cleanups): Support constructors/destructors on OpenMP
1148         offload targets.
1150 2024-08-07  Jakub Jelinek  <jakub@redhat.com>
1152         PR c++/109126
1153         * decl.cc (grokvardecl): Implement CWG 2387 - Linkage of
1154         const-qualified variable template.  Set TREE_PUBLIC on variable
1155         templates with const qualified types unless static is present.
1157 2024-08-07  Simon Martin  <simon@nasilyan.com>
1159         PR c++/111592
1160         * call.cc (build_over_call): Only error out if there's a single
1161         parameter of type A in a call to A::A(...).
1163 2024-08-07  Jakub Jelinek  <jakub@redhat.com>
1165         PR c++/116175
1166         * pt.cc (apply_late_template_attributes): For function/method types
1167         call cp_build_type_attribute_variant on the non-dependent attributes.
1168         (rebuild_function_or_method_type): Add ARGS argument.  Use
1169         apply_late_template_attributes rather than
1170         cp_build_type_attribute_variant.
1171         (maybe_rebuild_function_decl_type): Add ARGS argument, pass it to
1172         rebuild_function_or_method_type.
1173         (tsubst_function_decl): Adjust caller.
1174         (tsubst_function_type): Adjust rebuild_function_or_method_type caller.
1176 2024-08-07  Nathaniel Shead  <nathanieloshead@gmail.com>
1178         PR c++/115231
1179         * error.cc (dump_function_decl): Add a space before '->' when
1180         printing deduction guides.
1181         * module.cc (depset::hash::add_binding_entity): Don't create
1182         bindings for guides here, only mark dependencies.
1183         (depset::hash::add_deduction_guides): New.
1184         (depset::hash::find_dependencies): Add deduction guide
1185         dependencies for a class template.
1186         (module_state::write_cluster): Always consider deduction guides
1187         as exported.
1188         * pt.cc (deduction_guides_for): Use 'lkp_iterator' instead of
1189         'ovl_iterator'.
1191 2024-08-07  Nathaniel Shead  <nathanieloshead@gmail.com>
1193         * parser.cc (cp_parser_class_head): Clarify error message for
1194         explicit instantiations.
1196 2024-08-07  Patrick Palka  <ppalka@redhat.com>
1198         PR c++/116064
1199         * cp-tree.h (erroneous_templates_t): Declare.
1200         (erroneous_templates): Declare.
1201         (cp_seen_error): Declare.
1202         (seen_error): #define to cp_seen_error.
1203         * error.cc (get_current_template): Define.
1204         (relaxed_template_errors): Define.
1205         (cp_adjust_diagnostic_info): Define.
1206         (cp_seen_error): Define.
1207         (cxx_initialize_diagnostics): Set
1208         diagnostic_context::m_adjust_diagnostic_info.
1209         * module.cc (finish_module_processing): Don't write the
1210         module if it contains an erroneous template.
1211         * pt.cc (maybe_diagnose_erroneous_template): Define.
1212         (instantiate_class_template): Call it.
1213         (instantiate_decl): Likewise.
1215 2024-08-06  Marek Polacek  <polacek@redhat.com>
1217         * constexpr.cc (cxx_eval_call_expression): Remove concept_check_p check.
1218         (cxx_eval_outermost_constant_expr): Likewise.
1219         * cp-gimplify.cc (cp_genericize_r) <case CALL_EXPR>: Likewise.
1220         * except.cc (check_noexcept_r): Likewise.
1222 2024-08-06  Jason Merrill  <jason@redhat.com>
1224         PR c++/116223
1225         * pt.cc (deducible_expression): Strip all IMPLICIT_CONV_EXPR.
1226         (unify): Likewise.  Handle resulting function/addr mismatch.
1228 2024-08-06  Jason Merrill  <jason@redhat.com>
1230         PR c++/116223
1231         PR c++/112632
1232         * pt.cc (deducible_expression): Also look through
1233         IMPLICIT_CONV_EXPR_FORCED.
1234         (unify): Likewise.
1236 2024-08-06  Jason Merrill  <jason@redhat.com>
1238         PR c++/94568
1239         * init.cc (build_zero_init_1): Call cv_unqualified.
1241 2024-08-06  Patrick Palka  <ppalka@redhat.com>
1243         PR c++/96780
1244         * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls
1245         to std::forward_like as well.
1247 2024-08-06  Marek Polacek  <polacek@redhat.com>
1249         * constexpr.cc (cxx_eval_constant_expression): Don't call
1250         unpack_concept_check.  Add a concept_check_p assert.  Remove
1251         function_concept_p code.
1252         * constraint.cc (check_constraint_atom): Remove function concepts code.
1253         (unpack_concept_check): Remove.
1254         (get_concept_check_template): Remove Concepts TS code.
1255         (resolve_function_concept_overload): Remove.
1256         (resolve_function_concept_check): Remove.
1257         (resolve_concept_check): Remove Concepts TS code.
1258         (get_returned_expression): Remove.
1259         (get_variable_initializer): Remove.
1260         (get_concept_definition): Remove Concepts TS code.
1261         (normalize_concept_check): Likewise.
1262         (build_function_check): Remove.
1263         (build_variable_check): Remove.
1264         (build_standard_check): Use concept_definition_p instead of
1265         standard_concept_p.
1266         (build_concept_check): Remove variable_concept_p/function_concept_p
1267         code.
1268         (build_concept_id): Simplify.
1269         (build_type_constraint): Likewise.
1270         (placeholder_extract_concept_and_args): Likewise.
1271         (satisfy_nondeclaration_constraints): Likewise.
1272         (check_function_concept): Remove.
1273         (get_constraint_error_location): Remove Concepts TS code.
1274         * cp-tree.h (DECL_DECLARED_CONCEPT_P): Remove.
1275         (check_function_concept): Remove.
1276         (unpack_concept_check): Remove.
1277         (standard_concept_p): Remove.
1278         (variable_concept_p): Remove.
1279         (function_concept_p): Remove.
1280         (concept_definition_p): Simplify.
1281         (concept_check_p): Don't check for CALL_EXPR.
1282         * decl.cc (check_concept_refinement): Remove.
1283         (duplicate_decls): Remove check_concept_refinement code.
1284         (is_concept_var): Remove.
1285         (cp_finish_decl): Remove is_concept_var.
1286         (check_concept_fn): Remove.
1287         (grokfndecl): Give an error about function concepts not being supported
1288         anymore.  Remove unused code.
1289         (grokvardecl): Give an error about variable concepts not being
1290         supported anymore.
1291         (finish_function): Remove DECL_DECLARED_CONCEPT_P code.
1292         * decl2.cc (min_vis_expr_r): Use concept_definition_p instead of
1293         standard_concept_p.
1294         (maybe_instantiate_decl): Remove DECL_DECLARED_CONCEPT_P check.
1295         (mark_used): Likewise.
1296         * error.cc (dump_simple_decl): Use concept_definition_p instead of
1297         standard_concept_p.
1298         (dump_function_decl): Remove DECL_DECLARED_CONCEPT_P code.
1299         (print_concept_check_info): Don't call unpack_concept_check.  Simplify.
1300         * mangle.cc (write_type_constraint): Likewise.
1301         * parser.cc (cp_parser_nested_name_specifier_opt): Remove
1302         function_concept_p code.  Only check concept_definition_p, not
1303         variable_concept_p/standard_concept_p.
1304         (add_debug_begin_stmt): Remove DECL_DECLARED_CONCEPT_P code.
1305         (cp_parser_template_declaration_after_parameters): Remove a stale
1306         comment.
1307         * pt.cc (check_explicit_specialization): Remove
1308         DECL_DECLARED_CONCEPT_P code.
1309         (process_partial_specialization): Remove variable_concept_p code.
1310         (lookup_template_variable): Likewise.
1311         (tsubst_expr) <case CALL_EXPR>: Remove Concepts TS code and simplify.
1312         (do_decl_instantiation): Remove DECL_DECLARED_CONCEPT_P code.
1313         (instantiate_decl): Likewise.
1314         (placeholder_type_constraint_dependent_p): Don't call
1315         unpack_concept_check.  Add a concept_check_p assert.
1316         (convert_generic_types_to_packs): Likewise.
1317         * semantics.cc (finish_call_expr): Remove Concepts TS code and simplify.
1319 2024-08-05  Iain Sandoe  <iain@sandoe.co.uk>
1321         * coroutines.cc (split_coroutine_body_from_ramp): New.
1322         (morph_fn_to_coro): Use split_coroutine_body_from_ramp().
1323         * cp-tree.h (use_eh_spec_block): New.
1324         * decl.cc (use_eh_spec_block): Make non-static.
1326 2024-08-05  Marek Polacek  <polacek@redhat.com>
1328         PR c++/115987
1329         * call.cc (do_warn_dangling_reference): Don't consider a
1330         temporary with a scalar type that cannot bind to the return type.
1332 2024-08-02  Arsen Arsenović  <arsen@aarsen.me>
1334         PR c++/105475
1335         * coroutines.cc (struct coroutine_info): Add from_address.
1336         Carries the from_address member we looked up earlier.
1337         (coro_resume_identifier): Remove.  Unused.
1338         (coro_init_identifiers): Do not initialize the above.
1339         (void_coro_handle_address): New variable.  Contains the baselink
1340         for the std::coroutine_handle<void>::address() instance method.
1341         (get_handle_type_address): New function.  Looks up and validates
1342         handle_type::address in a given handle_type.
1343         (get_handle_type_from_address): New function.  Looks up and
1344         validates handle_type::from_address in a given handle_type.
1345         (coro_promise_type_found_p): Remove reliance on
1346         coroutine_handle<> defaulting the promise type to void.  Store
1347         get_handle_type_* results where appropriate.
1348         (get_coroutine_from_address): New helper.  Gets the
1349         handle_type::from_address BASELINK from a coroutine_info.
1350         (build_actor_fn): Use the get_coroutine_from_address helper and
1351         void_coro_handle_address.
1353 2024-08-02  Marek Polacek  <polacek@redhat.com>
1355         PR c++/116169
1356         * decl.cc (cp_finish_decl): Disallow deleting ::main.
1358 2024-08-02  Iain Sandoe  <iain@sandoe.co.uk>
1360         * coroutines.cc (struct local_vars_frame_data): Add a
1361         CTOR.
1362         (morph_fn_to_coro): Use CTOR for local_vars_frame_data
1363         instead of brace init.
1365 2024-08-02  Iain Sandoe  <iain@sandoe.co.uk>
1367         * coroutines.cc (struct susp_frame_data): Remove unused members,
1368         provide a CTOR.
1369         (morph_fn_to_coro): Use susp_frame_data CTOR, and make the suspend
1370         state hash map local to the morph function.
1372 2024-08-02  Iain Sandoe  <iain@sandoe.co.uk>
1374         * coroutines.cc (replace_continue): Look up expression type.
1376 2024-08-01  Jakub Jelinek  <jakub@redhat.com>
1378         PR c++/116113
1379         * semantics.cc (maybe_convert_cond): Check DECL_DECOMP_BASE
1380         is non-NULL before dereferencing it.
1381         (finish_switch_cond): Likewise.
1383 2024-08-01  Arsen Arsenović  <arsen@aarsen.me>
1385         PR c++/112341
1386         * coroutines.cc (struct coroutine_info): Also cache the
1387         traits type.
1388         (ensure_coro_initialized): New function.  Makes sure we have
1389         initialized the coroutine state successfully, or informs the
1390         caller should it fail to do so.  Extracted from
1391         coro_promise_type_found_p.
1392         (coro_get_traits_class): New function.  Gets the (cached)
1393         coroutine traits type for a given coroutine.  Extracted from
1394         coro_promise_type_found_p and refactored to cache the result.
1395         (coro_promise_type_found_p): Use the two functions above.
1396         (build_template_co_await_expr): New function.  Builds a
1397         CO_AWAIT_EXPR representing a CO_AWAIT_EXPR in a template
1398         declaration.
1399         (build_co_await): Use the above if processing_template_decl, and
1400         give it a proper type.
1401         (coro_dependent_p): New function.  Returns true iff its
1402         argument is a type-dependent expression OR the current functions
1403         traits class is type dependent.
1404         (finish_co_await_expr): Defer expansion only in the case
1405         coro_dependent_p returns true.
1406         (finish_co_yield_expr): Ditto.
1407         (finish_co_return_stmt): Ditto.
1408         * pt.cc (type_dependent_expression_p): Do not treat
1409         CO_AWAIT/CO_YIELD specially.
1411 2024-07-31  Marek Polacek  <polacek@redhat.com>
1413         PR c++/115645
1414         * init.cc (build_vec_init): When initializing a scalar type, try to
1415         create a constant initializer.
1417 2024-07-30  Arsen Arsenović  <arsen@aarsen.me>
1419         PR c++/115906
1420         * parser.cc (cp_parser_unary_expression): Reject await
1421         expressions if use of local variables is currently forbidden.
1422         (cp_parser_yield_expression): Reject yield expressions if use of
1423         local variables is currently forbidden.
1425 2024-07-30  Arsen Arsenovic  <arsen@aarsen.me>
1427         PR c++/115906
1428         * coroutines.cc (register_local_var_uses): Only process
1429         PARM_DECL and VAR_DECLs.
1431 2024-07-30  Arsen Arsenović  <arsen@aarsen.me>
1433         PR c++/110855
1434         * cp-gimplify.cc (fold_builtin_source_location): Use the name of
1435         the DECL_RAMP_FN of the current function if present.
1437 2024-07-29  Patrick Palka  <ppalka@redhat.com>
1439         PR c++/88313
1440         * parser.cc (cp_parser_lambda_declarator_opt): Pass
1441         lambda_p=true to cp_parser_parameter_declaration_clause.
1442         (cp_parser_direct_declarator): Pass lambda_p=false to
1443         to cp_parser_parameter_declaration_clause.
1444         (cp_parser_parameter_declaration_clause): Add bool lambda_p
1445         parameter.  Consider lambda_p instead of current_class_type
1446         when setting parser->auto_is_implicit_function_template_parm_p.
1447         Don't consider processing_template_parmlist.
1448         (cp_parser_requirement_parameter_list): Pass lambda_p=false
1449         to cp_parser_parameter_declaration_clause.
1451 2024-07-28  Jason Merrill  <jason@redhat.com>
1453         PR c++/115583
1454         * constexpr.cc (cxx_eval_conditional_expression): Don't
1455         cp_fold_immediate for if consteval.
1457 2024-07-27  Jason Merrill  <jason@redhat.com>
1459         PR c++/115986
1460         * cp-gimplify.cc (remember_escalating_expr): Skip function
1461         templates.
1463 2024-07-27  Jason Merrill  <jason@redhat.com>
1465         PR c++/115561
1466         * semantics.cc (finish_call_expr): Check cp_unevaluated_operand.
1468 2024-07-26  Jason Merrill  <jason@redhat.com>
1470         PR c++/116052
1471         * mangle.cc (write_prefix): Handle TRAIT_EXPR.
1473 2024-07-26  Nathaniel Shead  <nathanieloshead@gmail.com>
1475         PR c++/115757
1476         * module.cc (trees_out::core_vals): Write warning specs for
1477         DECLs and EXPRs.
1478         (trees_in::core_vals): Read warning specs.
1480 2024-07-25  Jason Merrill  <jason@redhat.com>
1482         PR c++/115403
1483         PR c++/109753
1484         * decl.cc (start_preparsed_function): Only call decl_attributes for
1485         artificial functions.
1487 2024-07-25  Patrick Palka  <ppalka@redhat.com>
1489         PR c++/115897
1490         * cp-tree.h (dependent_opaque_alias_p): Declare.
1491         * pt.cc (push_template_decl): Manually mark a dependent opaque
1492         alias or dependent alias template specialization as dependent,
1493         and use structural equality for them.
1494         (dependent_opaque_alias_p): Define.
1495         (alias_template_specialization_p): Don't look through an
1496         opaque alias.
1497         (complex_alias_template_p): Use dependent_opaque_alias_p instead of
1498         any_dependent_template_arguments_p directly.
1499         (dependent_alias_template_spec_p): Don't look through an
1500         opaque alias.
1501         (get_underlying_template): Use dependent_opaque_alias_p instead of
1502         any_dependent_template_arguments_p.
1503         (instantiate_alias_template): Mention same logic in
1504         push_template_decl.
1505         (dependent_type_p_r): Remove dependent_alias_template_spec_p check.
1506         (any_template_arguments_need_structural_equality_p): Return true
1507         for a dependent opaque alias.
1508         (alias_ctad_tweaks): Use template_args_equal instead of same_type_p
1509         followed by dependent_alias_template_spec_p.
1510         * tree.cc (strip_typedefs): Don't strip an opaque alias.
1511         * typeck.cc (structural_comptypes): Compare declaration attributes
1512         for an opaque alias.
1514 2024-07-25  Patrick Palka  <ppalka@redhat.com>
1516         PR c++/115897
1517         * tree.cc (strip_typedefs): Move up the typedef recursion case.
1518         Never strip a dependent alias template-id that has dependent
1519         attributes.
1521 2024-07-25  Arsen Arsenović  <arsen@aarsen.me>
1523         PR c++/110171
1524         * coroutines.cc (co_await_get_resume_call): New function.
1525         Returns the await_resume expression of a given co_await.
1526         * cp-tree.h (co_await_get_resume_call): New function.
1527         * cvt.cc (convert_to_void): Handle CO_AWAIT_EXPRs and call
1528         maybe_warn_nodiscard on their resume exprs.
1530 2024-07-25  Arsen Arsenović  <arsen@aarsen.me>
1532         PR c++/111728
1533         * coroutines.cc (rewrite_param_uses): Skip unevaluated
1534         subexpressions.
1536 2024-07-24  Jason Merrill  <jason@redhat.com>
1538         PR c++/116071
1539         * parser.cc (cp_parser_simple_type_specifier): Call
1540         cp_parser_simulate_error if nothing worked.
1542 2024-07-24  Jakub Jelinek  <jakub@redhat.com>
1544         * constraint.cc (subst_info::quiet, subst_info::noisy): Formatting
1545         fixes.
1546         (known_non_bool_p): Comment formatting fixes.
1547         (unpack_concept_check): Likewise.
1548         (resolve_function_concept_overload): Likewise.
1549         (resolve_function_concept_check): Likewise.
1550         (resolve_concept_check): Likewise.
1551         (deduce_constrained_parameter): Likewise.
1552         (finish_type_constraints): Likewise.
1553         (get_returned_expression): Likewise.
1554         (get_variable_initializer): Likewise.
1555         (norm_info::update_context, norm_info::ctx_params): Formatting
1556         fixes.
1557         (norm_info::context): Comment formatting fixes.
1558         (normalize_logical_operation): Likewise.  Formatting fix.
1559         (normalize_concept_check): Comment formatting fixes.
1560         (normalize_atom): Likewise.
1561         (normalize_expression): Likewise.
1562         (get_normalized_constraints_from_info): Likewise.
1563         (get_normalized_constraints_from_decl): Likewise.  Formatting
1564         fixes.
1565         (atomic_constraints_identical_p): Comment formatting fixes.
1566         (constraints_equivalent_p): Formatting fixes.
1567         (inchash::add_constraint): Likewise.
1568         (associate_classtype_constraints): Comment formatting fixes.
1569         (get_constraints): Likewise.
1570         (set_constraints): Likewise.
1571         (build_concept_check_arguments): Likewise.
1572         (build_function_check): Likewise.
1573         (build_concept_check): Likewise.
1574         (finish_shorthand_constraint): Likewise.
1575         (get_shorthand_constraints): Likewise.
1576         (check_constraint_variables): Likewise.
1577         (tsubst_constraint_variables): Likewise.
1578         (tsubst_requires_expr): Likewise.
1579         (get_mapped_args): Likewise.  Formatting fixes.
1580         (satisfy_atom): Comment formatting fixes.
1581         (satisfy_constraint_r): Comment wording and formatting fixes.
1582         (satisfy_normalized_constraints): Comment formatting fixes.
1583         (satisfy_declaration_constraints): Likewise.
1584         (evaluate_concept_check): Likewise.
1585         (finish_requires_expr): Likewise.
1586         (finish_compound_requirement): Likewise.
1587         (check_function_concept): Likewise.
1588         (equivalently_constrained): Likewise.
1589         (more_constrained): Likewise.
1590         (diagnose_atomic_constraint): Likewise.
1591         * cp-tree.h (TREE_LANG_FLAG_0): Fix a comment error,
1592         FOLD_EXPR_MODIFY_P instead of FOLD_EXPR_MODOP_P.
1593         (DECL_MAIN_FREESTANDING_P, DECL_MAIN_P): Comment formatting fixes.
1594         (enum cpp0x_warn_str): Likewise.
1595         (enum composite_pointer_operation): Likewise.
1596         (enum expr_list_kind): Likewise.
1597         (enum impl_conv_rhs): Likewise.
1598         (enum impl_conv_void): Likewise.
1599         (struct deferred_access_check): Likewise.
1600         (ATOMIC_CONSTR_EXPR): Likewise.
1601         (FUNCTION_REF_QUALIFIED): Likewise.
1602         (DECL_DEPENDENT_P): Likewise.
1603         (FOLD_EXPR_MODIFY_P): Likewise.
1604         (FOLD_EXPR_OP_RAW): Likewise.
1605         (FOLD_EXPR_PACK): Likewise.
1606         (FOLD_EXPR_INIT): Likewise.
1607         (TYPE_WAS_UNNAMED): Likewise.
1608         (class cp_unevaluated): Likewise.
1609         (struct ovl_op_info_t assertion): Likewise.
1610         (cp_declarator::function::requires_clause): Likewise.
1611         (variable_template_p): Likewise.
1612         (concept_definition_p): Likewise.
1613         * logic.cc (clause::clause): Likewise.
1614         (clause::replace): Likewise.
1615         (clause::insert): Likewise.  Formatting fixes.
1616         (struct formula): Comment formatting fixes.
1617         (formula::branch): Likewise.
1618         (debug): Formatting fixes.
1619         (dnf_size_r): Comment formatting fixes.
1620         (cnf_size_r): Likewise.
1621         (dnf_size): Likewise.
1622         (cnf_size): Likewise.
1623         (branch_clause): Likewise.
1624         (decompose_term): Likewise.  Formatting fixes.
1625         (struct subsumption_entry): Comment formatting fixes.
1626         (subsumption_cache): Likewise.
1627         (save_subsumption): Likewise.  Formatting fixes.
1628         (subsumes_constraints_nonnull): Formatting fixes.
1630 2024-07-23  Andi Kleen  <ak@linux.intel.com>
1632         PR c/83324
1633         * cp-tree.h (AGGR_INIT_EXPR_MUST_TAIL): Add.
1634         * parser.cc (cp_parser_statement): Handle musttail.
1635         (cp_parser_jump_statement): Dito.
1636         * pt.cc (tsubst_expr): Copy CALL_EXPR_MUST_TAIL_CALL.
1637         * semantics.cc (simplify_aggr_init_expr): Handle musttail.
1639 2024-07-23  Patrick Palka  <ppalka@redhat.com>
1641         PR c++/115656
1642         * constraint.cc (weakly_subsumes): Pass in_decl=tmpl to
1643         get_normalized_constraints_from_info.  Rename to ...
1644         (ttp_subsumes): ... this.
1645         * cp-tree.h (weakly_subsumes): Rename to ...
1646         (ttp_subsumes): ... this.
1647         * pt.cc (is_compatible_template_arg): Adjust after renaming.
1649 2024-07-23  Patrick Palka  <ppalka@redhat.com>
1651         PR c++/115296
1652         * pt.cc (alias_ctad_tweaks): Use complain=tf_none instead of
1653         tf_warning_or_error.
1655 2024-07-23  Jakub Jelinek  <jakub@redhat.com>
1657         * cp-tree.def (CHECK_CONSTR): Remove.
1658         * cp-tree.h (CHECK_CONSTR_CONCEPT, CHECK_CONSTR_ARGS): Remove.
1659         * cp-objcp-common.cc (cp_common_init_ts): Don't handle CHECK_CONSTR.
1660         * tree.cc (cp_tree_equal): Likewise.
1661         * error.cc (dump_expr): Likewise.
1662         * cxx-pretty-print.cc (cxx_pretty_printer::expression): Likewise.
1663         (pp_cxx_check_constraint): Remove.
1664         (pp_cxx_constraint): Don't handle CHECK_CONSTR.
1666 2024-07-23  Patrick Palka  <ppalka@redhat.com>
1668         PR c++/104981
1669         PR c++/115550
1670         * coroutines.cc (morph_fn_to_coro): Remove unneeded calls
1671         to convert_to_reference and convert_from_reference when
1672         passing *this.  Use cp_build_fold_indirect_ref instead
1673         of directly building INDIRECT_REF.
1675 2024-07-22  Jakub Jelinek  <jakub@redhat.com>
1677         * cp-tree.def (UNARY_LEFT_FOLD_EXPR): Use FOLD_EXPR_MODIFY_P instead
1678         of FOLD_EXPR_MOD_P or FOLDEXPR_MOD_P in the comment.  Comment
1679         formatting fixes.
1680         (ATOMIC_CONSTEXPR): Use CONSTR_INFO instead of ATOMIC_CONSTR_INFO
1681         and ATOMIC_CONSTR_MAP instead of ATOMIC_CONSTR_PARMS in the comment.
1682         Comment formatting fixes.
1683         (CONJ_CONSTR): Remove comment about third operand.  Use CONSTR_INFO
1684         instead of CONJ_CONSTR_INFO and DISJ_CONSTR_INFO.
1685         (CHECK_CONSTR): Use CHECK_CONSTR_ARGS instead of
1686         CHECK_CONSTR_ARGUMENTS.
1688 2024-07-20  Andi Kleen  <ak@gcc.gnu.org>
1690         Revert:
1691         2024-07-20  Andi Kleen  <ak@linux.intel.com>
1693         PR c/83324
1694         * cp-tree.h (AGGR_INIT_EXPR_MUST_TAIL): Add.
1695         * parser.cc (cp_parser_statement): Handle musttail.
1696         (cp_parser_jump_statement): Dito.
1697         * pt.cc (tsubst_expr): Copy CALL_EXPR_MUST_TAIL_CALL.
1698         * semantics.cc (simplify_aggr_init_expr): Handle musttail.
1700 2024-07-20  Andi Kleen  <ak@linux.intel.com>
1702         PR c/83324
1703         * cp-tree.h (AGGR_INIT_EXPR_MUST_TAIL): Add.
1704         * parser.cc (cp_parser_statement): Handle musttail.
1705         (cp_parser_jump_statement): Dito.
1706         * pt.cc (tsubst_expr): Copy CALL_EXPR_MUST_TAIL_CALL.
1707         * semantics.cc (simplify_aggr_init_expr): Handle musttail.
1709 2024-07-19  Patrick Palka  <ppalka@redhat.com>
1711         PR c++/115783
1712         * call.cc (build_new_method_call): Generalize METHOD_TYPE
1713         check to DECL_OBJECT_MEMBER_FUNCTION_P.
1715 2024-07-19  Seyed Sajad Kahani  <sska1377@gmail.com>
1717         * constraint.cc (hash_placeholder_constraint): Rename to
1718         iterative_hash_placeholder_constraint.
1719         (iterative_hash_placeholder_constraint): Rename from
1720         hash_placeholder_constraint and add the initial val argument.
1721         * cp-tree.h (hash_placeholder_constraint): Rename to
1722         iterative_hash_placeholder_constraint.
1723         (iterative_hash_placeholder_constraint): Renamed from
1724         hash_placeholder_constraint and add the initial val argument.
1725         * pt.cc (struct ctp_hasher): Updated to use
1726         iterative_hash_placeholder_constraint in the case of a valid placeholder
1727         constraint.
1728         (auto_hash::hash): Reflect the renaming of hash_placeholder_constraint to
1729         iterative_hash_placeholder_constraint.
1731 2024-07-18  Marek Polacek  <polacek@redhat.com>
1733         PR c++/108769
1734         PR c++/58074
1735         PR c++/115522
1736         PR c++/85723
1737         * class.cc (type_has_non_deleted_trivial_default_ctor): Fix formatting.
1738         * tree.cc (trivial_type_p): Instead of TYPE_HAS_TRIVIAL_DFLT, use
1739         type_has_non_deleted_trivial_default_ctor.
1741 2024-07-18  Nathaniel Shead  <nathanieloshead@gmail.com>
1743         PR c++/115165
1744         * module.cc (lazy_load_binding): Use 'timevar_cond*' APIs.
1745         (lazy_load_pendings): Likewise.
1747 2024-07-18  Patrick Palka  <ppalka@redhat.com>
1749         PR c++/112288
1750         * pt.cc (tsubst_friend_function): When adjusting existing
1751         specializations after defining a previously declared template
1752         friend, consider the most general template and correct
1753         DECL_TI_ARGS adjustment.
1755 2024-07-18  Patrick Palka  <ppalka@redhat.com>
1757         PR c++/114104
1758         * cvt.cc (convert_to_void): Call warn_if_unused_value for
1759         TRUTH_NOT_EXPR and ADDR_EXPR as well.
1761 2024-07-18  Patrick Palka  <ppalka@redhat.com>
1763         * decl.cc (make_typename_type): Restrict name lookup failure
1764         punting to dependentish_scope_p instead of dependent_type_p.
1765         * error.cc (qualified_name_lookup_error): Improve diagnostic
1766         when the scope is the current instantiation.
1767         * parser.cc (cp_parser_diagnose_invalid_type_name): Likewise.
1768         (cp_parser_conversion_function_id): Don't call push_scope on
1769         a template scope unless we're in a declaration context.
1770         (cp_parser_lookup_name): Restrict name lookup failure
1771         punting to dependentish_scope_p instead of depedent_type_p.
1772         * semantics.cc (finish_id_expression_1): Likewise.
1773         * typeck.cc (finish_class_member_access_expr): Likewise.
1775 2024-07-17  Marek Polacek  <polacek@redhat.com>
1777         PR c++/115900
1778         * constexpr.cc (cxx_eval_call_expression): Set new_obj to NULL_TREE
1779         if cxx_fold_indirect_ref set empty_base to true.
1781 2024-07-17  Patrick Palka  <ppalka@redhat.com>
1783         PR c++/111890
1784         * pt.cc (maybe_new_partial_specialization): Propagate TYPE_CONTEXT
1785         to the newly created partial specialization.
1787 2024-07-17  Nathaniel Shead  <nathanieloshead@gmail.com>
1789         PR c++/99242
1790         * name-lookup.cc (append_imported_binding_slot): Propagate dups
1791         flags.
1793 2024-07-16  Nina Ranns  <dinka.ranns@gmail.com>
1795         PR c++/110159
1796         * cp-tree.h (init_terminate_fn): Declaration of a new function.
1797         * decl.cc (cxx_init_decl_processing): If contracts are enabled,
1798         call init_terminate_fn.
1799         * except.cc (init_exception_processing): Function refactored to
1800         call init_terminate_fn.
1801         (init_terminate_fn): Added new function that initializes
1802         terminate_fn if it hasn't already been initialised.
1804 2024-07-16  Iain Sandoe  <iain@sandoe.co.uk>
1806         PR c++/115434
1807         PR c++/110871
1808         PR c++/110872
1809         * constexpr.cc (cxx_eval_constant_expression): Handle EH_ELSE_EXPR.
1810         * contracts.cc (finish_contract_attribute): Remove excess line.
1811         (build_contract_condition_function): Post condition handlers are
1812         void now.
1813         (emit_postconditions_cleanup): Remove.
1814         (emit_postconditions): New.
1815         (add_pre_condition_fn_call): New.
1816         (add_post_condition_fn_call): New.
1817         (apply_preconditions): New.
1818         (apply_postconditions): New.
1819         (maybe_apply_function_contracts): New.
1820         (apply_postcondition_to_return): Remove.
1821         * contracts.h (apply_postcondition_to_return): Remove.
1822         (maybe_apply_function_contracts): Add.
1823         * coroutines.cc (coro_build_actor_or_destroy_function): Do not
1824         copy contracts to coroutine helpers.
1825         * decl.cc (finish_function): Handle wrapping a possibly
1826         transformed function body in contract checks.
1827         * typeck.cc (check_return_expr): Remove handling of post
1828         conditions on return expressions.
1830 2024-07-15  Patrick Palka  <ppalka@redhat.com>
1832         PR c++/115897
1833         * pt.cc (complex_alias_template_p): Return true for an alias
1834         template with attributes.
1835         (get_underlying_template): Don't look through an alias template
1836         with attributes.
1838 2024-07-13  David Malcolm  <dmalcolm@redhat.com>
1840         * call.cc: Include "tree-pretty-print-markup.h".
1841         (implicit_conversion_error): Use highlight_colors::percent_h for
1842         the labelled range.
1843         (op_error_string): Split out into...
1844         (concat_op_error_string): ...this.
1845         (binop_error_string): New.
1846         (op_error): Use %e, binop_error_string, highlight_colors::lhs,
1847         and highlight_colors::rhs.
1848         (maybe_inform_about_fndecl_for_bogus_argument_init): Add
1849         "highlight_color" param; use it for the richloc.
1850         (convert_like_internal): Use highlight_colors::percent_h for the
1851         labelled_range, and highlight_colors::percent_i for the call to
1852         maybe_inform_about_fndecl_for_bogus_argument_init.
1853         (build_over_call): Pass cp_comp_parm_types for new "comp_types"
1854         param of check_function_arguments.
1855         (complain_about_bad_argument): Use highlight_colors::percent_h for
1856         the labelled_range, and highlight_colors::percent_i for the call
1857         to maybe_inform_about_fndecl_for_bogus_argument_init.
1858         * cp-tree.h (maybe_inform_about_fndecl_for_bogus_argument_init):
1859         Add optional highlight_color param.
1860         (cp_comp_parm_types): New decl.
1861         (highlight_colors::const percent_h): New decl.
1862         (highlight_colors::const percent_i): New decl.
1863         * error.cc: Include "tree-pretty-print-markup.h".
1864         (highlight_colors::const percent_h): New defn.
1865         (highlight_colors::const percent_i): New defn.
1866         (type_to_string): Add param "highlight_color" and use it.
1867         (print_nonequal_arg): Likewise.
1868         (print_template_differences): Add params "highlight_color_a" and
1869         "highlight_color_b".
1870         (type_to_string_with_compare): Add params "this_highlight_color"
1871         and "peer_highlight_color".
1872         (print_template_tree_comparison): Add params "highlight_color_a"
1873         and "highlight_color_b".
1874         (cxx_format_postprocessor::handle):
1875         Use highlight_colors::percent_h and highlight_colors::percent_i.
1876         (pp_markup::element_quoted_type::print_type): New.
1877         (range_label_for_type_mismatch::get_text): Pass nullptr for new
1878         params of type_to_string_with_compare.
1879         * typeck.cc (cp_comp_parm_types): New.
1880         (cp_build_function_call_vec): Pass it to check_function_arguments.
1881         (convert_for_assignment): Use highlight_colors::percent_h for the
1882         labelled_range.
1884 2024-07-12  Nathaniel Shead  <nathanieloshead@gmail.com>
1886         * decl.cc (xref_tag): Move assertion into condition.
1887         * name-lookup.cc (check_module_override): Check for conflicting
1888         types and using-decls.
1890 2024-07-12  Nathaniel Shead  <nathanieloshead@gmail.com>
1892         PR c++/114683
1893         * cp-tree.h (class ovl_iterator): Move definitions of purview_p
1894         and exporting_p to name-lookup.cc.
1895         * module.cc (depset::hash::add_binding_entity): Strip
1896         using-decls.  Remove workarounds.  Handle CONST_DECLs with
1897         different purview/exported from their enum.
1898         (enum ct_bind_flags): Remove unnecessary cbf_wrapped flag.
1899         (module_state::write_cluster): Likewise.
1900         (module_state::read_cluster): Build USING_DECL for non-function
1901         usings.
1902         (binding_cmp): Handle CONST_DECLs with different purview and/or
1903         exported from their enum.
1904         (set_instantiating_module): Support CONST_DECLs.
1905         * name-lookup.cc (get_fixed_binding_slot): Strip USING_DECLs.
1906         (name_lookup::process_binding): Strip USING_DECLs.
1907         (name_lookup::process_module_binding): Remove workaround.
1908         (update_binding): Strip USING_DECLs, remove incorrect check for
1909         non-extern variables.
1910         (ovl_iterator::purview_p): Support USING_DECLs.
1911         (ovl_iterator::exporting_p): Support USING_DECLs.
1912         (walk_module_binding): Handle stat hack type.
1913         (do_nonmember_using_decl): Strip USING_DECLs when comparing;
1914         build USING_DECLs for non-function usings in different scope
1915         rather than binding directly.
1916         (get_namespace_binding): Strip USING_DECLs.
1917         (lookup_name): Strip USING_DECLs.
1918         (lookup_elaborated_type): Strip USING_DECLs.
1919         * decl.cc (poplevel): Still support -Wunused for using-decls.
1920         (lookup_and_check_tag): Remove unnecessary strip_using_decl.
1921         * parser.cc (cp_parser_template_name): Likewise.
1922         (cp_parser_nonclass_name): Likewise.
1923         (cp_parser_class_name): Likewise.
1925 2024-07-11  Nathaniel Shead  <nathanieloshead@gmail.com>
1927         PR c++/99241
1928         * decl.cc (duplicate_decls): Merge module entity information.
1930 2024-07-10  Marek Polacek  <polacek@redhat.com>
1932         * constraint.cc (deduce_concept_introduction, get_deduced_wildcard,
1933         get_introduction_prototype, introduce_type_template_parameter,
1934         introduce_template_template_parameter,
1935         introduce_nontype_template_parameter,
1936         build_introduced_template_parameter, introduce_template_parameter,
1937         introduce_template_parameter_pack, introduce_template_parameter,
1938         introduce_template_parameters, process_introduction_parms,
1939         check_introduction_list, finish_template_introduction): Remove.
1940         (finish_shorthand_constraint): Remove a Concepts TS comment.
1941         * cp-tree.h (check_auto_in_tmpl_args, finish_template_introduction):
1942         Remove.
1943         * decl.cc (function_requirements_equivalent_p): Remove pre-C++20 code.
1944         (grokfndecl): Don't check flag_concepts_ts.
1945         (grokvardecl): Don't check that concept have type bool.
1946         * parser.cc (cp_parser_decl_specifier_seq): Don't check
1947         flag_concepts_ts.
1948         (cp_parser_introduction_list): Remove.
1949         (cp_parser_template_id): Remove dead code.
1950         (cp_parser_simple_type_specifier): Don't check flag_concepts_ts.
1951         (cp_parser_placeholder_type_specifier): Require require auto or
1952         decltype(auto) even pre-C++20.  Don't check flag_concepts_ts.
1953         (cp_parser_type_id_1): Don't check flag_concepts_ts.
1954         (cp_parser_template_type_arg): Likewise.
1955         (cp_parser_requires_clause_opt): Remove flag_concepts_ts code.
1956         (cp_parser_compound_requirement): Don't check flag_concepts_ts.
1957         (cp_parser_template_introduction): Remove.
1958         (cp_parser_template_declaration_after_export): Don't call
1959         cp_parser_template_introduction.
1960         * pt.cc (template_heads_equivalent_p): Remove pre-C++20 code.
1961         (find_parameter_pack_data): Remove type_pack_expansion_p.
1962         (find_parameter_packs_r): Remove flag_concepts_ts code.  Remove
1963         type_pack_expansion_p code.
1964         (uses_parameter_packs): Remove type_pack_expansion_p code.
1965         (make_pack_expansion): Likewise.
1966         (check_for_bare_parameter_packs): Likewise.
1967         (fixed_parameter_pack_p): Likewise.
1968         (tsubst_qualified_id): Remove dead code.
1969         (extract_autos_r): Remove.
1970         (extract_autos): Remove.
1971         (do_auto_deduction): Remove flag_concepts_ts code.
1972         (type_uses_auto): Likewise.
1973         (check_auto_in_tmpl_args): Remove.
1975 2024-07-10  Marek Polacek  <polacek@redhat.com>
1977         PR c++/115645
1978         * init.cc (build_new): Don't do any deduction for arrays with
1979         bounds if it's value-initialized.
1981 2024-07-10  Nina Ranns  <dinka.ranns@gmail.com>
1983         PR c++/113968
1984         * contracts.cc (grok_contract): Check for error_mark_node early
1985         exit.
1987 2024-07-09  Jakub Jelinek  <jakub@redhat.com>
1989         * constexpr.cc (cxx_eval_constant_expression): CWG2819 - Allow
1990         cv void * null pointer value conversion to object types in constant
1991         expressions.
1993 2024-07-07  Nathaniel Shead  <nathanieloshead@gmail.com>
1995         * module.cc (trees_out::get_merge_kind): Use
1996         LAMBDA_TYPE_EXTRA_SCOPE instead of LAMBDA_EXPR_EXTRA_SCOPE.
1997         (trees_out::key_mergeable): Likewise.
1999 2024-07-04  Tamar Christina  <tamar.christina@arm.com>
2001         PR c++/115623
2002         * semantics.cc (finish_for_cond): Add check for C++ cond.
2004 2024-07-04  Jason Merrill  <jason@redhat.com>
2006         * error.cc (dump_decl) [OVERLOAD]: Recurse on single case.
2008 2024-07-04  Jason Merrill  <jason@redhat.com>
2010         * pt.cc (ctad_template_p): Return false for trait names.
2012 2024-07-02  Jakub Jelinek  <jakub@redhat.com>
2013             Jason Merrill  <jason@redhat.com>
2015         PR c++/115754
2016         * constexpr.cc (cxx_eval_constant_expression) <case CONVERT_EXPR>:
2017         For conversions to void, pass vc_discard to the recursive call
2018         and otherwise for tcode other than VIEW_CONVERT_EXPR pass vc_prvalue.
2020 2024-07-02  Jakub Jelinek  <jakub@redhat.com>
2021             Jason Merrill  <jason@redhat.com>
2023         PR c++/115747
2024         * init.cc: Implement C++26 P3144R2 - Deleting a Pointer to an
2025         Incomplete Type Should be Ill-formed.
2026         (build_vec_delete_1): Emit permerror_at and return error_mark_node
2027         for delete [] on incomplete type.
2028         (build_delete): Similarly for delete.
2030 2024-07-02  Jakub Jelinek  <jakub@redhat.com>
2032         PR c++/115745
2033         * cp-tree.h: Implement C++26 P0963R3 - Structured binding declaration
2034         as a condition.
2035         (DECL_DECOMP_BASE): Adjust comment.
2036         (DECL_DECOMP_IS_BASE): Define.
2037         * parser.cc (cp_parser_selection_statement): Adjust
2038         cp_parser_condition caller.
2039         (cp_parser_condition): Add KEYWORD argument.  Parse
2040         C++26 structured bindings in conditions.
2041         (cp_parser_c_for, cp_parser_iteration_statement): Adjust
2042         cp_parser_condition callers.
2043         (cp_parser_simple_declaration): Adjust
2044         cp_parser_decomposition_declaration caller.
2045         (cp_parser_decomposition_declaration): Add KEYWORD argument.
2046         If it is not RID_MAX, diagnose for C++23 and older rather than C++14
2047         and older.  Set DECL_DECOMP_BASE to integer_zero_node for structured
2048         bindings used in if/while/for conditions or integer_one_node for
2049         those used in switch conditions.
2050         * decl.cc (poplevel, check_array_initializer): Use DECL_DECOMP_IS_BASE
2051         instead of !DECL_DECOMP_BASE.
2052         (cp_finish_decomp): Diagnose array initializer for structured bindings
2053         used in conditions.  If using std::tuple_{size,element}, emit
2054         conversion to bool or integer/enumeration of e into a TARGET_EXPR
2055         before emitting get method calls.
2056         * decl2.cc (mark_used): Use DECL_DECOMP_IS_BASE instead of
2057         !DECL_DECOMP_BASE.
2058         * module.cc (trees_in::tree_node): Likewise.
2059         * typeck.cc (maybe_warn_about_returning_address_of_local): Likewise.
2060         * semantics.cc (maybe_convert_cond): For structured bindings with
2061         TARGET_EXPR DECL_DECOMP_BASE use that as condition.
2062         (finish_switch_cond): Likewise.
2064 2024-07-02  Lewis Hyatt  <lhyatt@gmail.com>
2066         * Make-lang.in: Remove redundant slash.
2068 2024-07-02  Simon Martin  <simon@nasilyan.com>
2070         PR c++/111160
2071         * tree.cc (stabilize_expr): Stabilized expressions can have
2072         TREE_SIDE_EFFECTS if they're volatile.
2074 2024-07-01  Marek Polacek  <polacek@redhat.com>
2076         PR c++/115469
2077         * decl.cc (automatic_var_with_nontrivial_dtor_p): New.
2078         (poplevel_named_label_1): Use it.
2079         (check_goto_1): Likewise.
2081 2024-07-01  Marek Polacek  <polacek@redhat.com>
2083         PR c++/115430
2084         * typeck.cc (cp_build_compound_expr): Call resolve_nondeduced_context
2085         on RHS.
2087 2024-07-01  Marek Polacek  <polacek@redhat.com>
2089         DR 2627
2090         PR c++/94058
2091         PR c++/104392
2092         * typeck2.cc (check_narrowing): Don't warn if the conversion isn't
2093         narrowing as per DR 2627.
2095 2024-06-28  Patrick Palka  <ppalka@redhat.com>
2097         PR c++/106760
2098         * call.cc (add_candidates): Relax test for adding a candidate
2099         to 'bad_cands' to also accept an uninstantiated template candidate
2100         that has no missing conversions.
2102 2024-06-26  David Malcolm  <dmalcolm@redhat.com>
2104         * parser.cc (cp_parser_error_1): Pass *global_dc to
2105         gcc_rich_location::add_location_if_nearby.
2106         (cp_parser_decl_specifier_seq): Likewise.
2107         (cp_parser_set_storage_class): Likewise.
2108         (cp_parser_set_storage_class): Likewise.
2110 2024-06-26  Patrick Palka  <ppalka@redhat.com>
2112         PR c++/115504
2113         * semantics.cc (finish_decltype_type): Don't strip the reference
2114         type (if any) of a capture proxy's captured variable.
2116 2024-06-25  Marek Polacek  <polacek@redhat.com>
2118         PR c++/115476
2119         * semantics.cc (finish_trait_expr)
2120         <case CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS>: Move below to call
2121         check_trait_type with kind==2.
2123 2024-06-25  Marek Polacek  <polacek@redhat.com>
2125         PR c++/115425
2126         * pt.cc (tsubst_pack_expansion): Return error_mark_node if
2127         make_pack_expansion doesn't work out.
2129 2024-06-25  Marek Polacek  <polacek@redhat.com>
2131         PR c++/115501
2132         * rtti.cc (build_dynamic_cast_1): Return if dcast_fn is erroneous.
2134 2024-06-25  Patrick Palka  <ppalka@redhat.com>
2136         PR c++/115198
2137         * pt.cc (alias_ctad_tweaks): Update DECL_NAME of the transformed
2138         guides.
2140 2024-06-25  Patrick Palka  <ppalka@redhat.com>
2142         PR c++/115358
2143         * decl2.cc (mark_used): Call maybe_instantiate_decl for an array
2144         variable with unknown bound.
2145         * semantics.cc (finish_decltype_type): Remove now redundant
2146         handling of array variables with unknown bound.
2147         * typeck.cc (cxx_sizeof_expr): Likewise.
2149 2024-06-25  Sandra Loosemore  <sloosemore@baylibre.com>
2151         PR c/115587
2152         * parser.cc (cp_parser_omp_loop_nest): Move initializations to
2153         point of declaration.
2155 2024-06-17  Jakub Jelinek  <jakub@redhat.com>
2157         PR target/111343
2158         PR c++/115511
2159         * typeck.cc (cp_compare_floating_point_conversion_ranks): If an
2160         extended floating point type mv1 has same set of values as more
2161         than one standard floating point type and mv2 is float, return 2.
2163 2024-06-13  Jason Merrill  <jason@redhat.com>
2165         PR c++/114683
2166         * name-lookup.cc (do_nonmember_using_decl): Allow exporting
2167         a newly inserted decl.
2169 2024-06-13  Jason Merrill  <jason@redhat.com>
2171         PR c++/115194
2172         * name-lookup.cc (name_lookup::process_module_binding): Strip an
2173         OVERLOAD from a non-function.
2175 2024-06-13  Jason Merrill  <jason@redhat.com>
2177         * module.cc (depset::hash::add_binding_entity): Adjust comment.
2179 2024-06-13  Patrick Palka  <ppalka@redhat.com>
2181         PR c++/99678
2182         * parser.cc (cp_parser_constraint_primary_expression): Diagnose
2183         a bare unresolved unqualified-id.
2185 2024-06-13  Patrick Palka  <ppalka@redhat.com>
2187         PR c++/115239
2188         * call.cc (tourney): Don't consider a non-strictly viable
2189         candidate as the champ if there was ambiguity between two
2190         strictly viable candidates.
2192 2024-06-13  Andi Kleen  <ak@linux.intel.com>
2194         * parser.cc (cp_parser_asm_string_expression): Use correct error
2195         message.
2197 2024-06-13  Andi Kleen  <ak@linux.intel.com>
2199         * parser.cc (cp_parser_asm_string_expression): Parse close
2200         parent when constexpr extraction fails.
2202 2024-06-13  Andi Kleen  <ak@linux.intel.com>
2204         * parser.cc (cp_parser_asm_string_expression): Remove support
2205         for const char * for asm constexpr.
2207 2024-06-13  Patrick Palka  <ppalka@redhat.com>
2209         PR c++/115283
2210         * decl2.cc (min_vis_expr_r) <case TEMPLATE_DECL>: Ignore
2211         concepts.
2213 2024-06-12  Jason Merrill  <jason@redhat.com>
2215         * tree.cc (lookup_maybe_add): Use ovl_make when setting OVL_USING_P.
2217 2024-06-12  Jason Merrill  <jason@redhat.com>
2219         * module.cc (depset::hash::add_binding_entity): Set
2220         DECL_MODULE_PURVIEW_P instead of asserting.
2222 2024-06-12  Andi Kleen  <ak@linux.intel.com>
2224         * cp-tree.h (extract): Add new overload to return tree.
2225         * parser.cc (cp_parser_asm_string_expression): Use tree extract.
2226         * semantics.cc (cexpr_str::extract): Add new overload to return
2227         tree.
2229 2024-06-12  David Malcolm  <dmalcolm@redhat.com>
2231         * error.cc (append_formatted_chunk): Move part of body into
2232         chunk_info::append_formatted_chunk.
2234 2024-06-12  David Malcolm  <dmalcolm@redhat.com>
2236         * cxx-pretty-print.cc: Update throughout for fields of
2237         pretty_printer becoming private.
2238         * error.cc: Likewise.
2240 2024-06-11  Andi Kleen  <ak@linux.intel.com>
2242         * parser.cc (cp_parser_asm_string_expression): New function
2243         to handle constexpr strings for asm.
2244         (cp_parser_asm_definition): Use cp_parser_asm_string_expression.
2245         (cp_parser_yield_expression): Dito.
2246         (cp_parser_asm_specification_opt): Dito.
2247         (cp_parser_asm_operand_list): Dito.
2248         (cp_parser_asm_clobber_list): Dito.
2250 2024-06-11  Andi Kleen  <ak@linux.intel.com>
2252         * cp-tree.h (class cexpr_str): Add.
2253         * semantics.cc (finish_static_assert): Convert to use cexpr_str.
2254         (cexpr_str::type_check): Extract constexpr string code to here.
2255         (cexpr_str::extract): ... and here.
2257 2024-06-08  Simon Martin  <simon@nasilyan.com>
2259         PR c++/108438
2260         * parser.cc (cp_parser_postfix_expression): Use
2261         cp_parser_require_end_of_template_parameter_list to skip to the closing
2262         '>' upon error parsing the target type of *_cast<*> expressions.
2264 2024-06-07  Simon Martin  <simon@nasilyan.com>
2266         PR c++/107575
2267         * decl.cc (duplicate_decls): Check for error_mark_node
2268         DECL_LOCAL_DECL_ALIAS.
2270 2024-06-07  Jason Merrill  <jason@redhat.com>
2272         * module.cc (maybe_translate_include): Allow before the main file.
2274 2024-06-07  Patrick Palka  <ppalka@redhat.com>
2276         PR c++/115378
2277         * lambda.cc (lambda_capture_field_type): Set
2278         TEMPLATE_TYPE_PARAMETER_PACK on the auto type of an init-capture
2279         pack expansion.
2280         * pt.cc (find_parameter_packs_r) <case TEMPLATE_TYPE_PARM>:
2281         Restrict TEMPLATE_TYPE_PARAMETER_PACK promotion with
2282         flag_concepts_ts.
2284 2024-06-05  Jakub Jelinek  <jakub@redhat.com>
2285             Frederik Harwath  <frederik@codesourcery.com>
2286             Sandra Loosemore  <sandra@codesourcery.com>
2288         * cp-tree.h (dependent_omp_for_p): Add another tree argument.
2289         * parser.cc (check_omp_intervening_code): Reject imperfectly nested
2290         tile.
2291         (cp_parser_statement_seq_opt): If want_nested_loop, use
2292         cp_parser_next_tokens_can_be_canon_loop instead of just checking
2293         for RID_FOR keyword.
2294         (cp_parser_omp_clause_name): Handle full and partial clause names.
2295         (cp_parser_omp_clause_full, cp_parser_omp_clause_partial): New
2296         functions.
2297         (cp_parser_omp_all_clauses): Formatting fix.  Handle
2298         PRAGMA_OMP_CLAUSE_PARTIAL and PRAGMA_OMP_CLAUSE_FULL.
2299         (cp_parser_next_tokens_can_be_canon_loop): New function.
2300         (cp_parser_omp_loop_nest): Parse C++11 attributes.  Handle tile/unroll
2301         constructs.  Use cp_parser_next_tokens_can_be_canon_loop instead
2302         of just checking for RID_FOR keyword.  Only add_stmt
2303         cp_parser_omp_loop_nest result if it is non-NULL.
2304         (cp_parser_omp_for_loop): Rename tiling variable to oacc_tiling.  For
2305         OMP_CLAUSE_SIZES set collapse to list length of OMP_CLAUSE_SIZES_LIST.
2306         Use cp_parser_next_tokens_can_be_canon_loop instead of just
2307         checking for RID_FOR keyword.  Remove spurious semicolon.  Don't call
2308         c_omp_check_loop_binding_exprs if stmt is NULL.  Skip and/or handle
2309         generated loops.  Remove spurious ()s around & operands.
2310         (cp_parser_omp_tile_sizes, cp_parser_omp_tile): New functions.
2311         (OMP_UNROLL_CLAUSE_MASK): Define.
2312         (cp_parser_omp_unroll): New function.
2313         (cp_parser_omp_construct): Handle PRAGMA_OMP_TILE and
2314         PRAGMA_OMP_UNROLL.
2315         (cp_parser_pragma): Likewise.
2316         * semantics.cc (finish_omp_clauses): Don't call
2317         fold_build_cleanup_point_expr for cases which obviously won't need it,
2318         like checked INTEGER_CSTs.  Handle OMP_CLAUSE_{FULL,PARTIAL,SIZES}
2319         and diagnose full vs. partial conflict.  Adjust wording of some of the
2320         conflicting clause diagnostic messages to include word clause.
2321         (finish_omp_for): Use decl equal to global_namespace as a marker for
2322         generated loop.  Pass also body to dependent_omp_for_p.  Skip
2323         generated loops.
2324         (finish_omp_for_block): Skip generated loops.
2325         * pt.cc (tsubst_omp_clauses): Handle OMP_CLAUSE_{FULL,PARTIAL,SIZES}.
2326         (tsubst_stmt): Handle OMP_TILE and OMP_UNROLL.  Handle or skip
2327         generated loops.
2328         (dependent_omp_for_p): Add body argument.  If declv vector element
2329         is NULL, find generated loop.
2330         * cp-gimplify.cc (cp_gimplify_expr): Handle OMP_TILE and OMP_UNROLL.
2331         (cp_fold_r): Likewise.
2332         (cp_genericize_r): Likewise.  Skip generated loops.
2334 2024-06-04  Simon Martin  <simon@nasilyan.com>
2336         * pt.cc (tsubst_expr): Add missing space after seen_error.
2337         (dependent_type_p): Likewise.
2339 2024-06-04  Simon Martin  <simon@nasilyan.com>
2341         PR c++/111106
2342         * pt.cc (dependent_type_p): Don't fail assert during error recovery.
2344 2024-06-03  Jakub Jelinek  <jakub@redhat.com>
2346         PR c++/115012
2347         * parser.cc (cp_parser_direct_declarator): Handle
2348         abstract declarator starting with ... followed by opening paren.
2350 2024-06-02  Simon Martin  <simon@nasilyan.com>
2352         PR c++/109958
2353         * typeck.cc (build_class_member_access_expr): Handle single OVERLOADs.
2354         (cp_build_addr_expr_1): Likewise.
2356 2024-06-01  Nathaniel Shead  <nathanieloshead@gmail.com>
2358         PR c++/114867
2359         * cp-tree.h (OVL_PURVIEW_P): New.
2360         (ovl_iterator::purview_p): New.
2361         * module.cc (depset::hash::add_binding_entity): Only ignore
2362         entities not within module purview. Set OVL_PURVIEW_P on new
2363         OVERLOADs for emitted declarations.
2364         (module_state::read_cluster): Imported using-decls are always
2365         in purview, mark as OVL_PURVIEW_P.
2366         * name-lookup.h (enum WMB_Flags): New WMB_Purview flag.
2367         * name-lookup.cc (walk_module_binding): Set WMB_Purview as
2368         needed.
2369         (do_nonmember_using_decl): Don't remove from existing OVERLOADs.
2370         Also reveal non-exported decls. Also reveal 'extern "C"' decls.
2371         Add workaround to reveal non-function decls.
2372         * tree.cc (ovl_insert): Adjust to also set OVL_PURVIEW_P when
2373         needed.
2375 2024-05-29  Jason Merrill  <jason@redhat.com>
2377         PR c++/109753
2378         * decl.cc (start_preparsed_function): Call decl_attributes.
2380 2024-05-29  Jason Merrill  <jason@redhat.com>
2382         * lang-specs.h: Add module interface extensions.
2384 2024-05-29  Patrick Palka  <ppalka@redhat.com>
2386         PR c++/115223
2387         * tree.cc (build_cp_fntype_variant): Propagate structural
2388         equality of the exception-less variant.
2390 2024-05-28  Marek Polacek  <polacek@redhat.com>
2392         PR c++/109396
2393         * cp-tree.h (maybe_warn_self_move): Declare.
2394         * init.cc (perform_member_init): Call maybe_warn_self_move.
2395         * typeck.cc (maybe_warn_self_move): No longer static.  Change the
2396         return type to bool.  Also warn when called from
2397         a member-initializer-list.  Drop the inform call.
2399 2024-05-28  Marek Polacek  <polacek@redhat.com>
2401         PR c++/114707
2402         * call.cc (convert_for_arg_passing): Call set_target_expr_eliding.
2403         * typeck2.cc (replace_placeholders_for_class_temp_r): Don't use pset.
2404         (digest_nsdmi_init): Call cp_walk_tree_without_duplicates instead of
2405         cp_walk_tree.
2407 2024-05-28  David Malcolm  <dmalcolm@redhat.com>
2409         PR bootstrap/115167
2410         PR bootstrap/115167
2411         * call.cc: Replace include of "gcc-rich-location.h" with
2412         "c-family/c-type-mismatch.h".
2413         * error.cc: Likewise.
2414         * typeck.cc: Likewise.
2416 2024-05-25  Nathaniel Shead  <nathanieloshead@gmail.com>
2418         PR c++/102345
2419         * module.cc (module_may_redeclare): Update error message.
2421 2024-05-24  Nathaniel Shead  <nathanieloshead@gmail.com>
2423         PR c++/115200
2424         * parser.cc (cp_parser_error_1): Special-case unexpected module
2425         directives for better diagnostics.
2426         (cp_parser_module_declaration): Check that the module
2427         declaration is at global scope.
2428         (cp_parser_import_declaration): Sync error message with that in
2429         cp_parser_error_1.
2431 2024-05-24  Nathaniel Shead  <nathanieloshead@gmail.com>
2433         * cp-tree.h (module_has_cmi_p): Also include header units.
2434         (module_maybe_has_cmi_p): Update comment.
2435         * module.cc (set_defining_module): Only need to track
2436         declarations for later exporting if the module may have a CMI.
2437         (set_defining_module_for_partial_spec): Likewise.
2438         * name-lookup.cc (pushdecl): Likewise.
2440 2024-05-24  Nathaniel Shead  <nathanieloshead@gmail.com>
2442         * tree.cc (no_linkage_check): Anonymous types can't be accessed
2443         in a different TU.
2445 2024-05-24  Nathaniel Shead  <nathanieloshead@gmail.com>
2447         PR c++/114947
2448         * cp-tree.h (set_defining_module_for_partial_spec): Declare.
2449         * module.cc (trees_in::decl_value): Track partial specs coming
2450         from partitions.
2451         (set_defining_module): Don't track partial specialisations here
2452         anymore.
2453         (set_defining_module_for_partial_spec): New function.
2454         * pt.cc (process_partial_specialization): Call it.
2456 2024-05-23  Jason Merrill  <jason@redhat.com>
2458         PR c++/115187
2459         * init.cc (build_delete): Use get_target_expr instead of save_expr.
2460         * tree.cc (stabilize_expr): Update comment.
2462 2024-05-22  Patrick Palka  <ppalka@redhat.com>
2464         PR c++/115159
2465         * tree.cc (build_cp_fntype_variant): Always use structural
2466         equality for types with a complex exception specification.
2467         (fixup_deferred_exception_variants): Use structural equality
2468         for adjusted variants.
2469         * typeck.cc (comp_except_specs): Require == instead of
2470         cp_tree_equal for ce_exact noexcept-spec comparison.
2472 2024-05-22  Nathaniel Shead  <nathanieloshead@gmail.com>
2474         * decl.cc (grokfndecl): Check for main functions with language
2475         linkage or module attachment.
2476         (grokvardecl): Check for extern 'C' entities named main.
2478 2024-05-21  Jonathan Wakely  <jwakely@redhat.com>
2480         PR libstdc++/107800
2481         * cxxapi-data.csv <to_address>: Change dialect to cxx20.
2482         * std-name-hint.gperf: Regenerate.
2483         * std-name-hint.h: Regenerate.
2485 2024-05-21  Patrick Palka  <ppalka@redhat.com>
2487         PR c++/115139
2488         * pt.cc (tsubst_expr) <case CONST_DECL>: Exit early if args
2489         is empty.
2491 2024-05-17  Patrick Palka  <ppalka@redhat.com>
2493         PR c++/115114
2494         * pt.cc (maybe_aggr_guide): Consider bases in the paren init case.
2496 2024-05-15  Marek Polacek  <polacek@redhat.com>
2498         PR c++/114854
2499         * call.cc (convert_like_internal) <case ck_user>: Don't set
2500         TARGET_EXPR_DIRECT_INIT_P.
2502 2024-05-15  Marek Polacek  <polacek@redhat.com>
2504         DR 1693
2505         PR c++/113760
2506         DR 569
2507         * parser.cc (extra_semi_kind): New.
2508         (maybe_warn_extra_semi): New.
2509         (cp_parser_declaration): Call maybe_warn_extra_semi.
2510         (cp_parser_member_declaration): Likewise.
2512 2024-05-15  Jakub Jelinek  <jakub@redhat.com>
2513             Jason Merrill  <jason@redhat.com>
2515         PR lto/113208
2516         * cp-tree.h (maybe_optimize_cdtor): Remove.
2517         * decl2.cc (tentative_decl_linkage): Call maybe_make_one_only
2518         for implicit instantiations of maybe in charge ctors/dtors
2519         declared inline.
2520         (import_export_decl): Don't call maybe_optimize_cdtor.
2521         (c_parse_final_cleanups): Formatting fixes.
2522         * optimize.cc (can_alias_cdtor): Adjust condition, for
2523         HAVE_COMDAT_GROUP && DECL_ONE_ONLY && DECL_WEAK return true even
2524         if not DECL_INTERFACE_KNOWN.
2525         (maybe_clone_body): Don't clear DECL_SAVED_TREE, instead set it
2526         to void_node.
2527         (maybe_clone_body): Remove.
2528         * decl.cc (cxx_comdat_group): For DECL_CLONED_FUNCTION_P
2529         functions if SUPPORTS_ONE_ONLY return DECL_COMDAT_GROUP if already
2530         set.
2532 2024-05-15  Jakub Jelinek  <jakub@redhat.com>
2534         PR c/115103
2535         * semantics.cc (finish_omp_clauses): Diagnose grainsize
2536         used together with num_tasks.
2538 2024-05-15  Patrick Palka  <ppalka@redhat.com>
2540         PR c++/114994
2541         * tree.cc (lvalue_kind) <case MODOP_EXPR>: For a class
2542         assignment, consider the result type.
2544 2024-05-14  Simon Martin  <simon-l.martin@laposte.net>
2546         PR c++/105760
2547         * pt.cc (build_deduction_guide): Check for error_mark_node
2548         result from tsubst_arg_types.
2550 2024-05-14  Jason Merrill  <jason@redhat.com>
2552         * decl.cc (wrap_cleanups_r): Clarify comment.
2553         * init.cc (build_vec_init): Update comment.
2555 2024-05-13  Patrick Palka  <ppalka@redhat.com>
2557         * constraint.cc (norm_info::norm_info): Take a bool instead of
2558         tsubst_flags_t.
2559         (norm_info::generate_diagnostics): Turn this predicate function
2560         into a bool data member.
2561         (normalize_logical_operation): Adjust after norm_info changes.
2562         (normalize_concept_check): Likewise.
2563         (normalize_atom): Likewise.
2564         (get_normalized_constraints_from_info): Likewise.
2565         (normalize_concept_definition): Likewise.
2566         (normalize_constraint_expression): Likewise.
2567         (normalize_placeholder_type_constraints): Likewise.
2568         (satisfy_nondeclaration_constraints): Likewise.
2569         * cp-tree.h (enum tsubst_flags): Remove tf_norm.
2571 2024-05-13  Ken Matsui  <kmatsui@gcc.gnu.org>
2573         PR c++/115061
2574         * semantics.cc (finish_trait_expr): Use rank instead of
2575         __array_rank.
2577 2024-05-13  Patrick Palka  <ppalka@redhat.com>
2579         PR c++/114974
2580         PR c++/114901
2581         PR c++/114903
2582         * pt.cc (maybe_aggr_guide): Fix obtaining TYPE_FIELDS in
2583         the paren init case.  Hoist out partial substitution logic
2584         to apply to the paren init case as well.
2585         (alias_ctad_tweaks): Substitute outer template arguments into
2586         a guide's constraints.
2588 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2590         * cp-trait.def: Define __is_nothrow_invocable.
2591         * constraint.cc (diagnose_trait_expr): Handle
2592         CPTK_IS_NOTHROW_INVOCABLE.
2593         * semantics.cc (trait_expr_value): Likewise.
2594         (finish_trait_expr): Likewise.
2596 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2598         * cp-trait.def: Define __is_invocable.
2599         * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_INVOCABLE.
2600         * semantics.cc (trait_expr_value): Likewise.
2601         (finish_trait_expr): Likewise.
2602         * cp-tree.h (build_invoke): New function.
2603         * method.cc (build_invoke): New function.
2605 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2607         * cp-trait.def: Define __array_rank.
2608         * constraint.cc (diagnose_trait_expr): Handle CPTK_RANK.
2609         * semantics.cc (trait_expr_value): Likewise.
2610         (finish_trait_expr): Likewise.
2612 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2614         * cp-trait.def: Define __decay.
2615         * semantics.cc (finish_trait_type): Handle CPTK_DECAY.
2617 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2619         * cp-trait.def: Define __add_rvalue_reference.
2620         * semantics.cc (finish_trait_type): Handle
2621         CPTK_ADD_RVALUE_REFERENCE.
2623 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2625         * cp-trait.def: Define __add_lvalue_reference.
2626         * semantics.cc (finish_trait_type): Handle
2627         CPTK_ADD_LVALUE_REFERENCE.
2629 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2631         * cp-trait.def: Define __remove_all_extents.
2632         * semantics.cc (finish_trait_type): Handle
2633         CPTK_REMOVE_ALL_EXTENTS.
2635 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2637         * cp-trait.def: Define __remove_extent.
2638         * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_EXTENT.
2640 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2642         * cp-trait.def: Define __add_pointer.
2643         * semantics.cc (finish_trait_type): Handle CPTK_ADD_POINTER.
2644         (object_type_p): New function.
2645         (referenceable_type_p): Likewise.
2646         (trait_expr_value): Use object_type_p.
2648 2024-05-11  Ken Matsui  <kmatsui@gcc.gnu.org>
2650         * cp-trait.def: Define __is_unbounded_array.
2651         * constraint.cc (diagnose_trait_expr): Handle
2652         CPTK_IS_UNBOUNDED_ARRAY.
2653         * semantics.cc (trait_expr_value): Likewise.
2654         (finish_trait_expr): Likewise.
2656 2024-05-10  Jakub Jelinek  <jakub@redhat.com>
2658         PR target/114968
2659         * cp-tree.h (atexit_fn_ptr_type_node, cleanup_type): Adjust macro
2660         comments.
2661         (get_cxa_atexit_fn_ptr_type): Declare.
2662         * decl.cc (get_atexit_fn_ptr_type): Adjust function comment, only
2663         build type for atexit argument.
2664         (get_cxa_atexit_fn_ptr_type): New function.
2665         (get_atexit_node): Call get_cxa_atexit_fn_ptr_type rather than
2666         get_atexit_fn_ptr_type when using __cxa_atexit.
2667         (get_thread_atexit_node): Call get_cxa_atexit_fn_ptr_type
2668         rather than get_atexit_fn_ptr_type.
2669         (start_cleanup_fn): Add ob_parm argument, call
2670         get_cxa_atexit_fn_ptr_type or get_atexit_fn_ptr_type depending
2671         on it and create PARM_DECL also based on that argument.
2672         (register_dtor_fn): Adjust start_cleanup_fn caller, use
2673         get_cxa_atexit_fn_ptr_type rather than get_atexit_fn_ptr_type
2674         for use_dtor casts.
2675         * except.cc (build_throw): Use get_cxa_atexit_fn_ptr_type ().
2677 2024-05-09  Marek Polacek  <polacek@redhat.com>
2679         PR c++/114983
2680         * pt.cc (tsubst_expr) <case SIZEOF_EXPR>: Use copy_warning.
2681         * semantics.cc (finish_parenthesized_expr): Also suppress
2682         -Wsizeof-array-div.
2684 2024-05-09  Marek Polacek  <polacek@redhat.com>
2686         PR c++/85889
2687         * lambda.cc (add_capture): Add a pedwarn for capturing structured
2688         bindings.
2690 2024-05-08  Marek Polacek  <polacek@redhat.com>
2692         PR c++/113582
2693         * parser.cc (cp_parser_label_for_labeled_statement): suppress_warning
2694         if it's not enabled at input_location.
2695         * pt.cc (tsubst_stmt): Call copy_warning.
2697 2024-05-07  Nathaniel Shead  <nathanieloshead@gmail.com>
2699         PR c++/114856
2700         * call.cc (make_temporary_var_for_ref_to_temp): Set context for
2701         temporaries with linkage.
2702         * init.cc (create_temporary_var): Revert to only set context
2703         when in a function decl.
2705 2024-05-07  Andrew Pinski  <quic_apinski@quicinc.com>
2707         PR c++/89224
2708         * constexpr.cc (cxx_eval_array_reference): Compare main variants
2709         for the vector/array types instead of the types directly.
2711 2024-05-07  Jakub Jelinek  <jakub@redhat.com>
2713         PR c++/114459
2714         * parser.cc (cp_parser_member_declaration): Implement C++26
2715         P2893R3 - Variadic friends.  Parse friend type declarations
2716         with ... or with more than one friend type specifier.
2717         * friend.cc (make_friend_class): Allow TYPE_PACK_EXPANSION.
2718         * pt.cc (instantiate_class_template): Handle PACK_EXPANSION_P
2719         in friend classes.
2721 2024-05-07  Marek Polacek  <polacek@redhat.com>
2723         * decl.cc (duplicate_decls): Don't check VAR_P before
2724         DECL_DECOMPOSITION_P.
2725         * init.cc (build_aggr_init): Likewise.
2726         * parser.cc (cp_parser_range_for): Likewise.
2727         (do_range_for_auto_deduction): Likewise.
2728         (cp_convert_range_for): Likewise.
2729         (cp_convert_omp_range_for): Likewise.
2730         (cp_finish_omp_range_for): Likewise.
2731         * pt.cc (extract_locals_r): Likewise.
2732         (tsubst_omp_for_iterator): Likewise.
2733         (tsubst_decomp_names): Likewise.
2734         (tsubst_stmt): Likewise.
2735         * typeck.cc (maybe_warn_about_returning_address_of_local): Likewise.
2737 2024-05-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2739         * Make-lang.in (cc1plus$(exeext)): Remove $(NETLIBS).
2741 2024-05-07  Nathaniel Shead  <nathanieloshead@gmail.com>
2743         PR c++/114954
2744         * cp-tree.h (IS_FAKE_BASE_TYPE): Also apply to unions.
2746 2024-05-07  Nathaniel Shead  <nathanieloshead@gmail.com>
2748         PR c++/114275
2749         * cp-tree.h (remove_defining_module): Declare.
2750         * decl.cc (duplicate_decls): Call remove_defining_module on
2751         to-be-freed newdecl.
2752         * module.cc (imported_temploid_friends): Mark as GTY root...
2753         (init_modules): ...and allocate from ggc.
2754         (trees_in::decl_value): Only track for declarations that won't
2755         be discarded.
2756         (remove_defining_module): New function.
2758 2024-05-06  Qing Zhao  <qing.zhao@oracle.com>
2760         PR c/53548
2761         * decl.cc (layout_var_decl): Handle the cases when the DECL is
2762         union with a flexible array member initializer.
2764 2024-05-06  Qing Zhao  <qing.zhao@oracle.com>
2766         PR c/53548
2767         * class.cc (diagnose_flexarrays): Change error to pdewarn for the case
2768         flexible array members alone in structures.
2769         * decl.cc (grokdeclarator): Change error to pdewarn for the case
2770         flexible array members in unions.
2772 2024-05-03  Jason Merrill  <jason@redhat.com>
2774         PR c++/114935
2775         * cp-gimplify.cc (cp_genericize_init): Add flags parm.
2776         (cp_genericize_init_expr): Pass nullptr.
2777         (cp_genericize_target_expr): Handle cleanup flags.
2778         * typeck2.cc (build_disable_temp_cleanup): Factor out of...
2779         (split_nonconstant_init): ...here.
2780         * cp-tree.h (build_disable_temp_cleanup): Declare.
2782 2024-05-03  Ken Matsui  <kmatsui@gcc.gnu.org>
2784         * cp-trait.def: Define __is_pointer.
2785         * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER.
2786         * semantics.cc (trait_expr_value): Likewise.
2787         (finish_trait_expr): Likewise.
2789 2024-05-03  Ken Matsui  <kmatsui@gcc.gnu.org>
2791         * cp-trait.def: Define __is_volatile.
2792         * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_VOLATILE.
2793         * semantics.cc (trait_expr_value): Likewise.
2794         (finish_trait_expr): Likewise.
2796 2024-05-03  Ken Matsui  <kmatsui@gcc.gnu.org>
2798         * cp-trait.def: Define __is_const.
2799         * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONST.
2800         * semantics.cc (trait_expr_value): Likewise.
2801         (finish_trait_expr): Likewise.
2803 2024-05-03  Patrick Palka  <ppalka@redhat.com>
2805         * coroutines.cc (instantiate_coro_traits): Adjust call to
2806         lookup_template_class.
2807         (instantiate_coro_handle_for_promise_type): Likewise.
2808         * cp-tree.h (adjust_type_for_entering_scope): Declare.
2809         (lookup_template_class): Adjust declaration.
2810         * decl.cc (make_typename_type): Adjust call to
2811         lookup_template_class. Likewise.
2812         (get_tuple_size): Likewise.
2813         (get_tuple_element_type): Likewise.
2814         * pt.cc (adjust_type_for_entering_scope): Define.
2815         (tsubst_entering_scope): Define.
2816         (lookup_template_class): Remove entering_scope parameter.
2817         Replace tsubst_aggr_type call with tsubst_entering_scope.
2818         (tsubst_aggr_type): Remove.
2819         (tsubst_aggr_type_1): Inline into tsubst.
2820         (tsubst_function_decl): Replace tsubst_aggr_type call
2821         with tsubst_entering_scope.
2822         (tsubst_template_decl): Likewise.
2823         (tsubst_decl): Likewise.
2824         (tsubst) <case RECORD_TYPE, UNION_TYPE, ENUMERAL_TYPE>:
2825         Inlined from tsubst_aggr_type_1.
2826         <case BOUND_TEMPLATE_TEMPLATE_PARM>: Adjust calls to
2827         lookup_template_class.
2828         <case TYPENAME_TYPE>: Replace tsubst_aggr_type call with
2829         tsubst_entering_scope.
2830         <case UNBOUND_CLASS_TEMPLATE>: Likewise.
2831         Increment processing_template_decl when substituting the
2832         context.
2833         (tsubst_expr) <case FIELD_DECL>: Replace tsubst_aggr_type
2834         call with tsubst_entering_scope.
2835         <case TEMPLATE_DECL>: Likewise.
2836         (instantiate_template): Likewise.
2837         (resolve_typename_type): Adjust lookup_template_class call
2838         and call adjust_type_for_entering_scope afterward.
2839         (listify): Adjust lookup_template_class call.
2840         (alias_ctad_tweaks): Likewise.
2841         * semantics.cc (finish_template_type): Adjust lookup_template_class
2842         call and maybe call adjust_type_for_entering_scope afterward.
2844 2024-05-02  Nathaniel Shead  <nathanieloshead@gmail.com>
2846         PR c++/114917
2847         * parser.cc (cp_parser_declaration_seq_opt): Clear
2848         parser->in_unbraced_* flags when parsing toplevel declarations.
2850 2024-05-02  Jakub Jelinek  <jakub@redhat.com>
2852         PR c++/114458
2853         * parser.cc (cp_parser_pure_specifier): Implement C++26 P2573R2
2854         - = delete("should have a reason");.  Parse deleted-function-body.
2855         * decl.cc (duplicate_decls): Copy DECL_INITIAL from DECL_DELETED_FN
2856         olddecl to newdecl if it is a STRING_CST.
2857         (cp_finish_decl): Handle deleted init with a reason.
2858         * decl2.cc: Include "escaped_string.h".
2859         (grokfield): Handle deleted init with a reason.
2860         (mark_used): Emit DECL_DELETED_FN reason in the message if any.
2861         * cp-tree.h (DECL_DELETED_FN): Document representation of
2862         = delete("reason") on a DECL.
2864 2024-05-02  Nathaniel Shead  <nathanieloshead@gmail.com>
2866         PR c++/114630
2867         * module.cc (depset::hash::add_partial_entities): Mark GM
2868         specializations as unreached.
2869         (depset::hash::find_dependencies): Also reach entities in the
2870         DECL_TEMPLATE_SPECIALIZATIONS list.
2872 2024-05-02  Nathaniel Shead  <nathanieloshead@gmail.com>
2874         PR c++/105224
2875         * class.cc (finish_struct_1): Also push classes attached to a
2876         module into the 'keyed_classes' list.
2877         * decl.cc (record_key_method_defined): Don't push classes
2878         attached to a named module into the 'keyed_classes' list.
2879         * module.cc (trees_in::read_class_def): Likewise.
2880         * decl2.cc (import_export_class): Uniquely emit vtables for
2881         non-template classes attached to a named module.
2882         (vtables_uniquely_emitted): New function.
2883         (import_export_decl): Update comments. Update with knowledge
2884         about new kinds of uniquely emitted vtables.
2886 2024-05-01  Jason Merrill  <jason@redhat.com>
2888         * cp-tree.h (base_ctor_identifier): Adjust comment.
2889         * call.cc (in_charge_arg_for_name): Abort on deleting dtor.
2890         * decl2.cc (maybe_retrofit_in_chrg): Don't add it for
2891         destructors without vbases, either.
2892         * constexpr.cc (cxx_eval_call_expression): Remove workaround.
2894 2024-05-01  Jason Merrill  <jason@redhat.com>
2896         PR c++/113706
2897         * decl.cc (decls_match): Handle memchr return type being
2898         const-qualified.
2900 2024-05-01  Nathaniel Shead  <nathanieloshead@gmail.com>
2902         * name-lookup.cc (walk_module_binding): Use the
2903         partition-specific hidden flag instead of the top-level
2904         decl_hidden.
2906 2024-05-01  Nathaniel Shead  <nathanieloshead@gmail.com>
2908         PR c++/114868
2909         * module.cc (depset::hash::add_binding_entity): Propagate
2910         OVL_USING_P for using-declarations.
2912 2024-05-01  Nathaniel Shead  <nathanieloshead@gmail.com>
2914         PR c++/107688
2915         * name-lookup.cc (push_namespace): Error when exporting
2916         namespace with internal linkage.
2917         * parser.h (struct cp_parser): Add new flag
2918         'in_unbraced_export_declaration_p'.
2919         * parser.cc (cp_debug_parser): Print the new flag.
2920         (cp_parser_new): Initialise the new flag.
2921         (cp_parser_module_export): Set the new flag.
2922         (cp_parser_class_specifier): Clear and restore the new flag.
2923         (cp_parser_import_declaration): Imports can now appear directly
2924         in a linkage specification.
2925         (cp_parser_declaration): Categorise declarations as "name" or
2926         "special"; error on the later in contexts where the former is
2927         required.
2928         (cp_parser_class_head): Error when exporting a partial
2929         specialisation.
2931 2024-04-30  Jakub Jelinek  <jakub@redhat.com>
2933         PR c++/114456
2934         * parser.cc (cp_parser_decomposition_declaration): Implement C++26
2935         P0609R3 - Attributes for Structured Bindings.  Parse attributed
2936         identifier lists for structured binding declarations, pass the
2937         attributes to start_decl.
2939 2024-04-30  Nathaniel Shead  <nathanieloshead@gmail.com>
2941         PR c++/105320
2942         PR c++/114275
2943         * cp-tree.h (propagate_defining_module): Declare.
2944         (lookup_imported_hidden_friend): Declare.
2945         * decl.cc (duplicate_decls): Also check if hidden decls can be
2946         redeclared in this module.
2947         * module.cc (imported_temploid_friends): New.
2948         (init_modules): Initialize it.
2949         (trees_out::decl_value): Write it; don't consider imported
2950         temploid friends as attached to a module.
2951         (trees_in::decl_value): Read it.
2952         (get_originating_module_decl): Follow the owning decl for an
2953         imported temploid friend.
2954         (propagate_defining_module): New.
2955         * name-lookup.cc (get_mergeable_namespace_binding): New.
2956         (lookup_imported_hidden_friend): New.
2957         * pt.cc (tsubst_friend_function): Propagate defining module for
2958         new friend functions.
2959         (tsubst_friend_class): Lookup imported hidden friends.  Check
2960         for valid module attachment of existing names.  Propagate
2961         defining module for new classes.
2963 2024-04-30  Nathaniel Shead  <nathanieloshead@gmail.com>
2965         * cp-tree.h (module_may_redeclare): Add default parameter.
2966         * decl.cc (duplicate_decls): Don't emit errors for failed
2967         module_may_redeclare.
2968         (xref_tag): Likewise.
2969         (start_enum): Likewise.
2970         * semantics.cc (begin_class_definition): Likewise.
2971         * module.cc (module_may_redeclare): Clean up logic. Emit error
2972         messages on failure.
2974 2024-04-30  Patrick Palka  <ppalka@redhat.com>
2976         PR c++/114889
2977         * module.cc (trees_in::read_class_def): Look through
2978         TEMPLATE_DECL when adding to CLASSTYPE_BEFRIENDING_CLASSES.
2980 2024-04-30  Patrick Palka  <ppalka@redhat.com>
2982         PR c++/114888
2983         * typeck.cc (cp_build_binary_op) <case *_DIV_*>: Add missing
2984         dependence check for the second sizeof operand.
2986 2024-04-26  Patrick Palka  <ppalka@redhat.com>
2988         * error.cc (print_instantiation_partial_context_line): Clear the
2989         pretty printer prefix around the call to diagnostic_show_locus.
2991 2024-04-25  Jakub Jelinek  <jakub@redhat.com>
2993         PR c++/111284
2994         * constexpr.cc (cxx_bind_parameters_in_call): For PARM_DECLs with
2995         TREE_ADDRESSABLE types use vc_glvalue rather than vc_prvalue for
2996         cxx_eval_constant_expression and if it doesn't have the same
2997         type as it should, cast the reference type to reference to type
2998         before convert_from_reference and instead of adjust_temp_type
2999         take address of the arg, cast to reference to type and then
3000         convert_from_reference.
3001         (cxx_eval_constant_expression) <case PARM_DECL>: For lval case
3002         on parameters with TREE_ADDRESSABLE types lookup result in
3003         ctx->globals if possible.  Otherwise if lookup in ctx->globals
3004         was successful for parameter with TREE_ADDRESSABLE type,
3005         recurse with vc_prvalue on the returned value.
3007 2024-04-25  Jakub Jelinek  <jakub@redhat.com>
3009         PR lto/113208
3010         * cp-tree.h (maybe_optimize_cdtor): Declare.
3011         * decl2.cc (import_export_decl): Call it for cloned cdtors.
3012         * optimize.cc (maybe_optimize_cdtor): New function.
3014 2024-04-24  Patrick Palka  <ppalka@redhat.com>
3016         PR c++/114709
3017         * constexpr.cc (cxx_fold_indirect_ref): Restrict object/offset
3018         canonicalization to RECORD_TYPE member accesses.
3020 2024-04-23  Nathaniel Shead  <nathanieloshead@gmail.com>
3022         * parser.cc (cp_parser_parameter_declaration): Check if
3023         decl_specifiers.type is null.
3025 2024-04-23  Patrick Palka  <ppalka@redhat.com>
3027         PR c++/114795
3028         * module.cc (trees_in::is_matching_decl): Propagate deduced
3029         function return type.
3031 2024-04-23  Jakub Jelinek  <jakub@redhat.com>
3033         * parser.cc (cp_parser_using_declaration): Spelling fix: favour
3034         -> favor.
3036 2024-04-23  Jakub Jelinek  <jakub@redhat.com>
3038         PR c++/114784
3039         * method.cc (implicitly_declare_fn): Call clone_attrs
3040         on DECL_ATTRIBUTES on STRIP_TEMPLATE (inherited_ctor) rather than
3041         inherited_ctor.  Also copy DECL_DISREGARD_INLINE_LIMITS flag from it.
3043 2024-04-23  Nathaniel Shead  <nathanieloshead@gmail.com>
3045         PR c++/114078
3046         * decl.cc (grokdeclarator): Check allocation functions for xobj
3047         parameters.
3049 2024-04-16  Jakub Jelinek  <jakub@redhat.com>
3051         PR c++/114706
3052         * constexpr.cc (check_bit_cast_type): Handle ARRAY_TYPE.
3054 2024-04-15  Nathaniel Shead  <nathanieloshead@gmail.com>
3055             Patrick Palka  <ppalka@redhat.com>
3057         PR c++/114600
3058         * module.cc (depset::hash::add_binding_entity): Require both
3059         WMB_Using and WMB_Export for GMF entities.
3061 2024-04-14  Nathaniel Shead  <nathanieloshead@gmail.com>
3063         PR c++/106820
3064         * module.cc (trees_in::decl_value): Assemble alias when needed.
3066 2024-04-13  Patrick Palka  <ppalka@redhat.com>
3068         * module.cc (struct bytes_in::bits_in): Define defaulted
3069         move ctor.
3070         (struct bytes_out::bits_out): Likewise.
3072 2024-04-13  Patrick Palka  <ppalka@redhat.com>
3074         * module.cc: Update comment about classes defined within.
3075         (class data): Enclose in an anonymous namespace.
3076         (data::calc_crc): Moved from bytes::calc_crc.
3077         (class bytes): Remove.  Move bit_flush to namespace scope.
3078         (class bytes_in): Enclose in an anonymous namespace.  Inherit
3079         directly from data and adjust accordingly.  Move b and bflush
3080         members to bits_in.
3081         (class bytes_out): As above.  Remove is_set static data member.
3082         (bit_flush): Moved from class bytes.
3083         (struct bytes_in::bits_in): Define.
3084         (struct bytes_out::bits_out): Define.
3085         (bytes_in::stream_bits): Define.
3086         (bytes_out::stream_bits): Define.
3087         (bytes_out::bflush): Moved to bits_out/in.
3088         (bytes_in::bflush): Likewise
3089         (bytes_in::bfill): Removed.
3090         (bytes_out::b): Moved to bits_out/in.
3091         (bytes_in::b): Likewise.
3092         (class trees_in): Enclose in an anonymous namespace.
3093         (class trees_out): Enclose in an anonymous namespace.
3094         (trees_out::core_bools): Add bits_out/in parameter and use it.
3095         Unconditionally stream a bit for public_flag.  Add early exits
3096         as appropriate.
3097         (trees_out::core_bools): Likewise.
3098         (trees_out::lang_decl_bools): Add bits_out/in parameter and use
3099         it.  Flush the current bit buffer at the start.  Unconditionally
3100         stream a bit for module_keyed_decls_p.
3101         (trees_in::lang_decl_bools): Likewise.
3102         (trees_out::lang_type_bools): Add bits_out/in parameter and use
3103         it.  Flush the current bit buffer at the start.
3104         (trees_in::lang_type_bools): Likewise.
3105         (trees_out::tree_node_bools): Construct a bits_out object and
3106         use/pass it.
3107         (trees_in::tree_node_bools): Likewise.
3108         (trees_out::decl_value): Likewise.
3109         (trees_in::decl_value): Likewise.
3110         (module_state::write_define): Likewise.
3111         (module_state::read_define): Likewise.
3113 2024-04-12  Marek Polacek  <polacek@redhat.com>
3115         PR c++/109966
3116         * typeck2.cc (potential_prvalue_result_of): Remove.
3117         (replace_placeholders_for_class_temp_r): Check TARGET_EXPR_ELIDING_P.
3118         Use a pset.  Don't replace_placeholders in TARGET_EXPRs that initialize
3119         a function argument.
3121 2024-04-12  Patrick Palka  <ppalka@redhat.com>
3123         PR c++/99426
3124         * module.cc (merge_kind::MK_local_type): New enumerator.
3125         (merge_kind_name): Update.
3126         (trees_out::chained_decls): Move BLOCK-specific handling
3127         of DECL_LOCAL_DECL_P decls to ...
3128         (trees_out::core_vals) <case BLOCK>: ... here.  Stream
3129         BLOCK_VARS manually.
3130         (trees_in::core_vals) <case BLOCK>: Stream BLOCK_VARS
3131         manually.  Handle deduplicated local types..
3132         (trees_out::key_local_type): Define.
3133         (trees_in::key_local_type): Define.
3134         (trees_out::get_merge_kind) <case FUNCTION_DECL>: Return
3135         MK_local_type for a local type.
3136         (trees_out::key_mergeable) <case FUNCTION_DECL>: Use
3137         key_local_type.
3138         (trees_in::key_mergeable) <case FUNCTION_DECL>: Likewise.
3139         (trees_in::is_matching_decl): Be flexible with type mismatches
3140         for local entities.
3141         (trees_in::register_duplicate): Also register the
3142         DECL_TEMPLATE_RESULT of a TEMPLATE_DECL as a duplicate.
3143         (depset_cmp): Return 0 for equal IDENTIFIER_HASH_VALUEs.
3145 2024-04-12  Jason Merrill  <jason@redhat.com>
3146             Patrick Palka  <ppalka@redhat.com>
3148         PR c++/113141
3149         * call.cc (reference_binding): For an invalid cast, warn and don't
3150         recalculate.
3152 2024-04-12  Jason Merrill  <jason@redhat.com>
3153             Patrick Palka  <ppalka@redhat.com>
3155         DR 1996
3156         PR c++/113141
3157         * call.cc (reference_binding): Check direct binding from
3158         a single-element list.
3160 2024-04-12  Jakub Jelinek  <jakub@redhat.com>
3162         PR c++/114691
3163         * semantics.cc (simplify_loop_decl_cond): Use cp_build_unary_op with
3164         TRUTH_NOT_EXPR on ANNOTATE_EXPR argument (if any) rather than
3165         ANNOTATE_EXPR itself.
3167 2024-04-12  Patrick Palka  <ppalka@redhat.com>
3169         PR c++/114393
3170         * pt.cc (tsubst_lambda_expr): Also defer all dependent
3171         substitution.
3173 2024-04-12  Jakub Jelinek  <jakub@redhat.com>
3175         PR c++/114426
3176         * constexpr.cc (is_valid_constexpr_fn): Return false/diagnose with
3177         complain destructors in classes with virtual bases.
3179 2024-04-12  Patrick Palka  <ppalka@redhat.com>
3181         PR c++/114393
3182         PR c++/107457
3183         PR c++/93595
3184         * cp-tree.h (LAMBDA_EXPR_EXTRA_ARGS): Define.
3185         (tree_lambda_expr::extra_args): New field.
3186         * module.cc (trees_out::core_vals) <case LAMBDA_EXPR>: Stream
3187         LAMBDA_EXPR_EXTRA_ARGS.
3188         (trees_in::core_vals) <case LAMBDA_EXPR>: Likewise.
3189         * pt.cc (has_extra_args_mechanism_p): Return true for LAMBDA_EXPR.
3190         (tree_extra_args): Handle LAMBDA_EXPR.
3191         (tsubst_lambda_expr): Use LAMBDA_EXPR_EXTRA_ARGS to defer templated
3192         substitution into a lambda-expr if we lost the template context.
3193         Add sanity check for error_mark_node result from begin_lambda_type.
3195 2024-04-11  Patrick Palka  <ppalka@redhat.com>
3197         PR c++/114303
3198         * constraint.cc (tsubst_requires_expr): Clear
3199         REQUIRES_EXPR_EXTRA_ARGS before calling build_extra_args.
3200         * pt.cc (tree_extra_args): Define.
3201         (extract_locals_r): Assert *_EXTRA_ARGS is empty.
3202         (tsubst_stmt) <case IF_STMT>: Clear IF_SCOPE on the new
3203         IF_STMT.  Call build_extra_args on the new IF_STMT instead
3204         of t which might already have IF_STMT_EXTRA_ARGS.
3206 2024-04-11  Jakub Jelinek  <jakub@redhat.com>
3208         PR c++/114409
3209         * pt.cc (tsubst_expr) <case ANNOTATE_EXPR>: Move to ...
3210         (tsubst_stmt) <case ANNOTATE_EXPR>: ... here.  Use tsubst_expr
3211         instead of RECUR for the last 2 arguments.
3213 2024-04-10  Jakub Jelinek  <jakub@redhat.com>
3215         PR c++/114462
3216         * semantics.cc: Implement C++26 P2809R3 - Trivial infinite
3217         loops are not Undefined Behavior.
3218         (maybe_warn_for_constant_evaluated): Add trivial_infinite argument
3219         and emit special diagnostics for that case.
3220         (finish_if_stmt_cond): Adjust caller.
3221         (finish_loop_cond): New function.
3222         (finish_while_stmt): Use it.
3223         (finish_do_stmt): Likewise.
3224         (finish_for_stmt): Likewise.
3226 2024-04-10  Nathaniel Shead  <nathanieloshead@gmail.com>
3228         PR c++/104040
3229         * semantics.cc (expand_or_defer_fn_1): Keep DECL_SAVED_TREE for
3230         all vague linkage cdtors with modules.
3232 2024-04-10  Nathaniel Shead  <nathanieloshead@gmail.com>
3234         PR c++/99377
3235         * module.cc (trees_in::install_entity): Overwrite entity map
3236         index if installing from a partition.
3238 2024-04-09  Jakub Jelinek  <jakub@redhat.com>
3240         PR c++/114580
3241         * semantics.cc (finish_if_stmt_cond): Call
3242         maybe_warn_for_constant_evaluated with IF_STMT_CONSTEXPR_P (if_stmt)
3243         as the second argument, rather than true/false depending on if
3244         it is if constexpr with non-dependent constant expression with
3245         bool type.
3247 2024-04-09  Jakub Jelinek  <jakub@redhat.com>
3249         * constexpr.cc (build_new_constexpr_heap_type): Fix duplicated words
3250         in comment; is is -> is.
3251         * cp-tree.def (CO_RETURN_EXPR): Fix duplicated words in comment;
3252         for for -> for.
3253         * parser.cc (fixup_blocks_walker): Fix duplicated words in comment;
3254         is is -> is.
3255         * semantics.cc (fixup_template_type): Fix duplicated words in comment;
3256         for for -> for.
3257         (finish_omp_for): Fix duplicated words in comment; the the -> the.
3258         * pt.cc (more_specialized_fn): Fix duplicated words in comment;
3259         think think -> think.
3260         (type_targs_deducible_from): Fix duplicated words in comment; the the
3261         -> the.
3263 2024-04-05  Marek Polacek  <polacek@redhat.com>
3265         PR c++/111132
3266         * constexpr.cc (get_function_named_in_call): Use
3267         cp_get_fndecl_from_callee.
3268         * cvt.cc (cp_get_fndecl_from_callee): If there's a
3269         DECL_LOCAL_DECL_ALIAS, use it.
3271 2024-04-05  Jakub Jelinek  <jakub@redhat.com>
3273         PR c++/114572
3274         * cp-gimplify.cc (cxx_omp_clause_apply_fn): Call build_cplus_new
3275         on build_call_a result if it has class type.
3277 2024-04-04  centurion  <centurion009@proton.me>
3279         PR c++/114377
3280         * pt.cc (find_template_parameter_info::found): Use TREE_TYPE for
3281         TEMPLATE_DECL instead of DECL_INITIAL.
3283 2024-04-02  Marek Polacek  <polacek@redhat.com>
3285         PR c++/114479
3286         * semantics.cc (trait_expr_value) <case CPTK_IS_ARRAY>: Return false
3287         for zero-sized arrays.
3289 2024-04-02  Marek Polacek  <polacek@redhat.com>
3291         PR c++/103825
3292         * typeck.cc (is_bitfield_expr_with_lowered_type): Handle
3293         CLEANUP_POINT_EXPR.
3295 2024-04-02  Jason Merrill  <jason@redhat.com>
3297         PR c++/114561
3298         PR c++/114562
3299         * call.cc (convert_like_internal): Avoid adding qualification
3300         conversion in direct reference binding.
3302 2024-04-01  Jason Merrill  <jason@redhat.com>
3304         * typeck.cc (maybe_warn_about_returning_address_of_local):
3305         Permerror in C++26.
3307 2024-03-28  Jason Merrill  <jason@redhat.com>
3309         PR c++/100667
3310         * semantics.cc (same_type_ref_bind_p): New.
3311         (finish_trait_expr): Use it.
3313 2024-03-26  Jakub Jelinek  <jakub@redhat.com>
3315         PR c++/112724
3316         * error.cc (dump_expr): Handle EXCESS_PRECISION_EXPR like NOP_EXPR.
3318 2024-03-25  Marek Polacek  <polacek@redhat.com>
3320         PR c++/114349
3321         * name-lookup.cc (maybe_push_to_top_level): For a non-lambda,
3322         don't push to top level if decl_function_context is non-null.
3323         * pt.cc (maybe_instantiate_noexcept): Use maybe_push_to_top_level.
3325 2024-03-25  Marek Polacek  <polacek@redhat.com>
3327         PR c++/114439
3328         * init.cc (can_init_array_with_p): Return true for a VEC_INIT_EXPR
3329         wrapped in a TARGET_EXPR.
3331 2024-03-22  Marek Polacek  <polacek@redhat.com>
3333         PR c++/59465
3334         * init.cc (can_init_array_with_p): New.
3335         (perform_member_init): Check it.
3337 2024-03-21  Marek Polacek  <polacek@redhat.com>
3339         PR c++/110323
3340         * decl2.cc (min_vis_expr_r) <case VAR_DECL>: Do nothing for
3341         decl_constant_var_p VAR_DECLs.
3343 2024-03-20  Jakub Jelinek  <jakub@redhat.com>
3345         * coroutines.cc (expand_one_await_expression): Use
3346         integer_zero_node instead of build_int_cst (integer_type_node, 0)
3347         and integer_one_node instead of build_int_cst (integer_type_node, 1).
3349 2024-03-19  Nathaniel Shead  <nathanieloshead@gmail.com>
3351         * cp-tree.h (module_maybe_has_cmi_p): New function.
3352         * decl.cc (grokfndecl): Mark block-scope functions as public if
3353         they could be visible in other TUs.
3354         * decl2.cc (no_linkage_error): Don't error for declarations that
3355         could be defined in other TUs since C++20. Suppress duplicate
3356         errors from 'check_global_declaration'.
3357         * tree.cc (no_linkage_check): In relaxed mode, don't consider
3358         types in a module CMI to have no linkage.
3360 2024-03-16  Nathaniel Shead  <nathanieloshead@gmail.com>
3362         PR c++/112631
3363         * cp-tree.h (named_module_attach_p): New function.
3364         * decl.cc (start_decl): Check for attachment not purview.
3365         (grokmethod): Likewise.
3367 2024-03-14  Chung-Lin Tang  <cltang@baylibre.com>
3369         * parser.cc (cp_parser_oacc_data_clause): Add parsing support for
3370         'readonly' modifier, set OMP_CLAUSE_MAP_READONLY if readonly modifier
3371         found, update comments.
3372         (cp_parser_oacc_cache): Add parsing support for 'readonly' modifier,
3373         set OMP_CLAUSE__CACHE__READONLY if readonly modifier found, update
3374         comments.
3376 2024-03-12  Nathaniel Shead  <nathanieloshead@gmail.com>
3378         PR c++/98645
3379         PR c++/98688
3380         PR c++/111224
3381         * module.cc (enum tree_tag): Add new tag for builtin types.
3382         (trees_out::start): POLY_INT_CSTs can be emitted.
3383         (trees_in::start): Likewise.
3384         (trees_out::core_vals): Stream POLY_INT_CSTs.
3385         (trees_in::core_vals): Likewise.
3386         (trees_out::type_node): Handle vectors with multiple coeffs.
3387         (trees_in::tree_node): Likewise.
3388         (init_modules): Register target-specific builtin types. Bump
3389         initial capacity slightly.
3391 2024-03-08  Jakub Jelinek  <jakub@redhat.com>
3393         * pt.cc (tsubst_expr): Handle MEM_REF.
3395 2024-03-08  Jakub Jelinek  <jakub@redhat.com>
3397         PR debug/113918
3398         * cp-objcp-common.cc (cp_type_dwarf_attribute): Return 1
3399         for DW_AT_export_symbols on anonymous structs or unions.
3401 2024-03-08  Jakub Jelinek  <jakub@redhat.com>
3403         PR c++/113802
3404         * parser.cc (cp_parser_parameter_declaration): Move the xobj_param_p
3405         pack diagnostics after ellipsis handling and if an error is reported,
3406         pretend this specifier didn't appear.  Formatting fix.
3408 2024-03-07  Nathaniel Shead  <nathanieloshead@gmail.com>
3410         PR c++/114229
3411         * module.cc (trees_out::core_bools): Redetermine
3412         DECL_INTERFACE_KNOWN on stream-in for vtables and tinfo.
3413         * decl2.cc (import_export_decl): Add fixme for ABI changes with
3414         module vtables and tinfo.
3416 2024-03-07  Patrick Palka  <ppalka@redhat.com>
3418         PR c++/103994
3419         * cp-tree.h (add_mergeable_specialization): Remove second
3420         parameter.
3421         * module.cc (depset::disc_bits::DB_ALIAS_TMPL_INST_BIT): Remove.
3422         (depset::disc_bits::DB_ALIAS_SPEC_BIT): Remove.
3423         (depset::is_alias_tmpl_inst): Remove.
3424         (depset::is_alias): Remove.
3425         (merge_kind::MK_tmpl_alias_mask): Remove.
3426         (merge_kind::MK_alias_spec): Remove.
3427         (merge_kind_name): Remove entries for alias specializations.
3428         (trees_out::core_vals) <case TEMPLATE_DECL>: Adjust after
3429         removing is_alias_tmpl_inst.
3430         (trees_in::decl_value): Adjust add_mergeable_specialization
3431         calls.
3432         (trees_out::get_merge_kind) <case depset::EK_SPECIALIZATION>:
3433         Use MK_decl_spec for alias template specializations.
3434         (trees_out::key_mergeable): Simplify after MK_tmpl_alias_mask
3435         removal.
3436         (depset::hash::make_dependency): Adjust after removing
3437         DB_ALIAS_TMPL_INST_BIT.
3438         (specialization_add): Don't allow alias templates when !decl_p.
3439         (depset::hash::add_specializations): Remove now-dead code
3440         accomodating alias template specializations in the type table.
3441         * pt.cc (lookup_template_class): Dispatch early to
3442         instantiate_alias_template for alias templates.  Simplify
3443         accordingly.
3444         (add_mergeable_specialization): Remove alias_p parameter and
3445         simplify accordingly.
3447 2024-03-07  Patrick Palka  <ppalka@redhat.com>
3449         PR c++/110730
3450         PR c++/105512
3451         * module.cc (module_state::write_namespaces): Stream the
3452         abi_tag attribute of an inline namespace.
3453         (module_state::read_namespaces): Likewise.
3455 2024-03-07  Marek Polacek  <polacek@redhat.com>
3457         PR c++/110031
3458         * pt.cc (lookup_and_finish_template_variable): Pass complain to
3459         mark_used.
3461 2024-03-07  Nathaniel Shead  <nathanieloshead@gmail.com>
3463         PR c++/98356
3464         * typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
3465         'member' will be a FUNCTION_DECL (or something like it).
3467 2024-03-07  Nathaniel Shead  <nathanieloshead@gmail.com>
3469         PR c++/98881
3470         * module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT
3471         for template template parameters.
3472         (trees_in::tpl_parms_fini): Read it.
3474 2024-03-06  Marek Polacek  <polacek@redhat.com>
3476         PR c++/114114
3477         * pt.cc (maybe_instantiate_noexcept): Save/restore
3478         cp_unevaluated_operand, c_inhibit_evaluation_warnings, and
3479         cp_noexcept_operand around the tsubst_expr call.
3481 2024-03-06  Nathaniel Shead  <nathanieloshead@gmail.com>
3483         PR c++/113629
3484         * pt.cc (type_unification_real): Only use DEDUCE_CONV for the
3485         return type of a conversion function.
3487 2024-03-06  Patrick Palka  <ppalka@redhat.com>
3489         * module.cc (trees_out::get_merge_kind) <case depset::EK_DECL>:
3490         Accomodate class-scope DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P
3491         TEMPLATE_DECL.  Consolidate IDENTIFIER_ANON_P cases.
3493 2024-03-05  Patrick Palka  <ppalka@redhat.com>
3495         * parser.cc (cp_parser_translation_unit): Relax GMF contents
3496         error into a pedwarn.
3498 2024-03-04  Nathaniel Shead  <nathanieloshead@gmail.com>
3500         * name-lookup.cc (walk_module_binding): Remove completed FIXME.
3501         (do_nonmember_using_decl): Mark redeclared entities as exported
3502         when needed. Check for re-exporting internal linkage types.
3504 2024-03-01  Patrick Palka  <ppalka@redhat.com>
3506         PR c++/104919
3507         PR c++/106009
3508         * module.cc (depset::hash::sneakoscope): Remove.
3509         (trees_out::decl_node): Always add a dependency on a local type.
3510         (depset::hash::find_dependencies): Remove sneakoscope stuff.
3512 2024-03-01  Nathaniel Shead  <nathanieloshead@gmail.com>
3514         PR c++/114170
3515         * module.cc (has_definition): Fall back to DECL_INITIALIZED_P
3516         when DECL_INITIAL is not set on a template.
3517         (module_state::write_inits): Only increment count when
3518         initializers are actually written.
3520 2024-03-01  Nathaniel Shead  <nathanieloshead@gmail.com>
3522         PR c++/114005
3523         * init.cc (create_temporary_var): Use current_scope instead of
3524         current_function_decl.
3526 2024-03-01  Patrick Palka  <ppalka@redhat.com>
3528         * decl.cc (maybe_register_incomplete_var): Restrict second
3529         branch to static data members from a not-yet-complete class.
3531 2024-03-01  Marek Polacek  <polacek@redhat.com>
3533         PR c++/110358
3534         PR c++/109642
3535         * call.cc (no_dangling_p): New.
3536         (reference_like_class_p): Use it.
3537         (do_warn_dangling_reference): Use it.  Don't warn when the function
3538         or its enclosing class has attribute gnu::no_dangling.
3539         * tree.cc (cxx_gnu_attributes): Add gnu::no_dangling.
3540         (handle_no_dangling_attribute): New.
3542 2024-03-01  Patrick Palka  <ppalka@redhat.com>
3544         PR c++/110025
3545         PR c++/114138
3546         * cp-tree.h (make_cast_auto): Declare.
3547         * parser.cc (cp_parser_functional_cast): If the type is an auto,
3548         replace it with a level-less one via make_cast_auto.
3549         * pt.cc (find_parameter_packs_r): Don't treat level-less auto
3550         as a type parameter pack.
3551         (tsubst) <case TEMPLATE_TYPE_PARM>: Generalize CTAD placeholder
3552         auto handling to all level-less autos.
3553         (make_cast_auto): Define.
3554         (do_auto_deduction): Handle replacement of a level-less auto.
3556 2024-03-01  Jakub Jelinek  <jakub@redhat.com>
3558         PR c++/92687
3559         * decl.cc (lookup_decomp_type): Return NULL_TREE if decomp_type_table
3560         doesn't have entry for V.
3561         * semantics.cc (finish_decltype_type): If ptds.saved, assert
3562         DECL_HAS_VALUE_EXPR_P is true and decide on tuple vs. non-tuple based
3563         on if lookup_decomp_type is NULL or not.
3565 2024-02-29  Marek Polacek  <polacek@redhat.com>
3567         PR c++/113987
3568         * call.cc (conv_binds_to_reference_parm_p): New.
3569         * cp-tree.h (conv_binds_to_reference_parm_p): Declare.
3570         * init.cc (find_uninit_fields_r): Call it.
3572 2024-02-29  Nathaniel Shead  <nathanieloshead@gmail.com>
3574         PR c++/111710
3575         * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Remove tree checking.
3576         (struct lang_decl_base): Update comments and fix whitespace.
3577         * module.cc (trees_out::lang_decl_bools): Always write
3578         module_keyed_decls_p flag...
3579         (trees_in::lang_decl_bools): ...and always read it.
3580         (trees_out::decl_value): Handle all kinds of keyed decls.
3581         (trees_in::decl_value): Likewise.
3582         (trees_in::tree_value): Deduplicate LAMBDA_EXPRs.
3583         (maybe_key_decl): Also support lambdas attached to fields,
3584         parameters, and types. Key lambdas attached to fields to their
3585         class.
3586         (trees_out::get_merge_kind): Likewise.
3587         (trees_out::key_mergeable): Likewise.
3588         (trees_in::key_mergeable): Support keyed decls in a TYPE_DECL
3589         container.
3590         * parser.cc (cp_parser_class_head): Start a lambda scope when
3591         parsing base classes.
3593 2024-02-28  Jakub Jelinek  <jakub@redhat.com>
3594             Patrick Palka  <ppalka@redhat.com>
3596         PR c++/113976
3597         * decl.cc (grokdeclarator): Don't call cp_apply_type_quals_to_decl
3598         on DECL_TEMPLATE_INSTANTIATED VAR_DECLs.
3600 2024-02-28  Nathaniel Shead  <nathanieloshead@gmail.com>
3602         PR c++/113970
3603         PR c++/114013
3604         * decl.cc (make_rtl_for_nonlocal_decl): Don't defer inline
3605         variables.
3607 2024-02-23  Jakub Jelinek  <jakub@redhat.com>
3609         PR c++/113083
3610         * cp-gimplify.cc (cp_fold): For targetm.cxx.cdtor_returns_this ()
3611         wrap r into a COMPOUND_EXPR and return folded CALL_EXPR_ARG (x, 0).
3613 2024-02-19  Patrick Palka  <ppalka@redhat.com>
3615         PR c++/113966
3616         * constraint.cc (tsubst_compound_requirement): Don't check
3617         the noexcept condition or the return-type-requirement when
3618         partially substituting.
3620 2024-02-17  Marek Polacek  <polacek@redhat.com>
3622         PR c++/113158
3623         * search.cc (maybe_check_overriding_exception_spec): Defer checking
3624         when a noexcept couldn't be instantiated & evaluated to false/true.
3626 2024-02-16  Marek Polacek  <polacek@redhat.com>
3628         DR 1351
3629         * search.cc (maybe_check_overriding_exception_spec): Don't error about
3630         a looser exception specification if the overrider is deleted.
3632 2024-02-16  Marek Polacek  <polacek@redhat.com>
3634         PR c++/113789
3635         PR c++/113853
3636         * typeck.cc (treat_lvalue_as_rvalue_p): Update code to better
3637         reflect [expr.prim.id.unqual]#4.2.
3639 2024-02-16  Jakub Jelinek  <jakub@redhat.com>
3641         PR c++/113929
3642         * parser.cc (cp_parser_parameter_declaration): Diagnose this specifier
3643         on template parameter declaration.
3645 2024-02-16  Patrick Palka  <ppalka@redhat.com>
3647         * module.cc (trees_out::core_bools): Stream TREE_UNAVAILABLE.
3648         (trees_in::core_bools): Likewise.
3649         (trees_out::core_vals): Stream LAMBDA_EXPR_REGEN_INFO.
3650         (trees_in::core_vals): Likewise.
3652 2024-02-14  Nathaniel Shead  <nathanieloshead@gmail.com>
3654         PR c++/113708
3655         * decl.cc (make_rtl_for_nonlocal_decl): Defer inline variables.
3656         * decl2.cc (import_export_decl): Support inline variables.
3658 2024-02-14  Patrick Palka  <ppalka@redhat.com>
3660         PR c++/113908
3661         PR c++/113332
3662         * method.cc (synthesized_method_walk): Use maybe_push_to_top_level.
3664 2024-02-14  Nathaniel Shead  <nathanieloshead@gmail.com>
3666         PR c++/99573
3667         * decl.cc (start_enum): Reorder check for redeclaring in module.
3668         Add missing auto_diagnostic_groups.
3670 2024-02-13  Marek Polacek  <polacek@redhat.com>
3672         DR 1693
3673         PR c++/113760
3674         * parser.cc (cp_parser_member_declaration): Only pedwarn about an extra
3675         semicolon in C++98.
3677 2024-02-13  Tobias Burnus  <tburnus@baylibre.com>
3679         PR middle-end/113904
3680         * parser.cc (cp_parser_omp_context_selector): Handle splitting of
3681         OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
3683 2024-02-13  Patrick Palka  <ppalka@redhat.com>
3685         * Make-lang.in (CFLAGS-cp/module.o): Add $(ZLIBINC).
3686         * module.cc: Include <zlib.h>.
3687         (bytes::calc_crc): Use crc32 from zlib.
3688         (bytes_out::set_crc): Use crc32_combine from zlib.
3690 2024-02-13  Patrick Palka  <ppalka@redhat.com>
3692         * module.cc (depset::hash::add_specializations): Use
3693         STRIP_TEMPLATE consistently.
3694         (get_originating_module_decl): Handle class-scope CONST_DECL.
3696 2024-02-13  Patrick Palka  <ppalka@redhat.com>
3698         * lambda.cc (lambda_function): Call get_class_binding_direct
3699         instead of lookup_member to sidestep lazy loading.
3700         * name-lookup.cc (check_local_shadow): Punt if we're in a
3701         function context that's not actual parsing.
3703 2024-02-13  Jason Merrill  <jason@redhat.com>
3705         PR c++/113612
3706         * pt.cc (process_partial_specialization): Return early
3707         on redeclaration.
3709 2024-02-13  Marek Polacek  <polacek@redhat.com>
3711         PR c++/112436
3712         * except.cc (expand_start_catch_block): Pass tf_warning_or_error to
3713         is_admissible_throw_operand_or_catch_parameter.
3714         (build_throw): Pass complain to
3715         is_admissible_throw_operand_or_catch_parameter.
3716         (complete_ptr_ref_or_void_ptr_p): Add a tsubst_flags_t parameter.  Use
3717         it.  Return bool.  Call complete_type_or_maybe_complain instead of
3718         complete_type_or_else.
3719         (is_admissible_throw_operand_or_catch_parameter): Add a tsubst_flags_t
3720         parameter.  Use it.  Guard error calls.
3722 2024-02-13  Alex Coplan  <alex.coplan@arm.com>
3724         PR c++/113658
3725         * cp-objcp-common.cc (cp_feature_table): Remove entry for
3726         cxx_constexpr_string_builtins.
3728 2024-02-12  Marek Polacek  <polacek@redhat.com>
3730         PR c++/113545
3731         * constexpr.cc (cxx_eval_switch_expr): If the condition doesn't reduce
3732         to an INTEGER_CST, consider it non-constant.
3734 2024-02-10  Marek Polacek  <polacek@redhat.com>
3736         DR 2237
3737         PR c++/107126
3738         PR c++/97202
3739         * parser.cc (cp_parser_unqualified_id): Downgrade the DR2237 error to
3740         a pedwarn.
3741         (cp_parser_constructor_declarator_p): Likewise.
3743 2024-02-10  Jakub Jelinek  <jakub@redhat.com>
3745         * tree.cc (debug_binfo): Use HOST_WIDE_INT_PRINT_DEC instead of "%ld"
3746         and casts to long.
3747         * pt.cc (print_template_statistics): Use HOST_SIZE_T_PRINT_DEC
3748         and casts to fmt_size_t instead of "%ld" and casts to long.
3749         * class.cc (dump_class_hierarchy_1): Use HOST_WIDE_INT_PRINT_UNSIGNED
3750         instead of "%lu" and casts to unsigned long.  For TYPE_ALIGN, use
3751         %u instead of %lu and drop casts to unsigned long.
3752         * parser.cc (cp_lexer_peek_nth_token): Use HOST_SIZE_T_PRINT_DEC
3753         and casts to fmt_size_t instead of "%ld" and casts to long.
3755 2024-02-09  Marek Polacek  <polacek@redhat.com>
3757         PR c++/113834
3758         * semantics.cc (finish_type_pack_element): Perform range checking
3759         before tree_to_shwi.
3761 2024-02-09  Marek Polacek  <polacek@redhat.com>
3763         PR c++/98388
3764         * coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error
3765         to build_throw.
3766         (morph_fn_to_coro): Likewise.
3767         * cp-tree.h (build_throw): Adjust.
3768         * except.cc (expand_end_catch_block): Pass tf_warning_or_error to
3769         build_throw.
3770         (build_throw): Add a tsubst_flags_t parameter.  Use it.  Remove
3771         redundant variable.  Guard an inform call.
3772         * parser.cc (cp_parser_throw_expression): Pass tf_warning_or_error
3773         to build_throw.
3774         * pt.cc (tsubst_expr) <case THROW_EXPR>: Pass complain to build_throw.
3776 2024-02-09  Patrick Palka  <ppalka@redhat.com>
3778         PR c++/112580
3779         * module.cc (trees_in::read_class_def): When streaming in
3780         an anonymous union field of an as-base class, don't overwrite
3781         ANON_AGGR_TYPE_FIELD.
3783 2024-02-08  Patrick Palka  <ppalka@redhat.com>
3785         PR c++/113649
3786         * pt.cc (do_class_deduction): Add outer_targs parameter.
3787         Substitute outer arguments into the CTAD template.
3788         (do_auto_deduction): Pass outer_targs to do_class_deduction.
3790 2024-02-08  Jason Merrill  <jason@redhat.com>
3792         * pt.cc (create_template_parm_object): Pass TARGET_EXPR to
3793         cxx_constant_value.
3795 2024-02-06  Jakub Jelinek  <jakub@redhat.com>
3797         PR c++/113788
3798         * parser.cc (CP_PARSER_FLAGS_PARAMETER): New enumerator.
3799         (cp_parser_decl_specifier_seq): Parse RID_THIS only if
3800         CP_PARSER_FLAGS_PARAMETER is set in flags.
3801         (cp_parser_parameter_declaration): Or in CP_PARSER_FLAGS_PARAMETER
3802         when calling cp_parser_decl_specifier_seq.
3804 2024-02-06  Marek Polacek  <polacek@redhat.com>
3806         * method.cc (early_check_defaulted_comparison): Add
3807         auto_diagnostic_group.
3809 2024-02-06  Jason Merrill  <jason@redhat.com>
3811         PR c++/107291
3812         * method.cc (early_check_defaulted_comparison): Fail if not friend.
3814 2024-02-05  Jason Merrill  <jason@redhat.com>
3816         PR c++/111286
3817         * tree.cc (rvalue): Don't drop cv-quals from an array.
3819 2024-02-03  Patrick Palka  <ppalka@redhat.com>
3821         PR c++/110006
3822         PR c++/112769
3823         * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
3824         tsubst flags.
3825         (tsubst_valid_expression_requirement): Likewise.
3826         (tsubst_simple_requirement): Return a substituted _REQ node when
3827         processing_template_decl.
3828         (tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
3829         flags.
3830         (tsubst_type_requirement): Return a substituted _REQ node when
3831         processing_template_decl.
3832         (tsubst_compound_requirement): Likewise.  Accomodate non-diagnostic
3833         tsubst flags.
3834         (tsubst_nested_requirement): Likewise.
3835         (tsubst_requires_expr): Don't defer partial substitution when
3836         processing_constraint_expression_p is true, in which case return
3837         a substituted REQUIRES_EXPR.
3838         * pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
3839         non-diagnostic tsubst flags.
3841 2024-02-02  Jason Merrill  <jason@redhat.com>
3843         PR c++/110084
3844         * pt.cc (tsubst_function_decl): Only check a function defaulted
3845         outside the class if the class is complete.
3847 2024-02-02  Jason Merrill  <jason@redhat.com>
3849         PR c++/112439
3850         * constexpr.cc (cxx_eval_store_expression): Check empty_base
3851         before marking a CONSTRUCTOR readonly.
3853 2024-02-02  Jason Merrill  <jason@redhat.com>
3855         PR c++/113638
3856         * cp-tree.h: Adjust comment.
3857         * pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
3858         variable template.
3860 2024-02-01  Marek Polacek  <polacek@redhat.com>
3862         * call.cc (reference_like_class_p): Consider even non-templates for
3863         std::span-like classes.
3865 2024-02-01  Patrick Palka  <ppalka@redhat.com>
3867         PR c++/112737
3868         * pt.cc (iterative_hash_template_arg) <case TEMPLATE_DECL>:
3869         Adjust hashing to match cp_tree_equal.
3870         (ctp_hasher::hash): Also hash CLASS_PLACEHOLDER_TEMPLATE.
3871         * tree.cc (cp_tree_equal) <case TEMPLATE_DECL>: Return true
3872         for ttp TEMPLATE_DECLs if their TEMPLATE_TEMPLATE_PARMs are
3873         equivalent.
3874         * typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
3875         Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
3877 2024-02-01  Marek Polacek  <polacek@redhat.com>
3879         PR c++/112437
3880         * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
3881         the move on throw of parms loop.
3883 2024-01-30  Marek Polacek  <polacek@redhat.com>
3885         PR c++/110358
3886         PR c++/109640
3887         * call.cc (reference_like_class_p): Don't warn for std::span-like
3888         classes.
3890 2024-01-30  Patrick Palka  <ppalka@redhat.com>
3892         PR c++/113640
3893         * call.cc (keep_unused_object_arg): Punt for an xobj member
3894         function.
3896 2024-01-30  Patrick Palka  <ppalka@redhat.com>
3898         PR c++/113644
3899         * pt.cc (unify) <case INTEGER_CST>: Handle NULL_TREE type.
3901 2024-01-30  Nathaniel Shead  <nathanieloshead@gmail.com>
3903         PR c++/107594
3904         * module.cc (get_module): Bail on empty name.
3906 2024-01-29  Jason Merrill  <jason@redhat.com>
3908         PR c++/113544
3909         * pt.cc (instantiate_class_template): Don't partially instantiate.
3910         (tsubst_stmt): Likewise.
3912 2024-01-26  Nathaniel Shead  <nathanieloshead@gmail.com>
3914         PR c++/113580
3915         * module.cc (struct post_process_data): Create.
3916         (trees_in::post_decls): Use.
3917         (trees_in::post_process): Return entire vector at once.
3918         Change overload to take post_process_data instead of tree.
3919         (trees_out::write_function_def): Write needed flags from
3920         DECL_STRUCT_FUNCTION.
3921         (trees_in::read_function_def): Read them and pass to
3922         post_process.
3923         (module_state::read_cluster): Write flags into cfun.
3925 2024-01-26  Nathaniel Shead  <nathanieloshead@gmail.com>
3927         PR c++/112899
3928         * cp-tree.h (note_variable_template_instantiation): Rename to...
3929         (note_vague_linkage_variable): ...this.
3930         * decl2.cc (note_variable_template_instantiation): Rename to...
3931         (note_vague_linkage_variable): ...this.
3932         * pt.cc (instantiate_decl): Rename usage of above function.
3933         * module.cc (trees_in::read_var_def): Remember pending statics
3934         that we stream in.
3936 2024-01-25  Jakub Jelinek  <jakub@redhat.com>
3938         PR c++/113599
3939         * typeck2.cc (build_m_component_ref): Use convert instead of
3940         cp_convert for pointer conversion.
3942 2024-01-25  Jason Merrill  <jason@redhat.com>
3944         PR c++/113598
3945         * init.cc (build_vec_init): Don't use {} for PMF.
3947 2024-01-25  Jason Merrill  <jason@redhat.com>
3949         PR c++/109227
3950         * coroutines.cc (build_co_await): Use cxx_maybe_build_cleanup.
3951         (build_actor_fn, process_conditional, maybe_promote_temps)
3952         (morph_fn_to_coro): Likewise.
3953         (expand_one_await_expression): Use build_cleanup.
3955 2024-01-25  Nathaniel Shead  <nathanieloshead@gmail.com>
3957         PR c++/113405
3958         * module.cc (set_defining_module): Track partial specialisations
3959         for all declarations.
3961 2024-01-25  Nathaniel Shead  <nathanieloshead@gmail.com>
3963         PR c++/100707
3964         * name-lookup.cc (add_imported_namespace): Don't mark namespaces
3965         as imported.
3967 2024-01-24  Patrick Palka  <ppalka@redhat.com>
3969         PR c++/113529
3970         * call.cc (add_operator_candidates): Propagate error_mark_node
3971         result after recursing to find rewritten candidates.
3973 2024-01-23  Marek Polacek  <polacek@redhat.com>
3975         PR c++/113256
3976         PR c++/111607
3977         PR c++/109640
3978         * call.cc (do_warn_dangling_reference): Don't warn if the temporary
3979         is of lambda type.
3981 2024-01-23  Nathaniel Shead  <nathanieloshead@gmail.com>
3983         PR c++/112820
3984         PR c++/102607
3985         * module.cc (trees_out::lang_type_bools): Write interface_only
3986         and interface_unknown.
3987         (trees_in::lang_type_bools): Read the above flags.
3988         (trees_in::decl_value): Reset CLASSTYPE_INTERFACE_* except for
3989         extern templates.
3990         (trees_in::read_class_def): Remove buggy extern template
3991         handling.
3993 2024-01-19  Jason Merrill  <jason@redhat.com>
3995         PR c++/113498
3996         * pt.cc (decl_template_info): New fn.
3997         (get_template_info): Use it.
3999 2024-01-19  Jason Merrill  <jason@redhat.com>
4001         PR c++/112632
4002         PR c++/112594
4003         PR c++/111357
4004         PR c++/104594
4005         PR c++/67898
4006         * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
4007         * pt.cc (expand_integer_pack): Remove 111357 workaround.
4008         (maybe_convert_nontype_argument): Add force parm.
4009         (convert_template_argument): Handle alias template args
4010         specially.
4011         (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
4012         * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.
4014 2024-01-18  Marek Polacek  <polacek@redhat.com>
4016         PR c++/113389
4017         * decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
4018         NULL_TREE when emitting an error.
4020 2024-01-17  Nathaniel Shead  <nathanieloshead@gmail.com>
4022         PR c++/112588
4023         * module.cc (trees_in::read_function_def): Don't overwrite
4024         arguments.
4026 2024-01-17  Patrick Palka  <ppalka@redhat.com>
4028         PR c++/113242
4029         PR c++/99493
4030         * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
4031         DECL_ARTIFICIAL rejection test for class NTTP objects.
4033 2024-01-16  Nathaniel Shead  <nathanieloshead@gmail.com>
4035         PR c++/113292
4036         * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
4037         (c_parse_final_cleanups): Suppress warning for no definition of
4038         TLS wrapper functions in header modules.
4039         * module.cc (trees_out::lang_decl_vals): Write wrapped variable
4040         for TLS wrapper functions.
4041         (trees_in::lang_decl_vals): Read it.
4042         (trees_out::decl_value): Write TLS model for thread-local vars.
4043         (trees_in::decl_value): Read it for new decls. Remember to emit
4044         definitions of TLS wrapper functions later.
4046 2024-01-16  Nathaniel Shead  <nathanieloshead@gmail.com>
4048         * name-lookup.h (enum scope_kind): Add 'sk_count'.
4049         * name-lookup.cc (cp_binding_level_descriptor): Add missing
4050         scope kinds. Add assertion that the list is up to date. Fix
4051         handling of explicit_spec_p.
4053 2024-01-16  Marek Polacek  <polacek@redhat.com>
4055         * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
4056         messages.
4058 2024-01-16  Marek Polacek  <polacek@redhat.com>
4060         PR c++/113340
4061         * decl.cc (grokdeclarator) <case cdk_function>: Clear
4062         is_xobj_member_function in case of an error.
4064 2024-01-16  waffl3x  <waffl3x@protonmail.com>
4066         PR c++/113307
4067         * parser.cc (cp_parser_parameter_declaration): Reject packs
4068         on xobj params.
4070 2024-01-15  Marek Polacek  <polacek@redhat.com>
4072         PR c++/110065
4073         * parser.cc (cp_parser_template_type_arg): Add auto checking.
4075 2024-01-15  Patrick Palka  <ppalka@redhat.com>
4077         * parser.cc (cp_parser_check_access_in_redeclaration): Don't
4078         check access for a partial or explicit specialization.
4079         * pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
4080         or TREE_PROTECTED on the newly created partial specialization.
4082 2024-01-15  Patrick Palka  <ppalka@redhat.com>
4084         PR c++/104634
4085         * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
4086         to the newly created partial specialization.
4088 2024-01-15  Patrick Palka  <ppalka@redhat.com>
4090         PR c++/109899
4091         * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
4092         false in a template context.
4094 2024-01-13  Jakub Jelinek  <jakub@redhat.com>
4096         * mangle.cc (write_nested_name): Mangle explicit object
4097         member functions with H as per
4098         https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
4100 2024-01-12  Jason Merrill  <jason@redhat.com>
4102         PR c++/113038
4103         * name-lookup.cc (lookup_elaborated_type): Look for bindings
4104         in the global namespace in the ABI namespace.
4106 2024-01-12  Jason Merrill  <jason@redhat.com>
4108         * call.cc (reversed_match): New.
4109         (enum class pmatch): New enum.
4110         (cand_parms_match): Add match_kind parm.
4111         (object_parms_correspond): Add fn parms.
4112         (joust): Adjust.
4113         * class.cc (xobj_iobj_parameters_correspond): Rename to...
4114         (iobj_parm_corresponds_to): ...this.  Take the other
4115         type instead of a second function.
4116         (object_parms_correspond): Adjust.
4117         * cp-tree.h (iobj_parm_corresponds_to): Declare.
4119 2024-01-11  Jason Merrill  <jason@redhat.com>
4121         PR c++/113191
4122         * class.cc (xobj_iobj_parameters_correspond): Add context parm.
4123         (object_parms_correspond): Factor out of...
4124         (add_method): ...here.
4125         * method.cc (defaulted_late_check): Use it.
4126         * call.cc (class_of_implicit_object): New.
4127         (object_parms_correspond): Overload taking two candidates.
4128         (cand_parms_match): Use it.
4129         (joust): Check reversed before comparing constraints.
4130         * cp-tree.h (object_parms_correspond): Declare.
4132 2024-01-10  Tamar Christina  <tamar.christina@arm.com>
4134         * parser.cc (cp_parser_pragma): Initialize to false.
4136 2024-01-09  Jason Merrill  <jason@redhat.com>
4138         * semantics.cc (is_object_parameter): New.
4139         * cp-tree.h (is_object_parameter): Declare.
4140         * call.cc (maybe_warn_class_memaccess): Use it.
4141         * search.cc (field_access_p): Use it.
4142         (class_of_object_parm): New.
4143         (field_accessor_p): Adjust for explicit object parms.
4145 2024-01-09  Jason Merrill  <jason@redhat.com>
4147         * call.cc (build_over_call): Refactor handle_arg lambda.
4148         * class.cc (xobj_iobj_parameters_correspond): Fix FIXME.
4149         * method.cc (defaulted_late_check): Adjust comments.
4151 2024-01-09  waffl3x  <waffl3x@protonmail.com>
4153         PR c++/102609
4154         PR c++/102609
4155         C++23 P0847R7 (deducing this) - CWG2586.
4156         * decl.cc (copy_fn_p): Accept xobj copy assignment functions.
4157         (move_signature_fn_p): Accept xobj move assignment functions.
4158         * method.cc (do_build_copy_assign): Handle defaulted xobj member
4159         functions.
4160         (defaulted_late_check): Comment.
4161         (defaultable_fn_check): Comment.
4163 2024-01-09  waffl3x  <waffl3x@protonmail.com>
4165         PR c++/102609
4166         PR c++/102609
4167         C++23 P0847R7 (deducing this) - xobj lambdas.
4168         * lambda.cc (build_capture_proxy): Don't fold direct object types.
4169         * parser.cc (cp_parser_lambda_declarator_opt): Handle xobj lambdas,
4170         diagnostics.  Comments also updated.
4171         * pt.cc (tsubst_function_decl): Handle xobj lambdas.  Check object
4172         type of xobj lambda call operator, diagnose incorrect types.
4173         (tsubst_lambda_expr): Update comment.
4174         * semantics.cc (finish_decltype_type): Also consider by-value object
4175         parameter qualifications.
4177 2024-01-09  waffl3x  <waffl3x@protonmail.com>
4179         PR c++/102609
4180         PR c++/102609
4181         C++23 P0847R7 (deducing this) - diagnostics.
4182         * class.cc (resolve_address_of_overloaded_function): Diagnostics.
4183         * cp-tree.h (TFF_XOBJ_FUNC): Define.
4184         * decl.cc (grokfndecl): Diagnostics.
4185         (grokdeclarator): Diagnostics.
4186         * error.cc (dump_aggr_type): Pass TFF_XOBJ_FUNC.
4187         (dump_lambda_function): Formatting for xobj lambda.
4188         (dump_function_decl): Pass TFF_XOBJ_FUNC.
4189         (dump_parameters): Formatting for xobj member functions.
4190         (function_category): Formatting for xobj member functions.
4191         * parser.cc (cp_parser_decl_specifier_seq): Diagnostics.
4192         (cp_parser_parameter_declaration): Diagnostics.
4193         * search.cc (look_for_overrides_here): Make xobj member functions
4194         override.
4195         (look_for_overrides_r): Reject an overriding xobj member function
4196         and diagnose it.
4197         * semantics.cc (finish_this_expr): Diagnostics.
4198         * typeck.cc (cp_build_addr_expr_1): Diagnostics.
4200 2024-01-09  waffl3x  <waffl3x@protonmail.com>
4202         PR c++/102609
4203         PR c++/102609
4204         C++23 P0847R7 (deducing this) - initial functionality.
4205         * class.cc (xobj_iobj_parameters_correspond): New function, checks
4206         for corresponding object parameters between xobj and iobj member
4207         functions.
4208         (add_method): Handle object parameters of xobj member functions, use
4209         xobj_iobj_parameters_correspond.
4210         * call.cc (build_over_call): Refactor, handle xobj member functions.
4211         (cand_parms_match): Handle object parameters of xobj and iobj member
4212         functions, use xobj_iobj_parameters_correspond.
4213         * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
4214         * decl.cc (grokfndecl): Add xobj_func_p parameter.  For xobj member
4215         functions, Set xobj_flag, don't set static_function flag.
4216         (grokdeclarator): Handle xobj member functions, tell grokfndecl.
4217         (grok_op_properties): Don't error for xobj operators.
4218         * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
4219         (cp_parser_parameter_declaration): Set default argument to
4220         "this_identifier" for xobj parameters.
4221         (set_and_check_decl_spec_loc): Add "this", add comments.
4222         * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
4223         * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
4224         functions.
4226 2024-01-09  waffl3x  <waffl3x@protonmail.com>
4227             Jason Merrill  <jason@redhat.com>
4229         PR c++/102609
4230         * cp-tree.h (struct lang_decl_fn): New data member.
4231         (DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
4232         (DECL_IOBJ_MEMBER_FUNCTION_P): Define.
4233         (DECL_FUNCTION_XOBJ_FLAG): Define.
4234         (DECL_XOBJ_MEMBER_FUNCTION_P): Define.
4235         (DECL_OBJECT_MEMBER_FUNCTION_P): Define.
4236         (DECL_FUNCTION_MEMBER_P): Don't use
4237         DECL_NONSTATIC_MEMBER_FUNCTION_P.
4238         (DECL_CONST_MEMFUNC_P): Likewise.
4239         (DECL_VOLATILE_MEMFUNC_P): Likewise.
4240         (DECL_NONSTATIC_MEMBER_P): Likewise.
4241         * module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
4242         (trees_in::lang_decl_bools): Handle xobj_flag.
4243         * call.cc (build_this_conversion)
4244         (add_function_candidate)
4245         (add_template_candidate_real)
4246         (add_candidates)
4247         (maybe_warn_class_memaccess)
4248         (cand_parms_match)
4249         (joust)
4250         (do_warn_dangling_reference)
4251         * class.cc (finalize_literal_type_property)
4252         (finish_struct)
4253         (resolve_address_of_overloaded_function)
4254         * constexpr.cc (is_valid_constexpr_fn)
4255         (cxx_bind_parameters_in_call)
4256         * contracts.cc (build_contract_condition_function)
4257         * cp-objcp-common.cc (cp_decl_dwarf_attribute)
4258         * cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
4259         (cxx_pretty_printer::declaration_specifiers)
4260         (cxx_pretty_printer::direct_declarator)
4261         * decl.cc (cp_finish_decl)
4262         (grok_special_member_properties)
4263         (start_preparsed_function)
4264         (record_key_method_defined)
4265         * decl2.cc (cp_handle_deprecated_or_unavailable)
4266         * init.cc (find_uninit_fields_r)
4267         (build_offset_ref)
4268         * lambda.cc (lambda_expr_this_capture)
4269         (maybe_generic_this_capture)
4270         (nonlambda_method_basetype)
4271         * mangle.cc (write_nested_name)
4272         * method.cc (early_check_defaulted_comparison)
4273         (skip_artificial_parms_for)
4274         (num_artificial_parms_for)
4275         * pt.cc (is_specialization_of_friend)
4276         (determine_specialization)
4277         (copy_default_args_to_explicit_spec)
4278         (check_explicit_specialization)
4279         (tsubst_contract_attribute)
4280         (check_non_deducible_conversions)
4281         (more_specialized_fn)
4282         (maybe_instantiate_noexcept)
4283         (register_parameter_specializations)
4284         (value_dependent_expression_p)
4285         * search.cc (shared_member_p)
4286         (lookup_member)
4287         (field_access_p)
4288         * semantics.cc (finish_omp_declare_simd_methods)
4289         * tree.cc (lvalue_kind)
4290         * typeck.cc (invalid_nonstatic_memfn_p): Don't use
4291         DECL_NONSTATIC_MEMBER_FUNCTION_P.
4293 2024-01-09  Julian Brown  <julian@codesourcery.com>
4295         * constexpr.cc (potential_consant_expression_1): Handle
4296         OMP_ARRAY_SECTION.
4297         * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
4298         prototypes.
4299         * decl2.cc (grok_omp_array_section): New function.
4300         * error.cc (dump_expr): Handle OMP_ARRAY_SECTION.
4301         * parser.cc (cp_parser_new): Initialize parser->omp_array_section_p.
4302         (cp_parser_statement_expr): Disallow array sections.
4303         (cp_parser_postfix_open_square_expression): Support OMP_ARRAY_SECTION
4304         parsing.
4305         (cp_parser_parenthesized_expression_list, cp_parser_lambda_expression,
4306         cp_parser_braced_list): Disallow array sections.
4307         (cp_parser_omp_var_list_no_open): Remove ALLOW_DEREF parameter, add
4308         MAP_LVALUE in its place.  Support generalised lvalue parsing for
4309         OpenMP map, to and from clauses.  Use OMP_ARRAY_SECTION
4310         code instead of TREE_LIST to represent OpenMP array sections.
4311         (cp_parser_omp_var_list): Remove ALLOW_DEREF parameter, add MAP_LVALUE.
4312         Pass to cp_parser_omp_var_list_no_open.
4313         (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
4314         (cp_parser_omp_clause_map): Add sk_omp scope around
4315         cp_parser_omp_var_list_no_open call.
4316         * parser.h (cp_parser): Add omp_array_section_p field.
4317         * pt.cc (tsubst, tsubst_copy, tsubst_omp_clause_decl,
4318         tsubst_copy_and_build): Add OMP_ARRAY_SECTION support.
4319         * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections,
4320         cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION
4321         instead of TREE_LIST where appropriate.  Handle more types of map
4322         expression.
4323         * typeck.cc (build_omp_array_section): New function.
4325 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
4327         * module.cc (trees_out::write_var_def): Only write initializers
4328         in header modules.
4330 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
4332         PR c++/109679
4333         * module.cc (depset::hash::add_binding_entity): Don't skip names
4334         in the GMF if they've been exported with a using declaration.
4336 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
4338         PR c++/110808
4339         * parser.cc (cp_parser_module_name): Rewrite to handle
4340         module-names and module-partitions independently.
4341         (cp_parser_module_partition): New function.
4342         (cp_parser_module_declaration): Parse module partitions
4343         explicitly. Don't change state if parsing module decl failed.
4344         (cp_parser_import_declaration): Handle different kinds of
4345         import-declarations locally.
4347 2024-01-03  Patrick Palka  <ppalka@redhat.com>
4349         PR c++/113064
4350         * call.cc (reference_binding): Still try a conversion via a
4351         temporary if a direct conversion was bad.
4353 2024-01-03  Kwok Cheung Yeung  <kcy@codesourcery.com>
4355         * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
4356         clause to correspond to alphabetical order.
4359 Copyright (C) 2024 Free Software Foundation, Inc.
4361 Copying and distribution of this file, with or without modification,
4362 are permitted in any medium without royalty provided the copyright
4363 notice and this notice are preserved.