1 2024-04-11 Patrick Palka <ppalka@redhat.com>
4 * constraint.cc (tsubst_requires_expr): Clear
5 REQUIRES_EXPR_EXTRA_ARGS before calling build_extra_args.
6 * pt.cc (tree_extra_args): Define.
7 (extract_locals_r): Assert *_EXTRA_ARGS is empty.
8 (tsubst_stmt) <case IF_STMT>: Clear IF_SCOPE on the new
9 IF_STMT. Call build_extra_args on the new IF_STMT instead
10 of t which might already have IF_STMT_EXTRA_ARGS.
12 2024-04-11 Jakub Jelinek <jakub@redhat.com>
15 * pt.cc (tsubst_expr) <case ANNOTATE_EXPR>: Move to ...
16 (tsubst_stmt) <case ANNOTATE_EXPR>: ... here. Use tsubst_expr
17 instead of RECUR for the last 2 arguments.
19 2024-04-10 Jakub Jelinek <jakub@redhat.com>
22 * semantics.cc: Implement C++26 P2809R3 - Trivial infinite
23 loops are not Undefined Behavior.
24 (maybe_warn_for_constant_evaluated): Add trivial_infinite argument
25 and emit special diagnostics for that case.
26 (finish_if_stmt_cond): Adjust caller.
27 (finish_loop_cond): New function.
28 (finish_while_stmt): Use it.
29 (finish_do_stmt): Likewise.
30 (finish_for_stmt): Likewise.
32 2024-04-10 Nathaniel Shead <nathanieloshead@gmail.com>
35 * semantics.cc (expand_or_defer_fn_1): Keep DECL_SAVED_TREE for
36 all vague linkage cdtors with modules.
38 2024-04-10 Nathaniel Shead <nathanieloshead@gmail.com>
41 * module.cc (trees_in::install_entity): Overwrite entity map
42 index if installing from a partition.
44 2024-04-09 Jakub Jelinek <jakub@redhat.com>
47 * semantics.cc (finish_if_stmt_cond): Call
48 maybe_warn_for_constant_evaluated with IF_STMT_CONSTEXPR_P (if_stmt)
49 as the second argument, rather than true/false depending on if
50 it is if constexpr with non-dependent constant expression with
53 2024-04-09 Jakub Jelinek <jakub@redhat.com>
55 * constexpr.cc (build_new_constexpr_heap_type): Fix duplicated words
56 in comment; is is -> is.
57 * cp-tree.def (CO_RETURN_EXPR): Fix duplicated words in comment;
59 * parser.cc (fixup_blocks_walker): Fix duplicated words in comment;
61 * semantics.cc (fixup_template_type): Fix duplicated words in comment;
63 (finish_omp_for): Fix duplicated words in comment; the the -> the.
64 * pt.cc (more_specialized_fn): Fix duplicated words in comment;
66 (type_targs_deducible_from): Fix duplicated words in comment; the the
69 2024-04-05 Marek Polacek <polacek@redhat.com>
72 * constexpr.cc (get_function_named_in_call): Use
73 cp_get_fndecl_from_callee.
74 * cvt.cc (cp_get_fndecl_from_callee): If there's a
75 DECL_LOCAL_DECL_ALIAS, use it.
77 2024-04-05 Jakub Jelinek <jakub@redhat.com>
80 * cp-gimplify.cc (cxx_omp_clause_apply_fn): Call build_cplus_new
81 on build_call_a result if it has class type.
83 2024-04-04 centurion <centurion009@proton.me>
86 * pt.cc (find_template_parameter_info::found): Use TREE_TYPE for
87 TEMPLATE_DECL instead of DECL_INITIAL.
89 2024-04-02 Marek Polacek <polacek@redhat.com>
92 * semantics.cc (trait_expr_value) <case CPTK_IS_ARRAY>: Return false
93 for zero-sized arrays.
95 2024-04-02 Marek Polacek <polacek@redhat.com>
98 * typeck.cc (is_bitfield_expr_with_lowered_type): Handle
101 2024-04-02 Jason Merrill <jason@redhat.com>
105 * call.cc (convert_like_internal): Avoid adding qualification
106 conversion in direct reference binding.
108 2024-04-01 Jason Merrill <jason@redhat.com>
110 * typeck.cc (maybe_warn_about_returning_address_of_local):
113 2024-03-28 Jason Merrill <jason@redhat.com>
116 * semantics.cc (same_type_ref_bind_p): New.
117 (finish_trait_expr): Use it.
119 2024-03-26 Jakub Jelinek <jakub@redhat.com>
122 * error.cc (dump_expr): Handle EXCESS_PRECISION_EXPR like NOP_EXPR.
124 2024-03-25 Marek Polacek <polacek@redhat.com>
127 * name-lookup.cc (maybe_push_to_top_level): For a non-lambda,
128 don't push to top level if decl_function_context is non-null.
129 * pt.cc (maybe_instantiate_noexcept): Use maybe_push_to_top_level.
131 2024-03-25 Marek Polacek <polacek@redhat.com>
134 * init.cc (can_init_array_with_p): Return true for a VEC_INIT_EXPR
135 wrapped in a TARGET_EXPR.
137 2024-03-22 Marek Polacek <polacek@redhat.com>
140 * init.cc (can_init_array_with_p): New.
141 (perform_member_init): Check it.
143 2024-03-21 Marek Polacek <polacek@redhat.com>
146 * decl2.cc (min_vis_expr_r) <case VAR_DECL>: Do nothing for
147 decl_constant_var_p VAR_DECLs.
149 2024-03-20 Jakub Jelinek <jakub@redhat.com>
151 * coroutines.cc (expand_one_await_expression): Use
152 integer_zero_node instead of build_int_cst (integer_type_node, 0)
153 and integer_one_node instead of build_int_cst (integer_type_node, 1).
155 2024-03-19 Nathaniel Shead <nathanieloshead@gmail.com>
157 * cp-tree.h (module_maybe_has_cmi_p): New function.
158 * decl.cc (grokfndecl): Mark block-scope functions as public if
159 they could be visible in other TUs.
160 * decl2.cc (no_linkage_error): Don't error for declarations that
161 could be defined in other TUs since C++20. Suppress duplicate
162 errors from 'check_global_declaration'.
163 * tree.cc (no_linkage_check): In relaxed mode, don't consider
164 types in a module CMI to have no linkage.
166 2024-03-16 Nathaniel Shead <nathanieloshead@gmail.com>
169 * cp-tree.h (named_module_attach_p): New function.
170 * decl.cc (start_decl): Check for attachment not purview.
171 (grokmethod): Likewise.
173 2024-03-14 Chung-Lin Tang <cltang@baylibre.com>
175 * parser.cc (cp_parser_oacc_data_clause): Add parsing support for
176 'readonly' modifier, set OMP_CLAUSE_MAP_READONLY if readonly modifier
177 found, update comments.
178 (cp_parser_oacc_cache): Add parsing support for 'readonly' modifier,
179 set OMP_CLAUSE__CACHE__READONLY if readonly modifier found, update
182 2024-03-12 Nathaniel Shead <nathanieloshead@gmail.com>
187 * module.cc (enum tree_tag): Add new tag for builtin types.
188 (trees_out::start): POLY_INT_CSTs can be emitted.
189 (trees_in::start): Likewise.
190 (trees_out::core_vals): Stream POLY_INT_CSTs.
191 (trees_in::core_vals): Likewise.
192 (trees_out::type_node): Handle vectors with multiple coeffs.
193 (trees_in::tree_node): Likewise.
194 (init_modules): Register target-specific builtin types. Bump
195 initial capacity slightly.
197 2024-03-08 Jakub Jelinek <jakub@redhat.com>
199 * pt.cc (tsubst_expr): Handle MEM_REF.
201 2024-03-08 Jakub Jelinek <jakub@redhat.com>
204 * cp-objcp-common.cc (cp_type_dwarf_attribute): Return 1
205 for DW_AT_export_symbols on anonymous structs or unions.
207 2024-03-08 Jakub Jelinek <jakub@redhat.com>
210 * parser.cc (cp_parser_parameter_declaration): Move the xobj_param_p
211 pack diagnostics after ellipsis handling and if an error is reported,
212 pretend this specifier didn't appear. Formatting fix.
214 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
217 * module.cc (trees_out::core_bools): Redetermine
218 DECL_INTERFACE_KNOWN on stream-in for vtables and tinfo.
219 * decl2.cc (import_export_decl): Add fixme for ABI changes with
220 module vtables and tinfo.
222 2024-03-07 Patrick Palka <ppalka@redhat.com>
225 * cp-tree.h (add_mergeable_specialization): Remove second
227 * module.cc (depset::disc_bits::DB_ALIAS_TMPL_INST_BIT): Remove.
228 (depset::disc_bits::DB_ALIAS_SPEC_BIT): Remove.
229 (depset::is_alias_tmpl_inst): Remove.
230 (depset::is_alias): Remove.
231 (merge_kind::MK_tmpl_alias_mask): Remove.
232 (merge_kind::MK_alias_spec): Remove.
233 (merge_kind_name): Remove entries for alias specializations.
234 (trees_out::core_vals) <case TEMPLATE_DECL>: Adjust after
235 removing is_alias_tmpl_inst.
236 (trees_in::decl_value): Adjust add_mergeable_specialization
238 (trees_out::get_merge_kind) <case depset::EK_SPECIALIZATION>:
239 Use MK_decl_spec for alias template specializations.
240 (trees_out::key_mergeable): Simplify after MK_tmpl_alias_mask
242 (depset::hash::make_dependency): Adjust after removing
243 DB_ALIAS_TMPL_INST_BIT.
244 (specialization_add): Don't allow alias templates when !decl_p.
245 (depset::hash::add_specializations): Remove now-dead code
246 accomodating alias template specializations in the type table.
247 * pt.cc (lookup_template_class): Dispatch early to
248 instantiate_alias_template for alias templates. Simplify
250 (add_mergeable_specialization): Remove alias_p parameter and
251 simplify accordingly.
253 2024-03-07 Patrick Palka <ppalka@redhat.com>
257 * module.cc (module_state::write_namespaces): Stream the
258 abi_tag attribute of an inline namespace.
259 (module_state::read_namespaces): Likewise.
261 2024-03-07 Marek Polacek <polacek@redhat.com>
264 * pt.cc (lookup_and_finish_template_variable): Pass complain to
267 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
270 * typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
271 'member' will be a FUNCTION_DECL (or something like it).
273 2024-03-07 Nathaniel Shead <nathanieloshead@gmail.com>
276 * module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT
277 for template template parameters.
278 (trees_in::tpl_parms_fini): Read it.
280 2024-03-06 Marek Polacek <polacek@redhat.com>
283 * pt.cc (maybe_instantiate_noexcept): Save/restore
284 cp_unevaluated_operand, c_inhibit_evaluation_warnings, and
285 cp_noexcept_operand around the tsubst_expr call.
287 2024-03-06 Nathaniel Shead <nathanieloshead@gmail.com>
290 * pt.cc (type_unification_real): Only use DEDUCE_CONV for the
291 return type of a conversion function.
293 2024-03-06 Patrick Palka <ppalka@redhat.com>
295 * module.cc (trees_out::get_merge_kind) <case depset::EK_DECL>:
296 Accomodate class-scope DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P
297 TEMPLATE_DECL. Consolidate IDENTIFIER_ANON_P cases.
299 2024-03-05 Patrick Palka <ppalka@redhat.com>
301 * parser.cc (cp_parser_translation_unit): Relax GMF contents
302 error into a pedwarn.
304 2024-03-04 Nathaniel Shead <nathanieloshead@gmail.com>
306 * name-lookup.cc (walk_module_binding): Remove completed FIXME.
307 (do_nonmember_using_decl): Mark redeclared entities as exported
308 when needed. Check for re-exporting internal linkage types.
310 2024-03-01 Patrick Palka <ppalka@redhat.com>
314 * module.cc (depset::hash::sneakoscope): Remove.
315 (trees_out::decl_node): Always add a dependency on a local type.
316 (depset::hash::find_dependencies): Remove sneakoscope stuff.
318 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
321 * module.cc (has_definition): Fall back to DECL_INITIALIZED_P
322 when DECL_INITIAL is not set on a template.
323 (module_state::write_inits): Only increment count when
324 initializers are actually written.
326 2024-03-01 Nathaniel Shead <nathanieloshead@gmail.com>
329 * init.cc (create_temporary_var): Use current_scope instead of
330 current_function_decl.
332 2024-03-01 Patrick Palka <ppalka@redhat.com>
334 * decl.cc (maybe_register_incomplete_var): Restrict second
335 branch to static data members from a not-yet-complete class.
337 2024-03-01 Marek Polacek <polacek@redhat.com>
341 * call.cc (no_dangling_p): New.
342 (reference_like_class_p): Use it.
343 (do_warn_dangling_reference): Use it. Don't warn when the function
344 or its enclosing class has attribute gnu::no_dangling.
345 * tree.cc (cxx_gnu_attributes): Add gnu::no_dangling.
346 (handle_no_dangling_attribute): New.
348 2024-03-01 Patrick Palka <ppalka@redhat.com>
352 * cp-tree.h (make_cast_auto): Declare.
353 * parser.cc (cp_parser_functional_cast): If the type is an auto,
354 replace it with a level-less one via make_cast_auto.
355 * pt.cc (find_parameter_packs_r): Don't treat level-less auto
356 as a type parameter pack.
357 (tsubst) <case TEMPLATE_TYPE_PARM>: Generalize CTAD placeholder
358 auto handling to all level-less autos.
359 (make_cast_auto): Define.
360 (do_auto_deduction): Handle replacement of a level-less auto.
362 2024-03-01 Jakub Jelinek <jakub@redhat.com>
365 * decl.cc (lookup_decomp_type): Return NULL_TREE if decomp_type_table
366 doesn't have entry for V.
367 * semantics.cc (finish_decltype_type): If ptds.saved, assert
368 DECL_HAS_VALUE_EXPR_P is true and decide on tuple vs. non-tuple based
369 on if lookup_decomp_type is NULL or not.
371 2024-02-29 Marek Polacek <polacek@redhat.com>
374 * call.cc (conv_binds_to_reference_parm_p): New.
375 * cp-tree.h (conv_binds_to_reference_parm_p): Declare.
376 * init.cc (find_uninit_fields_r): Call it.
378 2024-02-29 Nathaniel Shead <nathanieloshead@gmail.com>
381 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Remove tree checking.
382 (struct lang_decl_base): Update comments and fix whitespace.
383 * module.cc (trees_out::lang_decl_bools): Always write
384 module_keyed_decls_p flag...
385 (trees_in::lang_decl_bools): ...and always read it.
386 (trees_out::decl_value): Handle all kinds of keyed decls.
387 (trees_in::decl_value): Likewise.
388 (trees_in::tree_value): Deduplicate LAMBDA_EXPRs.
389 (maybe_key_decl): Also support lambdas attached to fields,
390 parameters, and types. Key lambdas attached to fields to their
392 (trees_out::get_merge_kind): Likewise.
393 (trees_out::key_mergeable): Likewise.
394 (trees_in::key_mergeable): Support keyed decls in a TYPE_DECL
396 * parser.cc (cp_parser_class_head): Start a lambda scope when
397 parsing base classes.
399 2024-02-28 Jakub Jelinek <jakub@redhat.com>
400 Patrick Palka <ppalka@redhat.com>
403 * decl.cc (grokdeclarator): Don't call cp_apply_type_quals_to_decl
404 on DECL_TEMPLATE_INSTANTIATED VAR_DECLs.
406 2024-02-28 Nathaniel Shead <nathanieloshead@gmail.com>
410 * decl.cc (make_rtl_for_nonlocal_decl): Don't defer inline
413 2024-02-23 Jakub Jelinek <jakub@redhat.com>
416 * cp-gimplify.cc (cp_fold): For targetm.cxx.cdtor_returns_this ()
417 wrap r into a COMPOUND_EXPR and return folded CALL_EXPR_ARG (x, 0).
419 2024-02-19 Patrick Palka <ppalka@redhat.com>
422 * constraint.cc (tsubst_compound_requirement): Don't check
423 the noexcept condition or the return-type-requirement when
424 partially substituting.
426 2024-02-17 Marek Polacek <polacek@redhat.com>
429 * search.cc (maybe_check_overriding_exception_spec): Defer checking
430 when a noexcept couldn't be instantiated & evaluated to false/true.
432 2024-02-16 Marek Polacek <polacek@redhat.com>
435 * search.cc (maybe_check_overriding_exception_spec): Don't error about
436 a looser exception specification if the overrider is deleted.
438 2024-02-16 Marek Polacek <polacek@redhat.com>
442 * typeck.cc (treat_lvalue_as_rvalue_p): Update code to better
443 reflect [expr.prim.id.unqual]#4.2.
445 2024-02-16 Jakub Jelinek <jakub@redhat.com>
448 * parser.cc (cp_parser_parameter_declaration): Diagnose this specifier
449 on template parameter declaration.
451 2024-02-16 Patrick Palka <ppalka@redhat.com>
453 * module.cc (trees_out::core_bools): Stream TREE_UNAVAILABLE.
454 (trees_in::core_bools): Likewise.
455 (trees_out::core_vals): Stream LAMBDA_EXPR_REGEN_INFO.
456 (trees_in::core_vals): Likewise.
458 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
461 * decl.cc (make_rtl_for_nonlocal_decl): Defer inline variables.
462 * decl2.cc (import_export_decl): Support inline variables.
464 2024-02-14 Patrick Palka <ppalka@redhat.com>
468 * method.cc (synthesized_method_walk): Use maybe_push_to_top_level.
470 2024-02-14 Nathaniel Shead <nathanieloshead@gmail.com>
473 * decl.cc (start_enum): Reorder check for redeclaring in module.
474 Add missing auto_diagnostic_groups.
476 2024-02-13 Marek Polacek <polacek@redhat.com>
480 * parser.cc (cp_parser_member_declaration): Only pedwarn about an extra
483 2024-02-13 Tobias Burnus <tburnus@baylibre.com>
486 * parser.cc (cp_parser_omp_context_selector): Handle splitting of
487 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
489 2024-02-13 Patrick Palka <ppalka@redhat.com>
491 * Make-lang.in (CFLAGS-cp/module.o): Add $(ZLIBINC).
492 * module.cc: Include <zlib.h>.
493 (bytes::calc_crc): Use crc32 from zlib.
494 (bytes_out::set_crc): Use crc32_combine from zlib.
496 2024-02-13 Patrick Palka <ppalka@redhat.com>
498 * module.cc (depset::hash::add_specializations): Use
499 STRIP_TEMPLATE consistently.
500 (get_originating_module_decl): Handle class-scope CONST_DECL.
502 2024-02-13 Patrick Palka <ppalka@redhat.com>
504 * lambda.cc (lambda_function): Call get_class_binding_direct
505 instead of lookup_member to sidestep lazy loading.
506 * name-lookup.cc (check_local_shadow): Punt if we're in a
507 function context that's not actual parsing.
509 2024-02-13 Jason Merrill <jason@redhat.com>
512 * pt.cc (process_partial_specialization): Return early
515 2024-02-13 Marek Polacek <polacek@redhat.com>
518 * except.cc (expand_start_catch_block): Pass tf_warning_or_error to
519 is_admissible_throw_operand_or_catch_parameter.
520 (build_throw): Pass complain to
521 is_admissible_throw_operand_or_catch_parameter.
522 (complete_ptr_ref_or_void_ptr_p): Add a tsubst_flags_t parameter. Use
523 it. Return bool. Call complete_type_or_maybe_complain instead of
524 complete_type_or_else.
525 (is_admissible_throw_operand_or_catch_parameter): Add a tsubst_flags_t
526 parameter. Use it. Guard error calls.
528 2024-02-13 Alex Coplan <alex.coplan@arm.com>
531 * cp-objcp-common.cc (cp_feature_table): Remove entry for
532 cxx_constexpr_string_builtins.
534 2024-02-12 Marek Polacek <polacek@redhat.com>
537 * constexpr.cc (cxx_eval_switch_expr): If the condition doesn't reduce
538 to an INTEGER_CST, consider it non-constant.
540 2024-02-10 Marek Polacek <polacek@redhat.com>
545 * parser.cc (cp_parser_unqualified_id): Downgrade the DR2237 error to
547 (cp_parser_constructor_declarator_p): Likewise.
549 2024-02-10 Jakub Jelinek <jakub@redhat.com>
551 * tree.cc (debug_binfo): Use HOST_WIDE_INT_PRINT_DEC instead of "%ld"
553 * pt.cc (print_template_statistics): Use HOST_SIZE_T_PRINT_DEC
554 and casts to fmt_size_t instead of "%ld" and casts to long.
555 * class.cc (dump_class_hierarchy_1): Use HOST_WIDE_INT_PRINT_UNSIGNED
556 instead of "%lu" and casts to unsigned long. For TYPE_ALIGN, use
557 %u instead of %lu and drop casts to unsigned long.
558 * parser.cc (cp_lexer_peek_nth_token): Use HOST_SIZE_T_PRINT_DEC
559 and casts to fmt_size_t instead of "%ld" and casts to long.
561 2024-02-09 Marek Polacek <polacek@redhat.com>
564 * semantics.cc (finish_type_pack_element): Perform range checking
567 2024-02-09 Marek Polacek <polacek@redhat.com>
570 * coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error
572 (morph_fn_to_coro): Likewise.
573 * cp-tree.h (build_throw): Adjust.
574 * except.cc (expand_end_catch_block): Pass tf_warning_or_error to
576 (build_throw): Add a tsubst_flags_t parameter. Use it. Remove
577 redundant variable. Guard an inform call.
578 * parser.cc (cp_parser_throw_expression): Pass tf_warning_or_error
580 * pt.cc (tsubst_expr) <case THROW_EXPR>: Pass complain to build_throw.
582 2024-02-09 Patrick Palka <ppalka@redhat.com>
585 * module.cc (trees_in::read_class_def): When streaming in
586 an anonymous union field of an as-base class, don't overwrite
587 ANON_AGGR_TYPE_FIELD.
589 2024-02-08 Patrick Palka <ppalka@redhat.com>
592 * pt.cc (do_class_deduction): Add outer_targs parameter.
593 Substitute outer arguments into the CTAD template.
594 (do_auto_deduction): Pass outer_targs to do_class_deduction.
596 2024-02-08 Jason Merrill <jason@redhat.com>
598 * pt.cc (create_template_parm_object): Pass TARGET_EXPR to
601 2024-02-06 Jakub Jelinek <jakub@redhat.com>
604 * parser.cc (CP_PARSER_FLAGS_PARAMETER): New enumerator.
605 (cp_parser_decl_specifier_seq): Parse RID_THIS only if
606 CP_PARSER_FLAGS_PARAMETER is set in flags.
607 (cp_parser_parameter_declaration): Or in CP_PARSER_FLAGS_PARAMETER
608 when calling cp_parser_decl_specifier_seq.
610 2024-02-06 Marek Polacek <polacek@redhat.com>
612 * method.cc (early_check_defaulted_comparison): Add
613 auto_diagnostic_group.
615 2024-02-06 Jason Merrill <jason@redhat.com>
618 * method.cc (early_check_defaulted_comparison): Fail if not friend.
620 2024-02-05 Jason Merrill <jason@redhat.com>
623 * tree.cc (rvalue): Don't drop cv-quals from an array.
625 2024-02-03 Patrick Palka <ppalka@redhat.com>
629 * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
631 (tsubst_valid_expression_requirement): Likewise.
632 (tsubst_simple_requirement): Return a substituted _REQ node when
633 processing_template_decl.
634 (tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
636 (tsubst_type_requirement): Return a substituted _REQ node when
637 processing_template_decl.
638 (tsubst_compound_requirement): Likewise. Accomodate non-diagnostic
640 (tsubst_nested_requirement): Likewise.
641 (tsubst_requires_expr): Don't defer partial substitution when
642 processing_constraint_expression_p is true, in which case return
643 a substituted REQUIRES_EXPR.
644 * pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
645 non-diagnostic tsubst flags.
647 2024-02-02 Jason Merrill <jason@redhat.com>
650 * pt.cc (tsubst_function_decl): Only check a function defaulted
651 outside the class if the class is complete.
653 2024-02-02 Jason Merrill <jason@redhat.com>
656 * constexpr.cc (cxx_eval_store_expression): Check empty_base
657 before marking a CONSTRUCTOR readonly.
659 2024-02-02 Jason Merrill <jason@redhat.com>
662 * cp-tree.h: Adjust comment.
663 * pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
666 2024-02-01 Marek Polacek <polacek@redhat.com>
668 * call.cc (reference_like_class_p): Consider even non-templates for
669 std::span-like classes.
671 2024-02-01 Patrick Palka <ppalka@redhat.com>
674 * pt.cc (iterative_hash_template_arg) <case TEMPLATE_DECL>:
675 Adjust hashing to match cp_tree_equal.
676 (ctp_hasher::hash): Also hash CLASS_PLACEHOLDER_TEMPLATE.
677 * tree.cc (cp_tree_equal) <case TEMPLATE_DECL>: Return true
678 for ttp TEMPLATE_DECLs if their TEMPLATE_TEMPLATE_PARMs are
680 * typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
681 Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
683 2024-02-01 Marek Polacek <polacek@redhat.com>
686 * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
687 the move on throw of parms loop.
689 2024-01-30 Marek Polacek <polacek@redhat.com>
693 * call.cc (reference_like_class_p): Don't warn for std::span-like
696 2024-01-30 Patrick Palka <ppalka@redhat.com>
699 * call.cc (keep_unused_object_arg): Punt for an xobj member
702 2024-01-30 Patrick Palka <ppalka@redhat.com>
705 * pt.cc (unify) <case INTEGER_CST>: Handle NULL_TREE type.
707 2024-01-30 Nathaniel Shead <nathanieloshead@gmail.com>
710 * module.cc (get_module): Bail on empty name.
712 2024-01-29 Jason Merrill <jason@redhat.com>
715 * pt.cc (instantiate_class_template): Don't partially instantiate.
716 (tsubst_stmt): Likewise.
718 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
721 * module.cc (struct post_process_data): Create.
722 (trees_in::post_decls): Use.
723 (trees_in::post_process): Return entire vector at once.
724 Change overload to take post_process_data instead of tree.
725 (trees_out::write_function_def): Write needed flags from
726 DECL_STRUCT_FUNCTION.
727 (trees_in::read_function_def): Read them and pass to
729 (module_state::read_cluster): Write flags into cfun.
731 2024-01-26 Nathaniel Shead <nathanieloshead@gmail.com>
734 * cp-tree.h (note_variable_template_instantiation): Rename to...
735 (note_vague_linkage_variable): ...this.
736 * decl2.cc (note_variable_template_instantiation): Rename to...
737 (note_vague_linkage_variable): ...this.
738 * pt.cc (instantiate_decl): Rename usage of above function.
739 * module.cc (trees_in::read_var_def): Remember pending statics
742 2024-01-25 Jakub Jelinek <jakub@redhat.com>
745 * typeck2.cc (build_m_component_ref): Use convert instead of
746 cp_convert for pointer conversion.
748 2024-01-25 Jason Merrill <jason@redhat.com>
751 * init.cc (build_vec_init): Don't use {} for PMF.
753 2024-01-25 Jason Merrill <jason@redhat.com>
756 * coroutines.cc (build_co_await): Use cxx_maybe_build_cleanup.
757 (build_actor_fn, process_conditional, maybe_promote_temps)
758 (morph_fn_to_coro): Likewise.
759 (expand_one_await_expression): Use build_cleanup.
761 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
764 * module.cc (set_defining_module): Track partial specialisations
765 for all declarations.
767 2024-01-25 Nathaniel Shead <nathanieloshead@gmail.com>
770 * name-lookup.cc (add_imported_namespace): Don't mark namespaces
773 2024-01-24 Patrick Palka <ppalka@redhat.com>
776 * call.cc (add_operator_candidates): Propagate error_mark_node
777 result after recursing to find rewritten candidates.
779 2024-01-23 Marek Polacek <polacek@redhat.com>
784 * call.cc (do_warn_dangling_reference): Don't warn if the temporary
787 2024-01-23 Nathaniel Shead <nathanieloshead@gmail.com>
791 * module.cc (trees_out::lang_type_bools): Write interface_only
792 and interface_unknown.
793 (trees_in::lang_type_bools): Read the above flags.
794 (trees_in::decl_value): Reset CLASSTYPE_INTERFACE_* except for
796 (trees_in::read_class_def): Remove buggy extern template
799 2024-01-19 Jason Merrill <jason@redhat.com>
802 * pt.cc (decl_template_info): New fn.
803 (get_template_info): Use it.
805 2024-01-19 Jason Merrill <jason@redhat.com>
812 * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
813 * pt.cc (expand_integer_pack): Remove 111357 workaround.
814 (maybe_convert_nontype_argument): Add force parm.
815 (convert_template_argument): Handle alias template args
817 (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
818 * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.
820 2024-01-18 Marek Polacek <polacek@redhat.com>
823 * decl.cc (grokdeclarator) <case cdk_function>: Set TREE_PURPOSE to
824 NULL_TREE when emitting an error.
826 2024-01-17 Nathaniel Shead <nathanieloshead@gmail.com>
829 * module.cc (trees_in::read_function_def): Don't overwrite
832 2024-01-17 Patrick Palka <ppalka@redhat.com>
836 * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
837 DECL_ARTIFICIAL rejection test for class NTTP objects.
839 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
842 * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT.
843 (c_parse_final_cleanups): Suppress warning for no definition of
844 TLS wrapper functions in header modules.
845 * module.cc (trees_out::lang_decl_vals): Write wrapped variable
846 for TLS wrapper functions.
847 (trees_in::lang_decl_vals): Read it.
848 (trees_out::decl_value): Write TLS model for thread-local vars.
849 (trees_in::decl_value): Read it for new decls. Remember to emit
850 definitions of TLS wrapper functions later.
852 2024-01-16 Nathaniel Shead <nathanieloshead@gmail.com>
854 * name-lookup.h (enum scope_kind): Add 'sk_count'.
855 * name-lookup.cc (cp_binding_level_descriptor): Add missing
856 scope kinds. Add assertion that the list is up to date. Fix
857 handling of explicit_spec_p.
859 2024-01-16 Marek Polacek <polacek@redhat.com>
861 * decl.cc (grokdeclarator) <case cdk_function>: Tweak diagnostic
864 2024-01-16 Marek Polacek <polacek@redhat.com>
867 * decl.cc (grokdeclarator) <case cdk_function>: Clear
868 is_xobj_member_function in case of an error.
870 2024-01-16 waffl3x <waffl3x@protonmail.com>
873 * parser.cc (cp_parser_parameter_declaration): Reject packs
876 2024-01-15 Marek Polacek <polacek@redhat.com>
879 * parser.cc (cp_parser_template_type_arg): Add auto checking.
881 2024-01-15 Patrick Palka <ppalka@redhat.com>
883 * parser.cc (cp_parser_check_access_in_redeclaration): Don't
884 check access for a partial or explicit specialization.
885 * pt.cc (maybe_new_partial_specialization): Don't set TREE_PRIVATE
886 or TREE_PROTECTED on the newly created partial specialization.
888 2024-01-15 Patrick Palka <ppalka@redhat.com>
891 * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
892 to the newly created partial specialization.
894 2024-01-15 Patrick Palka <ppalka@redhat.com>
897 * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
898 false in a template context.
900 2024-01-13 Jakub Jelinek <jakub@redhat.com>
902 * mangle.cc (write_nested_name): Mangle explicit object
903 member functions with H as per
904 https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
906 2024-01-12 Jason Merrill <jason@redhat.com>
909 * name-lookup.cc (lookup_elaborated_type): Look for bindings
910 in the global namespace in the ABI namespace.
912 2024-01-12 Jason Merrill <jason@redhat.com>
914 * call.cc (reversed_match): New.
915 (enum class pmatch): New enum.
916 (cand_parms_match): Add match_kind parm.
917 (object_parms_correspond): Add fn parms.
919 * class.cc (xobj_iobj_parameters_correspond): Rename to...
920 (iobj_parm_corresponds_to): ...this. Take the other
921 type instead of a second function.
922 (object_parms_correspond): Adjust.
923 * cp-tree.h (iobj_parm_corresponds_to): Declare.
925 2024-01-11 Jason Merrill <jason@redhat.com>
928 * class.cc (xobj_iobj_parameters_correspond): Add context parm.
929 (object_parms_correspond): Factor out of...
930 (add_method): ...here.
931 * method.cc (defaulted_late_check): Use it.
932 * call.cc (class_of_implicit_object): New.
933 (object_parms_correspond): Overload taking two candidates.
934 (cand_parms_match): Use it.
935 (joust): Check reversed before comparing constraints.
936 * cp-tree.h (object_parms_correspond): Declare.
938 2024-01-10 Tamar Christina <tamar.christina@arm.com>
940 * parser.cc (cp_parser_pragma): Initialize to false.
942 2024-01-09 Jason Merrill <jason@redhat.com>
944 * semantics.cc (is_object_parameter): New.
945 * cp-tree.h (is_object_parameter): Declare.
946 * call.cc (maybe_warn_class_memaccess): Use it.
947 * search.cc (field_access_p): Use it.
948 (class_of_object_parm): New.
949 (field_accessor_p): Adjust for explicit object parms.
951 2024-01-09 Jason Merrill <jason@redhat.com>
953 * call.cc (build_over_call): Refactor handle_arg lambda.
954 * class.cc (xobj_iobj_parameters_correspond): Fix FIXME.
955 * method.cc (defaulted_late_check): Adjust comments.
957 2024-01-09 waffl3x <waffl3x@protonmail.com>
961 C++23 P0847R7 (deducing this) - CWG2586.
962 * decl.cc (copy_fn_p): Accept xobj copy assignment functions.
963 (move_signature_fn_p): Accept xobj move assignment functions.
964 * method.cc (do_build_copy_assign): Handle defaulted xobj member
966 (defaulted_late_check): Comment.
967 (defaultable_fn_check): Comment.
969 2024-01-09 waffl3x <waffl3x@protonmail.com>
973 C++23 P0847R7 (deducing this) - xobj lambdas.
974 * lambda.cc (build_capture_proxy): Don't fold direct object types.
975 * parser.cc (cp_parser_lambda_declarator_opt): Handle xobj lambdas,
976 diagnostics. Comments also updated.
977 * pt.cc (tsubst_function_decl): Handle xobj lambdas. Check object
978 type of xobj lambda call operator, diagnose incorrect types.
979 (tsubst_lambda_expr): Update comment.
980 * semantics.cc (finish_decltype_type): Also consider by-value object
981 parameter qualifications.
983 2024-01-09 waffl3x <waffl3x@protonmail.com>
987 C++23 P0847R7 (deducing this) - diagnostics.
988 * class.cc (resolve_address_of_overloaded_function): Diagnostics.
989 * cp-tree.h (TFF_XOBJ_FUNC): Define.
990 * decl.cc (grokfndecl): Diagnostics.
991 (grokdeclarator): Diagnostics.
992 * error.cc (dump_aggr_type): Pass TFF_XOBJ_FUNC.
993 (dump_lambda_function): Formatting for xobj lambda.
994 (dump_function_decl): Pass TFF_XOBJ_FUNC.
995 (dump_parameters): Formatting for xobj member functions.
996 (function_category): Formatting for xobj member functions.
997 * parser.cc (cp_parser_decl_specifier_seq): Diagnostics.
998 (cp_parser_parameter_declaration): Diagnostics.
999 * search.cc (look_for_overrides_here): Make xobj member functions
1001 (look_for_overrides_r): Reject an overriding xobj member function
1003 * semantics.cc (finish_this_expr): Diagnostics.
1004 * typeck.cc (cp_build_addr_expr_1): Diagnostics.
1006 2024-01-09 waffl3x <waffl3x@protonmail.com>
1010 C++23 P0847R7 (deducing this) - initial functionality.
1011 * class.cc (xobj_iobj_parameters_correspond): New function, checks
1012 for corresponding object parameters between xobj and iobj member
1014 (add_method): Handle object parameters of xobj member functions, use
1015 xobj_iobj_parameters_correspond.
1016 * call.cc (build_over_call): Refactor, handle xobj member functions.
1017 (cand_parms_match): Handle object parameters of xobj and iobj member
1018 functions, use xobj_iobj_parameters_correspond.
1019 * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
1020 * decl.cc (grokfndecl): Add xobj_func_p parameter. For xobj member
1021 functions, Set xobj_flag, don't set static_function flag.
1022 (grokdeclarator): Handle xobj member functions, tell grokfndecl.
1023 (grok_op_properties): Don't error for xobj operators.
1024 * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
1025 (cp_parser_parameter_declaration): Set default argument to
1026 "this_identifier" for xobj parameters.
1027 (set_and_check_decl_spec_loc): Add "this", add comments.
1028 * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
1029 * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
1032 2024-01-09 waffl3x <waffl3x@protonmail.com>
1033 Jason Merrill <jason@redhat.com>
1036 * cp-tree.h (struct lang_decl_fn): New data member.
1037 (DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
1038 (DECL_IOBJ_MEMBER_FUNCTION_P): Define.
1039 (DECL_FUNCTION_XOBJ_FLAG): Define.
1040 (DECL_XOBJ_MEMBER_FUNCTION_P): Define.
1041 (DECL_OBJECT_MEMBER_FUNCTION_P): Define.
1042 (DECL_FUNCTION_MEMBER_P): Don't use
1043 DECL_NONSTATIC_MEMBER_FUNCTION_P.
1044 (DECL_CONST_MEMFUNC_P): Likewise.
1045 (DECL_VOLATILE_MEMFUNC_P): Likewise.
1046 (DECL_NONSTATIC_MEMBER_P): Likewise.
1047 * module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
1048 (trees_in::lang_decl_bools): Handle xobj_flag.
1049 * call.cc (build_this_conversion)
1050 (add_function_candidate)
1051 (add_template_candidate_real)
1053 (maybe_warn_class_memaccess)
1056 (do_warn_dangling_reference)
1057 * class.cc (finalize_literal_type_property)
1059 (resolve_address_of_overloaded_function)
1060 * constexpr.cc (is_valid_constexpr_fn)
1061 (cxx_bind_parameters_in_call)
1062 * contracts.cc (build_contract_condition_function)
1063 * cp-objcp-common.cc (cp_decl_dwarf_attribute)
1064 * cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
1065 (cxx_pretty_printer::declaration_specifiers)
1066 (cxx_pretty_printer::direct_declarator)
1067 * decl.cc (cp_finish_decl)
1068 (grok_special_member_properties)
1069 (start_preparsed_function)
1070 (record_key_method_defined)
1071 * decl2.cc (cp_handle_deprecated_or_unavailable)
1072 * init.cc (find_uninit_fields_r)
1074 * lambda.cc (lambda_expr_this_capture)
1075 (maybe_generic_this_capture)
1076 (nonlambda_method_basetype)
1077 * mangle.cc (write_nested_name)
1078 * method.cc (early_check_defaulted_comparison)
1079 (skip_artificial_parms_for)
1080 (num_artificial_parms_for)
1081 * pt.cc (is_specialization_of_friend)
1082 (determine_specialization)
1083 (copy_default_args_to_explicit_spec)
1084 (check_explicit_specialization)
1085 (tsubst_contract_attribute)
1086 (check_non_deducible_conversions)
1087 (more_specialized_fn)
1088 (maybe_instantiate_noexcept)
1089 (register_parameter_specializations)
1090 (value_dependent_expression_p)
1091 * search.cc (shared_member_p)
1094 * semantics.cc (finish_omp_declare_simd_methods)
1095 * tree.cc (lvalue_kind)
1096 * typeck.cc (invalid_nonstatic_memfn_p): Don't use
1097 DECL_NONSTATIC_MEMBER_FUNCTION_P.
1099 2024-01-09 Julian Brown <julian@codesourcery.com>
1101 * constexpr.cc (potential_consant_expression_1): Handle
1103 * cp-tree.h (grok_omp_array_section, build_omp_array_section): Add
1105 * decl2.cc (grok_omp_array_section): New function.
1106 * error.cc (dump_expr): Handle OMP_ARRAY_SECTION.
1107 * parser.cc (cp_parser_new): Initialize parser->omp_array_section_p.
1108 (cp_parser_statement_expr): Disallow array sections.
1109 (cp_parser_postfix_open_square_expression): Support OMP_ARRAY_SECTION
1111 (cp_parser_parenthesized_expression_list, cp_parser_lambda_expression,
1112 cp_parser_braced_list): Disallow array sections.
1113 (cp_parser_omp_var_list_no_open): Remove ALLOW_DEREF parameter, add
1114 MAP_LVALUE in its place. Support generalised lvalue parsing for
1115 OpenMP map, to and from clauses. Use OMP_ARRAY_SECTION
1116 code instead of TREE_LIST to represent OpenMP array sections.
1117 (cp_parser_omp_var_list): Remove ALLOW_DEREF parameter, add MAP_LVALUE.
1118 Pass to cp_parser_omp_var_list_no_open.
1119 (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list.
1120 (cp_parser_omp_clause_map): Add sk_omp scope around
1121 cp_parser_omp_var_list_no_open call.
1122 * parser.h (cp_parser): Add omp_array_section_p field.
1123 * pt.cc (tsubst, tsubst_copy, tsubst_omp_clause_decl,
1124 tsubst_copy_and_build): Add OMP_ARRAY_SECTION support.
1125 * semantics.cc (handle_omp_array_sections_1, handle_omp_array_sections,
1126 cp_oacc_check_attachments, finish_omp_clauses): Use OMP_ARRAY_SECTION
1127 instead of TREE_LIST where appropriate. Handle more types of map
1129 * typeck.cc (build_omp_array_section): New function.
1131 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
1133 * module.cc (trees_out::write_var_def): Only write initializers
1136 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
1139 * module.cc (depset::hash::add_binding_entity): Don't skip names
1140 in the GMF if they've been exported with a using declaration.
1142 2024-01-07 Nathaniel Shead <nathanieloshead@gmail.com>
1145 * parser.cc (cp_parser_module_name): Rewrite to handle
1146 module-names and module-partitions independently.
1147 (cp_parser_module_partition): New function.
1148 (cp_parser_module_declaration): Parse module partitions
1149 explicitly. Don't change state if parsing module decl failed.
1150 (cp_parser_import_declaration): Handle different kinds of
1151 import-declarations locally.
1153 2024-01-03 Patrick Palka <ppalka@redhat.com>
1156 * call.cc (reference_binding): Still try a conversion via a
1157 temporary if a direct conversion was bad.
1159 2024-01-03 Kwok Cheung Yeung <kcy@codesourcery.com>
1161 * parser.cc (cp_parser_omp_clause_name): Move handling of indirect
1162 clause to correspond to alphabetical order.
1165 Copyright (C) 2024 Free Software Foundation, Inc.
1167 Copying and distribution of this file, with or without modification,
1168 are permitted in any medium without royalty provided the copyright
1169 notice and this notice are preserved.