blob: 8de4af385a819f433959a9c10d5f5f32b8910484 [file] [log] [blame]
2023-05-08 Release Manager
* GCC 12.3.0 released.
2023-05-04 Jason Merrill <>
2023-04-18 Jason Merrill <>
PR c++/106890
* (maybe_instantiate_nsdmi_init): Don't leave
current_function_decl set to a constructor.
2023-05-03 Jakub Jelinek <>
Backported from master:
2023-05-03 Jakub Jelinek <>
* (cp_fold_data): Move definition earlier.
(cp_gimplify_expr): Pass address of genericize = true
constructed data rather than &pset to cp_walk_tree with cp_fold_r.
2023-04-30 Iain Sandoe <>
Backported from master:
2023-04-09 Iain Sandoe <>
* (coro_rewrite_function_body): Ensure that added
bind expressions have scope blocks.
2023-04-30 Iain Sandoe <>
Backported from master:
2023-04-01 Iain Sandoe <>
PR c++/101118
* (flatten_await_stmt): Use the current count of
promoted temporaries to build a unique name for the frame entries.
2023-04-30 Andrew Pinski <>
Backported from master:
2022-12-16 Andrew Pinski <>
Iain Sandoe <>
PR c++/107768
* (coro_rewrite_function_body): Initialize pointers
from nullptr_node. (morph_fn_to_coro): Likewise.
2023-04-28 Patrick Palka <>
Backported from master:
2023-03-24 Patrick Palka <>
PR c++/106969
* (cp_parser_class_specifier): Clear current_class_ptr
and current_class_ref sooner, before parsing a class definition.
2023-04-28 Patrick Palka <>
Backported from master:
2023-03-01 Patrick Palka <>
Jason Merrill <>
PR c++/108219
PR c++/108218
* (fold_to_constant): Define.
(maybe_constant_value): Move up early exit test for unevaluated
operands. Try reducing an unevaluated operand to a constant via
(fold_non_dependent_expr_template): Add early exit test for
CONSTANT_CLASS_P nodes. Try reducing an unevaluated operand
to a constant via fold_to_constant.
* cp-tree.h (fold_to_constant): Declare.
2023-04-21 Jason Merrill <>
PR c++/108795
* (finish_id_expression_1): Check scope before
returning id_expression.
2023-04-20 Jason Merrill <>
2023-04-18 Jason Merrill <>
PR c++/108099
* (grokdeclarator): Handle non-typedef typedef_decl.
2023-04-19 Jason Merrill <>
PR c++/108099
* (grokdeclarator): Keep typedef_decl for __int128_t.
2023-04-18 Jason Merrill <>
PR c++/109357
* (cxx_eval_constant_expression) [TARGET_EXPR]:
Check for complex initializer.
2023-04-18 Jason Merrill <>
PR c++/105481
* (type_unification_real): Adjust for partial ordering.
2023-04-18 Jason Merrill <>
PR c++/105996
* (build_ptrmemfunc): Drop 0-offset optimization
and location wrappers.
2023-04-18 Jason Merrill <>
PR c++/106890
* (maybe_instantiate_nsdmi_init): Don't leave
current_function_decl set to a constructor.
2023-04-18 Jason Merrill <>
PR c++/108975
* (prune_lambda_captures): Don't bother in a template.
2023-04-18 Jason Merrill <>
PR c++/69410
* (do_friend): Handle namespace as scope argument.
* (grokdeclarator): Pass down in_namespace.
2023-04-18 Jason Merrill <>
PR c++/105809
* (get_nsdmi): Split out...
(maybe_instantiate_nsdmi_init): ...this function.
* cp-tree.h: Declare it.
* (tsubst_expr): Use it.
2023-04-18 Jason Merrill <>
PR c++/108242
* (tsubst_expr) [TAG_DEFN]: Handle partial instantiation.
2023-04-18 Jason Merrill <>
PR c++/101869
* (finish_qualified_id_expr): Don't try to build a
pointer-to-member if the scope is an enumeration.
2023-04-18 Jason Merrill <>
PR c++/105406
* (build_co_await): Handle lvalue 'o'.
2023-04-18 Jason Merrill <>
PR c++/103871
PR c++/98056
* (cp_build_modify_expr): Allow array initialization of
2023-04-18 Jason Merrill <>
PR c++/108468
* (unify_pack_expansion): Check that TPARMS_PRIMARY_TEMPLATE
is non-null.
2023-04-18 Jason Merrill <>
PR c++/107310
* (genericize_if_stmt): Restore folding
of constant conditions.
2023-04-18 Jason Merrill <>
PR c++/108566
* (anon_aggr_naming_decl): New.
(write_unqualified_name): Use it.
2023-04-18 Jason Merrill <>
PR c++/107154
* (cp_genericize_init_expr): Use iloc_sentinel.
(cp_genericize_target_expr): Likewise.
2023-04-18 Jason Merrill <>
PR c++/108099
* (grokdeclarator): Handle non-typedef typedef_decl.
2023-04-18 Jakub Jelinek <>
Backported from master:
2023-04-12 Jakub Jelinek <>
* (s-cp-module-version): New target.
(cp/module.o): Depend on it.
(MODULE_VERSION): Remove variable.
(CFLAGS-cp/module.o): For -DMODULE_VERSION= argument just
cat s-cp-module-version.
2023-04-18 Jakub Jelinek <>
Backported from master:
2023-03-30 Jakub Jelinek <>
PR c++/109319
* (grok_array_decl): After emitting a pedwarn for
-Wcomma-subscript, if processing_template_decl set orig_index_exp
to compound expr from orig_index_exp_list.
2023-04-18 Jakub Jelinek <>
Backported from master:
2023-03-20 Jakub Jelinek <>
PR c++/109164
* cp-tree.h (var_needs_tls_wrapper): Declare.
* (var_needs_tls_wrapper): No longer static.
* (cp_finish_decl): Clear TREE_READONLY on TLS variables
for which a TLS wrapper will be needed.
2023-03-19 Jakub Jelinek <>
Backported from master:
2023-03-14 Jakub Jelinek <>
PR c++/109096
* (record_has_unique_obj_representations): Ignore unnamed
2023-03-19 Jakub Jelinek <>
Backported from master:
2023-03-10 Jakub Jelinek <>
PR c++/107558
* (cp_finish_decl): Don't clear TREE_READONLY on
automatic non-aggregate variables just because of
2023-03-19 Jakub Jelinek <>
Backported from master:
2023-03-10 Jakub Jelinek <>
PR c++/109039
* (end_of_class): For bit-fields, instead of computing
offset as sum of byte_position (field) and DECL_SIZE_UNIT (field),
compute it as sum of bit_position (field) and DECL_SIZE (field)
divided by BITS_PER_UNIT rounded up.
2023-03-19 Jakub Jelinek <>
Backported from master:
2023-03-10 Jakub Jelinek <>
PR c/108079
* (poplevel): Suppress OPT_Wunused_variable warning
after diagnosing it.
2023-03-19 Jakub Jelinek <>
Backported from master:
2023-03-02 Jakub Jelinek <>
PR debug/108716
* (cp_genericize_r) <case USING_STMT>: Set
DECL_SOURCE_LOCATION on IMPORTED_DECL to expression location
of USING_STMT or input_location.
2023-03-15 Marek Polacek <>
Backported from master:
2023-03-15 Marek Polacek <>
PR c++/107280
* (cxx_eval_store_expression): Strip location wrappers.
2023-03-13 Arsen Arsenović <>
PR c++/106188
PR c++/106713
* (coro_rewrite_function_body): Ensure we have a
BIND_EXPR wrapping the function body.
2023-03-07 Marek Polacek <>
Backported from master:
2023-02-10 Marek Polacek <>
PR c++/107079
* (set_up_extended_ref_temp): Pass var to maybe_constant_init.
2023-03-07 Marek Polacek <>
Backported from master:
2023-03-07 Marek Polacek <>
PR c++/107939
* (potential_constant_expression_1) <case CALL_EXPR>: Pass
'any' when recursing on a VAR_DECL and not a pointer to function.
2023-03-07 Patrick Palka <>
Backported from master:
2023-03-03 Patrick Palka <>
PR c++/108998
* (el_data::skipped_trees): New data member.
(extract_locals_r): Push to skipped_trees any unevaluated
contexts that we skipped over.
(extract_local_specs): For the second walk, start from each
tree in skipped_trees.
2023-03-07 Patrick Palka <>
Backported from master:
2022-12-23 Patrick Palka <>
PR c++/108116
* (maybe_constant_value): Clear
processing_template_decl before calling break_out_target_exprs.
* (get_nsdmi): Likewise.
* (break_out_target_exprs): Assert processing_template_decl
is cleared.
2023-03-07 Patrick Palka <>
Backported from master:
2022-12-23 Patrick Palka <>
PR c++/107853
* (maybe_substitute_reqs_for): Substitute into
the template-head requirements of a template friend using only
its outer arguments via outer_template_args.
* cp-tree.h (outer_template_args): Declare.
* (outer_template_args): Define, factored out and
generalized from ...
(ctor_deduction_guides_for): ... here.
2023-03-07 Patrick Palka <>
Backported from master:
2022-11-29 Patrick Palka <>
PR c++/107864
* (function_requirements_equivalent_p): Don't check
* (determine_specialization): Propagate constraints when
specializing a function template too. Simplify by using
2023-03-07 Patrick Palka <>
Backported from master:
2022-11-03 Patrick Palka <>
PR c++/107179
* (tsubst_requires_expr): Make sure we're not
deferring access checks.
2023-03-04 Marek Polacek <>
PR c++/108550
* (lookup_and_finish_template_variable): Clear tf_partial.
2023-03-04 Marek Polacek <>
Backported from master:
2023-03-02 Marek Polacek <>
PR c++/106259
* (class_decl_loc_t::diag_mismatched_tags): If the first
lookup of SPEC didn't find anything, try to look for
2023-03-04 Marek Polacek <>
Backported from master:
2023-03-01 Marek Polacek <>
PR c++/107574
* (cxx_eval_constant_expression): Emit an error when
a PTRMEM_CST cannot be evaluated.
2023-02-20 Marek Polacek <>
Backported from master:
2023-02-20 Marek Polacek <>
PR c++/108829
* (prepend_one_capture): Set LAMBDA_CAPTURE_EXPLICIT_P.
(tsubst_lambda_expr): Pass LAMBDA_CAPTURE_EXPLICIT_P to
2023-02-15 Marek Polacek <>
Backported from master:
2023-02-15 Marek Polacek <>
PR c++/106675
* (joust_maybe_elide_copy): Return false for ck_ambig.
2023-02-10 Jakub Jelinek <>
Backported from master:
2023-01-16 Jakub Jelinek <>
PR c++/105593
* (cp_finish_decl): Check warning_enabled_at
at the DECL_SOURCE_LOCATION (decl) for OPT_Winit_self instead
of warn_init_self.
2023-02-10 Marek Polacek <>
Backported from master:
2022-08-11 Marek Polacek <>
PR middle-end/102633
* (cp_finish_decl): Call suppress_warning.
2023-02-10 Jakub Jelinek <>
Backported from master:
2023-01-24 Jakub Jelinek <>
PR c++/108474
* (cp_fold_r): Handle structured bindings
vars like anon union artificial vars.
2023-02-10 Jakub Jelinek <>
Backported from master:
2023-01-14 Jakub Jelinek <>
PR c++/108365
* (cp_build_binary_op): For integral division or modulo,
shorten if type0 is unsigned, or op0 is cast from narrower unsigned
integral type or stripped_op1 is INTEGER_CST other than -1.
2023-02-10 Jakub Jelinek <>
Backported from master:
2023-02-01 Jakub Jelinek <>
PR c++/108607
* (cxx_eval_constant_expression): Handle OMP_*
and OACC_* constructs as non-constant.
(potential_constant_expression_1): Handle OMP_SCAN and OMP_SCOPE.
2023-02-10 Jakub Jelinek <>
Backported from master:
2023-01-19 Jakub Jelinek <>
PR c++/53932
* (cp_fold_r): During cp_fully_fold_init replace
DECL_ANON_UNION_VAR_P VAR_DECLs with their corresponding
2023-02-10 Jakub Jelinek <>
Backported from master:
2023-01-05 Jakub Jelinek <>
PR c++/108286
* (finish_omp_target_clauses): Ignore clauses other than
2023-02-10 Jakub Jelinek <>
Backported from master:
2023-01-04 Jakub Jelinek <>
PR c++/108206
* (merge_default_template_args): Return false if either
new_parm or old_parm are erroneous.
2023-02-10 Jakub Jelinek <>
Backported from master:
2022-12-21 Jakub Jelinek <>
PR c++/108180
* (tsubst_expr): Don't call cp_finish_decl on
2023-02-10 Jakub Jelinek <>
Backported from master:
2022-12-15 Jakub Jelinek <>
PR c++/107065
* (cp_build_unary_op) <case TRUTH_NOT_EXPR>: If
invert_truthvalue_loc returns obvalue_p, wrap it into NON_LVALUE_EXPR.
* (cp_parser_binary_expression): Don't call
warn_logical_not_parentheses if current.lhs is a NON_LVALUE_EXPR
of a decl with boolean type.
2023-02-06 Patrick Palka <>
Backported from master:
2023-02-06 Patrick Palka <>
PR c++/107461
* cp-tree.h (call_expr_dependent_name): Declare.
* (iterative_hash_template_arg) <case CALL_EXPR>: Use
call_expr_dependent_name instead of dependent_name.
* (call_expr_dependent_name): Define.
(called_fns_equal): Adjust to take two CALL_EXPRs instead of
CALL_EXPR_FNs thereof. Use call_expr_dependent_name instead
of dependent_name.
(cp_tree_equal) <case CALL_EXPR>: Adjust call to called_fns_equal.
2023-02-03 Patrick Palka <>
Backported from master:
2023-02-03 Patrick Palka <>
PR c++/107461
* (finish_call_expr): Strip ADDR_EXPR from
the selected callee during overload set pruning.
2023-02-01 Marek Polacek <>
Backported from master:
2023-02-01 Marek Polacek <>
PR c++/107755
* (build_new_op): Don't call warn_logical_operator when
processing a template.
2023-01-31 Marek Polacek <>
PR c++/107593
PR c++/108597
* cp-tree.h (instantiation_dependent_expression_p): Don't
declare here.
2023-01-04 Patrick Palka <>
Backported from master:
2023-01-04 Patrick Palka <>
PR c++/108282
* (mark_single_function): Ignore mark_used failure
only in a non-SFINAE context rather than in a SFINAE one.
2022-12-19 Patrick Palka <>
Backported from master:
2022-12-15 Patrick Palka <>
PR c++/100295
PR c++/107579
* (el_data::skip_unevaluated_operands): New data member.
(extract_locals_r): If skip_unevaluated_operands is true,
don't walk into unevaluated contexts.
(extract_local_specs): Walk the pattern twice, first with
skip_unevaluated_operands true followed by it set to false.
2022-12-19 Patrick Palka <>
Backported from master:
2022-12-15 Patrick Palka <>
PR c++/108104
* (unify) <default>: Relax assert to accept any
2022-12-19 Patrick Palka <>
Backported from master:
2022-12-04 Patrick Palka <>
PR c++/107417
* (for_each_template_parm_r) <case REQUIRES_EXPR>: Move
walking of the TREE_TYPE of each parameter to ...
* (cp_walk_subtrees) <case REQUIRES_EXPR>: ... here.
2022-12-19 Patrick Palka <>
Backported from master:
2022-12-03 Patrick Palka <>
PR c++/103081
* (tsubst_copy) <case CONST_DECL>: Generalize
early exit test for namespace-scope decls to check dependence of
the enclosing scope instead. Remove dead early exit test.
2022-12-19 Patrick Palka <>
Backported from master:
2022-11-30 Patrick Palka <>
PR c++/107542
* (cp_build_binary_op): In the SPACESHIP_EXPR case,
handle an error_mark_node result type.
2022-11-20 Jakub Jelinek <>
Backported from master:
2022-11-15 Jakub Jelinek <>
* cp-tree.h (next_common_initial_seqence): Rename to ...
(next_common_initial_sequence): ... this.
* (next_common_initial_seqence): Rename to ...
(next_common_initial_sequence): ... this.
(layout_compatible_type_p): Call next_common_initial_sequence
rather than next_common_initial_seqence.
* (is_corresponding_member_aggr): Likewise.
2022-11-18 Marek Polacek <>
Backported from master:
2022-11-18 Marek Polacek <>
PR c++/104066
* (grokdeclarator): Check funcdecl_p before complaining
about constinit.
2022-11-03 Jakub Jelinek <>
Backported from master:
2022-10-24 Jakub Jelinek <>
PR c++/105774
* (cxx_eval_increment_expression): For signed types
that promote to int, evaluate PLUS_EXPR or MINUS_EXPR in int type.
2022-11-03 Jakub Jelinek <>
Backported from master:
2022-09-07 Jakub Jelinek <>
PR c++/106829
* (finish_omp_target_clauses): If current_function_decl
isn't a nonstatic member function, don't set data.current_object to
2022-10-13 Marek Polacek <>
Backported from master:
2022-10-13 Marek Polacek <>
PR c++/106925
* (maybe_splice_retval_cleanup): Check current_function_decl.
Make the bool const.
2022-09-29 Jason Merrill <>
* (check_methods): Call constraints_satisfied_p.
2022-09-12 Jason Merrill <>
PR c++/93259
* (type_dependent_expression_p): Treat a compound
literal of array-of-unknown-bound type like a variable.
2022-09-12 Jason Merrill <>
PR c++/106893
PR c++/90451
* (cp_finish_decl): Call mark_single_function.
2022-08-30 Marek Polacek <>
Backported from master:
2022-08-30 Marek Polacek <>
PR c++/106759
* (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
2022-08-29 Jakub Jelinek <>
Backported from master:
2022-08-16 Jakub Jelinek <>
* (cp_build_modify_expr): Implement
P2327R1 - De-deprecating volatile compound operations. Don't warn
for |=, &= or ^= with volatile lhs.
* (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
leave out simple.
2022-08-19 Release Manager
* GCC 12.2.0 released.
2022-08-12 Jason Merrill <>
Backported from master:
2022-07-31 Jason Merrill <>
PR c++/106369
* (reduced_constant_expression_p): Return false
if a CONSTRUCTOR initializes an empty field.
2022-08-12 Marek Polacek <>
Backported from master:
2022-04-29 Marek Polacek <>
PR c++/67048
* (cp_parser_enum_specifier): Warn about empty unnamed enum
only when it's followed by a semicolon.
2022-07-26 Marek Polacek <>
Backported from master:
2022-07-26 Marek Polacek <>
PR c++/106311
* (redeclare_class_template): Check DECL_P before accessing
2022-07-26 Jason Merrill <>
PR c++/106230
* (finish_for_stmt): Check stmts_are_full_exprs_p.
2022-07-21 Jason Merrill <>
PR c++/106361
* (move_fn_p): Remove assert.
2022-07-21 Patrick Palka <>
Backported from master:
2022-07-13 Patrick Palka <>
PR c++/105912
* (extract_call_expr): Return a NULL_TREE on failure
instead of asserting.
* (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
NULL_TREE extract_call_expr result.
2022-07-21 Patrick Palka <>
Backported from master:
2022-07-13 Patrick Palka <>
PR c++/105842
* (satisfy_declaration_constraints): Refine early
exit test for argument dependence.
* cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
* (template_class_depth): Handle TI_TEMPLATE being a
(usse_outer_template_parms): Factor out constraint dependence
test into ...
(uses_outer_template_parms_in_constraints): ... here.
(type_dependent_expression_p): Use it for FUNCTION_DECL.
2022-07-21 Patrick Palka <>
Backported from master:
2022-06-06 Patrick Palka <>
PR c++/53164
PR c++/105848
* (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
ADDR_EXPR callee when calling mark_used.
2022-07-21 Patrick Palka <>
Backported from master:
2022-06-03 Patrick Palka <>
PR c++/105637
* (maybe_dummy_object): When returning a dummy
object, respect the cv-quals of 'this' if available.
2022-07-21 Patrick Palka <>
Backported from master:
2022-06-03 Patrick Palka <>
PR c++/100374
* (determine_specialization): Compare overall constraints
not just the trailing constraints.
(tsubst_each_template_parm_constraints): Define.
(tsubst_friend_function): Use it.
(tsubst_friend_class): Use it.
(tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
2022-07-21 Patrick Palka <>
Backported from master:
2022-05-31 Patrick Palka <>
PR c++/105758
* (build_over_call): Use z_candidate::conversion_path
and ::access_path instead of TYPE_BINFO when building the
BASELINK for the templated form.
2022-07-21 Patrick Palka <>
Backported from master:
2022-05-26 Patrick Palka <>
PR c++/96363
* (shadow_tag): Use the return value of
* (cp_parser_single_declaration): Call shadow_tag
before associate_classtype_constraints.
* (maybe_new_partial_specialization): Change return type
to bool. Take 'type' argument by mutable reference. Set 'type'
to point to the correct constrained specialization when
(maybe_process_partial_specialization): Adjust accordingly.
2022-07-19 Marek Polacek <>
PR c++/105634
* (maybe_warn_class_memaccess): Avoid % by zero.
2022-07-02 Sergei Trofimovich <>
Backported from master:
2022-06-27 Sergei Trofimovich <>
PR c++/106102
* Include <memory> via "system.h".
* Ditto.
* Ditto.
2022-07-01 Jason Merrill <>
PR c++/106024
* (cp_parser_lookup_name): Limit previous change to
2022-07-01 Jason Merrill <>
PR c++/105541
* cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
* (cp_parser_enclosed_template_argument_list):
Use 0-length TREE_VEC for <>.
2022-07-01 Jason Merrill <>
PR c++/105779
* (resolve_args): Use complain.
2022-07-01 Jason Merrill <>
PR c++/106024
* (missing_template_diag): Factor out...
(cp_parser_id_expression): ...from here.
(cp_parser_lookup_name): Don't look in dependent object_type.
2022-06-24 Patrick Palka <>
Backported from master:
2022-06-23 Patrick Palka <>
PR c++/105931
* (fold_for_warn): Don't fold when in an unevaluated
2022-06-23 Jason Merrill <>
PR c++/105925
* (reshape_init_array_1): Set
(reshape_init_class): And here.
2022-06-23 Jason Merrill <>
PR c++/105885
* (tsubst_copy_and_build): Also suppress -Waddress for
comparison of dependent operands.
2022-06-23 Jason Merrill <>
PR c++/105964
* (type_dependent_expression_p): Look through BASELINK.
2022-06-23 Jason Merrill <>
PR c++/105908
* (outer_binding): Strip BASELINK.
2022-06-19 Jakub Jelinek <>
Backported from master:
2022-06-17 Jakub Jelinek <>
PR c++/106001
* (build_x_shufflevector): Use fold_non_dependent_expr
instead of maybe_constant_value.
2022-06-19 Jakub Jelinek <>
Backported from master:
2022-06-09 Jakub Jelinek <>
PR c++/105871
* (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
non-integral result type use fold_ternary too like for BIT_FIELD_REFs
from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
expression, set *non_constant_p and return t, instead of returning
2022-06-11 Patrick Palka <>
Backported from master:
2022-06-03 Patrick Palka <>
PR c++/105756
* (cp_build_binary_op): Don't fold operands
when c_inhibit_evaluation_warnings.
2022-06-08 Jason Merrill <>
PR c++/105852
PR c++/105761
* (duplicate_decls): Avoid copying template info
from non-templated friend even if newdecl isn't a definition.
Correct handling of DECL_UNIQUE_FRIEND_P on templates.
* (non_templated_friend_p): New.
* cp-tree.h (non_templated_friend_p): Declare it.
2022-06-03 Jason Merrill <>
PR c++/105761
* (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
from a hidden friend.
2022-06-02 Jason Merrill <>
PR c++/105795
* (cxx_eval_bare_aggregate): Always call
2022-06-01 Jason Merrill <>
PR c++/105734
* (cp_parser_postfix_dot_deref_expression): Use typeof
if the expression has auto type.
2022-06-01 Jason Merrill <>
PR c++/105779
* (resolve_args): Call mark_single_function here.
* (unify_one_argument): Not here.
2022-06-01 Patrick Palka <>
Backported from master:
2022-05-09 Patrick Palka <>
PR c++/105491
* (reduced_constant_expression_p): Use
next_subobject_field instead.
* cp-tree.h (next_subobject_field): Declare.
* (next_subobject_field): Define.
2022-05-31 Jason Merrill <>
PR c++/105652
* (tsubst_lambda_expr): Don't let a namespace-scope lambda
instantiate into a class-scope lambda.
2022-05-31 Jason Merrill <>
PR c++/105655
* (build_template_decl): Add assert.
(tsubst_function_decl): Don't return a template.
2022-05-31 Jason Merrill <>
PR c++/105623
* (mark_used): Copy type from fn to BASELINK.
* (unify_one_argument): Call mark_single_function.
2022-05-31 Jason Merrill <>
PR c++/102307
* (check_initializer): Use build_cplus_new in case of
constexpr failure.
2022-05-27 Marek Polacek <>
Backported from master:
2022-05-27 Marek Polacek <>
PR c++/105725
* (class_decl_loc_t::add): Check CLASS_TYPE_P.
2022-05-15 Jason Merrill <>
PR c++/105589
PR c++/105191
PR c++/92385
* (build_value_init): Handle class in template.
2022-05-15 Jason Merrill <>
PR c++/104470
* cp-tree.h (enum tsubst_flags): Add tf_dguide.
* (tsubst_aggr_type): Check it.
(tsubst_baselink, tsubst_copy): Check it.
(maybe_dependent_member_ref): Check it.
(instantiate_alias_template): Handle it.
(build_deduction_guide): Set it.
2022-05-15 Jason Merrill <>
PR c++/102651
PR c++/49387
* (get_tinfo_decl_direct): Don't complete_type.
(emit_tinfo_decl): Update tdesc type if needed.
2022-05-06 Patrick Palka <>
Backported from master:
2022-05-04 Patrick Palka <>
PR c++/105476
* (maybe_aggr_guide): Set processing_template_decl when
partially instantiating the guide's parameter list.
2022-05-06 Jakub Jelinek <>
Backported from master:
2022-05-04 Jakub Jelinek <>
* Include decl.h.
(maybe_add_lambda_conv_op): Temporarily override deprecated_state to
2022-05-06 Release Manager
* GCC 12.1.0 released.
2022-04-29 Iain Sandoe <>
Backported from master:
2022-04-29 Iain Sandoe <>
PR c++/105426
* (register_local_var_uses): Allow promotion of unnamed
temporaries to coroutine frame copies.
2022-04-28 Patrick Palka <>
Backported from master:
2022-04-28 Patrick Palka <>
PR c++/105425
* (unify) <case TEMPLATE_PARM_INDEX>: Treat
DEPENDENT_OPERATOR_TYPE like an empty type.
2022-04-28 Iain Sandoe <>
PR c++/104051
* (coro_diagnose_throwing_final_aw_expr): Handle
non-target expression inputs.
2022-04-28 Iain Sandoe <>
PR c++/105301
* (coro_promise_type_found_p): Account for possible
mutliple overloads of the promise return_value() method.
2022-04-28 Iain Sandoe <>
PR c++/105287
* (maybe_promote_temps): Ensure generated temporaries
are added to the bind expr.
(add_var_to_bind): Fix local var naming to use portable punctuation.
(register_local_var_uses): Do not add synthetic names to unnamed
2022-04-28 Nathan Sidwell <>
Iain Sandoe <>
PR c++/103868
* (finish_co_await_expr): Do not process non-dependent
coroutine expressions at template definition time.
(finish_co_yield_expr): Likewise.
(finish_co_return_stmt): Likewise.
2022-04-28 Marek Polacek <>
PR c++/90107
* (cp_parser_class_specifier_1): Accept :: after a class
2022-04-27 Jason Merrill <>
* (strip_typedefs): Add default argument comments.
2022-04-27 Marek Polacek <>
PR c++/105398
* (uses_template_parms): Return false for any NAMESPACE_DECL.
2022-04-26 Jason Merrill <>
PR c++/102629
* (gen_elem_of_pack_expansion_instantiation): Clear
2022-04-26 Patrick Palka <>
PR c++/105386
* (finish_decltype_type): Pass tf_decltype to
2022-04-26 Jason Merrill <>
PR c++/104624
* (check_for_bare_parameter_packs): Check for lambda
function parameter pack.
2022-04-26 Patrick Palka <>
PR c++/105289
PR c++/86193
* (process_partial_specialization): Downgrade "partial
specialization isn't more specialized" diagnostic from permerror
to an on-by-default pedwarn.
(unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
NTTP type a second time, use the original type not the
substituted type.
2022-04-25 Marek Polacek <>
PR c++/105353
* (build_x_shufflevector): Use
instantiation_dependent_expression_p except for the first two
2022-04-21 Marek Polacek <>
* (cxx_eval_logical_expression): Remove unused
(cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
<case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
2022-04-21 Marek Polacek <>
PR c++/105321
* (cxx_eval_logical_expression): Always pass false for lval
to cxx_eval_constant_expression.
2022-04-20 Ed Catmur <>
PR c++/104996
* (compare_ics): When comparing list-initialization
sequences, do not return early.
2022-04-19 Jakub Jelinek <>
PR c++/105256
* (process_init_constructor_array,
process_init_constructor_record, process_init_constructor_union): Move
containing CONSTRUCTOR.
2022-04-15 Marek Polacek <>
PR c++/105268
* (cp_parser_placeholder_type_specifier): Return
error_mark_node when trying to build up a constrained parameter in
a default argument.
2022-04-15 Jason Merrill <>
PR c++/102804
* (grokdeclarator): Drop typedef used with 'unsigned'.
2022-04-15 Jason Merrill <>
PR c++/102987
* (dump_expr): Handle USING_DECL.
[VIEW_CONVERT_EXPR]: Just look through location wrapper.
2022-04-14 Jason Merrill <>
PR c++/104646
* (maybe_save_constexpr_fundef): Don't do extra
checks for defaulted ctors.
2022-04-14 Jason Merrill <>
PR c++/82980
* (type_deducible_expression_p): New.
(lambda_capture_field_type): Check it.
2022-04-14 Jason Merrill <>
PR c++/65211
* (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
2022-04-14 Jason Merrill <>
PR c++/97219
* (dependent_local_decl_p): New.
* cp-tree.h (dependent_local_decl_p): Declare.
* (finish_call_expr): Use it.
* (tsubst_arg_types): Also substitute default args
for local externs.
2022-04-14 Jason Merrill <>
PR c++/101698
* (tsubst_baselink): Also check dependent optype.
2022-04-14 Jason Merrill <>
PR c++/101442
* (cp_finish_decl): Don't pass decl to push_cleanup.
* (perform_member_init): Likewise.
* (push_cleanup): Adjust comment.
2022-04-13 Jason Merrill <>
PR c++/105245
PR c++/100111
* (cxx_eval_store_expression): Build a CONSTRUCTOR
as needed in empty base handling.
2022-04-13 Jakub Jelinek <>
PR c++/105233
* (cp_check_const_attributes): For aligned attribute
pass manifestly_const_eval=true to fold_non_dependent_expr.
2022-04-13 Marek Polacek <>
PR c++/97296
* (direct_reference_binding): strip_top_quals when creating
a ck_qual.
2022-04-12 Jason Merrill <>
PR c++/104669
* (decls_match): Compare versions even if not recording.
(duplicate_decls): Propagate attributes to alias.
* (find_last_decl): Give up if versioned.
2022-04-12 Jason Merrill <>
PR c++/102071
* (build_new_1): Check array_p for alignment.
2022-04-12 Patrick Palka <>
PR c++/103105
* (build_extra_args): Call preserve_args.
2022-04-12 Jason Merrill <>
PR c++/104142
* (check_initializer): Check TREE_SIDE_EFFECTS.
2022-04-12 Jason Merrill <>
PR c++/105223
PR c++/92918
* (finish_struct): Always using op=.
2022-04-11 Jason Merrill <>
PR c++/98249
* (build_operator_new_call): Just look in ::.
2022-04-11 Alexandre Oliva <>
* (cxx_eval_call_expression): Disregard dtor
2022-04-11 Alexandre Oliva <>
* (set_cleanup_locs): Propagate locus to call
wrapped in cast-to-void.
2022-04-11 Jason Merrill <>
PR c++/100370
* (warn_placement_new_too_small): Check deref.
2022-04-09 Jason Merrill <>
PR c++/105191
PR c++/92385
* (build_vec_init_elt): Do {}-init for aggregates.
* (cxx_eval_vec_init): Only treat {} as value-init
for non-aggregate types.
(build_vec_init_expr): Also check constancy of explicit
initializer elements.
2022-04-09 Jason Merrill <>
PR c++/91618
PR c++/96604
* (set_decl_namespace): Set
DECL_IMPLICIT_INSTANTIATION if no non-template match.
* (check_explicit_specialization): Check it.
* (check_classfn): Call it.
2022-04-07 Patrick Palka <>
PR c++/99479
* (name_lookup::using_queue): Change to an
auto_vec (with 16 elements of internal storage).
(name_lookup::queue_namespace): Change return type to void,
take queue parameter by reference and adjust function body
(name_lookup::do_queue_usings): Inline into ...
(name_lookup::queue_usings): ... here. As in queue_namespace.
(name_lookup::search_unqualified): Don't make queue static,
remove length variable, and adjust function body accordingly.
2022-04-07 Jakub Jelinek <>
PR tree-optimization/102586
* cp-objcp-common.h (cp_classtype_as_base): Declare.
* (cp_classtype_as_base): New function.
2022-04-07 Jason Merrill <>
PR c++/101051
* (grokdeclarator): Reject conversion with trailing return
2022-04-07 Jason Merrill <>
PR c++/101717
* (lambda_expr_this_capture): Check all enclosing
lambdas for completeness.
2022-04-07 Jason Merrill <>
PR c++/105187
* (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
2022-04-06 Jakub Jelinek <>
PR c++/104668
* (splice_template_attributes): Return NULL if *p is
(cplus_decl_attributes): Return early if attributes is
error_mark_node. Don't check that later.
2022-04-06 Patrick Palka <>
PR c++/105143
* (do_class_deduction): Check complain before attempting
to issue a -Wctad-maybe-unsupported warning.
2022-04-06 Jason Merrill <>
PR c++/104702
* (build_vec_init): Use a reference for the result.
2022-04-06 Jason Merrill <>
PR c++/100608
* (check_local_shadow): Use -Wshadow=local
if exactly one of 'old' and 'decl' is a type.
2022-04-05 Jason Merrill <>
PR c++/103852
DR 1286
* (do_class_deduction): Pedwarn for renaming alias in C++17.
2022-04-05 Jason Merrill <>
PR c++/101677
* name-lookup.h (struct cp_binding_level): Add requires_expression
* (cp_parser_requires_expression): Set it.
(synthesize_implicit_template_parm): Check it.
2022-04-04 Jason Merrill <>
PR c++/101894
* (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
2022-04-04 Jason Merrill <>
PR c++/103852
DR 1286
* (get_underlying_template): Compare default template args.
2022-04-03 Benno Evers <>
Iain Sandoe <>
PR c++/103328
* (morph_fn_to_coro): Reset
2022-04-01 Jason Merrill <>
2022-03-31 Jason Merrill <>
PR c++/96645
* (cp_parser_early_parsing_nsdmi): New.
(cp_parser_member_declaration): Call it.
2022-04-01 Jason Merrill <>
2022-03-24 Jason Merrill <>
PR c++/96645
* cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
* (type_has_default_ctor_to_be_synthesized): New.
(type_has_non_user_provided_default_constructor_1): Support it.
(type_has_non_user_provided_default_constructor): Now a wrapper.
* (complain_about_unparsed_dmi): New.
(constructible_expr): Call it.
2022-04-01 Patrick Palka <>
PR c++/105110
* (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
the argument type of an NTTP before deducing from it.
2022-03-31 Jason Merrill <>
PR c++/96645
* (cp_parser_early_parsing_nsdmi): New.
(cp_parser_member_declaration): Call it.
2022-03-30 Patrick Palka <>
PR c++/100474
* (diagnose_trait_expr): Handle all remaining
traits appropriately. Remove default case.
2022-03-30 Marek Polacek <>
PR c++/93280
PR c++/104583
* (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
2022-03-30 Jakub Jelinek <>
PR c++/105092
* (tsubst_omp_clause_decl): When handling iterators, set
DECL_CONTEXT of the iterator var to current_function_decl and
call pushdecl.
2022-03-30 Jakub Jelinek <>
PR c++/105061
* (cp_parser_template_introduction): If member_p, temporarily
clear parser->colon_corrects_to_scope_p around tentative parsing of
nested name specifier.
2022-03-28 Jason Merrill <>
* (determine_specialization): Add comment.
2022-03-28 Patrick Palka <>
PR c++/105067
* (finish_concept_definition): Check that a concept is
declared with exactly one template parameter list.
2022-03-28 Patrick Palka <>
PR c++/105064
* (maybe_substitute_reqs_for): Don't assume
DECL_TEMPLATE_INFO is available.
2022-03-28 Jason Merrill <>
PR c++/105003
PR c++/104008
PR c++/102869
* (complex_alias_template_r): walk_tree callback, replacing
uses_all_template_parms_r, complex_pack_expansion_r.
(complex_alias_template_p): Adjust.
* (strip_typedefs): Revert r12-7710 change.
2022-03-28 Jason Merrill <>
PR c++/102071
* (build_new_1): Include cookie in alignment. Omit
constexpr wrapper from alloc_call.
2022-03-28 Jason Merrill <>
PR c++/103291
* (push_local_extern_decl_alias): Call
2022-03-28 Jason Merrill <>
PR c++/102123
* (tsubst_copy): Use make_unbound_class_template for rewriting
a type template reference.
2022-03-28 Jason Merrill <>
PR c++/103968
* (value_dependent_expression_p): Check
has_value_dependent_address for conversion to reference.
2022-03-28 Jason Merrill <>
PR c++/103943
* (tsubst_qualified_id): Handle getting SCOPE_REF from
(instantiation_dependent_scope_ref_p): Check dependent_scope_p.
2022-03-28 Jason Merrill <>
PR c++/102045
* (make_base_init_ok): Call make_used.
2022-03-28 Jason Merrill <>
PR c++/104847
* (write_expression): Don't write a union designator when
2022-03-28 Jason Merrill <>
PR c++/99445
PR c++/103769
* (strip_typedefs): Use build_distinct_type_copy.
2022-03-26 Patrick Palka <>
PR c++/105050
* (potential_constant_expression_1) <case IF_STMT>:
Clarify error message when a if-stmt is non-constant because its
branches are non-constant.
2022-03-26 Patrick Palka <>
PR c++/103455
* (add_builtin_candidate) <case MEMBER_REF>: Test
2022-03-26 Jakub Jelinek <>
* (cp_parser_postfix_expression)
return cp_build_{vec,convert,bit_cast} result right away, instead
set postfix_expression to it and break.
2022-03-25 Marek Polacek <>
PR c++/104944
* (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
(cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
complain == true.
2022-03-24 Marek Polacek <>
PR c++/104284
* (check_initializer): Don't call build_aggr_init in
a template.
2022-03-24 Jason Merrill <>
PR c++/96645
* cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
* (type_has_default_ctor_to_be_synthesized): New.
(type_has_non_user_provided_default_constructor_1): Support it.
(type_has_non_user_provided_default_constructor): Now a wrapper.
* (complain_about_unparsed_dmi): New.
(constructible_expr): Call it.
2022-03-24 Marek Polacek <>
PR c++/102990
* (massage_init_elt): Avoid folding CONSTRUCTORs.
2022-03-24 Patrick Palka <>
PR c++/104620
* (build_over_call): Use cxx_constant_value_sfinae
instead of cxx_constant_value to evaluate a consteval call.
* (cxx_constant_value_sfinae): Add decl parameter
and pass it to cxx_eval_outermost_constant_expr.
* cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
* (fold_targs_r): Pass NULL_TREE as decl parameter to
2022-03-24 Jakub Jelinek <>
PR c++/104994
* (cxx_eval_constant_expression): Don't diagnose passing
through extern thread_local declarations. Change wording from
declaration to definition.
(potential_constant_expression_1): Don't diagnose extern thread_local
declarations. Change wording from declared to defined.
* (start_decl): Likewise.
2022-03-23 Jason Merrill <>
PR c++/103337
* (reshape_single_init): New.
(reshape_init_class): Use it.
2022-03-23 Jason Merrill <>
PR c++/105006
* (lookup_using_decl): Check that scope is
a dependent type before looking for dependent using.
2022-03-23 Jason Merrill <>
PR c++/105006
* (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
finds a dependent using.
2022-03-21 Jason Merrill <>
PR c++/58646
* (build_vec_init): Check for vla element type.
2022-03-21 Jason Merrill <>
PR c++/103337
PR c++/102740
PR c++/103299
PR c++/102538
* (reshape_init_class): Avoid looking for designator
after we found it.
(reshape_init_r): Keep looking for designator.
2022-03-21 Jason Merrill <>
PR c++/101767
* (reshape_init_class): Back out of anon struct
if a designator doesn't match.
2022-03-18 Jason Merrill <>
PR c++/92918
PR c++/104476
* (add_method): Avoid adding the same used function twice.
(handle_using_decl): Don't add_method.
(finish_struct): Don't using op= if we have one already.
(maybe_push_used_methods): New.
* (finish_member_declaration): Call it.
* (diagnose_name_conflict): No longer static.
(push_class_level_binding): Revert 92918 patch, limit
to dependent using.
* cp-tree.h: Adjust.
2022-03-18 Jakub Jelinek <>
PR c++/104568
* (build_new_constexpr_heap_type): Remove FULL_SIZE
argument and its handling, instead add ITYPE2 argument. Only
support COOKIE_SIZE != NULL.
(build_new_1): If size is 0, change it to 0 * outer_nelts if
outer_nelts is non-NULL. Pass type rather than elt_type to
* (build_new_constexpr_heap_type): New function.
(cxx_eval_constant_expression) <case CONVERT_EXPR>:
If elt_size is zero sized type, try to recover outer_nelts from
the size argument to operator new/new[] and pass that as
arg_size to build_new_constexpr_heap_type. Pass ctx,
non_constant_p and overflow_p to that call too.
2022-03-18 Marek Polacek <>
PR c++/104008
* (strip_typedefs): Don't strip an alias template when
doing so would result in losing a parameter pack.
2022-03-16 Patrick Palka <>
* (lookup_member): Simplify by handling all values
of protect together in the ambiguous case. Don't modify protect.
2022-03-16 Patrick Palka <>
PR c++/96780
* (cp_fold) <case CALL_EXPR>: Fold calls to
std::move/forward and other cast-like functions into simple
2022-03-15 Patrick Palka <>
PR c++/103177
* (lookup_field_info::errstr): Remove this data
(lookup_field_r): Don't set errstr.
(lookup_member): Check ambiguity before checking access.
Simplify accordingly after errstr removal. Exit early upon
error or empty result.
2022-03-15 Jakub Jelinek <>
PR c++/104623
* (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
2022-03-14 Jakub Jelinek <>
PR tree-optimization/102586
* (build_cxx_call): Diagnose __builtin_clear_padding where
first argument's type is pointer to non-trivially-copyable type unless
it is address of a variable or parameter.
2022-03-12 Patrick Palka <>
PR c++/104641
* cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
* (make_typename_type): Allow a typename-specifier to
resolve to a template when tf_tst_ok, in which case return
a CTAD placeholder for the template.
* (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
substituting the type.
(tsubst): Clear tf_tst_ok and remember if it was set.
<case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
(tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
the type.
(tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
<case CONSTRUCTOR>: Likewise.
2022-03-12 Patrick Palka <>
PR c++/104622
* (missing_conversion_p): Define.
(add_candidates): Use it.
* (check_non_deducible_conversion): Change type of strict
parameter to unification_kind_t and directly test for DEDUCE_CALL.
2022-03-12 Patrick Palka <>
PR c++/104527
* (normalize_atom): Set
(get_mapped_args): Make static, adjust parameters. Always
return a vector whose depth corresponds to the template depth of
the context of the atomic constraint expression. Micro-optimize
by passing false as exact to safe_grow_cleared and by collapsing
a multi-level depth-one argument vector.
(satisfy_atom): Adjust call to get_mapped_args and
(diagnose_atomic_constraint): Replace map parameter with an args
(get_mapped_args): Remove declaration.
2022-03-12 Patrick Palka <>
Jason Merrill <>
PR c++/98644
* (mark_non_constant): Define, split out from ...
(cxx_eval_outermost_constant_expr): ... here.
(maybe_constant_value): Use it.
2022-03-12 Patrick Palka <>
* (finish_unary_fold_expr): Use input_location
(finish_binary_fold_expr): Likewise.
2022-03-12 Thomas Schwinge <>
PR other/65095
* (handle_omp_array_sections_1)
(cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
instead of 'c_omp_map_clause_name'.
2022-03-10 Marek Polacek <>
PR c++/104608
* (cp_parser_template_name): Repeat lookup of
2022-03-10 Marek Polacek <>
PR c++/104752
* (finish_compound_literal): Disallow auto{x} for
* (build_functional_cast_1): Likewise.
2022-03-10 Marek Polacek <>
PR c++/104846
* (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
data member errors.
2022-03-10 Jakub Jelinek <>
PR c++/103460
* (grok_op_properties): Allow variadic operator[] for
2022-03-10 Roger Sayle <>
PR c++/95999
* (finish_enum_value_list): If VALUE isn't an INTEGER_CST
consider it to be zero (i.e. treat it like error_mark_node).
(build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
set VALUE to error_mark_node.
2022-03-10 Roger Sayle <>
PR c++/39751
* (cp_parser_late_parsing_for_member): Confirm the token
stream hasn't been purged before processing DECL_PENDING_INLINE.
2022-03-09 Patrick Palka <>
PR c++/104823
* (build_noexcept_spec): Strengthen dependence check
to instantiation_dependent_expression_p.
* (cp_parser_parenthesized_expression_list_elt):
Remove fold_expr_p parameter, and don't call
(cp_parser_parenthesized_expression_list): Adjust accordingly.
* (expand_integer_pack): Strengthen dependence check
to instantiation_dependent_expression_p.
(instantiate_non_dependent_expr_internal): Adjust comment.
(instantiate_non_dependent_expr_sfinae): Likewise. Drop
the potentially-constant check, and relax and turn the
dependence check into a checking assert.
(instantiate_non_dependent_or_null): Adjust comment.
* (finish_decltype_type): Keep
processing_template_decl cleared after calling
2022-03-09 Patrick Palka <>
PR c++/102137
PR c++/87820
* cp-tree.h (is_copy_initialization): Declare.
* (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
when is_copy_initialization is true.
* (build_aggr_init): Split out copy-initialization
check into ...
(is_copy_initialization): ... here.
* (instantiate_decl): Pass 0 instead of
LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
2022-03-09 Patrick Palka <>
PR c++/65396
* cp-tree.h (merge_default_template_args): Declare.
* (merge_default_template_args): Define, factored out
from redeclare_class_template.
(duplicate_decls): Use it when merging member function template
and free function declarations.
* (redeclare_class_template): Factor out default argument
merging logic into merge_default_template_args. Improve location
of a note when there's a template parameter kind mismatch.
2022-03-09 Jakub Jelinek <>
PR c/104711
* (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
instead of TYPE_UNSIGNED.
* (cp_build_binary_op): Don't emit
-Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
2022-03-08 Roger Sayle <>
PR c++/96440
* (start_decl): Defend against prefix_attributes being
2022-03-08 Roger Sayle <>
PR c++/96437
* (synthesize_implicit_template_parm): Check that
TREE_VALUE (new_parm) isn't error_mark_node before setting its
2022-03-08 Roger Sayle <>
PR c++/96329
* (cp_parser_linkage_specification): Treat the case where
linkage is error_mark_node as "invalid linkage-specification".
2022-03-08 Marek Polacek <>
PR c++/104108
* (convert_nontype_argument): Recompute
value_dependent_expression_p after build_converted_constant_expr.
2022-03-08 Marek Polacek <>
* (is_late_template_attribute): Do not defer attribute
* (tsubst_enum): Set TREE_UNAVAILABLE.
2022-03-08 Jakub Jelinek <>
PR c++/104806
* (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
identifiers with space at the end.
2022-03-07 Jason Merrill <>
PR c++/104618
* (mark_single_function): Look through parens and location
* (cp_build_addr_expr_1): Not here.
2022-03-07 Jakub Jelinek <>
* (cp_parser_omp_clause_map): Add missing space in string
2022-03-07 Jakub Jelinek <>
* Fix up duplicated word issue in a comment.
* Likewise.
* Likewise.
* Likewise.
2022-03-04 Nathan Sidwell <>
* (is_std_substitution): Check global module.
(is_std_substitution_char): Return bool.
2022-03-04 Nathan Sidwell <>
* cp-tree.h (mangle_identifier): Replace with ...
(mangle_module_component): ... this.
* (dump_substitution_candidates): Adjust.
(add_substitution): Likewise.
(find_substitution): Likewise.
(unmangled_name_p): Likewise.
(mangle_module_substitution): Reimplement.
(mangle_module_component): New.
(write_module, maybe_write_module): Adjust.
(write_name): Drop modules here.
(write_unqualified): Do them here instead.
(mangle_global_init): Adjust.
* (module_state::mangle): Adjust.
(mangle_module): Likewise.
(get_originating_module): Adjust.
2022-02-28 Marek Polacek <>
PR c++/104682
* cp-tree.h (build_enumerator): Adjust.
* (finish_enum): Make it return the new decl.
* (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
2022-02-28 Marek Polacek <>
PR c++/104667
* (is_late_template_attribute): Cope with a decl without
a type.
2022-02-27 Jason Merrill <>
PR c++/104618
* (cp_build_addr_expr_1): Also
2022-02-24 Martin Liska <>
* (defarg_insts_for): Use braces for subobject.
2022-02-18 Patrick Palka <>
PR c++/94944
* (maybe_instantiate_noexcept): For non-static member
functions, set current_class_ptr/ref to the specialized 'this'
2022-02-17 Jason Merrill <>
PR c++/104539
* (mark_decl_instantiated): Don't clear DECL_COMDAT.
2022-02-17 Jason Merrill <>
PR c++/90451
* (mark_single_function): New.
* cp-tree.h: Declare it.
* (cp_build_addr_expr_1): mark_used when making a PMF.
* (finish_qualified_id_expr): Not here.
(finish_id_expression_1): Or here.
(finish_decltype_type): Call mark_single_function.
* (convert_to_void): And here.
* (convert_nontype_argument): And here.
* (build_offset_ref): Adjust assert.
2022-02-17 Patrick Palka <>
PR c++/104565
* (finish_compound_literal): Don't perform
non-dependent expr folding before calling check_narrowing.
2022-02-16 Patrick Palka <>
PR c++/104507
* (potential_constant_expression_1)
<case NON_DEPENDENT_EXPR>: Return false instead of recursing.
Assert tf_error isn't set.
2022-02-15 Jason Merrill <>
PR c++/104107
PR c++/95036
* (coerce_template_template_parms): Take full parms.
Avoid adding too much of outer_args.
(coerce_template_template_parm): Adjust.
(template_template_parm_bindings_ok_p): Adjust.
(convert_template_argument): Adjust.
2022-02-14 Jakub Jelinek <>
PR c++/104513
* (potential_constant_expression_1) <case GOTO_EXPR>:
Don't punt if returns (target).
2022-02-11 Jakub Jelinek <>
PR c++/104472
* (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
Only return fold_const_call result if it is non-NULL. Otherwise
fall through into the default: case to return t, set *non_constant_p
and emit diagnostics if needed.
2022-02-10 Jason Merrill <>
* (depset::hash::add_specializations): Use
2022-02-10 Tobias Burnus <>
PR c++/102204
* (cp_omp_mappable_type_1): Remove check for virtual
members as those are permitted since OpenMP 5.0.
2022-02-10 Patrick Palka <>
* (filter_memfn_lookup): Handle dependent USING_DECL
2022-02-10 Marcel Vollweiler <>
* (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
(cp_parser_omp_var_list_no_open): Handle array sections.
(cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
(cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
* (handle_omp_array_sections): Handle clause restrictions.
(finish_omp_clauses): Handle array sections.
2022-02-09 Patrick Palka <>
PR c++/104432
* (build_new_method_call): When a non-dependent call
resolves to a specialization of a member template, always build
the pruned overload set using the member template, not the
* (filter_memfn_lookup): New parameter newtype. Simplify
and correct how members from the new lookup set are matched to
those from the old one.
(tsubst_baselink): Pass binfo_type as newtype to
2022-02-09 Jason Merrill <>
PR c++/103752
* (trees_out::core_vals): Stream explicit specifier.
(trees_in::core_vals): Likewise.
* (store_explicit_specifier): No longer static.
(tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
* cp-tree.h (lookup_explicit_specifier): Declare.
2022-02-09 Jason Merrill <>
PR c++/96876
* (split_nonconstant_init_1): Push cleanups for
preceding members with constant initialization.
(maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
2022-02-08 Jakub Jelinek <>
PR c++/104379
* (check_local_shadow): When diagnosing shadowing
of a member or global declaration, add warning suppression for
the decl and don't warn again on it.
2022-02-08 Jakub Jelinek <>
PR c++/104403
* (cxx_eval_constant_expression): Don't assert DECL_EXPRs
of TREE_STATIC vars may only appear in -std=c++23.
2022-02-08 Patrick Palka <>
PR c++/80951
* (uses_deducible_template_parms): Consider the
noexcept-spec of a function type.
2022-02-08 Patrick Palka <>
PR c++/104410
* (satisfaction_value): Relax assert to accept
cv-qualified bool.
2022-02-08 Patrick Palka <>
PR c++/103706
* (preserve_args): New function.
(tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
2022-02-08 Patrick Palka <>
PR c++/103706
* (satisfy_declaration_constraints): Use
lambda_regenerating_args instead.
* cp-tree.h (lambda_regenerating_args): Declare.
* (lambda_regenerating_args): Define, split out from
(do_auto_deduction): Use lambda_regenerating_args to obtain the
full set of outer template arguments for satisfaction when
inside a lambda.
2022-02-06 Patrick Palka <>
PR c++/96242
* (mark_used): Directly synthesize a DECL_MAYBE_DELETED
fn by calling maybe_synthesize_method instead of relying on
maybe_instantiate_noexcept. Move call to m_i_n after the
* (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
fn synthesis to only those with an implicit noexcept-spec, and
return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
2022-02-06 Jakub Jelinek <>
PR c++/89074
PR c++/104033
* (cxx_eval_binary_expression): Temporarily set
2022-02-05 Jason Merrill <>
PR c++/104300
PR c++/92385
* cp-tree.h (get_vec_init_expr): New.
(target_expr_needs_replace): New.
* (cp_gimplify_init_expr): Use it.
(struct cp_fold_data): New.
(cp_fold_r): Only genericize inits at end of fn.
(cp_fold_function): Here.
(cp_fully_fold_init): Not here.
* (build_vec_init): Use get_vec_init_expr.
* (build_vec_init_expr): Likewise.
* (split_nonconstant_init_1): Likewise.
(process_init_constructor): Wrap VEC_INIT_EXPR in
2022-02-05 Jason Merrill <>
* (iterative_hash_template_arg): Add comment.
2022-02-03 Patrick Palka <>
PR c++/104079
* (value_dependent_noexcept_spec_p): New predicate split
out from ...
(dependent_type_p_r): ... here.
(instantiation_dependent_r): Use value_dependent_noexcept_spec_p
to consider dependence of a noexcept-spec before C++17.
* (fixup_deferred_exception_variants): Clear
2022-02-03 Jason Merrill <>
PR c++/104302
* (maybe_deduce_size_from_array_init): Give up
on type-dependent init.
(cp_complete_array_type): Only call reshape_init for character
2022-02-01 Jason Merrill <>
PR c++/103186
* (defarg_inst): Use tree_vec_map_cache_hasher.
(defarg_insts_for): New.
(tsubst_default_argument): Adjust.
2022-01-31 Marek Polacek <>
PR c++/102414
PR c++/101874
* (create_array_type_for_decl): Use template_placeholder_p.
Sorry on a variable-length array of auto.
2022-01-31 Marek Polacek <>
PR c++/102434
* (finish_struct): Don't allow union initializer_list.
2022-01-31 Patrick Palka <>
PR c++/104294
* (ctor_deduction_guides_for): Correct computation of
2022-01-31 Patrick Palka <>
PR c++/104291
* (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
walk_subtrees if !include_nondeduced_p. Simplify given that
cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
2022-01-28 Patrick Palka <>
Jason Merrill <>
PR c++/92752
* (build_ptrmemfunc): Cast a nullptr constant to the
unqualified pointer type not the qualified one.
2022-01-28 Patrick Palka <>
PR c++/103341
* (cp_finish_decl): Pass the template arguments of a
variable template specialization or a templated static data
member to do_auto_deduction when the auto is constrained.
2022-01-28 Jason Merrill <>
PR c++/100198
PR c++/100030
PR c++/100282
* (cp_parser_enumerator_definition): Sorry on parameter
pack in lambda.
(cp_parser_class_head): And in class attributes.
* (check_for_bare_parameter_packs): Sorry instead of error
in lambda.
2022-01-27 Jason Merrill <>
PR c++/104245
PR c++/51344
* (save_template_attributes): Take late attrs as parm.
(cplus_decl_attributes): Call it after decl_attributes,
splice_template_attributes before.
2022-01-27 Patrick Palka <>
PR c++/99895
* (build_over_call): For a non-dependent member call,
build up a CALL_EXPR using a COMPONENT_REF callee, as in
* (build_non_dependent_expr): Don't wrap PARM_DECL either.
* (build_min_non_dep_op_overload): Adjust accordingly
after the build_over_call change.
2022-01-27 Patrick Palka <>
PR c++/92944
PR c++/103678
* (cp_parser_class_head): Update 'type' with the result
of maybe_process_partial_specialization in the
nested_name_specifier branch. Refactor nearby code to accomodate
that maybe_process_partial_specialization returns a _TYPE, not a
TYPE_DECL, and eliminate local variable 'class_type' in passing.
2022-01-27 Marek Polacek <>
PR c++/101988
* (create_array_type_for_decl): Reject forming an array of
placeholder for a deduced class type.
2022-01-26 Jason Merrill <>
PR c++/104206
PR c++/101072
* (finish_compound_literal): Restore VECTOR_TYPE check.
2022-01-26 Jakub Jelinek <>
PR c++/104226
* (init_subob_ctx): For vector ctors containing
vector elements, ensure appending to the same ctor instead of
creating another one.
2022-01-26 Marek Polacek <>
PR target/104213
* (finish_constructor_body): Suppress -Wuse-after-free.
(finish_destructor_body): Likewise.
* (build_delete_destructor_body): Likewise.
2022-01-26 Jason Merrill <>
PR c++/104235
* (cp_parser_template_name): Repeat lookup of USING_DECL.
2022-01-26 Jason Merrill <>
PR c++/103057
* (tsubst_aggr_type): Call tsubst for alias template
2022-01-25 Patrick Palka <>
PR c++/101532
PR c++/104225
* (mark_used): Don't consider maybe_instantiate_noexcept
on a deleted function.
2022-01-25 Jason Merrill <>
PR c++/59950
* (build_over_call): Use cp_build_indirect_ref.
2022-01-24 Patrick Palka <>
PR c++/104197
* (make_auto_1): Use -1 as a placeholder default argument
for level.
2022-01-24 Patrick Palka <>
PR c++/104173
* (build_class_member_access_expr): Extend
unary_complex_lvalue result adjustment to preserve all
rvalues, not just xvalues.
2022-01-23 Will Wray <>
PR c++/55227
* (reshape_init_r): Only call has_designator_check when
first_initializer_p or for the inner constructor element.
(cp_complete_array_type): Call reshape_init on braced-init-list.
2022-01-23 Jason Merrill <>
PR c++/104182
* (cp_genericize_target_expr): Make sure nothing
has set DECL_INITIAL on a TARGET_EXPR slot.
* (is_local_temp): Don't check DECL_CONTEXT.
2022-01-23 Jason Merrill <>
PR c++/101072
* cp-tree.h (build_implicit_conv_flags): Declare.
* (build_implicit_conv_flags): Split out from...
* (check_initializer): Use it.
* (tsubst_copy_and_build): Remove TARGET_EXPR handling.
* (finish_compound_literal): Don't treat
scalar values like CONSTRUCTORs.
2022-01-21 Jason Merrill <>
* (find_failing_clause): Return expr if not
(finish_static_assert): Show constant values in failing
2022-01-21 Jason Merrill <>
PR c++/104084
PR c++/20040
* (build_new_1): Only pull out TARGET_EXPR_INITIAL if
alloc_expr is a TARGET_EXPR.
2022-01-21 Marek Polacek <>
PR c++/101715
* (fixup_deferred_exception_variants): Remove duplicate
variants after parsing the exception specifications.
2022-01-21 Jason Merrill <>
PR c++/104139
PR c++/103681
* (end_of_class): Use base_binfo.
2022-01-20 Jason Merrill <>
PR c++/101405
* (reshape_init_class): Reject designator for a member of
another class.
2022-01-20 Patrick Palka <>
PR c++/91911
PR c++/103672
* (keep_template_parm): Punt on a level 0 template parm.
(tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
(tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
(make_auto_1): Add defaulted 'level' parameter.
(make_template_placeholder): Pass 0 as 'level' to make_auto_1.
2022-01-20 Patrick Palka <>
* (grokdeclarator): Diagnose a CTAD placeholder as
function return type even when !funcdecl_p.
2022-01-20 Martin Liska <>
PR c++/104134
* (dump_aggr_type): Partially disable the warning.
2022-01-20 Jason Merrill <>
PR c++/102300
* (cp_parser_template_name): Use dependent_scope_p.
2022-01-19 David Malcolm <>
* (selftest::run_cp_tests): Update calls for .c to .cc
* cp-tree.h (cp_pt_c_tests): Rename to...
(cp_pt_cc_tests): ...this.
(cp_tree_c_tests): Rename to...
(cp_tree_cc_tests): ...this.
* (cp_pt_c_tests): Rename to...
(cp_pt_cc_tests): ...this.
* (cp_tree_c_tests): Rename to...
(cp_tree_cc_tests): ...this.
2022-01-19 Jason Merrill <>
* (saved_token_sentinel::rollback): Use
2022-01-18 Jakub Jelinek <>
PR c++/104055
* (cxx_eval_outermost_constant_expr): If t is a
TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
than get_target_expr_sfinae with tf_no_cleanup, and don't set
2022-01-18 Jason Merrill <>
Jakub Jelinek <>
PR c++/104025
* (saved_token_sentinel::rollback): Call
(~saved_token_sentinel): Call rollback.
2022-01-18 Patrick Palka <>
PR c++/104074
* (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
that we return false for DEPENDENT_OPERATOR_TYPE too.
2022-01-17 Martin Liska <>
* Rename .c names to .cc.
* Likewise.
* (cxx_eval_constant_expression): Likewise.
* (morph_fn_to_coro): Likewise.
* (cp_gimplify_expr): Likewise.
* (struct lang_hooks): Likewise.
(get_template_argument_pack_elems_folded): Likewise.
* (cp_tree_size): Likewise.
(cp_unit_size_without_reusable_padding): Likewise.
(pop_file_scope): Likewise.
(cp_pushdecl): Likewise.
* cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
(cxx_simulate_record_decl): Likewise.
* cp-tree.h (struct named_label_entry): Likewise.
(current_function_return_value): Likewise.
(more_aggr_init_expr_args_p): Likewise.
(get_function_version_dispatcher): Likewise.
(common_enclosing_class): Likewise.
(strip_fnptr_conv): Likewise.
(current_decl_namespace): Likewise.
(do_aggregate_paren_init): Likewise.
(cp_check_const_attributes): Likewise.
(qualified_name_lookup_error): Likewise.
(generic_targs_for): Likewise.
(mark_exp_read): Likewise.
(is_global_friend): Likewise.
(maybe_reject_flexarray_init): Likewise.
(module_token_lang): Likewise.
(handle_module_option): Likewise.
(literal_integer_zerop): Likewise.
(build_extra_args): Likewise.
(build_if_nonnull): Likewise.
(maybe_check_overriding_exception_spec): Likewise.
(finish_omp_target_clauses): Likewise.
(maybe_warn_zero_as_null_pointer_constant): Likewise.
(cxx_print_error_function): Likewise.
(decl_in_std_namespace_p): Likewise.
(merge_exception_specifiers): Likewise.
(mangle_module_global_init): Likewise.
(cxx_block_may_fallthru): Likewise.
(fold_builtin_source_location): Likewise.
(enum cp_oracle_request): Likewise.
(subsumes): Likewise.
(cp_finish_injected_record_type): Likewise.
(vtv_build_vtable_verify_fndecl): Likewise.
(cp_tree_c_finish_parsing): Likewise.
* (diagnose_ref_binding): Likewise.
(convert_to_void): Likewise.
(convert_force): Likewise.
(type_promotes_to): Likewise.
* (make_unbound_class_template_raw): Likewise.
(cxx_init_decl_processing): Likewise.
(check_class_member_definition_namespace): Likewise.
(cxx_maybe_build_cleanup): Likewise.
* (maybe_emit_vtables): Likewise.
* (dump_function_name): Likewise.
* (is_class_type): Likewise.
(build_new_1): Likewise.
* lang-specs.h: Likewise.
* (make_alias_for_thunk): Likewise.
* (specialization_add): Likewise.
(module_state::read_cluster): Likewise.
* (check_extern_c_conflict): Likewise.
* name-lookup.h (struct cxx_binding): Likewise.
* (cp_parser_identifier): Likewise.
* parser.h (struct cp_parser): Likewise.
* (has_value_dependent_address): Likewise.
(push_tinst_level_loc): Likewise.
* (finish_omp_clauses): Likewise.
(finish_omp_atomic): Likewise.
* (cp_save_expr): Likewise.
(cp_free_lang_data): Likewise.
* (cp_common_type): Likewise.
(strip_array_domain): Likewise.
(rationalize_conditional_expr): Likewise.
(check_return_expr): Likewise.
* Likewise.
2022-01-17 Martin Liska <>
* call.c: Moved to...
* class.c: Moved to...
* constexpr.c: Moved to...
* cp-gimplify.c: Moved to...
* cp-lang.c: Moved to...
* cp-objcp-common.c: Moved to...
* cp-ubsan.c: Moved to...
* cvt.c: Moved to...
* cxx-pretty-print.c: Moved to...
* decl.c: Moved to...
* decl2.c: Moved to...
* dump.c: Moved to...
* error.c: Moved to...
* except.c: Moved to...
* expr.c: Moved to...
* friend.c: Moved to...
* g++spec.c: Moved to...
* init.c: Moved to...
* lambda.c: Moved to...
* lex.c: Moved to...
* mangle.c: Moved to...
* method.c: Moved to...
* name-lookup.c: Moved to...
* optimize.c: Moved to...
* parser.c: Moved to...
* pt.c: Moved to...
* ptree.c: Moved to...
* rtti.c: Moved to...
* search.c: Moved to...
* semantics.c: Moved to...
* tree.c: Moved to...
* typeck.c: Moved to...
* typeck2.c: Moved to...
* vtable-class-hierarchy.c: Moved to...
2022-01-17 Jakub Jelinek <>
PR c++/104031
* cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
TARGET_EXPR_SLOT to current_function_decl if it was NULL.
2022-01-17 Andrew Stubbs <>
* parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
2022-01-14 Chung-Lin Tang <>
PR c++/103705
* semantics.c (finish_omp_clauses): Also continue peeling off of
outer node for ARRAY_REFs.
2022-01-14 Jakub Jelinek <>
PR c++/103991
* cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
IF_STMT_CONSTEXPR_P with constant false or true condition only
check if the taken clause may fall through.
* cp-gimplify.c (genericize_if_stmt): For consteval if, revert
to r12-5638^ behavior if then_ block can't fall through. For
constexpr if, revert to r12-5638^ behavior.
2022-01-13 Anthony Sharp <>
Jason Merrill <>
PR c++/70417
* parser.c (cp_parser_id_expression): Handle
(struct saved_token_sentinel): Add modes to control what happens
on destruction.
(cp_parser_statement): Adjust.
(cp_parser_skip_entire_template_parameter_list): New function that
skips an entire template parameter list.
(cp_parser_require_end_of_template_parameter_list): Rename old
(cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
called from one of the above two functions.
(cp_parser_enclosed_template_argument_list): Adjust.
2022-01-12 Jakub Jelinek <>
Jason Merrill <>
PR c++/103480
* tree.c (move): If expr is xvalue_p, just return expr without
2022-01-11 Jakub Jelinek <>
PR c++/101597
* class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
* error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
2022-01-11 Patrick Palka <>
PR c++/103831
* call.c (build_new_method_call): Consider dependent bases only
if 'this' is available.
2022-01-11 Olivier Hainque <>
* decl.c (cxx_init_decl_processing): Move code possibly
altering flag_weak before code testing it.
2022-01-10 Patrick Palka <>
PR c++/103879
* constexpr.c (cxx_fold_indirect_ref): Split out object/offset
canonicalization step into a local lambda. Strengthen it to
absorb more components at position 0. Use it before both calls
to cxx_fold_indirect_ref_1.
2022-01-10 Patrick Palka <>
PR c++/103783
* call.c (cand_parms_match): Skip over 'this' when given one
static and one non-static member function.
2022-01-10 Jakub Jelinek <>
PR c++/103912
* semantics.c (expand_or_defer_fn): For immediate functions, set
node->body_removed to true and clear analyzed, definition and
* decl2.c (c_parse_final_cleanups): Ignore immediate functions for
2022-01-08 Jakub Jelinek <>
PR c++/89074
* constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
(cxx_eval_binary_expression): Use it.
2022-01-08 Jason Merrill <>
PR c++/103946
* init.c (build_vec_init): Remove assert.
* tree.c (build_vec_init_expr): Likewise.
2022-01-08 Jason Merrill <>
PR c++/100588
* call.c (build_op_delete_call): Ignore destroying delete
if alloc_fn.
2022-01-07 Jason Merrill <>
PR c++/20040
* init.c (build_new_1): Also build pointer cleanup if
* cp-tree.h (TYPE_GETS_VEC_DELETE): New.
2022-01-07 Jason Merrill <>
PR c++/103936
PR c++/65591
* cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
2022-01-07 Jason Merrill <>
PR c++/103711
* init.c (perform_target_ctor): Select destructor by in_chrg.
2022-01-07 Jason Merrill <>
PR c++/61611
* except.c (in_nested_catch): New.
(expand_end_catch_block): Check it.
2022-01-07 Jason Merrill <>
PR c++/33799
PR c++/102191
* except.c (maybe_splice_retval_cleanup): Check
* semantics.c (do_poplevel): Call it here.
* parser.c (cp_parser_compound_statement): Not here.
2022-01-07 Jason Merrill <>
PR c++/53868
* decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
cleanups from set_up_extended_ref_temp.
(wrap_temporary_cleanups): Ignore array cleanups.
(initialize_local_var): Don't check for array here.
* cp-tree.h (BIND_EXPR_VEC_DTOR): New.
* init.c (build_vec_delete_1): Set it.
2022-01-07 Jason Merrill <>
PR c++/66451
* init.c (build_vec_delete_1): Handle throwing dtor.
(build_vec_init): Tell it we're in a cleanup already.
2022-01-07 Jason Merrill <>
* typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
(split_nonconstant_init): Adjust.
2022-01-07 Jason Merrill <>
PR c++/66139
PR c++/52320
* constexpr.c (replace_decl): Rename from replace_result_decl.
* cp-tree.h (replace_decl): Declare it.
* cp-gimplify.c (cp_gimplify_init_expr): Call it.
(cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
(cp_genericize_init, cp_genericize_init_expr)
(cp_genericize_target_expr): New.
(cp_fold_r): Call them.
* tree.c (build_array_copy): Add a TARGET_EXPR.
* typeck2.c (digest_init_r): Look through a TARGET_EXPR.
2022-01-07 Jason Merrill <>
PR c++/94041
* decl.c (initialize_local_var): Fix comment.
* init.c (build_new_1): Do stabilize array init.
(build_vec_init): Use TARGET_EXPR for cleanup. Initialization
of an element from an explicit initializer is not a
* tree.c (expand_vec_init_expr): Pass flags through.
* typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
(split_nonconstant_init): Handle array cleanups.
* cp-tree.h: Adjust.
2022-01-07 Jason Merrill <>
PR c++/94041
* decl.c (check_initializer): Remove obsolete comment.
(wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
(initialize_local_var): Change assert to test.
* typeck2.c (maybe_push_temp_cleanup): New.
(split_nonconstant_init_1): Use it.
(split_nonconstant_init): Clear cleanup flags.
2022-01-07 Jason Merrill <>
PR c++/92385
* typeck2.c (PICFLAG_VEC_INIT): New.
(process_init_constructor_array): Set it.
(process_init_constructor): Handle it.
(split_nonconstant_init_1): Handle VEC_INIT_EXPR.
* init.c (build_vec_init): Likewise.
* cp-gimplify.c (cp_gimplify_expr): Factor out...
* tree.c (expand_vec_init_expr): ...this function.
(build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
(build_vec_init_expr): Likewise.
* constexpr.c (cxx_eval_vec_init): Likewise.
(reduced_constant_expression_p): Check arrays before C++20.
* cp-tree.h (expand_vec_init_expr): Declare.
2022-01-07 Jason Merrill <>
* init.c (build_new_1): Remove preevaluation code.
2022-01-05 Nathan Sidwell <>
* pt.c (instantiate_class_template_1): Process attribute((used)) set
in class's context.
2022-01-05 Nathan Sidwell <>
* init.c (build_new_1): Check complain before alignment warning.
2022-01-04 Jason Merrill <>
* cp-tree.h (class releasing_vec): Add begin/end fns.
2022-01-04 Jason Merrill <>
* init.c: Include -*- C++ -*- on first line.
2022-01-03 Marek Polacek <>
PR c++/103758
* parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
with %qD.
2022-01-03 Marek Polacek <>
* parser.c (make_char_string_pack): Add a cast to const unsigned
char *.
2022-01-03 Jakub Jelinek <>
PR c++/103600
* rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
2022-01-02 Jason Merrill <>
* init.c (build_vec_init): Append the decrement to elt_init.
2022-01-02 Jason Merrill <>
* decl.c (wrap_cleanups_r): Don't wrap if noexcept.
Copyright (C) 2022 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.