Daily bump.
[official-gcc.git] / gcc / cp / ChangeLog
blob9daad1ffb000be2f486f4684604562aba08387e2
1 2024-01-16  Nathaniel Shead  <nathanieloshead@gmail.com>
3         PR c++/113292
4         * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
5         (c_parse_final_cleanups): Suppress warning for no definition of
6         TLS wrapper functions in header modules.
7         * module.cc (trees_out::lang_decl_vals): Write wrapped variable
8         for TLS wrapper functions.
9         (trees_in::lang_decl_vals): Read it.
10         (trees_out::decl_value): Write TLS model for thread-local vars.
11         (trees_in::decl_value): Read it for new decls. Remember to emit
12         definitions of TLS wrapper functions later.
14 2024-01-16  Nathaniel Shead  <nathanieloshead@gmail.com>
16         * name-lookup.h (enum scope_kind): Add 'sk_count'.
17         * name-lookup.cc (cp_binding_level_descriptor): Add missing
18         scope kinds. Add assertion that the list is up to date. Fix
19         handling of explicit_spec_p.
21 2024-01-16  Marek Polacek  <polacek@redhat.com>
23         * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
24         messages.
26 2024-01-16  Marek Polacek  <polacek@redhat.com>
28         PR c++/113340
29         * decl.cc (grokdeclarator) <case cdk_function>: Clear
30         is_xobj_member_function in case of an error.
32 2024-01-16  waffl3x  <waffl3x@protonmail.com>
34         PR c++/113307
35         * parser.cc (cp_parser_parameter_declaration): Reject packs
36         on xobj params.
38 2024-01-15  Marek Polacek  <polacek@redhat.com>
40         PR c++/110065
41         * parser.cc (cp_parser_template_type_arg): Add auto checking.
43 2024-01-15  Patrick Palka  <ppalka@redhat.com>
45         * parser.cc (cp_parser_check_access_in_redeclaration): Don't
46         check access for a partial or explicit specialization.
47         * pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
48         or TREE_PROTECTED on the newly created partial specialization.
50 2024-01-15  Patrick Palka  <ppalka@redhat.com>
52         PR c++/104634
53         * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
54         to the newly created partial specialization.
56 2024-01-15  Patrick Palka  <ppalka@redhat.com>
58         PR c++/109899
59         * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
60         false in a template context.
62 2024-01-13  Jakub Jelinek  <jakub@redhat.com>
64         * mangle.cc (write_nested_name): Mangle explicit object
65         member functions with H as per
66         https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
68 2024-01-12  Jason Merrill  <jason@redhat.com>
70         PR c++/113038
71         * name-lookup.cc (lookup_elaborated_type): Look for bindings
72         in the global namespace in the ABI namespace.
74 2024-01-12  Jason Merrill  <jason@redhat.com>
76         * call.cc (reversed_match): New.
77         (enum class pmatch): New enum.
78         (cand_parms_match): Add match_kind parm.
79         (object_parms_correspond): Add fn parms.
80         (joust): Adjust.
81         * class.cc (xobj_iobj_parameters_correspond): Rename to...
82         (iobj_parm_corresponds_to): ...this.  Take the other
83         type instead of a second function.
84         (object_parms_correspond): Adjust.
85         * cp-tree.h (iobj_parm_corresponds_to): Declare.
87 2024-01-11  Jason Merrill  <jason@redhat.com>
89         PR c++/113191
90         * class.cc (xobj_iobj_parameters_correspond): Add context parm.
91         (object_parms_correspond): Factor out of...
92         (add_method): ...here.
93         * method.cc (defaulted_late_check): Use it.
94         * call.cc (class_of_implicit_object): New.
95         (object_parms_correspond): Overload taking two candidates.
96         (cand_parms_match): Use it.
97         (joust): Check reversed before comparing constraints.
98         * cp-tree.h (object_parms_correspond): Declare.
100 2024-01-10  Tamar Christina  <tamar.christina@arm.com>
102         * parser.cc (cp_parser_pragma): Initialize to false.
104 2024-01-09  Jason Merrill  <jason@redhat.com>
106         * semantics.cc (is_object_parameter): New.
107         * cp-tree.h (is_object_parameter): Declare.
108         * call.cc (maybe_warn_class_memaccess): Use it.
109         * search.cc (field_access_p): Use it.
110         (class_of_object_parm): New.
111         (field_accessor_p): Adjust for explicit object parms.
113 2024-01-09  Jason Merrill  <jason@redhat.com>
115         * call.cc (build_over_call): Refactor handle_arg lambda.
116         * class.cc (xobj_iobj_parameters_correspond): Fix FIXME.
117         * method.cc (defaulted_late_check): Adjust comments.
119 2024-01-09  waffl3x  <waffl3x@protonmail.com>
121         PR c++/102609
122         PR c++/102609
123         C++23 P0847R7 (deducing this) - CWG2586.
124         * decl.cc (copy_fn_p): Accept xobj copy assignment functions.
125         (move_signature_fn_p): Accept xobj move assignment functions.
126         * method.cc (do_build_copy_assign): Handle defaulted xobj member
127         functions.
128         (defaulted_late_check): Comment.
129         (defaultable_fn_check): Comment.
131 2024-01-09  waffl3x  <waffl3x@protonmail.com>
133         PR c++/102609
134         PR c++/102609
135         C++23 P0847R7 (deducing this) - xobj lambdas.
136         * lambda.cc (build_capture_proxy): Don't fold direct object types.
137         * parser.cc (cp_parser_lambda_declarator_opt): Handle xobj lambdas,
138         diagnostics.  Comments also updated.
139         * pt.cc (tsubst_function_decl): Handle xobj lambdas.  Check object
140         type of xobj lambda call operator, diagnose incorrect types.
141         (tsubst_lambda_expr): Update comment.
142         * semantics.cc (finish_decltype_type): Also consider by-value object
143         parameter qualifications.
145 2024-01-09  waffl3x  <waffl3x@protonmail.com>
147         PR c++/102609
148         PR c++/102609
149         C++23 P0847R7 (deducing this) - diagnostics.
150         * class.cc (resolve_address_of_overloaded_function): Diagnostics.
151         * cp-tree.h (TFF_XOBJ_FUNC): Define.
152         * decl.cc (grokfndecl): Diagnostics.
153         (grokdeclarator): Diagnostics.
154         * error.cc (dump_aggr_type): Pass TFF_XOBJ_FUNC.
155         (dump_lambda_function): Formatting for xobj lambda.
156         (dump_function_decl): Pass TFF_XOBJ_FUNC.
157         (dump_parameters): Formatting for xobj member functions.
158         (function_category): Formatting for xobj member functions.
159         * parser.cc (cp_parser_decl_specifier_seq): Diagnostics.
160         (cp_parser_parameter_declaration): Diagnostics.
161         * search.cc (look_for_overrides_here): Make xobj member functions
162         override.
163         (look_for_overrides_r): Reject an overriding xobj member function
164         and diagnose it.
165         * semantics.cc (finish_this_expr): Diagnostics.
166         * typeck.cc (cp_build_addr_expr_1): Diagnostics.
168 2024-01-09  waffl3x  <waffl3x@protonmail.com>
170         PR c++/102609
171         PR c++/102609
172         C++23 P0847R7 (deducing this) - initial functionality.
173         * class.cc (xobj_iobj_parameters_correspond): New function, checks
174         for corresponding object parameters between xobj and iobj member
175         functions.
176         (add_method): Handle object parameters of xobj member functions, use
177         xobj_iobj_parameters_correspond.
178         * call.cc (build_over_call): Refactor, handle xobj member functions.
179         (cand_parms_match): Handle object parameters of xobj and iobj member
180         functions, use xobj_iobj_parameters_correspond.
181         * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
182         * decl.cc (grokfndecl): Add xobj_func_p parameter.  For xobj member
183         functions, Set xobj_flag, don't set static_function flag.
184         (grokdeclarator): Handle xobj member functions, tell grokfndecl.
185         (grok_op_properties): Don't error for xobj operators.
186         * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
187         (cp_parser_parameter_declaration): Set default argument to
188         "this_identifier" for xobj parameters.
189         (set_and_check_decl_spec_loc): Add "this", add comments.
190         * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
191         * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
192         functions.
194 2024-01-09  waffl3x  <waffl3x@protonmail.com>
195             Jason Merrill  <jason@redhat.com>
197         PR c++/102609
198         * cp-tree.h (struct lang_decl_fn): New data member.
199         (DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
200         (DECL_IOBJ_MEMBER_FUNCTION_P): Define.
201         (DECL_FUNCTION_XOBJ_FLAG): Define.
202         (DECL_XOBJ_MEMBER_FUNCTION_P): Define.
203         (DECL_OBJECT_MEMBER_FUNCTION_P): Define.
204         (DECL_FUNCTION_MEMBER_P): Don't use
205         DECL_NONSTATIC_MEMBER_FUNCTION_P.
206         (DECL_CONST_MEMFUNC_P): Likewise.
207         (DECL_VOLATILE_MEMFUNC_P): Likewise.
208         (DECL_NONSTATIC_MEMBER_P): Likewise.
209         * module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
210         (trees_in::lang_decl_bools): Handle xobj_flag.
211         * call.cc (build_this_conversion)
212         (add_function_candidate)
213         (add_template_candidate_real)
214         (add_candidates)
215         (maybe_warn_class_memaccess)
216         (cand_parms_match)
217         (joust)
218         (do_warn_dangling_reference)
219         * class.cc (finalize_literal_type_property)
220         (finish_struct)
221         (resolve_address_of_overloaded_function)
222         * constexpr.cc (is_valid_constexpr_fn)
223         (cxx_bind_parameters_in_call)
224         * contracts.cc (build_contract_condition_function)
225         * cp-objcp-common.cc (cp_decl_dwarf_attribute)
226         * cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
227         (cxx_pretty_printer::declaration_specifiers)
228         (cxx_pretty_printer::direct_declarator)
229         * decl.cc (cp_finish_decl)
230         (grok_special_member_properties)
231         (start_preparsed_function)
232         (record_key_method_defined)
233         * decl2.cc (cp_handle_deprecated_or_unavailable)
234         * init.cc (find_uninit_fields_r)
235         (build_offset_ref)
236         * lambda.cc (lambda_expr_this_capture)
237         (maybe_generic_this_capture)
238         (nonlambda_method_basetype)
239         * mangle.cc (write_nested_name)
240         * method.cc (early_check_defaulted_comparison)
241         (skip_artificial_parms_for)
242         (num_artificial_parms_for)
243         * pt.cc (is_specialization_of_friend)
244         (determine_specialization)
245         (copy_default_args_to_explicit_spec)
246         (check_explicit_specialization)
247         (tsubst_contract_attribute)
248         (check_non_deducible_conversions)
249         (more_specialized_fn)
250         (maybe_instantiate_noexcept)
251         (register_parameter_specializations)
252         (value_dependent_expression_p)
253         * search.cc (shared_member_p)
254         (lookup_member)
255         (field_access_p)
256         * semantics.cc (finish_omp_declare_simd_methods)
257         * tree.cc (lvalue_kind)
258         * typeck.cc (invalid_nonstatic_memfn_p): Don't use
259         DECL_NONSTATIC_MEMBER_FUNCTION_P.
261 2024-01-09  Julian Brown  <julian@codesourcery.com>
263         * constexpr.cc (potential_consant_expression_1): Handle
264         OMP_ARRAY_SECTION.
265         * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
266         prototypes.
267         * decl2.cc (grok_omp_array_section): New function.
268         * error.cc (dump_expr): Handle OMP_ARRAY_SECTION.
269         * parser.cc (cp_parser_new): Initialize parser->omp_array_section_p.
270         (cp_parser_statement_expr): Disallow array sections.
271         (cp_parser_postfix_open_square_expression): Support OMP_ARRAY_SECTION
272         parsing.
273         (cp_parser_parenthesized_expression_list, cp_parser_lambda_expression,
274         cp_parser_braced_list): Disallow array sections.
275         (cp_parser_omp_var_list_no_open): Remove ALLOW_DEREF parameter, add
276         MAP_LVALUE in its place.  Support generalised lvalue parsing for
277         OpenMP map, to and from clauses.  Use OMP_ARRAY_SECTION
278         code instead of TREE_LIST to represent OpenMP array sections.
279         (cp_parser_omp_var_list): Remove ALLOW_DEREF parameter, add MAP_LVALUE.
280         Pass to cp_parser_omp_var_list_no_open.
281         (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
282         (cp_parser_omp_clause_map): Add sk_omp scope around
283         cp_parser_omp_var_list_no_open call.
284         * parser.h (cp_parser): Add omp_array_section_p field.
285         * pt.cc (tsubst, tsubst_copy, tsubst_omp_clause_decl,
286         tsubst_copy_and_build): Add OMP_ARRAY_SECTION support.
287         * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections,
288         cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION
289         instead of TREE_LIST where appropriate.  Handle more types of map
290         expression.
291         * typeck.cc (build_omp_array_section): New function.
293 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
295         * module.cc (trees_out::write_var_def): Only write initializers
296         in header modules.
298 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
300         PR c++/109679
301         * module.cc (depset::hash::add_binding_entity): Don't skip names
302         in the GMF if they've been exported with a using declaration.
304 2024-01-07  Nathaniel Shead  <nathanieloshead@gmail.com>
306         PR c++/110808
307         * parser.cc (cp_parser_module_name): Rewrite to handle
308         module-names and module-partitions independently.
309         (cp_parser_module_partition): New function.
310         (cp_parser_module_declaration): Parse module partitions
311         explicitly. Don't change state if parsing module decl failed.
312         (cp_parser_import_declaration): Handle different kinds of
313         import-declarations locally.
315 2024-01-03  Patrick Palka  <ppalka@redhat.com>
317         PR c++/113064
318         * call.cc (reference_binding): Still try a conversion via a
319         temporary if a direct conversion was bad.
321 2024-01-03  Kwok Cheung Yeung  <kcy@codesourcery.com>
323         * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
324         clause to correspond to alphabetical order.
327 Copyright (C) 2024 Free Software Foundation, Inc.
329 Copying and distribution of this file, with or without modification,
330 are permitted in any medium without royalty provided the copyright
331 notice and this notice are preserved.