1 2024-03-08 Jakub Jelinek <jakub@redhat.com>
3 * pt.cc (tsubst_expr): Handle MEM_REF.
5 2024-03-08 Jakub Jelinek <jakub@redhat.com>
8 * cp-objcp-common.cc (cp_type_dwarf_attribute): Return 1
9 for DW_AT_export_symbols on anonymous structs or unions.
11 2024-03-08 Jakub Jelinek <jakub@redhat.com>
14 * parser.cc (cp_parser_parameter_declaration): Move the xobj_param_p
15 pack diagnostics after ellipsis handling and if an error is reported,
16 pretend this specifier didn't appear. Formatting fix.
18 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
21 * module.cc (trees_out::core_bools): Redetermine
22 DECL_INTERFACE_KNOWN on stream-in for vtables and tinfo.
23 * decl2.cc (import_export_decl): Add fixme for ABI changes with
24 module vtables and tinfo.
26 2024-03-07 Patrick Palka <ppalka@redhat.com>
29 * cp-tree.h (add_mergeable_specialization): Remove second
31 * module.cc (depset::disc_bits::DB_ALIAS_TMPL_INST_BIT): Remove.
32 (depset::disc_bits::DB_ALIAS_SPEC_BIT): Remove.
33 (depset::is_alias_tmpl_inst): Remove.
34 (depset::is_alias): Remove.
35 (merge_kind::MK_tmpl_alias_mask): Remove.
36 (merge_kind::MK_alias_spec): Remove.
37 (merge_kind_name): Remove entries for alias specializations.
38 (trees_out::core_vals) <case TEMPLATE_DECL>: Adjust after
39 removing is_alias_tmpl_inst.
40 (trees_in::decl_value): Adjust add_mergeable_specialization
42 (trees_out::get_merge_kind) <case depset::EK_SPECIALIZATION>:
43 Use MK_decl_spec for alias template specializations.
44 (trees_out::key_mergeable): Simplify after MK_tmpl_alias_mask
46 (depset::hash::make_dependency): Adjust after removing
47 DB_ALIAS_TMPL_INST_BIT.
48 (specialization_add): Don't allow alias templates when !decl_p.
49 (depset::hash::add_specializations): Remove now-dead code
50 accomodating alias template specializations in the type table.
51 * pt.cc (lookup_template_class): Dispatch early to
52 instantiate_alias_template for alias templates. Simplify
54 (add_mergeable_specialization): Remove alias_p parameter and
57 2024-03-07 Patrick Palka <ppalka@redhat.com>
61 * module.cc (module_state::write_namespaces): Stream the
62 abi_tag attribute of an inline namespace.
63 (module_state::read_namespaces): Likewise.
65 2024-03-07 Marek Polacek <polacek@redhat.com>
68 * pt.cc (lookup_and_finish_template_variable): Pass complain to
71 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
74 * typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
75 'member' will be a FUNCTION_DECL (or something like it).
77 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
80 * module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT
81 for template template parameters.
82 (trees_in::tpl_parms_fini): Read it.
84 2024-03-06 Marek Polacek <polacek@redhat.com>
87 * pt.cc (maybe_instantiate_noexcept): Save/restore
88 cp_unevaluated_operand, c_inhibit_evaluation_warnings, and
89 cp_noexcept_operand around the tsubst_expr call.
91 2024-03-06 Nathaniel Shead <nathanieloshead@gmail.com>
94 * pt.cc (type_unification_real): Only use DEDUCE_CONV for the
95 return type of a conversion function.
97 2024-03-06 Patrick Palka <ppalka@redhat.com>
99 * module.cc (trees_out::get_merge_kind) <case depset::EK_DECL>:
100 Accomodate class-scope DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P
101 TEMPLATE_DECL. Consolidate IDENTIFIER_ANON_P cases.
103 2024-03-05 Patrick Palka <ppalka@redhat.com>
105 * parser.cc (cp_parser_translation_unit): Relax GMF contents
106 error into a pedwarn.
108 2024-03-04 Nathaniel Shead <nathanieloshead@gmail.com>
110 * name-lookup.cc (walk_module_binding): Remove completed FIXME.
111 (do_nonmember_using_decl): Mark redeclared entities as exported
112 when needed. Check for re-exporting internal linkage types.
114 2024-03-01 Patrick Palka <ppalka@redhat.com>
118 * module.cc (depset::hash::sneakoscope): Remove.
119 (trees_out::decl_node): Always add a dependency on a local type.
120 (depset::hash::find_dependencies): Remove sneakoscope stuff.
122 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
125 * module.cc (has_definition): Fall back to DECL_INITIALIZED_P
126 when DECL_INITIAL is not set on a template.
127 (module_state::write_inits): Only increment count when
128 initializers are actually written.
130 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
133 * init.cc (create_temporary_var): Use current_scope instead of
134 current_function_decl.
136 2024-03-01 Patrick Palka <ppalka@redhat.com>
138 * decl.cc (maybe_register_incomplete_var): Restrict second
139 branch to static data members from a not-yet-complete class.
141 2024-03-01 Marek Polacek <polacek@redhat.com>
145 * call.cc (no_dangling_p): New.
146 (reference_like_class_p): Use it.
147 (do_warn_dangling_reference): Use it. Don't warn when the function
148 or its enclosing class has attribute gnu::no_dangling.
149 * tree.cc (cxx_gnu_attributes): Add gnu::no_dangling.
150 (handle_no_dangling_attribute): New.
152 2024-03-01 Patrick Palka <ppalka@redhat.com>
156 * cp-tree.h (make_cast_auto): Declare.
157 * parser.cc (cp_parser_functional_cast): If the type is an auto,
158 replace it with a level-less one via make_cast_auto.
159 * pt.cc (find_parameter_packs_r): Don't treat level-less auto
160 as a type parameter pack.
161 (tsubst) <case TEMPLATE_TYPE_PARM>: Generalize CTAD placeholder
162 auto handling to all level-less autos.
163 (make_cast_auto): Define.
164 (do_auto_deduction): Handle replacement of a level-less auto.
166 2024-03-01 Jakub Jelinek <jakub@redhat.com>
169 * decl.cc (lookup_decomp_type): Return NULL_TREE if decomp_type_table
170 doesn't have entry for V.
171 * semantics.cc (finish_decltype_type): If ptds.saved, assert
172 DECL_HAS_VALUE_EXPR_P is true and decide on tuple vs. non-tuple based
173 on if lookup_decomp_type is NULL or not.
175 2024-02-29 Marek Polacek <polacek@redhat.com>
178 * call.cc (conv_binds_to_reference_parm_p): New.
179 * cp-tree.h (conv_binds_to_reference_parm_p): Declare.
180 * init.cc (find_uninit_fields_r): Call it.
182 2024-02-29 Nathaniel Shead <nathanieloshead@gmail.com>
185 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Remove tree checking.
186 (struct lang_decl_base): Update comments and fix whitespace.
187 * module.cc (trees_out::lang_decl_bools): Always write
188 module_keyed_decls_p flag...
189 (trees_in::lang_decl_bools): ...and always read it.
190 (trees_out::decl_value): Handle all kinds of keyed decls.
191 (trees_in::decl_value): Likewise.
192 (trees_in::tree_value): Deduplicate LAMBDA_EXPRs.
193 (maybe_key_decl): Also support lambdas attached to fields,
194 parameters, and types. Key lambdas attached to fields to their
196 (trees_out::get_merge_kind): Likewise.
197 (trees_out::key_mergeable): Likewise.
198 (trees_in::key_mergeable): Support keyed decls in a TYPE_DECL
200 * parser.cc (cp_parser_class_head): Start a lambda scope when
201 parsing base classes.
203 2024-02-28 Jakub Jelinek <jakub@redhat.com>
204 Patrick Palka <ppalka@redhat.com>
207 * decl.cc (grokdeclarator): Don't call cp_apply_type_quals_to_decl
208 on DECL_TEMPLATE_INSTANTIATED VAR_DECLs.
210 2024-02-28 Nathaniel Shead <nathanieloshead@gmail.com>
214 * decl.cc (make_rtl_for_nonlocal_decl): Don't defer inline
217 2024-02-23 Jakub Jelinek <jakub@redhat.com>
220 * cp-gimplify.cc (cp_fold): For targetm.cxx.cdtor_returns_this ()
221 wrap r into a COMPOUND_EXPR and return folded CALL_EXPR_ARG (x, 0).
223 2024-02-19 Patrick Palka <ppalka@redhat.com>
226 * constraint.cc (tsubst_compound_requirement): Don't check
227 the noexcept condition or the return-type-requirement when
228 partially substituting.
230 2024-02-17 Marek Polacek <polacek@redhat.com>
233 * search.cc (maybe_check_overriding_exception_spec): Defer checking
234 when a noexcept couldn't be instantiated & evaluated to false/true.
236 2024-02-16 Marek Polacek <polacek@redhat.com>
239 * search.cc (maybe_check_overriding_exception_spec): Don't error about
240 a looser exception specification if the overrider is deleted.
242 2024-02-16 Marek Polacek <polacek@redhat.com>
246 * typeck.cc (treat_lvalue_as_rvalue_p): Update code to better
247 reflect [expr.prim.id.unqual]#4.2.
249 2024-02-16 Jakub Jelinek <jakub@redhat.com>
252 * parser.cc (cp_parser_parameter_declaration): Diagnose this specifier
253 on template parameter declaration.
255 2024-02-16 Patrick Palka <ppalka@redhat.com>
257 * module.cc (trees_out::core_bools): Stream TREE_UNAVAILABLE.
258 (trees_in::core_bools): Likewise.
259 (trees_out::core_vals): Stream LAMBDA_EXPR_REGEN_INFO.
260 (trees_in::core_vals): Likewise.
262 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
265 * decl.cc (make_rtl_for_nonlocal_decl): Defer inline variables.
266 * decl2.cc (import_export_decl): Support inline variables.
268 2024-02-14 Patrick Palka <ppalka@redhat.com>
272 * method.cc (synthesized_method_walk): Use maybe_push_to_top_level.
274 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
277 * decl.cc (start_enum): Reorder check for redeclaring in module.
278 Add missing auto_diagnostic_groups.
280 2024-02-13 Marek Polacek <polacek@redhat.com>
284 * parser.cc (cp_parser_member_declaration): Only pedwarn about an extra
287 2024-02-13 Tobias Burnus <tburnus@baylibre.com>
290 * parser.cc (cp_parser_omp_context_selector): Handle splitting of
291 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
293 2024-02-13 Patrick Palka <ppalka@redhat.com>
295 * Make-lang.in (CFLAGS-cp/module.o): Add $(ZLIBINC).
296 * module.cc: Include <zlib.h>.
297 (bytes::calc_crc): Use crc32 from zlib.
298 (bytes_out::set_crc): Use crc32_combine from zlib.
300 2024-02-13 Patrick Palka <ppalka@redhat.com>
302 * module.cc (depset::hash::add_specializations): Use
303 STRIP_TEMPLATE consistently.
304 (get_originating_module_decl): Handle class-scope CONST_DECL.
306 2024-02-13 Patrick Palka <ppalka@redhat.com>
308 * lambda.cc (lambda_function): Call get_class_binding_direct
309 instead of lookup_member to sidestep lazy loading.
310 * name-lookup.cc (check_local_shadow): Punt if we're in a
311 function context that's not actual parsing.
313 2024-02-13 Jason Merrill <jason@redhat.com>
316 * pt.cc (process_partial_specialization): Return early
319 2024-02-13 Marek Polacek <polacek@redhat.com>
322 * except.cc (expand_start_catch_block): Pass tf_warning_or_error to
323 is_admissible_throw_operand_or_catch_parameter.
324 (build_throw): Pass complain to
325 is_admissible_throw_operand_or_catch_parameter.
326 (complete_ptr_ref_or_void_ptr_p): Add a tsubst_flags_t parameter. Use
327 it. Return bool. Call complete_type_or_maybe_complain instead of
328 complete_type_or_else.
329 (is_admissible_throw_operand_or_catch_parameter): Add a tsubst_flags_t
330 parameter. Use it. Guard error calls.
332 2024-02-13 Alex Coplan <alex.coplan@arm.com>
335 * cp-objcp-common.cc (cp_feature_table): Remove entry for
336 cxx_constexpr_string_builtins.
338 2024-02-12 Marek Polacek <polacek@redhat.com>
341 * constexpr.cc (cxx_eval_switch_expr): If the condition doesn't reduce
342 to an INTEGER_CST, consider it non-constant.
344 2024-02-10 Marek Polacek <polacek@redhat.com>
349 * parser.cc (cp_parser_unqualified_id): Downgrade the DR2237 error to
351 (cp_parser_constructor_declarator_p): Likewise.
353 2024-02-10 Jakub Jelinek <jakub@redhat.com>
355 * tree.cc (debug_binfo): Use HOST_WIDE_INT_PRINT_DEC instead of "%ld"
357 * pt.cc (print_template_statistics): Use HOST_SIZE_T_PRINT_DEC
358 and casts to fmt_size_t instead of "%ld" and casts to long.
359 * class.cc (dump_class_hierarchy_1): Use HOST_WIDE_INT_PRINT_UNSIGNED
360 instead of "%lu" and casts to unsigned long. For TYPE_ALIGN, use
361 %u instead of %lu and drop casts to unsigned long.
362 * parser.cc (cp_lexer_peek_nth_token): Use HOST_SIZE_T_PRINT_DEC
363 and casts to fmt_size_t instead of "%ld" and casts to long.
365 2024-02-09 Marek Polacek <polacek@redhat.com>
368 * semantics.cc (finish_type_pack_element): Perform range checking
371 2024-02-09 Marek Polacek <polacek@redhat.com>
374 * coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error
376 (morph_fn_to_coro): Likewise.
377 * cp-tree.h (build_throw): Adjust.
378 * except.cc (expand_end_catch_block): Pass tf_warning_or_error to
380 (build_throw): Add a tsubst_flags_t parameter. Use it. Remove
381 redundant variable. Guard an inform call.
382 * parser.cc (cp_parser_throw_expression): Pass tf_warning_or_error
384 * pt.cc (tsubst_expr) <case THROW_EXPR>: Pass complain to build_throw.
386 2024-02-09 Patrick Palka <ppalka@redhat.com>
389 * module.cc (trees_in::read_class_def): When streaming in
390 an anonymous union field of an as-base class, don't overwrite
391 ANON_AGGR_TYPE_FIELD.
393 2024-02-08 Patrick Palka <ppalka@redhat.com>
396 * pt.cc (do_class_deduction): Add outer_targs parameter.
397 Substitute outer arguments into the CTAD template.
398 (do_auto_deduction): Pass outer_targs to do_class_deduction.
400 2024-02-08 Jason Merrill <jason@redhat.com>
402 * pt.cc (create_template_parm_object): Pass TARGET_EXPR to
405 2024-02-06 Jakub Jelinek <jakub@redhat.com>
408 * parser.cc (CP_PARSER_FLAGS_PARAMETER): New enumerator.
409 (cp_parser_decl_specifier_seq): Parse RID_THIS only if
410 CP_PARSER_FLAGS_PARAMETER is set in flags.
411 (cp_parser_parameter_declaration): Or in CP_PARSER_FLAGS_PARAMETER
412 when calling cp_parser_decl_specifier_seq.
414 2024-02-06 Marek Polacek <polacek@redhat.com>
416 * method.cc (early_check_defaulted_comparison): Add
417 auto_diagnostic_group.
419 2024-02-06 Jason Merrill <jason@redhat.com>
422 * method.cc (early_check_defaulted_comparison): Fail if not friend.
424 2024-02-05 Jason Merrill <jason@redhat.com>
427 * tree.cc (rvalue): Don't drop cv-quals from an array.
429 2024-02-03 Patrick Palka <ppalka@redhat.com>
433 * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
435 (tsubst_valid_expression_requirement): Likewise.
436 (tsubst_simple_requirement): Return a substituted _REQ node when
437 processing_template_decl.
438 (tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
440 (tsubst_type_requirement): Return a substituted _REQ node when
441 processing_template_decl.
442 (tsubst_compound_requirement): Likewise. Accomodate non-diagnostic
444 (tsubst_nested_requirement): Likewise.
445 (tsubst_requires_expr): Don't defer partial substitution when
446 processing_constraint_expression_p is true, in which case return
447 a substituted REQUIRES_EXPR.
448 * pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
449 non-diagnostic tsubst flags.
451 2024-02-02 Jason Merrill <jason@redhat.com>
454 * pt.cc (tsubst_function_decl): Only check a function defaulted
455 outside the class if the class is complete.
457 2024-02-02 Jason Merrill <jason@redhat.com>
460 * constexpr.cc (cxx_eval_store_expression): Check empty_base
461 before marking a CONSTRUCTOR readonly.
463 2024-02-02 Jason Merrill <jason@redhat.com>
466 * cp-tree.h: Adjust comment.
467 * pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
470 2024-02-01 Marek Polacek <polacek@redhat.com>
472 * call.cc (reference_like_class_p): Consider even non-templates for
473 std::span-like classes.
475 2024-02-01 Patrick Palka <ppalka@redhat.com>
478 * pt.cc (iterative_hash_template_arg) <case TEMPLATE_DECL>:
479 Adjust hashing to match cp_tree_equal.
480 (ctp_hasher::hash): Also hash CLASS_PLACEHOLDER_TEMPLATE.
481 * tree.cc (cp_tree_equal) <case TEMPLATE_DECL>: Return true
482 for ttp TEMPLATE_DECLs if their TEMPLATE_TEMPLATE_PARMs are
484 * typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
485 Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
487 2024-02-01 Marek Polacek <polacek@redhat.com>
490 * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
491 the move on throw of parms loop.
493 2024-01-30 Marek Polacek <polacek@redhat.com>
497 * call.cc (reference_like_class_p): Don't warn for std::span-like
500 2024-01-30 Patrick Palka <ppalka@redhat.com>
503 * call.cc (keep_unused_object_arg): Punt for an xobj member
506 2024-01-30 Patrick Palka <ppalka@redhat.com>
509 * pt.cc (unify) <case INTEGER_CST>: Handle NULL_TREE type.
511 2024-01-30 Nathaniel Shead <nathanieloshead@gmail.com>
514 * module.cc (get_module): Bail on empty name.
516 2024-01-29 Jason Merrill <jason@redhat.com>
519 * pt.cc (instantiate_class_template): Don't partially instantiate.
520 (tsubst_stmt): Likewise.
522 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
525 * module.cc (struct post_process_data): Create.
526 (trees_in::post_decls): Use.
527 (trees_in::post_process): Return entire vector at once.
528 Change overload to take post_process_data instead of tree.
529 (trees_out::write_function_def): Write needed flags from
530 DECL_STRUCT_FUNCTION.
531 (trees_in::read_function_def): Read them and pass to
533 (module_state::read_cluster): Write flags into cfun.
535 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
538 * cp-tree.h (note_variable_template_instantiation): Rename to...
539 (note_vague_linkage_variable): ...this.
540 * decl2.cc (note_variable_template_instantiation): Rename to...
541 (note_vague_linkage_variable): ...this.
542 * pt.cc (instantiate_decl): Rename usage of above function.
543 * module.cc (trees_in::read_var_def): Remember pending statics
546 2024-01-25 Jakub Jelinek <jakub@redhat.com>
549 * typeck2.cc (build_m_component_ref): Use convert instead of
550 cp_convert for pointer conversion.
552 2024-01-25 Jason Merrill <jason@redhat.com>
555 * init.cc (build_vec_init): Don't use {} for PMF.
557 2024-01-25 Jason Merrill <jason@redhat.com>
560 * coroutines.cc (build_co_await): Use cxx_maybe_build_cleanup.
561 (build_actor_fn, process_conditional, maybe_promote_temps)
562 (morph_fn_to_coro): Likewise.
563 (expand_one_await_expression): Use build_cleanup.
565 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
568 * module.cc (set_defining_module): Track partial specialisations
569 for all declarations.
571 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
574 * name-lookup.cc (add_imported_namespace): Don't mark namespaces
577 2024-01-24 Patrick Palka <ppalka@redhat.com>
580 * call.cc (add_operator_candidates): Propagate error_mark_node
581 result after recursing to find rewritten candidates.
583 2024-01-23 Marek Polacek <polacek@redhat.com>
588 * call.cc (do_warn_dangling_reference): Don't warn if the temporary
591 2024-01-23 Nathaniel Shead <nathanieloshead@gmail.com>
595 * module.cc (trees_out::lang_type_bools): Write interface_only
596 and interface_unknown.
597 (trees_in::lang_type_bools): Read the above flags.
598 (trees_in::decl_value): Reset CLASSTYPE_INTERFACE_* except for
600 (trees_in::read_class_def): Remove buggy extern template
603 2024-01-19 Jason Merrill <jason@redhat.com>
606 * pt.cc (decl_template_info): New fn.
607 (get_template_info): Use it.
609 2024-01-19 Jason Merrill <jason@redhat.com>
616 * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
617 * pt.cc (expand_integer_pack): Remove 111357 workaround.
618 (maybe_convert_nontype_argument): Add force parm.
619 (convert_template_argument): Handle alias template args
621 (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
622 * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.
624 2024-01-18 Marek Polacek <polacek@redhat.com>
627 * decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
628 NULL_TREE when emitting an error.
630 2024-01-17 Nathaniel Shead <nathanieloshead@gmail.com>
633 * module.cc (trees_in::read_function_def): Don't overwrite
636 2024-01-17 Patrick Palka <ppalka@redhat.com>
640 * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
641 DECL_ARTIFICIAL rejection test for class NTTP objects.
643 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
646 * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
647 (c_parse_final_cleanups): Suppress warning for no definition of
648 TLS wrapper functions in header modules.
649 * module.cc (trees_out::lang_decl_vals): Write wrapped variable
650 for TLS wrapper functions.
651 (trees_in::lang_decl_vals): Read it.
652 (trees_out::decl_value): Write TLS model for thread-local vars.
653 (trees_in::decl_value): Read it for new decls. Remember to emit
654 definitions of TLS wrapper functions later.
656 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
658 * name-lookup.h (enum scope_kind): Add 'sk_count'.
659 * name-lookup.cc (cp_binding_level_descriptor): Add missing
660 scope kinds. Add assertion that the list is up to date. Fix
661 handling of explicit_spec_p.
663 2024-01-16 Marek Polacek <polacek@redhat.com>
665 * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
668 2024-01-16 Marek Polacek <polacek@redhat.com>
671 * decl.cc (grokdeclarator) <case cdk_function>: Clear
672 is_xobj_member_function in case of an error.
674 2024-01-16 waffl3x <waffl3x@protonmail.com>
677 * parser.cc (cp_parser_parameter_declaration): Reject packs
680 2024-01-15 Marek Polacek <polacek@redhat.com>
683 * parser.cc (cp_parser_template_type_arg): Add auto checking.
685 2024-01-15 Patrick Palka <ppalka@redhat.com>
687 * parser.cc (cp_parser_check_access_in_redeclaration): Don't
688 check access for a partial or explicit specialization.
689 * pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
690 or TREE_PROTECTED on the newly created partial specialization.
692 2024-01-15 Patrick Palka <ppalka@redhat.com>
695 * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
696 to the newly created partial specialization.
698 2024-01-15 Patrick Palka <ppalka@redhat.com>
701 * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
702 false in a template context.
704 2024-01-13 Jakub Jelinek <jakub@redhat.com>
706 * mangle.cc (write_nested_name): Mangle explicit object
707 member functions with H as per
708 https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
710 2024-01-12 Jason Merrill <jason@redhat.com>
713 * name-lookup.cc (lookup_elaborated_type): Look for bindings
714 in the global namespace in the ABI namespace.
716 2024-01-12 Jason Merrill <jason@redhat.com>
718 * call.cc (reversed_match): New.
719 (enum class pmatch): New enum.
720 (cand_parms_match): Add match_kind parm.
721 (object_parms_correspond): Add fn parms.
723 * class.cc (xobj_iobj_parameters_correspond): Rename to...
724 (iobj_parm_corresponds_to): ...this. Take the other
725 type instead of a second function.
726 (object_parms_correspond): Adjust.
727 * cp-tree.h (iobj_parm_corresponds_to): Declare.
729 2024-01-11 Jason Merrill <jason@redhat.com>
732 * class.cc (xobj_iobj_parameters_correspond): Add context parm.
733 (object_parms_correspond): Factor out of...
734 (add_method): ...here.
735 * method.cc (defaulted_late_check): Use it.
736 * call.cc (class_of_implicit_object): New.
737 (object_parms_correspond): Overload taking two candidates.
738 (cand_parms_match): Use it.
739 (joust): Check reversed before comparing constraints.
740 * cp-tree.h (object_parms_correspond): Declare.
742 2024-01-10 Tamar Christina <tamar.christina@arm.com>
744 * parser.cc (cp_parser_pragma): Initialize to false.
746 2024-01-09 Jason Merrill <jason@redhat.com>
748 * semantics.cc (is_object_parameter): New.
749 * cp-tree.h (is_object_parameter): Declare.
750 * call.cc (maybe_warn_class_memaccess): Use it.
751 * search.cc (field_access_p): Use it.
752 (class_of_object_parm): New.
753 (field_accessor_p): Adjust for explicit object parms.
755 2024-01-09 Jason Merrill <jason@redhat.com>
757 * call.cc (build_over_call): Refactor handle_arg lambda.
758 * class.cc (xobj_iobj_parameters_correspond): Fix FIXME.
759 * method.cc (defaulted_late_check): Adjust comments.
761 2024-01-09 waffl3x <waffl3x@protonmail.com>
765 C++23 P0847R7 (deducing this) - CWG2586.
766 * decl.cc (copy_fn_p): Accept xobj copy assignment functions.
767 (move_signature_fn_p): Accept xobj move assignment functions.
768 * method.cc (do_build_copy_assign): Handle defaulted xobj member
770 (defaulted_late_check): Comment.
771 (defaultable_fn_check): Comment.
773 2024-01-09 waffl3x <waffl3x@protonmail.com>
777 C++23 P0847R7 (deducing this) - xobj lambdas.
778 * lambda.cc (build_capture_proxy): Don't fold direct object types.
779 * parser.cc (cp_parser_lambda_declarator_opt): Handle xobj lambdas,
780 diagnostics. Comments also updated.
781 * pt.cc (tsubst_function_decl): Handle xobj lambdas. Check object
782 type of xobj lambda call operator, diagnose incorrect types.
783 (tsubst_lambda_expr): Update comment.
784 * semantics.cc (finish_decltype_type): Also consider by-value object
785 parameter qualifications.
787 2024-01-09 waffl3x <waffl3x@protonmail.com>
791 C++23 P0847R7 (deducing this) - diagnostics.
792 * class.cc (resolve_address_of_overloaded_function): Diagnostics.
793 * cp-tree.h (TFF_XOBJ_FUNC): Define.
794 * decl.cc (grokfndecl): Diagnostics.
795 (grokdeclarator): Diagnostics.
796 * error.cc (dump_aggr_type): Pass TFF_XOBJ_FUNC.
797 (dump_lambda_function): Formatting for xobj lambda.
798 (dump_function_decl): Pass TFF_XOBJ_FUNC.
799 (dump_parameters): Formatting for xobj member functions.
800 (function_category): Formatting for xobj member functions.
801 * parser.cc (cp_parser_decl_specifier_seq): Diagnostics.
802 (cp_parser_parameter_declaration): Diagnostics.
803 * search.cc (look_for_overrides_here): Make xobj member functions
805 (look_for_overrides_r): Reject an overriding xobj member function
807 * semantics.cc (finish_this_expr): Diagnostics.
808 * typeck.cc (cp_build_addr_expr_1): Diagnostics.
810 2024-01-09 waffl3x <waffl3x@protonmail.com>
814 C++23 P0847R7 (deducing this) - initial functionality.
815 * class.cc (xobj_iobj_parameters_correspond): New function, checks
816 for corresponding object parameters between xobj and iobj member
818 (add_method): Handle object parameters of xobj member functions, use
819 xobj_iobj_parameters_correspond.
820 * call.cc (build_over_call): Refactor, handle xobj member functions.
821 (cand_parms_match): Handle object parameters of xobj and iobj member
822 functions, use xobj_iobj_parameters_correspond.
823 * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
824 * decl.cc (grokfndecl): Add xobj_func_p parameter. For xobj member
825 functions, Set xobj_flag, don't set static_function flag.
826 (grokdeclarator): Handle xobj member functions, tell grokfndecl.
827 (grok_op_properties): Don't error for xobj operators.
828 * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
829 (cp_parser_parameter_declaration): Set default argument to
830 "this_identifier" for xobj parameters.
831 (set_and_check_decl_spec_loc): Add "this", add comments.
832 * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
833 * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
836 2024-01-09 waffl3x <waffl3x@protonmail.com>
837 Jason Merrill <jason@redhat.com>
840 * cp-tree.h (struct lang_decl_fn): New data member.
841 (DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
842 (DECL_IOBJ_MEMBER_FUNCTION_P): Define.
843 (DECL_FUNCTION_XOBJ_FLAG): Define.
844 (DECL_XOBJ_MEMBER_FUNCTION_P): Define.
845 (DECL_OBJECT_MEMBER_FUNCTION_P): Define.
846 (DECL_FUNCTION_MEMBER_P): Don't use
847 DECL_NONSTATIC_MEMBER_FUNCTION_P.
848 (DECL_CONST_MEMFUNC_P): Likewise.
849 (DECL_VOLATILE_MEMFUNC_P): Likewise.
850 (DECL_NONSTATIC_MEMBER_P): Likewise.
851 * module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
852 (trees_in::lang_decl_bools): Handle xobj_flag.
853 * call.cc (build_this_conversion)
854 (add_function_candidate)
855 (add_template_candidate_real)
857 (maybe_warn_class_memaccess)
860 (do_warn_dangling_reference)
861 * class.cc (finalize_literal_type_property)
863 (resolve_address_of_overloaded_function)
864 * constexpr.cc (is_valid_constexpr_fn)
865 (cxx_bind_parameters_in_call)
866 * contracts.cc (build_contract_condition_function)
867 * cp-objcp-common.cc (cp_decl_dwarf_attribute)
868 * cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
869 (cxx_pretty_printer::declaration_specifiers)
870 (cxx_pretty_printer::direct_declarator)
871 * decl.cc (cp_finish_decl)
872 (grok_special_member_properties)
873 (start_preparsed_function)
874 (record_key_method_defined)
875 * decl2.cc (cp_handle_deprecated_or_unavailable)
876 * init.cc (find_uninit_fields_r)
878 * lambda.cc (lambda_expr_this_capture)
879 (maybe_generic_this_capture)
880 (nonlambda_method_basetype)
881 * mangle.cc (write_nested_name)
882 * method.cc (early_check_defaulted_comparison)
883 (skip_artificial_parms_for)
884 (num_artificial_parms_for)
885 * pt.cc (is_specialization_of_friend)
886 (determine_specialization)
887 (copy_default_args_to_explicit_spec)
888 (check_explicit_specialization)
889 (tsubst_contract_attribute)
890 (check_non_deducible_conversions)
891 (more_specialized_fn)
892 (maybe_instantiate_noexcept)
893 (register_parameter_specializations)
894 (value_dependent_expression_p)
895 * search.cc (shared_member_p)
898 * semantics.cc (finish_omp_declare_simd_methods)
899 * tree.cc (lvalue_kind)
900 * typeck.cc (invalid_nonstatic_memfn_p): Don't use
901 DECL_NONSTATIC_MEMBER_FUNCTION_P.
903 2024-01-09 Julian Brown <julian@codesourcery.com>
905 * constexpr.cc (potential_consant_expression_1): Handle
907 * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
909 * decl2.cc (grok_omp_array_section): New function.
910 * error.cc (dump_expr): Handle OMP_ARRAY_SECTION.
911 * parser.cc (cp_parser_new): Initialize parser->omp_array_section_p.
912 (cp_parser_statement_expr): Disallow array sections.
913 (cp_parser_postfix_open_square_expression): Support OMP_ARRAY_SECTION
915 (cp_parser_parenthesized_expression_list, cp_parser_lambda_expression,
916 cp_parser_braced_list): Disallow array sections.
917 (cp_parser_omp_var_list_no_open): Remove ALLOW_DEREF parameter, add
918 MAP_LVALUE in its place. Support generalised lvalue parsing for
919 OpenMP map, to and from clauses. Use OMP_ARRAY_SECTION
920 code instead of TREE_LIST to represent OpenMP array sections.
921 (cp_parser_omp_var_list): Remove ALLOW_DEREF parameter, add MAP_LVALUE.
922 Pass to cp_parser_omp_var_list_no_open.
923 (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
924 (cp_parser_omp_clause_map): Add sk_omp scope around
925 cp_parser_omp_var_list_no_open call.
926 * parser.h (cp_parser): Add omp_array_section_p field.
927 * pt.cc (tsubst, tsubst_copy, tsubst_omp_clause_decl,
928 tsubst_copy_and_build): Add OMP_ARRAY_SECTION support.
929 * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections,
930 cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION
931 instead of TREE_LIST where appropriate. Handle more types of map
933 * typeck.cc (build_omp_array_section): New function.
935 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
937 * module.cc (trees_out::write_var_def): Only write initializers
940 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
943 * module.cc (depset::hash::add_binding_entity): Don't skip names
944 in the GMF if they've been exported with a using declaration.
946 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
949 * parser.cc (cp_parser_module_name): Rewrite to handle
950 module-names and module-partitions independently.
951 (cp_parser_module_partition): New function.
952 (cp_parser_module_declaration): Parse module partitions
953 explicitly. Don't change state if parsing module decl failed.
954 (cp_parser_import_declaration): Handle different kinds of
955 import-declarations locally.
957 2024-01-03 Patrick Palka <ppalka@redhat.com>
960 * call.cc (reference_binding): Still try a conversion via a
961 temporary if a direct conversion was bad.
963 2024-01-03 Kwok Cheung Yeung <kcy@codesourcery.com>
965 * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
966 clause to correspond to alphabetical order.
969 Copyright (C) 2024 Free Software Foundation, Inc.
971 Copying and distribution of this file, with or without modification,
972 are permitted in any medium without royalty provided the copyright
973 notice and this notice are preserved.