1 2024-05-21 Release Manager
5 2024-05-14 Patrick Palka <ppalka@redhat.com>
7 Backported from master:
8 2024-04-11 Patrick Palka <ppalka@redhat.com>
11 * constraint.cc (tsubst_requires_expr): Clear
12 REQUIRES_EXPR_EXTRA_ARGS before calling build_extra_args.
13 * pt.cc (tree_extra_args): Define.
14 (extract_locals_r): Assert *_EXTRA_ARGS is empty.
15 (tsubst_stmt) <case IF_STMT>: Clear IF_SCOPE on the new
16 IF_STMT. Call build_extra_args on the new IF_STMT instead
17 of t which might already have IF_STMT_EXTRA_ARGS.
19 2024-05-13 Patrick Palka <ppalka@redhat.com>
21 Backported from master:
22 2024-04-24 Patrick Palka <ppalka@redhat.com>
25 * constexpr.cc (cxx_fold_indirect_ref): Restrict object/offset
26 canonicalization to RECORD_TYPE member accesses.
28 2024-05-09 Jakub Jelinek <jakub@redhat.com>
30 Backported from master:
31 2024-04-25 Jakub Jelinek <jakub@redhat.com>
34 * constexpr.cc (cxx_bind_parameters_in_call): For PARM_DECLs with
35 TREE_ADDRESSABLE types use vc_glvalue rather than vc_prvalue for
36 cxx_eval_constant_expression and if it doesn't have the same
37 type as it should, cast the reference type to reference to type
38 before convert_from_reference and instead of adjust_temp_type
39 take address of the arg, cast to reference to type and then
40 convert_from_reference.
41 (cxx_eval_constant_expression) <case PARM_DECL>: For lval case
42 on parameters with TREE_ADDRESSABLE types lookup result in
43 ctx->globals if possible. Otherwise if lookup in ctx->globals
44 was successful for parameter with TREE_ADDRESSABLE type,
45 recurse with vc_prvalue on the returned value.
47 2024-05-07 Andrew Pinski <quic_apinski@quicinc.com>
49 Backported from master:
50 2024-05-07 Andrew Pinski <quic_apinski@quicinc.com>
53 * constexpr.cc (cxx_eval_array_reference): Compare main variants
54 for the vector/array types instead of the types directly.
56 2024-05-01 Patrick Palka <ppalka@redhat.com>
59 * call.cc (reference_binding): Remove badness criteria sanity
60 check in the recursive case.
62 2024-05-01 centurion <centurion009@proton.me>
64 Backported from master:
65 2024-04-04 centurion <centurion009@proton.me>
68 * pt.cc (find_template_parameter_info::found): Use TREE_TYPE for
69 TEMPLATE_DECL instead of DECL_INITIAL.
71 2024-05-01 Jason Merrill <jason@redhat.com>
73 Backported from master:
74 2024-04-02 Jason Merrill <jason@redhat.com>
78 * call.cc (convert_like_internal): Avoid adding qualification
79 conversion in direct reference binding.
81 2024-05-01 Jason Merrill <jason@redhat.com>
83 Backported from master:
84 2024-03-28 Jason Merrill <jason@redhat.com>
87 * semantics.cc (same_type_ref_bind_p): New.
88 (finish_trait_expr): Use it.
90 2024-04-21 Jakub Jelinek <jakub@redhat.com>
92 Backported from master:
93 2024-04-12 Jakub Jelinek <jakub@redhat.com>
96 * semantics.cc (simplify_loop_decl_cond): Use cp_build_unary_op with
97 TRUTH_NOT_EXPR on ANNOTATE_EXPR argument (if any) rather than
100 2024-04-21 Jakub Jelinek <jakub@redhat.com>
102 Backported from master:
103 2024-04-09 Jakub Jelinek <jakub@redhat.com>
106 * semantics.cc (finish_if_stmt_cond): Call
107 maybe_warn_for_constant_evaluated with IF_STMT_CONSTEXPR_P (if_stmt)
108 as the second argument, rather than true/false depending on if
109 it is if constexpr with non-dependent constant expression with
112 2024-04-21 Jakub Jelinek <jakub@redhat.com>
114 Backported from master:
115 2024-04-05 Jakub Jelinek <jakub@redhat.com>
118 * cp-gimplify.cc (cxx_omp_clause_apply_fn): Call build_cplus_new
119 on build_call_a result if it has class type.
121 2024-04-15 Patrick Palka <ppalka@redhat.com>
123 Backported from master:
124 2024-02-19 Patrick Palka <ppalka@redhat.com>
127 * constraint.cc (tsubst_compound_requirement): Don't check
128 the noexcept condition or the return-type-requirement when
129 partially substituting.
131 2024-04-15 Patrick Palka <ppalka@redhat.com>
133 Backported from master:
134 2024-02-03 Patrick Palka <ppalka@redhat.com>
138 * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
140 (tsubst_valid_expression_requirement): Likewise.
141 (tsubst_simple_requirement): Return a substituted _REQ node when
142 processing_template_decl.
143 (tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
145 (tsubst_type_requirement): Return a substituted _REQ node when
146 processing_template_decl.
147 (tsubst_compound_requirement): Likewise. Accomodate non-diagnostic
149 (tsubst_nested_requirement): Likewise.
150 (tsubst_requires_expr): Don't defer partial substitution when
151 processing_constraint_expression_p is true, in which case return
152 a substituted REQUIRES_EXPR.
153 * pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
154 non-diagnostic tsubst flags.
156 2024-04-02 Marek Polacek <polacek@redhat.com>
158 Backported from master:
159 2024-04-02 Marek Polacek <polacek@redhat.com>
162 * typeck.cc (is_bitfield_expr_with_lowered_type): Handle
165 2024-02-16 Marek Polacek <polacek@redhat.com>
167 Backported from master:
168 2024-02-12 Marek Polacek <polacek@redhat.com>
171 * constexpr.cc (cxx_eval_switch_expr): If the condition doesn't reduce
172 to an INTEGER_CST, consider it non-constant.
174 2024-02-13 Jason Merrill <jason@redhat.com>
176 Backported from master:
177 2024-02-13 Jason Merrill <jason@redhat.com>
180 * pt.cc (process_partial_specialization): Return early
183 2024-02-09 Alexandre Oliva <oliva@adacore.com>
185 Backported from master:
186 2023-11-29 Alexandre Oliva <oliva@adacore.com>
188 * decl.cc (maybe_prepare_return_this): Split out of...
189 (maybe_return_this): ... this.
190 * cp-tree.h (maybe_prepare_return_this): Declare.
191 * class.cc (build_clone): Call it.
193 2024-02-09 Alexandre Oliva <oliva@adacore.com>
195 Backported from master:
196 2023-11-29 Alexandre Oliva <oliva@adacore.com>
198 * contracts.cc (check_postcondition_result): Cope with
201 2024-02-06 Jason Merrill <jason@redhat.com>
203 Backported from master:
204 2024-02-06 Jason Merrill <jason@redhat.com>
207 * method.cc (early_check_defaulted_comparison): Fail if not friend.
209 2024-02-05 Jason Merrill <jason@redhat.com>
211 Backported from master:
212 2024-02-05 Jason Merrill <jason@redhat.com>
215 * tree.cc (rvalue): Don't drop cv-quals from an array.
217 2024-02-02 Jason Merrill <jason@redhat.com>
219 Backported from master:
220 2024-02-02 Jason Merrill <jason@redhat.com>
223 * pt.cc (tsubst_function_decl): Only check a function defaulted
224 outside the class if the class is complete.
226 2024-02-02 Jason Merrill <jason@redhat.com>
228 Backported from master:
229 2024-02-02 Jason Merrill <jason@redhat.com>
232 * cp-tree.h: Adjust comment.
233 * pt.cc (instantiate_template): Set VAR_HAD_UNKNOWN_BOUND for
236 2024-02-02 Jason Merrill <jason@redhat.com>
238 Backported from master:
239 2024-02-02 Jason Merrill <jason@redhat.com>
242 * constexpr.cc (cxx_eval_store_expression): Check empty_base
243 before marking a CONSTRUCTOR readonly.
245 2024-02-01 Marek Polacek <polacek@redhat.com>
247 Backported from master:
248 2024-02-01 Marek Polacek <polacek@redhat.com>
251 * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
252 the move on throw of parms loop.
254 2024-01-26 Patrick Palka <ppalka@redhat.com>
256 Backported from master:
257 2024-01-24 Patrick Palka <ppalka@redhat.com>
260 * call.cc (add_operator_candidates): Propagate error_mark_node
261 result after recursing to find rewritten candidates.
263 2024-01-24 Jason Merrill <jason@redhat.com>
266 * semantics.cc (finalize_nrv_r): Handle null
267 current_retval_sentinel.
269 2024-01-24 Jason Merrill <jason@redhat.com>
271 Backported from master:
272 2023-12-20 Jason Merrill <jason@redhat.com>
275 * typeck.cc (cp_build_array_ref): Handle swapped operands.
277 2024-01-24 Jason Merrill <jason@redhat.com>
279 Backported from master:
280 2023-12-20 Jason Merrill <jason@redhat.com>
284 * except.cc (maybe_splice_retval_cleanup): Handle an empty block.
286 2024-01-18 Patrick Palka <ppalka@redhat.com>
288 Backported from master:
289 2024-01-17 Patrick Palka <ppalka@redhat.com>
293 * pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
294 DECL_ARTIFICIAL rejection test for class NTTP objects.
296 2024-01-15 Patrick Palka <ppalka@redhat.com>
298 Backported from master:
299 2024-01-15 Patrick Palka <ppalka@redhat.com>
302 * pt.cc (maybe_new_partial_specialization): Propagate TREE_PUBLIC
303 to the newly created partial specialization.
305 2024-01-15 Patrick Palka <ppalka@redhat.com>
307 Backported from master:
308 2024-01-15 Patrick Palka <ppalka@redhat.com>
311 * init.cc (build_vec_delete_1): Assume expr_noexcept_p returns
312 false in a template context.
314 2023-12-20 Patrick Palka <ppalka@redhat.com>
316 Backported from master:
317 2023-04-25 Patrick Palka <ppalka@redhat.com>
320 * pt.cc (value_dependent_expression_p) <case VAR_DECL>:
321 Suppress conservative early exit for reference variables
322 when DECL_HAS_VALUE_EXPR_P.
324 2023-12-15 Jakub Jelinek <jakub@redhat.com>
326 Backported from master:
327 2023-12-08 Jakub Jelinek <jakub@redhat.com>
330 * cp-gimplify.cc (cp_fold): If SAVE_EXPR has been previously
331 folded, unshare_expr what is returned.
333 2023-12-12 Marek Polacek <polacek@redhat.com>
335 Backported from master:
336 2023-07-21 Marek Polacek <polacek@redhat.com>
339 * constexpr.cc (potential_constant_expression_1): Try to complete the
340 type when !processing_template_decl.
342 2023-12-12 Marek Polacek <polacek@redhat.com>
344 Backported from master:
345 2023-11-16 Marek Polacek <polacek@redhat.com>
348 * parser.cc (cp_parser_direct_declarator): Maybe call
349 abort_fully_implicit_template if it turned out the parameter list was
352 2023-12-12 Marek Polacek <polacek@redhat.com>
354 Backported from master:
355 2023-07-14 Marek Polacek <polacek@redhat.com>
356 Jason Merrill <jason@redhat.com>
359 * decl.cc (cp_finish_decl): Set TREE_CONSTANT when initializing
360 an object of empty class type.
361 * pt.cc (value_dependent_expression_p) <case VAR_DECL>: Treat a
362 constexpr-declared non-constant variable as value-dependent.
364 2023-12-05 Jakub Jelinek <jakub@redhat.com>
366 Backported from master:
367 2023-12-04 Jakub Jelinek <jakub@redhat.com>
370 * parser.cc (cp_parser_pragma_unroll): Use fold_non_dependent_expr
371 instead of maybe_constant_value.
373 2023-11-24 Patrick Palka <ppalka@redhat.com>
375 Backported from master:
376 2023-11-16 Patrick Palka <ppalka@redhat.com>
380 * constexpr.cc (potential_constant_expression_1) <case CALL_EXPR>:
381 Fix FUNCTION_POINTER_TYPE_P test.
383 2023-11-24 Patrick Palka <ppalka@redhat.com>
385 Backported from master:
386 2023-11-15 Patrick Palka <ppalka@redhat.com>
390 * constexpr.cc (potential_constant_expression_1) <case VAR_DECL>:
391 Only consider var_in_maybe_constexpr_fn if 'now' is false.
392 <case INDIRECT_REF>: Likewise.
394 2023-11-23 Patrick Palka <ppalka@redhat.com>
396 Backported from master:
397 2023-11-22 Patrick Palka <ppalka@redhat.com>
400 * pt.cc (tsubst_aggr_type): Handle empty TYPE_TEMPLATE_INFO
401 in the entering_scope adjustment.
403 2023-11-17 Jason Merrill <jason@redhat.com>
408 * except.cc (maybe_splice_retval_cleanup): Clear
409 current_retval_sentinel when destroying retval.
410 * semantics.cc (nrv_data): Add in_nrv_cleanup.
411 (finalize_nrv): Set it.
412 (finalize_nrv_r): Fix handling of throwing cleanups.
414 2023-11-17 Jason Merrill <jason@redhat.com>
416 * semantics.cc (finalize_nrv_r): [RETURN_EXPR]: Only replace the
419 2023-11-17 Jason Merrill <jason@redhat.com>
422 * except.cc (maybe_splice_retval_cleanup): Change
423 recognition of function body and try scopes.
424 * semantics.cc (do_poplevel): Call it after poplevel.
426 * cp-tree.h (maybe_splice_retval_cleanup): Adjust.
428 2023-09-24 Patrick Palka <ppalka@redhat.com>
430 Backported from master:
431 2023-09-22 Patrick Palka <ppalka@redhat.com>
434 * decl2.cc (grok_array_decl): Guard diagnostic and backward
435 compatibility fallback code paths with tf_error.
437 2023-09-24 Patrick Palka <ppalka@redhat.com>
439 Backported from master:
440 2023-09-22 Patrick Palka <ppalka@redhat.com>
443 * pt.cc (is_compatible_template_arg): New parameter 'args'.
444 Add the outer template arguments 'args' to 'new_args'.
445 (convert_template_argument): Pass 'args' to
446 is_compatible_template_arg.
448 2023-09-24 Patrick Palka <ppalka@redhat.com>
450 Backported from master:
451 2023-09-19 Patrick Palka <ppalka@redhat.com>
454 * semantics.cc (finish_decltype_type): For an NTTP object,
455 return its type modulo cv-quals.
457 2023-09-22 Patrick Palka <ppalka@redhat.com>
459 Backported from master:
460 2023-09-20 Patrick Palka <ppalka@redhat.com>
463 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
464 <case VAR_DECL>: Handle class NTTP objects by printing
465 their type and value.
466 <case VIEW_CONVERT_EXPR>: Strip const VIEW_CONVERT_EXPR
467 wrappers for class NTTPs.
468 (pp_cxx_template_argument_list): Don't handle class NTTP
471 2023-08-31 Jason Merrill <jason@redhat.com>
474 * pt.cc (tsubst_friend_function): Don't check constraints.
476 2023-08-31 Jason Merrill <jason@redhat.com>
479 * cp-tree.h (struct language_function): Add backward_goto.
480 * decl.cc (check_goto): Set it.
481 * typeck.cc (check_return_expr): Prevent NRV if set.
483 2023-08-16 Patrick Palka <ppalka@redhat.com>
485 Backported from master:
486 2023-08-11 Patrick Palka <ppalka@redhat.com>
489 * parser.cc (cp_parser_type_requirement): Pass
490 check_dependency_p=true instead of =false.
492 2023-08-11 Jason Merrill <jason@redhat.com>
495 * constexpr.cc (cxx_fold_indirect_ref_1): Handle empty base first.
497 2023-08-11 Jason Merrill <jason@redhat.com>
500 * parser.cc (cp_parser_template_name): Skip non-member
501 lookup after the template keyword.
502 (cp_parser_lookup_name): Pass down template_keyword_p.
504 2023-08-07 Patrick Palka <ppalka@redhat.com>
506 Backported from master:
507 2023-07-27 Patrick Palka <ppalka@redhat.com>
510 * constexpr.cc (cxx_eval_array_reference): Allow synthesizing an
511 empty subobject even if CONSTRUCTOR_NO_CLEARING is set.
512 (cxx_eval_bare_aggregate): Set 'no_slot' to true more generally
513 whenever new_ctx.ctor is set to NULL_TREE by init_subob_ctx,
514 i.e. whenever initializing an subobject of empty type.
515 (cxx_eval_vec_init_1): Define 'no_slot' as above and use it
518 2023-08-07 Patrick Palka <ppalka@redhat.com>
520 Backported from master:
521 2023-07-26 Patrick Palka <ppalka@redhat.com>
525 * pt.cc (coerce_template_template_parms): Simplify by using
526 DECL_INNERMOST_TEMPLATE_PARMS and removing redundant asserts.
527 Always pass the parameters of the most general template to
528 coerce_template_parms.
530 2023-07-27 Patrick Palka <ppalka@redhat.com>
532 Backported from master:
533 2023-07-26 Patrick Palka <ppalka@redhat.com>
536 * pt.cc (unify) <case INTEGER_CST>: Generalize to handle
539 2023-07-27 Release Manager
541 * GCC 13.2.0 released.
543 2023-07-19 Patrick Palka <ppalka@redhat.com>
545 Backported from master:
546 2023-07-18 Patrick Palka <ppalka@redhat.com>
549 * call.cc (add_conv_candidate): Check constraints.
551 2023-07-19 Patrick Palka <ppalka@redhat.com>
553 Backported from master:
554 2023-06-11 Patrick Palka <ppalka@redhat.com>
557 * pt.cc (lookup_template_class): Extend shortcut for looking up the
558 current class scope to consider outer class scopes too, and use
559 current_nonlambda_class_type instead of current_class_type. Only
560 call coerce_template_parms when specializing a primary template.
562 2023-07-17 Patrick Palka <ppalka@redhat.com>
564 Backported from master:
565 2023-07-15 Patrick Palka <ppalka@redhat.com>
568 * mangle.cc (write_expression): Handle TEMPLATE_ID_EXPR
569 whose template is already an IDENTIFIER_NODE.
571 2023-07-01 Patrick Palka <ppalka@redhat.com>
573 Backported from master:
574 2023-06-29 Patrick Palka <ppalka@redhat.com>
577 * init.cc (maybe_instantiate_nsdmi_init): Mask out all
578 tsubst flags except for tf_warning_or_error.
580 2023-07-01 Patrick Palka <ppalka@redhat.com>
582 Backported from master:
583 2023-06-29 Patrick Palka <ppalka@redhat.com>
586 * cp-gimplify.cc (cp_fold) <case CONSTRUCTOR>: Propagate
587 CONSTRUCTOR_MUTABLE_POISON.
589 2023-06-23 Jason Merrill <jason@redhat.com>
591 * call.cc (maybe_init_list_as_array): Build a list.
593 2023-06-23 Jason Merrill <jason@redhat.com>
596 * call.cc (maybe_init_list_as_array): Check that the element type is
599 2023-06-23 Jason Merrill <jason@redhat.com>
603 * call.cc (sfk_copy_or_move): New.
604 (joust): Add tiebreaker for explicit conv and copy ctor.
606 2023-05-19 Patrick Palka <ppalka@redhat.com>
608 Backported from master:
609 2023-05-16 Patrick Palka <ppalka@redhat.com>
612 * call.cc (add_list_candidates): Check for invalid designated
613 initialization sooner and even for types that have a list
616 2023-05-17 Jakub Jelinek <jakub@redhat.com>
618 Backported from master:
619 2023-05-17 Jakub Jelinek <jakub@redhat.com>
622 * init.cc (build_zero_init_1): Don't initialize zero-width bitfields.
623 For unions only initialize the first FIELD_DECL.
625 2023-05-16 Marek Polacek <polacek@redhat.com>
627 Backported from master:
628 2023-05-16 Marek Polacek <polacek@redhat.com>
631 * typeck.cc (check_return_expr): In a template, return only after
632 suppressing -Wdangling-reference.
634 2023-05-12 Patrick Palka <ppalka@redhat.com>
636 Backported from master:
637 2023-05-11 Patrick Palka <ppalka@redhat.com>
640 * typeck2.cc (poison_mutable_constructors): Define.
641 (store_init_value): Use it instead of setting
642 CONSTRUCTOR_MUTABLE_POISON directly.
644 2023-05-12 Patrick Palka <ppalka@redhat.com>
646 Backported from master:
647 2023-05-11 Patrick Palka <ppalka@redhat.com>
648 Jonathan Wakely <jwakely@redhat.com>
653 * pt.cc (convert_nontype_argument_function): Remove linkage
654 requirement for C++17 and later.
655 (invalid_tparm_referent_p) <case ADDR_EXPR>: Restrict
656 DECL_ARTIFICIAL rejection test to VAR_DECL.
658 2023-05-12 Patrick Palka <ppalka@redhat.com>
660 Backported from master:
661 2023-05-09 Patrick Palka <ppalka@redhat.com>
664 * parser.cc (cp_parser_class_specifier): Don't pass a class
665 context to noexcept_override_late_checks.
666 (noexcept_override_late_checks): Remove 'type' parameter
667 and use DECL_CONTEXT of 'fndecl' instead.
669 2023-05-12 Patrick Palka <ppalka@redhat.com>
671 Backported from master:
672 2023-05-07 Patrick Palka <ppalka@redhat.com>
675 * pt.cc (coerce_template_args_for_ttp): Mention we can hit the
676 current_template_parms fallback when level-lowering a bound ttp.
677 (tsubst_template_decl): Add lambda_tparms parameter. Prefer to
678 use lambda_tparms instead of substituting DECL_TEMPLATE_PARMS.
679 (tsubst_decl) <case TEMPLATE_DECL>: Pass NULL_TREE as lambda_tparms
680 to tsubst_template_decl.
681 (tsubst_lambda_expr): For a generic lambda, substitute
682 DECL_TEMPLATE_PARMS and set current_template_parms to it
683 before substituting the function type. Pass the substituted
684 DECL_TEMPLATE_PARMS as lambda_tparms to tsubst_template_decl.
686 2023-05-09 Jakub Jelinek <jakub@redhat.com>
688 Backported from master:
689 2023-05-09 Jakub Jelinek <jakub@redhat.com>
692 * cp-gimplify.cc (process_stmt_assume_attribute): Diagnose pack
693 expansion of assume attribute.
695 2023-05-03 Jason Merrill <jason@redhat.com>
698 2022-04-29 Jason Merrill <jason@redhat.com>
702 * friend.cc (do_friend): Call check_explicit_specialization here.
703 * decl.cc (grokdeclarator): Not here.
704 * decl2.cc (check_classfn): Or here.
706 2023-05-03 Jakub Jelinek <jakub@redhat.com>
708 Backported from master:
709 2023-05-03 Jakub Jelinek <jakub@redhat.com>
711 * cp-gimplify.cc (cp_fold_data): Move definition earlier.
712 (cp_gimplify_expr): Pass address of ff_genericize | ff_mce_false
713 constructed data rather than &pset to cp_walk_tree with cp_fold_r.
715 2023-05-02 Jason Merrill <jason@redhat.com>
718 2022-05-24 Jason Merrill <jason@redhat.com>
720 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
721 (cxx_eval_call_expression): Call it.
722 (cxx_fold_indirect_ref_1): Handle null empty_base.
724 2023-05-02 Jason Merrill <jason@redhat.com>
727 * name-lookup.cc (maybe_push_to_top_level)
728 (maybe_pop_from_top_level): Split out...
729 * pt.cc (instantiate_body): ...from here.
730 * init.cc (maybe_instantiate_nsdmi_init): Use them.
731 * name-lookup.h: Declare them..
733 2023-05-02 Jason Merrill <jason@redhat.com>
736 * decl.cc (grokdeclarator): Don't clear typedef_decl after 'unsigned
737 typedef' pedwarn. Use c_common_signed_or_unsigned_type. Also
738 handle 'signed typedef'.
740 2023-04-26 Release Manager
742 * GCC 13.1.0 released.
744 2023-04-19 Patrick Palka <ppalka@redhat.com>
746 Backported from master:
747 2023-04-19 Patrick Palka <ppalka@redhat.com>
750 * pt.cc (try_class_unification): Don't ggc_free the copy of
753 2023-04-17 Patrick Palka <ppalka@redhat.com>
755 Backported from master:
756 2023-04-17 Patrick Palka <ppalka@redhat.com>
759 * pt.cc (tsubst) <case BOUND_TEMPLATE_TEMPLATE_PARM>:
760 In the level-lowering case just use lookup_template_class
761 to rebuild the bound ttp.
763 2023-04-15 Jason Merrill <jason@redhat.com>
766 * constexpr.cc (cxx_eval_constant_expression) [TARGET_EXPR]:
767 Check for complex initializer.
769 2023-04-13 Patrick Palka <ppalka@redhat.com>
772 * decl.cc (make_typename_type): Also ignore non-types during the
773 lookup if tag_type corresponds to an elaborated-type-specifier.
774 * pt.cc (tsubst) <case TYPENAME_TYPE>: Pass class_type or
775 enum_type as tag_type to make_typename_type accordingly instead
776 of always passing typename_type.
778 2023-04-13 Jason Merrill <jason@redhat.com>
781 * semantics.cc (check_trait_type): Handle incomplete type directly.
782 * typeck2.cc (cxx_incomplete_type_diagnostic): Remove assert.
784 2023-04-13 Jason Merrill <jason@redhat.com>
786 * typeck2.cc (cxx_incomplete_type_diagnostic): Return bool.
787 * cp-tree.h (cxx_incomplete_type_diagnostic): Adjust.
789 2023-04-12 Jakub Jelinek <jakub@redhat.com>
791 * Make-lang.in (s-cp-module-version): New target.
792 (cp/module.o): Depend on it.
793 (MODULE_VERSION): Remove variable.
794 (CFLAGS-cp/module.o): For -DMODULE_VERSION= argument just
795 cat s-cp-module-version.
797 2023-04-09 Iain Sandoe <iain@sandoe.co.uk>
799 * coroutines.cc (coro_rewrite_function_body): Ensure that added
800 bind expressions have scope blocks.
802 2023-04-04 Jason Merrill <jason@redhat.com>
805 * decl2.cc (find_last_decl): Return early if DECL_USE_TEMPLATE.
807 2023-04-03 Patrick Palka <ppalka@redhat.com>
810 * decl.cc (cp_finish_decl): Diagnose ordinary auto deduction
811 with no initializer, instead of asserting.
813 2023-04-01 Patrick Palka <ppalka@redhat.com>
816 * cp-tree.h (do_auto_deduction): Add defaulted tmpl parameter.
817 * pt.cc (convert_template_argument): Pass 'in_decl' as 'tmpl' to
819 (tsubst_decl) <case VAR_/TYPE_DECL>: Pass 'tmpl' instead of 't' as
820 'in_decl' to coerce_template_parms.
821 (unify) <case TEMPLATE_PARM_INDEX>: Pass TPARMS_PRIMARY_TEMPLATE
822 as 'tmpl' to do_auto_deduction.
823 (do_auto_deduction): Document default arguments. Rename local
824 variable 'tmpl' to 'ctmpl'. Use 'tmpl' to obtain a full set of
825 template arguments for satisfaction in the adc_unify case.
827 2023-04-01 Patrick Palka <ppalka@redhat.com>
831 * pt.cc (invalid_tparm_referent_p): Accept ADDR_EXPR of
833 (instantiate_class_template): Call mark_template_arguments_used.
834 (tsubst_copy_and_build) <case CALL_EXPR>: Revert r13-995 change.
835 (mark_template_arguments_used): Define.
836 (instantiate_body): Call mark_template_arguments_used.
838 2023-04-01 Iain Sandoe <iain@sandoe.co.uk>
841 * coroutines.cc (flatten_await_stmt): Use the current count of
842 promoted temporaries to build a unique name for the frame entries.
844 2023-03-30 Jason Merrill <jason@redhat.com>
847 * search.cc (type_context_for_name_lookup): New.
848 (accessible_p): Handle anonymous union.
849 * init.cc (maybe_instantiate_nsdmi_init): Use
850 type_context_for_name_lookup.
851 * parser.cc (cp_parser_class_specifier): Likewise.
852 * cp-tree.h (type_context_for_name_lookup): Declare.
854 2023-03-30 Jason Merrill <jason@redhat.com>
857 * pt.cc (unify) [FUNCTION_TYPE]: Handle function pointer
860 2023-03-30 Jakub Jelinek <jakub@redhat.com>
863 * decl2.cc (grok_array_decl): After emitting a pedwarn for
864 -Wcomma-subscript, if processing_template_decl set orig_index_exp
865 to compound expr from orig_index_exp_list.
867 2023-03-30 Jason Merrill <jason@redhat.com>
871 * decl2.cc (record_mangling): Use symtab_node::reset.
873 2023-03-30 Jakub Jelinek <jakub@redhat.com>
876 * call.cc (convert_like_internal): If pedwarn for extended float
877 type conversions doesn't report anything, avoid calling
878 maybe_inform_about_fndecl_for_bogus_argument_init.
880 2023-03-29 Jason Merrill <jason@redhat.com>
884 * pt.cc (alias_ctad_tweaks): Rewrite deduced args.
885 (type_targs_deducible_from): Handle null pack deduction.
887 2023-03-28 David Malcolm <dmalcolm@redhat.com>
890 * parser.cc (cp_parser_binary_expression): Update for new param of
891 check_for_xor_used_as_pow.
893 2023-03-28 Jakub Jelinek <jakub@redhat.com>
896 * contracts.cc: Include intl.h.
897 (check_postcondition_result): Don't form diagnostics from two halves
898 of an English message to allow translations.
900 2023-03-24 Patrick Palka <ppalka@redhat.com>
903 * parser.cc (cp_parser_class_specifier): Clear current_class_ptr
904 and current_class_ref sooner, before parsing a class definition.
906 2023-03-24 Jason Merrill <jason@redhat.com>
909 * pt.cc (type_unification_real): Adjust for partial ordering.
911 2023-03-23 Jason Merrill <jason@redhat.com>
914 * typeck.cc (build_ptrmemfunc): Drop 0-offset optimization
915 and location wrappers.
917 2023-03-23 Marek Polacek <polacek@redhat.com>
920 * call.cc (class_has_reference_member_p): New.
921 (class_has_reference_member_p_r): New.
922 (reference_like_class_p): Don't look for a specific constructor.
923 Use a DFS walk with class_has_reference_member_p_r.
925 2023-03-23 Jason Merrill <jason@redhat.com>
928 * pt.cc (find_parameter_packs_r): Handle null TREE_BINFO.
930 2023-03-22 Jason Merrill <jason@redhat.com>
933 * pt.cc (unify): Use fold of build_nop instead of fold_convert.
935 2023-03-22 Jason Merrill <jason@redhat.com>
938 * semantics.cc (finish_id_expression_1): Check scope before
939 returning id_expression.
941 2023-03-22 Alex Coplan <alex.coplan@arm.com>
944 * call.cc (build_over_call): Use make_temp_override to suppress
945 both unavailable and deprecated warnings when calling
948 2023-03-21 Jason Merrill <jason@redhat.com>
951 * init.cc (maybe_instantiate_nsdmi_init): Don't leave
952 current_function_decl set to a constructor.
954 2023-03-20 Marek Polacek <polacek@redhat.com>
957 * call.cc (add_template_candidate_real): Add explicit decls to the
958 set of candidates when the initializer is a braced-init-list.
960 2023-03-20 Jakub Jelinek <jakub@redhat.com>
963 * cp-tree.h (var_needs_tls_wrapper): Declare.
964 * decl2.cc (var_needs_tls_wrapper): No longer static.
965 * decl.cc (cp_finish_decl): Clear TREE_READONLY on TLS variables
966 for which a TLS wrapper will be needed.
968 2023-03-17 Jason Merrill <jason@redhat.com>
971 * lambda.cc (prune_lambda_captures): Don't bother in a template.
973 2023-03-17 Jason Merrill <jason@redhat.com>
976 * except.cc (build_throw): Check dtor access.
978 2023-03-17 Jason Merrill <jason@redhat.com>
981 * friend.cc (do_friend): Handle namespace as scope argument.
982 * decl.cc (grokdeclarator): Pass down in_namespace.
984 2023-03-16 Jason Merrill <jason@redhat.com>
987 * init.cc (get_nsdmi): Split out...
988 (maybe_instantiate_nsdmi_init): ...this function.
989 * cp-tree.h: Declare it.
990 * pt.cc (tsubst_expr): Use it.
992 2023-03-16 Jason Merrill <jason@redhat.com>
995 * pt.cc (tsubst_expr) [TAG_DEFN]: Handle partial instantiation.
997 2023-03-16 Jason Merrill <jason@redhat.com>
1000 * semantics.cc (finish_qualified_id_expr): Don't try to build a
1001 pointer-to-member if the scope is an enumeration.
1003 2023-03-16 Patrick Palka <ppalka@redhat.com>
1006 * constexpr.cc (maybe_constant_init_1): For an unevaluated
1007 non-manifestly-constant operand, don't constant evaluate
1008 and instead call fold_to_constant as in maybe_constant_value.
1010 2023-03-16 Patrick Palka <ppalka@redhat.com>
1013 * constraint.cc (satisfaction_cache::get): Relax overly strict
1014 checking assert in the constraint recursion case.
1016 2023-03-16 Jason Merrill <jason@redhat.com>
1019 * coroutines.cc (build_co_await): Handle lvalue 'o'.
1021 2023-03-15 Jason Merrill <jason@redhat.com>
1025 * typeck.cc (cp_build_modify_expr): Allow array initialization of
1026 DECL_ARTIFICIAL variable.
1028 2023-03-15 Marek Polacek <polacek@redhat.com>
1031 * constexpr.cc (cxx_eval_store_expression): Strip location wrappers.
1033 2023-03-15 Jason Merrill <jason@redhat.com>
1036 * semantics.cc (check_template_template_default_arg): Check
1037 maybe_get_template_decl_from_type_decl.
1039 2023-03-15 Jason Merrill <jason@redhat.com>
1044 * pt.cc (coerce_template_template_parms): Use args from
1045 DECL_CONTEXT (arg_tmpl) instead of outer_args.
1047 2023-03-15 Jason Merrill <jason@redhat.com>
1050 * pt.cc (coerce_template_template_parms): Take the arg and parm
1052 (coerce_template_template_parm): Adjust.
1053 (template_template_parm_bindings_ok_p): Adjust.
1054 (convert_template_argument): Adjust.
1056 2023-03-14 Patrick Palka <ppalka@redhat.com>
1059 * pt.cc (push_inline_template_parms_recursive): Set
1060 TEMPLATE_PARMS_CONSTRAINTS.
1061 (push_template_decl): For an out-of-line declaration, verify
1062 constraints for each enclosing template scope match those of the
1063 original template declaratation.
1065 2023-03-14 Patrick Palka <ppalka@redhat.com>
1068 * pt.cc (redeclare_class_template): Add missing "of" in
1069 constraint mismatch diagnostic.
1070 (tsubst_friend_class): For an already declared class template,
1071 substitute and pass the friend declaration's constraints to
1072 redeclare_class_template instead of passing the existing
1073 template's constraints.
1075 2023-03-14 Jason Merrill <jason@redhat.com>
1078 * pt.cc (unify_pack_expansion): Check that TPARMS_PRIMARY_TEMPLATE
1081 2023-03-14 Jason Merrill <jason@redhat.com>
1084 * cp-gimplify.cc (genericize_if_stmt): Restore folding
1085 of constant conditions.
1087 2023-03-14 Jakub Jelinek <jakub@redhat.com>
1090 * tree.cc (record_has_unique_obj_representations): Ignore unnamed
1093 2023-03-13 Jason Merrill <jason@redhat.com>
1096 * parser.cc (cp_parser_set_decl_spec_type): Use
1097 redefined_builtin_type for extended_float_type_p.
1099 2023-03-13 Marek Polacek <polacek@redhat.com>
1102 * call.cc (reference_like_class_p): Check for std::span.
1104 2023-03-10 Jakub Jelinek <jakub@redhat.com>
1107 * decl.cc (cp_finish_decl): Don't clear TREE_READONLY on
1108 automatic non-aggregate variables just because of
1109 -fmerge-all-constants.
1111 2023-03-10 Jakub Jelinek <jakub@redhat.com>
1114 * class.cc (end_of_class): For bit-fields, instead of computing
1115 offset as sum of byte_position (field) and DECL_SIZE_UNIT (field),
1116 compute it as sum of bit_position (field) and DECL_SIZE (field)
1117 divided by BITS_PER_UNIT rounded up.
1119 2023-03-10 Jason Merrill <jason@redhat.com>
1122 * lambda.cc (compare_lambda_template_head): Check more
1123 for error_mark_node.
1125 2023-03-10 Jason Merrill <jason@redhat.com>
1128 * mangle.cc (anon_aggr_naming_decl): New.
1129 (write_unqualified_name): Use it.
1131 2023-03-10 Jakub Jelinek <jakub@redhat.com>
1134 * decl.cc (poplevel): Suppress OPT_Wunused_variable warning
1135 after diagnosing it.
1137 2023-03-10 Jason Merrill <jason@redhat.com>
1140 * decl.cc (grokdeclarator): Handle non-typedef typedef_decl.
1142 2023-03-10 Jason Merrill <jason@redhat.com>
1145 * class.cc (instantiate_type): Strip location wrapper.
1147 2023-03-09 Jason Merrill <jason@redhat.com>
1150 * init.cc (find_allocator_temps_r): New.
1151 (combine_allocator_temps): Replace find_allocator_temp.
1152 (build_vec_init): Adjust.
1154 2023-03-09 Jason Merrill <jason@redhat.com>
1158 * pt.cc (alias_ctad_tweaks): Continue after deduction failure.
1160 2023-03-09 Jason Merrill <jason@redhat.com>
1161 Michael Spertus <mike@spertus.com>
1164 * pt.cc (corresponding_template_parameter_list): Split out...
1165 (corresponding_template_parameter): ...from here.
1166 (find_template_parameters): Factor out...
1167 (find_template_parameter_info::find_in): ...this function.
1168 (find_template_parameter_info::find_in_recursive): New.
1169 (find_template_parameter_info::found): New.
1170 (alias_ctad_tweaks): Only add parms used in the deduced args.
1172 2023-03-09 Jason Merrill <jason@redhat.com>
1174 * cp-trait.def (IS_DEDUCIBLE): Add space to name.
1176 2023-03-09 Jason Merrill <jason@redhat.com>
1179 * cp-trait.def (IS_DEDUCIBLE): New.
1180 * cxx-pretty-print.cc (pp_cxx_trait): Handle non-type.
1181 * parser.cc (cp_parser_trait): Likewise.
1182 * tree.cc (cp_tree_equal): Likewise.
1183 * pt.cc (tsubst_copy_and_build): Likewise.
1184 (type_targs_deducible_from): New.
1185 (alias_ctad_tweaks): Use it.
1186 * semantics.cc (trait_expr_value): Handle CPTK_IS_DEDUCIBLE.
1187 (finish_trait_expr): Likewise.
1188 * constraint.cc (diagnose_trait_expr): Likewise.
1189 * cp-tree.h (type_targs_deducible_from): Declare.
1191 2023-03-07 Jason Merrill <jason@redhat.com>
1195 * pt.cc (tsubst_function_decl): Don't replace the closure
1196 parameter if DECL_STATIC_FUNCTION_P.
1198 2023-03-07 Marek Polacek <polacek@redhat.com>
1201 * call.cc (reference_like_class_p): New.
1202 (do_warn_dangling_reference): Add new bool parameter. See through
1203 reference_like_class_p.
1205 2023-03-07 Jakub Jelinek <jakub@redhat.com>
1208 * rtti.cc (emit_support_tinfo_1): Don't assert that last
1209 unemitted_tinfo_decls element is tinfo, instead pop from it only in
1211 * decl2.cc (c_parse_final_cleanups): Don't call emit_tinfo_decl
1212 for unemitted_tinfO_decls which have already non-NULL DECL_INITIAL.
1214 2023-03-07 Marek Polacek <polacek@redhat.com>
1217 * constexpr.cc (cxx_eval_call_expression): Relax assert.
1219 2023-03-07 Marek Polacek <polacek@redhat.com>
1222 * constexpr.cc (potential_constant_expression_1) <case CALL_EXPR>: Pass
1223 'any' when recursing on a VAR_DECL and not a pointer to function.
1225 2023-03-04 Jakub Jelinek <jakub@redhat.com>
1228 * constexpr.cc: Include toplev.h.
1229 (cxx_eval_constant_expression) <case DECL_EXPR>: When seeing a local
1230 static initialized by constant expression outside of a constexpr
1231 function which has been deferred by make_rtl_for_nonlocal_decl,
1232 call rest_of_decl_compilation on it.
1234 2023-03-03 Patrick Palka <ppalka@redhat.com>
1237 * pt.cc (el_data::skipped_trees): New data member.
1238 (extract_locals_r): Push to skipped_trees any unevaluated
1239 contexts that we skipped over.
1240 (extract_local_specs): For the second walk, start from each
1241 tree in skipped_trees.
1243 2023-03-03 Alexandre Oliva <oliva@adacore.com>
1245 * typeck.cc (cp_build_binary_op): Suppress redundant warning
1246 for pfn null test in pmfn test with vbit-in-delta.
1248 2023-03-02 Jakub Jelinek <jakub@redhat.com>
1251 * cp-tree.h (enum cp_tree_index): Remove CPTI_FALLBACK_DFLOAT*_TYPE
1253 (fallback_dfloat32_type, fallback_dfloat64_type,
1254 fallback_dfloat128_type): Remove.
1255 * rtti.cc (emit_support_tinfo_1): If not emitted already, call
1256 emit_tinfo_decl and remove from unemitted_tinfo_decls right away.
1257 (emit_support_tinfos): Move &dfloat*_type_node from fundamentals array
1258 into new fundamentals_with_fallback array. Call emit_support_tinfo_1
1259 on elements of that array too, with the difference that if
1260 the type is NULL, use a fallback REAL_TYPE for it temporarily.
1261 Drop the !targetm.decimal_float_supported_p () handling. Call
1262 targetm.emit_support_tinfos at the end.
1263 * mangle.cc (write_builtin_type): Remove references to
1264 fallback_dfloat*_type. Handle bfloat16_type_node mangling.
1266 2023-03-02 Patrick Palka <ppalka@redhat.com>
1270 * cp-gimplify.cc (cp_fully_fold): Add an internal overload that
1271 additionally takes and propagate an mce_value parameter, and
1272 define the existing public overload in terms of it.
1273 (cp_fully_fold_init): Pass mce_false to cp_fully_fold.
1275 2023-03-02 Patrick Palka <ppalka@redhat.com>
1278 * constexpr.cc (maybe_constant_init_1): Override
1279 manifestly_const_eval to true if is_static.
1281 2023-03-02 Jakub Jelinek <jakub@redhat.com>
1284 * cp-gimplify.cc (cp_genericize_r) <case USING_STMT>: Set
1285 DECL_SOURCE_LOCATION on IMPORTED_DECL to expression location
1286 of USING_STMT or input_location.
1288 2023-03-02 Marek Polacek <polacek@redhat.com>
1291 * parser.cc (class_decl_loc_t::diag_mismatched_tags): If the first
1292 lookup of SPEC didn't find anything, try to look for
1293 most_general_template.
1295 2023-03-02 Jakub Jelinek <jakub@redhat.com>
1298 * parser.cc (cp_convert_omp_range_for): Allow in assert
1299 decomp_first_name without DECL_HAS_VALUE_EXPR_P if it has
1300 error_mark_node type.
1301 (cp_finish_omp_range_for): Don't set DECL_HAS_VALUE_EXPR_P back
1302 on decls which have error_mark_node type.
1304 2023-03-01 Marek Polacek <polacek@redhat.com>
1307 * constexpr.cc (cxx_eval_constant_expression): Emit an error when
1308 a PTRMEM_CST cannot be evaluated.
1310 2023-03-01 Patrick Palka <ppalka@redhat.com>
1312 * pt.cc (tsubst_scope): Define.
1313 (tsubst_decl) <case USING_DECL>: Call tsubst_scope instead of
1314 calling tsubst_scope with tf_qualifying_scope set.
1315 (tsubst_qualified_id): Call tsubst_scope instead of
1316 calling tsubst with tf_qualifying_scope set.
1317 (tsubst_copy): Immediately delegate to tsubst for all TYPE_P
1318 trees. Remove tf_qualifying_scope manipulation.
1319 <case SCOPE_REF>: Call tsubst_scope instead of calling
1320 tsubst with tf_qualifying_scope set.
1322 2023-03-01 Patrick Palka <ppalka@redhat.com>
1323 Jason Merrill <jason@redhat.com>
1327 * constexpr.cc (fold_to_constant): Define.
1328 (maybe_constant_value): Move up early exit test for unevaluated
1329 operands. Try reducing an unevaluated operand to a constant via
1331 (fold_non_dependent_expr_template): Add early exit test for
1332 CONSTANT_CLASS_P nodes. Try reducing an unevaluated operand
1333 to a constant via fold_to_constant.
1334 * cp-tree.h (fold_to_constant): Declare.
1336 2023-03-01 Jakub Jelinek <jakub@redhat.com>
1339 * constexpr.cc (potential_constant_expression_1) <case DECL_EXPR>:
1340 Only recurse on DECL_INITIAL (tmp) if tmp is a VAR_DECL, otherwise
1343 2023-02-28 Patrick Palka <ppalka@redhat.com>
1346 * pt.cc (finish_template_variable): Move dependence check
1348 (lookup_and_finish_template_variable): ... here.
1349 * semantics.cc (finish_id_expression_1): Call
1350 finish_template_variable sooner, before (and regardless of) the
1351 type_dependent_expression_p test.
1353 2023-02-28 Marek Polacek <polacek@redhat.com>
1356 * pt.cc (lookup_and_finish_template_variable): Clear tf_partial.
1358 2023-02-20 Marek Polacek <polacek@redhat.com>
1361 * constexpr.cc (cxx_eval_call_expression): Replace shortcutting trivial
1362 constructor/op= with a checking assert.
1364 2023-02-20 Marek Polacek <polacek@redhat.com>
1367 * pt.cc (prepend_one_capture): Set LAMBDA_CAPTURE_EXPLICIT_P.
1368 (tsubst_lambda_expr): Pass LAMBDA_CAPTURE_EXPLICIT_P to
1369 prepend_one_capture.
1371 2023-02-18 Jason Merrill <jason@redhat.com>
1381 * semantics.cc (finish_static_assert): Don't diagnose in
1384 2023-02-17 Patrick Palka <ppalka@redhat.com>
1388 * cp-gimplify.cc (enum fold_flags): Define.
1389 (fold_flags_t): Declare.
1390 (cp_fold_data::genericize): Replace this data member with ...
1391 (cp_fold_data::fold_flags): ... this.
1392 (cp_fold_r): Adjust use of cp_fold_data and calls to cp_fold.
1393 (cp_fold_function): Likewise.
1394 (cp_fold_maybe_rvalue): Add an internal overload that
1395 additionally takes and propagates a fold_flags_t parameter, and
1396 define the existing public overload in terms of it.
1397 (cp_fold_rvalue): Likewise.
1398 (cp_fully_fold_init): Adjust use of cp_fold_data.
1399 (fold_cache): Replace with ...
1400 (fold_caches): ... this 2-element array of caches.
1401 (get_fold_cache): Define.
1402 (clear_fold_cache): Adjust.
1403 (cp_fold): Add fold_flags_t parameter. Use get_fold_cache.
1404 Pass flags to calls to cp_fold, cp_fold_rvalue and
1405 cp_fold_maybe_rvalue.
1406 <case CALL_EXPR>: If ff_mce_false is set, fold
1407 __builtin_is_constant_evaluated to false and pass mce_false to
1408 maybe_constant_value.
1410 2023-02-17 Patrick Palka <ppalka@redhat.com>
1412 * constexpr.cc (constexpr_call::manifestly_const_eval): Give
1413 it type int instead of bool.
1414 (constexpr_ctx::manifestly_const_eval): Give it type mce_value
1416 (cxx_eval_builtin_function_call): Adjust after making
1417 manifestly_const_eval tri-state.
1418 (cxx_eval_call_expression): Likewise.
1419 (cxx_eval_binary_expression): Likewise.
1420 (cxx_eval_conditional_expression): Likewise.
1421 (cxx_eval_constant_expression): Likewise.
1422 (cxx_eval_outermost_constant_expr): Likewise.
1423 (cxx_constant_value): Likewise.
1424 (cxx_constant_dtor): Likewise.
1425 (maybe_constant_value): Give manifestly_const_eval parameter
1426 type mce_value instead of bool and adjust accordingly.
1427 (fold_non_dependent_expr_template): Adjust call
1428 to cxx_eval_outermost_constant_expr.
1429 (fold_non_dependent_expr): Likewise.
1430 (maybe_constant_init_1): Likewise.
1431 * constraint.cc (satisfy_atom): Adjust call to
1432 maybe_constant_value.
1433 * cp-tree.h (enum class mce_value): Define.
1434 (maybe_constant_value): Adjust manifestly_const_eval parameter
1435 type and default argument.
1436 * decl.cc (compute_array_index_type_loc): Adjust call to
1437 maybe_constant_value.
1438 * pt.cc (convert_nontype_argument): Likewise.
1440 2023-02-16 Patrick Palka <ppalka@redhat.com>
1443 * cp-tree.h (enum tsubst_flags): New flag tf_qualifying_scope.
1444 * decl.cc (make_typename_type): Use lookup_member instead of
1445 lookup_field. If tf_qualifying_scope is set, pass want_type=true
1446 instead of =false to lookup_member. Generalize format specifier
1447 in diagnostic to handle both type and non-type bindings.
1448 * pt.cc (tsubst_aggr_type_1): Clear tf_qualifying_scope. Tidy
1450 (tsubst_decl) <case USING_DECL>: Set tf_qualifying_scope when
1451 substituting USING_DECL_SCOPE.
1452 (tsubst): Clear tf_qualifying_scope right away and remember if
1453 it was set. Do the same for tf_tst_ok sooner.
1454 <case TYPENAME_TYPE>: Set tf_qualifying_scope when substituting
1455 TYPE_CONTEXT. Pass tf_qualifying_scope to make_typename_type
1457 (tsubst_qualified_id): Set tf_qualifying_scope when substituting
1459 (tsubst_copy): Clear tf_qualifying_scope and remember if it was
1461 <case SCOPE_REF>: Set tf_qualifying_scope when substituting the
1463 <case *_TYPE>: Pass tf_qualifying_scope to tsubst if it was set.
1464 * search.cc (lookup_member): Document default argument.
1466 2023-02-16 Patrick Palka <ppalka@redhat.com>
1468 * cp-tree.h: Mechanically drop static from static inline
1469 functions via s/^static inline/inline/g.
1471 2023-02-15 Marek Polacek <polacek@redhat.com>
1474 * call.cc (joust_maybe_elide_copy): Return false for ck_ambig.
1476 2023-02-10 Marek Polacek <polacek@redhat.com>
1479 * call.cc (set_up_extended_ref_temp): Pass var to maybe_constant_init.
1481 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1483 * parser.cc (cp_parser_omp_allocate): Parse align
1484 clause and check for restrictions.
1486 2023-02-09 Jakub Jelinek <jakub@redhat.com>
1489 * mangle.cc (write_expression, write_template_arg): Handle
1490 EXCESS_PRECISION_EXPR with REAL_CST operand as
1491 write_template_arg_literal on fold_convert of the REAL_CST
1492 to EXCESS_PRECISION_EXPR type.
1494 2023-02-06 Patrick Palka <ppalka@redhat.com>
1497 * cp-tree.h (call_expr_dependent_name): Declare.
1498 * pt.cc (iterative_hash_template_arg) <case CALL_EXPR>: Use
1499 call_expr_dependent_name instead of dependent_name.
1500 * tree.cc (call_expr_dependent_name): Define.
1501 (called_fns_equal): Adjust to take two CALL_EXPRs instead of
1502 CALL_EXPR_FNs thereof. Use call_expr_dependent_name instead
1504 (cp_tree_equal) <case CALL_EXPR>: Adjust call to called_fns_equal.
1506 2023-02-03 Marek Polacek <polacek@redhat.com>
1509 * constexpr.cc (cxx_eval_array_reference): Don't replace
1512 2023-02-03 Patrick Palka <ppalka@redhat.com>
1515 * semantics.cc (finish_call_expr): Strip ADDR_EXPR from
1516 the selected callee during overload set pruning.
1518 2023-02-03 Patrick Palka <ppalka@redhat.com>
1521 * class.cc (check_methods): Diagnose an unviable OVERLOAD
1522 set for CLASSTYPE_DESTRUCTOR differently from an ambiguous one.
1523 Then prune the OVERLOAD to a single function.
1524 (check_bases_and_members): Handle CLASSTYPE_DESTRUCTOR being
1525 an OVERLOAD when calling deduce_noexcept_on_destructor.
1526 Document why it has to be called before check_methods.
1528 2023-02-03 Patrick Palka <ppalka@redhat.com>
1531 * class.cc (check_methods): Swap order of constraints_satisfied_p
1532 and copy/move_fn_p tests.
1534 2023-02-01 Marek Polacek <polacek@redhat.com>
1537 * call.cc (build_new_op): Don't call warn_logical_operator when
1538 processing a template.
1540 2023-02-01 Jakub Jelinek <jakub@redhat.com>
1543 * constexpr.cc (cxx_eval_constant_expression): Handle OMP_*
1544 and OACC_* constructs as non-constant.
1545 (potential_constant_expression_1): Handle OMP_SCAN and OMP_SCOPE.
1547 2023-02-01 Jason Merrill <jason@redhat.com>
1549 * class.cc (note_name_declared_in_class): Change from permerror to
1550 -Wchanges-meaning pedwarn, forcing -pedantic-errors for most cases.
1552 2023-01-31 Jason Merrill <jason@redhat.com>
1555 * cp-gimplify.cc (any_non_eliding_target_exprs): New.
1556 (cp_genericize_init): Check it.
1558 2023-01-31 Marek Polacek <polacek@redhat.com>
1562 * cp-tree.h (instantiation_dependent_expression_p): Don't
1565 2023-01-26 Marek Polacek <polacek@redhat.com>
1568 * parser.cc: Remove unnecessary forward declarations.
1569 (cp_parser_string_literal): New wrapper.
1570 (cp_parser_string_literal_common): Renamed from
1571 cp_parser_string_literal. Add a bool parameter. Give an error when
1572 UDLs are not permitted.
1573 (cp_parser_userdef_string_literal): New wrapper.
1574 (finish_userdef_string_literal): Renamed from
1575 cp_parser_userdef_string_literal.
1576 (cp_parser_primary_expression): Call cp_parser_userdef_string_literal
1577 instead of cp_parser_string_literal.
1578 (cp_parser_linkage_specification): Move a variable declaration closer
1580 (cp_parser_static_assert): Likewise.
1581 (cp_parser_operator): Call cp_parser_userdef_string_literal instead of
1582 cp_parser_string_literal.
1583 (cp_parser_asm_definition): Move a variable declaration closer to its
1585 (cp_parser_asm_specification_opt): Move variable declarations closer to
1587 (cp_parser_asm_operand_list): Likewise.
1588 (cp_parser_asm_clobber_list): Likewise.
1590 2023-01-26 Jakub Jelinek <jakub@redhat.com>
1593 * parser.cc (cp_convert_omp_range_for): If cp_finish_decomp has been
1594 called in !processing_template_decl with processing_template_decl
1595 temporarily set, clear DECL_HAS_VALUE_EXPR_P on the vars temporarily.
1596 (cp_finish_omp_range_for): And set it back again here.
1598 2023-01-25 Jakub Jelinek <jakub@redhat.com>
1601 * mangle.cc (write_closure_type_name): Don't assume all
1602 lambda operator() fns are methods.
1604 2023-01-24 Jason Merrill <jason@redhat.com>
1607 * parser.cc (cp_lexer_new_main): Pass C_LEX_STRING_NO_JOIN for first
1610 2023-01-24 Jason Merrill <jason@redhat.com>
1613 * pt.cc (tsubst_function_decl): Handle static lambda.
1615 2023-01-24 Jakub Jelinek <jakub@redhat.com>
1618 * cp-gimplify.cc (cp_fold_r): Revert 2023-01-19 changes.
1620 2023-01-24 Jason Merrill <jason@redhat.com>
1624 * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: In case of double
1625 TARGET_EXPR, keep the outer one instead of the inner one.
1626 (maybe_replace_decl): New.
1628 2023-01-23 Jason Merrill <jason@redhat.com>
1631 * cp-gimplify.cc (cp_gimplify_init_expr): Allow unexpected elision
1634 2023-01-23 Marek Polacek <polacek@redhat.com>
1637 * cvt.cc (ocp_convert): copy_warning when creating a new
1639 * init.cc (build_new_1): Suppress -Wunused-value on
1640 compiler-generated COMPOUND_EXPRs.
1642 2023-01-23 Jason Merrill <jason@redhat.com>
1645 * call.cc (build_user_type_conversion_1): Check whether the
1646 iterators also find a list ctor.
1648 2023-01-23 Jason Merrill <jason@redhat.com>
1651 * decl.cc (grokdeclarator): Check whether DECL_RESULT is already
1654 2023-01-23 Jason Merrill <jason@redhat.com>
1658 * call.cc (extend_ref_init_temps_1): Handle ptrmem expression.
1660 2023-01-19 Jakub Jelinek <jakub@redhat.com>
1663 * cp-tree.h (keep_unused_object_arg): Declare.
1664 * call.cc (keep_unused_object_arg): No longer static.
1665 * tree.cc (build_min_non_dep_op_overload): Handle ARRAY_REF
1666 with overload being static member function.
1668 2023-01-19 Jakub Jelinek <jakub@redhat.com>
1671 * cp-gimplify.cc (cp_fold_r): During cp_fully_fold_init replace
1672 DECL_ANON_UNION_VAR_P VAR_DECLs with their corresponding
1675 2023-01-16 Jakub Jelinek <jakub@redhat.com>
1678 * decl.cc (cp_finish_decl): Check warning_enabled_at
1679 at the DECL_SOURCE_LOCATION (decl) for OPT_Winit_self instead
1682 2023-01-14 Jakub Jelinek <jakub@redhat.com>
1685 * typeck.cc (cp_build_binary_op): Use may_shorten_divmod for integral
1688 2023-01-13 Jakub Jelinek <jakub@redhat.com>
1691 * cvt.cc (cp_convert_and_check): For EXCESS_PRECISION_EXPR
1692 use its operand except that for warning purposes use the original
1693 EXCESS_PRECISION_EXPR.
1694 * call.cc (convert_like_internal): Only look through
1695 EXCESS_PRECISION_EXPR when calling cp_convert, not when calling
1696 cp_convert_and_check.
1698 2023-01-09 Jakub Jelinek <jakub@redhat.com>
1703 * call.cc (maybe_init_list_as_range): Always return NULL_TREE if
1704 processing_template_decl.
1706 2023-01-05 Patrick Palka <ppalka@redhat.com>
1709 * parser.cc (cp_parser_class_head): Use dk_deferred instead of
1710 dk_no_check when parsing the class name.
1712 2023-01-05 Jakub Jelinek <jakub@redhat.com>
1715 * semantics.cc (finish_omp_target_clauses): Ignore clauses other than
1718 2023-01-04 Patrick Palka <ppalka@redhat.com>
1721 * decl2.cc (mark_single_function): Ignore mark_used failure
1722 only in a non-SFINAE context rather than in a SFINAE one.
1724 2023-01-04 Jakub Jelinek <jakub@redhat.com>
1727 * decl.cc (merge_default_template_args): Return false if either
1728 new_parm or old_parm are erroneous.
1731 Copyright (C) 2023 Free Software Foundation, Inc.
1733 Copying and distribution of this file, with or without modification,
1734 are permitted in any medium without royalty provided the copyright
1735 notice and this notice are preserved.