1 2024-05-01 Jason Merrill <jason@redhat.com>
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.
9 2024-05-01 Jason Merrill <jason@redhat.com>
12 * decl.cc (decls_match): Handle memchr return type being
15 2024-05-01 Nathaniel Shead <nathanieloshead@gmail.com>
17 * name-lookup.cc (walk_module_binding): Use the
18 partition-specific hidden flag instead of the top-level
21 2024-05-01 Nathaniel Shead <nathanieloshead@gmail.com>
24 * module.cc (depset::hash::add_binding_entity): Propagate
25 OVL_USING_P for using-declarations.
27 2024-05-01 Nathaniel Shead <nathanieloshead@gmail.com>
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
43 (cp_parser_class_head): Error when exporting a partial
46 2024-04-30 Jakub Jelinek <jakub@redhat.com>
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.
54 2024-04-30 Nathaniel Shead <nathanieloshead@gmail.com>
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
74 (tsubst_friend_class): Lookup imported hidden friends. Check
75 for valid module attachment of existing names. Propagate
76 defining module for new classes.
78 2024-04-30 Nathaniel Shead <nathanieloshead@gmail.com>
80 * cp-tree.h (module_may_redeclare): Add default parameter.
81 * decl.cc (duplicate_decls): Don't emit errors for failed
84 (start_enum): Likewise.
85 * semantics.cc (begin_class_definition): Likewise.
86 * module.cc (module_may_redeclare): Clean up logic. Emit error
89 2024-04-30 Patrick Palka <ppalka@redhat.com>
92 * module.cc (trees_in::read_class_def): Look through
93 TEMPLATE_DECL when adding to CLASSTYPE_BEFRIENDING_CLASSES.
95 2024-04-30 Patrick Palka <ppalka@redhat.com>
98 * typeck.cc (cp_build_binary_op) <case *_DIV_*>: Add missing
99 dependence check for the second sizeof operand.
101 2024-04-26 Patrick Palka <ppalka@redhat.com>
103 * error.cc (print_instantiation_partial_context_line): Clear the
104 pretty printer prefix around the call to diagnostic_show_locus.
106 2024-04-25 Jakub Jelinek <jakub@redhat.com>
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.
122 2024-04-25 Jakub Jelinek <jakub@redhat.com>
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.
129 2024-04-24 Patrick Palka <ppalka@redhat.com>
132 * constexpr.cc (cxx_fold_indirect_ref): Restrict object/offset
133 canonicalization to RECORD_TYPE member accesses.
135 2024-04-23 Nathaniel Shead <nathanieloshead@gmail.com>
137 * parser.cc (cp_parser_parameter_declaration): Check if
138 decl_specifiers.type is null.
140 2024-04-23 Patrick Palka <ppalka@redhat.com>
143 * module.cc (trees_in::is_matching_decl): Propagate deduced
144 function return type.
146 2024-04-23 Jakub Jelinek <jakub@redhat.com>
148 * parser.cc (cp_parser_using_declaration): Spelling fix: favour
151 2024-04-23 Jakub Jelinek <jakub@redhat.com>
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.
158 2024-04-23 Nathaniel Shead <nathanieloshead@gmail.com>
161 * decl.cc (grokdeclarator): Check allocation functions for xobj
164 2024-04-16 Jakub Jelinek <jakub@redhat.com>
167 * constexpr.cc (check_bit_cast_type): Handle ARRAY_TYPE.
169 2024-04-15 Nathaniel Shead <nathanieloshead@gmail.com>
170 Patrick Palka <ppalka@redhat.com>
173 * module.cc (depset::hash::add_binding_entity): Require both
174 WMB_Using and WMB_Export for GMF entities.
176 2024-04-14 Nathaniel Shead <nathanieloshead@gmail.com>
179 * module.cc (trees_in::decl_value): Assemble alias when needed.
181 2024-04-13 Patrick Palka <ppalka@redhat.com>
183 * module.cc (struct bytes_in::bits_in): Define defaulted
185 (struct bytes_out::bits_out): Likewise.
187 2024-04-13 Patrick Palka <ppalka@redhat.com>
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
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
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
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.
228 2024-04-12 Marek Polacek <polacek@redhat.com>
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
236 2024-04-12 Patrick Palka <ppalka@redhat.com>
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
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
253 (trees_in::key_mergeable) <case FUNCTION_DECL>: Likewise.
254 (trees_in::is_matching_decl): Be flexible with type mismatches
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.
260 2024-04-12 Jason Merrill <jason@redhat.com>
261 Patrick Palka <ppalka@redhat.com>
264 * call.cc (reference_binding): For an invalid cast, warn and don't
267 2024-04-12 Jason Merrill <jason@redhat.com>
268 Patrick Palka <ppalka@redhat.com>
272 * call.cc (reference_binding): Check direct binding from
273 a single-element list.
275 2024-04-12 Jakub Jelinek <jakub@redhat.com>
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.
282 2024-04-12 Patrick Palka <ppalka@redhat.com>
285 * pt.cc (tsubst_lambda_expr): Also defer all dependent
288 2024-04-12 Jakub Jelinek <jakub@redhat.com>
291 * constexpr.cc (is_valid_constexpr_fn): Return false/diagnose with
292 complain destructors in classes with virtual bases.
294 2024-04-12 Patrick Palka <ppalka@redhat.com>
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.
310 2024-04-11 Patrick Palka <ppalka@redhat.com>
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.
321 2024-04-11 Jakub Jelinek <jakub@redhat.com>
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.
328 2024-04-10 Jakub Jelinek <jakub@redhat.com>
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.
341 2024-04-10 Nathaniel Shead <nathanieloshead@gmail.com>
344 * semantics.cc (expand_or_defer_fn_1): Keep DECL_SAVED_TREE for
345 all vague linkage cdtors with modules.
347 2024-04-10 Nathaniel Shead <nathanieloshead@gmail.com>
350 * module.cc (trees_in::install_entity): Overwrite entity map
351 index if installing from a partition.
353 2024-04-09 Jakub Jelinek <jakub@redhat.com>
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
362 2024-04-09 Jakub Jelinek <jakub@redhat.com>
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;
368 * parser.cc (fixup_blocks_walker): Fix duplicated words in comment;
370 * semantics.cc (fixup_template_type): Fix duplicated words in comment;
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
378 2024-04-05 Marek Polacek <polacek@redhat.com>
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.
386 2024-04-05 Jakub Jelinek <jakub@redhat.com>
389 * cp-gimplify.cc (cxx_omp_clause_apply_fn): Call build_cplus_new
390 on build_call_a result if it has class type.
392 2024-04-04 centurion <centurion009@proton.me>
395 * pt.cc (find_template_parameter_info::found): Use TREE_TYPE for
396 TEMPLATE_DECL instead of DECL_INITIAL.
398 2024-04-02 Marek Polacek <polacek@redhat.com>
401 * semantics.cc (trait_expr_value) <case CPTK_IS_ARRAY>: Return false
402 for zero-sized arrays.
404 2024-04-02 Marek Polacek <polacek@redhat.com>
407 * typeck.cc (is_bitfield_expr_with_lowered_type): Handle
410 2024-04-02 Jason Merrill <jason@redhat.com>
414 * call.cc (convert_like_internal): Avoid adding qualification
415 conversion in direct reference binding.
417 2024-04-01 Jason Merrill <jason@redhat.com>
419 * typeck.cc (maybe_warn_about_returning_address_of_local):
422 2024-03-28 Jason Merrill <jason@redhat.com>
425 * semantics.cc (same_type_ref_bind_p): New.
426 (finish_trait_expr): Use it.
428 2024-03-26 Jakub Jelinek <jakub@redhat.com>
431 * error.cc (dump_expr): Handle EXCESS_PRECISION_EXPR like NOP_EXPR.
433 2024-03-25 Marek Polacek <polacek@redhat.com>
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.
440 2024-03-25 Marek Polacek <polacek@redhat.com>
443 * init.cc (can_init_array_with_p): Return true for a VEC_INIT_EXPR
444 wrapped in a TARGET_EXPR.
446 2024-03-22 Marek Polacek <polacek@redhat.com>
449 * init.cc (can_init_array_with_p): New.
450 (perform_member_init): Check it.
452 2024-03-21 Marek Polacek <polacek@redhat.com>
455 * decl2.cc (min_vis_expr_r) <case VAR_DECL>: Do nothing for
456 decl_constant_var_p VAR_DECLs.
458 2024-03-20 Jakub Jelinek <jakub@redhat.com>
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).
464 2024-03-19 Nathaniel Shead <nathanieloshead@gmail.com>
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.
475 2024-03-16 Nathaniel Shead <nathanieloshead@gmail.com>
478 * cp-tree.h (named_module_attach_p): New function.
479 * decl.cc (start_decl): Check for attachment not purview.
480 (grokmethod): Likewise.
482 2024-03-14 Chung-Lin Tang <cltang@baylibre.com>
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
491 2024-03-12 Nathaniel Shead <nathanieloshead@gmail.com>
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.
506 2024-03-08 Jakub Jelinek <jakub@redhat.com>
508 * pt.cc (tsubst_expr): Handle MEM_REF.
510 2024-03-08 Jakub Jelinek <jakub@redhat.com>
513 * cp-objcp-common.cc (cp_type_dwarf_attribute): Return 1
514 for DW_AT_export_symbols on anonymous structs or unions.
516 2024-03-08 Jakub Jelinek <jakub@redhat.com>
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.
523 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
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.
531 2024-03-07 Patrick Palka <ppalka@redhat.com>
534 * cp-tree.h (add_mergeable_specialization): Remove second
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
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
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
559 (add_mergeable_specialization): Remove alias_p parameter and
560 simplify accordingly.
562 2024-03-07 Patrick Palka <ppalka@redhat.com>
566 * module.cc (module_state::write_namespaces): Stream the
567 abi_tag attribute of an inline namespace.
568 (module_state::read_namespaces): Likewise.
570 2024-03-07 Marek Polacek <polacek@redhat.com>
573 * pt.cc (lookup_and_finish_template_variable): Pass complain to
576 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
579 * typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
580 'member' will be a FUNCTION_DECL (or something like it).
582 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
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.
589 2024-03-06 Marek Polacek <polacek@redhat.com>
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.
596 2024-03-06 Nathaniel Shead <nathanieloshead@gmail.com>
599 * pt.cc (type_unification_real): Only use DEDUCE_CONV for the
600 return type of a conversion function.
602 2024-03-06 Patrick Palka <ppalka@redhat.com>
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.
608 2024-03-05 Patrick Palka <ppalka@redhat.com>
610 * parser.cc (cp_parser_translation_unit): Relax GMF contents
611 error into a pedwarn.
613 2024-03-04 Nathaniel Shead <nathanieloshead@gmail.com>
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.
619 2024-03-01 Patrick Palka <ppalka@redhat.com>
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.
627 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
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.
635 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
638 * init.cc (create_temporary_var): Use current_scope instead of
639 current_function_decl.
641 2024-03-01 Patrick Palka <ppalka@redhat.com>
643 * decl.cc (maybe_register_incomplete_var): Restrict second
644 branch to static data members from a not-yet-complete class.
646 2024-03-01 Marek Polacek <polacek@redhat.com>
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.
657 2024-03-01 Patrick Palka <ppalka@redhat.com>
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.
671 2024-03-01 Jakub Jelinek <jakub@redhat.com>
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.
680 2024-02-29 Marek Polacek <polacek@redhat.com>
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.
687 2024-02-29 Nathaniel Shead <nathanieloshead@gmail.com>
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
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
705 * parser.cc (cp_parser_class_head): Start a lambda scope when
706 parsing base classes.
708 2024-02-28 Jakub Jelinek <jakub@redhat.com>
709 Patrick Palka <ppalka@redhat.com>
712 * decl.cc (grokdeclarator): Don't call cp_apply_type_quals_to_decl
713 on DECL_TEMPLATE_INSTANTIATED VAR_DECLs.
715 2024-02-28 Nathaniel Shead <nathanieloshead@gmail.com>
719 * decl.cc (make_rtl_for_nonlocal_decl): Don't defer inline
722 2024-02-23 Jakub Jelinek <jakub@redhat.com>
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).
728 2024-02-19 Patrick Palka <ppalka@redhat.com>
731 * constraint.cc (tsubst_compound_requirement): Don't check
732 the noexcept condition or the return-type-requirement when
733 partially substituting.
735 2024-02-17 Marek Polacek <polacek@redhat.com>
738 * search.cc (maybe_check_overriding_exception_spec): Defer checking
739 when a noexcept couldn't be instantiated & evaluated to false/true.
741 2024-02-16 Marek Polacek <polacek@redhat.com>
744 * search.cc (maybe_check_overriding_exception_spec): Don't error about
745 a looser exception specification if the overrider is deleted.
747 2024-02-16 Marek Polacek <polacek@redhat.com>
751 * typeck.cc (treat_lvalue_as_rvalue_p): Update code to better
752 reflect [expr.prim.id.unqual]#4.2.
754 2024-02-16 Jakub Jelinek <jakub@redhat.com>
757 * parser.cc (cp_parser_parameter_declaration): Diagnose this specifier
758 on template parameter declaration.
760 2024-02-16 Patrick Palka <ppalka@redhat.com>
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.
767 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
770 * decl.cc (make_rtl_for_nonlocal_decl): Defer inline variables.
771 * decl2.cc (import_export_decl): Support inline variables.
773 2024-02-14 Patrick Palka <ppalka@redhat.com>
777 * method.cc (synthesized_method_walk): Use maybe_push_to_top_level.
779 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
782 * decl.cc (start_enum): Reorder check for redeclaring in module.
783 Add missing auto_diagnostic_groups.
785 2024-02-13 Marek Polacek <polacek@redhat.com>
789 * parser.cc (cp_parser_member_declaration): Only pedwarn about an extra
792 2024-02-13 Tobias Burnus <tburnus@baylibre.com>
795 * parser.cc (cp_parser_omp_context_selector): Handle splitting of
796 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
798 2024-02-13 Patrick Palka <ppalka@redhat.com>
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.
805 2024-02-13 Patrick Palka <ppalka@redhat.com>
807 * module.cc (depset::hash::add_specializations): Use
808 STRIP_TEMPLATE consistently.
809 (get_originating_module_decl): Handle class-scope CONST_DECL.
811 2024-02-13 Patrick Palka <ppalka@redhat.com>
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.
818 2024-02-13 Jason Merrill <jason@redhat.com>
821 * pt.cc (process_partial_specialization): Return early
824 2024-02-13 Marek Polacek <polacek@redhat.com>
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.
837 2024-02-13 Alex Coplan <alex.coplan@arm.com>
840 * cp-objcp-common.cc (cp_feature_table): Remove entry for
841 cxx_constexpr_string_builtins.
843 2024-02-12 Marek Polacek <polacek@redhat.com>
846 * constexpr.cc (cxx_eval_switch_expr): If the condition doesn't reduce
847 to an INTEGER_CST, consider it non-constant.
849 2024-02-10 Marek Polacek <polacek@redhat.com>
854 * parser.cc (cp_parser_unqualified_id): Downgrade the DR2237 error to
856 (cp_parser_constructor_declarator_p): Likewise.
858 2024-02-10 Jakub Jelinek <jakub@redhat.com>
860 * tree.cc (debug_binfo): Use HOST_WIDE_INT_PRINT_DEC instead of "%ld"
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.
870 2024-02-09 Marek Polacek <polacek@redhat.com>
873 * semantics.cc (finish_type_pack_element): Perform range checking
876 2024-02-09 Marek Polacek <polacek@redhat.com>
879 * coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error
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
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
889 * pt.cc (tsubst_expr) <case THROW_EXPR>: Pass complain to build_throw.
891 2024-02-09 Patrick Palka <ppalka@redhat.com>
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.
898 2024-02-08 Patrick Palka <ppalka@redhat.com>
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.
905 2024-02-08 Jason Merrill <jason@redhat.com>
907 * pt.cc (create_template_parm_object): Pass TARGET_EXPR to
910 2024-02-06 Jakub Jelinek <jakub@redhat.com>
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.
919 2024-02-06 Marek Polacek <polacek@redhat.com>
921 * method.cc (early_check_defaulted_comparison): Add
922 auto_diagnostic_group.
924 2024-02-06 Jason Merrill <jason@redhat.com>
927 * method.cc (early_check_defaulted_comparison): Fail if not friend.
929 2024-02-05 Jason Merrill <jason@redhat.com>
932 * tree.cc (rvalue): Don't drop cv-quals from an array.
934 2024-02-03 Patrick Palka <ppalka@redhat.com>
938 * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
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
945 (tsubst_type_requirement): Return a substituted _REQ node when
946 processing_template_decl.
947 (tsubst_compound_requirement): Likewise. Accomodate non-diagnostic
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.
956 2024-02-02 Jason Merrill <jason@redhat.com>
959 * pt.cc (tsubst_function_decl): Only check a function defaulted
960 outside the class if the class is complete.
962 2024-02-02 Jason Merrill <jason@redhat.com>
965 * constexpr.cc (cxx_eval_store_expression): Check empty_base
966 before marking a CONSTRUCTOR readonly.
968 2024-02-02 Jason Merrill <jason@redhat.com>
971 * cp-tree.h: Adjust comment.
972 * pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
975 2024-02-01 Marek Polacek <polacek@redhat.com>
977 * call.cc (reference_like_class_p): Consider even non-templates for
978 std::span-like classes.
980 2024-02-01 Patrick Palka <ppalka@redhat.com>
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
989 * typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
990 Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
992 2024-02-01 Marek Polacek <polacek@redhat.com>
995 * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
996 the move on throw of parms loop.
998 2024-01-30 Marek Polacek <polacek@redhat.com>
1002 * call.cc (reference_like_class_p): Don't warn for std::span-like
1005 2024-01-30 Patrick Palka <ppalka@redhat.com>
1008 * call.cc (keep_unused_object_arg): Punt for an xobj member
1011 2024-01-30 Patrick Palka <ppalka@redhat.com>
1014 * pt.cc (unify) <case INTEGER_CST>: Handle NULL_TREE type.
1016 2024-01-30 Nathaniel Shead <nathanieloshead@gmail.com>
1019 * module.cc (get_module): Bail on empty name.
1021 2024-01-29 Jason Merrill <jason@redhat.com>
1024 * pt.cc (instantiate_class_template): Don't partially instantiate.
1025 (tsubst_stmt): Likewise.
1027 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
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
1038 (module_state::read_cluster): Write flags into cfun.
1040 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
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
1051 2024-01-25 Jakub Jelinek <jakub@redhat.com>
1054 * typeck2.cc (build_m_component_ref): Use convert instead of
1055 cp_convert for pointer conversion.
1057 2024-01-25 Jason Merrill <jason@redhat.com>
1060 * init.cc (build_vec_init): Don't use {} for PMF.
1062 2024-01-25 Jason Merrill <jason@redhat.com>
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.
1070 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
1073 * module.cc (set_defining_module): Track partial specialisations
1074 for all declarations.
1076 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
1079 * name-lookup.cc (add_imported_namespace): Don't mark namespaces
1082 2024-01-24 Patrick Palka <ppalka@redhat.com>
1085 * call.cc (add_operator_candidates): Propagate error_mark_node
1086 result after recursing to find rewritten candidates.
1088 2024-01-23 Marek Polacek <polacek@redhat.com>
1093 * call.cc (do_warn_dangling_reference): Don't warn if the temporary
1096 2024-01-23 Nathaniel Shead <nathanieloshead@gmail.com>
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
1105 (trees_in::read_class_def): Remove buggy extern template
1108 2024-01-19 Jason Merrill <jason@redhat.com>
1111 * pt.cc (decl_template_info): New fn.
1112 (get_template_info): Use it.
1114 2024-01-19 Jason Merrill <jason@redhat.com>
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
1126 (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
1127 * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.
1129 2024-01-18 Marek Polacek <polacek@redhat.com>
1132 * decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
1133 NULL_TREE when emitting an error.
1135 2024-01-17 Nathaniel Shead <nathanieloshead@gmail.com>
1138 * module.cc (trees_in::read_function_def): Don't overwrite
1141 2024-01-17 Patrick Palka <ppalka@redhat.com>
1145 * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
1146 DECL_ARTIFICIAL rejection test for class NTTP objects.
1148 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
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.
1161 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
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.
1168 2024-01-16 Marek Polacek <polacek@redhat.com>
1170 * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
1173 2024-01-16 Marek Polacek <polacek@redhat.com>
1176 * decl.cc (grokdeclarator) <case cdk_function>: Clear
1177 is_xobj_member_function in case of an error.
1179 2024-01-16 waffl3x <waffl3x@protonmail.com>
1182 * parser.cc (cp_parser_parameter_declaration): Reject packs
1185 2024-01-15 Marek Polacek <polacek@redhat.com>
1188 * parser.cc (cp_parser_template_type_arg): Add auto checking.
1190 2024-01-15 Patrick Palka <ppalka@redhat.com>
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.
1197 2024-01-15 Patrick Palka <ppalka@redhat.com>
1200 * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
1201 to the newly created partial specialization.
1203 2024-01-15 Patrick Palka <ppalka@redhat.com>
1206 * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
1207 false in a template context.
1209 2024-01-13 Jakub Jelinek <jakub@redhat.com>
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.
1215 2024-01-12 Jason Merrill <jason@redhat.com>
1218 * name-lookup.cc (lookup_elaborated_type): Look for bindings
1219 in the global namespace in the ABI namespace.
1221 2024-01-12 Jason Merrill <jason@redhat.com>
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.
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.
1234 2024-01-11 Jason Merrill <jason@redhat.com>
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.
1247 2024-01-10 Tamar Christina <tamar.christina@arm.com>
1249 * parser.cc (cp_parser_pragma): Initialize to false.
1251 2024-01-09 Jason Merrill <jason@redhat.com>
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.
1260 2024-01-09 Jason Merrill <jason@redhat.com>
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.
1266 2024-01-09 waffl3x <waffl3x@protonmail.com>
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
1275 (defaulted_late_check): Comment.
1276 (defaultable_fn_check): Comment.
1278 2024-01-09 waffl3x <waffl3x@protonmail.com>
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.
1292 2024-01-09 waffl3x <waffl3x@protonmail.com>
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
1310 (look_for_overrides_r): Reject an overriding xobj member function
1312 * semantics.cc (finish_this_expr): Diagnostics.
1313 * typeck.cc (cp_build_addr_expr_1): Diagnostics.
1315 2024-01-09 waffl3x <waffl3x@protonmail.com>
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
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
1341 2024-01-09 waffl3x <waffl3x@protonmail.com>
1342 Jason Merrill <jason@redhat.com>
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)
1362 (maybe_warn_class_memaccess)
1365 (do_warn_dangling_reference)
1366 * class.cc (finalize_literal_type_property)
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)
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)
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.
1408 2024-01-09 Julian Brown <julian@codesourcery.com>
1410 * constexpr.cc (potential_consant_expression_1): Handle
1412 * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
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
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
1438 * typeck.cc (build_omp_array_section): New function.
1440 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
1442 * module.cc (trees_out::write_var_def): Only write initializers
1445 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
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.
1451 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
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.
1462 2024-01-03 Patrick Palka <ppalka@redhat.com>
1465 * call.cc (reference_binding): Still try a conversion via a
1466 temporary if a direct conversion was bad.
1468 2024-01-03 Kwok Cheung Yeung <kcy@codesourcery.com>
1470 * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
1471 clause to correspond to alphabetical order.
1474 Copyright (C) 2024 Free Software Foundation, Inc.
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.