1 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
4 * module.cc (trees_out::core_bools): Redetermine
5 DECL_INTERFACE_KNOWN on stream-in for vtables and tinfo.
6 * decl2.cc (import_export_decl): Add fixme for ABI changes with
7 module vtables and tinfo.
9 2024-03-07 Patrick Palka <ppalka@redhat.com>
12 * cp-tree.h (add_mergeable_specialization): Remove second
14 * module.cc (depset::disc_bits::DB_ALIAS_TMPL_INST_BIT): Remove.
15 (depset::disc_bits::DB_ALIAS_SPEC_BIT): Remove.
16 (depset::is_alias_tmpl_inst): Remove.
17 (depset::is_alias): Remove.
18 (merge_kind::MK_tmpl_alias_mask): Remove.
19 (merge_kind::MK_alias_spec): Remove.
20 (merge_kind_name): Remove entries for alias specializations.
21 (trees_out::core_vals) <case TEMPLATE_DECL>: Adjust after
22 removing is_alias_tmpl_inst.
23 (trees_in::decl_value): Adjust add_mergeable_specialization
25 (trees_out::get_merge_kind) <case depset::EK_SPECIALIZATION>:
26 Use MK_decl_spec for alias template specializations.
27 (trees_out::key_mergeable): Simplify after MK_tmpl_alias_mask
29 (depset::hash::make_dependency): Adjust after removing
30 DB_ALIAS_TMPL_INST_BIT.
31 (specialization_add): Don't allow alias templates when !decl_p.
32 (depset::hash::add_specializations): Remove now-dead code
33 accomodating alias template specializations in the type table.
34 * pt.cc (lookup_template_class): Dispatch early to
35 instantiate_alias_template for alias templates. Simplify
37 (add_mergeable_specialization): Remove alias_p parameter and
40 2024-03-07 Patrick Palka <ppalka@redhat.com>
44 * module.cc (module_state::write_namespaces): Stream the
45 abi_tag attribute of an inline namespace.
46 (module_state::read_namespaces): Likewise.
48 2024-03-07 Marek Polacek <polacek@redhat.com>
51 * pt.cc (lookup_and_finish_template_variable): Pass complain to
54 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
57 * typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
58 'member' will be a FUNCTION_DECL (or something like it).
60 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
63 * module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT
64 for template template parameters.
65 (trees_in::tpl_parms_fini): Read it.
67 2024-03-06 Marek Polacek <polacek@redhat.com>
70 * pt.cc (maybe_instantiate_noexcept): Save/restore
71 cp_unevaluated_operand, c_inhibit_evaluation_warnings, and
72 cp_noexcept_operand around the tsubst_expr call.
74 2024-03-06 Nathaniel Shead <nathanieloshead@gmail.com>
77 * pt.cc (type_unification_real): Only use DEDUCE_CONV for the
78 return type of a conversion function.
80 2024-03-06 Patrick Palka <ppalka@redhat.com>
82 * module.cc (trees_out::get_merge_kind) <case depset::EK_DECL>:
83 Accomodate class-scope DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P
84 TEMPLATE_DECL. Consolidate IDENTIFIER_ANON_P cases.
86 2024-03-05 Patrick Palka <ppalka@redhat.com>
88 * parser.cc (cp_parser_translation_unit): Relax GMF contents
91 2024-03-04 Nathaniel Shead <nathanieloshead@gmail.com>
93 * name-lookup.cc (walk_module_binding): Remove completed FIXME.
94 (do_nonmember_using_decl): Mark redeclared entities as exported
95 when needed. Check for re-exporting internal linkage types.
97 2024-03-01 Patrick Palka <ppalka@redhat.com>
101 * module.cc (depset::hash::sneakoscope): Remove.
102 (trees_out::decl_node): Always add a dependency on a local type.
103 (depset::hash::find_dependencies): Remove sneakoscope stuff.
105 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
108 * module.cc (has_definition): Fall back to DECL_INITIALIZED_P
109 when DECL_INITIAL is not set on a template.
110 (module_state::write_inits): Only increment count when
111 initializers are actually written.
113 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
116 * init.cc (create_temporary_var): Use current_scope instead of
117 current_function_decl.
119 2024-03-01 Patrick Palka <ppalka@redhat.com>
121 * decl.cc (maybe_register_incomplete_var): Restrict second
122 branch to static data members from a not-yet-complete class.
124 2024-03-01 Marek Polacek <polacek@redhat.com>
128 * call.cc (no_dangling_p): New.
129 (reference_like_class_p): Use it.
130 (do_warn_dangling_reference): Use it. Don't warn when the function
131 or its enclosing class has attribute gnu::no_dangling.
132 * tree.cc (cxx_gnu_attributes): Add gnu::no_dangling.
133 (handle_no_dangling_attribute): New.
135 2024-03-01 Patrick Palka <ppalka@redhat.com>
139 * cp-tree.h (make_cast_auto): Declare.
140 * parser.cc (cp_parser_functional_cast): If the type is an auto,
141 replace it with a level-less one via make_cast_auto.
142 * pt.cc (find_parameter_packs_r): Don't treat level-less auto
143 as a type parameter pack.
144 (tsubst) <case TEMPLATE_TYPE_PARM>: Generalize CTAD placeholder
145 auto handling to all level-less autos.
146 (make_cast_auto): Define.
147 (do_auto_deduction): Handle replacement of a level-less auto.
149 2024-03-01 Jakub Jelinek <jakub@redhat.com>
152 * decl.cc (lookup_decomp_type): Return NULL_TREE if decomp_type_table
153 doesn't have entry for V.
154 * semantics.cc (finish_decltype_type): If ptds.saved, assert
155 DECL_HAS_VALUE_EXPR_P is true and decide on tuple vs. non-tuple based
156 on if lookup_decomp_type is NULL or not.
158 2024-02-29 Marek Polacek <polacek@redhat.com>
161 * call.cc (conv_binds_to_reference_parm_p): New.
162 * cp-tree.h (conv_binds_to_reference_parm_p): Declare.
163 * init.cc (find_uninit_fields_r): Call it.
165 2024-02-29 Nathaniel Shead <nathanieloshead@gmail.com>
168 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Remove tree checking.
169 (struct lang_decl_base): Update comments and fix whitespace.
170 * module.cc (trees_out::lang_decl_bools): Always write
171 module_keyed_decls_p flag...
172 (trees_in::lang_decl_bools): ...and always read it.
173 (trees_out::decl_value): Handle all kinds of keyed decls.
174 (trees_in::decl_value): Likewise.
175 (trees_in::tree_value): Deduplicate LAMBDA_EXPRs.
176 (maybe_key_decl): Also support lambdas attached to fields,
177 parameters, and types. Key lambdas attached to fields to their
179 (trees_out::get_merge_kind): Likewise.
180 (trees_out::key_mergeable): Likewise.
181 (trees_in::key_mergeable): Support keyed decls in a TYPE_DECL
183 * parser.cc (cp_parser_class_head): Start a lambda scope when
184 parsing base classes.
186 2024-02-28 Jakub Jelinek <jakub@redhat.com>
187 Patrick Palka <ppalka@redhat.com>
190 * decl.cc (grokdeclarator): Don't call cp_apply_type_quals_to_decl
191 on DECL_TEMPLATE_INSTANTIATED VAR_DECLs.
193 2024-02-28 Nathaniel Shead <nathanieloshead@gmail.com>
197 * decl.cc (make_rtl_for_nonlocal_decl): Don't defer inline
200 2024-02-23 Jakub Jelinek <jakub@redhat.com>
203 * cp-gimplify.cc (cp_fold): For targetm.cxx.cdtor_returns_this ()
204 wrap r into a COMPOUND_EXPR and return folded CALL_EXPR_ARG (x, 0).
206 2024-02-19 Patrick Palka <ppalka@redhat.com>
209 * constraint.cc (tsubst_compound_requirement): Don't check
210 the noexcept condition or the return-type-requirement when
211 partially substituting.
213 2024-02-17 Marek Polacek <polacek@redhat.com>
216 * search.cc (maybe_check_overriding_exception_spec): Defer checking
217 when a noexcept couldn't be instantiated & evaluated to false/true.
219 2024-02-16 Marek Polacek <polacek@redhat.com>
222 * search.cc (maybe_check_overriding_exception_spec): Don't error about
223 a looser exception specification if the overrider is deleted.
225 2024-02-16 Marek Polacek <polacek@redhat.com>
229 * typeck.cc (treat_lvalue_as_rvalue_p): Update code to better
230 reflect [expr.prim.id.unqual]#4.2.
232 2024-02-16 Jakub Jelinek <jakub@redhat.com>
235 * parser.cc (cp_parser_parameter_declaration): Diagnose this specifier
236 on template parameter declaration.
238 2024-02-16 Patrick Palka <ppalka@redhat.com>
240 * module.cc (trees_out::core_bools): Stream TREE_UNAVAILABLE.
241 (trees_in::core_bools): Likewise.
242 (trees_out::core_vals): Stream LAMBDA_EXPR_REGEN_INFO.
243 (trees_in::core_vals): Likewise.
245 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
248 * decl.cc (make_rtl_for_nonlocal_decl): Defer inline variables.
249 * decl2.cc (import_export_decl): Support inline variables.
251 2024-02-14 Patrick Palka <ppalka@redhat.com>
255 * method.cc (synthesized_method_walk): Use maybe_push_to_top_level.
257 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
260 * decl.cc (start_enum): Reorder check for redeclaring in module.
261 Add missing auto_diagnostic_groups.
263 2024-02-13 Marek Polacek <polacek@redhat.com>
267 * parser.cc (cp_parser_member_declaration): Only pedwarn about an extra
270 2024-02-13 Tobias Burnus <tburnus@baylibre.com>
273 * parser.cc (cp_parser_omp_context_selector): Handle splitting of
274 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
276 2024-02-13 Patrick Palka <ppalka@redhat.com>
278 * Make-lang.in (CFLAGS-cp/module.o): Add $(ZLIBINC).
279 * module.cc: Include <zlib.h>.
280 (bytes::calc_crc): Use crc32 from zlib.
281 (bytes_out::set_crc): Use crc32_combine from zlib.
283 2024-02-13 Patrick Palka <ppalka@redhat.com>
285 * module.cc (depset::hash::add_specializations): Use
286 STRIP_TEMPLATE consistently.
287 (get_originating_module_decl): Handle class-scope CONST_DECL.
289 2024-02-13 Patrick Palka <ppalka@redhat.com>
291 * lambda.cc (lambda_function): Call get_class_binding_direct
292 instead of lookup_member to sidestep lazy loading.
293 * name-lookup.cc (check_local_shadow): Punt if we're in a
294 function context that's not actual parsing.
296 2024-02-13 Jason Merrill <jason@redhat.com>
299 * pt.cc (process_partial_specialization): Return early
302 2024-02-13 Marek Polacek <polacek@redhat.com>
305 * except.cc (expand_start_catch_block): Pass tf_warning_or_error to
306 is_admissible_throw_operand_or_catch_parameter.
307 (build_throw): Pass complain to
308 is_admissible_throw_operand_or_catch_parameter.
309 (complete_ptr_ref_or_void_ptr_p): Add a tsubst_flags_t parameter. Use
310 it. Return bool. Call complete_type_or_maybe_complain instead of
311 complete_type_or_else.
312 (is_admissible_throw_operand_or_catch_parameter): Add a tsubst_flags_t
313 parameter. Use it. Guard error calls.
315 2024-02-13 Alex Coplan <alex.coplan@arm.com>
318 * cp-objcp-common.cc (cp_feature_table): Remove entry for
319 cxx_constexpr_string_builtins.
321 2024-02-12 Marek Polacek <polacek@redhat.com>
324 * constexpr.cc (cxx_eval_switch_expr): If the condition doesn't reduce
325 to an INTEGER_CST, consider it non-constant.
327 2024-02-10 Marek Polacek <polacek@redhat.com>
332 * parser.cc (cp_parser_unqualified_id): Downgrade the DR2237 error to
334 (cp_parser_constructor_declarator_p): Likewise.
336 2024-02-10 Jakub Jelinek <jakub@redhat.com>
338 * tree.cc (debug_binfo): Use HOST_WIDE_INT_PRINT_DEC instead of "%ld"
340 * pt.cc (print_template_statistics): Use HOST_SIZE_T_PRINT_DEC
341 and casts to fmt_size_t instead of "%ld" and casts to long.
342 * class.cc (dump_class_hierarchy_1): Use HOST_WIDE_INT_PRINT_UNSIGNED
343 instead of "%lu" and casts to unsigned long. For TYPE_ALIGN, use
344 %u instead of %lu and drop casts to unsigned long.
345 * parser.cc (cp_lexer_peek_nth_token): Use HOST_SIZE_T_PRINT_DEC
346 and casts to fmt_size_t instead of "%ld" and casts to long.
348 2024-02-09 Marek Polacek <polacek@redhat.com>
351 * semantics.cc (finish_type_pack_element): Perform range checking
354 2024-02-09 Marek Polacek <polacek@redhat.com>
357 * coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error
359 (morph_fn_to_coro): Likewise.
360 * cp-tree.h (build_throw): Adjust.
361 * except.cc (expand_end_catch_block): Pass tf_warning_or_error to
363 (build_throw): Add a tsubst_flags_t parameter. Use it. Remove
364 redundant variable. Guard an inform call.
365 * parser.cc (cp_parser_throw_expression): Pass tf_warning_or_error
367 * pt.cc (tsubst_expr) <case THROW_EXPR>: Pass complain to build_throw.
369 2024-02-09 Patrick Palka <ppalka@redhat.com>
372 * module.cc (trees_in::read_class_def): When streaming in
373 an anonymous union field of an as-base class, don't overwrite
374 ANON_AGGR_TYPE_FIELD.
376 2024-02-08 Patrick Palka <ppalka@redhat.com>
379 * pt.cc (do_class_deduction): Add outer_targs parameter.
380 Substitute outer arguments into the CTAD template.
381 (do_auto_deduction): Pass outer_targs to do_class_deduction.
383 2024-02-08 Jason Merrill <jason@redhat.com>
385 * pt.cc (create_template_parm_object): Pass TARGET_EXPR to
388 2024-02-06 Jakub Jelinek <jakub@redhat.com>
391 * parser.cc (CP_PARSER_FLAGS_PARAMETER): New enumerator.
392 (cp_parser_decl_specifier_seq): Parse RID_THIS only if
393 CP_PARSER_FLAGS_PARAMETER is set in flags.
394 (cp_parser_parameter_declaration): Or in CP_PARSER_FLAGS_PARAMETER
395 when calling cp_parser_decl_specifier_seq.
397 2024-02-06 Marek Polacek <polacek@redhat.com>
399 * method.cc (early_check_defaulted_comparison): Add
400 auto_diagnostic_group.
402 2024-02-06 Jason Merrill <jason@redhat.com>
405 * method.cc (early_check_defaulted_comparison): Fail if not friend.
407 2024-02-05 Jason Merrill <jason@redhat.com>
410 * tree.cc (rvalue): Don't drop cv-quals from an array.
412 2024-02-03 Patrick Palka <ppalka@redhat.com>
416 * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
418 (tsubst_valid_expression_requirement): Likewise.
419 (tsubst_simple_requirement): Return a substituted _REQ node when
420 processing_template_decl.
421 (tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
423 (tsubst_type_requirement): Return a substituted _REQ node when
424 processing_template_decl.
425 (tsubst_compound_requirement): Likewise. Accomodate non-diagnostic
427 (tsubst_nested_requirement): Likewise.
428 (tsubst_requires_expr): Don't defer partial substitution when
429 processing_constraint_expression_p is true, in which case return
430 a substituted REQUIRES_EXPR.
431 * pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
432 non-diagnostic tsubst flags.
434 2024-02-02 Jason Merrill <jason@redhat.com>
437 * pt.cc (tsubst_function_decl): Only check a function defaulted
438 outside the class if the class is complete.
440 2024-02-02 Jason Merrill <jason@redhat.com>
443 * constexpr.cc (cxx_eval_store_expression): Check empty_base
444 before marking a CONSTRUCTOR readonly.
446 2024-02-02 Jason Merrill <jason@redhat.com>
449 * cp-tree.h: Adjust comment.
450 * pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
453 2024-02-01 Marek Polacek <polacek@redhat.com>
455 * call.cc (reference_like_class_p): Consider even non-templates for
456 std::span-like classes.
458 2024-02-01 Patrick Palka <ppalka@redhat.com>
461 * pt.cc (iterative_hash_template_arg) <case TEMPLATE_DECL>:
462 Adjust hashing to match cp_tree_equal.
463 (ctp_hasher::hash): Also hash CLASS_PLACEHOLDER_TEMPLATE.
464 * tree.cc (cp_tree_equal) <case TEMPLATE_DECL>: Return true
465 for ttp TEMPLATE_DECLs if their TEMPLATE_TEMPLATE_PARMs are
467 * typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
468 Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
470 2024-02-01 Marek Polacek <polacek@redhat.com>
473 * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
474 the move on throw of parms loop.
476 2024-01-30 Marek Polacek <polacek@redhat.com>
480 * call.cc (reference_like_class_p): Don't warn for std::span-like
483 2024-01-30 Patrick Palka <ppalka@redhat.com>
486 * call.cc (keep_unused_object_arg): Punt for an xobj member
489 2024-01-30 Patrick Palka <ppalka@redhat.com>
492 * pt.cc (unify) <case INTEGER_CST>: Handle NULL_TREE type.
494 2024-01-30 Nathaniel Shead <nathanieloshead@gmail.com>
497 * module.cc (get_module): Bail on empty name.
499 2024-01-29 Jason Merrill <jason@redhat.com>
502 * pt.cc (instantiate_class_template): Don't partially instantiate.
503 (tsubst_stmt): Likewise.
505 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
508 * module.cc (struct post_process_data): Create.
509 (trees_in::post_decls): Use.
510 (trees_in::post_process): Return entire vector at once.
511 Change overload to take post_process_data instead of tree.
512 (trees_out::write_function_def): Write needed flags from
513 DECL_STRUCT_FUNCTION.
514 (trees_in::read_function_def): Read them and pass to
516 (module_state::read_cluster): Write flags into cfun.
518 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
521 * cp-tree.h (note_variable_template_instantiation): Rename to...
522 (note_vague_linkage_variable): ...this.
523 * decl2.cc (note_variable_template_instantiation): Rename to...
524 (note_vague_linkage_variable): ...this.
525 * pt.cc (instantiate_decl): Rename usage of above function.
526 * module.cc (trees_in::read_var_def): Remember pending statics
529 2024-01-25 Jakub Jelinek <jakub@redhat.com>
532 * typeck2.cc (build_m_component_ref): Use convert instead of
533 cp_convert for pointer conversion.
535 2024-01-25 Jason Merrill <jason@redhat.com>
538 * init.cc (build_vec_init): Don't use {} for PMF.
540 2024-01-25 Jason Merrill <jason@redhat.com>
543 * coroutines.cc (build_co_await): Use cxx_maybe_build_cleanup.
544 (build_actor_fn, process_conditional, maybe_promote_temps)
545 (morph_fn_to_coro): Likewise.
546 (expand_one_await_expression): Use build_cleanup.
548 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
551 * module.cc (set_defining_module): Track partial specialisations
552 for all declarations.
554 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
557 * name-lookup.cc (add_imported_namespace): Don't mark namespaces
560 2024-01-24 Patrick Palka <ppalka@redhat.com>
563 * call.cc (add_operator_candidates): Propagate error_mark_node
564 result after recursing to find rewritten candidates.
566 2024-01-23 Marek Polacek <polacek@redhat.com>
571 * call.cc (do_warn_dangling_reference): Don't warn if the temporary
574 2024-01-23 Nathaniel Shead <nathanieloshead@gmail.com>
578 * module.cc (trees_out::lang_type_bools): Write interface_only
579 and interface_unknown.
580 (trees_in::lang_type_bools): Read the above flags.
581 (trees_in::decl_value): Reset CLASSTYPE_INTERFACE_* except for
583 (trees_in::read_class_def): Remove buggy extern template
586 2024-01-19 Jason Merrill <jason@redhat.com>
589 * pt.cc (decl_template_info): New fn.
590 (get_template_info): Use it.
592 2024-01-19 Jason Merrill <jason@redhat.com>
599 * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
600 * pt.cc (expand_integer_pack): Remove 111357 workaround.
601 (maybe_convert_nontype_argument): Add force parm.
602 (convert_template_argument): Handle alias template args
604 (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
605 * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.
607 2024-01-18 Marek Polacek <polacek@redhat.com>
610 * decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
611 NULL_TREE when emitting an error.
613 2024-01-17 Nathaniel Shead <nathanieloshead@gmail.com>
616 * module.cc (trees_in::read_function_def): Don't overwrite
619 2024-01-17 Patrick Palka <ppalka@redhat.com>
623 * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
624 DECL_ARTIFICIAL rejection test for class NTTP objects.
626 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
629 * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
630 (c_parse_final_cleanups): Suppress warning for no definition of
631 TLS wrapper functions in header modules.
632 * module.cc (trees_out::lang_decl_vals): Write wrapped variable
633 for TLS wrapper functions.
634 (trees_in::lang_decl_vals): Read it.
635 (trees_out::decl_value): Write TLS model for thread-local vars.
636 (trees_in::decl_value): Read it for new decls. Remember to emit
637 definitions of TLS wrapper functions later.
639 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
641 * name-lookup.h (enum scope_kind): Add 'sk_count'.
642 * name-lookup.cc (cp_binding_level_descriptor): Add missing
643 scope kinds. Add assertion that the list is up to date. Fix
644 handling of explicit_spec_p.
646 2024-01-16 Marek Polacek <polacek@redhat.com>
648 * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
651 2024-01-16 Marek Polacek <polacek@redhat.com>
654 * decl.cc (grokdeclarator) <case cdk_function>: Clear
655 is_xobj_member_function in case of an error.
657 2024-01-16 waffl3x <waffl3x@protonmail.com>
660 * parser.cc (cp_parser_parameter_declaration): Reject packs
663 2024-01-15 Marek Polacek <polacek@redhat.com>
666 * parser.cc (cp_parser_template_type_arg): Add auto checking.
668 2024-01-15 Patrick Palka <ppalka@redhat.com>
670 * parser.cc (cp_parser_check_access_in_redeclaration): Don't
671 check access for a partial or explicit specialization.
672 * pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
673 or TREE_PROTECTED on the newly created partial specialization.
675 2024-01-15 Patrick Palka <ppalka@redhat.com>
678 * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
679 to the newly created partial specialization.
681 2024-01-15 Patrick Palka <ppalka@redhat.com>
684 * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
685 false in a template context.
687 2024-01-13 Jakub Jelinek <jakub@redhat.com>
689 * mangle.cc (write_nested_name): Mangle explicit object
690 member functions with H as per
691 https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
693 2024-01-12 Jason Merrill <jason@redhat.com>
696 * name-lookup.cc (lookup_elaborated_type): Look for bindings
697 in the global namespace in the ABI namespace.
699 2024-01-12 Jason Merrill <jason@redhat.com>
701 * call.cc (reversed_match): New.
702 (enum class pmatch): New enum.
703 (cand_parms_match): Add match_kind parm.
704 (object_parms_correspond): Add fn parms.
706 * class.cc (xobj_iobj_parameters_correspond): Rename to...
707 (iobj_parm_corresponds_to): ...this. Take the other
708 type instead of a second function.
709 (object_parms_correspond): Adjust.
710 * cp-tree.h (iobj_parm_corresponds_to): Declare.
712 2024-01-11 Jason Merrill <jason@redhat.com>
715 * class.cc (xobj_iobj_parameters_correspond): Add context parm.
716 (object_parms_correspond): Factor out of...
717 (add_method): ...here.
718 * method.cc (defaulted_late_check): Use it.
719 * call.cc (class_of_implicit_object): New.
720 (object_parms_correspond): Overload taking two candidates.
721 (cand_parms_match): Use it.
722 (joust): Check reversed before comparing constraints.
723 * cp-tree.h (object_parms_correspond): Declare.
725 2024-01-10 Tamar Christina <tamar.christina@arm.com>
727 * parser.cc (cp_parser_pragma): Initialize to false.
729 2024-01-09 Jason Merrill <jason@redhat.com>
731 * semantics.cc (is_object_parameter): New.
732 * cp-tree.h (is_object_parameter): Declare.
733 * call.cc (maybe_warn_class_memaccess): Use it.
734 * search.cc (field_access_p): Use it.
735 (class_of_object_parm): New.
736 (field_accessor_p): Adjust for explicit object parms.
738 2024-01-09 Jason Merrill <jason@redhat.com>
740 * call.cc (build_over_call): Refactor handle_arg lambda.
741 * class.cc (xobj_iobj_parameters_correspond): Fix FIXME.
742 * method.cc (defaulted_late_check): Adjust comments.
744 2024-01-09 waffl3x <waffl3x@protonmail.com>
748 C++23 P0847R7 (deducing this) - CWG2586.
749 * decl.cc (copy_fn_p): Accept xobj copy assignment functions.
750 (move_signature_fn_p): Accept xobj move assignment functions.
751 * method.cc (do_build_copy_assign): Handle defaulted xobj member
753 (defaulted_late_check): Comment.
754 (defaultable_fn_check): Comment.
756 2024-01-09 waffl3x <waffl3x@protonmail.com>
760 C++23 P0847R7 (deducing this) - xobj lambdas.
761 * lambda.cc (build_capture_proxy): Don't fold direct object types.
762 * parser.cc (cp_parser_lambda_declarator_opt): Handle xobj lambdas,
763 diagnostics. Comments also updated.
764 * pt.cc (tsubst_function_decl): Handle xobj lambdas. Check object
765 type of xobj lambda call operator, diagnose incorrect types.
766 (tsubst_lambda_expr): Update comment.
767 * semantics.cc (finish_decltype_type): Also consider by-value object
768 parameter qualifications.
770 2024-01-09 waffl3x <waffl3x@protonmail.com>
774 C++23 P0847R7 (deducing this) - diagnostics.
775 * class.cc (resolve_address_of_overloaded_function): Diagnostics.
776 * cp-tree.h (TFF_XOBJ_FUNC): Define.
777 * decl.cc (grokfndecl): Diagnostics.
778 (grokdeclarator): Diagnostics.
779 * error.cc (dump_aggr_type): Pass TFF_XOBJ_FUNC.
780 (dump_lambda_function): Formatting for xobj lambda.
781 (dump_function_decl): Pass TFF_XOBJ_FUNC.
782 (dump_parameters): Formatting for xobj member functions.
783 (function_category): Formatting for xobj member functions.
784 * parser.cc (cp_parser_decl_specifier_seq): Diagnostics.
785 (cp_parser_parameter_declaration): Diagnostics.
786 * search.cc (look_for_overrides_here): Make xobj member functions
788 (look_for_overrides_r): Reject an overriding xobj member function
790 * semantics.cc (finish_this_expr): Diagnostics.
791 * typeck.cc (cp_build_addr_expr_1): Diagnostics.
793 2024-01-09 waffl3x <waffl3x@protonmail.com>
797 C++23 P0847R7 (deducing this) - initial functionality.
798 * class.cc (xobj_iobj_parameters_correspond): New function, checks
799 for corresponding object parameters between xobj and iobj member
801 (add_method): Handle object parameters of xobj member functions, use
802 xobj_iobj_parameters_correspond.
803 * call.cc (build_over_call): Refactor, handle xobj member functions.
804 (cand_parms_match): Handle object parameters of xobj and iobj member
805 functions, use xobj_iobj_parameters_correspond.
806 * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
807 * decl.cc (grokfndecl): Add xobj_func_p parameter. For xobj member
808 functions, Set xobj_flag, don't set static_function flag.
809 (grokdeclarator): Handle xobj member functions, tell grokfndecl.
810 (grok_op_properties): Don't error for xobj operators.
811 * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
812 (cp_parser_parameter_declaration): Set default argument to
813 "this_identifier" for xobj parameters.
814 (set_and_check_decl_spec_loc): Add "this", add comments.
815 * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
816 * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
819 2024-01-09 waffl3x <waffl3x@protonmail.com>
820 Jason Merrill <jason@redhat.com>
823 * cp-tree.h (struct lang_decl_fn): New data member.
824 (DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
825 (DECL_IOBJ_MEMBER_FUNCTION_P): Define.
826 (DECL_FUNCTION_XOBJ_FLAG): Define.
827 (DECL_XOBJ_MEMBER_FUNCTION_P): Define.
828 (DECL_OBJECT_MEMBER_FUNCTION_P): Define.
829 (DECL_FUNCTION_MEMBER_P): Don't use
830 DECL_NONSTATIC_MEMBER_FUNCTION_P.
831 (DECL_CONST_MEMFUNC_P): Likewise.
832 (DECL_VOLATILE_MEMFUNC_P): Likewise.
833 (DECL_NONSTATIC_MEMBER_P): Likewise.
834 * module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
835 (trees_in::lang_decl_bools): Handle xobj_flag.
836 * call.cc (build_this_conversion)
837 (add_function_candidate)
838 (add_template_candidate_real)
840 (maybe_warn_class_memaccess)
843 (do_warn_dangling_reference)
844 * class.cc (finalize_literal_type_property)
846 (resolve_address_of_overloaded_function)
847 * constexpr.cc (is_valid_constexpr_fn)
848 (cxx_bind_parameters_in_call)
849 * contracts.cc (build_contract_condition_function)
850 * cp-objcp-common.cc (cp_decl_dwarf_attribute)
851 * cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
852 (cxx_pretty_printer::declaration_specifiers)
853 (cxx_pretty_printer::direct_declarator)
854 * decl.cc (cp_finish_decl)
855 (grok_special_member_properties)
856 (start_preparsed_function)
857 (record_key_method_defined)
858 * decl2.cc (cp_handle_deprecated_or_unavailable)
859 * init.cc (find_uninit_fields_r)
861 * lambda.cc (lambda_expr_this_capture)
862 (maybe_generic_this_capture)
863 (nonlambda_method_basetype)
864 * mangle.cc (write_nested_name)
865 * method.cc (early_check_defaulted_comparison)
866 (skip_artificial_parms_for)
867 (num_artificial_parms_for)
868 * pt.cc (is_specialization_of_friend)
869 (determine_specialization)
870 (copy_default_args_to_explicit_spec)
871 (check_explicit_specialization)
872 (tsubst_contract_attribute)
873 (check_non_deducible_conversions)
874 (more_specialized_fn)
875 (maybe_instantiate_noexcept)
876 (register_parameter_specializations)
877 (value_dependent_expression_p)
878 * search.cc (shared_member_p)
881 * semantics.cc (finish_omp_declare_simd_methods)
882 * tree.cc (lvalue_kind)
883 * typeck.cc (invalid_nonstatic_memfn_p): Don't use
884 DECL_NONSTATIC_MEMBER_FUNCTION_P.
886 2024-01-09 Julian Brown <julian@codesourcery.com>
888 * constexpr.cc (potential_consant_expression_1): Handle
890 * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
892 * decl2.cc (grok_omp_array_section): New function.
893 * error.cc (dump_expr): Handle OMP_ARRAY_SECTION.
894 * parser.cc (cp_parser_new): Initialize parser->omp_array_section_p.
895 (cp_parser_statement_expr): Disallow array sections.
896 (cp_parser_postfix_open_square_expression): Support OMP_ARRAY_SECTION
898 (cp_parser_parenthesized_expression_list, cp_parser_lambda_expression,
899 cp_parser_braced_list): Disallow array sections.
900 (cp_parser_omp_var_list_no_open): Remove ALLOW_DEREF parameter, add
901 MAP_LVALUE in its place. Support generalised lvalue parsing for
902 OpenMP map, to and from clauses. Use OMP_ARRAY_SECTION
903 code instead of TREE_LIST to represent OpenMP array sections.
904 (cp_parser_omp_var_list): Remove ALLOW_DEREF parameter, add MAP_LVALUE.
905 Pass to cp_parser_omp_var_list_no_open.
906 (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
907 (cp_parser_omp_clause_map): Add sk_omp scope around
908 cp_parser_omp_var_list_no_open call.
909 * parser.h (cp_parser): Add omp_array_section_p field.
910 * pt.cc (tsubst, tsubst_copy, tsubst_omp_clause_decl,
911 tsubst_copy_and_build): Add OMP_ARRAY_SECTION support.
912 * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections,
913 cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION
914 instead of TREE_LIST where appropriate. Handle more types of map
916 * typeck.cc (build_omp_array_section): New function.
918 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
920 * module.cc (trees_out::write_var_def): Only write initializers
923 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
926 * module.cc (depset::hash::add_binding_entity): Don't skip names
927 in the GMF if they've been exported with a using declaration.
929 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
932 * parser.cc (cp_parser_module_name): Rewrite to handle
933 module-names and module-partitions independently.
934 (cp_parser_module_partition): New function.
935 (cp_parser_module_declaration): Parse module partitions
936 explicitly. Don't change state if parsing module decl failed.
937 (cp_parser_import_declaration): Handle different kinds of
938 import-declarations locally.
940 2024-01-03 Patrick Palka <ppalka@redhat.com>
943 * call.cc (reference_binding): Still try a conversion via a
944 temporary if a direct conversion was bad.
946 2024-01-03 Kwok Cheung Yeung <kcy@codesourcery.com>
948 * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
949 clause to correspond to alphabetical order.
952 Copyright (C) 2024 Free Software Foundation, Inc.
954 Copying and distribution of this file, with or without modification,
955 are permitted in any medium without royalty provided the copyright
956 notice and this notice are preserved.