Daily bump.
[official-gcc.git] / gcc / cp / ChangeLog
blob8ee3b4b481bad5882fc4d96ccc21fae9b6083486
1 2024-01-26  Nathaniel Shead  <nathanieloshead@gmail.com>
3         PR c++/113580
4         * module.cc (struct post_process_data): Create.
5         (trees_in::post_decls): Use.
6         (trees_in::post_process): Return entire vector at once.
7         Change overload to take post_process_data instead of tree.
8         (trees_out::write_function_def): Write needed flags from
9         DECL_STRUCT_FUNCTION.
10         (trees_in::read_function_def): Read them and pass to
11         post_process.
12         (module_state::read_cluster): Write flags into cfun.
14 2024-01-26  Nathaniel Shead  <nathanieloshead@gmail.com>
16         PR c++/112899
17         * cp-tree.h (note_variable_template_instantiation): Rename to...
18         (note_vague_linkage_variable): ...this.
19         * decl2.cc (note_variable_template_instantiation): Rename to...
20         (note_vague_linkage_variable): ...this.
21         * pt.cc (instantiate_decl): Rename usage of above function.
22         * module.cc (trees_in::read_var_def): Remember pending statics
23         that we stream in.
25 2024-01-25  Jakub Jelinek  <jakub@redhat.com>
27         PR c++/113599
28         * typeck2.cc (build_m_component_ref): Use convert instead of
29         cp_convert for pointer conversion.
31 2024-01-25  Jason Merrill  <jason@redhat.com>
33         PR c++/113598
34         * init.cc (build_vec_init): Don't use {} for PMF.
36 2024-01-25  Jason Merrill  <jason@redhat.com>
38         PR c++/109227
39         * coroutines.cc (build_co_await): Use cxx_maybe_build_cleanup.
40         (build_actor_fn, process_conditional, maybe_promote_temps)
41         (morph_fn_to_coro): Likewise.
42         (expand_one_await_expression): Use build_cleanup.
44 2024-01-25  Nathaniel Shead  <nathanieloshead@gmail.com>
46         PR c++/113405
47         * module.cc (set_defining_module): Track partial specialisations
48         for all declarations.
50 2024-01-25  Nathaniel Shead  <nathanieloshead@gmail.com>
52         PR c++/100707
53         * name-lookup.cc (add_imported_namespace): Don't mark namespaces
54         as imported.
56 2024-01-24  Patrick Palka  <ppalka@redhat.com>
58         PR c++/113529
59         * call.cc (add_operator_candidates): Propagate error_mark_node
60         result after recursing to find rewritten candidates.
62 2024-01-23  Marek Polacek  <polacek@redhat.com>
64         PR c++/113256
65         PR c++/111607
66         PR c++/109640
67         * call.cc (do_warn_dangling_reference): Don't warn if the temporary
68         is of lambda type.
70 2024-01-23  Nathaniel Shead  <nathanieloshead@gmail.com>
72         PR c++/112820
73         PR c++/102607
74         * module.cc (trees_out::lang_type_bools): Write interface_only
75         and interface_unknown.
76         (trees_in::lang_type_bools): Read the above flags.
77         (trees_in::decl_value): Reset CLASSTYPE_INTERFACE_* except for
78         extern templates.
79         (trees_in::read_class_def): Remove buggy extern template
80         handling.
82 2024-01-19  Jason Merrill  <jason@redhat.com>
84         PR c++/113498
85         * pt.cc (decl_template_info): New fn.
86         (get_template_info): Use it.
88 2024-01-19  Jason Merrill  <jason@redhat.com>
90         PR c++/112632
91         PR c++/112594
92         PR c++/111357
93         PR c++/104594
94         PR c++/67898
95         * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
96         * pt.cc (expand_integer_pack): Remove 111357 workaround.
97         (maybe_convert_nontype_argument): Add force parm.
98         (convert_template_argument): Handle alias template args
99         specially.
100         (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
101         * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.
103 2024-01-18  Marek Polacek  <polacek@redhat.com>
105         PR c++/113389
106         * decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
107         NULL_TREE when emitting an error.
109 2024-01-17  Nathaniel Shead  <nathanieloshead@gmail.com>
111         PR c++/112588
112         * module.cc (trees_in::read_function_def): Don't overwrite
113         arguments.
115 2024-01-17  Patrick Palka  <ppalka@redhat.com>
117         PR c++/113242
118         PR c++/99493
119         * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
120         DECL_ARTIFICIAL rejection test for class NTTP objects.
122 2024-01-16  Nathaniel Shead  <nathanieloshead@gmail.com>
124         PR c++/113292
125         * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
126         (c_parse_final_cleanups): Suppress warning for no definition of
127         TLS wrapper functions in header modules.
128         * module.cc (trees_out::lang_decl_vals): Write wrapped variable
129         for TLS wrapper functions.
130         (trees_in::lang_decl_vals): Read it.
131         (trees_out::decl_value): Write TLS model for thread-local vars.
132         (trees_in::decl_value): Read it for new decls. Remember to emit
133         definitions of TLS wrapper functions later.
135 2024-01-16  Nathaniel Shead  <nathanieloshead@gmail.com>
137         * name-lookup.h (enum scope_kind): Add 'sk_count'.
138         * name-lookup.cc (cp_binding_level_descriptor): Add missing
139         scope kinds. Add assertion that the list is up to date. Fix
140         handling of explicit_spec_p.
142 2024-01-16  Marek Polacek  <polacek@redhat.com>
144         * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
145         messages.
147 2024-01-16  Marek Polacek  <polacek@redhat.com>
149         PR c++/113340
150         * decl.cc (grokdeclarator) <case cdk_function>: Clear
151         is_xobj_member_function in case of an error.
153 2024-01-16  waffl3x  <waffl3x@protonmail.com>
155         PR c++/113307
156         * parser.cc (cp_parser_parameter_declaration): Reject packs
157         on xobj params.
159 2024-01-15  Marek Polacek  <polacek@redhat.com>
161         PR c++/110065
162         * parser.cc (cp_parser_template_type_arg): Add auto checking.
164 2024-01-15  Patrick Palka  <ppalka@redhat.com>
166         * parser.cc (cp_parser_check_access_in_redeclaration): Don't
167         check access for a partial or explicit specialization.
168         * pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
169         or TREE_PROTECTED on the newly created partial specialization.
171 2024-01-15  Patrick Palka  <ppalka@redhat.com>
173         PR c++/104634
174         * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
175         to the newly created partial specialization.
177 2024-01-15  Patrick Palka  <ppalka@redhat.com>
179         PR c++/109899
180         * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
181         false in a template context.
183 2024-01-13  Jakub Jelinek  <jakub@redhat.com>
185         * mangle.cc (write_nested_name): Mangle explicit object
186         member functions with H as per
187         https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
189 2024-01-12  Jason Merrill  <jason@redhat.com>
191         PR c++/113038
192         * name-lookup.cc (lookup_elaborated_type): Look for bindings
193         in the global namespace in the ABI namespace.
195 2024-01-12  Jason Merrill  <jason@redhat.com>
197         * call.cc (reversed_match): New.
198         (enum class pmatch): New enum.
199         (cand_parms_match): Add match_kind parm.
200         (object_parms_correspond): Add fn parms.
201         (joust): Adjust.
202         * class.cc (xobj_iobj_parameters_correspond): Rename to...
203         (iobj_parm_corresponds_to): ...this.  Take the other
204         type instead of a second function.
205         (object_parms_correspond): Adjust.
206         * cp-tree.h (iobj_parm_corresponds_to): Declare.
208 2024-01-11  Jason Merrill  <jason@redhat.com>
210         PR c++/113191
211         * class.cc (xobj_iobj_parameters_correspond): Add context parm.
212         (object_parms_correspond): Factor out of...
213         (add_method): ...here.
214         * method.cc (defaulted_late_check): Use it.
215         * call.cc (class_of_implicit_object): New.
216         (object_parms_correspond): Overload taking two candidates.
217         (cand_parms_match): Use it.
218         (joust): Check reversed before comparing constraints.
219         * cp-tree.h (object_parms_correspond): Declare.
221 2024-01-10  Tamar Christina  <tamar.christina@arm.com>
223         * parser.cc (cp_parser_pragma): Initialize to false.
225 2024-01-09  Jason Merrill  <jason@redhat.com>
227         * semantics.cc (is_object_parameter): New.
228         * cp-tree.h (is_object_parameter): Declare.
229         * call.cc (maybe_warn_class_memaccess): Use it.
230         * search.cc (field_access_p): Use it.
231         (class_of_object_parm): New.
232         (field_accessor_p): Adjust for explicit object parms.
234 2024-01-09  Jason Merrill  <jason@redhat.com>
236         * call.cc (build_over_call): Refactor handle_arg lambda.
237         * class.cc (xobj_iobj_parameters_correspond): Fix FIXME.
238         * method.cc (defaulted_late_check): Adjust comments.
240 2024-01-09  waffl3x  <waffl3x@protonmail.com>
242         PR c++/102609
243         PR c++/102609
244         C++23 P0847R7 (deducing this) - CWG2586.
245         * decl.cc (copy_fn_p): Accept xobj copy assignment functions.
246         (move_signature_fn_p): Accept xobj move assignment functions.
247         * method.cc (do_build_copy_assign): Handle defaulted xobj member
248         functions.
249         (defaulted_late_check): Comment.
250         (defaultable_fn_check): Comment.
252 2024-01-09  waffl3x  <waffl3x@protonmail.com>
254         PR c++/102609
255         PR c++/102609
256         C++23 P0847R7 (deducing this) - xobj lambdas.
257         * lambda.cc (build_capture_proxy): Don't fold direct object types.
258         * parser.cc (cp_parser_lambda_declarator_opt): Handle xobj lambdas,
259         diagnostics.  Comments also updated.
260         * pt.cc (tsubst_function_decl): Handle xobj lambdas.  Check object
261         type of xobj lambda call operator, diagnose incorrect types.
262         (tsubst_lambda_expr): Update comment.
263         * semantics.cc (finish_decltype_type): Also consider by-value object
264         parameter qualifications.
266 2024-01-09  waffl3x  <waffl3x@protonmail.com>
268         PR c++/102609
269         PR c++/102609
270         C++23 P0847R7 (deducing this) - diagnostics.
271         * class.cc (resolve_address_of_overloaded_function): Diagnostics.
272         * cp-tree.h (TFF_XOBJ_FUNC): Define.
273         * decl.cc (grokfndecl): Diagnostics.
274         (grokdeclarator): Diagnostics.
275         * error.cc (dump_aggr_type): Pass TFF_XOBJ_FUNC.
276         (dump_lambda_function): Formatting for xobj lambda.
277         (dump_function_decl): Pass TFF_XOBJ_FUNC.
278         (dump_parameters): Formatting for xobj member functions.
279         (function_category): Formatting for xobj member functions.
280         * parser.cc (cp_parser_decl_specifier_seq): Diagnostics.
281         (cp_parser_parameter_declaration): Diagnostics.
282         * search.cc (look_for_overrides_here): Make xobj member functions
283         override.
284         (look_for_overrides_r): Reject an overriding xobj member function
285         and diagnose it.
286         * semantics.cc (finish_this_expr): Diagnostics.
287         * typeck.cc (cp_build_addr_expr_1): Diagnostics.
289 2024-01-09  waffl3x  <waffl3x@protonmail.com>
291         PR c++/102609
292         PR c++/102609
293         C++23 P0847R7 (deducing this) - initial functionality.
294         * class.cc (xobj_iobj_parameters_correspond): New function, checks
295         for corresponding object parameters between xobj and iobj member
296         functions.
297         (add_method): Handle object parameters of xobj member functions, use
298         xobj_iobj_parameters_correspond.
299         * call.cc (build_over_call): Refactor, handle xobj member functions.
300         (cand_parms_match): Handle object parameters of xobj and iobj member
301         functions, use xobj_iobj_parameters_correspond.
302         * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
303         * decl.cc (grokfndecl): Add xobj_func_p parameter.  For xobj member
304         functions, Set xobj_flag, don't set static_function flag.
305         (grokdeclarator): Handle xobj member functions, tell grokfndecl.
306         (grok_op_properties): Don't error for xobj operators.
307         * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
308         (cp_parser_parameter_declaration): Set default argument to
309         "this_identifier" for xobj parameters.
310         (set_and_check_decl_spec_loc): Add "this", add comments.
311         * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
312         * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
313         functions.
315 2024-01-09  waffl3x  <waffl3x@protonmail.com>
316             Jason Merrill  <jason@redhat.com>
318         PR c++/102609
319         * cp-tree.h (struct lang_decl_fn): New data member.
320         (DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
321         (DECL_IOBJ_MEMBER_FUNCTION_P): Define.
322         (DECL_FUNCTION_XOBJ_FLAG): Define.
323         (DECL_XOBJ_MEMBER_FUNCTION_P): Define.
324         (DECL_OBJECT_MEMBER_FUNCTION_P): Define.
325         (DECL_FUNCTION_MEMBER_P): Don't use
326         DECL_NONSTATIC_MEMBER_FUNCTION_P.
327         (DECL_CONST_MEMFUNC_P): Likewise.
328         (DECL_VOLATILE_MEMFUNC_P): Likewise.
329         (DECL_NONSTATIC_MEMBER_P): Likewise.
330         * module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
331         (trees_in::lang_decl_bools): Handle xobj_flag.
332         * call.cc (build_this_conversion)
333         (add_function_candidate)
334         (add_template_candidate_real)
335         (add_candidates)
336         (maybe_warn_class_memaccess)
337         (cand_parms_match)
338         (joust)
339         (do_warn_dangling_reference)
340         * class.cc (finalize_literal_type_property)
341         (finish_struct)
342         (resolve_address_of_overloaded_function)
343         * constexpr.cc (is_valid_constexpr_fn)
344         (cxx_bind_parameters_in_call)
345         * contracts.cc (build_contract_condition_function)
346         * cp-objcp-common.cc (cp_decl_dwarf_attribute)
347         * cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
348         (cxx_pretty_printer::declaration_specifiers)
349         (cxx_pretty_printer::direct_declarator)
350         * decl.cc (cp_finish_decl)
351         (grok_special_member_properties)
352         (start_preparsed_function)
353         (record_key_method_defined)
354         * decl2.cc (cp_handle_deprecated_or_unavailable)
355         * init.cc (find_uninit_fields_r)
356         (build_offset_ref)
357         * lambda.cc (lambda_expr_this_capture)
358         (maybe_generic_this_capture)
359         (nonlambda_method_basetype)
360         * mangle.cc (write_nested_name)
361         * method.cc (early_check_defaulted_comparison)
362         (skip_artificial_parms_for)
363         (num_artificial_parms_for)
364         * pt.cc (is_specialization_of_friend)
365         (determine_specialization)
366         (copy_default_args_to_explicit_spec)
367         (check_explicit_specialization)
368         (tsubst_contract_attribute)
369         (check_non_deducible_conversions)
370         (more_specialized_fn)
371         (maybe_instantiate_noexcept)
372         (register_parameter_specializations)
373         (value_dependent_expression_p)
374         * search.cc (shared_member_p)
375         (lookup_member)
376         (field_access_p)
377         * semantics.cc (finish_omp_declare_simd_methods)
378         * tree.cc (lvalue_kind)
379         * typeck.cc (invalid_nonstatic_memfn_p): Don't use
380         DECL_NONSTATIC_MEMBER_FUNCTION_P.
382 2024-01-09  Julian Brown  <julian@codesourcery.com>
384         * constexpr.cc (potential_consant_expression_1): Handle
385         OMP_ARRAY_SECTION.
386         * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
387         prototypes.
388         * decl2.cc (grok_omp_array_section): New function.
389         * error.cc (dump_expr): Handle OMP_ARRAY_SECTION.
390         * parser.cc (cp_parser_new): Initialize parser->omp_array_section_p.
391         (cp_parser_statement_expr): Disallow array sections.
392         (cp_parser_postfix_open_square_expression): Support OMP_ARRAY_SECTION
393         parsing.
394         (cp_parser_parenthesized_expression_list, cp_parser_lambda_expression,
395         cp_parser_braced_list): Disallow array sections.
396         (cp_parser_omp_var_list_no_open): Remove ALLOW_DEREF parameter, add
397         MAP_LVALUE in its place.  Support generalised lvalue parsing for
398         OpenMP map, to and from clauses.  Use OMP_ARRAY_SECTION
399         code instead of TREE_LIST to represent OpenMP array sections.
400         (cp_parser_omp_var_list): Remove ALLOW_DEREF parameter, add MAP_LVALUE.
401         Pass to cp_parser_omp_var_list_no_open.
402         (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
403         (cp_parser_omp_clause_map): Add sk_omp scope around
404         cp_parser_omp_var_list_no_open call.
405         * parser.h (cp_parser): Add omp_array_section_p field.
406         * pt.cc (tsubst, tsubst_copy, tsubst_omp_clause_decl,
407         tsubst_copy_and_build): Add OMP_ARRAY_SECTION support.
408         * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections,
409         cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION
410         instead of TREE_LIST where appropriate.  Handle more types of map
411         expression.
412         * typeck.cc (build_omp_array_section): New function.
414 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
416         * module.cc (trees_out::write_var_def): Only write initializers
417         in header modules.
419 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
421         PR c++/109679
422         * module.cc (depset::hash::add_binding_entity): Don't skip names
423         in the GMF if they've been exported with a using declaration.
425 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
427         PR c++/110808
428         * parser.cc (cp_parser_module_name): Rewrite to handle
429         module-names and module-partitions independently.
430         (cp_parser_module_partition): New function.
431         (cp_parser_module_declaration): Parse module partitions
432         explicitly. Don't change state if parsing module decl failed.
433         (cp_parser_import_declaration): Handle different kinds of
434         import-declarations locally.
436 2024-01-03  Patrick Palka  <ppalka@redhat.com>
438         PR c++/113064
439         * call.cc (reference_binding): Still try a conversion via a
440         temporary if a direct conversion was bad.
442 2024-01-03  Kwok Cheung Yeung  <kcy@codesourcery.com>
444         * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
445         clause to correspond to alphabetical order.
448 Copyright (C) 2024 Free Software Foundation, Inc.
450 Copying and distribution of this file, with or without modification,
451 are permitted in any medium without royalty provided the copyright
452 notice and this notice are preserved.