]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2024-05-01 Jason Merrill <jason@redhat.com>
2
3 * cp-tree.h (base_ctor_identifier): Adjust comment.
4 * call.cc (in_charge_arg_for_name): Abort on deleting dtor.
5 * decl2.cc (maybe_retrofit_in_chrg): Don't add it for
6 destructors without vbases, either.
7 * constexpr.cc (cxx_eval_call_expression): Remove workaround.
8
9 2024-05-01 Jason Merrill <jason@redhat.com>
10
11 PR c++/113706
12 * decl.cc (decls_match): Handle memchr return type being
13 const-qualified.
14
15 2024-05-01 Nathaniel Shead <nathanieloshead@gmail.com>
16
17 * name-lookup.cc (walk_module_binding): Use the
18 partition-specific hidden flag instead of the top-level
19 decl_hidden.
20
21 2024-05-01 Nathaniel Shead <nathanieloshead@gmail.com>
22
23 PR c++/114868
24 * module.cc (depset::hash::add_binding_entity): Propagate
25 OVL_USING_P for using-declarations.
26
27 2024-05-01 Nathaniel Shead <nathanieloshead@gmail.com>
28
29 PR c++/107688
30 * name-lookup.cc (push_namespace): Error when exporting
31 namespace with internal linkage.
32 * parser.h (struct cp_parser): Add new flag
33 'in_unbraced_export_declaration_p'.
34 * parser.cc (cp_debug_parser): Print the new flag.
35 (cp_parser_new): Initialise the new flag.
36 (cp_parser_module_export): Set the new flag.
37 (cp_parser_class_specifier): Clear and restore the new flag.
38 (cp_parser_import_declaration): Imports can now appear directly
39 in a linkage specification.
40 (cp_parser_declaration): Categorise declarations as "name" or
41 "special"; error on the later in contexts where the former is
42 required.
43 (cp_parser_class_head): Error when exporting a partial
44 specialisation.
45
46 2024-04-30 Jakub Jelinek <jakub@redhat.com>
47
48 PR c++/114456
49 * parser.cc (cp_parser_decomposition_declaration): Implement C++26
50 P0609R3 - Attributes for Structured Bindings. Parse attributed
51 identifier lists for structured binding declarations, pass the
52 attributes to start_decl.
53
54 2024-04-30 Nathaniel Shead <nathanieloshead@gmail.com>
55
56 PR c++/105320
57 PR c++/114275
58 * cp-tree.h (propagate_defining_module): Declare.
59 (lookup_imported_hidden_friend): Declare.
60 * decl.cc (duplicate_decls): Also check if hidden decls can be
61 redeclared in this module.
62 * module.cc (imported_temploid_friends): New.
63 (init_modules): Initialize it.
64 (trees_out::decl_value): Write it; don't consider imported
65 temploid friends as attached to a module.
66 (trees_in::decl_value): Read it.
67 (get_originating_module_decl): Follow the owning decl for an
68 imported temploid friend.
69 (propagate_defining_module): New.
70 * name-lookup.cc (get_mergeable_namespace_binding): New.
71 (lookup_imported_hidden_friend): New.
72 * pt.cc (tsubst_friend_function): Propagate defining module for
73 new friend functions.
74 (tsubst_friend_class): Lookup imported hidden friends. Check
75 for valid module attachment of existing names. Propagate
76 defining module for new classes.
77
78 2024-04-30 Nathaniel Shead <nathanieloshead@gmail.com>
79
80 * cp-tree.h (module_may_redeclare): Add default parameter.
81 * decl.cc (duplicate_decls): Don't emit errors for failed
82 module_may_redeclare.
83 (xref_tag): Likewise.
84 (start_enum): Likewise.
85 * semantics.cc (begin_class_definition): Likewise.
86 * module.cc (module_may_redeclare): Clean up logic. Emit error
87 messages on failure.
88
89 2024-04-30 Patrick Palka <ppalka@redhat.com>
90
91 PR c++/114889
92 * module.cc (trees_in::read_class_def): Look through
93 TEMPLATE_DECL when adding to CLASSTYPE_BEFRIENDING_CLASSES.
94
95 2024-04-30 Patrick Palka <ppalka@redhat.com>
96
97 PR c++/114888
98 * typeck.cc (cp_build_binary_op) <case *_DIV_*>: Add missing
99 dependence check for the second sizeof operand.
100
101 2024-04-26 Patrick Palka <ppalka@redhat.com>
102
103 * error.cc (print_instantiation_partial_context_line): Clear the
104 pretty printer prefix around the call to diagnostic_show_locus.
105
106 2024-04-25 Jakub Jelinek <jakub@redhat.com>
107
108 PR c++/111284
109 * constexpr.cc (cxx_bind_parameters_in_call): For PARM_DECLs with
110 TREE_ADDRESSABLE types use vc_glvalue rather than vc_prvalue for
111 cxx_eval_constant_expression and if it doesn't have the same
112 type as it should, cast the reference type to reference to type
113 before convert_from_reference and instead of adjust_temp_type
114 take address of the arg, cast to reference to type and then
115 convert_from_reference.
116 (cxx_eval_constant_expression) <case PARM_DECL>: For lval case
117 on parameters with TREE_ADDRESSABLE types lookup result in
118 ctx->globals if possible. Otherwise if lookup in ctx->globals
119 was successful for parameter with TREE_ADDRESSABLE type,
120 recurse with vc_prvalue on the returned value.
121
122 2024-04-25 Jakub Jelinek <jakub@redhat.com>
123
124 PR lto/113208
125 * cp-tree.h (maybe_optimize_cdtor): Declare.
126 * decl2.cc (import_export_decl): Call it for cloned cdtors.
127 * optimize.cc (maybe_optimize_cdtor): New function.
128
129 2024-04-24 Patrick Palka <ppalka@redhat.com>
130
131 PR c++/114709
132 * constexpr.cc (cxx_fold_indirect_ref): Restrict object/offset
133 canonicalization to RECORD_TYPE member accesses.
134
135 2024-04-23 Nathaniel Shead <nathanieloshead@gmail.com>
136
137 * parser.cc (cp_parser_parameter_declaration): Check if
138 decl_specifiers.type is null.
139
140 2024-04-23 Patrick Palka <ppalka@redhat.com>
141
142 PR c++/114795
143 * module.cc (trees_in::is_matching_decl): Propagate deduced
144 function return type.
145
146 2024-04-23 Jakub Jelinek <jakub@redhat.com>
147
148 * parser.cc (cp_parser_using_declaration): Spelling fix: favour
149 -> favor.
150
151 2024-04-23 Jakub Jelinek <jakub@redhat.com>
152
153 PR c++/114784
154 * method.cc (implicitly_declare_fn): Call clone_attrs
155 on DECL_ATTRIBUTES on STRIP_TEMPLATE (inherited_ctor) rather than
156 inherited_ctor. Also copy DECL_DISREGARD_INLINE_LIMITS flag from it.
157
158 2024-04-23 Nathaniel Shead <nathanieloshead@gmail.com>
159
160 PR c++/114078
161 * decl.cc (grokdeclarator): Check allocation functions for xobj
162 parameters.
163
164 2024-04-16 Jakub Jelinek <jakub@redhat.com>
165
166 PR c++/114706
167 * constexpr.cc (check_bit_cast_type): Handle ARRAY_TYPE.
168
169 2024-04-15 Nathaniel Shead <nathanieloshead@gmail.com>
170 Patrick Palka <ppalka@redhat.com>
171
172 PR c++/114600
173 * module.cc (depset::hash::add_binding_entity): Require both
174 WMB_Using and WMB_Export for GMF entities.
175
176 2024-04-14 Nathaniel Shead <nathanieloshead@gmail.com>
177
178 PR c++/106820
179 * module.cc (trees_in::decl_value): Assemble alias when needed.
180
181 2024-04-13 Patrick Palka <ppalka@redhat.com>
182
183 * module.cc (struct bytes_in::bits_in): Define defaulted
184 move ctor.
185 (struct bytes_out::bits_out): Likewise.
186
187 2024-04-13 Patrick Palka <ppalka@redhat.com>
188
189 * module.cc: Update comment about classes defined within.
190 (class data): Enclose in an anonymous namespace.
191 (data::calc_crc): Moved from bytes::calc_crc.
192 (class bytes): Remove. Move bit_flush to namespace scope.
193 (class bytes_in): Enclose in an anonymous namespace. Inherit
194 directly from data and adjust accordingly. Move b and bflush
195 members to bits_in.
196 (class bytes_out): As above. Remove is_set static data member.
197 (bit_flush): Moved from class bytes.
198 (struct bytes_in::bits_in): Define.
199 (struct bytes_out::bits_out): Define.
200 (bytes_in::stream_bits): Define.
201 (bytes_out::stream_bits): Define.
202 (bytes_out::bflush): Moved to bits_out/in.
203 (bytes_in::bflush): Likewise
204 (bytes_in::bfill): Removed.
205 (bytes_out::b): Moved to bits_out/in.
206 (bytes_in::b): Likewise.
207 (class trees_in): Enclose in an anonymous namespace.
208 (class trees_out): Enclose in an anonymous namespace.
209 (trees_out::core_bools): Add bits_out/in parameter and use it.
210 Unconditionally stream a bit for public_flag. Add early exits
211 as appropriate.
212 (trees_out::core_bools): Likewise.
213 (trees_out::lang_decl_bools): Add bits_out/in parameter and use
214 it. Flush the current bit buffer at the start. Unconditionally
215 stream a bit for module_keyed_decls_p.
216 (trees_in::lang_decl_bools): Likewise.
217 (trees_out::lang_type_bools): Add bits_out/in parameter and use
218 it. Flush the current bit buffer at the start.
219 (trees_in::lang_type_bools): Likewise.
220 (trees_out::tree_node_bools): Construct a bits_out object and
221 use/pass it.
222 (trees_in::tree_node_bools): Likewise.
223 (trees_out::decl_value): Likewise.
224 (trees_in::decl_value): Likewise.
225 (module_state::write_define): Likewise.
226 (module_state::read_define): Likewise.
227
228 2024-04-12 Marek Polacek <polacek@redhat.com>
229
230 PR c++/109966
231 * typeck2.cc (potential_prvalue_result_of): Remove.
232 (replace_placeholders_for_class_temp_r): Check TARGET_EXPR_ELIDING_P.
233 Use a pset. Don't replace_placeholders in TARGET_EXPRs that initialize
234 a function argument.
235
236 2024-04-12 Patrick Palka <ppalka@redhat.com>
237
238 PR c++/99426
239 * module.cc (merge_kind::MK_local_type): New enumerator.
240 (merge_kind_name): Update.
241 (trees_out::chained_decls): Move BLOCK-specific handling
242 of DECL_LOCAL_DECL_P decls to ...
243 (trees_out::core_vals) <case BLOCK>: ... here. Stream
244 BLOCK_VARS manually.
245 (trees_in::core_vals) <case BLOCK>: Stream BLOCK_VARS
246 manually. Handle deduplicated local types..
247 (trees_out::key_local_type): Define.
248 (trees_in::key_local_type): Define.
249 (trees_out::get_merge_kind) <case FUNCTION_DECL>: Return
250 MK_local_type for a local type.
251 (trees_out::key_mergeable) <case FUNCTION_DECL>: Use
252 key_local_type.
253 (trees_in::key_mergeable) <case FUNCTION_DECL>: Likewise.
254 (trees_in::is_matching_decl): Be flexible with type mismatches
255 for local entities.
256 (trees_in::register_duplicate): Also register the
257 DECL_TEMPLATE_RESULT of a TEMPLATE_DECL as a duplicate.
258 (depset_cmp): Return 0 for equal IDENTIFIER_HASH_VALUEs.
259
260 2024-04-12 Jason Merrill <jason@redhat.com>
261 Patrick Palka <ppalka@redhat.com>
262
263 PR c++/113141
264 * call.cc (reference_binding): For an invalid cast, warn and don't
265 recalculate.
266
267 2024-04-12 Jason Merrill <jason@redhat.com>
268 Patrick Palka <ppalka@redhat.com>
269
270 DR 1996
271 PR c++/113141
272 * call.cc (reference_binding): Check direct binding from
273 a single-element list.
274
275 2024-04-12 Jakub Jelinek <jakub@redhat.com>
276
277 PR c++/114691
278 * semantics.cc (simplify_loop_decl_cond): Use cp_build_unary_op with
279 TRUTH_NOT_EXPR on ANNOTATE_EXPR argument (if any) rather than
280 ANNOTATE_EXPR itself.
281
282 2024-04-12 Patrick Palka <ppalka@redhat.com>
283
284 PR c++/114393
285 * pt.cc (tsubst_lambda_expr): Also defer all dependent
286 substitution.
287
288 2024-04-12 Jakub Jelinek <jakub@redhat.com>
289
290 PR c++/114426
291 * constexpr.cc (is_valid_constexpr_fn): Return false/diagnose with
292 complain destructors in classes with virtual bases.
293
294 2024-04-12 Patrick Palka <ppalka@redhat.com>
295
296 PR c++/114393
297 PR c++/107457
298 PR c++/93595
299 * cp-tree.h (LAMBDA_EXPR_EXTRA_ARGS): Define.
300 (tree_lambda_expr::extra_args): New field.
301 * module.cc (trees_out::core_vals) <case LAMBDA_EXPR>: Stream
302 LAMBDA_EXPR_EXTRA_ARGS.
303 (trees_in::core_vals) <case LAMBDA_EXPR>: Likewise.
304 * pt.cc (has_extra_args_mechanism_p): Return true for LAMBDA_EXPR.
305 (tree_extra_args): Handle LAMBDA_EXPR.
306 (tsubst_lambda_expr): Use LAMBDA_EXPR_EXTRA_ARGS to defer templated
307 substitution into a lambda-expr if we lost the template context.
308 Add sanity check for error_mark_node result from begin_lambda_type.
309
310 2024-04-11 Patrick Palka <ppalka@redhat.com>
311
312 PR c++/114303
313 * constraint.cc (tsubst_requires_expr): Clear
314 REQUIRES_EXPR_EXTRA_ARGS before calling build_extra_args.
315 * pt.cc (tree_extra_args): Define.
316 (extract_locals_r): Assert *_EXTRA_ARGS is empty.
317 (tsubst_stmt) <case IF_STMT>: Clear IF_SCOPE on the new
318 IF_STMT. Call build_extra_args on the new IF_STMT instead
319 of t which might already have IF_STMT_EXTRA_ARGS.
320
321 2024-04-11 Jakub Jelinek <jakub@redhat.com>
322
323 PR c++/114409
324 * pt.cc (tsubst_expr) <case ANNOTATE_EXPR>: Move to ...
325 (tsubst_stmt) <case ANNOTATE_EXPR>: ... here. Use tsubst_expr
326 instead of RECUR for the last 2 arguments.
327
328 2024-04-10 Jakub Jelinek <jakub@redhat.com>
329
330 PR c++/114462
331 * semantics.cc: Implement C++26 P2809R3 - Trivial infinite
332 loops are not Undefined Behavior.
333 (maybe_warn_for_constant_evaluated): Add trivial_infinite argument
334 and emit special diagnostics for that case.
335 (finish_if_stmt_cond): Adjust caller.
336 (finish_loop_cond): New function.
337 (finish_while_stmt): Use it.
338 (finish_do_stmt): Likewise.
339 (finish_for_stmt): Likewise.
340
341 2024-04-10 Nathaniel Shead <nathanieloshead@gmail.com>
342
343 PR c++/104040
344 * semantics.cc (expand_or_defer_fn_1): Keep DECL_SAVED_TREE for
345 all vague linkage cdtors with modules.
346
347 2024-04-10 Nathaniel Shead <nathanieloshead@gmail.com>
348
349 PR c++/99377
350 * module.cc (trees_in::install_entity): Overwrite entity map
351 index if installing from a partition.
352
353 2024-04-09 Jakub Jelinek <jakub@redhat.com>
354
355 PR c++/114580
356 * semantics.cc (finish_if_stmt_cond): Call
357 maybe_warn_for_constant_evaluated with IF_STMT_CONSTEXPR_P (if_stmt)
358 as the second argument, rather than true/false depending on if
359 it is if constexpr with non-dependent constant expression with
360 bool type.
361
362 2024-04-09 Jakub Jelinek <jakub@redhat.com>
363
364 * constexpr.cc (build_new_constexpr_heap_type): Fix duplicated words
365 in comment; is is -> is.
366 * cp-tree.def (CO_RETURN_EXPR): Fix duplicated words in comment;
367 for for -> for.
368 * parser.cc (fixup_blocks_walker): Fix duplicated words in comment;
369 is is -> is.
370 * semantics.cc (fixup_template_type): Fix duplicated words in comment;
371 for for -> for.
372 (finish_omp_for): Fix duplicated words in comment; the the -> the.
373 * pt.cc (more_specialized_fn): Fix duplicated words in comment;
374 think think -> think.
375 (type_targs_deducible_from): Fix duplicated words in comment; the the
376 -> the.
377
378 2024-04-05 Marek Polacek <polacek@redhat.com>
379
380 PR c++/111132
381 * constexpr.cc (get_function_named_in_call): Use
382 cp_get_fndecl_from_callee.
383 * cvt.cc (cp_get_fndecl_from_callee): If there's a
384 DECL_LOCAL_DECL_ALIAS, use it.
385
386 2024-04-05 Jakub Jelinek <jakub@redhat.com>
387
388 PR c++/114572
389 * cp-gimplify.cc (cxx_omp_clause_apply_fn): Call build_cplus_new
390 on build_call_a result if it has class type.
391
392 2024-04-04 centurion <centurion009@proton.me>
393
394 PR c++/114377
395 * pt.cc (find_template_parameter_info::found): Use TREE_TYPE for
396 TEMPLATE_DECL instead of DECL_INITIAL.
397
398 2024-04-02 Marek Polacek <polacek@redhat.com>
399
400 PR c++/114479
401 * semantics.cc (trait_expr_value) <case CPTK_IS_ARRAY>: Return false
402 for zero-sized arrays.
403
404 2024-04-02 Marek Polacek <polacek@redhat.com>
405
406 PR c++/103825
407 * typeck.cc (is_bitfield_expr_with_lowered_type): Handle
408 CLEANUP_POINT_EXPR.
409
410 2024-04-02 Jason Merrill <jason@redhat.com>
411
412 PR c++/114561
413 PR c++/114562
414 * call.cc (convert_like_internal): Avoid adding qualification
415 conversion in direct reference binding.
416
417 2024-04-01 Jason Merrill <jason@redhat.com>
418
419 * typeck.cc (maybe_warn_about_returning_address_of_local):
420 Permerror in C++26.
421
422 2024-03-28 Jason Merrill <jason@redhat.com>
423
424 PR c++/100667
425 * semantics.cc (same_type_ref_bind_p): New.
426 (finish_trait_expr): Use it.
427
428 2024-03-26 Jakub Jelinek <jakub@redhat.com>
429
430 PR c++/112724
431 * error.cc (dump_expr): Handle EXCESS_PRECISION_EXPR like NOP_EXPR.
432
433 2024-03-25 Marek Polacek <polacek@redhat.com>
434
435 PR c++/114349
436 * name-lookup.cc (maybe_push_to_top_level): For a non-lambda,
437 don't push to top level if decl_function_context is non-null.
438 * pt.cc (maybe_instantiate_noexcept): Use maybe_push_to_top_level.
439
440 2024-03-25 Marek Polacek <polacek@redhat.com>
441
442 PR c++/114439
443 * init.cc (can_init_array_with_p): Return true for a VEC_INIT_EXPR
444 wrapped in a TARGET_EXPR.
445
446 2024-03-22 Marek Polacek <polacek@redhat.com>
447
448 PR c++/59465
449 * init.cc (can_init_array_with_p): New.
450 (perform_member_init): Check it.
451
452 2024-03-21 Marek Polacek <polacek@redhat.com>
453
454 PR c++/110323
455 * decl2.cc (min_vis_expr_r) <case VAR_DECL>: Do nothing for
456 decl_constant_var_p VAR_DECLs.
457
458 2024-03-20 Jakub Jelinek <jakub@redhat.com>
459
460 * coroutines.cc (expand_one_await_expression): Use
461 integer_zero_node instead of build_int_cst (integer_type_node, 0)
462 and integer_one_node instead of build_int_cst (integer_type_node, 1).
463
464 2024-03-19 Nathaniel Shead <nathanieloshead@gmail.com>
465
466 * cp-tree.h (module_maybe_has_cmi_p): New function.
467 * decl.cc (grokfndecl): Mark block-scope functions as public if
468 they could be visible in other TUs.
469 * decl2.cc (no_linkage_error): Don't error for declarations that
470 could be defined in other TUs since C++20. Suppress duplicate
471 errors from 'check_global_declaration'.
472 * tree.cc (no_linkage_check): In relaxed mode, don't consider
473 types in a module CMI to have no linkage.
474
475 2024-03-16 Nathaniel Shead <nathanieloshead@gmail.com>
476
477 PR c++/112631
478 * cp-tree.h (named_module_attach_p): New function.
479 * decl.cc (start_decl): Check for attachment not purview.
480 (grokmethod): Likewise.
481
482 2024-03-14 Chung-Lin Tang <cltang@baylibre.com>
483
484 * parser.cc (cp_parser_oacc_data_clause): Add parsing support for
485 'readonly' modifier, set OMP_CLAUSE_MAP_READONLY if readonly modifier
486 found, update comments.
487 (cp_parser_oacc_cache): Add parsing support for 'readonly' modifier,
488 set OMP_CLAUSE__CACHE__READONLY if readonly modifier found, update
489 comments.
490
491 2024-03-12 Nathaniel Shead <nathanieloshead@gmail.com>
492
493 PR c++/98645
494 PR c++/98688
495 PR c++/111224
496 * module.cc (enum tree_tag): Add new tag for builtin types.
497 (trees_out::start): POLY_INT_CSTs can be emitted.
498 (trees_in::start): Likewise.
499 (trees_out::core_vals): Stream POLY_INT_CSTs.
500 (trees_in::core_vals): Likewise.
501 (trees_out::type_node): Handle vectors with multiple coeffs.
502 (trees_in::tree_node): Likewise.
503 (init_modules): Register target-specific builtin types. Bump
504 initial capacity slightly.
505
506 2024-03-08 Jakub Jelinek <jakub@redhat.com>
507
508 * pt.cc (tsubst_expr): Handle MEM_REF.
509
510 2024-03-08 Jakub Jelinek <jakub@redhat.com>
511
512 PR debug/113918
513 * cp-objcp-common.cc (cp_type_dwarf_attribute): Return 1
514 for DW_AT_export_symbols on anonymous structs or unions.
515
516 2024-03-08 Jakub Jelinek <jakub@redhat.com>
517
518 PR c++/113802
519 * parser.cc (cp_parser_parameter_declaration): Move the xobj_param_p
520 pack diagnostics after ellipsis handling and if an error is reported,
521 pretend this specifier didn't appear. Formatting fix.
522
523 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
524
525 PR c++/114229
526 * module.cc (trees_out::core_bools): Redetermine
527 DECL_INTERFACE_KNOWN on stream-in for vtables and tinfo.
528 * decl2.cc (import_export_decl): Add fixme for ABI changes with
529 module vtables and tinfo.
530
531 2024-03-07 Patrick Palka <ppalka@redhat.com>
532
533 PR c++/103994
534 * cp-tree.h (add_mergeable_specialization): Remove second
535 parameter.
536 * module.cc (depset::disc_bits::DB_ALIAS_TMPL_INST_BIT): Remove.
537 (depset::disc_bits::DB_ALIAS_SPEC_BIT): Remove.
538 (depset::is_alias_tmpl_inst): Remove.
539 (depset::is_alias): Remove.
540 (merge_kind::MK_tmpl_alias_mask): Remove.
541 (merge_kind::MK_alias_spec): Remove.
542 (merge_kind_name): Remove entries for alias specializations.
543 (trees_out::core_vals) <case TEMPLATE_DECL>: Adjust after
544 removing is_alias_tmpl_inst.
545 (trees_in::decl_value): Adjust add_mergeable_specialization
546 calls.
547 (trees_out::get_merge_kind) <case depset::EK_SPECIALIZATION>:
548 Use MK_decl_spec for alias template specializations.
549 (trees_out::key_mergeable): Simplify after MK_tmpl_alias_mask
550 removal.
551 (depset::hash::make_dependency): Adjust after removing
552 DB_ALIAS_TMPL_INST_BIT.
553 (specialization_add): Don't allow alias templates when !decl_p.
554 (depset::hash::add_specializations): Remove now-dead code
555 accomodating alias template specializations in the type table.
556 * pt.cc (lookup_template_class): Dispatch early to
557 instantiate_alias_template for alias templates. Simplify
558 accordingly.
559 (add_mergeable_specialization): Remove alias_p parameter and
560 simplify accordingly.
561
562 2024-03-07 Patrick Palka <ppalka@redhat.com>
563
564 PR c++/110730
565 PR c++/105512
566 * module.cc (module_state::write_namespaces): Stream the
567 abi_tag attribute of an inline namespace.
568 (module_state::read_namespaces): Likewise.
569
570 2024-03-07 Marek Polacek <polacek@redhat.com>
571
572 PR c++/110031
573 * pt.cc (lookup_and_finish_template_variable): Pass complain to
574 mark_used.
575
576 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
577
578 PR c++/98356
579 * typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
580 'member' will be a FUNCTION_DECL (or something like it).
581
582 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
583
584 PR c++/98881
585 * module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT
586 for template template parameters.
587 (trees_in::tpl_parms_fini): Read it.
588
589 2024-03-06 Marek Polacek <polacek@redhat.com>
590
591 PR c++/114114
592 * pt.cc (maybe_instantiate_noexcept): Save/restore
593 cp_unevaluated_operand, c_inhibit_evaluation_warnings, and
594 cp_noexcept_operand around the tsubst_expr call.
595
596 2024-03-06 Nathaniel Shead <nathanieloshead@gmail.com>
597
598 PR c++/113629
599 * pt.cc (type_unification_real): Only use DEDUCE_CONV for the
600 return type of a conversion function.
601
602 2024-03-06 Patrick Palka <ppalka@redhat.com>
603
604 * module.cc (trees_out::get_merge_kind) <case depset::EK_DECL>:
605 Accomodate class-scope DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P
606 TEMPLATE_DECL. Consolidate IDENTIFIER_ANON_P cases.
607
608 2024-03-05 Patrick Palka <ppalka@redhat.com>
609
610 * parser.cc (cp_parser_translation_unit): Relax GMF contents
611 error into a pedwarn.
612
613 2024-03-04 Nathaniel Shead <nathanieloshead@gmail.com>
614
615 * name-lookup.cc (walk_module_binding): Remove completed FIXME.
616 (do_nonmember_using_decl): Mark redeclared entities as exported
617 when needed. Check for re-exporting internal linkage types.
618
619 2024-03-01 Patrick Palka <ppalka@redhat.com>
620
621 PR c++/104919
622 PR c++/106009
623 * module.cc (depset::hash::sneakoscope): Remove.
624 (trees_out::decl_node): Always add a dependency on a local type.
625 (depset::hash::find_dependencies): Remove sneakoscope stuff.
626
627 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
628
629 PR c++/114170
630 * module.cc (has_definition): Fall back to DECL_INITIALIZED_P
631 when DECL_INITIAL is not set on a template.
632 (module_state::write_inits): Only increment count when
633 initializers are actually written.
634
635 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
636
637 PR c++/114005
638 * init.cc (create_temporary_var): Use current_scope instead of
639 current_function_decl.
640
641 2024-03-01 Patrick Palka <ppalka@redhat.com>
642
643 * decl.cc (maybe_register_incomplete_var): Restrict second
644 branch to static data members from a not-yet-complete class.
645
646 2024-03-01 Marek Polacek <polacek@redhat.com>
647
648 PR c++/110358
649 PR c++/109642
650 * call.cc (no_dangling_p): New.
651 (reference_like_class_p): Use it.
652 (do_warn_dangling_reference): Use it. Don't warn when the function
653 or its enclosing class has attribute gnu::no_dangling.
654 * tree.cc (cxx_gnu_attributes): Add gnu::no_dangling.
655 (handle_no_dangling_attribute): New.
656
657 2024-03-01 Patrick Palka <ppalka@redhat.com>
658
659 PR c++/110025
660 PR c++/114138
661 * cp-tree.h (make_cast_auto): Declare.
662 * parser.cc (cp_parser_functional_cast): If the type is an auto,
663 replace it with a level-less one via make_cast_auto.
664 * pt.cc (find_parameter_packs_r): Don't treat level-less auto
665 as a type parameter pack.
666 (tsubst) <case TEMPLATE_TYPE_PARM>: Generalize CTAD placeholder
667 auto handling to all level-less autos.
668 (make_cast_auto): Define.
669 (do_auto_deduction): Handle replacement of a level-less auto.
670
671 2024-03-01 Jakub Jelinek <jakub@redhat.com>
672
673 PR c++/92687
674 * decl.cc (lookup_decomp_type): Return NULL_TREE if decomp_type_table
675 doesn't have entry for V.
676 * semantics.cc (finish_decltype_type): If ptds.saved, assert
677 DECL_HAS_VALUE_EXPR_P is true and decide on tuple vs. non-tuple based
678 on if lookup_decomp_type is NULL or not.
679
680 2024-02-29 Marek Polacek <polacek@redhat.com>
681
682 PR c++/113987
683 * call.cc (conv_binds_to_reference_parm_p): New.
684 * cp-tree.h (conv_binds_to_reference_parm_p): Declare.
685 * init.cc (find_uninit_fields_r): Call it.
686
687 2024-02-29 Nathaniel Shead <nathanieloshead@gmail.com>
688
689 PR c++/111710
690 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Remove tree checking.
691 (struct lang_decl_base): Update comments and fix whitespace.
692 * module.cc (trees_out::lang_decl_bools): Always write
693 module_keyed_decls_p flag...
694 (trees_in::lang_decl_bools): ...and always read it.
695 (trees_out::decl_value): Handle all kinds of keyed decls.
696 (trees_in::decl_value): Likewise.
697 (trees_in::tree_value): Deduplicate LAMBDA_EXPRs.
698 (maybe_key_decl): Also support lambdas attached to fields,
699 parameters, and types. Key lambdas attached to fields to their
700 class.
701 (trees_out::get_merge_kind): Likewise.
702 (trees_out::key_mergeable): Likewise.
703 (trees_in::key_mergeable): Support keyed decls in a TYPE_DECL
704 container.
705 * parser.cc (cp_parser_class_head): Start a lambda scope when
706 parsing base classes.
707
708 2024-02-28 Jakub Jelinek <jakub@redhat.com>
709 Patrick Palka <ppalka@redhat.com>
710
711 PR c++/113976
712 * decl.cc (grokdeclarator): Don't call cp_apply_type_quals_to_decl
713 on DECL_TEMPLATE_INSTANTIATED VAR_DECLs.
714
715 2024-02-28 Nathaniel Shead <nathanieloshead@gmail.com>
716
717 PR c++/113970
718 PR c++/114013
719 * decl.cc (make_rtl_for_nonlocal_decl): Don't defer inline
720 variables.
721
722 2024-02-23 Jakub Jelinek <jakub@redhat.com>
723
724 PR c++/113083
725 * cp-gimplify.cc (cp_fold): For targetm.cxx.cdtor_returns_this ()
726 wrap r into a COMPOUND_EXPR and return folded CALL_EXPR_ARG (x, 0).
727
728 2024-02-19 Patrick Palka <ppalka@redhat.com>
729
730 PR c++/113966
731 * constraint.cc (tsubst_compound_requirement): Don't check
732 the noexcept condition or the return-type-requirement when
733 partially substituting.
734
735 2024-02-17 Marek Polacek <polacek@redhat.com>
736
737 PR c++/113158
738 * search.cc (maybe_check_overriding_exception_spec): Defer checking
739 when a noexcept couldn't be instantiated & evaluated to false/true.
740
741 2024-02-16 Marek Polacek <polacek@redhat.com>
742
743 DR 1351
744 * search.cc (maybe_check_overriding_exception_spec): Don't error about
745 a looser exception specification if the overrider is deleted.
746
747 2024-02-16 Marek Polacek <polacek@redhat.com>
748
749 PR c++/113789
750 PR c++/113853
751 * typeck.cc (treat_lvalue_as_rvalue_p): Update code to better
752 reflect [expr.prim.id.unqual]#4.2.
753
754 2024-02-16 Jakub Jelinek <jakub@redhat.com>
755
756 PR c++/113929
757 * parser.cc (cp_parser_parameter_declaration): Diagnose this specifier
758 on template parameter declaration.
759
760 2024-02-16 Patrick Palka <ppalka@redhat.com>
761
762 * module.cc (trees_out::core_bools): Stream TREE_UNAVAILABLE.
763 (trees_in::core_bools): Likewise.
764 (trees_out::core_vals): Stream LAMBDA_EXPR_REGEN_INFO.
765 (trees_in::core_vals): Likewise.
766
767 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
768
769 PR c++/113708
770 * decl.cc (make_rtl_for_nonlocal_decl): Defer inline variables.
771 * decl2.cc (import_export_decl): Support inline variables.
772
773 2024-02-14 Patrick Palka <ppalka@redhat.com>
774
775 PR c++/113908
776 PR c++/113332
777 * method.cc (synthesized_method_walk): Use maybe_push_to_top_level.
778
779 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
780
781 PR c++/99573
782 * decl.cc (start_enum): Reorder check for redeclaring in module.
783 Add missing auto_diagnostic_groups.
784
785 2024-02-13 Marek Polacek <polacek@redhat.com>
786
787 DR 1693
788 PR c++/113760
789 * parser.cc (cp_parser_member_declaration): Only pedwarn about an extra
790 semicolon in C++98.
791
792 2024-02-13 Tobias Burnus <tburnus@baylibre.com>
793
794 PR middle-end/113904
795 * parser.cc (cp_parser_omp_context_selector): Handle splitting of
796 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
797
798 2024-02-13 Patrick Palka <ppalka@redhat.com>
799
800 * Make-lang.in (CFLAGS-cp/module.o): Add $(ZLIBINC).
801 * module.cc: Include <zlib.h>.
802 (bytes::calc_crc): Use crc32 from zlib.
803 (bytes_out::set_crc): Use crc32_combine from zlib.
804
805 2024-02-13 Patrick Palka <ppalka@redhat.com>
806
807 * module.cc (depset::hash::add_specializations): Use
808 STRIP_TEMPLATE consistently.
809 (get_originating_module_decl): Handle class-scope CONST_DECL.
810
811 2024-02-13 Patrick Palka <ppalka@redhat.com>
812
813 * lambda.cc (lambda_function): Call get_class_binding_direct
814 instead of lookup_member to sidestep lazy loading.
815 * name-lookup.cc (check_local_shadow): Punt if we're in a
816 function context that's not actual parsing.
817
818 2024-02-13 Jason Merrill <jason@redhat.com>
819
820 PR c++/113612
821 * pt.cc (process_partial_specialization): Return early
822 on redeclaration.
823
824 2024-02-13 Marek Polacek <polacek@redhat.com>
825
826 PR c++/112436
827 * except.cc (expand_start_catch_block): Pass tf_warning_or_error to
828 is_admissible_throw_operand_or_catch_parameter.
829 (build_throw): Pass complain to
830 is_admissible_throw_operand_or_catch_parameter.
831 (complete_ptr_ref_or_void_ptr_p): Add a tsubst_flags_t parameter. Use
832 it. Return bool. Call complete_type_or_maybe_complain instead of
833 complete_type_or_else.
834 (is_admissible_throw_operand_or_catch_parameter): Add a tsubst_flags_t
835 parameter. Use it. Guard error calls.
836
837 2024-02-13 Alex Coplan <alex.coplan@arm.com>
838
839 PR c++/113658
840 * cp-objcp-common.cc (cp_feature_table): Remove entry for
841 cxx_constexpr_string_builtins.
842
843 2024-02-12 Marek Polacek <polacek@redhat.com>
844
845 PR c++/113545
846 * constexpr.cc (cxx_eval_switch_expr): If the condition doesn't reduce
847 to an INTEGER_CST, consider it non-constant.
848
849 2024-02-10 Marek Polacek <polacek@redhat.com>
850
851 DR 2237
852 PR c++/107126
853 PR c++/97202
854 * parser.cc (cp_parser_unqualified_id): Downgrade the DR2237 error to
855 a pedwarn.
856 (cp_parser_constructor_declarator_p): Likewise.
857
858 2024-02-10 Jakub Jelinek <jakub@redhat.com>
859
860 * tree.cc (debug_binfo): Use HOST_WIDE_INT_PRINT_DEC instead of "%ld"
861 and casts to long.
862 * pt.cc (print_template_statistics): Use HOST_SIZE_T_PRINT_DEC
863 and casts to fmt_size_t instead of "%ld" and casts to long.
864 * class.cc (dump_class_hierarchy_1): Use HOST_WIDE_INT_PRINT_UNSIGNED
865 instead of "%lu" and casts to unsigned long. For TYPE_ALIGN, use
866 %u instead of %lu and drop casts to unsigned long.
867 * parser.cc (cp_lexer_peek_nth_token): Use HOST_SIZE_T_PRINT_DEC
868 and casts to fmt_size_t instead of "%ld" and casts to long.
869
870 2024-02-09 Marek Polacek <polacek@redhat.com>
871
872 PR c++/113834
873 * semantics.cc (finish_type_pack_element): Perform range checking
874 before tree_to_shwi.
875
876 2024-02-09 Marek Polacek <polacek@redhat.com>
877
878 PR c++/98388
879 * coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error
880 to build_throw.
881 (morph_fn_to_coro): Likewise.
882 * cp-tree.h (build_throw): Adjust.
883 * except.cc (expand_end_catch_block): Pass tf_warning_or_error to
884 build_throw.
885 (build_throw): Add a tsubst_flags_t parameter. Use it. Remove
886 redundant variable. Guard an inform call.
887 * parser.cc (cp_parser_throw_expression): Pass tf_warning_or_error
888 to build_throw.
889 * pt.cc (tsubst_expr) <case THROW_EXPR>: Pass complain to build_throw.
890
891 2024-02-09 Patrick Palka <ppalka@redhat.com>
892
893 PR c++/112580
894 * module.cc (trees_in::read_class_def): When streaming in
895 an anonymous union field of an as-base class, don't overwrite
896 ANON_AGGR_TYPE_FIELD.
897
898 2024-02-08 Patrick Palka <ppalka@redhat.com>
899
900 PR c++/113649
901 * pt.cc (do_class_deduction): Add outer_targs parameter.
902 Substitute outer arguments into the CTAD template.
903 (do_auto_deduction): Pass outer_targs to do_class_deduction.
904
905 2024-02-08 Jason Merrill <jason@redhat.com>
906
907 * pt.cc (create_template_parm_object): Pass TARGET_EXPR to
908 cxx_constant_value.
909
910 2024-02-06 Jakub Jelinek <jakub@redhat.com>
911
912 PR c++/113788
913 * parser.cc (CP_PARSER_FLAGS_PARAMETER): New enumerator.
914 (cp_parser_decl_specifier_seq): Parse RID_THIS only if
915 CP_PARSER_FLAGS_PARAMETER is set in flags.
916 (cp_parser_parameter_declaration): Or in CP_PARSER_FLAGS_PARAMETER
917 when calling cp_parser_decl_specifier_seq.
918
919 2024-02-06 Marek Polacek <polacek@redhat.com>
920
921 * method.cc (early_check_defaulted_comparison): Add
922 auto_diagnostic_group.
923
924 2024-02-06 Jason Merrill <jason@redhat.com>
925
926 PR c++/107291
927 * method.cc (early_check_defaulted_comparison): Fail if not friend.
928
929 2024-02-05 Jason Merrill <jason@redhat.com>
930
931 PR c++/111286
932 * tree.cc (rvalue): Don't drop cv-quals from an array.
933
934 2024-02-03 Patrick Palka <ppalka@redhat.com>
935
936 PR c++/110006
937 PR c++/112769
938 * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
939 tsubst flags.
940 (tsubst_valid_expression_requirement): Likewise.
941 (tsubst_simple_requirement): Return a substituted _REQ node when
942 processing_template_decl.
943 (tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
944 flags.
945 (tsubst_type_requirement): Return a substituted _REQ node when
946 processing_template_decl.
947 (tsubst_compound_requirement): Likewise. Accomodate non-diagnostic
948 tsubst flags.
949 (tsubst_nested_requirement): Likewise.
950 (tsubst_requires_expr): Don't defer partial substitution when
951 processing_constraint_expression_p is true, in which case return
952 a substituted REQUIRES_EXPR.
953 * pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
954 non-diagnostic tsubst flags.
955
956 2024-02-02 Jason Merrill <jason@redhat.com>
957
958 PR c++/110084
959 * pt.cc (tsubst_function_decl): Only check a function defaulted
960 outside the class if the class is complete.
961
962 2024-02-02 Jason Merrill <jason@redhat.com>
963
964 PR c++/112439
965 * constexpr.cc (cxx_eval_store_expression): Check empty_base
966 before marking a CONSTRUCTOR readonly.
967
968 2024-02-02 Jason Merrill <jason@redhat.com>
969
970 PR c++/113638
971 * cp-tree.h: Adjust comment.
972 * pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
973 variable template.
974
975 2024-02-01 Marek Polacek <polacek@redhat.com>
976
977 * call.cc (reference_like_class_p): Consider even non-templates for
978 std::span-like classes.
979
980 2024-02-01 Patrick Palka <ppalka@redhat.com>
981
982 PR c++/112737
983 * pt.cc (iterative_hash_template_arg) <case TEMPLATE_DECL>:
984 Adjust hashing to match cp_tree_equal.
985 (ctp_hasher::hash): Also hash CLASS_PLACEHOLDER_TEMPLATE.
986 * tree.cc (cp_tree_equal) <case TEMPLATE_DECL>: Return true
987 for ttp TEMPLATE_DECLs if their TEMPLATE_TEMPLATE_PARMs are
988 equivalent.
989 * typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
990 Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
991
992 2024-02-01 Marek Polacek <polacek@redhat.com>
993
994 PR c++/112437
995 * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
996 the move on throw of parms loop.
997
998 2024-01-30 Marek Polacek <polacek@redhat.com>
999
1000 PR c++/110358
1001 PR c++/109640
1002 * call.cc (reference_like_class_p): Don't warn for std::span-like
1003 classes.
1004
1005 2024-01-30 Patrick Palka <ppalka@redhat.com>
1006
1007 PR c++/113640
1008 * call.cc (keep_unused_object_arg): Punt for an xobj member
1009 function.
1010
1011 2024-01-30 Patrick Palka <ppalka@redhat.com>
1012
1013 PR c++/113644
1014 * pt.cc (unify) <case INTEGER_CST>: Handle NULL_TREE type.
1015
1016 2024-01-30 Nathaniel Shead <nathanieloshead@gmail.com>
1017
1018 PR c++/107594
1019 * module.cc (get_module): Bail on empty name.
1020
1021 2024-01-29 Jason Merrill <jason@redhat.com>
1022
1023 PR c++/113544
1024 * pt.cc (instantiate_class_template): Don't partially instantiate.
1025 (tsubst_stmt): Likewise.
1026
1027 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
1028
1029 PR c++/113580
1030 * module.cc (struct post_process_data): Create.
1031 (trees_in::post_decls): Use.
1032 (trees_in::post_process): Return entire vector at once.
1033 Change overload to take post_process_data instead of tree.
1034 (trees_out::write_function_def): Write needed flags from
1035 DECL_STRUCT_FUNCTION.
1036 (trees_in::read_function_def): Read them and pass to
1037 post_process.
1038 (module_state::read_cluster): Write flags into cfun.
1039
1040 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
1041
1042 PR c++/112899
1043 * cp-tree.h (note_variable_template_instantiation): Rename to...
1044 (note_vague_linkage_variable): ...this.
1045 * decl2.cc (note_variable_template_instantiation): Rename to...
1046 (note_vague_linkage_variable): ...this.
1047 * pt.cc (instantiate_decl): Rename usage of above function.
1048 * module.cc (trees_in::read_var_def): Remember pending statics
1049 that we stream in.
1050
1051 2024-01-25 Jakub Jelinek <jakub@redhat.com>
1052
1053 PR c++/113599
1054 * typeck2.cc (build_m_component_ref): Use convert instead of
1055 cp_convert for pointer conversion.
1056
1057 2024-01-25 Jason Merrill <jason@redhat.com>
1058
1059 PR c++/113598
1060 * init.cc (build_vec_init): Don't use {} for PMF.
1061
1062 2024-01-25 Jason Merrill <jason@redhat.com>
1063
1064 PR c++/109227
1065 * coroutines.cc (build_co_await): Use cxx_maybe_build_cleanup.
1066 (build_actor_fn, process_conditional, maybe_promote_temps)
1067 (morph_fn_to_coro): Likewise.
1068 (expand_one_await_expression): Use build_cleanup.
1069
1070 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
1071
1072 PR c++/113405
1073 * module.cc (set_defining_module): Track partial specialisations
1074 for all declarations.
1075
1076 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
1077
1078 PR c++/100707
1079 * name-lookup.cc (add_imported_namespace): Don't mark namespaces
1080 as imported.
1081
1082 2024-01-24 Patrick Palka <ppalka@redhat.com>
1083
1084 PR c++/113529
1085 * call.cc (add_operator_candidates): Propagate error_mark_node
1086 result after recursing to find rewritten candidates.
1087
1088 2024-01-23 Marek Polacek <polacek@redhat.com>
1089
1090 PR c++/113256
1091 PR c++/111607
1092 PR c++/109640
1093 * call.cc (do_warn_dangling_reference): Don't warn if the temporary
1094 is of lambda type.
1095
1096 2024-01-23 Nathaniel Shead <nathanieloshead@gmail.com>
1097
1098 PR c++/112820
1099 PR c++/102607
1100 * module.cc (trees_out::lang_type_bools): Write interface_only
1101 and interface_unknown.
1102 (trees_in::lang_type_bools): Read the above flags.
1103 (trees_in::decl_value): Reset CLASSTYPE_INTERFACE_* except for
1104 extern templates.
1105 (trees_in::read_class_def): Remove buggy extern template
1106 handling.
1107
1108 2024-01-19 Jason Merrill <jason@redhat.com>
1109
1110 PR c++/113498
1111 * pt.cc (decl_template_info): New fn.
1112 (get_template_info): Use it.
1113
1114 2024-01-19 Jason Merrill <jason@redhat.com>
1115
1116 PR c++/112632
1117 PR c++/112594
1118 PR c++/111357
1119 PR c++/104594
1120 PR c++/67898
1121 * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
1122 * pt.cc (expand_integer_pack): Remove 111357 workaround.
1123 (maybe_convert_nontype_argument): Add force parm.
1124 (convert_template_argument): Handle alias template args
1125 specially.
1126 (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
1127 * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.
1128
1129 2024-01-18 Marek Polacek <polacek@redhat.com>
1130
1131 PR c++/113389
1132 * decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
1133 NULL_TREE when emitting an error.
1134
1135 2024-01-17 Nathaniel Shead <nathanieloshead@gmail.com>
1136
1137 PR c++/112588
1138 * module.cc (trees_in::read_function_def): Don't overwrite
1139 arguments.
1140
1141 2024-01-17 Patrick Palka <ppalka@redhat.com>
1142
1143 PR c++/113242
1144 PR c++/99493
1145 * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
1146 DECL_ARTIFICIAL rejection test for class NTTP objects.
1147
1148 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
1149
1150 PR c++/113292
1151 * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
1152 (c_parse_final_cleanups): Suppress warning for no definition of
1153 TLS wrapper functions in header modules.
1154 * module.cc (trees_out::lang_decl_vals): Write wrapped variable
1155 for TLS wrapper functions.
1156 (trees_in::lang_decl_vals): Read it.
1157 (trees_out::decl_value): Write TLS model for thread-local vars.
1158 (trees_in::decl_value): Read it for new decls. Remember to emit
1159 definitions of TLS wrapper functions later.
1160
1161 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
1162
1163 * name-lookup.h (enum scope_kind): Add 'sk_count'.
1164 * name-lookup.cc (cp_binding_level_descriptor): Add missing
1165 scope kinds. Add assertion that the list is up to date. Fix
1166 handling of explicit_spec_p.
1167
1168 2024-01-16 Marek Polacek <polacek@redhat.com>
1169
1170 * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
1171 messages.
1172
1173 2024-01-16 Marek Polacek <polacek@redhat.com>
1174
1175 PR c++/113340
1176 * decl.cc (grokdeclarator) <case cdk_function>: Clear
1177 is_xobj_member_function in case of an error.
1178
1179 2024-01-16 waffl3x <waffl3x@protonmail.com>
1180
1181 PR c++/113307
1182 * parser.cc (cp_parser_parameter_declaration): Reject packs
1183 on xobj params.
1184
1185 2024-01-15 Marek Polacek <polacek@redhat.com>
1186
1187 PR c++/110065
1188 * parser.cc (cp_parser_template_type_arg): Add auto checking.
1189
1190 2024-01-15 Patrick Palka <ppalka@redhat.com>
1191
1192 * parser.cc (cp_parser_check_access_in_redeclaration): Don't
1193 check access for a partial or explicit specialization.
1194 * pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
1195 or TREE_PROTECTED on the newly created partial specialization.
1196
1197 2024-01-15 Patrick Palka <ppalka@redhat.com>
1198
1199 PR c++/104634
1200 * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
1201 to the newly created partial specialization.
1202
1203 2024-01-15 Patrick Palka <ppalka@redhat.com>
1204
1205 PR c++/109899
1206 * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
1207 false in a template context.
1208
1209 2024-01-13 Jakub Jelinek <jakub@redhat.com>
1210
1211 * mangle.cc (write_nested_name): Mangle explicit object
1212 member functions with H as per
1213 https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
1214
1215 2024-01-12 Jason Merrill <jason@redhat.com>
1216
1217 PR c++/113038
1218 * name-lookup.cc (lookup_elaborated_type): Look for bindings
1219 in the global namespace in the ABI namespace.
1220
1221 2024-01-12 Jason Merrill <jason@redhat.com>
1222
1223 * call.cc (reversed_match): New.
1224 (enum class pmatch): New enum.
1225 (cand_parms_match): Add match_kind parm.
1226 (object_parms_correspond): Add fn parms.
1227 (joust): Adjust.
1228 * class.cc (xobj_iobj_parameters_correspond): Rename to...
1229 (iobj_parm_corresponds_to): ...this. Take the other
1230 type instead of a second function.
1231 (object_parms_correspond): Adjust.
1232 * cp-tree.h (iobj_parm_corresponds_to): Declare.
1233
1234 2024-01-11 Jason Merrill <jason@redhat.com>
1235
1236 PR c++/113191
1237 * class.cc (xobj_iobj_parameters_correspond): Add context parm.
1238 (object_parms_correspond): Factor out of...
1239 (add_method): ...here.
1240 * method.cc (defaulted_late_check): Use it.
1241 * call.cc (class_of_implicit_object): New.
1242 (object_parms_correspond): Overload taking two candidates.
1243 (cand_parms_match): Use it.
1244 (joust): Check reversed before comparing constraints.
1245 * cp-tree.h (object_parms_correspond): Declare.
1246
1247 2024-01-10 Tamar Christina <tamar.christina@arm.com>
1248
1249 * parser.cc (cp_parser_pragma): Initialize to false.
1250
1251 2024-01-09 Jason Merrill <jason@redhat.com>
1252
1253 * semantics.cc (is_object_parameter): New.
1254 * cp-tree.h (is_object_parameter): Declare.
1255 * call.cc (maybe_warn_class_memaccess): Use it.
1256 * search.cc (field_access_p): Use it.
1257 (class_of_object_parm): New.
1258 (field_accessor_p): Adjust for explicit object parms.
1259
1260 2024-01-09 Jason Merrill <jason@redhat.com>
1261
1262 * call.cc (build_over_call): Refactor handle_arg lambda.
1263 * class.cc (xobj_iobj_parameters_correspond): Fix FIXME.
1264 * method.cc (defaulted_late_check): Adjust comments.
1265
1266 2024-01-09 waffl3x <waffl3x@protonmail.com>
1267
1268 PR c++/102609
1269 PR c++/102609
1270 C++23 P0847R7 (deducing this) - CWG2586.
1271 * decl.cc (copy_fn_p): Accept xobj copy assignment functions.
1272 (move_signature_fn_p): Accept xobj move assignment functions.
1273 * method.cc (do_build_copy_assign): Handle defaulted xobj member
1274 functions.
1275 (defaulted_late_check): Comment.
1276 (defaultable_fn_check): Comment.
1277
1278 2024-01-09 waffl3x <waffl3x@protonmail.com>
1279
1280 PR c++/102609
1281 PR c++/102609
1282 C++23 P0847R7 (deducing this) - xobj lambdas.
1283 * lambda.cc (build_capture_proxy): Don't fold direct object types.
1284 * parser.cc (cp_parser_lambda_declarator_opt): Handle xobj lambdas,
1285 diagnostics. Comments also updated.
1286 * pt.cc (tsubst_function_decl): Handle xobj lambdas. Check object
1287 type of xobj lambda call operator, diagnose incorrect types.
1288 (tsubst_lambda_expr): Update comment.
1289 * semantics.cc (finish_decltype_type): Also consider by-value object
1290 parameter qualifications.
1291
1292 2024-01-09 waffl3x <waffl3x@protonmail.com>
1293
1294 PR c++/102609
1295 PR c++/102609
1296 C++23 P0847R7 (deducing this) - diagnostics.
1297 * class.cc (resolve_address_of_overloaded_function): Diagnostics.
1298 * cp-tree.h (TFF_XOBJ_FUNC): Define.
1299 * decl.cc (grokfndecl): Diagnostics.
1300 (grokdeclarator): Diagnostics.
1301 * error.cc (dump_aggr_type): Pass TFF_XOBJ_FUNC.
1302 (dump_lambda_function): Formatting for xobj lambda.
1303 (dump_function_decl): Pass TFF_XOBJ_FUNC.
1304 (dump_parameters): Formatting for xobj member functions.
1305 (function_category): Formatting for xobj member functions.
1306 * parser.cc (cp_parser_decl_specifier_seq): Diagnostics.
1307 (cp_parser_parameter_declaration): Diagnostics.
1308 * search.cc (look_for_overrides_here): Make xobj member functions
1309 override.
1310 (look_for_overrides_r): Reject an overriding xobj member function
1311 and diagnose it.
1312 * semantics.cc (finish_this_expr): Diagnostics.
1313 * typeck.cc (cp_build_addr_expr_1): Diagnostics.
1314
1315 2024-01-09 waffl3x <waffl3x@protonmail.com>
1316
1317 PR c++/102609
1318 PR c++/102609
1319 C++23 P0847R7 (deducing this) - initial functionality.
1320 * class.cc (xobj_iobj_parameters_correspond): New function, checks
1321 for corresponding object parameters between xobj and iobj member
1322 functions.
1323 (add_method): Handle object parameters of xobj member functions, use
1324 xobj_iobj_parameters_correspond.
1325 * call.cc (build_over_call): Refactor, handle xobj member functions.
1326 (cand_parms_match): Handle object parameters of xobj and iobj member
1327 functions, use xobj_iobj_parameters_correspond.
1328 * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
1329 * decl.cc (grokfndecl): Add xobj_func_p parameter. For xobj member
1330 functions, Set xobj_flag, don't set static_function flag.
1331 (grokdeclarator): Handle xobj member functions, tell grokfndecl.
1332 (grok_op_properties): Don't error for xobj operators.
1333 * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
1334 (cp_parser_parameter_declaration): Set default argument to
1335 "this_identifier" for xobj parameters.
1336 (set_and_check_decl_spec_loc): Add "this", add comments.
1337 * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
1338 * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
1339 functions.
1340
1341 2024-01-09 waffl3x <waffl3x@protonmail.com>
1342 Jason Merrill <jason@redhat.com>
1343
1344 PR c++/102609
1345 * cp-tree.h (struct lang_decl_fn): New data member.
1346 (DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
1347 (DECL_IOBJ_MEMBER_FUNCTION_P): Define.
1348 (DECL_FUNCTION_XOBJ_FLAG): Define.
1349 (DECL_XOBJ_MEMBER_FUNCTION_P): Define.
1350 (DECL_OBJECT_MEMBER_FUNCTION_P): Define.
1351 (DECL_FUNCTION_MEMBER_P): Don't use
1352 DECL_NONSTATIC_MEMBER_FUNCTION_P.
1353 (DECL_CONST_MEMFUNC_P): Likewise.
1354 (DECL_VOLATILE_MEMFUNC_P): Likewise.
1355 (DECL_NONSTATIC_MEMBER_P): Likewise.
1356 * module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
1357 (trees_in::lang_decl_bools): Handle xobj_flag.
1358 * call.cc (build_this_conversion)
1359 (add_function_candidate)
1360 (add_template_candidate_real)
1361 (add_candidates)
1362 (maybe_warn_class_memaccess)
1363 (cand_parms_match)
1364 (joust)
1365 (do_warn_dangling_reference)
1366 * class.cc (finalize_literal_type_property)
1367 (finish_struct)
1368 (resolve_address_of_overloaded_function)
1369 * constexpr.cc (is_valid_constexpr_fn)
1370 (cxx_bind_parameters_in_call)
1371 * contracts.cc (build_contract_condition_function)
1372 * cp-objcp-common.cc (cp_decl_dwarf_attribute)
1373 * cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
1374 (cxx_pretty_printer::declaration_specifiers)
1375 (cxx_pretty_printer::direct_declarator)
1376 * decl.cc (cp_finish_decl)
1377 (grok_special_member_properties)
1378 (start_preparsed_function)
1379 (record_key_method_defined)
1380 * decl2.cc (cp_handle_deprecated_or_unavailable)
1381 * init.cc (find_uninit_fields_r)
1382 (build_offset_ref)
1383 * lambda.cc (lambda_expr_this_capture)
1384 (maybe_generic_this_capture)
1385 (nonlambda_method_basetype)
1386 * mangle.cc (write_nested_name)
1387 * method.cc (early_check_defaulted_comparison)
1388 (skip_artificial_parms_for)
1389 (num_artificial_parms_for)
1390 * pt.cc (is_specialization_of_friend)
1391 (determine_specialization)
1392 (copy_default_args_to_explicit_spec)
1393 (check_explicit_specialization)
1394 (tsubst_contract_attribute)
1395 (check_non_deducible_conversions)
1396 (more_specialized_fn)
1397 (maybe_instantiate_noexcept)
1398 (register_parameter_specializations)
1399 (value_dependent_expression_p)
1400 * search.cc (shared_member_p)
1401 (lookup_member)
1402 (field_access_p)
1403 * semantics.cc (finish_omp_declare_simd_methods)
1404 * tree.cc (lvalue_kind)
1405 * typeck.cc (invalid_nonstatic_memfn_p): Don't use
1406 DECL_NONSTATIC_MEMBER_FUNCTION_P.
1407
1408 2024-01-09 Julian Brown <julian@codesourcery.com>
1409
1410 * constexpr.cc (potential_consant_expression_1): Handle
1411 OMP_ARRAY_SECTION.
1412 * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
1413 prototypes.
1414 * decl2.cc (grok_omp_array_section): New function.
1415 * error.cc (dump_expr): Handle OMP_ARRAY_SECTION.
1416 * parser.cc (cp_parser_new): Initialize parser->omp_array_section_p.
1417 (cp_parser_statement_expr): Disallow array sections.
1418 (cp_parser_postfix_open_square_expression): Support OMP_ARRAY_SECTION
1419 parsing.
1420 (cp_parser_parenthesized_expression_list, cp_parser_lambda_expression,
1421 cp_parser_braced_list): Disallow array sections.
1422 (cp_parser_omp_var_list_no_open): Remove ALLOW_DEREF parameter, add
1423 MAP_LVALUE in its place. Support generalised lvalue parsing for
1424 OpenMP map, to and from clauses. Use OMP_ARRAY_SECTION
1425 code instead of TREE_LIST to represent OpenMP array sections.
1426 (cp_parser_omp_var_list): Remove ALLOW_DEREF parameter, add MAP_LVALUE.
1427 Pass to cp_parser_omp_var_list_no_open.
1428 (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
1429 (cp_parser_omp_clause_map): Add sk_omp scope around
1430 cp_parser_omp_var_list_no_open call.
1431 * parser.h (cp_parser): Add omp_array_section_p field.
1432 * pt.cc (tsubst, tsubst_copy, tsubst_omp_clause_decl,
1433 tsubst_copy_and_build): Add OMP_ARRAY_SECTION support.
1434 * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections,
1435 cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION
1436 instead of TREE_LIST where appropriate. Handle more types of map
1437 expression.
1438 * typeck.cc (build_omp_array_section): New function.
1439
1440 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
1441
1442 * module.cc (trees_out::write_var_def): Only write initializers
1443 in header modules.
1444
1445 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
1446
1447 PR c++/109679
1448 * module.cc (depset::hash::add_binding_entity): Don't skip names
1449 in the GMF if they've been exported with a using declaration.
1450
1451 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
1452
1453 PR c++/110808
1454 * parser.cc (cp_parser_module_name): Rewrite to handle
1455 module-names and module-partitions independently.
1456 (cp_parser_module_partition): New function.
1457 (cp_parser_module_declaration): Parse module partitions
1458 explicitly. Don't change state if parsing module decl failed.
1459 (cp_parser_import_declaration): Handle different kinds of
1460 import-declarations locally.
1461
1462 2024-01-03 Patrick Palka <ppalka@redhat.com>
1463
1464 PR c++/113064
1465 * call.cc (reference_binding): Still try a conversion via a
1466 temporary if a direct conversion was bad.
1467
1468 2024-01-03 Kwok Cheung Yeung <kcy@codesourcery.com>
1469
1470 * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
1471 clause to correspond to alphabetical order.
1472
1473 \f
1474 Copyright (C) 2024 Free Software Foundation, Inc.
1475
1476 Copying and distribution of this file, with or without modification,
1477 are permitted in any medium without royalty provided the copyright
1478 notice and this notice are preserved.