Debian Codegraph @

gcc/cp/ChangeLog-2024

raw
1 2024-12-29 Nathaniel Shead <[email protected]>
2
3 PR c++/100358
4 PR c++/115008
5 * module.cc (elf_out::create_mapping): Fallback to ftruncate if
6 posix_fallocate fails.
7
8 2024-12-29 Nathaniel Shead <[email protected]>
9
10 PR c++/106221
11 PR c++/110680
12 * pt.cc (check_default_tmpl_args): Check this is actually a
13 lambda declaration and not just a typedef.
14 (push_template_decl): Likewise.
15
16 2024-12-27 Jakub Jelinek <[email protected]>
17
18 Revert:
19 2024-12-18 Jakub Jelinek <[email protected]>
20
21 * parser.cc (cp_lexer_new_main): Attempt to optimize large sequences
22 of CPP_NUMBER with int type and values 0-255 separated by CPP_COMMA
23 into CPP_EMBED with RAW_DATA_CST u.value.
24
25 2024-12-20 Jakub Jelinek <[email protected]>
26
27 PR c++/110345
28 * tree.cc (handle_maybe_unused_attribute): New function.
29 (std_attributes): Use handle_maybe_unused_attribute instead
30 of handle_unused_attribute for maybe_unused attribute.
31
32 2024-12-20 Jakub Jelinek <[email protected]>
33
34 PR c++/110345
35 * parser.cc (cp_parser_std_attribute): Don't transform
36 [[deprecated]] into [[gnu::deprecated]].
37 * tree.cc (handle_std_deprecated_attribute): New function.
38 (std_attributes): Add deprecated entry.
39
40 2024-12-20 Nathaniel Shead <[email protected]>
41
42 PR c++/116401
43 * decl.cc (grokfndecl): Mark deduction guides as 'inline'.
44 * module.cc (check_module_decl_linkage): Implement checks for
45 non-inline external linkage definitions in headers.
46
47 2024-12-20 Nathaniel Shead <[email protected]>
48
49 * cp-tree.h (check_module_decl_linkage): Declare.
50 * decl2.cc (finish_static_data_member_decl): Check linkage.
51 * module.cc (set_originating_module): Adjust comment.
52 (check_module_decl_linkage): New function.
53 * name-lookup.cc (do_namespace_alias): Build alias with
54 specified location, check linkage.
55 (pushtag): Check linkage.
56 (push_namespace): Slightly clarify error message.
57 * name-lookup.h (do_namespace_alias): Add location parameter.
58 * parser.cc (cp_parser_namespace_alias_definition): Pass
59 identifier location to do_namespace_alias.
60 (cp_parser_alias_declaration): Check linkage.
61 (cp_parser_init_declarator): Check linkage.
62 (cp_parser_function_definition_after_declarator): Check linkage.
63 (cp_parser_save_member_function_body): Check linkage.
64 * pt.cc (finish_concept_definition): Mark as public, check
65 linkage.
66
67 2024-12-20 Nathaniel Shead <[email protected]>
68
69 * module.cc (depset::hash::add_binding_entity): Also walk
70 unnamed namespaces.
71 (module_state::write_namespaces): Adjust assertion.
72 * name-lookup.cc (push_namespace): Move anon using-directive
73 handling to...
74 (make_namespace_finish): ...here.
75
76 2024-12-20 Nathaniel Shead <[email protected]>
77
78 * cp-objcp-common.cc (cp_tree_size): Add TU_LOCAL_ENTITY.
79 * cp-tree.def (TU_LOCAL_ENTITY): New tree code.
80 * cp-tree.h (DECL_TEMPLATE_INSTANTIATIONS): Update comment.
81 (struct tree_tu_local_entity): New type.
82 (TU_LOCAL_ENTITY_NAME): New accessor.
83 (TU_LOCAL_ENTITY_LOCATION): New accessor.
84 (enum cp_tree_node_structure_enum): Add TS_CP_TU_LOCAL_ENTITY.
85 (union GTY): Add tu_local_entity field.
86 * module.cc (enum tree_tag): New flag DB_REFS_TU_LOCAL_BIT.
87 (depset::has_defn): Override for TU-local entities.
88 (depset::refs_tu_local): New accessor.
89 (depset::hash::ignore_tu_local): New field.
90 (depset::hash::hash): Initialize it.
91 (trees_out::tree_tag::tt_tu_local): New flag.
92 (trees_out::writing_local_entities): New field.
93 (trees_out::is_initial_scan): New function.
94 (trees_out::tu_local_count): New counter.
95 (trees_out::trees_out): Initialize writing_local_entities.
96 (dumper::impl::nested_name): Handle TU_LOCAL_ENTITY.
97 (trees_out::instrument): Report TU-local entity counts.
98 (trees_out::decl_value): Early exit for TU-local entities.
99 (trees_in::decl_value): Handle typedefs of TU-local entities.
100 (trees_out::decl_node): Adjust assertion to cope with early exit
101 of TU-local deps. Always write TU-local entities by value.
102 (trees_out::type_node): Handle TU-local types.
103 (trees_out::has_tu_local_dep): New function.
104 (trees_out::find_tu_local_decl): New function.
105 (trees_out::tree_node): Intercept TU-local entities and write
106 placeholder values for them instead of normal streaming.
107 (trees_in::tree_node): Handle TU-local entities and TU-local
108 template results.
109 (trees_out::write_function_def): Ignore exposures in non-inline
110 function bodies.
111 (trees_out::write_var_def): Ignore exposures in initializers.
112 (trees_out::write_class_def): Ignore exposures in friend decls.
113 (trees_in::read_class_def): Skip TU-local friends.
114 (trees_out::write_definition): Record whether we're writing a
115 decl which refers to TU-local entities.
116 (depset::hash::add_dependency): Only mark as exposure if we're not
117 ignoring TU-local entities.
118 (depset::hash::find_dependencies): Use depset's own is_key_order
119 function rather than delegating via walker. Pass whether the
120 decl has ignored TU-local entities in its definition.
121 (template_has_explicit_inst): New function.
122 (depset::hash::finalize_dependencies): Implement new warning
123 Wtemplate-names-tu-local.
124 (module_state::intercluster_seed): Don't seed TU-local deps.
125 (module_state::write_cluster): Pass whether the decl has ignored
126 TU-local entities in its definition.
127 * pt.cc (register_specialization): Always register in a module.
128 (complain_about_tu_local_entity): New function.
129 (expr_contains_tu_local_entity): New function.
130 (function_contains_tu_local_entity): New function.
131 (instantiate_class_template): Skip TU-local friends.
132 (tsubst_decl): Handle typedefs of TU-local entities.
133 (tsubst): Complain about TU-local entities.
134 (dependent_operand_p): Early exit for TU-local entities so we
135 don't attempt to constant-evaluate them.
136 (tsubst_expr): Detect and complain about TU-local entities.
137
138 2024-12-20 Nathaniel Shead <[email protected]>
139
140 * tree.cc (decl_linkage): Treat DECL_SELF_REFERENCE_P like
141 DECL_IMPLICIT_TYPEDEF_P.
142 * name-lookup.cc (do_namespace_alias): Fix linkage.
143 * module.cc (DB_IS_INTERNAL_BIT): Rename to...
144 (DB_TU_LOCAL_BIT): ...this.
145 (DB_REFS_INTERNAL_BIT): Rename to...
146 (DB_EXPOSURE_BIT): ...this.
147 (depset::hash::is_internal): Rename to...
148 (depset::hash::is_tu_local): ...this.
149 (depset::hash::refs_internal): Rename to...
150 (depset::hash::is_exposure): ...this.
151 (depset::hash::is_tu_local_entity): New function.
152 (depset::hash::has_tu_local_tmpl_arg): New function.
153 (depset::hash::is_tu_local_value): New function.
154 (depset::hash::make_dependency): Check for TU-local entities.
155 (depset::hash::add_dependency): Make current an exposure
156 whenever it references a TU-local entity.
157 (depset::hash::add_binding_entity): Don't create bindings for
158 any TU-local entity.
159 (depset::hash::finalize_dependencies): Rename flags and adjust
160 diagnostic messages to report exposures of TU-local entities.
161 (depset::tarjan::connect): Don't include any TU-local depsets.
162 (depset::hash::connect): Likewise.
163
164 2024-12-19 Patrick Palka <[email protected]>
165
166 PR c++/118069
167 * constraint.cc (atom_hasher): Define here, instead of ...
168 * cp-tree.h (atom_hasher): ... here.
169 * logic.cc (clause::m_set): Use pointer instead of structural
170 hashing.
171
172 2024-12-19 Patrick Palka <[email protected]>
173
174 PR c++/118069
175 * logic.cc (dnf_size_r): Use HOST_WIDE_INT instead of int, and
176 handle overflow gracefully via add_sat_hwi and mul_sat_hwi.
177 (cnf_size_r): Likewise.
178 (dnf_size): Use HOST_WIDE_INT instead of int.
179 (cnf_size): Likewise.
180
181 2024-12-19 Marek Polacek <[email protected]>
182 Jason Merrill <[email protected]>
183
184 PR c++/117980
185 * constexpr.cc (cxx_eval_outermost_constant_expr): If there's
186 an object to initialize, take its type. Don't set the type
187 in the constexpr dtor case.
188
189 2024-12-18 Jakub Jelinek <[email protected]>
190
191 * parser.cc (cp_lexer_new_main): Attempt to optimize large sequences
192 of CPP_NUMBER with int type and values 0-255 separated by CPP_COMMA
193 into CPP_EMBED with RAW_DATA_CST u.value.
194
195 2024-12-18 Tobias Burnus <[email protected]>
196
197 * decl.cc (omp_declare_variant_finalize_one): Handle
198 append_args.
199 * parser.cc (cp_parser_omp_clause_init_modifiers): New;
200 split of from ...
201 (cp_parser_omp_clause_init): ... here; call it.
202 (cp_parser_omp_all_clauses): Replace interop parsing by
203 a call to ...
204 (cp_parser_omp_clause_interop): ... this new function;
205 set tree used/read.
206 (cp_finish_omp_declare_variant): Parse 'append_args' clause.
207 (cp_parser_omp_declare): Update comment.
208 * pt.cc (tsubst_attribute, tsubst_omp_clauses): Handle template
209 substitution also for declare variant's append_args clause,
210 using for 'init' the same code as for interop's init clause.
211
212 2024-12-18 Jakub Jelinek <[email protected]>
213
214 * parser.cc (cp_parser_postfix_expression): Use
215 type_id_in_expr_sentinel instead of manually saving+setting/restoring
216 parser->in_type_id_in_expr_p around cp_parser_type_id calls.
217 (cp_parser_has_attribute_expression): Likewise.
218 (cp_parser_cast_expression): Likewise.
219 (cp_parser_sizeof_operand): Likewise.
220
221 2024-12-18 Jakub Jelinek <[email protected]>
222
223 PR c++/110345
224 * cp-tree.h (enum cp_tree_index): Add CPTI_INTERNAL_IDENTIFIER.
225 (internal_identifier): Define.
226 (internal_attribute_table): Declare.
227 * parser.cc (cp_parser_exception_declaration): Error on alignas
228 on exception declaration.
229 (cp_parser_std_attribute_spec): Turn alignas into internal
230 ns aligned attribute rather than gnu.
231 * decl.cc (initialize_predefined_identifiers): Initialize
232 internal_identifier.
233 * tree.cc (handle_alignas_attribute): New function.
234 (internal_attributes): New variable.
235 (internal_attribute_table): Likewise.
236 * cp-objcp-common.h (cp_objcp_attribute_table): Add
237 internal_attribute_table entry.
238
239 2024-12-18 Jakub Jelinek <[email protected]>
240
241 PR c++/110345
242 * parser.cc (cp_parser_type_specifier_seq): Chain cxx11_attribute_p
243 attributes after any type specifier in the is_declaration case
244 to std_attributes rather than attributes. Set also ds_attribute
245 or ds_std_attribute locations if not yet set.
246 (cp_parser_exception_declaration): Pass &type_specifiers.attributes
247 instead of NULL as last argument, call cp_decl_attributes.
248
249 2024-12-18 Jakub Jelinek <[email protected]>
250
251 PR c++/110345
252 * decl.cc (check_tag_decl): Diagnose std_attributes.
253
254 2024-12-18 Jakub Jelinek <[email protected]>
255
256 PR c++/110345
257 * parser.cc (cp_parser_decl_specifier_seq): Call
258 warn_misplaced_attr_for_class_type for all OVERLOAD_TYPE_P
259 types, not just CLASS_TYPE_P. When not calling
260 warn_misplaced_attr_for_class_type, don't clear attrs and
261 add it to decl_specs->std_attributes instead.
262
263 2024-12-18 Jakub Jelinek <[email protected]>
264
265 PR c/41045
266 * semantics.cc (finish_asm_stmt): Reject - constraint modifier inside
267 of a function.
268
269 2024-12-18 Jakub Jelinek <[email protected]>
270
271 * semantics.cc (finish_asm_stmt): Diagnose invalid ":" constraint
272 uses.
273
274 2024-12-18 Lewis Hyatt <[email protected]>
275
276 PR c++/117970
277 * module.cc (module_state::read_ordinary_maps): Change argument to
278 line_map_uint_t instead of unsigned int.
279
280 2024-12-17 Marek Polacek <[email protected]>
281
282 PR c++/118073
283 * error.cc (dump_expr) <case NONTYPE_ARGUMENT_PACK>: New case.
284
285 2024-12-17 Marek Polacek <[email protected]>
286
287 PR c++/117985
288 * init.cc (build_vec_init): Pop CLEANUP_FLAGS if we're not
289 generating the loop.
290
291 2024-12-17 Jakub Jelinek <[email protected]>
292
293 PR c++/116108
294 * decl.cc (grokdeclarator): Pass TYYPE_MAIN_VARIANT (type)
295 rather than type to same_type_p when checking if the non-static
296 data member doesn't have current class type.
297
298 2024-12-16 David Malcolm <[email protected]>
299
300 PR sarif-replay/117943
301 * error.cc (auto_context_line::~auto_context_line): Use
302 source-printing options from text_output.
303
304 2024-12-15 Iain Sandoe <[email protected]>
305
306 * coroutines.cc
307 (cp_coroutine_transform::wrap_original_function_body): Use
308 finish_if_stmt instead of manually applying the same process.
309
310 2024-12-15 Iain Sandoe <[email protected]>
311
312 * coroutines.cc (expand_one_await_expression): Update the
313 resume index before checking if the coroutine is ready.
314
315 2024-12-15 Iain Sandoe <[email protected]>
316
317 PR c++/98935
318 * coroutines.cc (register_local_var_uses): Add a pset to the
319 tree walk to avoid visiting the same BIND_EXPR twice. Make
320 an early exit for cases that the callback does not apply.
321 (cp_coroutine_transform::apply_transforms): Add a pset to the
322 tree walk for register_local_vars.
323
324 2024-12-14 Nathaniel Shead <[email protected]>
325
326 PR c++/90321
327 * decl.cc (find_decomp_class_base): Check for decomposing a
328 lambda closure type. Report base class chains if needed.
329 (cp_finish_decomp): Remove no-longer-needed check.
330
331 2024-12-13 Tobias Burnus <[email protected]>
332
333 * parser.cc (cp_parser_omp_construct, cp_parser_pragma): Reject
334 OpenMP expressions in constexpr functions.
335
336 2024-12-12 Tobias Burnus <[email protected]>
337
338 * parser.cc (OMP_DISPATCH_CLAUSE_MASK): Add has_device_addr clause.
339
340 2024-12-11 Jakub Jelinek <[email protected]>
341
342 PR c++/117614
343 * constexpr.cc (cxx_eval_store_expression): For stores to
344 DECL_ANON_UNION_VAR_P vars just continue with DECL_VALUE_EXPR
345 of it, without setting evaluated to true or full
346 cxx_eval_constant_expression.
347
348 2024-12-11 David Malcolm <[email protected]>
349
350 * decl.cc: Add #include "diagnostic-highlight-colors.h"
351 and #include "pretty-print-markup.h".
352 (complain_about_incompatible_declspecs): New.
353 (grokdeclarator): Use it when complaining about both 'signed' and
354 'unsigned', and both 'long' and 'short'.
355
356 2024-12-11 David Malcolm <[email protected]>
357
358 * call.cc (print_z_candidates): Count the number of
359 candidates and issue a note stating the count at an
360 intermediate nesting level. Number the individual
361 candidates.
362
363 2024-12-10 Arsen Arsenović <[email protected]>
364 Iain Sandoe <[email protected]>
365
366 * coroutines.cc (dump_record_fields): New helper. Iterates a
367 RECORD_TYPEs TYPE_FIELDS and pretty-prints them.
368 (dmp_str): New. The lang-coro dump stream.
369 (coro_dump_id): New. ID of the lang-coro dump.
370 (coro_dump_flags): New. Flags passed to the lang-coro dump.
371 (coro_maybe_dump_initial_function): New helper. Prints, if
372 dumping is enabled, the fndecl passed to it as the original
373 function.
374 (coro_maybe_dump_ramp): New. Prints the ramp function passed to
375 it, if dumping is enabled.
376 (coro_maybe_dump_transformed_functions): New.
377 (cp_coroutine_transform::apply_transforms): Initialize the
378 lang-coro dump. Call coro_maybe_dump_initial_function on the
379 original function, as well as coro_maybe_dump_ramp, after the
380 transformation into the ramp is finished.
381 (cp_coroutine_transform::finish_transforms): Call
382 coro_maybe_dump_transformed_functions on the built actor and
383 destroy.
384 * cp-objcp-common.cc (cp_register_dumps): Register the coroutine
385 dump.
386 * cp-tree.h (coro_dump_id): Declare as extern.
387 * cxx-pretty-print.cc (pp_cxx_template_parameter): Don't call
388 TREE_TYPE on a TREE_LIST cell.
389 (cxx_pretty_printer::declaration): Handle FIELD_DECL similar to
390 VAR_DECL.
391
392 2024-12-10 Marek Polacek <[email protected]>
393
394 PR c++/117788
395 * typeck.cc (cp_build_binary_op) <case EQ_EXPR>: Don't check
396 warn_array_compare. Check tf_warning_or_error instead of just
397 tf_warning. Maybe return an error_mark_node in C++26.
398 <case LE_EXPR>: Likewise.
399
400 2024-12-09 Marek Polacek <[email protected]>
401 Patrick Palka <[email protected]>
402
403 PR c++/116416
404 * cp-gimplify.cc (cp_fold_r) <case TARGET_EXPR>: Try to fold
405 TARGET_EXPR_INITIAL and replace it with the folded result if
406 it's TREE_CONSTANT.
407
408 2024-12-09 Matthew Malcomson <[email protected]>
409
410 * call.cc (build_cxx_call): Pass `complain` parameter to
411 check_builtin_function_arguments. Take its value from the
412 `tsubst_flags_t` type `complain & tf_error`.
413 * semantics.cc (finish_call_expr): Pass `complain` parameter to
414 resolve_overloaded_builtin. Take its value from the
415 `tsubst_flags_t` type `complain & tf_error`.
416
417 2024-12-06 David Malcolm <[email protected]>
418
419 PR other/116253
420 * call.cc (print_conversion_rejection): Remove leading space from
421 diagnostic messages.
422 (print_conversion_rejection): Likewise.
423 (print_arity_information): Likewise.
424 (print_z_candidate): Likewise. Add auto_diagnostic_nesting_level
425 before calls to fn_type_unification and diagnose_constraints.
426 (print_z_candidates): Add auto_diagnostic_nesting_level before
427 looping over candidates.
428 (conversion_null_warnings): Remove leading space from
429 diagnostic messages.
430 (maybe_inform_about_fndecl_for_bogus_argument_init): Likewise.
431 * constraint.cc (tsubst_valid_expression_requirement): Add
432 auto_diagnostic_nesting_level when showing why the expression is
433 invalid.
434 (satisfy_disjunction): Likewise when showing operans, and again
435 when replaying each branch of the disjunction.
436 (diagnose_constraints): Likewise when replaying satisfaction.
437 * error.cc (cp_diagnostic_text_starter): Set prefix.
438 (print_instantiation_full_context): Only show the file
439 if we're not showing nesting or the user has opted in to
440 showing location information in nested diagnostics.
441 (class auto_context_line): New.
442 (print_instantiation_partial_context_line): Replace calls to
443 print_location and to diagnostic_show_locus with an
444 auto_context_line.
445 (print_instantiation_partial_context): Replace calls to
446 print_location with an auto_context_line.
447 (maybe_print_constexpr_context): Likewise.
448 (print_constrained_decl_info): Likewise.
449 (print_concept_check_info): Likewise.
450 (print_constraint_context_head): Likewise.
451 (print_requires_expression_info): Likewise.
452
453 2024-12-06 David Malcolm <[email protected]>
454
455 * cp-gimplify.cc: Include "gcc-urlifier.h".
456 (process_stmt_hotness_attribute): Use auto_urlify_attributes with
457 OPT_Wattributes.
458 * cvt.cc: Include "gcc-urlifier.h".
459 (maybe_warn_nodiscard): Use auto_urlify_attributes with
460 OPT_Wunused_result.
461 * decl.cc: Include "gcc-urlifier.h".
462 (start_decl): Use auto_urlify_attributes.
463 (start_preparsed_function): Likewise.
464
465 2024-12-06 David Malcolm <[email protected]>
466
467 * name-lookup.cc (suggest_alternative_in_explicit_scope):
468 Gracefully handle non-namespaces, such as scoped enums.
469 * parser.cc (cp_parser_name_lookup_error): Provide
470 a name_hint for the case where we're in an explicit scope.
471 * std-name-hint.gperf: Add <concepts>.
472 * std-name-hint.h: Regenerate.
473
474 2024-12-06 David Malcolm <[email protected]>
475
476 PR other/116253
477 * error.cc (print_location): Move to earlier in the file.
478 (print_instantiation_partial_context_line): Replace
479 location-printing logic with a call to print_location.
480 (print_instantiation_partial_context): Likewise, splitting up
481 pp_verbatim calls.
482 (maybe_print_constexpr_context): Likewise.
483
484 2024-12-06 Jakub Jelinek <[email protected]>
485
486 * cp-tree.h (class raw_data_iterator): New type.
487 (class raw_data_range): New type.
488 * parser.cc (cp_parser_postfix_open_square_expression): Handle
489 parsing of CPP_EMBED.
490 (cp_parser_parenthesized_expression_list): Likewise. Use
491 cp_lexer_next_token_is.
492 (cp_parser_expression): Handle parsing of CPP_EMBED.
493 (cp_parser_template_argument_list): Likewise.
494 (cp_parser_initializer_list): Likewise.
495 (cp_parser_oacc_clause_tile): Likewise.
496 (cp_parser_omp_tile_sizes): Likewise.
497 * pt.cc (tsubst_expr): Handle RAW_DATA_CST.
498 * constexpr.cc (reduced_constant_expression_p): Likewise.
499 (raw_data_cst_elt): New function.
500 (find_array_ctor_elt): Handle RAW_DATA_CST.
501 (cxx_eval_array_reference): Likewise.
502 * typeck2.cc (digest_init_r): Emit -Wnarrowing and/or -Wconversion
503 diagnostics.
504 (process_init_constructor_array): Handle RAW_DATA_CST.
505 * decl.cc (maybe_deduce_size_from_array_init): Likewise.
506 (is_direct_enum_init): Fail for RAW_DATA_CST.
507 (cp_maybe_split_raw_data): New function.
508 (consume_init): New function.
509 (reshape_init_array_1): Add VECTOR_P argument. Handle RAW_DATA_CST.
510 (reshape_init_array): Adjust reshape_init_array_1 caller.
511 (reshape_init_vector): Likewise.
512 (reshape_init_class): Handle RAW_DATA_CST.
513 (reshape_init_r): Likewise.
514
515 2024-12-06 Marek Polacek <[email protected]>
516
517 PR c++/117898
518 * pt.cc (tsubst_pack_index): Detect indexing an empty pack.
519
520 2024-12-05 Jakub Jelinek <[email protected]>
521
522 PR c/41045
523 * cp-tree.h (finish_asm_stmt): Add TOPLEV_P argument.
524 * parser.cc (cp_parser_asm_definition): Parse also extended asm
525 without clobbers/labels outside of functions.
526 * semantics.cc (finish_asm_stmt): Add TOPLEV_P argument, if set,
527 check extra restrictions for extended asm outside of functions.
528 * pt.cc (tsubst_stmt): Adjust finish_asm_stmt caller.
529
530 2024-12-04 David Malcolm <[email protected]>
531
532 PR c++/116771
533 * parser.cc (cp_parser_name_lookup_error): Provide suggestions for
534 the case of complete failure where there is no scope.
535
536 2024-12-04 Simon Martin <[email protected]>
537
538 PR c++/117615
539 * constexpr.cc (cxx_eval_constant_expression): Don't reject
540 INTEGER_CSTs with type POINTER_TYPE to METHOD_TYPE.
541
542 2024-12-04 Jakub Jelinek <[email protected]>
543
544 PR c++/117826
545 * cp-tree.h (struct decl_location_traits): New type.
546 (erroneous_templates_t): Change using into typedef.
547 (erroneous_templates): Add GTY((cache)).
548 * error.cc (cp_adjust_diagnostic_info): Use
549 hash_map_safe_get_or_insert<true> rather than
550 hash_map_safe_get_or_insert<false> for erroneous_templates.
551
552 2024-12-03 Nina Ranns <[email protected]>
553
554 PR c++/117579
555 * parser.cc (cp_parser_statement): Replace assertion with a
556 conditional check that the statement containing a contract assert
557 is empty.
558
559 2024-12-02 Patrick Palka <[email protected]>
560
561 * constraint.cc (resolve_concept_check): Remove.
562 (deduce_constrained_parameter): Remove.
563 (finish_type_constraints): Inline into its only caller
564 cp_parser_placeholder_type_specifier and remove.
565 (build_concept_check_arguments): Coding style tweaks.
566 (build_standard_check): Inline into its only caller ...
567 (build_concept_check): ... here.
568 (build_type_constraint): Use the prototype parameter as the
569 first template argument.
570 (finish_shorthand_constraint): Remove function concept
571 handling. Use concept_prototype_parameter.
572 (placeholder_extract_concept_and_args): Inline into its
573 callers and remove.
574 (equivalent_placeholder_constraints): Adjust after
575 placeholder_extract_concept_and_args removal.
576 (iterative_hash_placeholder_constraint): Likewise.
577 * cp-objcp-common.cc (cp_common_init_ts): Remove WILDCARD_DECL
578 handling.
579 * cp-tree.def (WILDCARD_DECL): Remove.
580 * cp-tree.h (WILDCARD_PACK_P): Remove.
581 (type_uses_auto_or_concept): Remove declaration of nonexistent
582 function.
583 (append_type_to_template_for_access_check): Likewise.
584 (finish_type_constraints): Remove declaration.
585 (placeholder_extract_concept_and_args): Remove declaration.
586 (deduce_constrained_parameter): Remove declaration.
587 (resolve_constraint_check): Remove declaration.
588 (valid_requirements_p): Remove declaration of nonexistent
589 function.
590 (finish_concept_name): Likewise.
591 (concept_definition_p): Remove redundant overload.
592 (concept_prototype_parameter): Define.
593 * cxx-pretty-print.cc (pp_cxx_constrained_type_spec): Adjust
594 after placeholder_extract_concept_and_args.
595 * error.cc (dump_decl) <case WILDCARD_DECL>: Remove.
596 (dump_expr) <case WILDCARD_DECL>: Likewise.
597 * parser.cc (is_constrained_parameter): Inline into
598 declares_constrained_type_template_parameter and remove.
599 (cp_parser_check_constrained_type_parm): Declare static.
600 (finish_constrained_template_template_parm): Remove.
601 (cp_parser_constrained_template_template_parm): Remove.
602 (finish_constrained_parameter): Remove dead code guarded by
603 cp_parser_constrained_template_template_parm.
604 (declares_constrained_type_template_parameter): Adjust after
605 is_constrained_parameter removal.
606 (declares_constrained_template_template_parameter): Remove.
607 (cp_parser_placeholder_type_specifier): Adjust after
608 finish_type_constraints removal. Check the prototype parameter
609 earlier, before build_type_constraint.
610 Use concept_prototype_parameter.
611 (cp_parser_parameter_declaration): Remove dead code guarded by
612 declares_constrained_template_template_parameter.
613 * pt.cc (convert_wildcard_argument): Remove.
614 (convert_template_argument): Remove WILDCARD_DECL handling.
615 (coerce_template_parameter_pack): Likewise.
616 (tsubst) <case TEMPLATE_TYPE_PARM>: Likewise.
617 (type_dependent_expression_p): Likewise.
618 (make_constrained_placeholder_type): Remove function concept
619 handling.
620 (placeholder_type_constraint_dependent_p): Remove WILDCARD_DECL
621 handling.
622
623 2024-11-30 Jakub Jelinek <[email protected]>
624
625 * parser.cc: Implement C++26 P3176R1 - The Oxford variadic comma.
626 (cp_parser_parameter_declaration_clause): Emit
627 -Wdeprecated-variadic-comma-omission warnings.
628
629 2024-11-29 Tejas Belagod <[email protected]>
630
631 * decl.cc (reshape_init_array_1): Handle poly indices.
632
633 2024-11-28 Marek Polacek <[email protected]>
634
635 PR c++/113798
636 * constexpr.cc (potential_constant_expression_1) <case PACK_INDEX_EXPR>:
637 New case.
638 * cp-objcp-common.cc (cp_common_init_ts): Mark PACK_INDEX_TYPE and
639 PACK_INDEX_EXPR.
640 * cp-tree.def (PACK_INDEX_TYPE): New.
641 (PACK_INDEX_EXPR): New.
642 * cp-tree.h (WILDCARD_TYPE_P): Also check PACK_INDEX_TYPE.
643 (PACK_INDEX_CHECK): Define.
644 (PACK_INDEX_P): Define.
645 (PACK_INDEX_PACK): Define.
646 (PACK_INDEX_INDEX): Define.
647 (PACK_INDEX_PARENTHESIZED_P): Define.
648 (make_pack_index): Declare.
649 (pack_index_element): Declare.
650 * cxx-pretty-print.cc (cxx_pretty_printer::expression) <case
651 PACK_INDEX_EXPR>: New case.
652 (cxx_pretty_printer::type_id) <case PACK_INDEX_TYPE>: New case.
653 * error.cc (dump_type) <case PACK_INDEX_TYPE>: New case.
654 (dump_type_prefix): Handle PACK_INDEX_TYPE.
655 (dump_type_suffix): Likewise.
656 (dump_expr) <case PACK_INDEX_EXPR>: New case.
657 * mangle.cc (write_type) <case PACK_INDEX_TYPE>: New case.
658 * module.cc (trees_out::type_node) <case PACK_INDEX_TYPE>: New case.
659 (trees_in::tree_node) <case PACK_INDEX_TYPE>: New case.
660 * parser.cc (cp_parser_next_tokens_are_pack_index_p): New.
661 (cp_parser_pack_index): New.
662 (cp_parser_primary_expression): Handle a C++26 pack-index-expression.
663 (cp_parser_unqualified_id): Handle a C++26 pack-index-specifier.
664 (cp_parser_nested_name_specifier_opt): See if a pack-index-specifier
665 follows.
666 (cp_parser_qualifying_entity): Handle a C++26 pack-index-specifier.
667 (cp_parser_decltype_expr): Set id_expression_or_member_access_p for
668 pack indexing.
669 (cp_parser_mem_initializer_id): Handle a C++26 pack-index-specifier.
670 (cp_parser_simple_type_specifier): Likewise.
671 (cp_parser_base_specifier): Likewise.
672 * pt.cc (iterative_hash_template_arg) <case PACK_INDEX_TYPE,
673 PACK_INDEX_EXPR>: New case.
674 (find_parameter_packs_r) <case PACK_INDEX_TYPE, PACK_INDEX_EXPR>: New
675 case.
676 (make_pack_index): New.
677 (tsubst_pack_index): New.
678 (tsubst): Avoid tsubst on PACK_INDEX_TYPE.
679 <case TYPENAME_TYPE>: Add a call to error.
680 <case PACK_INDEX_TYPE>: New case.
681 (tsubst_expr) <case PACK_INDEX_EXPR>: New case.
682 (dependent_type_p_r): Return true for PACK_INDEX_TYPE.
683 (type_dependent_expression_p): Recurse on PACK_INDEX_PACK for
684 PACK_INDEX_EXPR.
685 * ptree.cc (cxx_print_type) <case PACK_INDEX_TYPE>: New case.
686 * semantics.cc (finish_parenthesized_expr): Set
687 PACK_INDEX_PARENTHESIZED_P for PACK_INDEX_EXPR.
688 (finish_type_pack_element): Adjust error messages.
689 (pack_index_element): New.
690 * tree.cc (cp_tree_equal) <case PACK_INDEX_EXPR>: New case.
691 (cp_walk_subtrees) <case PACK_INDEX_TYPE, PACK_INDEX_EXPR>: New case.
692 * typeck.cc (structural_comptypes) <case PACK_INDEX_TYPE>: New case.
693
694 2024-11-28 Jakub Jelinek <[email protected]>
695
696 PR c++/78620
697 PR c++/117256
698 * init.cc (build_zero_init_1): Set CONSTRUCTOR_ZERO_PADDING_BITS.
699 (build_value_init_noctor): Likewise.
700 * constexpr.cc (cxx_eval_store_expression): Propagate
701 CONSTRUCTOR_ZERO_PADDING_BITS flag.
702
703 2024-11-28 David Malcolm <[email protected]>
704
705 PR c/82892
706 * name-lookup.cc (suggest_alternatives_for_1): Provide hints for
707 missing command-line options.
708
709 2024-11-28 David Malcolm <[email protected]>
710
711 PR c++/87850
712 * call.cc (convert_like_real): Call maybe_emit_indirection_note
713 for "invalid conversion" diagnostic.
714 * typeck.cc (compatible_types_for_indirection_note_p): New
715 function.
716
717 2024-11-28 David Malcolm <[email protected]>
718
719 PR c/104896
720 * cvt.cc (maybe_warn_nodiscard): Replace "%<%s%>" with "%qs" in
721 message wording.
722
723 2024-11-27 Jason Merrill <[email protected]>
724
725 * module.cc (trees_out::core_bools): Check vague_linkage_p.
726 (has_definition): Likewise.
727
728 2024-11-23 Lewis Hyatt <[email protected]>
729
730 * module.cc (bytes_out::loc): New function.
731 (bytes_in::loc): New function.
732 (struct span): Change int fields to location_diff_t.
733 (range_t): Change from "unsigned int" to "line_map_uint_t".
734 (struct ord_loc_info): Likewise.
735 (struct macro_loc_info): Likewise.
736 (class module_state): Likewise.
737 (dumper::operator()): Add new code 'K' for dumping a location_t.
738 (loc_spans::init): Use %K instead of %u for location_t dumps.
739 (loc_spans::open): Likewise.
740 (loc_spans::close): Likewise. Adjust bitwise expressions to support
741 64-bit location_t as well.
742 (struct module_state_config): Change ordinary_locs and macro_locs
743 from "unsigned int" to "line_map_uint_t". Reorder fields to improve
744 packing. Rather than changing the constructor initializer list to
745 match the new order, switch to NSDMI instead.
746 (module_state::note_location): Adjust to support 64-bit location_t.
747 (module_state::write_location): Use %K instead of %u for location_t
748 dumps. Use loc() instead of u() for streaming location_t.
749 (module_state::read_location): Likewise.
750 (module_state::write_ordinary_maps): Likewise.
751 (module_state::write_macro_maps): Likewise.
752 (module_state::write_config): Likewise.
753 (module_state::read_config): Likewise.
754 (module_state::write_prepare_maps): Use %K instead of %u for
755 location_t dumps. Adjust variable types and bitwise expressions to
756 support 64-bit location_t.
757 (module_state::read_ordinary_maps): Likewise.
758 (module_state::read_macro_maps): Likewise.
759 (preprocess_module): Adjust data types to support 64-bit number of
760 line maps.
761
762 2024-11-22 Andrew Pinski <[email protected]>
763
764 PR bootstrap/117737
765 * call.cc (INCLUDE_MEMORY): Remove.
766 * class.cc (INCLUDE_MEMORY): Remove.
767 * constexpr.cc (INCLUDE_MEMORY): Remove.
768 * constraint.cc (INCLUDE_MEMORY): Remove.
769 * contracts.cc (INCLUDE_MEMORY): Remove.
770 * coroutines.cc (INCLUDE_MEMORY): Remove.
771 * cp-gimplify.cc (INCLUDE_MEMORY): Remove.
772 * cp-lang.cc (INCLUDE_MEMORY): Remove.
773 * cp-objcp-common.cc (INCLUDE_MEMORY): Remove.
774 * cp-ubsan.cc (INCLUDE_MEMORY): Remove.
775 * cvt.cc (INCLUDE_MEMORY): Remove.
776 * cxx-pretty-print.cc (INCLUDE_MEMORY): Remove.
777 * decl.cc (INCLUDE_MEMORY): Remove.
778 * decl2.cc (INCLUDE_MEMORY): Remove.
779 * dump.cc (INCLUDE_MEMORY): Remove.
780 * error.cc (INCLUDE_MEMORY): Remove.
781 * except.cc (INCLUDE_MEMORY): Remove.
782 * expr.cc (INCLUDE_MEMORY): Remove.
783 * friend.cc (INCLUDE_MEMORY): Remove.
784 * init.cc (INCLUDE_MEMORY): Remove.
785 * lambda.cc (INCLUDE_MEMORY): Remove.
786 * lex.cc (INCLUDE_MEMORY): Remove.
787 * logic.cc (INCLUDE_MEMORY): Remove.
788 * mangle.cc (INCLUDE_MEMORY): Remove.
789 * mapper-client.cc (INCLUDE_MEMORY): Remove.
790 * mapper-resolver.cc (INCLUDE_MEMORY): Remove.
791 * method.cc (INCLUDE_MEMORY): Remove.
792 * module.cc (INCLUDE_MEMORY): Remove.
793 * name-lookup.cc (INCLUDE_MEMORY): Remove.
794 * optimize.cc (INCLUDE_MEMORY): Remove.
795 * parser.cc (INCLUDE_MEMORY): Remove.
796 * pt.cc (INCLUDE_MEMORY): Remove.
797 * ptree.cc (INCLUDE_MEMORY): Remove.
798 * rtti.cc (INCLUDE_MEMORY): Remove.
799 * search.cc (INCLUDE_MEMORY): Remove.
800 * semantics.cc (INCLUDE_MEMORY): Remove.
801 * tree.cc (INCLUDE_MEMORY): Remove.
802 * typeck.cc (INCLUDE_MEMORY): Remove.
803 * typeck2.cc (INCLUDE_MEMORY): Remove.
804 * vtable-class-hierarchy.cc (INCLUDE_MEMORY): Remove.
805
806 2024-11-22 Tobias Burnus <[email protected]>
807
808 * parser.cc (cp_parser_omp_clause_name, cp_parser_omp_all_clauses,
809 cp_parser_omp_dispatch_body): Handle 'interop' clause.
810 * pt.cc (tsubst_omp_clauses): Likewise.
811 * semantics.cc (finish_omp_clauses): Likewise.
812
813 2024-11-22 Tobias Burnus <[email protected]>
814
815 * parser.cc (INCLUDE_STRING): Define.
816 (cp_parser_omp_clause_name): Handle init, use, and destroy clauses.
817 (cp_parser_omp_all_clauses): Likewise; use C_ORT_OMP_INTEROP, if
818 'use' is permitted, for c_finish_omp_clauses.
819 (cp_parser_omp_modifier_prefer_type, cp_parser_omp_clause_init,
820 OMP_INTEROP_CLAUSE_MASK, cp_parser_omp_interop): New.
821 (cp_parser_pragma): Handle 'interop' directive.
822 * pt.cc (tsubst_omp_clauses): Handle init, use, and destroy clauses.
823 (tsubst_stmt): Handle OMP_INTEROP.
824 * semantics.cc (cp_omp_init_prefer_type_update): New.
825 (finish_omp_clauses): Handle init, use, and destroy clauses
826 and add clause check for 'depend' on 'interop'.
827
828 2024-11-21 Jason Merrill <[email protected]>
829
830 * module.cc (has_definition): Also true for inline vars.
831
832 2024-11-21 Jason Merrill <[email protected]>
833
834 * module.cc (trees_in::core_vals) [STATEMENT_LIST]: Skip
835 DEBUG_BEGIN_STMT if !MAY_HAVE_DEBUG_MARKER_STMTS.
836
837 2024-11-21 Jason Merrill <[email protected]>
838
839 * name-lookup.cc (lookup_imported_hidden_friend): Call
840 lazy_load_pendings.
841
842 2024-11-20 Paul-Antoine Arras <[email protected]>
843
844 * decl.cc (omp_declare_variant_finalize_one): Set adjust_args
845 need_device_ptr attribute.
846 * parser.cc (cp_parser_direct_declarator): Update call to
847 cp_parser_late_return_type_opt.
848 (cp_parser_late_return_type_opt): Add 'tree parms' parameter. Update
849 call to cp_parser_late_parsing_omp_declare_simd.
850 (cp_parser_omp_clause_name): Handle nocontext and novariants clauses.
851 (cp_parser_omp_clause_novariants): New function.
852 (cp_parser_omp_clause_nocontext): Likewise.
853 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_NOVARIANTS and
854 PRAGMA_OMP_CLAUSE_NOCONTEXT.
855 (cp_parser_omp_dispatch_body): New function, inspired from
856 cp_parser_assignment_expression and cp_parser_postfix_expression.
857 (OMP_DISPATCH_CLAUSE_MASK): Define.
858 (cp_parser_omp_dispatch): New function.
859 (cp_finish_omp_declare_variant): Add parameter. Handle adjust_args
860 clause.
861 (cp_parser_late_parsing_omp_declare_simd): Add parameter. Update calls
862 to cp_finish_omp_declare_variant and cp_finish_omp_declare_variant.
863 (cp_parser_omp_construct): Handle PRAGMA_OMP_DISPATCH.
864 (cp_parser_pragma): Likewise.
865 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_NOCONTEXT and
866 OMP_CLAUSE_NOVARIANTS.
867 * pt.cc (tsubst_omp_clauses): Handle OMP_CLAUSE_NOCONTEXT and
868 OMP_CLAUSE_NOVARIANTS.
869 (tsubst_stmt): Handle OMP_DISPATCH.
870 (tsubst_expr): Handle IFN_GOMP_DISPATCH.
871
872 2024-11-19 Jason Merrill <[email protected]>
873
874 * decl2.cc (cp_handle_deprecated_or_unavailable): Avoid redundant
875 warning.
876 * call.cc (build_over_call): Set TREE_NO_WARNING for calls
877 to deprecated functions.
878 * semantics.cc (finish_call_expr): Propagate TREE_NO_WARNING.
879
880 2024-11-17 Jason Merrill <[email protected]>
881
882 * module.cc (module_preprocess_options): Set directives_only here.
883
884 2024-11-17 Jason Merrill <[email protected]>
885
886 * module.cc (module_preprocess_options): Don't override it.
887
888 2024-11-16 Jan Hubicka <[email protected]>
889
890 * decl.cc (cxx_build_operator_new): Break out from ...
891 (cxx_build_operator_delete): Break out from ...
892 (cxx_init_operator_new_delete_decls): Break out from ...
893 (cxx_init_decl_processing): ... here.
894
895 2024-11-14 Jason Merrill <[email protected]>
896
897 * name-lookup.cc (do_namespace_alias): set_originating_module after
898 pushdecl.
899
900 2024-11-14 Jason Merrill <[email protected]>
901
902 * module.cc (module_state_config::get_dialect): Expect coroutines in
903 C++20.
904
905 2024-11-11 Jason Merrill <[email protected]>
906
907 * Make-lang.in: Also collect tags from libcody and c++tools.
908
909 2024-11-11 Jason Merrill <[email protected]>
910
911 * lang-specs.h: Check fmodules* instead of fmodules-ts.
912
913 2024-11-11 Simon Martin <[email protected]>
914
915 PR c++/117463
916 * constexpr.cc (cxx_placement_new_fn): Implement in terms of
917 std_placement_new_fn_p.
918 * cp-tree.h (std_placement_new_fn_p): Declare.
919 * init.cc (std_placement_new_fn_p): Add missing checks to ensure
920 that fndecl is a non-replaceable ::operator new.
921
922 2024-11-11 Jakub Jelinek <[email protected]>
923
924 * parser.cc (cp_parser_postfix_expression): Handle
925 RID_BUILTIN_OPERATOR_NEW and RID_BUILTIN_OPERATOR_DELETE.
926 * cp-objcp-common.cc (names_builtin_p): Change return type from
927 bool to int, adjust return statments. Handle
928 RID_BUILTIN_OPERATOR_NEW and RID_BUILTIN_OPERATOR_DELETE.
929 * pt.cc (tsubst_expr) <case CALL_EXPR>: Handle
930 CALL_FROM_NEW_OR_DELETE_P.
931
932 2024-11-11 Jason Merrill <[email protected]>
933
934 * cp-tree.h (struct ptrmem_cst): Change tree_common to tree_typed.
935 (struct tree_trait_expr): Likewise.
936 (struct tree_static_assert): Change tree_common to tree_base.
937 (struct tree_argument_pack_select): Likewise.
938
939 2024-11-10 Lewis Hyatt <[email protected]>
940
941 * cp-objcp-common.cc (cp_common_init_ts): Change TRAIT_EXPR from
942 TS_EXP to TS_TYPED.
943
944 2024-11-08 Jakub Jelinek <[email protected]>
945
946 PR c++/117317
947 * semantics.cc (emit_associated_thunks): Do nothing for
948 !DECL_INTERFACE_KNOWN && DECL_DEFER_OUTPUT fns.
949
950 2024-11-05 Jason Merrill <[email protected]>
951
952 PR c++/116634
953 * init.cc (can_init_array_with_p): Allow PR59465 case with
954 permerror.
955
956 2024-11-05 Simon Martin <[email protected]>
957
958 PR c++/117099
959 PR c++/117129
960 * typeck.cc (check_return_expr): Upon error, set
961 current_function_return_value to error_mark_node.
962
963 2024-11-05 Simon Martin <[email protected]>
964
965 PR c++/117101
966 * init.cc (std_placement_new_fn_p): Check first_arg against
967 NULL_TREE.
968
969 2024-11-05 Simon Martin <[email protected]>
970
971 PR c++/117158
972 * typeck.cc (cp_build_array_ref): Only wrap array expression
973 into a SAVE_EXPR at template instantiation time.
974
975 2024-11-05 Jakub Jelinek <[email protected]>
976
977 PR c++/117370
978 * cp-tree.h (is_std_class): Declare.
979 * constexpr.cc (is_std_class): New function.
980 (is_std_allocator): Use it.
981 * decl.cc (grok_op_properties): Mark global replaceable
982 operator new/delete operators with const std::nothrow_t & last
983 argument with DECL_IS_REPLACEABLE_OPERATOR.
984
985 2024-11-05 Nathaniel Shead <[email protected]>
986
987 PR c++/99274
988 * module.cc (trees_in::is_matching_decl): Merge default
989 arguments.
990 * tree.cc (cp_tree_equal) <AGGR_INIT_EXPR>: Handle unification
991 of AGGR_INIT_EXPRs with new VAR_DECL slots.
992
993 2024-11-05 Nathaniel Shead <[email protected]>
994
995 PR c++/105443
996 * module.cc (loc_spans::locs_exhausted_p): New field.
997 (loc_spans::loc_spans): Initialise it.
998 (loc_spans::locations_exhausted_p): New function.
999 (module_state::read_prepare_maps): Move inform into...
1000 (loc_spans::report_location_exhaustion): ...this new function.
1001 (module_state::write_location): Check for writing module
1002 locations stored due to resource exhaustion.
1003
1004 2024-11-02 Nathaniel Shead <[email protected]>
1005 Jason Merrill <[email protected]>
1006
1007 PR c++/113814
1008 * pt.cc (add_mergeable_specialization): Propagate
1009 TYPE_CANONICAL.
1010
1011 2024-11-02 Nathaniel Shead <[email protected]>
1012
1013 PR c++/116317
1014 * module.cc
1015 (depset::DB_MAYBE_RECURSIVE_BIT): New flag.
1016 (depset::DB_ENTRY_BIT): New flag.
1017 (depset::is_maybe_recursive): New accessor.
1018 (depset::is_entry): New accessor.
1019 (depset::hash::writing_merge_key): New field.
1020 (trees_out::decl_value): Inform dep_hash while we're writing the
1021 merge key information for a decl.
1022 (depset::hash::add_dependency): Find recursive deps and mark the
1023 entry point.
1024 (sort_cluster): Ensure that the entry dep is streamed first.
1025
1026 2024-11-01 David Malcolm <[email protected]>
1027
1028 PR bootstrap/117361
1029 * Make-lang.in (s-selftest-c++): Use GCC_FOR_SELFTESTS.
1030 (selftest-c++-gdb): Likewise.
1031 (selftest-c++-valgrind): Likewise.
1032
1033 2024-11-01 Jakub Jelinek <[email protected]>
1034
1035 * pt.cc (tsubst_attribute): For "omp declare variant base" attribute
1036 if varid is error_mark_node, set val to error_mark_node rather than
1037 creating a TREE_LIST with error_mark_node TREE_PURPOSE.
1038
1039 2024-10-31 Tobias Burnus <[email protected]>
1040
1041 * decl.cc (omp_declare_variant_finalize_one): Use STRIP_REFERENCE_REF
1042 instead of doing it manually.
1043
1044 2024-10-31 Tobias Burnus <[email protected]>
1045
1046 * decl.cc (omp_declare_variant_finalize_one): Strip indirect ref
1047 around variant-function call when processing a variant.
1048
1049 2024-10-30 Iain Sandoe <[email protected]>
1050
1051 PR c++/116607
1052 * contracts.cc (has_active_contract_condition): Use the
1053 CONTRACT_CHAIN macro to advance through the attribute list.
1054
1055 2024-10-29 David Malcolm <[email protected]>
1056
1057 PR other/116613
1058 * error.cc (cxx_initialize_diagnostics): Use unique_ptr for
1059 pretty_printer. Use context->set_format_decoder.
1060 * module.cc (noisy_p): Update for global_dc's m_printer becoming
1061 reference printer.
1062
1063 2024-10-29 Jason Merrill <[email protected]>
1064
1065 PR c++/30854
1066 PR c++/116634
1067 * error.cc (dump_aggr_init_expr_args): Remove.
1068 (dump_call_expr_args): Handle AGGR_INIT_EXPR.
1069 (dump_expr): Combine AGGR_INIT_EXPR and CALL_EXPR cases.
1070
1071 2024-10-25 Jakub Jelinek <[email protected]>
1072
1073 * vtable-class-hierarchy.cc: Remove trailing whitespace.
1074 * typeck2.cc: Likewise.
1075 * decl.cc: Likewise.
1076 * init.cc: Likewise.
1077 * semantics.cc: Likewise.
1078 * module.cc: Likewise.
1079 * rtti.cc: Likewise.
1080 * cxx-pretty-print.cc: Likewise.
1081 * cvt.cc: Likewise.
1082 * mangle.cc: Likewise.
1083 * name-lookup.h: Likewise.
1084 * coroutines.cc: Likewise.
1085 * error.cc: Likewise.
1086 * lambda.cc: Likewise.
1087 * tree.cc: Likewise.
1088 * g++spec.cc: Likewise.
1089 * decl2.cc: Likewise.
1090 * cp-tree.h: Likewise.
1091 * parser.cc: Likewise.
1092 * pt.cc: Likewise.
1093 * call.cc: Likewise.
1094 * lex.cc: Likewise.
1095 * cp-lang.cc: Likewise.
1096 * cp-tree.def: Likewise.
1097 * constexpr.cc: Likewise.
1098 * typeck.cc: Likewise.
1099 * name-lookup.cc: Likewise.
1100 * optimize.cc: Likewise.
1101 * search.cc: Likewise.
1102 * mapper-client.cc: Likewise.
1103 * ptree.cc: Likewise.
1104 * class.cc: Likewise.
1105
1106 2024-10-24 Nathaniel Shead <[email protected]>
1107
1108 * module.cc (trees_in::read_class_def): Propagate some missing
1109 flags from the streamed-in definition.
1110
1111 2024-10-24 Nathaniel Shead <[email protected]>
1112
1113 * module.cc (post_load_processing): Mark COMDAT as needed, emit
1114 declarations if maybe_clone_body fails.
1115
1116 2024-10-24 Nathaniel Shead <[email protected]>
1117
1118 PR c++/115007
1119 * module.cc (module_state::read_cluster): Replace
1120 DECL_ABSTRACT_P with DECL_MAYBE_IN_CHARGE_CDTOR_P.
1121 (post_load_processing): Check and mark TREE_ASM_WRITTEN.
1122 * semantics.cc (expand_or_defer_fn_1): Use the more specific
1123 module_maybe_has_cmi_p instead of modules_p.
1124
1125 2024-10-24 Nathaniel Shead <[email protected]>
1126
1127 * decl2.cc (import_export_class): Use TYPE_CONTAINS_VPTR_P
1128 instead of TYPE_POLYMORPHIC_P.
1129 (import_export_decl): Likewise.
1130
1131 2024-10-24 David Malcolm <[email protected]>
1132 Gaius Mulley <[email protected]>
1133
1134 PR other/116613
1135 * call.cc: Add #define INCLUDE_MEMORY.
1136 * class.cc: Likewise.
1137 * constexpr.cc: Likewise.
1138 * constraint.cc: Likewise.
1139 * contracts.cc: Likewise.
1140 * coroutines.cc: Likewise.
1141 * cp-gimplify.cc: Likewise.
1142 * cp-lang.cc: Likewise.
1143 * cp-objcp-common.cc: Likewise.
1144 * cp-ubsan.cc: Likewise.
1145 * cvt.cc: Likewise.
1146 * cxx-pretty-print.cc: Likewise. Add #include "cp-tree.h".
1147 (cxx_pretty_printer::clone): Use std::unique_ptr and
1148 ::make_unique.
1149 * cxx-pretty-print.h (cxx_pretty_printer::clone): Use
1150 std::unique_ptr.
1151 * decl2.cc: Add #define INCLUDE_MEMORY.
1152 * dump.cc: Likewise.
1153 * except.cc: Likewise.
1154 * expr.cc: Likewise.
1155 * friend.cc: Likewise.
1156 * init.cc: Likewise.
1157 * lambda.cc: Likewise.
1158 * logic.cc: Likewise.
1159 * mangle.cc: Likewise.
1160 * method.cc: Likewise.
1161 * optimize.cc: Likewise.
1162 * pt.cc: Likewise.
1163 * ptree.cc: Likewise.
1164 * rtti.cc: Likewise.
1165 * search.cc: Likewise.
1166 * semantics.cc: Likewise.
1167 * tree.cc: Likewise.
1168 * typeck.cc: Likewise.
1169 * typeck2.cc: Likewise.
1170 * vtable-class-hierarchy.cc: Likewise.
1171
1172 2024-10-24 Jakub Jelinek <[email protected]>
1173
1174 PR c++/117259
1175 * typeck.cc (get_member_function_from_ptrfunc): Use force_target_expr
1176 rather than save_expr for instance_ptr and function. Don't call it
1177 for TREE_CONSTANT.
1178
1179 2024-10-22 Jason Merrill <[email protected]>
1180
1181 PR c++/117107
1182 PR c++/92687
1183 * decl.cc (lookup_decomp_type): Handle null table.
1184
1185 2024-10-22 Patrick Palka <[email protected]>
1186
1187 * pt.cc (register_specialization): Set elt.hash.
1188
1189 2024-10-22 Nathaniel Shead <[email protected]>
1190
1191 * module.cc (depset::DB_IS_MEMBER_BIT): Rename to...
1192 (depset::DB_IS_PENDING_BIT): ...this.
1193 (depset::is_member): Remove.
1194 (depset::is_pending_entity): New function.
1195 (depset::hash::make_dependency): Mark definitions of
1196 namespace-scope types as maybe-pending entities.
1197 (depset::hash::add_class_entities): Rename DB_IS_MEMBER_BIT to
1198 DB_IS_PENDING_BIT.
1199 (depset::hash::find_dependencies): Use is_pending_entity
1200 instead of is_member.
1201 (module_state::write_pendings): Likewise; adjust comment.
1202
1203 2024-10-18 Alejandro Colomar <[email protected]>
1204
1205 * cp-tree.h (array_type_nelts_top)
1206 * tree.cc (array_type_nelts_top):
1207 Remove function (move to gcc/).
1208
1209 2024-10-18 Alejandro Colomar <[email protected]>
1210
1211 * decl.cc (reshape_init_array)
1212 * init.cc
1213 (build_zero_init_1)
1214 (build_value_init_noctor)
1215 (build_vec_init)
1216 (build_delete)
1217 * lambda.cc (add_capture)
1218 * tree.cc (array_type_nelts_top):
1219 Rename array_type_nelts => array_type_nelts_minus_one
1220
1221 2024-10-16 Jakub Jelinek <[email protected]>
1222
1223 * search.cc (lookup_member): ?: operator formatting fixes.
1224 * typeck.cc (cp_build_modify_expr): Likewise.
1225
1226 2024-10-15 Jakub Jelinek <[email protected]>
1227
1228 PR c/117022
1229 * semantics.cc (begin_while_stmt, begin_do_stmt, begin_for_stmt,
1230 finish_break_stmt, finish_continue_stmt, begin_switch_stmt): Pass
1231 another NULL_TREE to build_stmt calls.
1232
1233 2024-10-15 Patrick Palka <[email protected]>
1234
1235 PR c++/116710
1236 * pt.cc (unify) <case REFERENCE_TYPE>: Compare rvalueness.
1237
1238 2024-10-15 Patrick Palka <[email protected]>
1239
1240 PR c++/117054
1241 * pt.cc (extract_locals_r): Disable tree_extra_args assert
1242 for LAMBDA_EXPR.
1243
1244 2024-10-14 Jason Merrill <[email protected]>
1245
1246 * cp-tree.h (most_constrained_function): Declare..
1247 * class.cc (resolve_address_of_overloaded_function): Call it.
1248 * pt.cc (get_template_for_ordering): Handle list from
1249 resolve_address_of_overloaded_function.
1250 (most_constrained_function): No longer static.
1251 (resolve_overloaded_unification): Always compare type rather
1252 than decl.
1253
1254 2024-10-13 Simon Martin <[email protected]>
1255
1256 Revert:
1257 2024-10-12 Simon Martin <[email protected]>
1258
1259 PR c++/109918
1260 * class.cc (warn_hidden): Keep track of overloaded and of hidden
1261 base methods. Mention the actual hiding function in the warning,
1262 not the first overload.
1263 * error.cc (location_of): Skip over conv_op_marker.
1264
1265 2024-10-12 Simon Martin <[email protected]>
1266
1267 PR c++/109918
1268 * class.cc (warn_hidden): Keep track of overloaded and of hidden
1269 base methods. Mention the actual hiding function in the warning,
1270 not the first overload.
1271 * error.cc (location_of): Skip over conv_op_marker.
1272
1273 2024-10-07 Jason Merrill <[email protected]>
1274
1275 * decl.cc (duplicate_decls): Only check PURVIEW_P if
1276 DECL_LANG_SPECIFIC.
1277
1278 2024-10-07 Jason Merrill <[email protected]>
1279
1280 * decl2.cc (mark_used): Always check require_deduced_type.
1281
1282 2024-10-07 Jason Merrill <[email protected]>
1283
1284 * module.cc (init_modules): Don't warn about -M.
1285
1286 2024-10-04 Nathaniel Shead <[email protected]>
1287
1288 PR c++/113266
1289 PR c++/116911
1290 * parser.cc (cp_parser_template_argument): Allow
1291 internal-linkage variables since C++11.
1292
1293 2024-10-04 Nathaniel Shead <[email protected]>
1294
1295 PR c++/116913
1296 * name-lookup.cc (update_binding): Return the strip_using'd old
1297 decl rather than the binding.
1298
1299 2024-10-04 Jason Merrill <[email protected]>
1300 Richard Biener <[email protected]>
1301
1302 * cp-tree.h (spec_entry::hash): New member.
1303 * pt.cc (spec_hasher::hash): Set it and return it.
1304 (maybe_process_partial_specialization): Clear it when
1305 changing tmpl/args.
1306 (lookup_template_class): Likewise, don't pass hash to find.
1307 (retrieve_specialization): Set it, don't pass hash to find.
1308 (register_specialization): Don't pass hash to find.
1309 (reregister_specialization): Likewise.
1310 (match_mergeable_specialization): Likewise.
1311 (add_mergeable_specialization): Likewise.
1312
1313 2024-10-03 Jason Merrill <[email protected]>
1314 Richard Biener <[email protected]>
1315
1316 * pt.cc (coerce_template_parms): Free garbage vecs.
1317
1318 2024-10-03 Jason Merrill <[email protected]>
1319
1320 Revert:
1321 2024-10-03 Jason Merrill <[email protected]>
1322 Richard Biener <[email protected]>
1323
1324 * pt.cc (struct free_if_changed_proxy): New.
1325 (coerce_template_parms): Use it.
1326
1327 2024-10-03 Jason Merrill <[email protected]>
1328
1329 * parser.cc (location_between): New.
1330 (cp_parser_operator): Handle -Wdeprecated-literal-operator.
1331
1332 2024-10-03 Jason Merrill <[email protected]>
1333 Richard Biener <[email protected]>
1334
1335 * pt.cc (struct free_if_changed_proxy): New.
1336 (coerce_template_parms): Use it.
1337
1338 2024-10-02 Simon Martin <[email protected]>
1339
1340 PR c++/116722
1341 * constexpr.cc (cxx_bind_parameters_in_call): When !ctx->quiet,
1342 emit error before bailing out due to a call to {con,de}structor
1343 for a class with virtual bases.
1344
1345 2024-10-02 Richard Biener <[email protected]>
1346
1347 * pt.cc (iterative_hash_template_arg): Use iterative_hash_hashval_t
1348 to hash TYPE_HASH.
1349
1350 2024-10-02 Richard Biener <[email protected]>
1351
1352 * pt.cc (iterative_hash_template_arg): Avoid using
1353 iterative_hash_object.
1354
1355 2024-10-01 Giuseppe D'Angelo <[email protected]>
1356
1357 * constraint.cc (diagnose_trait_expr): New diagnostic.
1358 * cp-trait.def (IS_VIRTUAL_BASE_OF): New builtin.
1359 * cp-tree.h (enum base_access_flags): Add a new flag to be
1360 able to request a search for a virtual base class.
1361 * cxx-pretty-print.cc (pp_cxx_userdef_literal): Update the
1362 list of GNU extensions to the grammar.
1363 * search.cc (struct lookup_base_data_s): Add a field to
1364 request searching for a virtual base class.
1365 (dfs_lookup_base): Add the ability to look for a virtual
1366 base class.
1367 (lookup_base): Forward the flag to dfs_lookup_base.
1368 * semantics.cc (trait_expr_value): Implement the builtin
1369 by calling lookup_base with the new flag.
1370 (finish_trait_expr): Handle the new builtin.
1371
1372 2024-09-30 Marek Polacek <[email protected]>
1373
1374 PR c++/109859
1375 * parser.cc (cp_parser_lambda_declarator_opt): Temporarily clear
1376 local_variables_forbidden_p.
1377 (cp_parser_placeholder_type_specifier): Turn an assert into an
1378 error.
1379
1380 2024-09-30 David Malcolm <[email protected]>
1381
1382 PR other/116613
1383 * pt.cc: Include "pretty-print-markup.h".
1384 (warn_spec_missing_attributes): Defer colorization choices by
1385 replacing printing to a pretty_printer * param with appending
1386 to a vec of strings. Replace pretty_printer with usage of
1387 pp_markup::comma_separated_quoted_strings and "%e".
1388
1389 2024-09-27 Nathaniel Shead <[email protected]>
1390
1391 PR c++/116160
1392 * name-lookup.cc (supplement_binding): Allow redeclaration via
1393 USING_DECL if not in class scope.
1394 (do_nonmember_using_decl): Remove function-scope exemption.
1395 (push_using_decl_bindings): Remove outdated comment.
1396
1397 2024-09-27 Nathaniel Shead <[email protected]>
1398
1399 PR c++/116748
1400 * name-lookup.cc (update_binding): Maintain USING_DECLs in the
1401 binding slots.
1402
1403 2024-09-27 Nathaniel Shead <[email protected]>
1404
1405 PR c++/116803
1406 * decl.cc (duplicate_decls): Propagate DECL_MODULE_PURVIEW_P and
1407 DECL_MODULE_IMPORT_P for template redeclarations.
1408
1409 2024-09-27 Marek Polacek <[email protected]>
1410
1411 PR c++/102594
1412 * init.cc (build_vec_init): Build up a CONSTRUCTOR to signal
1413 direct-initialization rather than a TREE_LIST.
1414
1415 2024-09-27 Arsen Arsenović <[email protected]>
1416
1417 PR c++/116793
1418 * coroutines.cc (await_statement_expander): Just process
1419 subtrees if encountering a CLEANUP_POINT_EXPR.
1420
1421 2024-09-27 Arsen Arsenović <[email protected]>
1422
1423 * coroutines.cc (co_await_get_resume_call): Return a tree
1424 directly, rather than a tree pointer.
1425 * cp-tree.h (co_await_get_resume_call): Adjust signature
1426 accordingly.
1427 * cvt.cc (convert_to_void): Do not alter CO_AWAIT_EXPRs when
1428 discarding them. Simplify handling implicit INDIRECT_REFs.
1429
1430 2024-09-27 Arsen Arsenović <[email protected]>
1431
1432 PR c++/116502
1433 * coroutines.cc (maybe_promote_temps): Convert temporary
1434 initializers to void without complaining.
1435
1436 2024-09-27 Nathaniel Shead <[email protected]>
1437
1438 * module.cc (has_definition): Use decl_maybe_constant_var
1439 instead of TREE_CONSTANT.
1440
1441 2024-09-27 Nathaniel Shead <[email protected]>
1442
1443 * name-lookup.cc (check_can_export_using_decl): Handle internal
1444 linkage GM entities (but ignore in header units); use linkage
1445 of entity ultimately referred to by aliases.
1446
1447 2024-09-27 Nathaniel Shead <[email protected]>
1448
1449 * name-lookup.cc (maybe_record_mergeable_decl): Use decl_linkage
1450 instead of ad-hoc checks.
1451
1452 2024-09-27 Nathaniel Shead <[email protected]>
1453
1454 * name-lookup.cc (do_namespace_alias): Propagate TREE_PUBLIC for
1455 namespace aliases.
1456 * tree.cc (decl_linkage): Update rules for C++11.
1457
1458 2024-09-26 Marek Polacek <[email protected]>
1459
1460 PR c++/116731
1461 * parser.cc (warn_for_range_copy): Check if TYPE is trivially
1462 constructible, not copyable.
1463
1464 2024-09-25 Marek Polacek <[email protected]>
1465
1466 * coroutines.cc (build_co_await): Use TARGET_EXPR accessors.
1467 (finish_co_yield_expr): Likewise.
1468 (register_awaits): Likewise.
1469 (tmp_target_expr_p): Likewise.
1470 (flatten_await_stmt): Likewise.
1471 * error.cc (dump_expr): Likewise.
1472 * semantics.cc (finish_omp_target_clauses): Likewise.
1473 * tree.cc (bot_manip): Likewise.
1474 (cp_tree_equal): Likewise.
1475 * typeck.cc (cxx_mark_addressable): Likewise.
1476 (cp_build_compound_expr): Likewise.
1477 (cp_build_modify_expr): Likewise.
1478 (check_return_expr): Likewise.
1479
1480 2024-09-25 Tobias Burnus <[email protected]>
1481
1482 * parser.cc (cp_parser_omp_declare_target): Set target-used bit
1483 in omp_requires_mask.
1484
1485 2024-09-24 Jakub Jelinek <[email protected]>
1486
1487 PR c++/107637
1488 * cp-tree.h: Implement C++23 P2718R0 - Wording for P2644R1 Fix for
1489 Range-based for Loop.
1490 (cp_convert_omp_range_for): Add bool tmpl_p argument.
1491 (find_range_for_decls): Declare.
1492 * parser.cc (cp_convert_range_for): For flag_range_for_ext_temps call
1493 push_stmt_list () before cp_finish_decl for range_temp and save it
1494 temporarily to FOR_INIT_STMT.
1495 (cp_convert_omp_range_for): Add tmpl_p argument. If set, remember
1496 DECL_NAME of range_temp and for cp_finish_decl call restore it before
1497 clearing it again, if unset, don't adjust DECL_NAME of range_temp at
1498 all.
1499 (cp_parser_omp_loop_nest): For flag_range_for_ext_temps range for add
1500 CLEANUP_POINT_EXPR around sl. Call find_range_for_decls and adjust
1501 DECL_NAMEs for range fors if not processing_template_decl. Adjust
1502 cp_convert_omp_range_for caller. Remove superfluous backslash at the
1503 end of line.
1504 * decl.cc (initialize_local_var): For flag_range_for_ext_temps
1505 temporarily clear stmts_are_full_exprs_p rather than set for
1506 for_range__identifier decls.
1507 * call.cc (extend_ref_init_temps): For flag_range_for_ext_temps return
1508 init early for for_range__identifier decls.
1509 * semantics.cc (find_range_for_decls): New function.
1510 (finish_for_stmt): Use it. For flag_range_for_ext_temps if
1511 cp_convert_range_for set FOR_INIT_STMT, pop_stmt_list it and wrap
1512 into CLEANUP_POINT_EXPR.
1513 * pt.cc (tsubst_omp_for_iterator): Adjust tsubst_omp_for_iterator
1514 caller.
1515 (tsubst_stmt) <case OMP_FOR>: For flag_range_for_ext_temps if there
1516 are any range fors in the loop nest, add push_stmt_list starting
1517 before the initializations, pop_stmt_list it after the body and wrap
1518 into CLEANUP_POINT_EXPR. Change DECL_NAME of range for temps from
1519 NULL to for_range_identifier.
1520
1521 2024-09-24 Nina Dinka Ranns <[email protected]>
1522
1523 PR c++/116490
1524 * contracts.cc (build_contract_condition_function): added
1525 a check for comdat group of the guarded function. If set,
1526 the condition check function is added to the same comdat
1527 group.
1528
1529 2024-09-24 Tobias Burnus <[email protected]>
1530
1531 * parser.cc (cp_parser_omp_requires): Handle self_maps clause.
1532
1533 2024-09-23 Marek Polacek <[email protected]>
1534
1535 PR c++/116798
1536 * parser.cc (cp_parser_parameter_declaration): Detect an explicit
1537 object parameter in a requires expression.
1538
1539 2024-09-23 Simon Martin <[email protected]>
1540
1541 PR c++/109790
1542 PR c++/100632
1543 * mangle.cc (write_member_name): Handle members whose type is an
1544 anonymous union member. Write missing "on" marker for operators
1545 when ABI version is at least 16.
1546
1547 2024-09-23 Simon Martin <[email protected]>
1548
1549 PR c++/116722
1550 * constexpr.cc (cxx_bind_parameters_in_call): Leave early for
1551 {con,de}structors of classes with virtual bases.
1552
1553 2024-09-20 David Malcolm <[email protected]>
1554
1555 PR other/116613
1556 * cp-tree.h (cxx_print_error_function): Convert first param
1557 from diagnostic_context * to diagnostic_text_output_format &.
1558 * error.cc: Include "diagnostic-format-text.h".
1559 (cxx_initialize_diagnostics): Update for renamings.
1560 (cxx_print_error_function): Convert first param from
1561 diagnostic_context * to diagnostic_text_output_format & and update
1562 accordingly
1563 (cp_diagnostic_starter): Rename to...
1564 (cp_diagnostic_text_starter): ...this. Convert first
1565 param from diagnostic_context * to diagnostic_text_output_format &
1566 and update accordingly.
1567 (cp_print_error_function): Likewise.
1568 (print_instantiation_full_context): Likewise.
1569 (print_instantiation_partial_context_line): Likewise.
1570 (print_instantiation_partial_context): Likewise.
1571 (maybe_print_instantiation_context): Likewise.
1572 (maybe_print_constexpr_context): Likewise.
1573 (print_location): Likewise.
1574 (print_constrained_decl_info): Likewise.
1575 (print_concept_check_info): Likewise.
1576 (print_constraint_context_head): Likewise.
1577 (print_requires_expression_info): Likewise.
1578 (maybe_print_single_constraint_context): Likewise.
1579
1580 2024-09-20 Patrick Palka <[email protected]>
1581
1582 DR 2789
1583 * call.cc (cand_parms_match): Check for matching class contexts
1584 even in the reversed case.
1585
1586 2024-09-20 Patrick Palka <[email protected]>
1587
1588 PR c++/116492
1589 DR 2789
1590 * call.cc (object_parms_correspond): Remove.
1591 (cand_parms_match): Return false for member functions that come
1592 from different classes. Adjust call to object_parms_correspond.
1593 (joust): Update comment for the non-template "more constrained"
1594 case.
1595
1596 2024-09-20 Patrick Palka <[email protected]>
1597
1598 DR 2273
1599 * call.cc (joust): Restrict inheritedness tiebreaker to
1600 constructors.
1601
1602 2024-09-20 Iain Sandoe <[email protected]>
1603
1604 * coroutines.cc (coro_build_artificial_var_with_dve): New.
1605 (coro_build_and_push_artificial_var): New.
1606 (coro_build_and_push_artificial_var_with_dve): New.
1607 (analyze_fn_parms): Ensure that frame entries cannot clash
1608 with local variables.
1609 (build_coroutine_frame_delete_expr): Amend comment.
1610 (cp_coroutine_transform::build_ramp_function): Rework to
1611 avoid manual management of variables and scopes.
1612
1613 2024-09-19 Marek Polacek <[email protected]>
1614
1615 PR c++/116162
1616 * class.cc (check_bases_and_members): Don't set DECL_DELETED_FN here,
1617 leave it to defaulted_late_check.
1618 * cp-tree.h (maybe_delete_defaulted_fn): Declare.
1619 (defaulted_late_check): Add a tristate parameter.
1620 * method.cc (maybe_delete_defaulted_fn): New.
1621 (defaulted_late_check): Add a tristate parameter. Call
1622 maybe_delete_defaulted_fn instead of giving an error.
1623
1624 2024-09-18 Patrick Palka <[email protected]>
1625
1626 PR c++/116714
1627 PR c++/107390
1628 * pt.cc (dependent_opaque_alias_p): Also return true for a
1629 decltype(lambda) alias.
1630
1631 2024-09-18 Jason Merrill <[email protected]>
1632
1633 * call.cc (do_warn_dangling_reference): Return temporary
1634 instead of the call it's passed to.
1635 (maybe_warn_dangling_reference): Adjust diagnostic.
1636
1637 2024-09-18 Jason Merrill <[email protected]>
1638
1639 PR c++/115361
1640 * call.cc (do_warn_dangling_reference): Check is_empty_class.
1641
1642 2024-09-17 Marek Polacek <[email protected]>
1643
1644 PR c++/116741
1645 * constexpr.cc (cxx_eval_constant_expression) <case CONVERT_EXPR>: If
1646 the result of build_fold_indirect_ref is a COMPONENT_REF, use its op1.
1647 Check DECL_P before calling inform.
1648
1649 2024-09-17 Marek Polacek <[email protected]>
1650
1651 PR c++/116676
1652 * constexpr.cc (maybe_warn_about_constant_value): Check DECL_NAME.
1653
1654 2024-09-15 Jason Merrill <[email protected]>
1655
1656 * parser.cc (cp_parser_unary_expression) [RID_EXTENSION]: Also
1657 suppress -Wconditionally-supported.
1658
1659 2024-09-15 Jason Merrill <[email protected]>
1660
1661 * call.cc (convert_like_internal) [ck_user]: Use iloc_sentinel.
1662
1663 2024-09-15 Iain Sandoe <[email protected]>
1664
1665 PR c++/115905
1666 * coroutines.cc (struct coro_aw_data): Add a member for the
1667 restart dispatch label.
1668 (expand_one_await_expression): Rework to modernise and to
1669 handle the boolean await_suspend() case.
1670 (build_actor_fn): Rework the dispatcher and allow for a jump
1671 back to the dispatcher.
1672
1673 2024-09-14 Jason Merrill <[email protected]>
1674
1675 * tree.cc (handle_init_priority_attribute): Check
1676 in_system_header_at.
1677
1678 2024-09-14 Simon Martin <[email protected]>
1679
1680 PR c++/116681
1681 * name-lookup.cc (qualified_namespace_lookup): Use an
1682 auto_cond_timer instead of using timevar_start and timevar_stop.
1683
1684 2024-09-13 Jason Merrill <[email protected]>
1685
1686 PR c++/116696
1687 * constexpr.cc (explain_invalid_constexpr_fn): When
1688 -fimplicit-constexpr, also explain inline functions, and point out
1689 non-inline functions.
1690
1691 2024-09-13 Jakub Jelinek <[email protected]>
1692
1693 PR c++/116678
1694 * optimize.cc: Include decl.h.
1695 (maybe_thunk_body): Temporarily change deprecated_state to
1696 UNAVAILABLE_DEPRECATED_SUPPRESS.
1697
1698 2024-09-12 Jonathan Wakely <[email protected]>
1699
1700 PR c++/116673
1701 * semantics.cc (finish_builtin_launder): Diagnose function
1702 pointers and cv void pointers.
1703
1704 2024-09-12 Patrick Palka <[email protected]>
1705
1706 PR c++/116418
1707 * tree.cc (strip_typedefs_expr) <case STATEMENT_LIST>: Replace
1708 this error path with ...
1709 <case STMT_EXPR>: ... this, returning the original tree.
1710
1711 2024-09-12 Jakub Jelinek <[email protected]>
1712
1713 PR c++/116636
1714 * method.cc: Include decl.h.
1715 (use_thunk): Temporarily change deprecated_state to
1716 UNAVAILABLE_DEPRECATED_SUPPRESS.
1717
1718 2024-09-12 Marek Polacek <[email protected]>
1719
1720 PR c++/96097
1721 * pt.cc (coerce_template_template_parm): Increment
1722 processing_template_decl before calling tsubst.
1723
1724 2024-09-12 Simon Martin <[email protected]>
1725
1726 PR c++/116323
1727 * search.cc (get_parent_with_private_access): Only call access_in_type
1728 for RECORD_OR_UNION_TYPE_P base BINFOs.
1729
1730 2024-09-12 Nathaniel Shead <[email protected]>
1731
1732 PR c++/116496
1733 * module.cc (trees_in::decl_value): Don't call
1734 set_defining_module_for_partial_spec here.
1735 (depset::hash::add_partial_entities): Clarity assertions.
1736 * pt.cc (add_mergeable_specialization): Always call
1737 set_defining_module_for_partial_spec when adding a partial spec.
1738
1739 2024-09-11 Alex Coplan <[email protected]>
1740
1741 PR libstdc++/116140
1742 * semantics.cc (anotate_saver): New. Use it ...
1743 (maybe_convert_cond): ... here, to ensure any ANNOTATE_EXPRs
1744 remain the outermost expression(s) of the condition.
1745
1746 2024-09-10 Jakub Jelinek <[email protected]>
1747
1748 PR c++/116449
1749 * typeck.cc (get_member_function_from_ptrfunc): Use save_expr
1750 on instance_ptr and function even if it doesn't have side-effects,
1751 as long as it isn't a decl.
1752
1753 2024-09-10 Marek Polacek <[email protected]>
1754
1755 PR c++/116369
1756 * call.cc (set_up_extended_ref_temp): Don't mark a temporary
1757 TREE_READONLY if its type is TYPE_HAS_MUTABLE_P.
1758
1759 2024-09-09 David Malcolm <[email protected]>
1760
1761 * constexpr.cc (constexpr_error): Update for renaming of
1762 diagnostic_info field.
1763 * cp-tree.h (pedwarn_cxx98): Use "diagnostic_option_id" rather
1764 than "int".
1765 * error.cc (cp_adjust_diagnostic_info): Update for renaming of
1766 diagnostic_info field.
1767 (pedwarn_cxx98): Use "diagnostic_option_id option_id" rather than
1768 "int opt". Update for renaming of diagnostic_info field.
1769 (diagnostic_set_info): Likewise.
1770
1771 2024-09-09 David Malcolm <[email protected]>
1772
1773 PR other/116613
1774 * error.cc (cxx_initialize_diagnostics): Rename
1775 diagnostic_context's "printer" field to "m_printer".
1776 (cxx_print_error_function): Likewise.
1777 (cp_diagnostic_starter): Likewise.
1778 (cp_print_error_function): Likewise.
1779 (print_instantiation_full_context): Likewise.
1780 (print_instantiation_partial_context_line): Likewise.
1781 (maybe_print_constexpr_context): Likewise.
1782 (print_location): Likewise.
1783 (print_constrained_decl_info): Likewise.
1784 (print_concept_check_info): Likewise.
1785 (print_constraint_context_head): Likewise.
1786 (print_requires_expression_info): Likewise.
1787 * module.cc (noisy_p): Likewise.
1788
1789 2024-09-07 Jason Merrill <[email protected]>
1790
1791 * decl.cc (check_redeclaration_exception_specification): Remove
1792 OPT_Wsystem_headers from pedwarn when the old declaration is
1793 in a system header. Also check std namespace.
1794
1795 2024-09-07 Patrick Palka <[email protected]>
1796
1797 PR c++/116567
1798 * pt.cc (coerce_template_parms): Set tf_partial when substituting
1799 into a default template argument in a template context.
1800 (build_extra_args): Set TREE_STATIC on the deferred args if this
1801 is a partial substitution.
1802 (add_extra_args): Check TREE_STATIC instead of dependence of args.
1803 Adjust merging behavior in that case.
1804 (tsubst_lammda_expr): Check for tf_partial instead of dependence
1805 of args when determining whether to defer substitution.
1806 (tsubst_expr) <case LAMBDA_EXPR>: Remove tf_partial early exit.
1807
1808 2024-09-06 Jakub Jelinek <[email protected]>
1809
1810 PR c++/115769
1811 * cp-tree.h: Partially implement CWG 2867 - Order of initialization
1812 for structured bindings.
1813 (cp_finish_decomp): Add TEST_P argument defaulted to false.
1814 * decl.cc (initialize_local_var): Add DECOMP argument, if true,
1815 don't build cleanup and temporarily override stmts_are_full_exprs_p
1816 to 0 rather than 1. Formatting fix.
1817 (cp_finish_decl): Invoke cp_finish_decomp for structured bindings
1818 here, first with test_p. For automatic structured binding bases
1819 if the test cp_finish_decomp returned true wrap the initialization
1820 together with what non-test cp_finish_decomp emits with a
1821 CLEANUP_POINT_EXPR, and if there are any CLEANUP_STMTs needed, emit
1822 them around the whole CLEANUP_POINT_EXPR with guard variables for the
1823 cleanups. Call cp_finish_decomp using RAII if not called with
1824 decomp != NULL otherwise.
1825 (cp_finish_decomp): Add TEST_P argument, change return type from
1826 void to bool, if TEST_P is true, return true instead of emitting
1827 actual code for the tuple case, otherwise return false.
1828 * parser.cc (cp_convert_range_for): Don't call cp_finish_decomp
1829 after cp_finish_decl.
1830 (cp_parser_decomposition_declaration): Set DECL_DECOMP_BASE
1831 before cp_finish_decl call. Don't call cp_finish_decomp after
1832 cp_finish_decl.
1833 (cp_finish_omp_range_for): Don't call cp_finish_decomp after
1834 cp_finish_decl.
1835 * pt.cc (tsubst_stmt): Likewise.
1836
1837 2024-09-06 Jason Merrill <[email protected]>
1838
1839 PR c++/46457
1840 PR c++/81665
1841 * cp-objcp-common.h (cp_objcp_attribute_table): Add
1842 c_common_clang_attribute_table.
1843
1844 2024-09-05 Marek Polacek <[email protected]>
1845
1846 PR c++/116606
1847 * decl2.cc (mark_vtable_entries): Temporarily override deprecated_state to
1848 UNAVAILABLE_DEPRECATED_SUPPRESS. Remove a warning_sentinel.
1849
1850 2024-09-05 Iain Sandoe <[email protected]>
1851
1852 * coroutines.cc
1853 (cp_coroutine_transform::build_ramp_function): Separate the
1854 build of promise constructor and destructor. When evaluating
1855 the constructor, check that build_special_member_call returns
1856 an expression with side effects before adding it.
1857
1858 2024-09-05 Patrick Palka <[email protected]>
1859
1860 PR c++/113063
1861 * name-lookup.cc (local_state_t): Clear and restore
1862 cp_noexcept_operand as well.
1863
1864 2024-09-05 Marek Polacek <[email protected]>
1865
1866 PR c++/116239
1867 * cp-tree.h (validate_constexpr_redeclaration): Declare.
1868 * decl.cc (validate_constexpr_redeclaration): No longer static.
1869 * name-lookup.cc (push_local_extern_decl_alias): Call
1870 validate_constexpr_redeclaration.
1871
1872 2024-09-05 Nathaniel Shead <[email protected]>
1873
1874 * class.cc (add_method): Add missing auto_diagnostic_group.
1875 (handle_using_decl): Likewise.
1876 (maybe_warn_about_overly_private_class): Likewise.
1877 (check_field_decl): Likewise.
1878 (check_field_decls): Likewise.
1879 (resolve_address_of_overloaded_function): Likewise.
1880 (note_name_declared_in_class): Likewise.
1881 * constraint.cc (associate_classtype_constraints): Likewise.
1882 (diagnose_trait_expr): Clean up whitespace.
1883 * coroutines.cc (find_coro_traits_template_decl): Add missing
1884 auto_diagnostic_group.
1885 (coro_promise_type_found_p): Likewise.
1886 (coro_diagnose_throwing_fn): Likewise.
1887 * cvt.cc (build_expr_type_conversion): Likewise.
1888 * decl.cc (validate_constexpr_redeclaration): Likewise.
1889 (duplicate_function_template_decls): Likewise.
1890 (duplicate_decls): Likewise.
1891 (lookup_label_1): Likewise.
1892 (check_previous_goto_1): Likewise.
1893 (check_goto_1): Likewise.
1894 (make_typename_type): Likewise.
1895 (make_unbound_class_template): Likewise.
1896 (check_tag_decl): Likewise.
1897 (start_decl): Likewise.
1898 (maybe_commonize_var): Likewise.
1899 (check_for_uninitialized_const_var): Likewise.
1900 (reshape_init_class): Likewise.
1901 (check_initializer): Likewise.
1902 (cp_finish_decl): Likewise.
1903 (find_decomp_class_base): Likewise.
1904 (cp_finish_decomp): Likewise.
1905 (expand_static_init): Likewise.
1906 (grokfndecl): Likewise.
1907 (grokdeclarator): Likewise.
1908 (check_elaborated_type_specifier): Likewise.
1909 (lookup_and_check_tag): Likewise.
1910 (xref_tag): Likewise.
1911 (cxx_simulate_enum_decl): Likewise.
1912 (finish_function): Likewise.
1913 * decl2.cc (check_classfn): Likewise.
1914 (record_mangling): Likewise.
1915 (mark_used): Likewise.
1916 * error.cc (qualified_name_lookup_error): Likewise.
1917 * except.cc (build_throw): Likewise.
1918 * init.cc (get_nsdmi): Likewise.
1919 (diagnose_uninitialized_cst_or_ref_member_1): Likewise.
1920 (warn_placement_new_too_small): Likewise.
1921 (build_new_1): Likewise.
1922 (build_vec_delete_1): Likewise.
1923 (build_delete): Likewise.
1924 * lambda.cc (add_capture): Likewise.
1925 (add_default_capture): Likewise.
1926 * lex.cc (unqualified_fn_lookup_error): Likewise.
1927 * method.cc (synthesize_method): Likewise.
1928 (defaulted_late_check): Likewise.
1929 * module.cc (trees_in::is_matching_decl): Likewise.
1930 (trees_in::read_enum_def): Likewise.
1931 (module_state::check_not_purview): Likewise.
1932 (module_state::deferred_macro): Likewise.
1933 (module_state::read_config): Likewise.
1934 (module_state::check_read): Likewise.
1935 (declare_module): Likewise.
1936 (init_modules): Likewise.
1937 * name-lookup.cc (diagnose_name_conflict): Likewise.
1938 (lookup_using_decl): Likewise.
1939 (set_decl_namespace): Likewise.
1940 (finish_using_directive): Likewise.
1941 (push_namespace): Likewise.
1942 (add_imported_namespace): Likewise.
1943 * parser.cc (cp_parser_check_for_definition_in_return_type): Likewise.
1944 (cp_parser_userdef_numeric_literal): Likewise.
1945 (cp_parser_nested_name_specifier_opt): Likewise.
1946 (cp_parser_new_expression): Likewise.
1947 (cp_parser_binary_expression): Likewise.
1948 (cp_parser_lambda_introducer): Likewise.
1949 (cp_parser_module_declaration): Likewise.
1950 (cp_parser_import_declaration): Likewise, removing gotos to
1951 support this.
1952 (cp_parser_declaration): Add missing auto_diagnostic_group.
1953 (cp_parser_decl_specifier_seq): Likewise.
1954 (cp_parser_template_id): Likewise.
1955 (cp_parser_template_name): Likewise.
1956 (cp_parser_explicit_specialization): Likewise.
1957 (cp_parser_placeholder_type_specifier): Likewise.
1958 (cp_parser_elaborated_type_specifier): Likewise.
1959 (cp_parser_enum_specifier): Likewise.
1960 (cp_parser_asm_definition): Likewise.
1961 (cp_parser_init_declarator): Likewise.
1962 (cp_parser_direct_declarator): Likewise.
1963 (cp_parser_class_head): Likewise.
1964 (cp_parser_member_declaration): Likewise.
1965 (cp_parser_lookup_name): Likewise.
1966 (cp_parser_explicit_template_declaration): Likewise.
1967 (cp_parser_check_class_key): Likewise.
1968 * pt.cc (maybe_process_partial_specialization): Likewise.
1969 (determine_specialization): Likewise.
1970 (check_for_bare_parameter_packs): Likewise.
1971 (check_template_shadow): Likewise.
1972 (process_partial_specialization): Likewise.
1973 (push_template_decl): Likewise.
1974 (redeclare_class_template): Likewise.
1975 (convert_nontype_argument_function): Likewise.
1976 (check_valid_ptrmem_cst_expr): Likewise.
1977 (convert_nontype_argument): Likewise.
1978 (convert_template_argument): Likewise.
1979 (coerce_template_parms): Likewise.
1980 (tsubst_qualified_id): Likewise.
1981 (tsubst_expr): Likewise.
1982 (most_specialized_partial_spec): Likewise.
1983 (do_class_deduction): Likewise.
1984 (do_auto_deduction): Likewise.
1985 * search.cc (lookup_member): Likewise.
1986 * semantics.cc (finish_non_static_data_member): Likewise.
1987 (process_outer_var_ref): Likewise.
1988 (finish_id_expression_1): Likewise.
1989 (finish_offsetof): Likewise.
1990 (omp_reduction_lookup): Likewise.
1991 (finish_omp_clauses): Likewise.
1992 * tree.cc (check_abi_tag_redeclaration): Likewise.
1993 (check_abi_tag_args): Likewise.
1994 * typeck.cc (invalid_nonstatic_memfn_p): Likewise.
1995 (complain_about_unrecognized_member): Likewise.
1996 (finish_class_member_access_expr): Likewise.
1997 (error_args_num): Likewise.
1998 (warn_for_null_address): Likewise.
1999 (cp_build_binary_op): Likewise.
2000 (build_x_unary_op): Likewise.
2001 (cp_build_unary_op): Likewise.
2002 (build_static_cast): Likewise.
2003 (cp_build_modify_expr): Likewise.
2004 (get_delta_difference): Likewise.
2005 (convert_for_assignment): Widen scope of auto_diagnostic_group.
2006 (check_return_expr): Add missing auto_diagnostic_group.
2007 * typeck2.cc (cxx_incomplete_type_diagnostic): Likewise.
2008
2009 2024-09-04 Marek Polacek <[email protected]>
2010
2011 * pt.cc (coerce_template_template_parm): Return bool instead of int.
2012
2013 2024-09-04 Marek Polacek <[email protected]>
2014
2015 PR c++/113108
2016 * pt.cc (resolve_overloaded_unification): Call
2017 maybe_instantiate_noexcept.
2018
2019 2024-09-03 Jason Merrill <[email protected]>
2020
2021 * parser.cc (cp_nth_tokens_can_be_std_attribute_p): Don't check
2022 cxx_dialect.
2023 * error.cc (maybe_warn_cpp0x): Only complain about C++11 attributes
2024 if pedantic.
2025
2026 2024-09-03 David Malcolm <[email protected]>
2027
2028 * error.cc (type_to_string): Prefix all output_buffer fields with
2029 "m_".
2030 (append_formatted_chunk): Likewise. Rename "chunk_info" to
2031 "pp_formatted_chunks" and field cur_chunk_array with
2032 m_cur_formatted_chunks.
2033
2034 2024-09-02 Richard Sandiford <[email protected]>
2035
2036 * pt.cc (tsubst_stmt): Rename ASM_INPUT_P to ASM_BASIC_P.
2037 * parser.cc (cp_parser_asm_definition): Likewise.
2038
2039 2024-08-31 Iain Sandoe <[email protected]>
2040
2041 * coroutines.cc (coro_build_frame_access_expr): New.
2042 (transform_await_expr): Use coro_build_frame_access_expr.
2043 (transform_local_var_uses): Likewise.
2044 (build_actor_fn): Likewise.
2045 (build_destroy_fn): Likewise.
2046 (cp_coroutine_transform::build_ramp_function): Likewise.
2047
2048 2024-08-30 Jason Merrill <[email protected]>
2049
2050 * decl2.cc (c_parse_final_cleanups): Also check
2051 DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION.
2052
2053 2024-08-30 Jakub Jelinek <[email protected]>
2054
2055 PR c++/110345
2056 * parser.cc (make_array_declarator): Add STD_ATTRS argument, set
2057 declarator->std_attributes to it.
2058 (cp_parser_new_type_id): Warn on non-ignored std_attributes on the
2059 array declarator which is being omitted.
2060 (cp_parser_direct_new_declarator): Parse standard attributes after
2061 closing square bracket, pass it to make_array_declarator.
2062 (cp_parser_direct_declarator): Pass std_attrs to make_array_declarator
2063 instead of setting declarator->std_attributes manually.
2064
2065 2024-08-29 David Malcolm <[email protected]>
2066
2067 * error.cc: Include "make-unique.h".
2068 (deferred_printed_type::m_buffer_ptr): Replace with...
2069 (deferred_printed_type::m_printed_text): ...this and...
2070 (deferred_printed_type::m_token_list): ...this.
2071 (deferred_printed_type::deferred_printed_type): Update ctors for
2072 above changes.
2073 (deferred_printed_type::set_text_for_token_list): New.
2074 (append_formatted_chunk): Pass chunk_obstack to
2075 append_formatted_chunk.
2076 (add_quotes): Delete.
2077 (cxx_format_postprocessor::handle): Reimplement to call
2078 deferred_printed_type::set_text_for_token_list, rather than store
2079 buffer pointers.
2080 (defer_phase_2_of_type_diff): Replace param "buffer_ptr"
2081 with "formatted_token_list". Reimplement by storing
2082 a pointer to formatted_token_list so that the postprocessor can
2083 put its text there.
2084 (cp_printer): Convert param "buffer_ptr" to
2085 "formatted_token_list". Update calls to
2086 defer_phase_2_of_type_diff accordingly.
2087
2088 2024-08-29 David Malcolm <[email protected]>
2089
2090 * error.cc: Include "pretty-print-format-impl.h".
2091
2092 2024-08-28 Marek Polacek <[email protected]>
2093
2094 PR c++/116476
2095 * call.cc (maybe_init_list_as_array): Try convert_like and see if it
2096 worked.
2097
2098 2024-08-28 Marek Polacek <[email protected]>
2099
2100 PR c++/116424
2101 * typeck2.cc (process_init_constructor_record): Move the clearing of
2102 TARGET_EXPR_ELIDING_P down.
2103
2104 2024-08-28 Jason Merrill <[email protected]>
2105
2106 * parser.cc (cp_parser_simple_type_specifier): Use
2107 -Wc++20-extensions for auto parameter pedwarn.
2108 * pt.cc (do_decl_instantiation, do_type_instantiation): Use
2109 -Wc++11-extensions for 'extern template'.
2110
2111 2024-08-27 Arsen Arsenović <[email protected]>
2112
2113 PR c++/109867
2114 * coroutines.cc (expand_one_await_expression): Replace uses of
2115 build_case_label with finish_case_label.
2116 (build_actor_fn): Ditto.
2117 (create_anon_label_with_ctx): Remove now-unused function.
2118
2119 2024-08-27 Simon Martin <[email protected]>
2120
2121 PR c++/105483
2122 * parser.cc (cp_parser_expression_statement): Use %qE instead of
2123 incorrect %<%T::%D%>. Skip to end of statement and return
2124 error_mark_node in case of error.
2125
2126 2024-08-27 Jonathan Wakely <[email protected]>
2127
2128 * cxxapi-data.csv: Add C++20 and C++23 names from <chrono>,
2129 <format>, <generator>, <iterator>, <print>, and <stdfloat>.
2130 Set cxx11 dialect for std::ignore in <tuple>. Uncomment
2131 atomic_flag functions from <atomic>.
2132 * std-name-hint.gperf: Regenerate.
2133 * std-name-hint.h: Regenerate.
2134
2135 2024-08-27 Jonathan Wakely <[email protected]>
2136
2137 * gen-cxxapi-file.py: Fix copyright dates in generated output.
2138
2139 2024-08-27 Iain Sandoe <[email protected]>
2140
2141 PR c++/116482
2142 * coroutines.cc
2143 (coro_build_actor_or_destroy_function): Make the parameter
2144 decls DECL_ARTIFICIAL.
2145
2146 2024-08-27 Nathaniel Shead <[email protected]>
2147
2148 PR c++/99243
2149 * module.cc (module_state::set_filename): Handle repeated calls
2150 to 'set_filename' as long as the CMI path matches.
2151 (maybe_translate_include): Adjust comment.
2152
2153 2024-08-27 Nathaniel Shead <[email protected]>
2154
2155 PR c++/110980
2156 * module.cc (maybe_translate_include): Clean up.
2157
2158 2024-08-26 Arsen Arsenović <[email protected]>
2159
2160 PR c++/113457
2161 * coroutines.cc (struct coroutine_info): Add integer field
2162 awaitable_number. This is a counter used for assigning unique
2163 names to awaitable temporaries.
2164 (get_awaitable_var): Use awaitable_number from coroutine_info
2165 instead of the static int awn.
2166
2167 2024-08-26 Simon Martin <[email protected]>
2168
2169 PR c++/115716
2170 * pt.cc (maybe_process_partial_specialization): Call
2171 redeclare_class_template.
2172
2173 2024-08-24 Iain Sandoe <[email protected]>
2174
2175 PR c++/110635
2176 * coroutines.cc
2177 (cp_coroutine_transform::wrap_original_function_body): Look through
2178 initial await target expressions to find the actual co_await_expr
2179 that we need to update.
2180
2181 2024-08-24 Iain Sandoe <[email protected]>
2182
2183 PR c++/102051
2184 * coroutines.cc
2185 (cp_coroutine_transform::build_ramp_function): Handle
2186 "throwing_cleanup" here instead of ...
2187 (cp_coroutine_transform::apply_transforms): ... here.
2188
2189 2024-08-24 Iain Sandoe <[email protected]>
2190
2191 PR c++/115908
2192 * coroutines.cc
2193 (cp_coroutine_transform::build_ramp_function): Rework the return
2194 value initialisation to initialise the return slot always from
2195 get_return_object, even if that implies carrying out conversions
2196 to do so.
2197
2198 2024-08-24 Iain Sandoe <[email protected]>
2199
2200 PR c++/109682
2201 * coroutines.cc
2202 (cp_coroutine_transform::build_ramp_function): Allow for cases where
2203 get_return_on_allocation_fail has a type convertible to the ramp
2204 return type.
2205
2206 2024-08-24 Iain Sandoe <[email protected]>
2207
2208 PR c++/100476
2209 * coroutines.cc
2210 (cp_coroutine_transform::build_ramp_function): Remove special
2211 handling of void get_return_object expressions.
2212
2213 2024-08-24 Iain Sandoe <[email protected]>
2214
2215 PR c++/113773
2216 * coroutines.cc
2217 (cp_coroutine_transform::build_ramp_function): Only cleanup the
2218 frame state on exceptions that occur before the initial await
2219 resume has begun.
2220
2221 2024-08-24 Iain Sandoe <[email protected]>
2222
2223 * call.cc (build_op_delete_call_1): Renamed and added a param
2224 to allow the caller to prioritize two argument usual deleters.
2225 (build_op_delete_call): New.
2226 (build_coroutine_op_delete_call): New.
2227 * coroutines.cc (coro_get_frame_dtor): Rename...
2228 (build_coroutine_frame_delete_expr):... to this; simplify to
2229 use build_op_delete_call for all cases.
2230 (build_actor_fn): Use revised frame delete function.
2231 (build_coroutine_frame_alloc_expr): New.
2232 (cp_coroutine_transform::complete_ramp_function): Rename...
2233 (cp_coroutine_transform::build_ramp_function): ... to this.
2234 Reorder code to carry out checks for prerequisites before the
2235 codegen. Split out the allocation/delete code.
2236 (cp_coroutine_transform::apply_transforms): Use revised name.
2237 * coroutines.h: Rename function.
2238 * cp-tree.h (build_coroutine_op_delete_call): New.
2239
2240 2024-08-24 Iain Sandoe <[email protected]>
2241 Arsen Arsenović <[email protected]>
2242
2243 * coroutines.cc (struct suspend_point_info, struct param_info,
2244 struct local_var_info, struct susp_frame_data,
2245 struct local_vars_frame_data): Move to coroutines.h.
2246 (build_actor_fn): Use start/finish function APIs.
2247 (build_destroy_fn): Likewise.
2248 (coro_build_actor_or_destroy_function): No longer mark the
2249 actor / destroyer as DECL_COROUTINE_P.
2250 (coro_rewrite_function_body): Use class members.
2251 (cp_coroutine_transform::wrap_original_function_body): Likewise.
2252 (build_ramp_function): Replace by...
2253 (cp_coroutine_transform::complete_ramp_function): ...this.
2254 (cp_coroutine_transform::cp_coroutine_transform): New.
2255 (cp_coroutine_transform::~cp_coroutine_transform): New
2256 (morph_fn_to_coro): Replace by...
2257 (cp_coroutine_transform::apply_transforms): ...this.
2258 (cp_coroutine_transform::finish_transforms): New.
2259 * cp-tree.h (morph_fn_to_coro): Remove.
2260 * decl.cc (emit_coro_helper): Remove.
2261 (finish_function): Revise handling of coroutine transforms.
2262 * coroutines.h: New file.
2263
2264 2024-08-24 Iain Sandoe <[email protected]>
2265
2266 * coroutines.cc (build_actor_fn): Arrange to apply any
2267 required parameter copy DTORs in reverse order to their
2268 creation.
2269 (coro_rewrite_function_body): Handle revised param uses.
2270 (morph_fn_to_coro): Split the ramp function completion
2271 into a separate function.
2272 (build_ramp_function): New.
2273
2274 2024-08-24 Iain Sandoe <[email protected]>
2275
2276 * coroutines.cc (build_co_await): Simplify checks for the cases that
2277 we need to materialise an awaiter.
2278
2279 2024-08-21 Iain Sandoe <[email protected]>
2280
2281 * coroutines.cc (split_coroutine_body_from_ramp): Check
2282 that the binding level is as expected before attempting
2283 to outline the function body.
2284
2285 2024-08-20 Nathaniel Shead <[email protected]>
2286
2287 * module.cc (module_state::write_begin): Return a boolean to
2288 indicate errors rather than just doing set_error().
2289 (finish_module_processing): Prevent emission of unnecessary
2290 errors; only indicate module writing occurred if write_begin
2291 succeeds.
2292
2293 2024-08-20 Jakub Jelinek <[email protected]>
2294
2295 PR c++/110345
2296 * decl.cc (grokdeclarator): Apply declarator->std_attributes
2297 for cdk_array to type, rather than chaining it to returned_attrs.
2298
2299 2024-08-20 Jakub Jelinek <[email protected]>
2300
2301 PR c++/110345
2302 * parser.cc (cp_parser_base_specifier): Parse standard attributes
2303 at the start and emit a warning if there are any non-ignored ones.
2304
2305 2024-08-20 Franciszek Witt <[email protected]>
2306
2307 PR c++/101232
2308 * parser.cc (cp_parser_postfix_expression): Commit to the
2309 parse in case we know its either a cast or invalid syntax.
2310 (cp_parser_braced_list): Add a heuristic to inform about
2311 missing comma or operator.
2312
2313 2024-08-20 Patrick Palka <[email protected]>
2314
2315 PR c++/101463
2316 * pt.cc (type_unification_real): Directly look for undeduced
2317 parameters in the default argument instead of doing a trial
2318 substitution.
2319
2320 2024-08-20 Nathaniel Shead <[email protected]>
2321
2322 PR c++/115020
2323 * module.cc (has_definition): Only force writing definitions for
2324 header_module_p.
2325
2326 2024-08-20 Nathaniel Shead <[email protected]>
2327
2328 PR c++/116403
2329 * pt.cc (deduction_guides_for): Use ANY_REACHABLE for lookup of
2330 deduction guides.
2331 * module.cc (depset::hash::add_deduction_guides): Likewise.
2332 (module_state::write_cluster): No longer override deduction
2333 guides as exported.
2334 * name-lookup.cc (name_lookup::search_namespace_only): Ignore
2335 visibility when LOOK_want::ANY_REACHABLE is specified.
2336 (check_module_override): Ignore visibility when checking for
2337 ambiguating deduction guides.
2338 * name-lookup.h (LOOK_want): New flag 'ANY_REACHABLE'.
2339
2340 2024-08-20 Nathaniel Shead <[email protected]>
2341
2342 PR c++/116382
2343 * cp-tree.h (get_template_parm_object): Add check_init param.
2344 * module.cc (trees_in::tree_node): Pass check_init=false when
2345 building NTTPs.
2346 * pt.cc (get_template_parm_object): Prevent cp_finish_decl from
2347 validating the initializer when check_init=false.
2348
2349 2024-08-20 Nathaniel Shead <[email protected]>
2350
2351 PR c++/116364
2352 * cp-tree.h (get_mergeable_specialization_flags): Adjust
2353 signature.
2354 * module.cc (trees_out::decl_value): Indicate whether this is a
2355 type or decl specialisation.
2356 * pt.cc (get_mergeable_specialization_flags): Match against the
2357 type of a non-decl specialisation.
2358 (add_mergeable_specialization): Use the already calculated spec
2359 instead of always adding decl to DECL_TEMPLATE_INSTANTIATIONS.
2360
2361 2024-08-19 Marek Polacek <[email protected]>
2362
2363 PR c++/115657
2364 * decl.cc (build_enumerator): Call maybe_fold_non_dependent_expr
2365 instead of fold_non_dependent_expr.
2366
2367 2024-08-19 Marek Polacek <[email protected]>
2368
2369 PR c++/116384
2370 * pt.cc (tsubst_expr) <case IMPLICIT_CONV_EXPR>: Bail if tsubst
2371 returns error_mark_node.
2372
2373 2024-08-16 Jakub Jelinek <[email protected]>
2374
2375 PR c++/110345
2376 * parser.cc (cp_parser_member_declaration): Call maybe_warn_extra_semi
2377 only if it is empty-declaration, if there are some tokens like
2378 attribute, pedwarn that the declaration doesn't declare anything.
2379
2380 2024-08-15 Patrick Palka <[email protected]>
2381
2382 PR c++/116320
2383 * semantics.cc (check_accessibility_of_qualified_id): Try
2384 currently_open_class when using the object type as the
2385 effective qualifying type.
2386
2387 2024-08-15 Patrick Palka <[email protected]>
2388
2389 PR c++/116327
2390 PR c++/104981
2391 PR c++/115550
2392 * coroutines.cc (morph_fn_to_coro): Use build_fold_indirect_ref
2393 instead of cp_build_fold_indirect_ref.
2394
2395 2024-08-14 Marek Polacek <[email protected]>
2396
2397 PR c++/116015
2398 * call.cc (convert_for_arg_passing): Don't set_target_expr_eliding
2399 when the TARGET_EXPR initializer is a CONSTRUCTOR.
2400
2401 2024-08-10 Patrick Palka <[email protected]>
2402
2403 PR c++/116276
2404 * call.cc (joust): Implement P2582R1 inherited vs non-inherited
2405 guide tiebreaker.
2406 * cp-tree.h (lang_decl_fn::context): Document usage in
2407 deduction_guide_p FUNCTION_DECLs.
2408 (inherited_guide_p): Declare.
2409 * pt.cc (inherited_guide_p): Define.
2410 (set_inherited_guide_context): Define.
2411 (alias_ctad_tweaks): Use set_inherited_guide_context.
2412 (inherited_ctad_tweaks): Recognize some inherited constructors
2413 whose scope is a TYPENAME_TYPE.
2414 (ctor_deduction_guides_for): For C++23 inherited CTAD, iterate
2415 over TYPE_FIELDS instead of CLASSTYPE_CONSTRUCTORS to recognize
2416 all inherited constructors.
2417
2418 2024-08-10 Patrick Palka <[email protected]>
2419
2420 * pt.cc (tsubst_friend_class): Simplify depth comparison test
2421 in the redeclaration code path to
2422 DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P. Clear the flag after
2423 partial instantiation here ...
2424 (tsubst_template_decl): ... instead of here.
2425
2426 2024-08-10 Patrick Palka <[email protected]>
2427
2428 * cp-tree.h (get_identifier_kind): Define.
2429 (IDENTIFIER_KEYWORD_P): Redefine in terms of get_identifier_kind.
2430 (IDENTIFIER_CDTOR_P): Likewise.
2431 (IDENTIFIER_CTOR_P): Likewise.
2432 (IDENTIFIER_DTOR_P): Likewise.
2433 (IDENTIFIER_ANY_OP_P): Likewise.
2434 (IDENTIFIER_OVL_OP_P): Likewise.
2435 (IDENTIFIER_ASSIGN_OP_P): Likewise.
2436 (IDENTIFIER_CONV_OP_P): Likewise.
2437 (IDENTIFIER_TRAIT_P): Likewise.
2438 * parser.cc (cp_lexer_peek_trait): Mark IDENTIFIER_TRAIT_P
2439 check UNLIKELY.
2440
2441 2024-08-09 Simon Martin <[email protected]>
2442
2443 PR c++/115806
2444 * decl.cc (start_enum): Only set OPAQUE_ENUM_P and
2445 ENUM_FIXED_UNDERLYING_TYPE_P when pushing a new tag.
2446
2447 2024-08-08 Nathaniel Shead <[email protected]>
2448
2449 PR c++/115062
2450 * class.cc (fixup_type_variants): Propagate TREE_ADDRESSABLE.
2451 (finish_struct_bits): Cleanup now that TREE_ADDRESSABLE is
2452 propagated by fixup_type_variants.
2453
2454 2024-08-08 Nathaniel Shead <[email protected]>
2455
2456 * module.cc (module_state::read_cluster): Assume header module
2457 declarations will require GM merging.
2458
2459 2024-08-08 Nathaniel Shead <[email protected]>
2460
2461 PR c++/115801
2462 * pt.cc (tsubst_friend_class): Return the type immediately when
2463 no tsubsting or name lookup is required.
2464
2465 2024-08-08 Nathaniel Shead <[email protected]>
2466
2467 PR c++/114950
2468 * module.cc (trees_out::decl_value): Stream bit indicating
2469 imported temploid friends early.
2470 (trees_in::decl_value): Use this bit with key_mergeable.
2471 (trees_in::key_mergeable): Allow merging attached declarations
2472 if they're imported temploid friends (which must be namespace
2473 scope).
2474 (module_state::read_cluster): Check for GM entities that may
2475 require merging even when importing from partitions.
2476 * name-lookup.cc (enum binding_slots): Adjust comment.
2477 (get_fixed_binding_slot): Always create partition slot.
2478 (name_lookup::search_namespace_only): Support binding vectors
2479 with both partition and GM entities to dedup.
2480 (walk_module_binding): Likewise.
2481 (name_lookup::adl_namespace_fns): Likewise.
2482 (set_module_binding): Likewise.
2483 (check_module_override): Use attachment of the decl when
2484 checking overrides rather than named_module_p.
2485 (lookup_imported_hidden_friend): Use partition slot for finding
2486 mergeable template bindings.
2487 * name-lookup.h (set_module_binding): Split mod_glob_flag
2488 parameter into separate global_p and partition_p params.
2489
2490 2024-08-08 Nathaniel Shead <[email protected]>
2491
2492 * module.cc (trees_in::read_enum_def): Clarify error.
2493
2494 2024-08-07 Patrick Palka <[email protected]>
2495
2496 PR c++/116064
2497 * error.cc (get_current_template): If the current scope is
2498 a partial specialization, return it instead of the primary
2499 template.
2500 * pt.cc (instantiate_class_template): Pass the partial
2501 specialization if any to maybe_diagnose_erroneous_template
2502 instead of the primary template.
2503
2504 2024-08-07 Julian Brown <[email protected]>
2505 Tobias Burnus <[email protected]>
2506
2507 * decl2.cc (tree-inline.h): Include.
2508 (static_init_fini_fns): Bump to four entries. Update comment.
2509 (start_objects, start_partial_init_fini_fn): Add 'omp_target'
2510 parameter. Support "declare target" decls. Update forward declaration.
2511 (emit_partial_init_fini_fn): Add 'host_fn' parameter. Return tree for
2512 the created function. Support "declare target".
2513 (OMP_SSDF_IDENTIFIER): New macro.
2514 (partition_vars_for_init_fini): Support partitioning "declare target"
2515 variables also.
2516 (generate_ctor_or_dtor_function): Add 'omp_target' parameter. Support
2517 "declare target" decls.
2518 (c_parse_final_cleanups): Support constructors/destructors on OpenMP
2519 offload targets.
2520
2521 2024-08-07 Jakub Jelinek <[email protected]>
2522
2523 PR c++/109126
2524 * decl.cc (grokvardecl): Implement CWG 2387 - Linkage of
2525 const-qualified variable template. Set TREE_PUBLIC on variable
2526 templates with const qualified types unless static is present.
2527
2528 2024-08-07 Simon Martin <[email protected]>
2529
2530 PR c++/111592
2531 * call.cc (build_over_call): Only error out if there's a single
2532 parameter of type A in a call to A::A(...).
2533
2534 2024-08-07 Jakub Jelinek <[email protected]>
2535
2536 PR c++/116175
2537 * pt.cc (apply_late_template_attributes): For function/method types
2538 call cp_build_type_attribute_variant on the non-dependent attributes.
2539 (rebuild_function_or_method_type): Add ARGS argument. Use
2540 apply_late_template_attributes rather than
2541 cp_build_type_attribute_variant.
2542 (maybe_rebuild_function_decl_type): Add ARGS argument, pass it to
2543 rebuild_function_or_method_type.
2544 (tsubst_function_decl): Adjust caller.
2545 (tsubst_function_type): Adjust rebuild_function_or_method_type caller.
2546
2547 2024-08-07 Nathaniel Shead <[email protected]>
2548
2549 PR c++/115231
2550 * error.cc (dump_function_decl): Add a space before '->' when
2551 printing deduction guides.
2552 * module.cc (depset::hash::add_binding_entity): Don't create
2553 bindings for guides here, only mark dependencies.
2554 (depset::hash::add_deduction_guides): New.
2555 (depset::hash::find_dependencies): Add deduction guide
2556 dependencies for a class template.
2557 (module_state::write_cluster): Always consider deduction guides
2558 as exported.
2559 * pt.cc (deduction_guides_for): Use 'lkp_iterator' instead of
2560 'ovl_iterator'.
2561
2562 2024-08-07 Nathaniel Shead <[email protected]>
2563
2564 * parser.cc (cp_parser_class_head): Clarify error message for
2565 explicit instantiations.
2566
2567 2024-08-07 Patrick Palka <[email protected]>
2568
2569 PR c++/116064
2570 * cp-tree.h (erroneous_templates_t): Declare.
2571 (erroneous_templates): Declare.
2572 (cp_seen_error): Declare.
2573 (seen_error): #define to cp_seen_error.
2574 * error.cc (get_current_template): Define.
2575 (relaxed_template_errors): Define.
2576 (cp_adjust_diagnostic_info): Define.
2577 (cp_seen_error): Define.
2578 (cxx_initialize_diagnostics): Set
2579 diagnostic_context::m_adjust_diagnostic_info.
2580 * module.cc (finish_module_processing): Don't write the
2581 module if it contains an erroneous template.
2582 * pt.cc (maybe_diagnose_erroneous_template): Define.
2583 (instantiate_class_template): Call it.
2584 (instantiate_decl): Likewise.
2585
2586 2024-08-06 Marek Polacek <[email protected]>
2587
2588 * constexpr.cc (cxx_eval_call_expression): Remove concept_check_p check.
2589 (cxx_eval_outermost_constant_expr): Likewise.
2590 * cp-gimplify.cc (cp_genericize_r) <case CALL_EXPR>: Likewise.
2591 * except.cc (check_noexcept_r): Likewise.
2592
2593 2024-08-06 Jason Merrill <[email protected]>
2594
2595 PR c++/116223
2596 * pt.cc (deducible_expression): Strip all IMPLICIT_CONV_EXPR.
2597 (unify): Likewise. Handle resulting function/addr mismatch.
2598
2599 2024-08-06 Jason Merrill <[email protected]>
2600
2601 PR c++/116223
2602 PR c++/112632
2603 * pt.cc (deducible_expression): Also look through
2604 IMPLICIT_CONV_EXPR_FORCED.
2605 (unify): Likewise.
2606
2607 2024-08-06 Jason Merrill <[email protected]>
2608
2609 PR c++/94568
2610 * init.cc (build_zero_init_1): Call cv_unqualified.
2611
2612 2024-08-06 Patrick Palka <[email protected]>
2613
2614 PR c++/96780
2615 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls
2616 to std::forward_like as well.
2617
2618 2024-08-06 Marek Polacek <[email protected]>
2619
2620 * constexpr.cc (cxx_eval_constant_expression): Don't call
2621 unpack_concept_check. Add a concept_check_p assert. Remove
2622 function_concept_p code.
2623 * constraint.cc (check_constraint_atom): Remove function concepts code.
2624 (unpack_concept_check): Remove.
2625 (get_concept_check_template): Remove Concepts TS code.
2626 (resolve_function_concept_overload): Remove.
2627 (resolve_function_concept_check): Remove.
2628 (resolve_concept_check): Remove Concepts TS code.
2629 (get_returned_expression): Remove.
2630 (get_variable_initializer): Remove.
2631 (get_concept_definition): Remove Concepts TS code.
2632 (normalize_concept_check): Likewise.
2633 (build_function_check): Remove.
2634 (build_variable_check): Remove.
2635 (build_standard_check): Use concept_definition_p instead of
2636 standard_concept_p.
2637 (build_concept_check): Remove variable_concept_p/function_concept_p
2638 code.
2639 (build_concept_id): Simplify.
2640 (build_type_constraint): Likewise.
2641 (placeholder_extract_concept_and_args): Likewise.
2642 (satisfy_nondeclaration_constraints): Likewise.
2643 (check_function_concept): Remove.
2644 (get_constraint_error_location): Remove Concepts TS code.
2645 * cp-tree.h (DECL_DECLARED_CONCEPT_P): Remove.
2646 (check_function_concept): Remove.
2647 (unpack_concept_check): Remove.
2648 (standard_concept_p): Remove.
2649 (variable_concept_p): Remove.
2650 (function_concept_p): Remove.
2651 (concept_definition_p): Simplify.
2652 (concept_check_p): Don't check for CALL_EXPR.
2653 * decl.cc (check_concept_refinement): Remove.
2654 (duplicate_decls): Remove check_concept_refinement code.
2655 (is_concept_var): Remove.
2656 (cp_finish_decl): Remove is_concept_var.
2657 (check_concept_fn): Remove.
2658 (grokfndecl): Give an error about function concepts not being supported
2659 anymore. Remove unused code.
2660 (grokvardecl): Give an error about variable concepts not being
2661 supported anymore.
2662 (finish_function): Remove DECL_DECLARED_CONCEPT_P code.
2663 * decl2.cc (min_vis_expr_r): Use concept_definition_p instead of
2664 standard_concept_p.
2665 (maybe_instantiate_decl): Remove DECL_DECLARED_CONCEPT_P check.
2666 (mark_used): Likewise.
2667 * error.cc (dump_simple_decl): Use concept_definition_p instead of
2668 standard_concept_p.
2669 (dump_function_decl): Remove DECL_DECLARED_CONCEPT_P code.
2670 (print_concept_check_info): Don't call unpack_concept_check. Simplify.
2671 * mangle.cc (write_type_constraint): Likewise.
2672 * parser.cc (cp_parser_nested_name_specifier_opt): Remove
2673 function_concept_p code. Only check concept_definition_p, not
2674 variable_concept_p/standard_concept_p.
2675 (add_debug_begin_stmt): Remove DECL_DECLARED_CONCEPT_P code.
2676 (cp_parser_template_declaration_after_parameters): Remove a stale
2677 comment.
2678 * pt.cc (check_explicit_specialization): Remove
2679 DECL_DECLARED_CONCEPT_P code.
2680 (process_partial_specialization): Remove variable_concept_p code.
2681 (lookup_template_variable): Likewise.
2682 (tsubst_expr) <case CALL_EXPR>: Remove Concepts TS code and simplify.
2683 (do_decl_instantiation): Remove DECL_DECLARED_CONCEPT_P code.
2684 (instantiate_decl): Likewise.
2685 (placeholder_type_constraint_dependent_p): Don't call
2686 unpack_concept_check. Add a concept_check_p assert.
2687 (convert_generic_types_to_packs): Likewise.
2688 * semantics.cc (finish_call_expr): Remove Concepts TS code and simplify.
2689
2690 2024-08-05 Iain Sandoe <[email protected]>
2691
2692 * coroutines.cc (split_coroutine_body_from_ramp): New.
2693 (morph_fn_to_coro): Use split_coroutine_body_from_ramp().
2694 * cp-tree.h (use_eh_spec_block): New.
2695 * decl.cc (use_eh_spec_block): Make non-static.
2696
2697 2024-08-05 Marek Polacek <[email protected]>
2698
2699 PR c++/115987
2700 * call.cc (do_warn_dangling_reference): Don't consider a
2701 temporary with a scalar type that cannot bind to the return type.
2702
2703 2024-08-02 Arsen Arsenović <[email protected]>
2704
2705 PR c++/105475
2706 * coroutines.cc (struct coroutine_info): Add from_address.
2707 Carries the from_address member we looked up earlier.
2708 (coro_resume_identifier): Remove. Unused.
2709 (coro_init_identifiers): Do not initialize the above.
2710 (void_coro_handle_address): New variable. Contains the baselink
2711 for the std::coroutine_handle<void>::address() instance method.
2712 (get_handle_type_address): New function. Looks up and validates
2713 handle_type::address in a given handle_type.
2714 (get_handle_type_from_address): New function. Looks up and
2715 validates handle_type::from_address in a given handle_type.
2716 (coro_promise_type_found_p): Remove reliance on
2717 coroutine_handle<> defaulting the promise type to void. Store
2718 get_handle_type_* results where appropriate.
2719 (get_coroutine_from_address): New helper. Gets the
2720 handle_type::from_address BASELINK from a coroutine_info.
2721 (build_actor_fn): Use the get_coroutine_from_address helper and
2722 void_coro_handle_address.
2723
2724 2024-08-02 Marek Polacek <[email protected]>
2725
2726 PR c++/116169
2727 * decl.cc (cp_finish_decl): Disallow deleting ::main.
2728
2729 2024-08-02 Iain Sandoe <[email protected]>
2730
2731 * coroutines.cc (struct local_vars_frame_data): Add a
2732 CTOR.
2733 (morph_fn_to_coro): Use CTOR for local_vars_frame_data
2734 instead of brace init.
2735
2736 2024-08-02 Iain Sandoe <[email protected]>
2737
2738 * coroutines.cc (struct susp_frame_data): Remove unused members,
2739 provide a CTOR.
2740 (morph_fn_to_coro): Use susp_frame_data CTOR, and make the suspend
2741 state hash map local to the morph function.
2742
2743 2024-08-02 Iain Sandoe <[email protected]>
2744
2745 * coroutines.cc (replace_continue): Look up expression type.
2746
2747 2024-08-01 Jakub Jelinek <[email protected]>
2748
2749 PR c++/116113
2750 * semantics.cc (maybe_convert_cond): Check DECL_DECOMP_BASE
2751 is non-NULL before dereferencing it.
2752 (finish_switch_cond): Likewise.
2753
2754 2024-08-01 Arsen Arsenović <[email protected]>
2755
2756 PR c++/112341
2757 * coroutines.cc (struct coroutine_info): Also cache the
2758 traits type.
2759 (ensure_coro_initialized): New function. Makes sure we have
2760 initialized the coroutine state successfully, or informs the
2761 caller should it fail to do so. Extracted from
2762 coro_promise_type_found_p.
2763 (coro_get_traits_class): New function. Gets the (cached)
2764 coroutine traits type for a given coroutine. Extracted from
2765 coro_promise_type_found_p and refactored to cache the result.
2766 (coro_promise_type_found_p): Use the two functions above.
2767 (build_template_co_await_expr): New function. Builds a
2768 CO_AWAIT_EXPR representing a CO_AWAIT_EXPR in a template
2769 declaration.
2770 (build_co_await): Use the above if processing_template_decl, and
2771 give it a proper type.
2772 (coro_dependent_p): New function. Returns true iff its
2773 argument is a type-dependent expression OR the current functions
2774 traits class is type dependent.
2775 (finish_co_await_expr): Defer expansion only in the case
2776 coro_dependent_p returns true.
2777 (finish_co_yield_expr): Ditto.
2778 (finish_co_return_stmt): Ditto.
2779 * pt.cc (type_dependent_expression_p): Do not treat
2780 CO_AWAIT/CO_YIELD specially.
2781
2782 2024-07-31 Marek Polacek <[email protected]>
2783
2784 PR c++/115645
2785 * init.cc (build_vec_init): When initializing a scalar type, try to
2786 create a constant initializer.
2787
2788 2024-07-30 Arsen Arsenović <[email protected]>
2789
2790 PR c++/115906
2791 * parser.cc (cp_parser_unary_expression): Reject await
2792 expressions if use of local variables is currently forbidden.
2793 (cp_parser_yield_expression): Reject yield expressions if use of
2794 local variables is currently forbidden.
2795
2796 2024-07-30 Arsen Arsenovic <[email protected]>
2797
2798 PR c++/115906
2799 * coroutines.cc (register_local_var_uses): Only process
2800 PARM_DECL and VAR_DECLs.
2801
2802 2024-07-30 Arsen Arsenović <[email protected]>
2803
2804 PR c++/110855
2805 * cp-gimplify.cc (fold_builtin_source_location): Use the name of
2806 the DECL_RAMP_FN of the current function if present.
2807
2808 2024-07-29 Patrick Palka <[email protected]>
2809
2810 PR c++/88313
2811 * parser.cc (cp_parser_lambda_declarator_opt): Pass
2812 lambda_p=true to cp_parser_parameter_declaration_clause.
2813 (cp_parser_direct_declarator): Pass lambda_p=false to
2814 to cp_parser_parameter_declaration_clause.
2815 (cp_parser_parameter_declaration_clause): Add bool lambda_p
2816 parameter. Consider lambda_p instead of current_class_type
2817 when setting parser->auto_is_implicit_function_template_parm_p.
2818 Don't consider processing_template_parmlist.
2819 (cp_parser_requirement_parameter_list): Pass lambda_p=false
2820 to cp_parser_parameter_declaration_clause.
2821
2822 2024-07-28 Jason Merrill <[email protected]>
2823
2824 PR c++/115583
2825 * constexpr.cc (cxx_eval_conditional_expression): Don't
2826 cp_fold_immediate for if consteval.
2827
2828 2024-07-27 Jason Merrill <[email protected]>
2829
2830 PR c++/115986
2831 * cp-gimplify.cc (remember_escalating_expr): Skip function
2832 templates.
2833
2834 2024-07-27 Jason Merrill <[email protected]>
2835
2836 PR c++/115561
2837 * semantics.cc (finish_call_expr): Check cp_unevaluated_operand.
2838
2839 2024-07-26 Jason Merrill <[email protected]>
2840
2841 PR c++/116052
2842 * mangle.cc (write_prefix): Handle TRAIT_EXPR.
2843
2844 2024-07-26 Nathaniel Shead <[email protected]>
2845
2846 PR c++/115757
2847 * module.cc (trees_out::core_vals): Write warning specs for
2848 DECLs and EXPRs.
2849 (trees_in::core_vals): Read warning specs.
2850
2851 2024-07-25 Jason Merrill <[email protected]>
2852
2853 PR c++/115403
2854 PR c++/109753
2855 * decl.cc (start_preparsed_function): Only call decl_attributes for
2856 artificial functions.
2857
2858 2024-07-25 Patrick Palka <[email protected]>
2859
2860 PR c++/115897
2861 * cp-tree.h (dependent_opaque_alias_p): Declare.
2862 * pt.cc (push_template_decl): Manually mark a dependent opaque
2863 alias or dependent alias template specialization as dependent,
2864 and use structural equality for them.
2865 (dependent_opaque_alias_p): Define.
2866 (alias_template_specialization_p): Don't look through an
2867 opaque alias.
2868 (complex_alias_template_p): Use dependent_opaque_alias_p instead of
2869 any_dependent_template_arguments_p directly.
2870 (dependent_alias_template_spec_p): Don't look through an
2871 opaque alias.
2872 (get_underlying_template): Use dependent_opaque_alias_p instead of
2873 any_dependent_template_arguments_p.
2874 (instantiate_alias_template): Mention same logic in
2875 push_template_decl.
2876 (dependent_type_p_r): Remove dependent_alias_template_spec_p check.
2877 (any_template_arguments_need_structural_equality_p): Return true
2878 for a dependent opaque alias.
2879 (alias_ctad_tweaks): Use template_args_equal instead of same_type_p
2880 followed by dependent_alias_template_spec_p.
2881 * tree.cc (strip_typedefs): Don't strip an opaque alias.
2882 * typeck.cc (structural_comptypes): Compare declaration attributes
2883 for an opaque alias.
2884
2885 2024-07-25 Patrick Palka <[email protected]>
2886
2887 PR c++/115897
2888 * tree.cc (strip_typedefs): Move up the typedef recursion case.
2889 Never strip a dependent alias template-id that has dependent
2890 attributes.
2891
2892 2024-07-25 Arsen Arsenović <[email protected]>
2893
2894 PR c++/110171
2895 * coroutines.cc (co_await_get_resume_call): New function.
2896 Returns the await_resume expression of a given co_await.
2897 * cp-tree.h (co_await_get_resume_call): New function.
2898 * cvt.cc (convert_to_void): Handle CO_AWAIT_EXPRs and call
2899 maybe_warn_nodiscard on their resume exprs.
2900
2901 2024-07-25 Arsen Arsenović <[email protected]>
2902
2903 PR c++/111728
2904 * coroutines.cc (rewrite_param_uses): Skip unevaluated
2905 subexpressions.
2906
2907 2024-07-24 Jason Merrill <[email protected]>
2908
2909 PR c++/116071
2910 * parser.cc (cp_parser_simple_type_specifier): Call
2911 cp_parser_simulate_error if nothing worked.
2912
2913 2024-07-24 Jakub Jelinek <[email protected]>
2914
2915 * constraint.cc (subst_info::quiet, subst_info::noisy): Formatting
2916 fixes.
2917 (known_non_bool_p): Comment formatting fixes.
2918 (unpack_concept_check): Likewise.
2919 (resolve_function_concept_overload): Likewise.
2920 (resolve_function_concept_check): Likewise.
2921 (resolve_concept_check): Likewise.
2922 (deduce_constrained_parameter): Likewise.
2923 (finish_type_constraints): Likewise.
2924 (get_returned_expression): Likewise.
2925 (get_variable_initializer): Likewise.
2926 (norm_info::update_context, norm_info::ctx_params): Formatting
2927 fixes.
2928 (norm_info::context): Comment formatting fixes.
2929 (normalize_logical_operation): Likewise. Formatting fix.
2930 (normalize_concept_check): Comment formatting fixes.
2931 (normalize_atom): Likewise.
2932 (normalize_expression): Likewise.
2933 (get_normalized_constraints_from_info): Likewise.
2934 (get_normalized_constraints_from_decl): Likewise. Formatting
2935 fixes.
2936 (atomic_constraints_identical_p): Comment formatting fixes.
2937 (constraints_equivalent_p): Formatting fixes.
2938 (inchash::add_constraint): Likewise.
2939 (associate_classtype_constraints): Comment formatting fixes.
2940 (get_constraints): Likewise.
2941 (set_constraints): Likewise.
2942 (build_concept_check_arguments): Likewise.
2943 (build_function_check): Likewise.
2944 (build_concept_check): Likewise.
2945 (finish_shorthand_constraint): Likewise.
2946 (get_shorthand_constraints): Likewise.
2947 (check_constraint_variables): Likewise.
2948 (tsubst_constraint_variables): Likewise.
2949 (tsubst_requires_expr): Likewise.
2950 (get_mapped_args): Likewise. Formatting fixes.
2951 (satisfy_atom): Comment formatting fixes.
2952 (satisfy_constraint_r): Comment wording and formatting fixes.
2953 (satisfy_normalized_constraints): Comment formatting fixes.
2954 (satisfy_declaration_constraints): Likewise.
2955 (evaluate_concept_check): Likewise.
2956 (finish_requires_expr): Likewise.
2957 (finish_compound_requirement): Likewise.
2958 (check_function_concept): Likewise.
2959 (equivalently_constrained): Likewise.
2960 (more_constrained): Likewise.
2961 (diagnose_atomic_constraint): Likewise.
2962 * cp-tree.h (TREE_LANG_FLAG_0): Fix a comment error,
2963 FOLD_EXPR_MODIFY_P instead of FOLD_EXPR_MODOP_P.
2964 (DECL_MAIN_FREESTANDING_P, DECL_MAIN_P): Comment formatting fixes.
2965 (enum cpp0x_warn_str): Likewise.
2966 (enum composite_pointer_operation): Likewise.
2967 (enum expr_list_kind): Likewise.
2968 (enum impl_conv_rhs): Likewise.
2969 (enum impl_conv_void): Likewise.
2970 (struct deferred_access_check): Likewise.
2971 (ATOMIC_CONSTR_EXPR): Likewise.
2972 (FUNCTION_REF_QUALIFIED): Likewise.
2973 (DECL_DEPENDENT_P): Likewise.
2974 (FOLD_EXPR_MODIFY_P): Likewise.
2975 (FOLD_EXPR_OP_RAW): Likewise.
2976 (FOLD_EXPR_PACK): Likewise.
2977 (FOLD_EXPR_INIT): Likewise.
2978 (TYPE_WAS_UNNAMED): Likewise.
2979 (class cp_unevaluated): Likewise.
2980 (struct ovl_op_info_t assertion): Likewise.
2981 (cp_declarator::function::requires_clause): Likewise.
2982 (variable_template_p): Likewise.
2983 (concept_definition_p): Likewise.
2984 * logic.cc (clause::clause): Likewise.
2985 (clause::replace): Likewise.
2986 (clause::insert): Likewise. Formatting fixes.
2987 (struct formula): Comment formatting fixes.
2988 (formula::branch): Likewise.
2989 (debug): Formatting fixes.
2990 (dnf_size_r): Comment formatting fixes.
2991 (cnf_size_r): Likewise.
2992 (dnf_size): Likewise.
2993 (cnf_size): Likewise.
2994 (branch_clause): Likewise.
2995 (decompose_term): Likewise. Formatting fixes.
2996 (struct subsumption_entry): Comment formatting fixes.
2997 (subsumption_cache): Likewise.
2998 (save_subsumption): Likewise. Formatting fixes.
2999 (subsumes_constraints_nonnull): Formatting fixes.
3000
3001 2024-07-23 Andi Kleen <[email protected]>
3002
3003 PR c/83324
3004 * cp-tree.h (AGGR_INIT_EXPR_MUST_TAIL): Add.
3005 * parser.cc (cp_parser_statement): Handle musttail.
3006 (cp_parser_jump_statement): Dito.
3007 * pt.cc (tsubst_expr): Copy CALL_EXPR_MUST_TAIL_CALL.
3008 * semantics.cc (simplify_aggr_init_expr): Handle musttail.
3009
3010 2024-07-23 Patrick Palka <[email protected]>
3011
3012 PR c++/115656
3013 * constraint.cc (weakly_subsumes): Pass in_decl=tmpl to
3014 get_normalized_constraints_from_info. Rename to ...
3015 (ttp_subsumes): ... this.
3016 * cp-tree.h (weakly_subsumes): Rename to ...
3017 (ttp_subsumes): ... this.
3018 * pt.cc (is_compatible_template_arg): Adjust after renaming.
3019
3020 2024-07-23 Patrick Palka <[email protected]>
3021
3022 PR c++/115296
3023 * pt.cc (alias_ctad_tweaks): Use complain=tf_none instead of
3024 tf_warning_or_error.
3025
3026 2024-07-23 Jakub Jelinek <[email protected]>
3027
3028 * cp-tree.def (CHECK_CONSTR): Remove.
3029 * cp-tree.h (CHECK_CONSTR_CONCEPT, CHECK_CONSTR_ARGS): Remove.
3030 * cp-objcp-common.cc (cp_common_init_ts): Don't handle CHECK_CONSTR.
3031 * tree.cc (cp_tree_equal): Likewise.
3032 * error.cc (dump_expr): Likewise.
3033 * cxx-pretty-print.cc (cxx_pretty_printer::expression): Likewise.
3034 (pp_cxx_check_constraint): Remove.
3035 (pp_cxx_constraint): Don't handle CHECK_CONSTR.
3036
3037 2024-07-23 Patrick Palka <[email protected]>
3038
3039 PR c++/104981
3040 PR c++/115550
3041 * coroutines.cc (morph_fn_to_coro): Remove unneeded calls
3042 to convert_to_reference and convert_from_reference when
3043 passing *this. Use cp_build_fold_indirect_ref instead
3044 of directly building INDIRECT_REF.
3045
3046 2024-07-22 Jakub Jelinek <[email protected]>
3047
3048 * cp-tree.def (UNARY_LEFT_FOLD_EXPR): Use FOLD_EXPR_MODIFY_P instead
3049 of FOLD_EXPR_MOD_P or FOLDEXPR_MOD_P in the comment. Comment
3050 formatting fixes.
3051 (ATOMIC_CONSTEXPR): Use CONSTR_INFO instead of ATOMIC_CONSTR_INFO
3052 and ATOMIC_CONSTR_MAP instead of ATOMIC_CONSTR_PARMS in the comment.
3053 Comment formatting fixes.
3054 (CONJ_CONSTR): Remove comment about third operand. Use CONSTR_INFO
3055 instead of CONJ_CONSTR_INFO and DISJ_CONSTR_INFO.
3056 (CHECK_CONSTR): Use CHECK_CONSTR_ARGS instead of
3057 CHECK_CONSTR_ARGUMENTS.
3058
3059 2024-07-20 Andi Kleen <[email protected]>
3060
3061 Revert:
3062 2024-07-20 Andi Kleen <[email protected]>
3063
3064 PR c/83324
3065 * cp-tree.h (AGGR_INIT_EXPR_MUST_TAIL): Add.
3066 * parser.cc (cp_parser_statement): Handle musttail.
3067 (cp_parser_jump_statement): Dito.
3068 * pt.cc (tsubst_expr): Copy CALL_EXPR_MUST_TAIL_CALL.
3069 * semantics.cc (simplify_aggr_init_expr): Handle musttail.
3070
3071 2024-07-20 Andi Kleen <[email protected]>
3072
3073 PR c/83324
3074 * cp-tree.h (AGGR_INIT_EXPR_MUST_TAIL): Add.
3075 * parser.cc (cp_parser_statement): Handle musttail.
3076 (cp_parser_jump_statement): Dito.
3077 * pt.cc (tsubst_expr): Copy CALL_EXPR_MUST_TAIL_CALL.
3078 * semantics.cc (simplify_aggr_init_expr): Handle musttail.
3079
3080 2024-07-19 Patrick Palka <[email protected]>
3081
3082 PR c++/115783
3083 * call.cc (build_new_method_call): Generalize METHOD_TYPE
3084 check to DECL_OBJECT_MEMBER_FUNCTION_P.
3085
3086 2024-07-19 Seyed Sajad Kahani <[email protected]>
3087
3088 * constraint.cc (hash_placeholder_constraint): Rename to
3089 iterative_hash_placeholder_constraint.
3090 (iterative_hash_placeholder_constraint): Rename from
3091 hash_placeholder_constraint and add the initial val argument.
3092 * cp-tree.h (hash_placeholder_constraint): Rename to
3093 iterative_hash_placeholder_constraint.
3094 (iterative_hash_placeholder_constraint): Renamed from
3095 hash_placeholder_constraint and add the initial val argument.
3096 * pt.cc (struct ctp_hasher): Updated to use
3097 iterative_hash_placeholder_constraint in the case of a valid placeholder
3098 constraint.
3099 (auto_hash::hash): Reflect the renaming of hash_placeholder_constraint to
3100 iterative_hash_placeholder_constraint.
3101
3102 2024-07-18 Marek Polacek <[email protected]>
3103
3104 PR c++/108769
3105 PR c++/58074
3106 PR c++/115522
3107 PR c++/85723
3108 * class.cc (type_has_non_deleted_trivial_default_ctor): Fix formatting.
3109 * tree.cc (trivial_type_p): Instead of TYPE_HAS_TRIVIAL_DFLT, use
3110 type_has_non_deleted_trivial_default_ctor.
3111
3112 2024-07-18 Nathaniel Shead <[email protected]>
3113
3114 PR c++/115165
3115 * module.cc (lazy_load_binding): Use 'timevar_cond*' APIs.
3116 (lazy_load_pendings): Likewise.
3117
3118 2024-07-18 Patrick Palka <[email protected]>
3119
3120 PR c++/112288
3121 * pt.cc (tsubst_friend_function): When adjusting existing
3122 specializations after defining a previously declared template
3123 friend, consider the most general template and correct
3124 DECL_TI_ARGS adjustment.
3125
3126 2024-07-18 Patrick Palka <[email protected]>
3127
3128 PR c++/114104
3129 * cvt.cc (convert_to_void): Call warn_if_unused_value for
3130 TRUTH_NOT_EXPR and ADDR_EXPR as well.
3131
3132 2024-07-18 Patrick Palka <[email protected]>
3133
3134 * decl.cc (make_typename_type): Restrict name lookup failure
3135 punting to dependentish_scope_p instead of dependent_type_p.
3136 * error.cc (qualified_name_lookup_error): Improve diagnostic
3137 when the scope is the current instantiation.
3138 * parser.cc (cp_parser_diagnose_invalid_type_name): Likewise.
3139 (cp_parser_conversion_function_id): Don't call push_scope on
3140 a template scope unless we're in a declaration context.
3141 (cp_parser_lookup_name): Restrict name lookup failure
3142 punting to dependentish_scope_p instead of depedent_type_p.
3143 * semantics.cc (finish_id_expression_1): Likewise.
3144 * typeck.cc (finish_class_member_access_expr): Likewise.
3145
3146 2024-07-17 Marek Polacek <[email protected]>
3147
3148 PR c++/115900
3149 * constexpr.cc (cxx_eval_call_expression): Set new_obj to NULL_TREE
3150 if cxx_fold_indirect_ref set empty_base to true.
3151
3152 2024-07-17 Patrick Palka <[email protected]>
3153
3154 PR c++/111890
3155 * pt.cc (maybe_new_partial_specialization): Propagate TYPE_CONTEXT
3156 to the newly created partial specialization.
3157
3158 2024-07-17 Nathaniel Shead <[email protected]>
3159
3160 PR c++/99242
3161 * name-lookup.cc (append_imported_binding_slot): Propagate dups
3162 flags.
3163
3164 2024-07-16 Nina Ranns <[email protected]>
3165
3166 PR c++/110159
3167 * cp-tree.h (init_terminate_fn): Declaration of a new function.
3168 * decl.cc (cxx_init_decl_processing): If contracts are enabled,
3169 call init_terminate_fn.
3170 * except.cc (init_exception_processing): Function refactored to
3171 call init_terminate_fn.
3172 (init_terminate_fn): Added new function that initializes
3173 terminate_fn if it hasn't already been initialised.
3174
3175 2024-07-16 Iain Sandoe <[email protected]>
3176
3177 PR c++/115434
3178 PR c++/110871
3179 PR c++/110872
3180 * constexpr.cc (cxx_eval_constant_expression): Handle EH_ELSE_EXPR.
3181 * contracts.cc (finish_contract_attribute): Remove excess line.
3182 (build_contract_condition_function): Post condition handlers are
3183 void now.
3184 (emit_postconditions_cleanup): Remove.
3185 (emit_postconditions): New.
3186 (add_pre_condition_fn_call): New.
3187 (add_post_condition_fn_call): New.
3188 (apply_preconditions): New.
3189 (apply_postconditions): New.
3190 (maybe_apply_function_contracts): New.
3191 (apply_postcondition_to_return): Remove.
3192 * contracts.h (apply_postcondition_to_return): Remove.
3193 (maybe_apply_function_contracts): Add.
3194 * coroutines.cc (coro_build_actor_or_destroy_function): Do not
3195 copy contracts to coroutine helpers.
3196 * decl.cc (finish_function): Handle wrapping a possibly
3197 transformed function body in contract checks.
3198 * typeck.cc (check_return_expr): Remove handling of post
3199 conditions on return expressions.
3200
3201 2024-07-15 Patrick Palka <[email protected]>
3202
3203 PR c++/115897
3204 * pt.cc (complex_alias_template_p): Return true for an alias
3205 template with attributes.
3206 (get_underlying_template): Don't look through an alias template
3207 with attributes.
3208
3209 2024-07-13 David Malcolm <[email protected]>
3210
3211 * call.cc: Include "tree-pretty-print-markup.h".
3212 (implicit_conversion_error): Use highlight_colors::percent_h for
3213 the labelled range.
3214 (op_error_string): Split out into...
3215 (concat_op_error_string): ...this.
3216 (binop_error_string): New.
3217 (op_error): Use %e, binop_error_string, highlight_colors::lhs,
3218 and highlight_colors::rhs.
3219 (maybe_inform_about_fndecl_for_bogus_argument_init): Add
3220 "highlight_color" param; use it for the richloc.
3221 (convert_like_internal): Use highlight_colors::percent_h for the
3222 labelled_range, and highlight_colors::percent_i for the call to
3223 maybe_inform_about_fndecl_for_bogus_argument_init.
3224 (build_over_call): Pass cp_comp_parm_types for new "comp_types"
3225 param of check_function_arguments.
3226 (complain_about_bad_argument): Use highlight_colors::percent_h for
3227 the labelled_range, and highlight_colors::percent_i for the call
3228 to maybe_inform_about_fndecl_for_bogus_argument_init.
3229 * cp-tree.h (maybe_inform_about_fndecl_for_bogus_argument_init):
3230 Add optional highlight_color param.
3231 (cp_comp_parm_types): New decl.
3232 (highlight_colors::const percent_h): New decl.
3233 (highlight_colors::const percent_i): New decl.
3234 * error.cc: Include "tree-pretty-print-markup.h".
3235 (highlight_colors::const percent_h): New defn.
3236 (highlight_colors::const percent_i): New defn.
3237 (type_to_string): Add param "highlight_color" and use it.
3238 (print_nonequal_arg): Likewise.
3239 (print_template_differences): Add params "highlight_color_a" and
3240 "highlight_color_b".
3241 (type_to_string_with_compare): Add params "this_highlight_color"
3242 and "peer_highlight_color".
3243 (print_template_tree_comparison): Add params "highlight_color_a"
3244 and "highlight_color_b".
3245 (cxx_format_postprocessor::handle):
3246 Use highlight_colors::percent_h and highlight_colors::percent_i.
3247 (pp_markup::element_quoted_type::print_type): New.
3248 (range_label_for_type_mismatch::get_text): Pass nullptr for new
3249 params of type_to_string_with_compare.
3250 * typeck.cc (cp_comp_parm_types): New.
3251 (cp_build_function_call_vec): Pass it to check_function_arguments.
3252 (convert_for_assignment): Use highlight_colors::percent_h for the
3253 labelled_range.
3254
3255 2024-07-12 Nathaniel Shead <[email protected]>
3256
3257 * decl.cc (xref_tag): Move assertion into condition.
3258 * name-lookup.cc (check_module_override): Check for conflicting
3259 types and using-decls.
3260
3261 2024-07-12 Nathaniel Shead <[email protected]>
3262
3263 PR c++/114683
3264 * cp-tree.h (class ovl_iterator): Move definitions of purview_p
3265 and exporting_p to name-lookup.cc.
3266 * module.cc (depset::hash::add_binding_entity): Strip
3267 using-decls. Remove workarounds. Handle CONST_DECLs with
3268 different purview/exported from their enum.
3269 (enum ct_bind_flags): Remove unnecessary cbf_wrapped flag.
3270 (module_state::write_cluster): Likewise.
3271 (module_state::read_cluster): Build USING_DECL for non-function
3272 usings.
3273 (binding_cmp): Handle CONST_DECLs with different purview and/or
3274 exported from their enum.
3275 (set_instantiating_module): Support CONST_DECLs.
3276 * name-lookup.cc (get_fixed_binding_slot): Strip USING_DECLs.
3277 (name_lookup::process_binding): Strip USING_DECLs.
3278 (name_lookup::process_module_binding): Remove workaround.
3279 (update_binding): Strip USING_DECLs, remove incorrect check for
3280 non-extern variables.
3281 (ovl_iterator::purview_p): Support USING_DECLs.
3282 (ovl_iterator::exporting_p): Support USING_DECLs.
3283 (walk_module_binding): Handle stat hack type.
3284 (do_nonmember_using_decl): Strip USING_DECLs when comparing;
3285 build USING_DECLs for non-function usings in different scope
3286 rather than binding directly.
3287 (get_namespace_binding): Strip USING_DECLs.
3288 (lookup_name): Strip USING_DECLs.
3289 (lookup_elaborated_type): Strip USING_DECLs.
3290 * decl.cc (poplevel): Still support -Wunused for using-decls.
3291 (lookup_and_check_tag): Remove unnecessary strip_using_decl.
3292 * parser.cc (cp_parser_template_name): Likewise.
3293 (cp_parser_nonclass_name): Likewise.
3294 (cp_parser_class_name): Likewise.
3295
3296 2024-07-11 Nathaniel Shead <[email protected]>
3297
3298 PR c++/99241
3299 * decl.cc (duplicate_decls): Merge module entity information.
3300
3301 2024-07-10 Marek Polacek <[email protected]>
3302
3303 * constraint.cc (deduce_concept_introduction, get_deduced_wildcard,
3304 get_introduction_prototype, introduce_type_template_parameter,
3305 introduce_template_template_parameter,
3306 introduce_nontype_template_parameter,
3307 build_introduced_template_parameter, introduce_template_parameter,
3308 introduce_template_parameter_pack, introduce_template_parameter,
3309 introduce_template_parameters, process_introduction_parms,
3310 check_introduction_list, finish_template_introduction): Remove.
3311 (finish_shorthand_constraint): Remove a Concepts TS comment.
3312 * cp-tree.h (check_auto_in_tmpl_args, finish_template_introduction):
3313 Remove.
3314 * decl.cc (function_requirements_equivalent_p): Remove pre-C++20 code.
3315 (grokfndecl): Don't check flag_concepts_ts.
3316 (grokvardecl): Don't check that concept have type bool.
3317 * parser.cc (cp_parser_decl_specifier_seq): Don't check
3318 flag_concepts_ts.
3319 (cp_parser_introduction_list): Remove.
3320 (cp_parser_template_id): Remove dead code.
3321 (cp_parser_simple_type_specifier): Don't check flag_concepts_ts.
3322 (cp_parser_placeholder_type_specifier): Require require auto or
3323 decltype(auto) even pre-C++20. Don't check flag_concepts_ts.
3324 (cp_parser_type_id_1): Don't check flag_concepts_ts.
3325 (cp_parser_template_type_arg): Likewise.
3326 (cp_parser_requires_clause_opt): Remove flag_concepts_ts code.
3327 (cp_parser_compound_requirement): Don't check flag_concepts_ts.
3328 (cp_parser_template_introduction): Remove.
3329 (cp_parser_template_declaration_after_export): Don't call
3330 cp_parser_template_introduction.
3331 * pt.cc (template_heads_equivalent_p): Remove pre-C++20 code.
3332 (find_parameter_pack_data): Remove type_pack_expansion_p.
3333 (find_parameter_packs_r): Remove flag_concepts_ts code. Remove
3334 type_pack_expansion_p code.
3335 (uses_parameter_packs): Remove type_pack_expansion_p code.
3336 (make_pack_expansion): Likewise.
3337 (check_for_bare_parameter_packs): Likewise.
3338 (fixed_parameter_pack_p): Likewise.
3339 (tsubst_qualified_id): Remove dead code.
3340 (extract_autos_r): Remove.
3341 (extract_autos): Remove.
3342 (do_auto_deduction): Remove flag_concepts_ts code.
3343 (type_uses_auto): Likewise.
3344 (check_auto_in_tmpl_args): Remove.
3345
3346 2024-07-10 Marek Polacek <[email protected]>
3347
3348 PR c++/115645
3349 * init.cc (build_new): Don't do any deduction for arrays with
3350 bounds if it's value-initialized.
3351
3352 2024-07-10 Nina Ranns <[email protected]>
3353
3354 PR c++/113968
3355 * contracts.cc (grok_contract): Check for error_mark_node early
3356 exit.
3357
3358 2024-07-09 Jakub Jelinek <[email protected]>
3359
3360 * constexpr.cc (cxx_eval_constant_expression): CWG2819 - Allow
3361 cv void * null pointer value conversion to object types in constant
3362 expressions.
3363
3364 2024-07-07 Nathaniel Shead <[email protected]>
3365
3366 * module.cc (trees_out::get_merge_kind): Use
3367 LAMBDA_TYPE_EXTRA_SCOPE instead of LAMBDA_EXPR_EXTRA_SCOPE.
3368 (trees_out::key_mergeable): Likewise.
3369
3370 2024-07-04 Tamar Christina <[email protected]>
3371
3372 PR c++/115623
3373 * semantics.cc (finish_for_cond): Add check for C++ cond.
3374
3375 2024-07-04 Jason Merrill <[email protected]>
3376
3377 * error.cc (dump_decl) [OVERLOAD]: Recurse on single case.
3378
3379 2024-07-04 Jason Merrill <[email protected]>
3380
3381 * pt.cc (ctad_template_p): Return false for trait names.
3382
3383 2024-07-02 Jakub Jelinek <[email protected]>
3384 Jason Merrill <[email protected]>
3385
3386 PR c++/115754
3387 * constexpr.cc (cxx_eval_constant_expression) <case CONVERT_EXPR>:
3388 For conversions to void, pass vc_discard to the recursive call
3389 and otherwise for tcode other than VIEW_CONVERT_EXPR pass vc_prvalue.
3390
3391 2024-07-02 Jakub Jelinek <[email protected]>
3392 Jason Merrill <[email protected]>
3393
3394 PR c++/115747
3395 * init.cc: Implement C++26 P3144R2 - Deleting a Pointer to an
3396 Incomplete Type Should be Ill-formed.
3397 (build_vec_delete_1): Emit permerror_at and return error_mark_node
3398 for delete [] on incomplete type.
3399 (build_delete): Similarly for delete.
3400
3401 2024-07-02 Jakub Jelinek <[email protected]>
3402
3403 PR c++/115745
3404 * cp-tree.h: Implement C++26 P0963R3 - Structured binding declaration
3405 as a condition.
3406 (DECL_DECOMP_BASE): Adjust comment.
3407 (DECL_DECOMP_IS_BASE): Define.
3408 * parser.cc (cp_parser_selection_statement): Adjust
3409 cp_parser_condition caller.
3410 (cp_parser_condition): Add KEYWORD argument. Parse
3411 C++26 structured bindings in conditions.
3412 (cp_parser_c_for, cp_parser_iteration_statement): Adjust
3413 cp_parser_condition callers.
3414 (cp_parser_simple_declaration): Adjust
3415 cp_parser_decomposition_declaration caller.
3416 (cp_parser_decomposition_declaration): Add KEYWORD argument.
3417 If it is not RID_MAX, diagnose for C++23 and older rather than C++14
3418 and older. Set DECL_DECOMP_BASE to integer_zero_node for structured
3419 bindings used in if/while/for conditions or integer_one_node for
3420 those used in switch conditions.
3421 * decl.cc (poplevel, check_array_initializer): Use DECL_DECOMP_IS_BASE
3422 instead of !DECL_DECOMP_BASE.
3423 (cp_finish_decomp): Diagnose array initializer for structured bindings
3424 used in conditions. If using std::tuple_{size,element}, emit
3425 conversion to bool or integer/enumeration of e into a TARGET_EXPR
3426 before emitting get method calls.
3427 * decl2.cc (mark_used): Use DECL_DECOMP_IS_BASE instead of
3428 !DECL_DECOMP_BASE.
3429 * module.cc (trees_in::tree_node): Likewise.
3430 * typeck.cc (maybe_warn_about_returning_address_of_local): Likewise.
3431 * semantics.cc (maybe_convert_cond): For structured bindings with
3432 TARGET_EXPR DECL_DECOMP_BASE use that as condition.
3433 (finish_switch_cond): Likewise.
3434
3435 2024-07-02 Lewis Hyatt <[email protected]>
3436
3437 * Make-lang.in: Remove redundant slash.
3438
3439 2024-07-02 Simon Martin <[email protected]>
3440
3441 PR c++/111160
3442 * tree.cc (stabilize_expr): Stabilized expressions can have
3443 TREE_SIDE_EFFECTS if they're volatile.
3444
3445 2024-07-01 Marek Polacek <[email protected]>
3446
3447 PR c++/115469
3448 * decl.cc (automatic_var_with_nontrivial_dtor_p): New.
3449 (poplevel_named_label_1): Use it.
3450 (check_goto_1): Likewise.
3451
3452 2024-07-01 Marek Polacek <[email protected]>
3453
3454 PR c++/115430
3455 * typeck.cc (cp_build_compound_expr): Call resolve_nondeduced_context
3456 on RHS.
3457
3458 2024-07-01 Marek Polacek <[email protected]>
3459
3460 DR 2627
3461 PR c++/94058
3462 PR c++/104392
3463 * typeck2.cc (check_narrowing): Don't warn if the conversion isn't
3464 narrowing as per DR 2627.
3465
3466 2024-06-28 Patrick Palka <[email protected]>
3467
3468 PR c++/106760
3469 * call.cc (add_candidates): Relax test for adding a candidate
3470 to 'bad_cands' to also accept an uninstantiated template candidate
3471 that has no missing conversions.
3472
3473 2024-06-26 David Malcolm <[email protected]>
3474
3475 * parser.cc (cp_parser_error_1): Pass *global_dc to
3476 gcc_rich_location::add_location_if_nearby.
3477 (cp_parser_decl_specifier_seq): Likewise.
3478 (cp_parser_set_storage_class): Likewise.
3479 (cp_parser_set_storage_class): Likewise.
3480
3481 2024-06-26 Patrick Palka <[email protected]>
3482
3483 PR c++/115504
3484 * semantics.cc (finish_decltype_type): Don't strip the reference
3485 type (if any) of a capture proxy's captured variable.
3486
3487 2024-06-25 Marek Polacek <[email protected]>
3488
3489 PR c++/115476
3490 * semantics.cc (finish_trait_expr)
3491 <case CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS>: Move below to call
3492 check_trait_type with kind==2.
3493
3494 2024-06-25 Marek Polacek <[email protected]>
3495
3496 PR c++/115425
3497 * pt.cc (tsubst_pack_expansion): Return error_mark_node if
3498 make_pack_expansion doesn't work out.
3499
3500 2024-06-25 Marek Polacek <[email protected]>
3501
3502 PR c++/115501
3503 * rtti.cc (build_dynamic_cast_1): Return if dcast_fn is erroneous.
3504
3505 2024-06-25 Patrick Palka <[email protected]>
3506
3507 PR c++/115198
3508 * pt.cc (alias_ctad_tweaks): Update DECL_NAME of the transformed
3509 guides.
3510
3511 2024-06-25 Patrick Palka <[email protected]>
3512
3513 PR c++/115358
3514 * decl2.cc (mark_used): Call maybe_instantiate_decl for an array
3515 variable with unknown bound.
3516 * semantics.cc (finish_decltype_type): Remove now redundant
3517 handling of array variables with unknown bound.
3518 * typeck.cc (cxx_sizeof_expr): Likewise.
3519
3520 2024-06-25 Sandra Loosemore <[email protected]>
3521
3522 PR c/115587
3523 * parser.cc (cp_parser_omp_loop_nest): Move initializations to
3524 point of declaration.
3525
3526 2024-06-17 Jakub Jelinek <[email protected]>
3527
3528 PR target/111343
3529 PR c++/115511
3530 * typeck.cc (cp_compare_floating_point_conversion_ranks): If an
3531 extended floating point type mv1 has same set of values as more
3532 than one standard floating point type and mv2 is float, return 2.
3533
3534 2024-06-13 Jason Merrill <[email protected]>
3535
3536 PR c++/114683
3537 * name-lookup.cc (do_nonmember_using_decl): Allow exporting
3538 a newly inserted decl.
3539
3540 2024-06-13 Jason Merrill <[email protected]>
3541
3542 PR c++/115194
3543 * name-lookup.cc (name_lookup::process_module_binding): Strip an
3544 OVERLOAD from a non-function.
3545
3546 2024-06-13 Jason Merrill <[email protected]>
3547
3548 * module.cc (depset::hash::add_binding_entity): Adjust comment.
3549
3550 2024-06-13 Patrick Palka <[email protected]>
3551
3552 PR c++/99678
3553 * parser.cc (cp_parser_constraint_primary_expression): Diagnose
3554 a bare unresolved unqualified-id.
3555
3556 2024-06-13 Patrick Palka <[email protected]>
3557
3558 PR c++/115239
3559 * call.cc (tourney): Don't consider a non-strictly viable
3560 candidate as the champ if there was ambiguity between two
3561 strictly viable candidates.
3562
3563 2024-06-13 Andi Kleen <[email protected]>
3564
3565 * parser.cc (cp_parser_asm_string_expression): Use correct error
3566 message.
3567
3568 2024-06-13 Andi Kleen <[email protected]>
3569
3570 * parser.cc (cp_parser_asm_string_expression): Parse close
3571 parent when constexpr extraction fails.
3572
3573 2024-06-13 Andi Kleen <[email protected]>
3574
3575 * parser.cc (cp_parser_asm_string_expression): Remove support
3576 for const char * for asm constexpr.
3577
3578 2024-06-13 Patrick Palka <[email protected]>
3579
3580 PR c++/115283
3581 * decl2.cc (min_vis_expr_r) <case TEMPLATE_DECL>: Ignore
3582 concepts.
3583
3584 2024-06-12 Jason Merrill <[email protected]>
3585
3586 * tree.cc (lookup_maybe_add): Use ovl_make when setting OVL_USING_P.
3587
3588 2024-06-12 Jason Merrill <[email protected]>
3589
3590 * module.cc (depset::hash::add_binding_entity): Set
3591 DECL_MODULE_PURVIEW_P instead of asserting.
3592
3593 2024-06-12 Andi Kleen <[email protected]>
3594
3595 * cp-tree.h (extract): Add new overload to return tree.
3596 * parser.cc (cp_parser_asm_string_expression): Use tree extract.
3597 * semantics.cc (cexpr_str::extract): Add new overload to return
3598 tree.
3599
3600 2024-06-12 David Malcolm <[email protected]>
3601
3602 * error.cc (append_formatted_chunk): Move part of body into
3603 chunk_info::append_formatted_chunk.
3604
3605 2024-06-12 David Malcolm <[email protected]>
3606
3607 * cxx-pretty-print.cc: Update throughout for fields of
3608 pretty_printer becoming private.
3609 * error.cc: Likewise.
3610
3611 2024-06-11 Andi Kleen <[email protected]>
3612
3613 * parser.cc (cp_parser_asm_string_expression): New function
3614 to handle constexpr strings for asm.
3615 (cp_parser_asm_definition): Use cp_parser_asm_string_expression.
3616 (cp_parser_yield_expression): Dito.
3617 (cp_parser_asm_specification_opt): Dito.
3618 (cp_parser_asm_operand_list): Dito.
3619 (cp_parser_asm_clobber_list): Dito.
3620
3621 2024-06-11 Andi Kleen <[email protected]>
3622
3623 * cp-tree.h (class cexpr_str): Add.
3624 * semantics.cc (finish_static_assert): Convert to use cexpr_str.
3625 (cexpr_str::type_check): Extract constexpr string code to here.
3626 (cexpr_str::extract): ... and here.
3627
3628 2024-06-08 Simon Martin <[email protected]>
3629
3630 PR c++/108438
3631 * parser.cc (cp_parser_postfix_expression): Use
3632 cp_parser_require_end_of_template_parameter_list to skip to the closing
3633 '>' upon error parsing the target type of *_cast<*> expressions.
3634
3635 2024-06-07 Simon Martin <[email protected]>
3636
3637 PR c++/107575
3638 * decl.cc (duplicate_decls): Check for error_mark_node
3639 DECL_LOCAL_DECL_ALIAS.
3640
3641 2024-06-07 Jason Merrill <[email protected]>
3642
3643 * module.cc (maybe_translate_include): Allow before the main file.
3644
3645 2024-06-07 Patrick Palka <[email protected]>
3646
3647 PR c++/115378
3648 * lambda.cc (lambda_capture_field_type): Set
3649 TEMPLATE_TYPE_PARAMETER_PACK on the auto type of an init-capture
3650 pack expansion.
3651 * pt.cc (find_parameter_packs_r) <case TEMPLATE_TYPE_PARM>:
3652 Restrict TEMPLATE_TYPE_PARAMETER_PACK promotion with
3653 flag_concepts_ts.
3654
3655 2024-06-05 Jakub Jelinek <[email protected]>
3656 Frederik Harwath <[email protected]>
3657 Sandra Loosemore <[email protected]>
3658
3659 * cp-tree.h (dependent_omp_for_p): Add another tree argument.
3660 * parser.cc (check_omp_intervening_code): Reject imperfectly nested
3661 tile.
3662 (cp_parser_statement_seq_opt): If want_nested_loop, use
3663 cp_parser_next_tokens_can_be_canon_loop instead of just checking
3664 for RID_FOR keyword.
3665 (cp_parser_omp_clause_name): Handle full and partial clause names.
3666 (cp_parser_omp_clause_full, cp_parser_omp_clause_partial): New
3667 functions.
3668 (cp_parser_omp_all_clauses): Formatting fix. Handle
3669 PRAGMA_OMP_CLAUSE_PARTIAL and PRAGMA_OMP_CLAUSE_FULL.
3670 (cp_parser_next_tokens_can_be_canon_loop): New function.
3671 (cp_parser_omp_loop_nest): Parse C++11 attributes. Handle tile/unroll
3672 constructs. Use cp_parser_next_tokens_can_be_canon_loop instead
3673 of just checking for RID_FOR keyword. Only add_stmt
3674 cp_parser_omp_loop_nest result if it is non-NULL.
3675 (cp_parser_omp_for_loop): Rename tiling variable to oacc_tiling. For
3676 OMP_CLAUSE_SIZES set collapse to list length of OMP_CLAUSE_SIZES_LIST.
3677 Use cp_parser_next_tokens_can_be_canon_loop instead of just
3678 checking for RID_FOR keyword. Remove spurious semicolon. Don't call
3679 c_omp_check_loop_binding_exprs if stmt is NULL. Skip and/or handle
3680 generated loops. Remove spurious ()s around & operands.
3681 (cp_parser_omp_tile_sizes, cp_parser_omp_tile): New functions.
3682 (OMP_UNROLL_CLAUSE_MASK): Define.
3683 (cp_parser_omp_unroll): New function.
3684 (cp_parser_omp_construct): Handle PRAGMA_OMP_TILE and
3685 PRAGMA_OMP_UNROLL.
3686 (cp_parser_pragma): Likewise.
3687 * semantics.cc (finish_omp_clauses): Don't call
3688 fold_build_cleanup_point_expr for cases which obviously won't need it,
3689 like checked INTEGER_CSTs. Handle OMP_CLAUSE_{FULL,PARTIAL,SIZES}
3690 and diagnose full vs. partial conflict. Adjust wording of some of the
3691 conflicting clause diagnostic messages to include word clause.
3692 (finish_omp_for): Use decl equal to global_namespace as a marker for
3693 generated loop. Pass also body to dependent_omp_for_p. Skip
3694 generated loops.
3695 (finish_omp_for_block): Skip generated loops.
3696 * pt.cc (tsubst_omp_clauses): Handle OMP_CLAUSE_{FULL,PARTIAL,SIZES}.
3697 (tsubst_stmt): Handle OMP_TILE and OMP_UNROLL. Handle or skip
3698 generated loops.
3699 (dependent_omp_for_p): Add body argument. If declv vector element
3700 is NULL, find generated loop.
3701 * cp-gimplify.cc (cp_gimplify_expr): Handle OMP_TILE and OMP_UNROLL.
3702 (cp_fold_r): Likewise.
3703 (cp_genericize_r): Likewise. Skip generated loops.
3704
3705 2024-06-04 Simon Martin <[email protected]>
3706
3707 * pt.cc (tsubst_expr): Add missing space after seen_error.
3708 (dependent_type_p): Likewise.
3709
3710 2024-06-04 Simon Martin <[email protected]>
3711
3712 PR c++/111106
3713 * pt.cc (dependent_type_p): Don't fail assert during error recovery.
3714
3715 2024-06-03 Jakub Jelinek <[email protected]>
3716
3717 PR c++/115012
3718 * parser.cc (cp_parser_direct_declarator): Handle
3719 abstract declarator starting with ... followed by opening paren.
3720
3721 2024-06-02 Simon Martin <[email protected]>
3722
3723 PR c++/109958
3724 * typeck.cc (build_class_member_access_expr): Handle single OVERLOADs.
3725 (cp_build_addr_expr_1): Likewise.
3726
3727 2024-06-01 Nathaniel Shead <[email protected]>
3728
3729 PR c++/114867
3730 * cp-tree.h (OVL_PURVIEW_P): New.
3731 (ovl_iterator::purview_p): New.
3732 * module.cc (depset::hash::add_binding_entity): Only ignore
3733 entities not within module purview. Set OVL_PURVIEW_P on new
3734 OVERLOADs for emitted declarations.
3735 (module_state::read_cluster): Imported using-decls are always
3736 in purview, mark as OVL_PURVIEW_P.
3737 * name-lookup.h (enum WMB_Flags): New WMB_Purview flag.
3738 * name-lookup.cc (walk_module_binding): Set WMB_Purview as
3739 needed.
3740 (do_nonmember_using_decl): Don't remove from existing OVERLOADs.
3741 Also reveal non-exported decls. Also reveal 'extern "C"' decls.
3742 Add workaround to reveal non-function decls.
3743 * tree.cc (ovl_insert): Adjust to also set OVL_PURVIEW_P when
3744 needed.
3745
3746 2024-05-29 Jason Merrill <[email protected]>
3747
3748 PR c++/109753
3749 * decl.cc (start_preparsed_function): Call decl_attributes.
3750
3751 2024-05-29 Jason Merrill <[email protected]>
3752
3753 * lang-specs.h: Add module interface extensions.
3754
3755 2024-05-29 Patrick Palka <[email protected]>
3756
3757 PR c++/115223
3758 * tree.cc (build_cp_fntype_variant): Propagate structural
3759 equality of the exception-less variant.
3760
3761 2024-05-28 Marek Polacek <[email protected]>
3762
3763 PR c++/109396
3764 * cp-tree.h (maybe_warn_self_move): Declare.
3765 * init.cc (perform_member_init): Call maybe_warn_self_move.
3766 * typeck.cc (maybe_warn_self_move): No longer static. Change the
3767 return type to bool. Also warn when called from
3768 a member-initializer-list. Drop the inform call.
3769
3770 2024-05-28 Marek Polacek <[email protected]>
3771
3772 PR c++/114707
3773 * call.cc (convert_for_arg_passing): Call set_target_expr_eliding.
3774 * typeck2.cc (replace_placeholders_for_class_temp_r): Don't use pset.
3775 (digest_nsdmi_init): Call cp_walk_tree_without_duplicates instead of
3776 cp_walk_tree.
3777
3778 2024-05-28 David Malcolm <[email protected]>
3779
3780 PR bootstrap/115167
3781 PR bootstrap/115167
3782 * call.cc: Replace include of "gcc-rich-location.h" with
3783 "c-family/c-type-mismatch.h".
3784 * error.cc: Likewise.
3785 * typeck.cc: Likewise.
3786
3787 2024-05-25 Nathaniel Shead <[email protected]>
3788
3789 PR c++/102345
3790 * module.cc (module_may_redeclare): Update error message.
3791
3792 2024-05-24 Nathaniel Shead <[email protected]>
3793
3794 PR c++/115200
3795 * parser.cc (cp_parser_error_1): Special-case unexpected module
3796 directives for better diagnostics.
3797 (cp_parser_module_declaration): Check that the module
3798 declaration is at global scope.
3799 (cp_parser_import_declaration): Sync error message with that in
3800 cp_parser_error_1.
3801
3802 2024-05-24 Nathaniel Shead <[email protected]>
3803
3804 * cp-tree.h (module_has_cmi_p): Also include header units.
3805 (module_maybe_has_cmi_p): Update comment.
3806 * module.cc (set_defining_module): Only need to track
3807 declarations for later exporting if the module may have a CMI.
3808 (set_defining_module_for_partial_spec): Likewise.
3809 * name-lookup.cc (pushdecl): Likewise.
3810
3811 2024-05-24 Nathaniel Shead <[email protected]>
3812
3813 * tree.cc (no_linkage_check): Anonymous types can't be accessed
3814 in a different TU.
3815
3816 2024-05-24 Nathaniel Shead <[email protected]>
3817
3818 PR c++/114947
3819 * cp-tree.h (set_defining_module_for_partial_spec): Declare.
3820 * module.cc (trees_in::decl_value): Track partial specs coming
3821 from partitions.
3822 (set_defining_module): Don't track partial specialisations here
3823 anymore.
3824 (set_defining_module_for_partial_spec): New function.
3825 * pt.cc (process_partial_specialization): Call it.
3826
3827 2024-05-23 Jason Merrill <[email protected]>
3828
3829 PR c++/115187
3830 * init.cc (build_delete): Use get_target_expr instead of save_expr.
3831 * tree.cc (stabilize_expr): Update comment.
3832
3833 2024-05-22 Patrick Palka <[email protected]>
3834
3835 PR c++/115159
3836 * tree.cc (build_cp_fntype_variant): Always use structural
3837 equality for types with a complex exception specification.
3838 (fixup_deferred_exception_variants): Use structural equality
3839 for adjusted variants.
3840 * typeck.cc (comp_except_specs): Require == instead of
3841 cp_tree_equal for ce_exact noexcept-spec comparison.
3842
3843 2024-05-22 Nathaniel Shead <[email protected]>
3844
3845 * decl.cc (grokfndecl): Check for main functions with language
3846 linkage or module attachment.
3847 (grokvardecl): Check for extern 'C' entities named main.
3848
3849 2024-05-21 Jonathan Wakely <[email protected]>
3850
3851 PR libstdc++/107800
3852 * cxxapi-data.csv <to_address>: Change dialect to cxx20.
3853 * std-name-hint.gperf: Regenerate.
3854 * std-name-hint.h: Regenerate.
3855
3856 2024-05-21 Patrick Palka <[email protected]>
3857
3858 PR c++/115139
3859 * pt.cc (tsubst_expr) <case CONST_DECL>: Exit early if args
3860 is empty.
3861
3862 2024-05-17 Patrick Palka <[email protected]>
3863
3864 PR c++/115114
3865 * pt.cc (maybe_aggr_guide): Consider bases in the paren init case.
3866
3867 2024-05-15 Marek Polacek <[email protected]>
3868
3869 PR c++/114854
3870 * call.cc (convert_like_internal) <case ck_user>: Don't set
3871 TARGET_EXPR_DIRECT_INIT_P.
3872
3873 2024-05-15 Marek Polacek <[email protected]>
3874
3875 DR 1693
3876 PR c++/113760
3877 DR 569
3878 * parser.cc (extra_semi_kind): New.
3879 (maybe_warn_extra_semi): New.
3880 (cp_parser_declaration): Call maybe_warn_extra_semi.
3881 (cp_parser_member_declaration): Likewise.
3882
3883 2024-05-15 Jakub Jelinek <[email protected]>
3884 Jason Merrill <[email protected]>
3885
3886 PR lto/113208
3887 * cp-tree.h (maybe_optimize_cdtor): Remove.
3888 * decl2.cc (tentative_decl_linkage): Call maybe_make_one_only
3889 for implicit instantiations of maybe in charge ctors/dtors
3890 declared inline.
3891 (import_export_decl): Don't call maybe_optimize_cdtor.
3892 (c_parse_final_cleanups): Formatting fixes.
3893 * optimize.cc (can_alias_cdtor): Adjust condition, for
3894 HAVE_COMDAT_GROUP && DECL_ONE_ONLY && DECL_WEAK return true even
3895 if not DECL_INTERFACE_KNOWN.
3896 (maybe_clone_body): Don't clear DECL_SAVED_TREE, instead set it
3897 to void_node.
3898 (maybe_clone_body): Remove.
3899 * decl.cc (cxx_comdat_group): For DECL_CLONED_FUNCTION_P
3900 functions if SUPPORTS_ONE_ONLY return DECL_COMDAT_GROUP if already
3901 set.
3902
3903 2024-05-15 Jakub Jelinek <[email protected]>
3904
3905 PR c/115103
3906 * semantics.cc (finish_omp_clauses): Diagnose grainsize
3907 used together with num_tasks.
3908
3909 2024-05-15 Patrick Palka <[email protected]>
3910
3911 PR c++/114994
3912 * tree.cc (lvalue_kind) <case MODOP_EXPR>: For a class
3913 assignment, consider the result type.
3914
3915 2024-05-14 Simon Martin <[email protected]>
3916
3917 PR c++/105760
3918 * pt.cc (build_deduction_guide): Check for error_mark_node
3919 result from tsubst_arg_types.
3920
3921 2024-05-14 Jason Merrill <[email protected]>
3922
3923 * decl.cc (wrap_cleanups_r): Clarify comment.
3924 * init.cc (build_vec_init): Update comment.
3925
3926 2024-05-13 Patrick Palka <[email protected]>
3927
3928 * constraint.cc (norm_info::norm_info): Take a bool instead of
3929 tsubst_flags_t.
3930 (norm_info::generate_diagnostics): Turn this predicate function
3931 into a bool data member.
3932 (normalize_logical_operation): Adjust after norm_info changes.
3933 (normalize_concept_check): Likewise.
3934 (normalize_atom): Likewise.
3935 (get_normalized_constraints_from_info): Likewise.
3936 (normalize_concept_definition): Likewise.
3937 (normalize_constraint_expression): Likewise.
3938 (normalize_placeholder_type_constraints): Likewise.
3939 (satisfy_nondeclaration_constraints): Likewise.
3940 * cp-tree.h (enum tsubst_flags): Remove tf_norm.
3941
3942 2024-05-13 Ken Matsui <[email protected]>
3943
3944 PR c++/115061
3945 * semantics.cc (finish_trait_expr): Use rank instead of
3946 __array_rank.
3947
3948 2024-05-13 Patrick Palka <[email protected]>
3949
3950 PR c++/114974
3951 PR c++/114901
3952 PR c++/114903
3953 * pt.cc (maybe_aggr_guide): Fix obtaining TYPE_FIELDS in
3954 the paren init case. Hoist out partial substitution logic
3955 to apply to the paren init case as well.
3956 (alias_ctad_tweaks): Substitute outer template arguments into
3957 a guide's constraints.
3958
3959 2024-05-11 Ken Matsui <[email protected]>
3960
3961 * cp-trait.def: Define __is_nothrow_invocable.
3962 * constraint.cc (diagnose_trait_expr): Handle
3963 CPTK_IS_NOTHROW_INVOCABLE.
3964 * semantics.cc (trait_expr_value): Likewise.
3965 (finish_trait_expr): Likewise.
3966
3967 2024-05-11 Ken Matsui <[email protected]>
3968
3969 * cp-trait.def: Define __is_invocable.
3970 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_INVOCABLE.
3971 * semantics.cc (trait_expr_value): Likewise.
3972 (finish_trait_expr): Likewise.
3973 * cp-tree.h (build_invoke): New function.
3974 * method.cc (build_invoke): New function.
3975
3976 2024-05-11 Ken Matsui <[email protected]>
3977
3978 * cp-trait.def: Define __array_rank.
3979 * constraint.cc (diagnose_trait_expr): Handle CPTK_RANK.
3980 * semantics.cc (trait_expr_value): Likewise.
3981 (finish_trait_expr): Likewise.
3982
3983 2024-05-11 Ken Matsui <[email protected]>
3984
3985 * cp-trait.def: Define __decay.
3986 * semantics.cc (finish_trait_type): Handle CPTK_DECAY.
3987
3988 2024-05-11 Ken Matsui <[email protected]>
3989
3990 * cp-trait.def: Define __add_rvalue_reference.
3991 * semantics.cc (finish_trait_type): Handle
3992 CPTK_ADD_RVALUE_REFERENCE.
3993
3994 2024-05-11 Ken Matsui <[email protected]>
3995
3996 * cp-trait.def: Define __add_lvalue_reference.
3997 * semantics.cc (finish_trait_type): Handle
3998 CPTK_ADD_LVALUE_REFERENCE.
3999
4000 2024-05-11 Ken Matsui <[email protected]>
4001
4002 * cp-trait.def: Define __remove_all_extents.
4003 * semantics.cc (finish_trait_type): Handle
4004 CPTK_REMOVE_ALL_EXTENTS.
4005
4006 2024-05-11 Ken Matsui <[email protected]>
4007
4008 * cp-trait.def: Define __remove_extent.
4009 * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_EXTENT.
4010
4011 2024-05-11 Ken Matsui <[email protected]>
4012
4013 * cp-trait.def: Define __add_pointer.
4014 * semantics.cc (finish_trait_type): Handle CPTK_ADD_POINTER.
4015 (object_type_p): New function.
4016 (referenceable_type_p): Likewise.
4017 (trait_expr_value): Use object_type_p.
4018
4019 2024-05-11 Ken Matsui <[email protected]>
4020
4021 * cp-trait.def: Define __is_unbounded_array.
4022 * constraint.cc (diagnose_trait_expr): Handle
4023 CPTK_IS_UNBOUNDED_ARRAY.
4024 * semantics.cc (trait_expr_value): Likewise.
4025 (finish_trait_expr): Likewise.
4026
4027 2024-05-10 Jakub Jelinek <[email protected]>
4028
4029 PR target/114968
4030 * cp-tree.h (atexit_fn_ptr_type_node, cleanup_type): Adjust macro
4031 comments.
4032 (get_cxa_atexit_fn_ptr_type): Declare.
4033 * decl.cc (get_atexit_fn_ptr_type): Adjust function comment, only
4034 build type for atexit argument.
4035 (get_cxa_atexit_fn_ptr_type): New function.
4036 (get_atexit_node): Call get_cxa_atexit_fn_ptr_type rather than
4037 get_atexit_fn_ptr_type when using __cxa_atexit.
4038 (get_thread_atexit_node): Call get_cxa_atexit_fn_ptr_type
4039 rather than get_atexit_fn_ptr_type.
4040 (start_cleanup_fn): Add ob_parm argument, call
4041 get_cxa_atexit_fn_ptr_type or get_atexit_fn_ptr_type depending
4042 on it and create PARM_DECL also based on that argument.
4043 (register_dtor_fn): Adjust start_cleanup_fn caller, use
4044 get_cxa_atexit_fn_ptr_type rather than get_atexit_fn_ptr_type
4045 for use_dtor casts.
4046 * except.cc (build_throw): Use get_cxa_atexit_fn_ptr_type ().
4047
4048 2024-05-09 Marek Polacek <[email protected]>
4049
4050 PR c++/114983
4051 * pt.cc (tsubst_expr) <case SIZEOF_EXPR>: Use copy_warning.
4052 * semantics.cc (finish_parenthesized_expr): Also suppress
4053 -Wsizeof-array-div.
4054
4055 2024-05-09 Marek Polacek <[email protected]>
4056
4057 PR c++/85889
4058 * lambda.cc (add_capture): Add a pedwarn for capturing structured
4059 bindings.
4060
4061 2024-05-08 Marek Polacek <[email protected]>
4062
4063 PR c++/113582
4064 * parser.cc (cp_parser_label_for_labeled_statement): suppress_warning
4065 if it's not enabled at input_location.
4066 * pt.cc (tsubst_stmt): Call copy_warning.
4067
4068 2024-05-07 Nathaniel Shead <[email protected]>
4069
4070 PR c++/114856
4071 * call.cc (make_temporary_var_for_ref_to_temp): Set context for
4072 temporaries with linkage.
4073 * init.cc (create_temporary_var): Revert to only set context
4074 when in a function decl.
4075
4076 2024-05-07 Andrew Pinski <[email protected]>
4077
4078 PR c++/89224
4079 * constexpr.cc (cxx_eval_array_reference): Compare main variants
4080 for the vector/array types instead of the types directly.
4081
4082 2024-05-07 Jakub Jelinek <[email protected]>
4083
4084 PR c++/114459
4085 * parser.cc (cp_parser_member_declaration): Implement C++26
4086 P2893R3 - Variadic friends. Parse friend type declarations
4087 with ... or with more than one friend type specifier.
4088 * friend.cc (make_friend_class): Allow TYPE_PACK_EXPANSION.
4089 * pt.cc (instantiate_class_template): Handle PACK_EXPANSION_P
4090 in friend classes.
4091
4092 2024-05-07 Marek Polacek <[email protected]>
4093
4094 * decl.cc (duplicate_decls): Don't check VAR_P before
4095 DECL_DECOMPOSITION_P.
4096 * init.cc (build_aggr_init): Likewise.
4097 * parser.cc (cp_parser_range_for): Likewise.
4098 (do_range_for_auto_deduction): Likewise.
4099 (cp_convert_range_for): Likewise.
4100 (cp_convert_omp_range_for): Likewise.
4101 (cp_finish_omp_range_for): Likewise.
4102 * pt.cc (extract_locals_r): Likewise.
4103 (tsubst_omp_for_iterator): Likewise.
4104 (tsubst_decomp_names): Likewise.
4105 (tsubst_stmt): Likewise.
4106 * typeck.cc (maybe_warn_about_returning_address_of_local): Likewise.
4107
4108 2024-05-07 Rainer Orth <[email protected]>
4109
4110 * Make-lang.in (cc1plus$(exeext)): Remove $(NETLIBS).
4111
4112 2024-05-07 Nathaniel Shead <[email protected]>
4113
4114 PR c++/114954
4115 * cp-tree.h (IS_FAKE_BASE_TYPE): Also apply to unions.
4116
4117 2024-05-07 Nathaniel Shead <[email protected]>
4118
4119 PR c++/114275
4120 * cp-tree.h (remove_defining_module): Declare.
4121 * decl.cc (duplicate_decls): Call remove_defining_module on
4122 to-be-freed newdecl.
4123 * module.cc (imported_temploid_friends): Mark as GTY root...
4124 (init_modules): ...and allocate from ggc.
4125 (trees_in::decl_value): Only track for declarations that won't
4126 be discarded.
4127 (remove_defining_module): New function.
4128
4129 2024-05-06 Qing Zhao <[email protected]>
4130
4131 PR c/53548
4132 * decl.cc (layout_var_decl): Handle the cases when the DECL is
4133 union with a flexible array member initializer.
4134
4135 2024-05-06 Qing Zhao <[email protected]>
4136
4137 PR c/53548
4138 * class.cc (diagnose_flexarrays): Change error to pdewarn for the case
4139 flexible array members alone in structures.
4140 * decl.cc (grokdeclarator): Change error to pdewarn for the case
4141 flexible array members in unions.
4142
4143 2024-05-03 Jason Merrill <[email protected]>
4144
4145 PR c++/114935
4146 * cp-gimplify.cc (cp_genericize_init): Add flags parm.
4147 (cp_genericize_init_expr): Pass nullptr.
4148 (cp_genericize_target_expr): Handle cleanup flags.
4149 * typeck2.cc (build_disable_temp_cleanup): Factor out of...
4150 (split_nonconstant_init): ...here.
4151 * cp-tree.h (build_disable_temp_cleanup): Declare.
4152
4153 2024-05-03 Ken Matsui <[email protected]>
4154
4155 * cp-trait.def: Define __is_pointer.
4156 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER.
4157 * semantics.cc (trait_expr_value): Likewise.
4158 (finish_trait_expr): Likewise.
4159
4160 2024-05-03 Ken Matsui <[email protected]>
4161
4162 * cp-trait.def: Define __is_volatile.
4163 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_VOLATILE.
4164 * semantics.cc (trait_expr_value): Likewise.
4165 (finish_trait_expr): Likewise.
4166
4167 2024-05-03 Ken Matsui <[email protected]>
4168
4169 * cp-trait.def: Define __is_const.
4170 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONST.
4171 * semantics.cc (trait_expr_value): Likewise.
4172 (finish_trait_expr): Likewise.
4173
4174 2024-05-03 Patrick Palka <[email protected]>
4175
4176 * coroutines.cc (instantiate_coro_traits): Adjust call to
4177 lookup_template_class.
4178 (instantiate_coro_handle_for_promise_type): Likewise.
4179 * cp-tree.h (adjust_type_for_entering_scope): Declare.
4180 (lookup_template_class): Adjust declaration.
4181 * decl.cc (make_typename_type): Adjust call to
4182 lookup_template_class. Likewise.
4183 (get_tuple_size): Likewise.
4184 (get_tuple_element_type): Likewise.
4185 * pt.cc (adjust_type_for_entering_scope): Define.
4186 (tsubst_entering_scope): Define.
4187 (lookup_template_class): Remove entering_scope parameter.
4188 Replace tsubst_aggr_type call with tsubst_entering_scope.
4189 (tsubst_aggr_type): Remove.
4190 (tsubst_aggr_type_1): Inline into tsubst.
4191 (tsubst_function_decl): Replace tsubst_aggr_type call
4192 with tsubst_entering_scope.
4193 (tsubst_template_decl): Likewise.
4194 (tsubst_decl): Likewise.
4195 (tsubst) <case RECORD_TYPE, UNION_TYPE, ENUMERAL_TYPE>:
4196 Inlined from tsubst_aggr_type_1.
4197 <case BOUND_TEMPLATE_TEMPLATE_PARM>: Adjust calls to
4198 lookup_template_class.
4199 <case TYPENAME_TYPE>: Replace tsubst_aggr_type call with
4200 tsubst_entering_scope.
4201 <case UNBOUND_CLASS_TEMPLATE>: Likewise.
4202 Increment processing_template_decl when substituting the
4203 context.
4204 (tsubst_expr) <case FIELD_DECL>: Replace tsubst_aggr_type
4205 call with tsubst_entering_scope.
4206 <case TEMPLATE_DECL>: Likewise.
4207 (instantiate_template): Likewise.
4208 (resolve_typename_type): Adjust lookup_template_class call
4209 and call adjust_type_for_entering_scope afterward.
4210 (listify): Adjust lookup_template_class call.
4211 (alias_ctad_tweaks): Likewise.
4212 * semantics.cc (finish_template_type): Adjust lookup_template_class
4213 call and maybe call adjust_type_for_entering_scope afterward.
4214
4215 2024-05-02 Nathaniel Shead <[email protected]>
4216
4217 PR c++/114917
4218 * parser.cc (cp_parser_declaration_seq_opt): Clear
4219 parser->in_unbraced_* flags when parsing toplevel declarations.
4220
4221 2024-05-02 Jakub Jelinek <[email protected]>
4222
4223 PR c++/114458
4224 * parser.cc (cp_parser_pure_specifier): Implement C++26 P2573R2
4225 - = delete("should have a reason");. Parse deleted-function-body.
4226 * decl.cc (duplicate_decls): Copy DECL_INITIAL from DECL_DELETED_FN
4227 olddecl to newdecl if it is a STRING_CST.
4228 (cp_finish_decl): Handle deleted init with a reason.
4229 * decl2.cc: Include "escaped_string.h".
4230 (grokfield): Handle deleted init with a reason.
4231 (mark_used): Emit DECL_DELETED_FN reason in the message if any.
4232 * cp-tree.h (DECL_DELETED_FN): Document representation of
4233 = delete("reason") on a DECL.
4234
4235 2024-05-02 Nathaniel Shead <[email protected]>
4236
4237 PR c++/114630
4238 * module.cc (depset::hash::add_partial_entities): Mark GM
4239 specializations as unreached.
4240 (depset::hash::find_dependencies): Also reach entities in the
4241 DECL_TEMPLATE_SPECIALIZATIONS list.
4242
4243 2024-05-02 Nathaniel Shead <[email protected]>
4244
4245 PR c++/105224
4246 * class.cc (finish_struct_1): Also push classes attached to a
4247 module into the 'keyed_classes' list.
4248 * decl.cc (record_key_method_defined): Don't push classes
4249 attached to a named module into the 'keyed_classes' list.
4250 * module.cc (trees_in::read_class_def): Likewise.
4251 * decl2.cc (import_export_class): Uniquely emit vtables for
4252 non-template classes attached to a named module.
4253 (vtables_uniquely_emitted): New function.
4254 (import_export_decl): Update comments. Update with knowledge
4255 about new kinds of uniquely emitted vtables.
4256
4257 2024-05-01 Jason Merrill <[email protected]>
4258
4259 * cp-tree.h (base_ctor_identifier): Adjust comment.
4260 * call.cc (in_charge_arg_for_name): Abort on deleting dtor.
4261 * decl2.cc (maybe_retrofit_in_chrg): Don't add it for
4262 destructors without vbases, either.
4263 * constexpr.cc (cxx_eval_call_expression): Remove workaround.
4264
4265 2024-05-01 Jason Merrill <[email protected]>
4266
4267 PR c++/113706
4268 * decl.cc (decls_match): Handle memchr return type being
4269 const-qualified.
4270
4271 2024-05-01 Nathaniel Shead <[email protected]>
4272
4273 * name-lookup.cc (walk_module_binding): Use the
4274 partition-specific hidden flag instead of the top-level
4275 decl_hidden.
4276
4277 2024-05-01 Nathaniel Shead <[email protected]>
4278
4279 PR c++/114868
4280 * module.cc (depset::hash::add_binding_entity): Propagate
4281 OVL_USING_P for using-declarations.
4282
4283 2024-05-01 Nathaniel Shead <[email protected]>
4284
4285 PR c++/107688
4286 * name-lookup.cc (push_namespace): Error when exporting
4287 namespace with internal linkage.
4288 * parser.h (struct cp_parser): Add new flag
4289 'in_unbraced_export_declaration_p'.
4290 * parser.cc (cp_debug_parser): Print the new flag.
4291 (cp_parser_new): Initialise the new flag.
4292 (cp_parser_module_export): Set the new flag.
4293 (cp_parser_class_specifier): Clear and restore the new flag.
4294 (cp_parser_import_declaration): Imports can now appear directly
4295 in a linkage specification.
4296 (cp_parser_declaration): Categorise declarations as "name" or
4297 "special"; error on the later in contexts where the former is
4298 required.
4299 (cp_parser_class_head): Error when exporting a partial
4300 specialisation.
4301
4302 2024-04-30 Jakub Jelinek <[email protected]>
4303
4304 PR c++/114456
4305 * parser.cc (cp_parser_decomposition_declaration): Implement C++26
4306 P0609R3 - Attributes for Structured Bindings. Parse attributed
4307 identifier lists for structured binding declarations, pass the
4308 attributes to start_decl.
4309
4310 2024-04-30 Nathaniel Shead <[email protected]>
4311
4312 PR c++/105320
4313 PR c++/114275
4314 * cp-tree.h (propagate_defining_module): Declare.
4315 (lookup_imported_hidden_friend): Declare.
4316 * decl.cc (duplicate_decls): Also check if hidden decls can be
4317 redeclared in this module.
4318 * module.cc (imported_temploid_friends): New.
4319 (init_modules): Initialize it.
4320 (trees_out::decl_value): Write it; don't consider imported
4321 temploid friends as attached to a module.
4322 (trees_in::decl_value): Read it.
4323 (get_originating_module_decl): Follow the owning decl for an
4324 imported temploid friend.
4325 (propagate_defining_module): New.
4326 * name-lookup.cc (get_mergeable_namespace_binding): New.
4327 (lookup_imported_hidden_friend): New.
4328 * pt.cc (tsubst_friend_function): Propagate defining module for
4329 new friend functions.
4330 (tsubst_friend_class): Lookup imported hidden friends. Check
4331 for valid module attachment of existing names. Propagate
4332 defining module for new classes.
4333
4334 2024-04-30 Nathaniel Shead <[email protected]>
4335
4336 * cp-tree.h (module_may_redeclare): Add default parameter.
4337 * decl.cc (duplicate_decls): Don't emit errors for failed
4338 module_may_redeclare.
4339 (xref_tag): Likewise.
4340 (start_enum): Likewise.
4341 * semantics.cc (begin_class_definition): Likewise.
4342 * module.cc (module_may_redeclare): Clean up logic. Emit error
4343 messages on failure.
4344
4345 2024-04-30 Patrick Palka <[email protected]>
4346
4347 PR c++/114889
4348 * module.cc (trees_in::read_class_def): Look through
4349 TEMPLATE_DECL when adding to CLASSTYPE_BEFRIENDING_CLASSES.
4350
4351 2024-04-30 Patrick Palka <[email protected]>
4352
4353 PR c++/114888
4354 * typeck.cc (cp_build_binary_op) <case *_DIV_*>: Add missing
4355 dependence check for the second sizeof operand.
4356
4357 2024-04-26 Patrick Palka <[email protected]>
4358
4359 * error.cc (print_instantiation_partial_context_line): Clear the
4360 pretty printer prefix around the call to diagnostic_show_locus.
4361
4362 2024-04-25 Jakub Jelinek <[email protected]>
4363
4364 PR c++/111284
4365 * constexpr.cc (cxx_bind_parameters_in_call): For PARM_DECLs with
4366 TREE_ADDRESSABLE types use vc_glvalue rather than vc_prvalue for
4367 cxx_eval_constant_expression and if it doesn't have the same
4368 type as it should, cast the reference type to reference to type
4369 before convert_from_reference and instead of adjust_temp_type
4370 take address of the arg, cast to reference to type and then
4371 convert_from_reference.
4372 (cxx_eval_constant_expression) <case PARM_DECL>: For lval case
4373 on parameters with TREE_ADDRESSABLE types lookup result in
4374 ctx->globals if possible. Otherwise if lookup in ctx->globals
4375 was successful for parameter with TREE_ADDRESSABLE type,
4376 recurse with vc_prvalue on the returned value.
4377
4378 2024-04-25 Jakub Jelinek <[email protected]>
4379
4380 PR lto/113208
4381 * cp-tree.h (maybe_optimize_cdtor): Declare.
4382 * decl2.cc (import_export_decl): Call it for cloned cdtors.
4383 * optimize.cc (maybe_optimize_cdtor): New function.
4384
4385 2024-04-24 Patrick Palka <[email protected]>
4386
4387 PR c++/114709
4388 * constexpr.cc (cxx_fold_indirect_ref): Restrict object/offset
4389 canonicalization to RECORD_TYPE member accesses.
4390
4391 2024-04-23 Nathaniel Shead <[email protected]>
4392
4393 * parser.cc (cp_parser_parameter_declaration): Check if
4394 decl_specifiers.type is null.
4395
4396 2024-04-23 Patrick Palka <[email protected]>
4397
4398 PR c++/114795
4399 * module.cc (trees_in::is_matching_decl): Propagate deduced
4400 function return type.
4401
4402 2024-04-23 Jakub Jelinek <[email protected]>
4403
4404 * parser.cc (cp_parser_using_declaration): Spelling fix: favour
4405 -> favor.
4406
4407 2024-04-23 Jakub Jelinek <[email protected]>
4408
4409 PR c++/114784
4410 * method.cc (implicitly_declare_fn): Call clone_attrs
4411 on DECL_ATTRIBUTES on STRIP_TEMPLATE (inherited_ctor) rather than
4412 inherited_ctor. Also copy DECL_DISREGARD_INLINE_LIMITS flag from it.
4413
4414 2024-04-23 Nathaniel Shead <[email protected]>
4415
4416 PR c++/114078
4417 * decl.cc (grokdeclarator): Check allocation functions for xobj
4418 parameters.
4419
4420 2024-04-16 Jakub Jelinek <[email protected]>
4421
4422 PR c++/114706
4423 * constexpr.cc (check_bit_cast_type): Handle ARRAY_TYPE.
4424
4425 2024-04-15 Nathaniel Shead <[email protected]>
4426 Patrick Palka <[email protected]>
4427
4428 PR c++/114600
4429 * module.cc (depset::hash::add_binding_entity): Require both
4430 WMB_Using and WMB_Export for GMF entities.
4431
4432 2024-04-14 Nathaniel Shead <[email protected]>
4433
4434 PR c++/106820
4435 * module.cc (trees_in::decl_value): Assemble alias when needed.
4436
4437 2024-04-13 Patrick Palka <[email protected]>
4438
4439 * module.cc (struct bytes_in::bits_in): Define defaulted
4440 move ctor.
4441 (struct bytes_out::bits_out): Likewise.
4442
4443 2024-04-13 Patrick Palka <[email protected]>
4444
4445 * module.cc: Update comment about classes defined within.
4446 (class data): Enclose in an anonymous namespace.
4447 (data::calc_crc): Moved from bytes::calc_crc.
4448 (class bytes): Remove. Move bit_flush to namespace scope.
4449 (class bytes_in): Enclose in an anonymous namespace. Inherit
4450 directly from data and adjust accordingly. Move b and bflush
4451 members to bits_in.
4452 (class bytes_out): As above. Remove is_set static data member.
4453 (bit_flush): Moved from class bytes.
4454 (struct bytes_in::bits_in): Define.
4455 (struct bytes_out::bits_out): Define.
4456 (bytes_in::stream_bits): Define.
4457 (bytes_out::stream_bits): Define.
4458 (bytes_out::bflush): Moved to bits_out/in.
4459 (bytes_in::bflush): Likewise
4460 (bytes_in::bfill): Removed.
4461 (bytes_out::b): Moved to bits_out/in.
4462 (bytes_in::b): Likewise.
4463 (class trees_in): Enclose in an anonymous namespace.
4464 (class trees_out): Enclose in an anonymous namespace.
4465 (trees_out::core_bools): Add bits_out/in parameter and use it.
4466 Unconditionally stream a bit for public_flag. Add early exits
4467 as appropriate.
4468 (trees_out::core_bools): Likewise.
4469 (trees_out::lang_decl_bools): Add bits_out/in parameter and use
4470 it. Flush the current bit buffer at the start. Unconditionally
4471 stream a bit for module_keyed_decls_p.
4472 (trees_in::lang_decl_bools): Likewise.
4473 (trees_out::lang_type_bools): Add bits_out/in parameter and use
4474 it. Flush the current bit buffer at the start.
4475 (trees_in::lang_type_bools): Likewise.
4476 (trees_out::tree_node_bools): Construct a bits_out object and
4477 use/pass it.
4478 (trees_in::tree_node_bools): Likewise.
4479 (trees_out::decl_value): Likewise.
4480 (trees_in::decl_value): Likewise.
4481 (module_state::write_define): Likewise.
4482 (module_state::read_define): Likewise.
4483
4484 2024-04-12 Marek Polacek <[email protected]>
4485
4486 PR c++/109966
4487 * typeck2.cc (potential_prvalue_result_of): Remove.
4488 (replace_placeholders_for_class_temp_r): Check TARGET_EXPR_ELIDING_P.
4489 Use a pset. Don't replace_placeholders in TARGET_EXPRs that initialize
4490 a function argument.
4491
4492 2024-04-12 Patrick Palka <[email protected]>
4493
4494 PR c++/99426
4495 * module.cc (merge_kind::MK_local_type): New enumerator.
4496 (merge_kind_name): Update.
4497 (trees_out::chained_decls): Move BLOCK-specific handling
4498 of DECL_LOCAL_DECL_P decls to ...
4499 (trees_out::core_vals) <case BLOCK>: ... here. Stream
4500 BLOCK_VARS manually.
4501 (trees_in::core_vals) <case BLOCK>: Stream BLOCK_VARS
4502 manually. Handle deduplicated local types..
4503 (trees_out::key_local_type): Define.
4504 (trees_in::key_local_type): Define.
4505 (trees_out::get_merge_kind) <case FUNCTION_DECL>: Return
4506 MK_local_type for a local type.
4507 (trees_out::key_mergeable) <case FUNCTION_DECL>: Use
4508 key_local_type.
4509 (trees_in::key_mergeable) <case FUNCTION_DECL>: Likewise.
4510 (trees_in::is_matching_decl): Be flexible with type mismatches
4511 for local entities.
4512 (trees_in::register_duplicate): Also register the
4513 DECL_TEMPLATE_RESULT of a TEMPLATE_DECL as a duplicate.
4514 (depset_cmp): Return 0 for equal IDENTIFIER_HASH_VALUEs.
4515
4516 2024-04-12 Jason Merrill <[email protected]>
4517 Patrick Palka <[email protected]>
4518
4519 PR c++/113141
4520 * call.cc (reference_binding): For an invalid cast, warn and don't
4521 recalculate.
4522
4523 2024-04-12 Jason Merrill <[email protected]>
4524 Patrick Palka <[email protected]>
4525
4526 DR 1996
4527 PR c++/113141
4528 * call.cc (reference_binding): Check direct binding from
4529 a single-element list.
4530
4531 2024-04-12 Jakub Jelinek <[email protected]>
4532
4533 PR c++/114691
4534 * semantics.cc (simplify_loop_decl_cond): Use cp_build_unary_op with
4535 TRUTH_NOT_EXPR on ANNOTATE_EXPR argument (if any) rather than
4536 ANNOTATE_EXPR itself.
4537
4538 2024-04-12 Patrick Palka <[email protected]>
4539
4540 PR c++/114393
4541 * pt.cc (tsubst_lambda_expr): Also defer all dependent
4542 substitution.
4543
4544 2024-04-12 Jakub Jelinek <[email protected]>
4545
4546 PR c++/114426
4547 * constexpr.cc (is_valid_constexpr_fn): Return false/diagnose with
4548 complain destructors in classes with virtual bases.
4549
4550 2024-04-12 Patrick Palka <[email protected]>
4551
4552 PR c++/114393
4553 PR c++/107457
4554 PR c++/93595
4555 * cp-tree.h (LAMBDA_EXPR_EXTRA_ARGS): Define.
4556 (tree_lambda_expr::extra_args): New field.
4557 * module.cc (trees_out::core_vals) <case LAMBDA_EXPR>: Stream
4558 LAMBDA_EXPR_EXTRA_ARGS.
4559 (trees_in::core_vals) <case LAMBDA_EXPR>: Likewise.
4560 * pt.cc (has_extra_args_mechanism_p): Return true for LAMBDA_EXPR.
4561 (tree_extra_args): Handle LAMBDA_EXPR.
4562 (tsubst_lambda_expr): Use LAMBDA_EXPR_EXTRA_ARGS to defer templated
4563 substitution into a lambda-expr if we lost the template context.
4564 Add sanity check for error_mark_node result from begin_lambda_type.
4565
4566 2024-04-11 Patrick Palka <[email protected]>
4567
4568 PR c++/114303
4569 * constraint.cc (tsubst_requires_expr): Clear
4570 REQUIRES_EXPR_EXTRA_ARGS before calling build_extra_args.
4571 * pt.cc (tree_extra_args): Define.
4572 (extract_locals_r): Assert *_EXTRA_ARGS is empty.
4573 (tsubst_stmt) <case IF_STMT>: Clear IF_SCOPE on the new
4574 IF_STMT. Call build_extra_args on the new IF_STMT instead
4575 of t which might already have IF_STMT_EXTRA_ARGS.
4576
4577 2024-04-11 Jakub Jelinek <[email protected]>
4578
4579 PR c++/114409
4580 * pt.cc (tsubst_expr) <case ANNOTATE_EXPR>: Move to ...
4581 (tsubst_stmt) <case ANNOTATE_EXPR>: ... here. Use tsubst_expr
4582 instead of RECUR for the last 2 arguments.
4583
4584 2024-04-10 Jakub Jelinek <[email protected]>
4585
4586 PR c++/114462
4587 * semantics.cc: Implement C++26 P2809R3 - Trivial infinite
4588 loops are not Undefined Behavior.
4589 (maybe_warn_for_constant_evaluated): Add trivial_infinite argument
4590 and emit special diagnostics for that case.
4591 (finish_if_stmt_cond): Adjust caller.
4592 (finish_loop_cond): New function.
4593 (finish_while_stmt): Use it.
4594 (finish_do_stmt): Likewise.
4595 (finish_for_stmt): Likewise.
4596
4597 2024-04-10 Nathaniel Shead <[email protected]>
4598
4599 PR c++/104040
4600 * semantics.cc (expand_or_defer_fn_1): Keep DECL_SAVED_TREE for
4601 all vague linkage cdtors with modules.
4602
4603 2024-04-10 Nathaniel Shead <[email protected]>
4604
4605 PR c++/99377
4606 * module.cc (trees_in::install_entity): Overwrite entity map
4607 index if installing from a partition.
4608
4609 2024-04-09 Jakub Jelinek <[email protected]>
4610
4611 PR c++/114580
4612 * semantics.cc (finish_if_stmt_cond): Call
4613 maybe_warn_for_constant_evaluated with IF_STMT_CONSTEXPR_P (if_stmt)
4614 as the second argument, rather than true/false depending on if
4615 it is if constexpr with non-dependent constant expression with
4616 bool type.
4617
4618 2024-04-09 Jakub Jelinek <[email protected]>
4619
4620 * constexpr.cc (build_new_constexpr_heap_type): Fix duplicated words
4621 in comment; is is -> is.
4622 * cp-tree.def (CO_RETURN_EXPR): Fix duplicated words in comment;
4623 for for -> for.
4624 * parser.cc (fixup_blocks_walker): Fix duplicated words in comment;
4625 is is -> is.
4626 * semantics.cc (fixup_template_type): Fix duplicated words in comment;
4627 for for -> for.
4628 (finish_omp_for): Fix duplicated words in comment; the the -> the.
4629 * pt.cc (more_specialized_fn): Fix duplicated words in comment;
4630 think think -> think.
4631 (type_targs_deducible_from): Fix duplicated words in comment; the the
4632 -> the.
4633
4634 2024-04-05 Marek Polacek <[email protected]>
4635
4636 PR c++/111132
4637 * constexpr.cc (get_function_named_in_call): Use
4638 cp_get_fndecl_from_callee.
4639 * cvt.cc (cp_get_fndecl_from_callee): If there's a
4640 DECL_LOCAL_DECL_ALIAS, use it.
4641
4642 2024-04-05 Jakub Jelinek <[email protected]>
4643
4644 PR c++/114572
4645 * cp-gimplify.cc (cxx_omp_clause_apply_fn): Call build_cplus_new
4646 on build_call_a result if it has class type.
4647
4648 2024-04-04 centurion <[email protected]>
4649
4650 PR c++/114377
4651 * pt.cc (find_template_parameter_info::found): Use TREE_TYPE for
4652 TEMPLATE_DECL instead of DECL_INITIAL.
4653
4654 2024-04-02 Marek Polacek <[email protected]>
4655
4656 PR c++/114479
4657 * semantics.cc (trait_expr_value) <case CPTK_IS_ARRAY>: Return false
4658 for zero-sized arrays.
4659
4660 2024-04-02 Marek Polacek <[email protected]>
4661
4662 PR c++/103825
4663 * typeck.cc (is_bitfield_expr_with_lowered_type): Handle
4664 CLEANUP_POINT_EXPR.
4665
4666 2024-04-02 Jason Merrill <[email protected]>
4667
4668 PR c++/114561
4669 PR c++/114562
4670 * call.cc (convert_like_internal): Avoid adding qualification
4671 conversion in direct reference binding.
4672
4673 2024-04-01 Jason Merrill <[email protected]>
4674
4675 * typeck.cc (maybe_warn_about_returning_address_of_local):
4676 Permerror in C++26.
4677
4678 2024-03-28 Jason Merrill <[email protected]>
4679
4680 PR c++/100667
4681 * semantics.cc (same_type_ref_bind_p): New.
4682 (finish_trait_expr): Use it.
4683
4684 2024-03-26 Jakub Jelinek <[email protected]>
4685
4686 PR c++/112724
4687 * error.cc (dump_expr): Handle EXCESS_PRECISION_EXPR like NOP_EXPR.
4688
4689 2024-03-25 Marek Polacek <[email protected]>
4690
4691 PR c++/114349
4692 * name-lookup.cc (maybe_push_to_top_level): For a non-lambda,
4693 don't push to top level if decl_function_context is non-null.
4694 * pt.cc (maybe_instantiate_noexcept): Use maybe_push_to_top_level.
4695
4696 2024-03-25 Marek Polacek <[email protected]>
4697
4698 PR c++/114439
4699 * init.cc (can_init_array_with_p): Return true for a VEC_INIT_EXPR
4700 wrapped in a TARGET_EXPR.
4701
4702 2024-03-22 Marek Polacek <[email protected]>
4703
4704 PR c++/59465
4705 * init.cc (can_init_array_with_p): New.
4706 (perform_member_init): Check it.
4707
4708 2024-03-21 Marek Polacek <[email protected]>
4709
4710 PR c++/110323
4711 * decl2.cc (min_vis_expr_r) <case VAR_DECL>: Do nothing for
4712 decl_constant_var_p VAR_DECLs.
4713
4714 2024-03-20 Jakub Jelinek <[email protected]>
4715
4716 * coroutines.cc (expand_one_await_expression): Use
4717 integer_zero_node instead of build_int_cst (integer_type_node, 0)
4718 and integer_one_node instead of build_int_cst (integer_type_node, 1).
4719
4720 2024-03-19 Nathaniel Shead <[email protected]>
4721
4722 * cp-tree.h (module_maybe_has_cmi_p): New function.
4723 * decl.cc (grokfndecl): Mark block-scope functions as public if
4724 they could be visible in other TUs.
4725 * decl2.cc (no_linkage_error): Don't error for declarations that
4726 could be defined in other TUs since C++20. Suppress duplicate
4727 errors from 'check_global_declaration'.
4728 * tree.cc (no_linkage_check): In relaxed mode, don't consider
4729 types in a module CMI to have no linkage.
4730
4731 2024-03-16 Nathaniel Shead <[email protected]>
4732
4733 PR c++/112631
4734 * cp-tree.h (named_module_attach_p): New function.
4735 * decl.cc (start_decl): Check for attachment not purview.
4736 (grokmethod): Likewise.
4737
4738 2024-03-14 Chung-Lin Tang <[email protected]>
4739
4740 * parser.cc (cp_parser_oacc_data_clause): Add parsing support for
4741 'readonly' modifier, set OMP_CLAUSE_MAP_READONLY if readonly modifier
4742 found, update comments.
4743 (cp_parser_oacc_cache): Add parsing support for 'readonly' modifier,
4744 set OMP_CLAUSE__CACHE__READONLY if readonly modifier found, update
4745 comments.
4746
4747 2024-03-12 Nathaniel Shead <[email protected]>
4748
4749 PR c++/98645
4750 PR c++/98688
4751 PR c++/111224
4752 * module.cc (enum tree_tag): Add new tag for builtin types.
4753 (trees_out::start): POLY_INT_CSTs can be emitted.
4754 (trees_in::start): Likewise.
4755 (trees_out::core_vals): Stream POLY_INT_CSTs.
4756 (trees_in::core_vals): Likewise.
4757 (trees_out::type_node): Handle vectors with multiple coeffs.
4758 (trees_in::tree_node): Likewise.
4759 (init_modules): Register target-specific builtin types. Bump
4760 initial capacity slightly.
4761
4762 2024-03-08 Jakub Jelinek <[email protected]>
4763
4764 * pt.cc (tsubst_expr): Handle MEM_REF.
4765
4766 2024-03-08 Jakub Jelinek <[email protected]>
4767
4768 PR debug/113918
4769 * cp-objcp-common.cc (cp_type_dwarf_attribute): Return 1
4770 for DW_AT_export_symbols on anonymous structs or unions.
4771
4772 2024-03-08 Jakub Jelinek <[email protected]>
4773
4774 PR c++/113802
4775 * parser.cc (cp_parser_parameter_declaration): Move the xobj_param_p
4776 pack diagnostics after ellipsis handling and if an error is reported,
4777 pretend this specifier didn't appear. Formatting fix.
4778
4779 2024-03-07 Nathaniel Shead <[email protected]>
4780
4781 PR c++/114229
4782 * module.cc (trees_out::core_bools): Redetermine
4783 DECL_INTERFACE_KNOWN on stream-in for vtables and tinfo.
4784 * decl2.cc (import_export_decl): Add fixme for ABI changes with
4785 module vtables and tinfo.
4786
4787 2024-03-07 Patrick Palka <[email protected]>
4788
4789 PR c++/103994
4790 * cp-tree.h (add_mergeable_specialization): Remove second
4791 parameter.
4792 * module.cc (depset::disc_bits::DB_ALIAS_TMPL_INST_BIT): Remove.
4793 (depset::disc_bits::DB_ALIAS_SPEC_BIT): Remove.
4794 (depset::is_alias_tmpl_inst): Remove.
4795 (depset::is_alias): Remove.
4796 (merge_kind::MK_tmpl_alias_mask): Remove.
4797 (merge_kind::MK_alias_spec): Remove.
4798 (merge_kind_name): Remove entries for alias specializations.
4799 (trees_out::core_vals) <case TEMPLATE_DECL>: Adjust after
4800 removing is_alias_tmpl_inst.
4801 (trees_in::decl_value): Adjust add_mergeable_specialization
4802 calls.
4803 (trees_out::get_merge_kind) <case depset::EK_SPECIALIZATION>:
4804 Use MK_decl_spec for alias template specializations.
4805 (trees_out::key_mergeable): Simplify after MK_tmpl_alias_mask
4806 removal.
4807 (depset::hash::make_dependency): Adjust after removing
4808 DB_ALIAS_TMPL_INST_BIT.
4809 (specialization_add): Don't allow alias templates when !decl_p.
4810 (depset::hash::add_specializations): Remove now-dead code
4811 accomodating alias template specializations in the type table.
4812 * pt.cc (lookup_template_class): Dispatch early to
4813 instantiate_alias_template for alias templates. Simplify
4814 accordingly.
4815 (add_mergeable_specialization): Remove alias_p parameter and
4816 simplify accordingly.
4817
4818 2024-03-07 Patrick Palka <[email protected]>
4819
4820 PR c++/110730
4821 PR c++/105512
4822 * module.cc (module_state::write_namespaces): Stream the
4823 abi_tag attribute of an inline namespace.
4824 (module_state::read_namespaces): Likewise.
4825
4826 2024-03-07 Marek Polacek <[email protected]>
4827
4828 PR c++/110031
4829 * pt.cc (lookup_and_finish_template_variable): Pass complain to
4830 mark_used.
4831
4832 2024-03-07 Nathaniel Shead <[email protected]>
4833
4834 PR c++/98356
4835 * typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
4836 'member' will be a FUNCTION_DECL (or something like it).
4837
4838 2024-03-07 Nathaniel Shead <[email protected]>
4839
4840 PR c++/98881
4841 * module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT
4842 for template template parameters.
4843 (trees_in::tpl_parms_fini): Read it.
4844
4845 2024-03-06 Marek Polacek <[email protected]>
4846
4847 PR c++/114114
4848 * pt.cc (maybe_instantiate_noexcept): Save/restore
4849 cp_unevaluated_operand, c_inhibit_evaluation_warnings, and
4850 cp_noexcept_operand around the tsubst_expr call.
4851
4852 2024-03-06 Nathaniel Shead <[email protected]>
4853
4854 PR c++/113629
4855 * pt.cc (type_unification_real): Only use DEDUCE_CONV for the
4856 return type of a conversion function.
4857
4858 2024-03-06 Patrick Palka <[email protected]>
4859
4860 * module.cc (trees_out::get_merge_kind) <case depset::EK_DECL>:
4861 Accomodate class-scope DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P
4862 TEMPLATE_DECL. Consolidate IDENTIFIER_ANON_P cases.
4863
4864 2024-03-05 Patrick Palka <[email protected]>
4865
4866 * parser.cc (cp_parser_translation_unit): Relax GMF contents
4867 error into a pedwarn.
4868
4869 2024-03-04 Nathaniel Shead <[email protected]>
4870
4871 * name-lookup.cc (walk_module_binding): Remove completed FIXME.
4872 (do_nonmember_using_decl): Mark redeclared entities as exported
4873 when needed. Check for re-exporting internal linkage types.
4874
4875 2024-03-01 Patrick Palka <[email protected]>
4876
4877 PR c++/104919
4878 PR c++/106009
4879 * module.cc (depset::hash::sneakoscope): Remove.
4880 (trees_out::decl_node): Always add a dependency on a local type.
4881 (depset::hash::find_dependencies): Remove sneakoscope stuff.
4882
4883 2024-03-01 Nathaniel Shead <[email protected]>
4884
4885 PR c++/114170
4886 * module.cc (has_definition): Fall back to DECL_INITIALIZED_P
4887 when DECL_INITIAL is not set on a template.
4888 (module_state::write_inits): Only increment count when
4889 initializers are actually written.
4890
4891 2024-03-01 Nathaniel Shead <[email protected]>
4892
4893 PR c++/114005
4894 * init.cc (create_temporary_var): Use current_scope instead of
4895 current_function_decl.
4896
4897 2024-03-01 Patrick Palka <[email protected]>
4898
4899 * decl.cc (maybe_register_incomplete_var): Restrict second
4900 branch to static data members from a not-yet-complete class.
4901
4902 2024-03-01 Marek Polacek <[email protected]>
4903
4904 PR c++/110358
4905 PR c++/109642
4906 * call.cc (no_dangling_p): New.
4907 (reference_like_class_p): Use it.
4908 (do_warn_dangling_reference): Use it. Don't warn when the function
4909 or its enclosing class has attribute gnu::no_dangling.
4910 * tree.cc (cxx_gnu_attributes): Add gnu::no_dangling.
4911 (handle_no_dangling_attribute): New.
4912
4913 2024-03-01 Patrick Palka <[email protected]>
4914
4915 PR c++/110025
4916 PR c++/114138
4917 * cp-tree.h (make_cast_auto): Declare.
4918 * parser.cc (cp_parser_functional_cast): If the type is an auto,
4919 replace it with a level-less one via make_cast_auto.
4920 * pt.cc (find_parameter_packs_r): Don't treat level-less auto
4921 as a type parameter pack.
4922 (tsubst) <case TEMPLATE_TYPE_PARM>: Generalize CTAD placeholder
4923 auto handling to all level-less autos.
4924 (make_cast_auto): Define.
4925 (do_auto_deduction): Handle replacement of a level-less auto.
4926
4927 2024-03-01 Jakub Jelinek <[email protected]>
4928
4929 PR c++/92687
4930 * decl.cc (lookup_decomp_type): Return NULL_TREE if decomp_type_table
4931 doesn't have entry for V.
4932 * semantics.cc (finish_decltype_type): If ptds.saved, assert
4933 DECL_HAS_VALUE_EXPR_P is true and decide on tuple vs. non-tuple based
4934 on if lookup_decomp_type is NULL or not.
4935
4936 2024-02-29 Marek Polacek <[email protected]>
4937
4938 PR c++/113987
4939 * call.cc (conv_binds_to_reference_parm_p): New.
4940 * cp-tree.h (conv_binds_to_reference_parm_p): Declare.
4941 * init.cc (find_uninit_fields_r): Call it.
4942
4943 2024-02-29 Nathaniel Shead <[email protected]>
4944
4945 PR c++/111710
4946 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Remove tree checking.
4947 (struct lang_decl_base): Update comments and fix whitespace.
4948 * module.cc (trees_out::lang_decl_bools): Always write
4949 module_keyed_decls_p flag...
4950 (trees_in::lang_decl_bools): ...and always read it.
4951 (trees_out::decl_value): Handle all kinds of keyed decls.
4952 (trees_in::decl_value): Likewise.
4953 (trees_in::tree_value): Deduplicate LAMBDA_EXPRs.
4954 (maybe_key_decl): Also support lambdas attached to fields,
4955 parameters, and types. Key lambdas attached to fields to their
4956 class.
4957 (trees_out::get_merge_kind): Likewise.
4958 (trees_out::key_mergeable): Likewise.
4959 (trees_in::key_mergeable): Support keyed decls in a TYPE_DECL
4960 container.
4961 * parser.cc (cp_parser_class_head): Start a lambda scope when
4962 parsing base classes.
4963
4964 2024-02-28 Jakub Jelinek <[email protected]>
4965 Patrick Palka <[email protected]>
4966
4967 PR c++/113976
4968 * decl.cc (grokdeclarator): Don't call cp_apply_type_quals_to_decl
4969 on DECL_TEMPLATE_INSTANTIATED VAR_DECLs.
4970
4971 2024-02-28 Nathaniel Shead <[email protected]>
4972
4973 PR c++/113970
4974 PR c++/114013
4975 * decl.cc (make_rtl_for_nonlocal_decl): Don't defer inline
4976 variables.
4977
4978 2024-02-23 Jakub Jelinek <[email protected]>
4979
4980 PR c++/113083
4981 * cp-gimplify.cc (cp_fold): For targetm.cxx.cdtor_returns_this ()
4982 wrap r into a COMPOUND_EXPR and return folded CALL_EXPR_ARG (x, 0).
4983
4984 2024-02-19 Patrick Palka <[email protected]>
4985
4986 PR c++/113966
4987 * constraint.cc (tsubst_compound_requirement): Don't check
4988 the noexcept condition or the return-type-requirement when
4989 partially substituting.
4990
4991 2024-02-17 Marek Polacek <[email protected]>
4992
4993 PR c++/113158
4994 * search.cc (maybe_check_overriding_exception_spec): Defer checking
4995 when a noexcept couldn't be instantiated & evaluated to false/true.
4996
4997 2024-02-16 Marek Polacek <[email protected]>
4998
4999 DR 1351
5000 * search.cc (maybe_check_overriding_exception_spec): Don't error about
5001 a looser exception specification if the overrider is deleted.
5002
5003 2024-02-16 Marek Polacek <[email protected]>
5004
5005 PR c++/113789
5006 PR c++/113853
5007 * typeck.cc (treat_lvalue_as_rvalue_p): Update code to better
5008 reflect [expr.prim.id.unqual]#4.2.
5009
5010 2024-02-16 Jakub Jelinek <[email protected]>
5011
5012 PR c++/113929
5013 * parser.cc (cp_parser_parameter_declaration): Diagnose this specifier
5014 on template parameter declaration.
5015
5016 2024-02-16 Patrick Palka <[email protected]>
5017
5018 * module.cc (trees_out::core_bools): Stream TREE_UNAVAILABLE.
5019 (trees_in::core_bools): Likewise.
5020 (trees_out::core_vals): Stream LAMBDA_EXPR_REGEN_INFO.
5021 (trees_in::core_vals): Likewise.
5022
5023 2024-02-14 Nathaniel Shead <[email protected]>
5024
5025 PR c++/113708
5026 * decl.cc (make_rtl_for_nonlocal_decl): Defer inline variables.
5027 * decl2.cc (import_export_decl): Support inline variables.
5028
5029 2024-02-14 Patrick Palka <[email protected]>
5030
5031 PR c++/113908
5032 PR c++/113332
5033 * method.cc (synthesized_method_walk): Use maybe_push_to_top_level.
5034
5035 2024-02-14 Nathaniel Shead <[email protected]>
5036
5037 PR c++/99573
5038 * decl.cc (start_enum): Reorder check for redeclaring in module.
5039 Add missing auto_diagnostic_groups.
5040
5041 2024-02-13 Marek Polacek <[email protected]>
5042
5043 DR 1693
5044 PR c++/113760
5045 * parser.cc (cp_parser_member_declaration): Only pedwarn about an extra
5046 semicolon in C++98.
5047
5048 2024-02-13 Tobias Burnus <[email protected]>
5049
5050 PR middle-end/113904
5051 * parser.cc (cp_parser_omp_context_selector): Handle splitting of
5052 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
5053
5054 2024-02-13 Patrick Palka <[email protected]>
5055
5056 * Make-lang.in (CFLAGS-cp/module.o): Add $(ZLIBINC).
5057 * module.cc: Include <zlib.h>.
5058 (bytes::calc_crc): Use crc32 from zlib.
5059 (bytes_out::set_crc): Use crc32_combine from zlib.
5060
5061 2024-02-13 Patrick Palka <[email protected]>
5062
5063 * module.cc (depset::hash::add_specializations): Use
5064 STRIP_TEMPLATE consistently.
5065 (get_originating_module_decl): Handle class-scope CONST_DECL.
5066
5067 2024-02-13 Patrick Palka <[email protected]>
5068
5069 * lambda.cc (lambda_function): Call get_class_binding_direct
5070 instead of lookup_member to sidestep lazy loading.
5071 * name-lookup.cc (check_local_shadow): Punt if we're in a
5072 function context that's not actual parsing.
5073
5074 2024-02-13 Jason Merrill <[email protected]>
5075
5076 PR c++/113612
5077 * pt.cc (process_partial_specialization): Return early
5078 on redeclaration.
5079
5080 2024-02-13 Marek Polacek <[email protected]>
5081
5082 PR c++/112436
5083 * except.cc (expand_start_catch_block): Pass tf_warning_or_error to
5084 is_admissible_throw_operand_or_catch_parameter.
5085 (build_throw): Pass complain to
5086 is_admissible_throw_operand_or_catch_parameter.
5087 (complete_ptr_ref_or_void_ptr_p): Add a tsubst_flags_t parameter. Use
5088 it. Return bool. Call complete_type_or_maybe_complain instead of
5089 complete_type_or_else.
5090 (is_admissible_throw_operand_or_catch_parameter): Add a tsubst_flags_t
5091 parameter. Use it. Guard error calls.
5092
5093 2024-02-13 Alex Coplan <[email protected]>
5094
5095 PR c++/113658
5096 * cp-objcp-common.cc (cp_feature_table): Remove entry for
5097 cxx_constexpr_string_builtins.
5098
5099 2024-02-12 Marek Polacek <[email protected]>
5100
5101 PR c++/113545
5102 * constexpr.cc (cxx_eval_switch_expr): If the condition doesn't reduce
5103 to an INTEGER_CST, consider it non-constant.
5104
5105 2024-02-10 Marek Polacek <[email protected]>
5106
5107 DR 2237
5108 PR c++/107126
5109 PR c++/97202
5110 * parser.cc (cp_parser_unqualified_id): Downgrade the DR2237 error to
5111 a pedwarn.
5112 (cp_parser_constructor_declarator_p): Likewise.
5113
5114 2024-02-10 Jakub Jelinek <[email protected]>
5115
5116 * tree.cc (debug_binfo): Use HOST_WIDE_INT_PRINT_DEC instead of "%ld"
5117 and casts to long.
5118 * pt.cc (print_template_statistics): Use HOST_SIZE_T_PRINT_DEC
5119 and casts to fmt_size_t instead of "%ld" and casts to long.
5120 * class.cc (dump_class_hierarchy_1): Use HOST_WIDE_INT_PRINT_UNSIGNED
5121 instead of "%lu" and casts to unsigned long. For TYPE_ALIGN, use
5122 %u instead of %lu and drop casts to unsigned long.
5123 * parser.cc (cp_lexer_peek_nth_token): Use HOST_SIZE_T_PRINT_DEC
5124 and casts to fmt_size_t instead of "%ld" and casts to long.
5125
5126 2024-02-09 Marek Polacek <[email protected]>
5127
5128 PR c++/113834
5129 * semantics.cc (finish_type_pack_element): Perform range checking
5130 before tree_to_shwi.
5131
5132 2024-02-09 Marek Polacek <[email protected]>
5133
5134 PR c++/98388
5135 * coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error
5136 to build_throw.
5137 (morph_fn_to_coro): Likewise.
5138 * cp-tree.h (build_throw): Adjust.
5139 * except.cc (expand_end_catch_block): Pass tf_warning_or_error to
5140 build_throw.
5141 (build_throw): Add a tsubst_flags_t parameter. Use it. Remove
5142 redundant variable. Guard an inform call.
5143 * parser.cc (cp_parser_throw_expression): Pass tf_warning_or_error
5144 to build_throw.
5145 * pt.cc (tsubst_expr) <case THROW_EXPR>: Pass complain to build_throw.
5146
5147 2024-02-09 Patrick Palka <[email protected]>
5148
5149 PR c++/112580
5150 * module.cc (trees_in::read_class_def): When streaming in
5151 an anonymous union field of an as-base class, don't overwrite
5152 ANON_AGGR_TYPE_FIELD.
5153
5154 2024-02-08 Patrick Palka <[email protected]>
5155
5156 PR c++/113649
5157 * pt.cc (do_class_deduction): Add outer_targs parameter.
5158 Substitute outer arguments into the CTAD template.
5159 (do_auto_deduction): Pass outer_targs to do_class_deduction.
5160
5161 2024-02-08 Jason Merrill <[email protected]>
5162
5163 * pt.cc (create_template_parm_object): Pass TARGET_EXPR to
5164 cxx_constant_value.
5165
5166 2024-02-06 Jakub Jelinek <[email protected]>
5167
5168 PR c++/113788
5169 * parser.cc (CP_PARSER_FLAGS_PARAMETER): New enumerator.
5170 (cp_parser_decl_specifier_seq): Parse RID_THIS only if
5171 CP_PARSER_FLAGS_PARAMETER is set in flags.
5172 (cp_parser_parameter_declaration): Or in CP_PARSER_FLAGS_PARAMETER
5173 when calling cp_parser_decl_specifier_seq.
5174
5175 2024-02-06 Marek Polacek <[email protected]>
5176
5177 * method.cc (early_check_defaulted_comparison): Add
5178 auto_diagnostic_group.
5179
5180 2024-02-06 Jason Merrill <[email protected]>
5181
5182 PR c++/107291
5183 * method.cc (early_check_defaulted_comparison): Fail if not friend.
5184
5185 2024-02-05 Jason Merrill <[email protected]>
5186
5187 PR c++/111286
5188 * tree.cc (rvalue): Don't drop cv-quals from an array.
5189
5190 2024-02-03 Patrick Palka <[email protected]>
5191
5192 PR c++/110006
5193 PR c++/112769
5194 * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
5195 tsubst flags.
5196 (tsubst_valid_expression_requirement): Likewise.
5197 (tsubst_simple_requirement): Return a substituted _REQ node when
5198 processing_template_decl.
5199 (tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
5200 flags.
5201 (tsubst_type_requirement): Return a substituted _REQ node when
5202 processing_template_decl.
5203 (tsubst_compound_requirement): Likewise. Accomodate non-diagnostic
5204 tsubst flags.
5205 (tsubst_nested_requirement): Likewise.
5206 (tsubst_requires_expr): Don't defer partial substitution when
5207 processing_constraint_expression_p is true, in which case return
5208 a substituted REQUIRES_EXPR.
5209 * pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
5210 non-diagnostic tsubst flags.
5211
5212 2024-02-02 Jason Merrill <[email protected]>
5213
5214 PR c++/110084
5215 * pt.cc (tsubst_function_decl): Only check a function defaulted
5216 outside the class if the class is complete.
5217
5218 2024-02-02 Jason Merrill <[email protected]>
5219
5220 PR c++/112439
5221 * constexpr.cc (cxx_eval_store_expression): Check empty_base
5222 before marking a CONSTRUCTOR readonly.
5223
5224 2024-02-02 Jason Merrill <[email protected]>
5225
5226 PR c++/113638
5227 * cp-tree.h: Adjust comment.
5228 * pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
5229 variable template.
5230
5231 2024-02-01 Marek Polacek <[email protected]>
5232
5233 * call.cc (reference_like_class_p): Consider even non-templates for
5234 std::span-like classes.
5235
5236 2024-02-01 Patrick Palka <[email protected]>
5237
5238 PR c++/112737
5239 * pt.cc (iterative_hash_template_arg) <case TEMPLATE_DECL>:
5240 Adjust hashing to match cp_tree_equal.
5241 (ctp_hasher::hash): Also hash CLASS_PLACEHOLDER_TEMPLATE.
5242 * tree.cc (cp_tree_equal) <case TEMPLATE_DECL>: Return true
5243 for ttp TEMPLATE_DECLs if their TEMPLATE_TEMPLATE_PARMs are
5244 equivalent.
5245 * typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
5246 Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
5247
5248 2024-02-01 Marek Polacek <[email protected]>
5249
5250 PR c++/112437
5251 * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
5252 the move on throw of parms loop.
5253
5254 2024-01-30 Marek Polacek <[email protected]>
5255
5256 PR c++/110358
5257 PR c++/109640
5258 * call.cc (reference_like_class_p): Don't warn for std::span-like
5259 classes.
5260
5261 2024-01-30 Patrick Palka <[email protected]>
5262
5263 PR c++/113640
5264 * call.cc (keep_unused_object_arg): Punt for an xobj member
5265 function.
5266
5267 2024-01-30 Patrick Palka <[email protected]>
5268
5269 PR c++/113644
5270 * pt.cc (unify) <case INTEGER_CST>: Handle NULL_TREE type.
5271
5272 2024-01-30 Nathaniel Shead <[email protected]>
5273
5274 PR c++/107594
5275 * module.cc (get_module): Bail on empty name.
5276
5277 2024-01-29 Jason Merrill <[email protected]>
5278
5279 PR c++/113544
5280 * pt.cc (instantiate_class_template): Don't partially instantiate.
5281 (tsubst_stmt): Likewise.
5282
5283 2024-01-26 Nathaniel Shead <[email protected]>
5284
5285 PR c++/113580
5286 * module.cc (struct post_process_data): Create.
5287 (trees_in::post_decls): Use.
5288 (trees_in::post_process): Return entire vector at once.
5289 Change overload to take post_process_data instead of tree.
5290 (trees_out::write_function_def): Write needed flags from
5291 DECL_STRUCT_FUNCTION.
5292 (trees_in::read_function_def): Read them and pass to
5293 post_process.
5294 (module_state::read_cluster): Write flags into cfun.
5295
5296 2024-01-26 Nathaniel Shead <[email protected]>
5297
5298 PR c++/112899
5299 * cp-tree.h (note_variable_template_instantiation): Rename to...
5300 (note_vague_linkage_variable): ...this.
5301 * decl2.cc (note_variable_template_instantiation): Rename to...
5302 (note_vague_linkage_variable): ...this.
5303 * pt.cc (instantiate_decl): Rename usage of above function.
5304 * module.cc (trees_in::read_var_def): Remember pending statics
5305 that we stream in.
5306
5307 2024-01-25 Jakub Jelinek <[email protected]>
5308
5309 PR c++/113599
5310 * typeck2.cc (build_m_component_ref): Use convert instead of
5311 cp_convert for pointer conversion.
5312
5313 2024-01-25 Jason Merrill <[email protected]>
5314
5315 PR c++/113598
5316 * init.cc (build_vec_init): Don't use {} for PMF.
5317
5318 2024-01-25 Jason Merrill <[email protected]>
5319
5320 PR c++/109227
5321 * coroutines.cc (build_co_await): Use cxx_maybe_build_cleanup.
5322 (build_actor_fn, process_conditional, maybe_promote_temps)
5323 (morph_fn_to_coro): Likewise.
5324 (expand_one_await_expression): Use build_cleanup.
5325
5326 2024-01-25 Nathaniel Shead <[email protected]>
5327
5328 PR c++/113405
5329 * module.cc (set_defining_module): Track partial specialisations
5330 for all declarations.
5331
5332 2024-01-25 Nathaniel Shead <[email protected]>
5333
5334 PR c++/100707
5335 * name-lookup.cc (add_imported_namespace): Don't mark namespaces
5336 as imported.
5337
5338 2024-01-24 Patrick Palka <[email protected]>
5339
5340 PR c++/113529
5341 * call.cc (add_operator_candidates): Propagate error_mark_node
5342 result after recursing to find rewritten candidates.
5343
5344 2024-01-23 Marek Polacek <[email protected]>
5345
5346 PR c++/113256
5347 PR c++/111607
5348 PR c++/109640
5349 * call.cc (do_warn_dangling_reference): Don't warn if the temporary
5350 is of lambda type.
5351
5352 2024-01-23 Nathaniel Shead <[email protected]>
5353
5354 PR c++/112820
5355 PR c++/102607
5356 * module.cc (trees_out::lang_type_bools): Write interface_only
5357 and interface_unknown.
5358 (trees_in::lang_type_bools): Read the above flags.
5359 (trees_in::decl_value): Reset CLASSTYPE_INTERFACE_* except for
5360 extern templates.
5361 (trees_in::read_class_def): Remove buggy extern template
5362 handling.
5363
5364 2024-01-19 Jason Merrill <[email protected]>
5365
5366 PR c++/113498
5367 * pt.cc (decl_template_info): New fn.
5368 (get_template_info): Use it.
5369
5370 2024-01-19 Jason Merrill <[email protected]>
5371
5372 PR c++/112632
5373 PR c++/112594
5374 PR c++/111357
5375 PR c++/104594
5376 PR c++/67898
5377 * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
5378 * pt.cc (expand_integer_pack): Remove 111357 workaround.
5379 (maybe_convert_nontype_argument): Add force parm.
5380 (convert_template_argument): Handle alias template args
5381 specially.
5382 (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
5383 * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.
5384
5385 2024-01-18 Marek Polacek <[email protected]>
5386
5387 PR c++/113389
5388 * decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
5389 NULL_TREE when emitting an error.
5390
5391 2024-01-17 Nathaniel Shead <[email protected]>
5392
5393 PR c++/112588
5394 * module.cc (trees_in::read_function_def): Don't overwrite
5395 arguments.
5396
5397 2024-01-17 Patrick Palka <[email protected]>
5398
5399 PR c++/113242
5400 PR c++/99493
5401 * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
5402 DECL_ARTIFICIAL rejection test for class NTTP objects.
5403
5404 2024-01-16 Nathaniel Shead <[email protected]>
5405
5406 PR c++/113292
5407 * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
5408 (c_parse_final_cleanups): Suppress warning for no definition of
5409 TLS wrapper functions in header modules.
5410 * module.cc (trees_out::lang_decl_vals): Write wrapped variable
5411 for TLS wrapper functions.
5412 (trees_in::lang_decl_vals): Read it.
5413 (trees_out::decl_value): Write TLS model for thread-local vars.
5414 (trees_in::decl_value): Read it for new decls. Remember to emit
5415 definitions of TLS wrapper functions later.
5416
5417 2024-01-16 Nathaniel Shead <[email protected]>
5418
5419 * name-lookup.h (enum scope_kind): Add 'sk_count'.
5420 * name-lookup.cc (cp_binding_level_descriptor): Add missing
5421 scope kinds. Add assertion that the list is up to date. Fix
5422 handling of explicit_spec_p.
5423
5424 2024-01-16 Marek Polacek <[email protected]>
5425
5426 * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
5427 messages.
5428
5429 2024-01-16 Marek Polacek <[email protected]>
5430
5431 PR c++/113340
5432 * decl.cc (grokdeclarator) <case cdk_function>: Clear
5433 is_xobj_member_function in case of an error.
5434
5435 2024-01-16 waffl3x <[email protected]>
5436
5437 PR c++/113307
5438 * parser.cc (cp_parser_parameter_declaration): Reject packs
5439 on xobj params.
5440
5441 2024-01-15 Marek Polacek <[email protected]>
5442
5443 PR c++/110065
5444 * parser.cc (cp_parser_template_type_arg): Add auto checking.
5445
5446 2024-01-15 Patrick Palka <[email protected]>
5447
5448 * parser.cc (cp_parser_check_access_in_redeclaration): Don't
5449 check access for a partial or explicit specialization.
5450 * pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
5451 or TREE_PROTECTED on the newly created partial specialization.
5452
5453 2024-01-15 Patrick Palka <[email protected]>
5454
5455 PR c++/104634
5456 * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
5457 to the newly created partial specialization.
5458
5459 2024-01-15 Patrick Palka <[email protected]>
5460
5461 PR c++/109899
5462 * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
5463 false in a template context.
5464
5465 2024-01-13 Jakub Jelinek <[email protected]>
5466
5467 * mangle.cc (write_nested_name): Mangle explicit object
5468 member functions with H as per
5469 https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
5470
5471 2024-01-12 Jason Merrill <[email protected]>
5472
5473 PR c++/113038
5474 * name-lookup.cc (lookup_elaborated_type): Look for bindings
5475 in the global namespace in the ABI namespace.
5476
5477 2024-01-12 Jason Merrill <[email protected]>
5478
5479 * call.cc (reversed_match): New.
5480 (enum class pmatch): New enum.
5481 (cand_parms_match): Add match_kind parm.
5482 (object_parms_correspond): Add fn parms.
5483 (joust): Adjust.
5484 * class.cc (xobj_iobj_parameters_correspond): Rename to...
5485 (iobj_parm_corresponds_to): ...this. Take the other
5486 type instead of a second function.
5487 (object_parms_correspond): Adjust.
5488 * cp-tree.h (iobj_parm_corresponds_to): Declare.
5489
5490 2024-01-11 Jason Merrill <[email protected]>
5491
5492 PR c++/113191
5493 * class.cc (xobj_iobj_parameters_correspond): Add context parm.
5494 (object_parms_correspond): Factor out of...
5495 (add_method): ...here.
5496 * method.cc (defaulted_late_check): Use it.
5497 * call.cc (class_of_implicit_object): New.
5498 (object_parms_correspond): Overload taking two candidates.
5499 (cand_parms_match): Use it.
5500 (joust): Check reversed before comparing constraints.
5501 * cp-tree.h (object_parms_correspond): Declare.
5502
5503 2024-01-10 Tamar Christina <[email protected]>
5504
5505 * parser.cc (cp_parser_pragma): Initialize to false.
5506
5507 2024-01-09 Jason Merrill <[email protected]>
5508
5509 * semantics.cc (is_object_parameter): New.
5510 * cp-tree.h (is_object_parameter): Declare.
5511 * call.cc (maybe_warn_class_memaccess): Use it.
5512 * search.cc (field_access_p): Use it.
5513 (class_of_object_parm): New.
5514 (field_accessor_p): Adjust for explicit object parms.
5515
5516 2024-01-09 Jason Merrill <[email protected]>
5517
5518 * call.cc (build_over_call): Refactor handle_arg lambda.
5519 * class.cc (xobj_iobj_parameters_correspond): Fix FIXME.
5520 * method.cc (defaulted_late_check): Adjust comments.
5521
5522 2024-01-09 waffl3x <[email protected]>
5523
5524 PR c++/102609
5525 PR c++/102609
5526 C++23 P0847R7 (deducing this) - CWG2586.
5527 * decl.cc (copy_fn_p): Accept xobj copy assignment functions.
5528 (move_signature_fn_p): Accept xobj move assignment functions.
5529 * method.cc (do_build_copy_assign): Handle defaulted xobj member
5530 functions.
5531 (defaulted_late_check): Comment.
5532 (defaultable_fn_check): Comment.
5533
5534 2024-01-09 waffl3x <[email protected]>
5535
5536 PR c++/102609
5537 PR c++/102609
5538 C++23 P0847R7 (deducing this) - xobj lambdas.
5539 * lambda.cc (build_capture_proxy): Don't fold direct object types.
5540 * parser.cc (cp_parser_lambda_declarator_opt): Handle xobj lambdas,
5541 diagnostics. Comments also updated.
5542 * pt.cc (tsubst_function_decl): Handle xobj lambdas. Check object
5543 type of xobj lambda call operator, diagnose incorrect types.
5544 (tsubst_lambda_expr): Update comment.
5545 * semantics.cc (finish_decltype_type): Also consider by-value object
5546 parameter qualifications.
5547
5548 2024-01-09 waffl3x <[email protected]>
5549
5550 PR c++/102609
5551 PR c++/102609
5552 C++23 P0847R7 (deducing this) - diagnostics.
5553 * class.cc (resolve_address_of_overloaded_function): Diagnostics.
5554 * cp-tree.h (TFF_XOBJ_FUNC): Define.
5555 * decl.cc (grokfndecl): Diagnostics.
5556 (grokdeclarator): Diagnostics.
5557 * error.cc (dump_aggr_type): Pass TFF_XOBJ_FUNC.
5558 (dump_lambda_function): Formatting for xobj lambda.
5559 (dump_function_decl): Pass TFF_XOBJ_FUNC.
5560 (dump_parameters): Formatting for xobj member functions.
5561 (function_category): Formatting for xobj member functions.
5562 * parser.cc (cp_parser_decl_specifier_seq): Diagnostics.
5563 (cp_parser_parameter_declaration): Diagnostics.
5564 * search.cc (look_for_overrides_here): Make xobj member functions
5565 override.
5566 (look_for_overrides_r): Reject an overriding xobj member function
5567 and diagnose it.
5568 * semantics.cc (finish_this_expr): Diagnostics.
5569 * typeck.cc (cp_build_addr_expr_1): Diagnostics.
5570
5571 2024-01-09 waffl3x <[email protected]>
5572
5573 PR c++/102609
5574 PR c++/102609
5575 C++23 P0847R7 (deducing this) - initial functionality.
5576 * class.cc (xobj_iobj_parameters_correspond): New function, checks
5577 for corresponding object parameters between xobj and iobj member
5578 functions.
5579 (add_method): Handle object parameters of xobj member functions, use
5580 xobj_iobj_parameters_correspond.
5581 * call.cc (build_over_call): Refactor, handle xobj member functions.
5582 (cand_parms_match): Handle object parameters of xobj and iobj member
5583 functions, use xobj_iobj_parameters_correspond.
5584 * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
5585 * decl.cc (grokfndecl): Add xobj_func_p parameter. For xobj member
5586 functions, Set xobj_flag, don't set static_function flag.
5587 (grokdeclarator): Handle xobj member functions, tell grokfndecl.
5588 (grok_op_properties): Don't error for xobj operators.
5589 * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
5590 (cp_parser_parameter_declaration): Set default argument to
5591 "this_identifier" for xobj parameters.
5592 (set_and_check_decl_spec_loc): Add "this", add comments.
5593 * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
5594 * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
5595 functions.
5596
5597 2024-01-09 waffl3x <[email protected]>
5598 Jason Merrill <[email protected]>
5599
5600 PR c++/102609
5601 * cp-tree.h (struct lang_decl_fn): New data member.
5602 (DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
5603 (DECL_IOBJ_MEMBER_FUNCTION_P): Define.
5604 (DECL_FUNCTION_XOBJ_FLAG): Define.
5605 (DECL_XOBJ_MEMBER_FUNCTION_P): Define.
5606 (DECL_OBJECT_MEMBER_FUNCTION_P): Define.
5607 (DECL_FUNCTION_MEMBER_P): Don't use
5608 DECL_NONSTATIC_MEMBER_FUNCTION_P.
5609 (DECL_CONST_MEMFUNC_P): Likewise.
5610 (DECL_VOLATILE_MEMFUNC_P): Likewise.
5611 (DECL_NONSTATIC_MEMBER_P): Likewise.
5612 * module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
5613 (trees_in::lang_decl_bools): Handle xobj_flag.
5614 * call.cc (build_this_conversion)
5615 (add_function_candidate)
5616 (add_template_candidate_real)
5617 (add_candidates)
5618 (maybe_warn_class_memaccess)
5619 (cand_parms_match)
5620 (joust)
5621 (do_warn_dangling_reference)
5622 * class.cc (finalize_literal_type_property)
5623 (finish_struct)
5624 (resolve_address_of_overloaded_function)
5625 * constexpr.cc (is_valid_constexpr_fn)
5626 (cxx_bind_parameters_in_call)
5627 * contracts.cc (build_contract_condition_function)
5628 * cp-objcp-common.cc (cp_decl_dwarf_attribute)
5629 * cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
5630 (cxx_pretty_printer::declaration_specifiers)
5631 (cxx_pretty_printer::direct_declarator)
5632 * decl.cc (cp_finish_decl)
5633 (grok_special_member_properties)
5634 (start_preparsed_function)
5635 (record_key_method_defined)
5636 * decl2.cc (cp_handle_deprecated_or_unavailable)
5637 * init.cc (find_uninit_fields_r)
5638 (build_offset_ref)
5639 * lambda.cc (lambda_expr_this_capture)
5640 (maybe_generic_this_capture)
5641 (nonlambda_method_basetype)
5642 * mangle.cc (write_nested_name)
5643 * method.cc (early_check_defaulted_comparison)
5644 (skip_artificial_parms_for)
5645 (num_artificial_parms_for)
5646 * pt.cc (is_specialization_of_friend)
5647 (determine_specialization)
5648 (copy_default_args_to_explicit_spec)
5649 (check_explicit_specialization)
5650 (tsubst_contract_attribute)
5651 (check_non_deducible_conversions)
5652 (more_specialized_fn)
5653 (maybe_instantiate_noexcept)
5654 (register_parameter_specializations)
5655 (value_dependent_expression_p)
5656 * search.cc (shared_member_p)
5657 (lookup_member)
5658 (field_access_p)
5659 * semantics.cc (finish_omp_declare_simd_methods)
5660 * tree.cc (lvalue_kind)
5661 * typeck.cc (invalid_nonstatic_memfn_p): Don't use
5662 DECL_NONSTATIC_MEMBER_FUNCTION_P.
5663
5664 2024-01-09 Julian Brown <[email protected]>
5665
5666 * constexpr.cc (potential_consant_expression_1): Handle
5667 OMP_ARRAY_SECTION.
5668 * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
5669 prototypes.
5670 * decl2.cc (grok_omp_array_section): New function.
5671 * error.cc (dump_expr): Handle OMP_ARRAY_SECTION.
5672 * parser.cc (cp_parser_new): Initialize parser->omp_array_section_p.
5673 (cp_parser_statement_expr): Disallow array sections.
5674 (cp_parser_postfix_open_square_expression): Support OMP_ARRAY_SECTION
5675 parsing.
5676 (cp_parser_parenthesized_expression_list, cp_parser_lambda_expression,
5677 cp_parser_braced_list): Disallow array sections.
5678 (cp_parser_omp_var_list_no_open): Remove ALLOW_DEREF parameter, add
5679 MAP_LVALUE in its place. Support generalised lvalue parsing for
5680 OpenMP map, to and from clauses. Use OMP_ARRAY_SECTION
5681 code instead of TREE_LIST to represent OpenMP array sections.
5682 (cp_parser_omp_var_list): Remove ALLOW_DEREF parameter, add MAP_LVALUE.
5683 Pass to cp_parser_omp_var_list_no_open.
5684 (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
5685 (cp_parser_omp_clause_map): Add sk_omp scope around
5686 cp_parser_omp_var_list_no_open call.
5687 * parser.h (cp_parser): Add omp_array_section_p field.
5688 * pt.cc (tsubst, tsubst_copy, tsubst_omp_clause_decl,
5689 tsubst_copy_and_build): Add OMP_ARRAY_SECTION support.
5690 * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections,
5691 cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION
5692 instead of TREE_LIST where appropriate. Handle more types of map
5693 expression.
5694 * typeck.cc (build_omp_array_section): New function.
5695
5696 2024-01-07 Nathaniel Shead <[email protected]>
5697
5698 * module.cc (trees_out::write_var_def): Only write initializers
5699 in header modules.
5700
5701 2024-01-07 Nathaniel Shead <[email protected]>
5702
5703 PR c++/109679
5704 * module.cc (depset::hash::add_binding_entity): Don't skip names
5705 in the GMF if they've been exported with a using declaration.
5706
5707 2024-01-07 Nathaniel Shead <[email protected]>
5708
5709 PR c++/110808
5710 * parser.cc (cp_parser_module_name): Rewrite to handle
5711 module-names and module-partitions independently.
5712 (cp_parser_module_partition): New function.
5713 (cp_parser_module_declaration): Parse module partitions
5714 explicitly. Don't change state if parsing module decl failed.
5715 (cp_parser_import_declaration): Handle different kinds of
5716 import-declarations locally.
5717
5718 2024-01-03 Patrick Palka <[email protected]>
5719
5720 PR c++/113064
5721 * call.cc (reference_binding): Still try a conversion via a
5722 temporary if a direct conversion was bad.
5723
5724 2024-01-03 Kwok Cheung Yeung <[email protected]>
5725
5726 * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
5727 clause to correspond to alphabetical order.
5728
5729 Copyright (C) 2024 Free Software Foundation, Inc.
5730
5731 Copying and distribution of this file, with or without modification,
5732 are permitted in any medium without royalty provided the copyright
5733 notice and this notice are preserved.