1 2022-11-08 Jason Merrill <jason@redhat.com>
2 Jakub Jelinek <jakub@redhat.com>
4 * cp-tree.h (fns_correspond): Declare.
5 * decl.cc (fns_correspond): New.
6 * call.cc (add_candidates): Look for op!= matching op==.
7 (joust): Complain about non-standard reversed tiebreaker.
8 (tourney): Fix champ_compared_to_predecessor logic.
9 (build_new_op): Don't complain about error_mark_node not having
11 * pt.cc (tsubst_copy_and_build): Don't try to be permissive
14 2022-11-06 Patrick Palka <ppalka@redhat.com>
16 * tree.cc (cxx_attribute_table): Include init_priority entry
17 only if SUPPORTS_INIT_PRIORITY.
18 (handle_init_priority_attribute): Add ATTRIBUTE_UNUSED. Assert
19 SUPPORTS_INIT_PRIORITY is true.
21 2022-11-04 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
22 Yvan ROUX <yvan.roux@foss.st.com>
24 * mapper-client.cc: Use in-process client when networking is
27 2022-11-03 Marek Polacek <polacek@redhat.com>
30 * call.cc (do_warn_dangling_reference): Quash -Wdangling-reference
33 2022-11-03 Patrick Palka <ppalka@redhat.com>
36 * constraint.cc (tsubst_requires_expr): Make sure we're not
37 deferring access checks.
39 2022-11-03 Jason Merrill <jason@redhat.com>
41 * parser.cc (cp_parser_template_declaration_after_parameters): Fix
42 concept parsing below C++20.
44 2022-11-03 Patrick Palka <ppalka@redhat.com>
47 * decl2.cc (mark_used): Don't defer synthesis of virtual
50 2022-11-01 Nathan Sidwell <nathan@acm.org>
52 * cp-tree.h (LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR): New.
53 (struct tree_lambda_expr): Add discriminator_sig bitfield.
54 (recrd_lambda_scope_sig_discriminator): Declare.
55 * lambda.cc (struct lambda_sig_count): New.
56 (lambda_discriminator): Add signature vector.
57 (start_lambda_scope): Adjust.
58 (compare_lambda_template_head, compare_lambda_sig): New.
59 (record_lambda_scope_sig_discriminator): New.
60 * mangle.cc (write_closure_type): Use the scope-sig discriminator for
61 ABI >= 18. Emit abi mangling warning if needed.
62 * module.cc (trees_out::core_vals): Stream the new discriminator.
63 (trees_in::core_vals): Likewise.
64 * parser.cc (cp_parser_lambda_declarator_opt): Call
65 record_lambda_scope_sig_discriminator.
66 * pt.cc (tsubst_lambda_expr): Likewise.
68 2022-11-01 Nathan Sidwell <nathan@acm.org>
70 * cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
71 (LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
72 (struct tree_lambda_expr): Make default_capture_mode &
73 discriminator_scope bitfields.
74 (record_null_lambda_scope) Delete.
75 (record_lambda_scope_discriminator): Declare.
76 * lambda.cc (struct lambda_discriminator): New struct.
77 (lambda_scope, lambda_scope_stack): Adjust types.
78 (lambda_count): Delete.
79 (struct tree_int): Delete.
80 (start_lambda_scope, finish_lambda_scope): Adjust.
81 (record_lambda_scope): Only record the scope.
82 (record_lambda_scope_discriminator): New.
83 * mangle.cc (write_closure_type_name): Adjust.
84 * module.cc (trees_out::core_vals): Likewise,
85 (trees_in::core_vals): Likewise.
86 * parser.cc (cp_parser_lambda_expression): Call
87 record_lambda_scope_discriminator.
88 * pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling. Call
89 record_lambda_scope_discriminator. Commonize control flow on tsubsting
90 the operator function.
92 2022-11-01 Jason Merrill <jason@redhat.com>
94 * parser.cc (make_call_declarator): Add std_attrs parm.
95 (cp_parser_lambda_declarator_opt): Pass it.
96 (cp_parser_direct_declarator): Pass it.
98 2022-11-01 Jason Merrill <jason@redhat.com>
100 * decl.cc (finish_function): Set TREE_NOTHROW later in the function.
102 2022-11-01 Jason Merrill <jason@redhat.com>
104 * decl.cc (duplicate_decls): Reformat loop.
105 * parser.cc (cp_parser_member_declaration): Add newline.
106 * semantics.cc: Remove newline.
108 2022-10-28 Marek Polacek <polacek@redhat.com>
110 * call.cc (maybe_warn_dangling_reference): Enable the warning in
111 system headers if the decl isn't in a system header.
113 2022-10-28 Jason Merrill <jason@redhat.com>
115 * decl.cc (grokdeclarator): Call decl_attributes before do_friend.
117 2022-10-28 Jakub Jelinek <jakub@redhat.com>
119 * parser.cc (cp_parser_omp_all_clauses): Allow optional comma
120 before the first clause even in pragma syntax.
121 (cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj,
122 cp_parser_omp_flush, cp_parser_omp_scan_loop_body,
123 cp_parser_omp_ordered, cp_parser_omp_assumption_clauses,
124 cp_finish_omp_declare_variant, cp_parser_omp_declare_target,
125 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires,
126 cp_parser_omp_error): Likewise.
128 2022-10-28 Joseph Myers <joseph@codesourcery.com>
131 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P, ENUM_UNDERLYING_TYPE):
132 Remove. Moved to c-common.h.
134 2022-10-27 Jakub Jelinek <jakub@redhat.com>
137 * name-lookup.cc (push_namespace): Call find_namespace_slot again
138 after pushdecl as the hash table might be expanded during pushdecl.
140 2022-10-27 Nathan Sidwell <nathan@acm.org>
142 * mangle.cc (write_closure_template_head): New.
143 (write_closure_type_name): Call it.
145 2022-10-27 Jakub Jelinek <jakub@redhat.com>
149 * typeck.cc (cp_build_binary_op): Don't compute semantic_result_type
150 if result_type is NULL.
152 2022-10-26 Marek Polacek <polacek@redhat.com>
155 * call.cc (expr_represents_temporary_p): New, factored out of...
156 (conv_binds_ref_to_temporary): ...here. Don't return false just
157 because a ck_base is missing. Use expr_represents_temporary_p.
158 (do_warn_dangling_reference): New.
159 (maybe_warn_dangling_reference): New.
160 (extend_ref_init_temps): Call maybe_warn_dangling_reference.
161 * cp-tree.h: Adjust comment.
162 * typeck.cc (check_return_expr): Suppress -Wdangling-reference
165 2022-10-25 Nathan Sidwell <nathan@acm.org>
167 * parser.cc (synthesize_implicit_template_parm): Fix thinko about
168 mark the new parm DECL_VIRTUAL_P. Avoid unneccessary tree_last call.
170 2022-10-25 Patrick Palka <ppalka@redhat.com>
172 * constraint.cc (resolve_function_concept_overload): Explicitly
173 pass complain=tf_none to coerce_template_parms.
174 (resolve_concept_check): Likewise.
175 (normalize_concept_check): Likewise.
176 * cp-tree.h (coerce_template_parms): Declare the main overload
177 and default its last parameter to true. Remove wrapper overloads.
178 * pt.cc (determine_specialization): Adjust calls to
179 coerce_template_parms and coerce_innermost_template_parms after
180 removing their last parameter.
181 (coerce_template_args_for_ttp): Likewise.
182 (coerce_ttp_args_for_tta): Likewise.
183 (coerce_template_template_parms): Likewise.
184 (coerce_template_parms): Remove use_default_args parameter and
185 adjust function comment. Document default argument. Remove
186 wrapper overloads. No longer static.
187 (coerce_innermost_template_parms): Remove use_default_args
188 parameter. Default require_all_args to true.
189 (lookup_template_class): As with determine_specialization.
190 (finish_template_variable): Likewise.
191 (tsubst_decl): Likewise.
192 (instantiate_alias_template): Likewise.
193 (fn_type_unification): Likewise.
194 (resolve_overloaded_unification): Likewise.
195 (resolve_nondeduced_context): Likewise.
196 (get_partial_spec_bindings): Likewise.
198 2022-10-25 Jason Merrill <jason@redhat.com>
200 * constexpr.cc (find_failing_clause_r): Re-add the call to
201 contextual_conv_bool.
203 2022-10-25 Patrick Palka <ppalka@redhat.com>
207 * module.cc (trees_out::core_vals): Stream TYPE_MAX_VALUE and
208 TYPE_MIN_VALUE of ENUMERAL_TYPE.
209 (trees_in::core_vals): Likewise.
210 (trees_out::write_enum_def): Don't stream them here.
211 (trees_in::read_enum_def): Likewise.
213 2022-10-25 Jason Merrill <jason@redhat.com>
215 * constexpr.cc (class constexpr_global_ctx): Add modifiable field,
216 get_value, get_value_ptr, put_value, remove_value, flush_modifiable
218 (class modifiable_tracker): New.
219 (cxx_eval_internal_function): Use it.
220 (diagnose_failing_condition): Strip CLEANUP_POINT_EXPR.
222 2022-10-25 Jason Merrill <jason@redhat.com>
224 * constexpr.cc (fold_operand): New function.
225 (find_failing_clause_r): Add const.
226 (find_failing_clause): Add const.
227 (diagnose_failing_condition): Add ctx parameter.
228 (cxx_eval_internal_function): Pass it.
229 * semantics.cc (diagnose_failing_condition): Move to constexpr.cc.
232 2022-10-24 Jason Merrill <jason@redhat.com>
234 * cp-gimplify.cc (fold_builtin_source_location)
235 * vtable-class-hierarchy.cc (register_all_pairs): Simplify calls to
236 build_string_literal.
237 (build_string_from_id): Remove.
239 2022-10-24 Marek Polacek <polacek@redhat.com>
242 * typeck.cc (treat_lvalue_as_rvalue_p): Check the return value of move.
244 2022-10-24 Jakub Jelinek <jakub@redhat.com>
247 * typeck.cc (cp_build_binary_op): Pass operands before excess precision
248 promotions to scalar_to_vector call.
250 2022-10-24 Jakub Jelinek <jakub@redhat.com>
253 * constexpr.cc (cxx_eval_increment_expression): For signed types
254 that promote to int, evaluate PLUS_EXPR or MINUS_EXPR in int type.
256 2022-10-24 Arsen Arsenović <arsen@aarsen.me>
258 * cp-tree.h (DECL_MAIN_P): Move most logic, besides the hosted
260 (DECL_MAIN_ANY_P): ... to here, so that it can be reused ...
261 (DECL_MAIN_FREESTANDING_P): ... here, with an additional
262 constraint on (hosted OR return type == int)
263 * decl.cc (finish_function): Use DECL_MAIN_FREESTANDING_P
264 instead of DECL_MAIN_P, to loosen the hosted requirement, but
265 check noreturn, before adding implicit returns.
267 2022-10-21 Jakub Jelinek <jakub@redhat.com>
270 * constexpr.cc (reduced_constant_expression_p) <case CONSTRUCTOR>:
271 Return false for VECTOR_TYPE CONSTRUCTORs even without
272 CONSTRUCTOR_NO_CLEARING set on them.
273 (cxx_eval_bare_aggregate): If constant but !changed, fold before
274 returning VECTOR_TYPE_P CONSTRUCTOR.
275 (cxx_eval_constant_expression) <case CONSTRUCTOR>: Don't fold
276 TREE_CONSTANT CONSTRUCTOR, just return it.
278 2022-10-21 Jakub Jelinek <jakub@redhat.com>
281 * semantics.cc (finish_compound_literal): For void{}, if
282 processing_template_decl return a COMPOUND_LITERAL_P
283 CONSTRUCTOR rather than void_node.
285 2022-10-20 Patrick Palka <ppalka@redhat.com>
287 * pt.cc (lookup_and_finish_template_variable): Don't
288 instantiate if the template's scope is dependent.
289 (tsubst_copy) <case TEMPLATE_DECL>: Pass entering_scope=true
290 when substituting the class scope.
292 2022-10-20 Patrick Palka <ppalka@redhat.com>
295 * module.cc (node_template_info): Handle CONCEPT_DECL.
297 2022-10-20 Jonathan Wakely <jwakely@redhat.com>
298 Ulrich Drepper <drepper@redhat.com>
300 * Make-lang.in: Add rules to generate std-name-hint.gperf. Adjust
301 rule to generate std-name-hint.h to allow chain rule.
302 * std-name-hint.h: Regenerated.
303 * std-name-hint.gperf: This file is now generated.
304 * cxxapi-data.csv: New file. CSV file with C++ API data.
305 * gen-cxxapi-file.py: New file. Generate std-name-hint.gperf
306 and module export source (in future).
308 2022-10-19 Marek Polacek <polacek@redhat.com>
311 * typeck.cc (maybe_warn_about_useless_cast): Don't warn when
312 a glvalue is cast to a non-reference type.
314 2022-10-18 Patrick Palka <ppalka@redhat.com>
317 * module.cc (trees_out::tpl_parms_fini): Don't assume default
318 template arguments must be trailing.
319 (trees_in::tpl_parms_fini): Likewise.
321 2022-10-18 Jakub Jelinek <jakub@redhat.com>
324 * cp-tree.h (build_assume_call): Declare.
325 * parser.cc (cp_parser_omp_assumption_clauses): Use build_assume_call.
326 * cp-gimplify.cc (build_assume_call): New function.
327 (process_stmt_assume_attribute): Use build_assume_call.
328 * pt.cc (tsubst_copy_and_build): Likewise.
330 2022-10-17 Patrick Palka <ppalka@redhat.com>
333 * module.cc (trees_out::write_function_def): Stream the
334 parms and result of the constexpr_fundef entry.
335 (trees_in::read_function_def): Likewise.
337 2022-10-14 Patrick Palka <ppalka@redhat.com>
340 * constexpr.cc (cxx_dynamic_cast_fn_p): Check for abi_node
341 instead of global_namespace.
342 * rtti.cc (build_dynamic_cast_1): Set DECL_CONTEXT and
343 DECL_SOURCE_LOCATION when building dynamic_cast_node. Push
344 it into the namespace.
346 2022-10-14 Jakub Jelinek <jakub@redhat.com>
348 * cp-tree.h (extended_float_type_p): Return true for
350 * typeck.cc (cp_compare_floating_point_conversion_ranks): Set
351 extended{1,2} if mv{1,2} is bfloat16_type_node. Adjust comment.
353 2022-10-14 Jakub Jelinek <jakub@redhat.com>
358 * cp-tree.h (cp_ep_convert_and_check): Remove.
359 * cvt.cc (cp_ep_convert_and_check): Remove.
360 * call.cc (build_conditional_expr): Use excess precision for ?: with
361 one arm floating and another integral. Don't convert first to
362 semantic result type from integral types.
363 (convert_like_internal): Don't call cp_ep_convert_and_check, instead
364 just strip EXCESS_PRECISION_EXPR before calling cp_convert_and_check
366 * typeck.cc (cp_build_binary_op): Set may_need_excess_precision
367 for comparisons or SPACESHIP_EXPR with at least one operand integral.
368 Don't compute semantic_result_type if build_type is non-NULL. Call
369 cp_convert_and_check instead of cp_ep_convert_and_check.
371 2022-10-14 Jakub Jelinek <jakub@redhat.com>
375 * parser.cc (cp_parser_primary_expression): Handle
376 EXCESS_PRECISION_EXPR with REAL_CST operand the same as REAL_CST.
377 * cvt.cc (cp_ep_convert_and_check): New function.
378 * call.cc (build_conditional_expr): Add excess precision support.
379 When type_after_usual_arithmetic_conversions returns error_mark_node,
380 use gcc_checking_assert that it is because of uncomparable floating
381 point ranks instead of checking all those conditions and make it
382 work also with complex types.
383 (convert_like_internal): Likewise. Add NESTED_P argument, pass true
384 to recursive calls to convert_like.
385 (convert_like): Add NESTED_P argument, pass it through to
386 convert_like_internal. For other overload pass false to it.
387 (convert_like_with_context): Pass false to NESTED_P.
388 (convert_arg_to_ellipsis): Add excess precision support.
389 (magic_varargs_p): For __builtin_is{finite,inf,inf_sign,nan,normal}
390 and __builtin_fpclassify return 2 instead of 1, document what it
392 (build_over_call): Don't handle former magic 2 which is no longer
393 used, instead for magic 1 remove EXCESS_PRECISION_EXPR.
394 (perform_direct_initialization_if_possible): Pass false to NESTED_P
395 convert_like argument.
396 * constexpr.cc (cxx_eval_constant_expression): Handle
397 EXCESS_PRECISION_EXPR.
398 (potential_constant_expression_1): Likewise.
399 * pt.cc (tsubst_copy, tsubst_copy_and_build): Likewise.
400 * cp-tree.h (cp_ep_convert_and_check): Declare.
401 * cp-gimplify.cc (cp_fold): Handle EXCESS_PRECISION_EXPR.
402 * typeck.cc (cp_common_type): For COMPLEX_TYPEs, return error_mark_node
403 if recursive call returned it.
404 (convert_arguments): For magic 1 remove EXCESS_PRECISION_EXPR.
405 (cp_build_binary_op): Add excess precision support. When
406 cp_common_type returns error_mark_node, use gcc_checking_assert that
407 it is because of uncomparable floating point ranks instead of checking
408 all those conditions and make it work also with complex types.
409 (cp_build_unary_op): Likewise.
410 (cp_build_compound_expr): Likewise.
411 (build_static_cast_1): Remove EXCESS_PRECISION_EXPR.
413 2022-10-13 Jason Merrill <jason@redhat.com>
415 * cp-tree.h: Fix whitespace.
416 * parser.h: Fix whitespace.
417 * decl.cc: Fix whitespace.
418 * parser.cc: Fix whitespace.
419 * pt.cc: Fix whitespace.
421 2022-10-13 Martin Liska <mliska@suse.cz>
423 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Emit
424 an artificial variable that would be put into .preinit_array
427 2022-10-13 Marek Polacek <polacek@redhat.com>
430 * except.cc (maybe_splice_retval_cleanup): Check current_function_decl.
433 2022-10-12 Marek Polacek <polacek@redhat.com>
435 * call.cc (standard_conversion): Remove LOOKUP_PREFER_RVALUE code.
436 (reference_binding): Honor clk_implicit_rval even pre-C++20.
437 (implicit_conversion_1): Remove LOOKUP_PREFER_RVALUE code.
438 (build_user_type_conversion_1): Likewise.
439 (convert_like_internal): Likewise.
440 (build_over_call): Likewise.
441 * cp-tree.h (LOOKUP_PREFER_RVALUE): Remove.
442 (LOOKUP_NO_NARROWING): Adjust definition.
443 * except.cc (build_throw): Don't perform two overload resolutions.
444 * typeck.cc (maybe_warn_pessimizing_move): Don't use
445 LOOKUP_PREFER_RVALUE.
446 (check_return_expr): Don't perform two overload resolutions.
448 2022-10-12 Jason Merrill <jason@redhat.com>
451 * cp-tree.h (source_location_current_p): Remove.
452 * name-lookup.h (struct cp_binding_level): Remove
454 * call.cc (in_immediate_context): All default args
455 and DMI are potentially immediate context.
456 (immediate_invocation_p): Don't treat source_location specially.
457 (struct in_consteval_if_p_temp_override): Move to cp-tree.h.
458 * constexpr.cc (get_nth_callarg): Move to cp-tree.h.
459 * cp-gimplify.cc (cp_fold_r): Don't fold consteval.
460 * name-lookup.cc (begin_scope): Don't set immediate_fn_ctx_p.
461 * parser.cc (cp_parser_lambda_declarator_opt): Likewise.
462 (cp_parser_direct_declarator): Likewise.
463 * pt.cc (tsubst_default_argument): Open sk_function_parms level.
464 * tree.cc (source_location_current_p): Remove.
465 (bot_replace): Fold consteval here.
466 (break_out_target_exprs): Handle errors.
468 2022-10-11 Patrick Palka <ppalka@redhat.com>
471 * pt.cc (tsubst_friend_function): Propagate DECL_MODULE_PURVIEW_P
472 from the introduced namespace-scope function to the namespace.
474 2022-10-11 Patrick Palka <ppalka@redhat.com>
477 * module.cc (lazy_load_binding): Clear processing_template_decl.
478 (lazy_load_pendings): Likewise.
480 2022-10-10 Nathan Sidwell <nathan@acm.org>
482 * mangle.cc (write_prefix): Add VAR_DECL & FIELD_DECL to
483 substitution table under abi=18. Note possible mismatch.
485 2022-10-10 Marek Polacek <polacek@redhat.com>
488 * error.cc: Include "attribs.h".
489 (dump_type_prefix): Print only GNU attributes here.
490 (dump_type_suffix): Print standard attributes here.
492 2022-10-08 Jason Merrill <jason@redhat.com>
494 * cp-tree.h (TARGET_EXPR_ELIDING_P): New.
495 (unsafe_copy_elision_p, set_target_expr_eliding)
496 (cp_build_init_expr): Declare.
497 * call.cc (unsafe_copy_elision_p): No longer static.
498 (build_over_call, build_special_member_call)
499 (build_new_method_call): Use cp_build_init_expr.
500 * coroutines.cc (expand_one_await_expression)
501 (build_actor_fn, flatten_await_stmt, handle_nested_conditionals)
502 (await_statement_walker, morph_fn_to_coro): Use cp_build_init_expr.
503 * cp-gimplify.cc (cp_gimplify_init_expr)
504 (cp_gimplify_expr): Check TARGET_EXPR_ELIDING_P.
505 (cp_fold_r): Propagate it.
506 (cp_fold): Use cp_build_init_expr.
507 * decl.cc (check_initializer): Use cp_build_init_expr.
508 * except.cc (build_throw): Use cp_build_init_expr.
509 * init.cc (get_nsdmi): Call set_target_expr_eliding.
510 (perform_member_init, expand_default_init, expand_aggr_init_1)
511 (build_new_1, build_vec_init): Use cp_build_init_expr.
512 * method.cc (do_build_copy_constructor): Use cp_build_init_expr.
513 * semantics.cc (simplify_aggr_init_expr, finalize_nrv_r)
514 (finish_omp_reduction_clause): Use cp_build_init_expr.
515 * tree.cc (build_target_expr): Call set_target_expr_eliding.
516 (bot_manip): Copy TARGET_EXPR_ELIDING_P.
517 * typeck.cc (cp_build_modify_expr): Call set_target_expr_eliding.
518 (check_return_expr): Use cp_build_modify_expr.
519 * typeck2.cc (split_nonconstant_init_1)
520 (split_nonconstant_init): Use cp_build_init_expr.
521 (massage_init_elt): Call set_target_expr_eliding.
522 (process_init_constructor_record): Clear TARGET_EXPR_ELIDING_P on
524 (set_target_expr_eliding, cp_build_init_expr): New.
526 2022-10-07 Marek Polacek <polacek@redhat.com>
529 * call.cc (conv_binds_ref_to_temporary): New.
530 (ref_conv_binds_directly): Rename to...
531 (ref_conv_binds_to_temporary): ...this. Use
532 conv_binds_ref_to_temporary.
533 * cp-tree.h (ref_conv_binds_directly): Rename to...
534 (ref_conv_binds_to_temporary): ...this.
535 * method.cc (ref_xes_from_temporary): Use ref_conv_binds_to_temporary.
536 * parser.cc (warn_for_range_copy): Likewise.
538 2022-10-07 Qing Zhao <qing.zhao@oracle.com>
540 * module.cc (trees_out::core_bools): Stream out new bit
542 (trees_in::core_bools): Stream in new bit decl_not_flexarray.
544 2022-10-07 Patrick Palka <ppalka@redhat.com>
546 * module.cc (trees_out::mark_class_def): Guard against
547 DECL_BIT_FIELD_REPRESENTATIVE not being a decl.
549 2022-10-07 Jason Merrill <jason@redhat.com>
551 * init.cc (expand_default_init): Also push the INIT_EXPR inside a
554 2022-10-07 Patrick Palka <ppalka@redhat.com>
557 * module.cc (trees_out::core_bools): Don't override
558 DECL_EXTERNAL to true for static variables from an inline
561 2022-10-07 Martin Liska <mliska@suse.cz>
563 * module.cc (enum module_state_counts): Use array size.
564 * name-lookup.cc (class namespace_limit_reached): Likewise.
565 (class module_state): Move up in the file.
567 2022-10-07 Jakub Jelinek <jakub@redhat.com>
569 * parser.cc (cp_parser_check_std_attribute): Only do checks if
570 attribute is a standard attribute or in gnu namespace and only
571 lookup other attributes in those namespaces.
572 * cp-gimplify.cc (lookup_hotness_attribute): Adjust function comment.
573 Only return true for standard attribute or gnu namespace attribute.
574 (remove_hotness_attribute): Only remove hotness attributes when
575 they are standard or in gnu namespace, implement it in a single
576 loop rather than former 4 now 8 remove_attribute calls.
578 2022-10-06 Jason Merrill <jason@redhat.com>
580 * coroutines.cc (expand_one_await_expression): Change conversion
581 to VIEW_CONVERT_EXPR.
582 * cp-gimplify.cc (cp_genericize_r) [CONVERT_EXPR]: Add assert.
584 2022-10-06 Joseph Myers <joseph@codesourcery.com>
586 * lex.cc (init_reswords): Handle D_EXT11.
588 2022-10-06 Patrick Palka <ppalka@redhat.com>
590 * pt.cc (optimize_specialization_lookup_p): Remove.
591 (retrieve_specialization): Assume the above returns false
592 and simplify accordingly.
593 (register_specialization): Likewise.
595 2022-10-06 Jakub Jelinek <jakub@redhat.com>
597 * parser.cc (cp_parser_omp_assumption_clauses): Emit IFN_ASSUME
598 call for holds clause on assume construct.
600 2022-10-06 Jakub Jelinek <jakub@redhat.com>
603 * cp-tree.h (process_stmt_assume_attribute): Implement C++23
604 P1774R8 - Portable assumptions. Declare.
605 (diagnose_failing_condition): Declare.
606 (find_failing_clause): Likewise.
607 * parser.cc (assume_attr): New enumerator.
608 (cp_parser_parenthesized_expression_list): Handle assume_attr.
609 Remove identifier variable, for id_attr push the identifier into
610 expression_list right away instead of inserting it before all the
612 (cp_parser_conditional_expression): New function.
613 (cp_parser_constant_expression): Use it.
614 (cp_parser_statement): Handle assume attribute.
615 (cp_parser_expression_statement): Likewise.
616 (cp_parser_gnu_attribute_list): Use assume_attr for assume
618 (cp_parser_std_attribute): Likewise. Handle standard assume
619 attribute like gnu::assume.
620 * cp-gimplify.cc (process_stmt_assume_attribute): New function.
621 * constexpr.cc: Include fold-const.h.
622 (find_failing_clause_r, find_failing_clause): New functions,
623 moved from semantics.cc with ctx argument added and if non-NULL,
624 call cxx_eval_constant_expression rather than fold_non_dependent_expr.
625 (cxx_eval_internal_function): Handle IFN_ASSUME.
626 (potential_constant_expression_1): Likewise.
627 * pt.cc (tsubst_copy_and_build): Likewise.
628 * semantics.cc (diagnose_failing_condition): New function.
629 (find_failing_clause_r, find_failing_clause): Moved to constexpr.cc.
630 (finish_static_assert): Use it. Add auto_diagnostic_group.
632 2022-10-05 Jason Merrill <jason@redhat.com>
634 * tree.cc (lvalue_kind) [VIEW_CONVERT_EXPR]: Change prvalue to
637 2022-10-04 Jason Merrill <jason@redhat.com>
640 * cp-gimplify.cc (cp_genericize_init_expr): Use iloc_sentinel.
641 (cp_genericize_target_expr): Likewise.
643 2022-10-04 Patrick Palka <ppalka@redhat.com>
646 * Make-lang.in (CP_PLUGIN_HEADERS): Add cp-trait.def.
648 2022-10-04 Jakub Jelinek <jakub@redhat.com>
650 * cp-tree.h (struct omp_declare_target_attr): Rename to ...
651 (cp_omp_declare_target_attr): ... this. Add device_type member.
652 (omp_begin_assumes_data): Rename to ...
653 (cp_omp_begin_assumes_data): ... this.
654 (struct saved_scope): Change types of omp_declare_target_attribute
655 and omp_begin_assumes.
656 * parser.cc (cp_parser_omp_clause_device_type): Uncomment
657 check_no_duplicate_clause call.
658 (cp_parser_omp_all_clauses): Fix up pasto, c_name for OMP_CLAUSE_LINK
659 should be "link" rather than "to".
660 (cp_parser_omp_declare_target): Adjust for omp_declare_target_attr
661 to cp_omp_declare_target_attr changes, push -1 as device_type. Use
662 error_at rather than warning_at for declare target with only
664 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
665 (cp_parser_omp_begin): Add begin declare target support. Adjust
666 for omp_begin_assumes_data to cp_omp_begin_assumes_data change.
667 (cp_parser_omp_end): Adjust for the
668 omp_declare_target_attr to cp_omp_declare_target_attr and
669 omp_begin_assumes_data to cp_omp_begin_assumes_data type changes,
670 adjust diagnostics wording and simplify format strings for easier
672 * semantics.cc (finish_translation_unit): Likewise.
673 * decl2.cc (cplus_decl_attributes): If device_type was present on
674 begin declare target, add "omp declare target host" and/or
675 "omp declare target nohost" attributes.
677 2022-10-03 Jakub Jelinek <jakub@redhat.com>
679 * cp-tree.h (BCS_STMT_EXPR): New enumerator.
680 * name-lookup.h (enum scope_kind): Add sk_stmt_expr.
681 * name-lookup.cc (begin_scope): Handle sk_stmt_expr like sk_block.
682 * semantics.cc (begin_compound_stmt): For BCS_STMT_EXPR use
684 * parser.cc (cp_parser_statement_expr): Use BCS_STMT_EXPR instead of
686 * decl.cc (struct named_label_entry): Add in_stmt_expr.
687 (poplevel_named_label_1): Handle sk_stmt_expr.
688 (check_previous_goto_1): Diagnose entering of statement expression.
689 (check_goto): Likewise.
691 2022-10-03 Patrick Palka <ppalka@redhat.com>
693 * constraint.cc (diagnose_trait_expr): Use CPTK_IS_SAME instead
695 * cp-trait.def (IS_SAME_AS): Rename to ...
697 * pt.cc (alias_ctad_tweaks): Use CPTK_IS_SAME instead of
699 * semantics.cc (trait_expr_value): Likewise.
700 (finish_trait_expr): Likewise.
702 2022-10-01 Patrick Palka <ppalka@redhat.com>
704 * semantics.cc (trait_expr_value): Make cp_trait_kind switch
705 statement exhaustive.
706 (finish_trait_expr): Likewise.
707 (finish_trait_type): Likewise.
709 2022-10-01 Jason Merrill <jason@redhat.com>
711 * init.cc (build_vec_init): Clear from_array for CONSTRUCTOR
714 2022-10-01 Jason Merrill <jason@redhat.com>
716 * cp-gimplify.cc (cp_genericize_init): Also convert the result of
717 split_nonconstant_init to void.
719 2022-09-30 Patrick Palka <ppalka@redhat.com>
721 * constraint.cc (diagnose_trait_expr): Likewise.
722 * cp-objcp-common.cc (names_builtin_p): Likewise.
723 * cp-tree.h (enum cp_trait_kind): Likewise.
724 * cxx-pretty-print.cc (pp_cxx_trait): Likewise.
725 * parser.cc (cp_keyword_starts_decl_specifier_p): Likewise.
726 (cp_parser_primary_expression): Likewise.
727 (cp_parser_trait): Likewise.
728 (cp_parser_simple_type_specifier): Likewise.
729 * cp-trait.def: New file.
731 2022-09-30 Jason Merrill <jason@redhat.com>
733 * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: Collapse
734 TARGET_EXPR within TARGET_EXPR.
735 * constexpr.cc (cxx_eval_outermost_constant_expr): Avoid
736 adding redundant TARGET_EXPR.
737 * cp-tree.h (target_expr_needs_replace): VEC_INIT_EXPR doesn't.
739 2022-09-29 Patrick Palka <ppalka@redhat.com>
742 * pt.cc (listify): Use lookup_qualified_name instead of
743 get_namespace_binding.
745 2022-09-29 Jason Merrill <jason@redhat.com>
747 * class.cc (check_methods): Call constraints_satisfied_p.
749 2022-09-29 Jason Merrill <jason@redhat.com>
751 * constexpr.cc (potential_constant_expression_1): Look into
752 DECL_INITIAL. Use location wrappers.
754 2022-09-29 Jason Merrill <jason@redhat.com>
757 * call.cc (build_conditional_expr): For a?:c extension, treat
758 a reused class prvalue as an xvalue.
760 2022-09-29 Jason Merrill <jason@redhat.com>
762 * call.cc (build_conditional_expr): Set TARGET_EXPR_NO_ELIDE on the
765 2022-09-29 Patrick Palka <ppalka@redhat.com>
767 * constraint.cc (diagnose_trait_expr): Handle CPTK_REMOVE_CV,
768 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
769 * cp-objcp-common.cc (names_builtin_p): Likewise.
770 * cp-tree.h (enum cp_trait_kind): Add CPTK_REMOVE_CV,
771 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
772 * cxx-pretty-print.cc (pp_cxx_trait): Handle CPTK_REMOVE_CV,
773 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
774 * parser.cc (cp_keyword_starts_decl_specifier_p): Return true
775 for RID_REMOVE_CV, RID_REMOVE_REFERENCE and RID_REMOVE_CVREF.
776 (cp_parser_trait): Handle RID_REMOVE_CV, RID_REMOVE_REFERENCE
777 and RID_REMOVE_CVREF.
778 (cp_parser_simple_type_specifier): Likewise.
779 * semantics.cc (finish_trait_type): Likewise.
781 2022-09-29 Patrick Palka <ppalka@redhat.com>
783 * cp-objcp-common.cc (cp_common_init_ts): Replace
784 UNDERLYING_TYPE with TRAIT_TYPE.
785 * cp-tree.def (TRAIT_TYPE): Define.
786 (UNDERLYING_TYPE): Remove.
787 * cp-tree.h (TRAIT_TYPE_KIND_RAW): Define.
788 (TRAIT_TYPE_KIND): Define.
789 (TRAIT_TYPE_TYPE1): Define.
790 (TRAIT_TYPE_TYPE2): Define.
791 (WILDCARD_TYPE_P): Return true for TRAIT_TYPE.
792 (finish_trait_type): Declare.
793 * cxx-pretty-print.cc (cxx_pretty_printer::primary_expression):
794 Adjust after renaming pp_cxx_trait_expression.
795 (cxx_pretty_printer::simple_type_specifier) <case TRAIT_TYPE>:
797 (cxx_pretty_printer::type_id): Replace UNDERLYING_TYPE with
799 (pp_cxx_trait_expression): Rename to ...
800 (pp_cxx_trait): ... this. Handle TRAIT_TYPE as well. Correct
801 pretty printing of the trailing arguments.
802 * cxx-pretty-print.h (pp_cxx_trait_expression): Rename to ...
803 (pp_cxx_trait_type): ... this.
804 * error.cc (dump_type) <case UNDERLYING_TYPE>: Remove.
805 <case TRAIT_TYPE>: New.
806 (dump_type_prefix): Replace UNDERLYING_WITH with TRAIT_TYPE.
807 (dump_type_suffix): Likewise.
808 * mangle.cc (write_type) <case UNDERLYING_TYPE>: Remove.
809 <case TRAIT_TYPE>: New.
810 * module.cc (trees_out::type_node) <case UNDERLYING_TYPE>:
812 <case TRAIT_TYPE>: New.
813 (trees_in::tree_node): Likewise.
814 * parser.cc (cp_parser_primary_expression): Adjust after
815 renaming cp_parser_trait_expr.
816 (cp_parser_trait_expr): Rename to ...
817 (cp_parser_trait): ... this. Call finish_trait_type for traits
819 (cp_parser_simple_type_specifier): Adjust after renaming
820 cp_parser_trait_expr.
821 * pt.cc (for_each_template_parm_r) <case UNDERLYING_TYPE>:
823 <case TRAIT_TYPE>: New.
825 (unify): Replace UNDERLYING_TYPE with TRAIT_TYPE.
826 (dependent_type_p_r): Likewise.
827 * semantics.cc (finish_underlying_type): Don't return
828 UNDERLYING_TYPE anymore when processing_template_decl.
829 (finish_trait_type): Define.
830 * tree.cc (strip_typedefs) <case UNDERLYING_TYPE>: Remove.
831 <case TRAIT_TYPE>: New.
832 (cp_walk_subtrees): Likewise.
833 * typeck.cc (structural_comptypes): Likewise.
835 2022-09-29 Nathan Sidwell <nathan@acm.org>
838 * module.cc (enum tree_tag): Add tt_nttp_var.
839 (trees_out::decl_node): Handle NTTP objects.
840 (trees_in::tree_node): Handle tt_nttp_var.
841 (depset::hash::add_binding_entry): Skip NTTP objects.
843 2022-09-28 Eugene Rozenfeld <erozen@microsoft.com>
845 * module.cc (write_location): Write discriminator.
846 (read_location): Read discriminator.
848 2022-09-28 Nathan Sidwell <nathan@acm.org>
850 * cp-tree.h (DECL_NTTP_OBJECT_P): New.
851 (template_parm_object_p): Delete.
852 (build_template_parm_object): Declare.
853 * cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P.
854 * error.cc (dump_simple_decl): Likewise.
855 * mangle.cc (write_template_arg): Likewise.
856 * pt.cc (template_parm_object_p): Delete.
857 (create_template_parm_object): Separated out checking from ...
858 (get_template_parm_object): ... this, new external entry point.
860 2022-09-27 Marek Polacek <polacek@redhat.com>
864 * call.cc (reference_binding): Check clk_implicit_rval in C++20 only.
865 * cp-tree.h (unparenthesized_id_or_class_member_access_p): Declare.
866 * pt.cc (unparenthesized_id_or_class_member_access_p): New function,
868 (do_auto_deduction): ...here. Use it. In C++23, maybe call
869 treat_lvalue_as_rvalue_p.
870 * tree.cc (xvalue_p): Check & clk_rvalueref, not == clk_rvalueref.
871 * typeck.cc (check_return_expr): Allow implicit move for functions
872 returning a reference as well, or when the return value type is not
875 2022-09-27 Marek Polacek <polacek@redhat.com>
877 * constraint.cc (diagnose_trait_expr): Say "nothrow" without quotes
878 rather than in quotes.
880 2022-09-27 Jonathan Wakely <jwakely@redhat.com>
883 * method.cc (is_convertible_helper): Use access check sentinel.
885 2022-09-27 Jakub Jelinek <jakub@redhat.com>
888 * cp-tree.h (LAMBDA_EXPR_STATIC_P): Implement C++23
889 P1169R4 - static operator(). Define.
890 * parser.cc (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Document
891 that it also allows static.
892 (cp_parser_lambda_declarator_opt): Handle static lambda specifier.
893 (cp_parser_decl_specifier_seq): Allow RID_STATIC for
894 CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
895 * decl.cc (grok_op_properties): If operator() isn't a method,
896 use a different error wording, if it is static member function,
897 allow it (for C++20 and older with a pedwarn unless it is
898 a lambda function or template instantiation).
899 * call.cc (joust): Don't ICE if one candidate is static member
900 function and the other is an indirect call. If the parameter
901 conversion on the other candidate is user defined conversion,
902 ellipsis or bad conversion, make static member function candidate
903 a winner for that parameter.
904 * lambda.cc (maybe_add_lambda_conv_op): Handle static lambdas.
905 * error.cc (dump_lambda_function): Print static for static lambdas.
907 2022-09-27 Jakub Jelinek <jakub@redhat.com>
909 * cp-tree.h (struct omp_begin_assumes_data): New type.
910 (struct saved_scope): Add omp_begin_assumes member.
911 * parser.cc: Include bitmap.h.
912 (cp_parser_omp_assumption_clauses, cp_parser_omp_assume,
913 cp_parser_omp_assumes, cp_parser_omp_begin): New functions.
914 (cp_parser_omp_end_declare_target): Rename to ...
915 (cp_parser_omp_end): ... this. Handle also end assumes.
916 (cp_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
917 (cp_parser_pragma): Handle PRAGMA_OMP_ASSUME, PRAGMA_OMP_ASSUMES
918 and PRAGMA_OMP_BEGIN. Handle PRAGMA_OMP_END rather than
919 PRAGMA_OMP_END_DECLARE_TARGET and call cp_parser_omp_end
920 for it rather than cp_parser_omp_end_declare_target.
921 * pt.cc (apply_late_template_attributes): Also temporarily clear
923 * semantics.cc (finish_translation_unit): Also diagnose
924 #pragma omp begin assumes without corresponding
925 #pragma omp end assumes.
927 2022-09-27 Jakub Jelinek <jakub@redhat.com>
929 * parser.cc (cp_parser_lambda_declarator_opt): Don't diagnose
930 conflicting specifiers here.
931 (cp_storage_class_name): New variable.
932 (cp_parser_decl_specifier_seq): When setting conflicting_specifiers_p
933 for the first time, diagnose which exact specifiers conflict.
934 (cp_parser_set_storage_class): Likewise. Move storage_class
936 * decl.cc (grokdeclarator): Don't diagnose conflicting specifiers
937 here, just return error_mark_node.
939 2022-09-27 Jakub Jelinek <jakub@redhat.com>
943 * cp-tree.h (cp_compare_floating_point_conversion_ranks): Implement
944 P1467R9 - Extended floating-point types and standard names except
945 for std::bfloat16_t for now. Declare.
946 (extended_float_type_p): New inline function.
947 * mangle.cc (write_builtin_type): Mangle float{16,32,64,128}_type_node
948 as DF{16,32,64,128}_. Mangle float{32,64,128}x_type_node as
949 DF{32,64,128}x. Remove FIXED_POINT_TYPE mangling that conflicts
951 * typeck2.cc (check_narrowing): If one of ftype or type is extended
952 floating-point type, compare floating-point conversion ranks.
953 * parser.cc (cp_keyword_starts_decl_specifier_p): Handle
955 (cp_parser_simple_type_specifier): Likewise and diagnose missing
956 _Float<N> or _Float<N>x support if not supported by target.
957 * typeck.cc (cp_compare_floating_point_conversion_ranks): New function.
958 (cp_common_type): If both types are REAL_TYPE and one or both are
959 extended floating-point types, select common type based on comparison
960 of floating-point conversion ranks and subranks.
961 (cp_build_binary_op): Diagnose operation with floating point arguments
962 with unordered conversion ranks.
963 * call.cc (standard_conversion): For floating-point conversion, if
964 either from or to are extended floating-point types, set conv->bad_p
965 for implicit conversion from larger to smaller conversion rank or
966 with unordered conversion ranks.
967 (convert_like_internal): Emit a pedwarn on such conversions.
968 (build_conditional_expr): Diagnose operation with floating point
969 arguments with unordered conversion ranks.
970 (convert_arg_to_ellipsis): Don't promote extended floating-point types
971 narrower than double to double.
972 (compare_ics): Implement P1467R9 [over.ics.rank]/4 changes.
974 2022-09-26 Marek Polacek <polacek@redhat.com>
977 * typeck2.cc (array_string_literal_compatible_p): Allow
978 initializing arrays of char or unsigned char by a UTF-8 string literal.
980 2022-09-26 Marek Polacek <polacek@redhat.com>
983 * method.cc (is_convertible_helper): New.
984 (is_convertible): Use it.
985 (is_nothrow_convertible): Likewise.
987 2022-09-26 Patrick Palka <ppalka@redhat.com>
990 * module.cc (trees_in::decl_value): In the MK_partial case for
991 a variable template partial specialization, pass decl_p=true to
992 add_mergeable_specialization, and set spec to the VAR_DECL not
994 * pt.cc (add_mergeable_specialization): For a variable template
995 partial specialization, set the TREE_TYPE of the new
996 DECL_TEMPLATE_SPECIALIZATIONS node to the TREE_TYPE of the
997 VAR_DECL not the VAR_DECL itself.
999 2022-09-23 Marek Polacek <polacek@redhat.com>
1002 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONVERTIBLE
1003 and CPTK_IS_NOTHROW_CONVERTIBLE.
1004 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_CONVERTIBLE
1005 RID_IS_NOTHROW_CONVERTIBLE.
1006 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_CONVERTIBLE and
1007 CPTK_IS_NOTHROW_CONVERTIBLE.
1008 (is_convertible): Declare.
1009 (is_nothrow_convertible): Likewise.
1010 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1011 CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE.
1012 * method.cc (is_convertible): New.
1013 (is_nothrow_convertible): Likewise.
1014 * parser.cc (cp_parser_primary_expression): Handle RID_IS_CONVERTIBLE
1015 and RID_IS_NOTHROW_CONVERTIBLE.
1016 (cp_parser_trait_expr): Likewise.
1017 * semantics.cc (trait_expr_value): Handle CPTK_IS_CONVERTIBLE and
1018 CPTK_IS_NOTHROW_CONVERTIBLE.
1019 (finish_trait_expr): Likewise.
1021 2022-09-23 Marek Polacek <polacek@redhat.com>
1024 * typeck2.cc (split_nonconstant_init_1): Check TYPE_P.
1026 2022-09-22 Patrick Palka <ppalka@redhat.com>
1029 * module.cc (trees_out::decl_value): Use get_template_info in
1030 the MK_partial case to handle both VAR_DECL and TYPE_DECL.
1031 (trees_out::key_mergeable): Likewise.
1032 (trees_in::key_mergeable): Likewise.
1033 (has_definition): Consider DECL_INITIAL of a partial variable
1034 template specialization.
1035 (depset::hash::make_dependency): Handle partial variable template
1036 specializations too.
1038 2022-09-20 Patrick Palka <ppalka@redhat.com>
1040 * decl.cc (cp_finish_decl): After updating the deduced type of a
1041 VAR_DECL, also update the corresponding TEMPLATE_DECL if there
1044 2022-09-20 Patrick Palka <ppalka@redhat.com>
1047 * module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
1048 Stream PACK_EXPANSION_EXTRA_ARGS.
1049 (trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
1051 2022-09-17 Patrick Palka <ppalka@redhat.com>
1053 * module.cc (friend_from_decl_list): Don't consider
1054 CLASSTYPE_TEMPLATE_INFO for a TYPENAME_TYPE friend.
1055 (trees_in::read_class_def): Don't add to
1056 CLASSTYPE_BEFRIENDING_CLASSES for a TYPENAME_TYPE friend.
1058 2022-09-16 Patrick Palka <ppalka@redhat.com>
1061 * constexpr.cc (cxx_eval_component_reference): Check non_constant_p
1062 sooner. In C++14 or later, reject a DECL_MUTABLE_P member access
1063 only if CONSTRUCTOR_MUTABLE_POISION is also set.
1065 2022-09-16 Jason Merrill <jason@redhat.com>
1068 * parser.cc (cp_parser_omp_var_list_no_open): Pass the
1069 initial token location down.
1070 * semantics.cc (finish_omp_clauses): Check
1071 invalid_nonstatic_memfn_p.
1072 * typeck.cc (invalid_nonstatic_memfn_p): Handle null TREE_TYPE.
1074 2022-09-15 Richard Biener <rguenther@suse.de>
1076 * decl.cc (cxx_init_decl_processing): Inline last
1077 build_void_list_node call.
1078 (build_void_list_node): Remove.
1080 2022-09-14 Julian Brown <julian@codesourcery.com>
1082 * semantics.cc (finish_omp_clauses): Likewise.
1084 2022-09-13 Patrick Palka <ppalka@redhat.com>
1086 * cp-tree.h (mark_used): Remove single-parameter overload. Add
1087 default argument to the two-parameter overload.
1088 * decl2.cc (mark_used): Likewise.
1090 2022-09-13 Patrick Palka <ppalka@redhat.com>
1092 * cp-tree.h (cxx_constant_value): Define two-parameter version
1093 that omits the object parameter.
1094 * decl.cc (build_explicit_specifier): Omit NULL_TREE object
1095 argument to cxx_constant_value.
1096 * except.cc (build_noexcept_spec): Likewise.
1097 * pt.cc (expand_integer_pack): Likewise.
1098 (fold_targs_r): Likewise.
1099 * semantics.cc (finish_if_stmt_cond): Likewise.
1101 2022-09-13 Patrick Palka <ppalka@redhat.com>
1103 * decl.cc (build_explicit_specifier): Pass complain to
1105 * except.cc (build_noexcept_spec): Likewise.
1106 * pt.cc (expand_integer_pack): Likewise.
1107 (tsubst_function_decl): Propagate error_mark_node returned
1108 from build_explicit_specifier.
1110 2022-09-12 Patrick Palka <ppalka@redhat.com>
1112 * call.cc (build_conditional_expr): Adjust calls to
1113 '_sfinae'-suffixed functions.
1114 (build_temp): Likewise.
1115 (convert_like_internal): Likewise.
1116 (convert_arg_to_ellipsis): Likewise.
1117 (build_over_call): Likewise.
1118 (build_cxx_call): Likewise.
1119 (build_new_method_call): Likewise.
1120 * constexpr.cc (cxx_eval_outermost_constant_expr): Likewise.
1121 (cxx_constant_value_sfinae): Rename to ...
1122 (cxx_constant_value): ... this. Document its default arguments.
1123 (fold_non_dependent_expr): Adjust function comment.
1124 * cp-tree.h (instantiate_non_dependent_expr_sfinae): Rename to ...
1125 (instantiate_non_dependent_expr): ... this. Give its 'complain'
1126 parameter a default argument.
1127 (get_target_expr_sfinae, get_target_expr): Likewise.
1128 (require_complete_type_sfinae, require_complete_type): Likewise.
1129 (abstract_virtuals_error_sfinae, abstract_virtuals_error):
1131 (cxx_constant_value_sfinae, cxx_constant_value): Likewise.
1132 * cvt.cc (build_up_reference): Adjust calls to '_sfinae'-suffixed
1134 (ocp_convert): Likewise.
1135 * decl.cc (build_explicit_specifier): Likewise.
1136 * except.cc (build_noexcept_spec): Likewise.
1137 * init.cc (build_new_1): Likewise.
1138 * pt.cc (expand_integer_pack): Likewise.
1139 (instantiate_non_dependent_expr_internal): Adjust function
1141 (instantiate_non_dependent_expr): Rename to ...
1142 (instantiate_non_dependent_expr_sfinae): ... this. Document its
1144 (tsubst_init): Adjust calls to '_sfinae'-suffixed functions.
1145 (fold_targs_r): Likewise.
1146 * semantics.cc (finish_compound_literal): Likewise.
1147 (finish_decltype_type): Likewise.
1148 (cp_build_bit_cast): Likewise.
1149 * tree.cc (build_cplus_new): Likewise.
1150 (get_target_expr): Rename to ...
1151 (get_target_expr_sfinae): ... this. Document its default
1153 * typeck.cc (require_complete_type): Rename to ...
1154 (require_complete_type_sfinae): ... this. Document its default
1156 (cp_build_array_ref): Adjust calls to '_sfinae'-suffixed
1158 (convert_arguments): Likewise.
1159 (cp_build_binary_op): Likewise.
1160 (build_static_cast_1): Likewise.
1161 (cp_build_modify_expr): Likewise.
1162 (convert_for_initialization): Likewise.
1163 * typeck2.cc (abstract_virtuals_error): Rename to ...
1164 (abstract_virtuals_error_sfinae): ... this. Document its default
1166 (build_functional_cast_1): Adjust calls to '_sfinae'-suffixed
1169 2022-09-12 Patrick Palka <ppalka@redhat.com>
1172 * pt.cc (tsubst_template_args): Set cp_evaluated here.
1173 (tsubst_aggr_type): Not here.
1175 2022-09-12 Jason Merrill <jason@redhat.com>
1179 * decl.cc (cp_finish_decl): Call mark_single_function.
1181 2022-09-12 Jason Merrill <jason@redhat.com>
1184 * pt.cc (type_dependent_expression_p): Treat a compound
1185 literal of array-of-unknown-bound type like a variable.
1187 2022-09-12 Jason Merrill <jason@redhat.com>
1190 * lambda.cc (type_deducible_expression_p): Check
1191 array_of_unknown_bound_p.
1193 2022-09-12 Jonathan Wakely <jwakely@redhat.com>
1196 * decl2.cc (constrain_class_visibility): Adjust wording of
1197 -Wsubobject-linkage for cases where anonymous
1198 namespaces aren't used.
1199 * tree.cc (decl_anon_ns_mem_p): Now only true for actual anonymous
1200 namespace members, rename old semantics to...
1201 (decl_internal_context_p): ...this.
1202 * cp-tree.h, name-lookup.cc, pt.cc: Adjust.
1204 2022-09-08 Jonathan Wakely <jwakely@redhat.com>
1207 * class.cc (type_has_virtual_destructor): Return false for
1209 * semantics.cc (check_trait_type): Add KIND parameter to support
1210 different sets of requirements.
1211 (finish_trait_expr): Pass KIND argument for relevant traits.
1213 2022-09-08 Patrick Palka <ppalka@redhat.com>
1216 * decl2.cc (maybe_instantiate_decl): Adjust function comment.
1217 Check VAR_OR_FUNCTION_DECL_P. Pull out the disjunction into ...
1218 (mark_used): ... here, removing the decl_maybe_constant_var_p
1221 2022-09-07 Jason Merrill <jason@redhat.com>
1224 * decl.cc (grokdeclarator): Improve placeholder diagnostics.
1225 * parser.cc (cp_parser_type_id_1): Add fixit.
1227 2022-09-07 Arsen Arsenović <arsen@aarsen.me>
1231 * coroutines.cc (coro_rewrite_function_body): Ensure we have a
1232 BIND_EXPR wrapping the function body.
1234 2022-09-07 Jakub Jelinek <jakub@redhat.com>
1237 * semantics.cc (finish_omp_target_clauses): If current_function_decl
1238 isn't a nonstatic member function, don't set data.current_object to
1241 2022-09-06 Jason Merrill <jason@redhat.com>
1243 * decl.cc (grok_op_properties): Return sooner for C++23 op[].
1245 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1247 * parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
1248 in omp_cur_iteration - 1 has integer_type_node type.
1250 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1252 * pt.cc (tsubst_expr) <case OMP_ORDERED>: If OMP_BODY was NULL, keep
1253 it NULL after instantiation too.
1255 2022-09-03 Jakub Jelinek <jakub@redhat.com>
1257 * parser.cc (cp_parser_omp_clause_name): Handle doacross.
1258 (cp_parser_omp_clause_depend_sink): Renamed to ...
1259 (cp_parser_omp_clause_doacross_sink): ... this. Add depend_p
1260 argument. Handle parsing of doacross(sink:omp_cur_iteration-1). Use
1261 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1262 OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS instead
1263 of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND flag on it.
1264 (cp_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
1265 OMP_CLAUSE_DOACROSS_SOURCE instead of OMP_CLAUSE_DEPEND_SINK and
1266 OMP_CLAUSE_DEPEND_SOURCE, build OMP_CLAUSE_DOACROSS for depend(source)
1267 and set OMP_CLAUSE_DOACROSS_DEPEND on it.
1268 (cp_parser_omp_clause_doacross): New function.
1269 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
1270 (cp_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
1271 OMP_CLAUSE_DEPEND_SOURCE.
1272 (cp_parser_omp_for_loop): Don't diagnose here linear clause together
1273 with ordered with argument.
1274 (cp_parser_omp_simd): Don't diagnose ordered clause with argument on
1276 (OMP_ORDERED_DEPEND_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DOACROSS.
1277 (cp_parser_omp_ordered): Handle also doacross and adjust for it
1279 * pt.cc (tsubst_omp_clause_decl): Use
1280 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1281 OMP_CLAUSE_DEPEND_SINK_NEGATIVE.
1282 (tsubst_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
1283 (tsubst_expr): Use OMP_CLAUSE_DEPEND_INVALID instead of
1284 OMP_CLAUSE_DEPEND_SOURCE.
1285 * semantics.cc (cp_finish_omp_clause_depend_sink): Rename to ...
1286 (cp_finish_omp_clause_doacross_sink): ... this.
1287 (finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS. Don't handle
1288 OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK.
1290 2022-09-02 David Malcolm <dmalcolm@redhat.com>
1293 * cp-tree.h (class cp_expr): Add bitfield m_decimal. Clear it in
1294 existing ctors. Add ctor that allows specifying its value.
1295 (cp_expr::decimal_p): New accessor.
1296 * parser.cc (cp_parser_expression_stack_entry::flags): New field.
1297 (cp_parser_primary_expression): Set m_decimal of cp_expr when
1299 (cp_parser_binary_expression): Extract flags from token when
1300 populating stack. Call check_for_xor_used_as_pow.
1302 2022-09-01 Marek Polacek <polacek@redhat.com>
1304 * cp-tree.h (maybe_strip_ref_conversion): Remove.
1306 2022-08-30 Ulrich Drepper <drepper@gmail.com>
1308 * Make-lang.in: Add rule to rebuild std-name-hint.h from
1309 std-name-hint.gperf.
1310 * name-lookup.cc (get_std_name_hint): Remove hints array.
1311 Use gperf-generated class std_name_hint_lookup.
1312 Include "std-name-hint.h".
1313 * std-name-hint.gperf: New file.
1314 * std-name-hint.h: New file. Generated from the .gperf file.
1316 2022-08-30 Marek Polacek <polacek@redhat.com>
1319 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
1320 and RID_IS_NOTHROW_CONSTRUCTIBLE.
1322 2022-08-29 Marek Polacek <polacek@redhat.com>
1325 * decl.cc (grokdeclarator): Reverse the order of arguments to
1328 2022-08-26 Marek Polacek <polacek@redhat.com>
1331 * typeck.cc (maybe_warn_self_move): New.
1332 (cp_build_modify_expr): Call maybe_warn_self_move.
1334 2022-08-25 Marek Polacek <polacek@redhat.com>
1336 * cp-tree.h (enum cp_tree_index): Remove CTI_NULLPTR, CTI_NULLPTR_TYPE.
1337 Move it to c_tree_index.
1338 (nullptr_node): No longer define here.
1339 (nullptr_type_node): Likewise.
1340 (NULLPTR_TYPE_P): Likewise.
1341 * decl.cc (cxx_init_decl_processing): Only keep C++-specific nullptr
1342 initialization; move the shared code to c_common_nodes_and_builtins.
1344 2022-08-25 Jason Merrill <jason@redhat.com>
1346 * call.cc (unsafe_return_slot_p): Return 2 for *this in a
1349 2022-08-23 Marek Polacek <polacek@redhat.com>
1351 * typeck.cc (maybe_warn_pessimizing_move): Don't warn about
1352 redundant std::move when the expression was wrapped in { }.
1354 2022-08-17 Marek Polacek <polacek@redhat.com>
1357 * typeck.cc (can_do_rvo_p): Rename to ...
1358 (can_elide_copy_prvalue_p): ... this.
1359 (maybe_warn_pessimizing_move): Extend the
1360 -Wredundant-move warning to warn about std::move on a
1361 const-qualified object.
1363 2022-08-17 Marek Polacek <polacek@redhat.com>
1366 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Maybe suppress
1368 * typeck.cc (maybe_warn_pessimizing_move): Don't issue warnings
1369 if they are suppressed.
1370 (check_return_expr): Disable -Wpessimizing-move when returning
1371 a dependent expression.
1373 2022-08-17 Marek Polacek <polacek@redhat.com>
1376 * call.cc (build_over_call): Call maybe_warn_pessimizing_move.
1377 * cp-tree.h (maybe_warn_pessimizing_move): Declare.
1378 * decl.cc (build_aggr_init_full_exprs): Call
1379 maybe_warn_pessimizing_move.
1380 * typeck.cc (maybe_warn_pessimizing_move): Handle TREE_LIST and
1381 CONSTRUCTOR. Add a bool parameter and use it. Adjust a diagnostic
1383 (check_return_expr): Adjust the call to maybe_warn_pessimizing_move.
1385 2022-08-17 Tobias Burnus <tobias@codesourcery.com>
1386 Chung-Lin Tang <cltang@codesourcery.com>
1389 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove.
1390 * cp-tree.h (cp_omp_mappable_type, cp_omp_emit_unmappable_type_notes):
1392 * decl2.cc (cp_omp_mappable_type_1, cp_omp_mappable_type,
1393 cp_omp_emit_unmappable_type_notes): Remove.
1394 (cplus_decl_attributes): Call omp_mappable_type instead of
1396 * decl.cc (cp_finish_decl): Likewise; call cxx_incomplete_type_inform
1397 in lieu of cp_omp_emit_unmappable_type_notes.
1398 * semantics.cc (finish_omp_clauses): Likewise.
1400 2022-08-16 Tom Honermann <tom@honermann.net>
1403 * parser.cc (cp_lexer_saving_tokens): Add comment regarding
1404 diagnostic requirements.
1406 2022-08-16 Jakub Jelinek <jakub@redhat.com>
1408 * typeck.cc (cp_build_modify_expr): Implement
1409 P2327R1 - De-deprecating volatile compound operations. Don't warn
1410 for |=, &= or ^= with volatile lhs.
1411 * expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
1414 2022-08-15 Marek Polacek <polacek@redhat.com>
1417 * typeck.cc (can_do_rvo_p): New.
1418 (maybe_warn_pessimizing_move): Warn when moving a temporary object
1419 in a return statement prevents copy elision.
1421 2022-08-11 Marek Polacek <polacek@redhat.com>
1423 PR middle-end/102633
1424 * decl.cc (cp_finish_decl): Call suppress_warning.
1426 2022-08-07 Jakub Jelinek <jakub@redhat.com>
1429 * constexpr.cc (cxx_eval_store_expression): Handle REALPART_EXPR
1430 and IMAGPART_EXPR. Change ctors from releasing_vec to
1431 auto_vec<tree *>, adjust all uses. For !preeval, update ctors
1434 2022-07-31 Lewis Hyatt <lhyatt@gmail.com>
1437 * parser.cc (cp_lexer_new_main): Rename global done_lexing to
1438 override_libcpp_locations.
1440 2022-07-31 Jason Merrill <jason@redhat.com>
1443 * constexpr.cc (reduced_constant_expression_p): Return false
1444 if a CONSTRUCTOR initializes an empty field.
1446 2022-07-29 Jakub Jelinek <jakub@redhat.com>
1449 * parser.cc (cp_parser_omp_atomic): For simple cast followed by
1450 CPP_QUERY token, don't try cp_parser_binary_operation if compare
1453 2022-07-26 Marek Polacek <polacek@redhat.com>
1456 * pt.cc (redeclare_class_template): Check DECL_P before accessing
1457 DECL_SOURCE_LOCATION.
1459 2022-07-26 Jason Merrill <jason@redhat.com>
1462 * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.
1464 2022-07-25 Jason Merrill <jason@redhat.com>
1467 * class.cc (warn_hidden): Remove shortcut.
1469 2022-07-22 Patrick Palka <ppalka@redhat.com>
1472 * pt.cc (do_class_deduction): Don't consider TYPE_HAS_LIST_CTOR
1473 when setting try_list_ctor. Reset args even when try_list_ctor
1474 is true and there are no list candidates. Call resolve_args on
1475 the reset args. Rename try_list_ctor to try_list_cand.
1477 2022-07-22 Martin Liska <mliska@suse.cz>
1480 * init.cc (sort_mem_initializers): Remove continue as last stmt
1483 2022-07-21 Jason Merrill <jason@redhat.com>
1486 * decl.cc (move_fn_p): Remove assert.
1488 2022-07-21 Jason Merrill <jason@redhat.com>
1492 * method.cc (walk_field_subobs): Fix DMI in union case.
1494 2022-07-19 Patrick Palka <ppalka@redhat.com>
1499 * call.cc (enum conversion_kind): Add ck_deferred_bad enumerator.
1500 (has_next): Return false for it.
1501 (reference_binding): Return a ck_deferred_bad conversion instead
1502 of an actual bad conversion when LOOKUP_SHORTCUT_BAD_CONVS is set.
1503 Remove now obsolete early exit for the incomplete TO case.
1504 (implicit_conversion_1): Don't mask out LOOKUP_SHORTCUT_BAD_CONVS.
1505 (add_function_candidate): Set LOOKUP_SHORTCUT_BAD_CONVS iff
1507 (missing_conversion_p): Also return true for a ck_deferred_bad
1509 * cp-tree.h (LOOKUP_SHORTCUT_BAD_CONVS): Define.
1511 2022-07-19 Jonathan Wakely <jwakely@redhat.com>
1513 * cp-objcp-common.cc (names_builtin_p): Return true for
1514 RID_REF_CONSTRUCTS_FROM_TEMPORARY and
1515 RID_REF_CONVERTS_FROM_TEMPORARY.
1517 2022-07-15 Marek Polacek <polacek@redhat.com>
1520 * call.cc (ref_conv_binds_directly_p): Rename to ...
1521 (ref_conv_binds_directly): ... this. Add a new bool parameter. Change
1522 the return type to tristate.
1523 * constraint.cc (diagnose_trait_expr): Handle
1524 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1525 * cp-tree.h: Include "tristate.h".
1526 (enum cp_trait_kind): Add CPTK_REF_CONSTRUCTS_FROM_TEMPORARY
1527 and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1528 (ref_conv_binds_directly_p): Rename to ...
1529 (ref_conv_binds_directly): ... this.
1530 (ref_xes_from_temporary): Declare.
1531 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1532 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1533 * method.cc (ref_xes_from_temporary): New.
1534 * parser.cc (cp_parser_primary_expression): Handle
1535 RID_REF_CONSTRUCTS_FROM_TEMPORARY and RID_REF_CONVERTS_FROM_TEMPORARY.
1536 (cp_parser_trait_expr): Likewise.
1537 (warn_for_range_copy): Adjust to call ref_conv_binds_directly.
1538 * semantics.cc (trait_expr_value): Handle
1539 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1540 (finish_trait_expr): Likewise.
1542 2022-07-13 Patrick Palka <ppalka@redhat.com>
1545 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
1546 NULL_TREE extract_call_expr result.
1548 2022-07-13 Patrick Palka <ppalka@redhat.com>
1551 * constraint.cc (satisfy_declaration_constraints): Refine early
1552 exit test for argument dependence.
1553 * cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
1554 * pt.cc (template_class_depth): Handle TI_TEMPLATE being a
1556 (usse_outer_template_parms): Factor out constraint dependence
1558 (uses_outer_template_parms_in_constraints): ... here.
1559 (type_dependent_expression_p): Use it for FUNCTION_DECL.
1561 2022-07-07 Patrick Palka <ppalka@redhat.com>
1564 * pt.cc (template_arg_to_parm): Define.
1565 (tsubst_argument_pack): Try to reuse the corresponding
1566 ARGUMENT_PACK from 'args' when substituting into a generic
1567 ARGUMENT_PACK for a variadic template parameter.
1568 (tsubst_template_args): Move variable declarations closer to
1569 their first use. Replace 'orig_t' with 'r'. Rename 'need_new'
1570 to 'const_subst_p'. Heuristically detect if the substituted
1571 elements are identical to that of a level from 'args' and avoid
1572 allocating a new TREE_VEC if so. Add sanity check for the
1573 length of the new TREE_VEC, and remove dead ARGUMENT_PACK_P test.
1574 (tsubst_decl) <case TYPE_DECL, case VAR_DECL>: Revert
1575 r13-1045-gcb7fd1ea85feea change for avoiding substitution into
1576 DECL_TI_ARGS, but still avoid coercion in this case.
1578 2022-07-07 Jason Merrill <jason@redhat.com>
1581 * class.cc (warn_hidden): Ignore [cd]tors.
1583 2022-07-06 Lewis Hyatt <lhyatt@gmail.com>
1586 * parser.cc (cp_parser_pragma_kind): Move earlier in the file.
1587 (cp_lexer_handle_early_pragma): New function.
1588 (cp_lexer_new_main): Support parsing and handling early pragmas.
1589 (c_parse_file): Adapt to changes in cp_lexer_new_main.
1591 2022-07-06 Jason Merrill <jason@redhat.com>
1595 * parser.cc (cp_parser_lookup_name): Remove :: requirement
1596 for using unqualified lookup result.
1598 2022-07-05 Nathan Sidwell <nathan@acm.org>
1601 (struct ord_loc_info, ord_loc_traits): New.
1602 (ord_loc_tabke, ord_loc_remap): New globals.
1603 (struct location_map_info): Delete.
1604 (struct module_state_config): Rename ordinary_loc_align to
1606 (module_for_ordinary_loc): Adjust.
1607 (module_state::note_location): Note ordinary locations,
1609 (module_state::write_location): Adjust ordinary location
1611 (module_state::read_location): Likewise.
1612 (module_state::write_init_maps): Allocate ord_loc_table.
1613 (module_state::write_prepare_maps): Reimplement ordinary
1615 (module_state::read_prepare_maps): Adjust.
1616 (module_state::write_ordinary_maps): Reimplement.
1617 (module_state::write_macro_maps): Adjust.
1618 (module_state::read_ordinary_maps): Reimplement.
1619 (module_state::write_macros): Adjust.
1620 (module_state::write_config): Adjust.
1621 (module_state::read_config): Adjust.
1622 (module_state::write_begin): Adjust.
1623 (module_state::read_initial): Adjust.
1625 2022-07-04 Tobias Burnus <tobias@codesourcery.com>
1626 Chung-Lin Tang <cltang@codesourcery.com>
1627 Thomas Schwinge <thomas@codesourcery.com>
1629 * parser.cc (cp_parser_omp_target_data,
1630 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1631 cp_parser_omp_target_update): Set OMP_REQUIRES_TARGET_USED.
1632 (cp_parser_omp_requires): Remove sorry.
1634 2022-07-01 Lewis Hyatt <lhyatt@gmail.com>
1636 * parser.cc (cp_token_is_module_directive): New function
1637 refactoring common code.
1638 (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
1639 (cp_parser_skip_to_end_of_statement): Likewise.
1640 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
1641 (cp_parser_declaration): Likewise.
1643 2022-07-01 Marek Polacek <polacek@redhat.com>
1646 * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
1648 2022-07-01 Tobias Burnus <tobias@codesourcery.com>
1650 * parser.cc (cp_parser_omp_target_enter_data,
1651 cp_parser_omp_target_exit_data): Accept tofrom
1652 map-type modifier but use 'to' / 'from' internally.
1654 2022-07-01 Marek Polacek <polacek@redhat.com>
1657 * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
1658 RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
1660 2022-07-01 Jason Merrill <jason@redhat.com>
1663 * call.cc (resolve_args): Use complain.
1665 2022-07-01 Jason Merrill <jason@redhat.com>
1667 * parser.cc (missing_template_diag): Split out...
1668 (cp_parser_id_expression): ...from here.
1670 2022-07-01 Jason Merrill <jason@redhat.com>
1673 * parser.cc (missing_template_diag): Factor out...
1674 (cp_parser_id_expression): ...from here.
1675 (cp_parser_lookup_name): Don't look in dependent object_type.
1677 2022-06-30 Nathan Sidwell <nathan@acm.org>
1679 * module.cc (module_state::write_define): Drop located param.
1680 (module_state::read_define): Likewise.
1681 (module_state::prepare_macros): New, broken out of ...
1682 (module_state::write_macros): ... here. Adjust.
1683 (module_state::write_begin): Adjust.
1685 2022-06-29 Nathan Sidwell <nathan@acm.org>
1687 * module.cc (macro_info, macro_traits, macro_table,
1688 macro_remap): Rename to ...
1689 (macro_loc_info, macro_loc_traits, macro_loc_table,
1690 macro_loc_remap): ... these. Update all uses.
1691 (module_state::write_prepare_maps): Remove unneeded macro checking.
1692 (module_state::write_begin): Free macro_loc_remap.
1694 2022-06-27 Sergei Trofimovich <siarheit@google.com>
1697 * mapper-client.cc: Include <memory> via "system.h".
1698 * mapper-resolver.cc: Ditto.
1701 2022-06-27 David Malcolm <dmalcolm@redhat.com>
1703 * cxx-pretty-print.h: Add "final" and "override" to various vfunc
1704 implementations, removing redundant "virtual" as appropriate.
1705 * module.cc: Likewise.
1707 2022-06-24 Jason Merrill <jason@redhat.com>
1711 * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
1713 2022-06-24 Alexandre Oliva <oliva@adacore.com>
1715 * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
1717 2022-06-23 Jason Merrill <jason@redhat.com>
1720 * call.cc (build_aggr_conv): Don't depend on
1721 CONSTRUCTOR_IS_DESIGNATED_INIT.
1723 2022-06-23 Jason Merrill <jason@redhat.com>
1726 * decl.cc (reshape_init_array_1): Set
1727 CONSTRUCTOR_IS_DESIGNATED_INIT here.
1728 (reshape_init_class): And here.
1729 (reshape_init): Not here.
1731 2022-06-23 Patrick Palka <ppalka@redhat.com>
1734 * expr.cc (fold_for_warn): Don't fold when in an unevaluated
1737 2022-06-23 Patrick Palka <ppalka@redhat.com>
1740 * pt.cc (lookup_template_class): After calling complete_type for
1741 the substituted context, check the table again iff the type was
1742 previously incomplete and complete_type made it complete.
1744 2022-06-23 Jason Merrill <jason@redhat.com>
1747 * pt.cc (dependent_operand_p): Split out from...
1748 (tsubst_copy_and_build): ...here.
1749 (tsubst_expr) [IF_STMT]: Use it.
1750 * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
1751 condition in the template tree.
1753 2022-06-23 Jason Merrill <jason@redhat.com>
1756 * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
1757 comparison of dependent operands.
1759 2022-06-23 Nathan Sidwell <nathan@acm.org>
1761 * module.cc (struct macro_info): New.
1762 (struct macro_traits): New.
1763 (macro_remap, macro_table): New globals.
1764 (depset::hash::find_dependencies): Note namespace location.
1765 (module_for_macro_loc): Adjust.
1766 (module_state::note_location): New.
1767 (module_state::Write_location): Note location when not
1768 streaming. Adjust macro location streaming.
1769 (module_state::read_location): Adjust macro location
1771 (module_state::write_init_maps): New.
1772 (module_state::write_prepare_maps): Reimplement macro map
1774 (module_state::write_macro_maps): Reimplement.
1775 (module_state::read_macro_maps): Likewise.
1776 (module_state::write_begin): Adjust.
1778 2022-06-23 Jason Merrill <jason@redhat.com>
1780 * pt.cc (type_unification_real): An auto tparm can't
1781 be affected by other deductions.
1783 2022-06-23 Jason Merrill <jason@redhat.com>
1786 * pt.cc (type_dependent_expression_p): Look through BASELINK.
1788 2022-06-22 Jason Merrill <jason@redhat.com>
1791 * name-lookup.cc (outer_binding): Strip BASELINK.
1793 2022-06-22 Nathan Sidwell <nathan@acm.org>
1795 * module.cc (struct duplicate_hash): Remove.
1796 (duplicate_hash_map): Adjust.
1798 2022-06-22 Jason Merrill <jason@redhat.com>
1801 * constexpr.cc (cxx_eval_builtin_function_call): Handle
1802 unreachable/trap earlier.
1803 * cp-gimplify.cc (cp_maybe_instrument_return): Use
1804 build_builtin_unreachable.
1806 2022-06-18 Jakub Jelinek <jakub@redhat.com>
1808 * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
1809 flag_sanitize_trap & SANITIZE_VPTR instead of
1810 flag_sanitize_undefined_trap_on_error.
1812 2022-06-17 Jakub Jelinek <jakub@redhat.com>
1815 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
1816 instead of maybe_constant_value.
1818 2022-06-16 Nathan Sidwell <nathan@acm.org>
1820 * decl2.cc (finish_objects): Add startp parameter, adjust.
1821 (generate_ctor_or_dtor_function): Detect empty fn, and don't
1822 generate unnecessary code. Remove objc startup here ...
1823 (c_parse_final_cleanyps): ... do it here.
1825 2022-06-16 Martin Liska <mliska@suse.cz>
1827 * decl2.cc (struct priority_map_traits): Remove unused param.
1829 2022-06-15 Nathan Sidwell <nathan@acm.org>
1831 * module.cc (module_state::write_readme): Use less confusing
1832 importable unit names.
1834 2022-06-14 Nathan Sidwell <nathan@acm.org>
1836 * cp-tree.h (fini_modules): Add has_inits parm.
1837 * decl2.cc (c_parse_final_cleanups): Check for
1838 inits, adjust fini_modules flags.
1839 * module.cc (module_state): Rename call_init_p to
1841 (module_state::write_config): Write active_init.
1842 (module_state::read_config): Read it.
1843 (module_determine_import_inits): Clear active_init_p
1845 (late_finish_module): Add has_init parm. Record it.
1846 (fini_modules): Adjust.
1848 2022-06-13 Nathan Sidwell <nathan@acm.org>
1850 * module.cc (module_state::write): Separate to ...
1851 (module_state::write_begin, module_state::write_end): ...
1853 (module_state::write_readme): Drop extensions parameter.
1854 (struct module_processing_cookie): Add more fields.
1855 (finish_module_processing): Adjust state writing call.
1856 (late_finish_module): Call write_end.
1858 2022-06-10 Patrick Palka <ppalka@redhat.com>
1861 * decl.cc (typename_hasher::hash): Add extra overloads.
1862 Use iterative_hash_object instead of htab_hash_pointer.
1863 Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
1864 (build_typename_type): Use typename_hasher::hash.
1865 * pt.cc (spec_hasher::hash): Add two-parameter overload.
1866 Set comparing_specializations around the call to
1868 (iterative_hash_template_arg) <case TYPENAME_TYPE>:
1869 When comparing_specializations, hash the TYPE_CONTEXT
1870 and TYPENAME_TYPE_FULLNAME.
1871 (tsubst_function_decl): Use spec_hasher::hash instead of
1873 (tsubst_template_decl): Likewise.
1874 (tsubst_decl): Likewise.
1876 2022-06-10 Patrick Palka <ppalka@redhat.com>
1878 * pt.cc (instantiate_template): Don't substitute the context
1879 of the most general template if that of the partially
1880 instantiated template is already non-dependent.
1882 2022-06-10 Patrick Palka <ppalka@redhat.com>
1884 * pt.cc (lookup_template_class): Remove dead stores to
1885 context parameter. Don't substitute the context of the
1886 most general template if that of the partially instantiated
1887 template is already non-dependent. Check the specializations
1888 table again after completing the context of a nested dependent
1890 (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
1891 TYPE_CONTEXT or pass it to lookup_template_class.
1892 (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
1893 the TREE_TYPE for DECL_SELF_REFERENCE_P. Avoid template argument
1894 substitution or coercion in some cases.
1896 2022-06-10 Nathan Sidwell <nathan@acm.org>
1898 * cp-tree.h (fini_modules): Add some parameters.
1899 (finish_module_processing): Return an opaque pointer.
1900 * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
1901 finish_module_processing to fini_modules.
1902 * module.cc (struct module_processing_cookie): New.
1903 (finish_module_processing): Return a heap-allocated cookie.
1904 (late_finish_module): New. Finish out the module writing.
1905 (fini_modules): Adjust.
1907 2022-06-10 Nathan Sidwell <nathan@acm.org>
1909 * cp-tree.h (module_has_import_init): Rename to ...
1910 (module_determined_import_inits): ... here.
1911 * decl2.cc (start_objects): Do not handle module initializers
1913 (c_parse_final_cleanups): Generate a separate module
1914 initializer calling function and add it to the list. Shrink
1916 * module.cc (num_init_calls_needed): Delete.
1917 (module_has_import_init): Rename to ...
1918 (module_determined_import_inits): ... here. Do the
1919 calculation here ...
1920 (finish_module_processing): ... rather than here.
1921 (module_add_import_initializers): Reformat.
1923 2022-06-09 Jakub Jelinek <jakub@redhat.com>
1926 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
1927 non-integral result type use fold_ternary too like for BIT_FIELD_REFs
1928 from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
1929 expression, set *non_constant_p and return t, instead of returning
1932 2022-06-09 Nathan Sidwell <nathan@acm.org>
1934 * cp-tree.h (module_initializer_kind): Replace with ...
1935 (module_global_init_needed, module_has_import_inits): ...
1937 * decl2.cc (start_objects): Add has_body parm. Reorganize
1938 module initializer creation.
1939 (generate_ctor_or_dtor_function): Adjust.
1940 (c_parse_final_cleanups): Adjust.
1941 (vtv_start_verification_constructor_init_function): Adjust.
1942 * module.cc (module_initializer_kind): Replace with ...
1943 (module_global_init_needed, module_has_import_inits): ...
1946 2022-06-08 Jason Merrill <jason@redhat.com>
1949 * decl.cc (duplicate_decls): Change non-templated friend
1951 * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
1952 on non-templated friends.
1953 (tsubst_friend_function): Adjust.
1955 2022-06-08 Jason Merrill <jason@redhat.com>
1959 * decl.cc (duplicate_decls): Avoid copying template info
1960 from non-templated friend even if newdecl isn't a definition.
1961 Correct handling of DECL_UNIQUE_FRIEND_P on templates.
1962 * pt.cc (non_templated_friend_p): New.
1963 * cp-tree.h (non_templated_friend_p): Declare it.
1965 2022-06-08 Nathan Sidwell <nathan@acm.org>
1967 * decl2.cc (struct priority_info_s, priority_info): Delete.
1968 (priority_map_traits, priority_map_t): New.
1969 (static_init_fini_fns): New.
1970 (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
1971 (initialize_p_decl, priority_decl): Delete.
1972 (ssdf_decls, priority_info_map): Delete.
1973 (start_static_storage_duration_function): Rename to ...
1974 (start_partial_init_fini_fn): ... here. Create a void arg fn.
1975 Add it to the slot in the appropriate static_init_fini_fns
1977 (finish_static_storage_duration_function): Rename to ...
1978 (finish_partial_init_fini_fn): ... here.
1979 (get_priority_info): Delete.
1980 (one_static_initialization_or_destruction): Assert not
1982 (do_static_initialization_or_destruction): Rename to ...
1983 (emit_partial_init_fini_fn) ... here. Start & finish the fn.
1984 Simply init/fini each var.
1985 (partition_vars_for_init_fini): Partition vars according to
1986 priority and add to init and/or fini list.
1987 (generate_ctor_or_dtor_function): Start and finish the function.
1988 Do santitizer calls here.
1989 (generate_ctor_and_dtor_functions_for_priority): Delete.
1990 (c_parse_final_cleanups): Reimplement global init/fini
1993 2022-06-07 Jakub Jelinek <jakub@redhat.com>
1995 * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
1996 style linear clause modifiers. Set
1997 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
1998 old style modifiers are used.
1999 * semantics.cc (finish_omp_clauses): Only reject linear clause
2000 with val modifier on simd or for if the old style modifiers are
2003 2022-06-07 Roger Sayle <roger@nextmovesoftware.com>
2006 * decl.cc (start_enum): When emitting a "must be integral" error,
2007 set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
2008 downstream in build_enumeration.
2010 2022-06-06 Patrick Palka <ppalka@redhat.com>
2014 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
2015 ADDR_EXPR callee when calling mark_used.
2017 2022-06-04 Marek Polacek <polacek@redhat.com>
2021 * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
2022 followed by [[]] attributes and vice versa.
2024 2022-06-03 Patrick Palka <ppalka@redhat.com>
2027 * typeck.cc (cp_build_binary_op): Don't fold operands
2028 when c_inhibit_evaluation_warnings.
2030 2022-06-03 Jason Merrill <jason@redhat.com>
2033 * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
2034 from a hidden friend.
2036 2022-06-03 Patrick Palka <ppalka@redhat.com>
2039 * tree.cc (maybe_dummy_object): When returning a dummy
2040 object, respect the cv-quals of 'this' if available.
2042 2022-06-03 Patrick Palka <ppalka@redhat.com>
2045 * pt.cc (determine_specialization): Compare overall constraints
2046 not just the trailing constraints.
2047 (tsubst_each_template_parm_constraints): Define.
2048 (tsubst_friend_function): Use it.
2049 (tsubst_friend_class): Use it.
2050 (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
2052 2022-06-03 Patrick Palka <ppalka@redhat.com>
2055 * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
2056 Don't walk DECL_CONTEXT.
2057 <case PARM_DECL>: Likewise. Walk TREE_TYPE.
2058 <case CONST_DECL>: Simplify.
2059 (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
2061 2022-06-02 Marek Polacek <polacek@redhat.com>
2063 * constexpr.cc (potential_constant_expression_1): Treat
2064 {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
2066 2022-06-02 Marek Polacek <polacek@redhat.com>
2069 * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
2072 2022-06-02 David Malcolm <dmalcolm@redhat.com>
2074 * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
2075 (cp_get_sarif_source_language): New.
2077 2022-06-02 Jason Merrill <jason@redhat.com>
2080 * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
2081 (cxx_eval_store_expression): Likewise.
2082 (cxx_eval_bare_aggregate): Handle null ctx->ctor.
2084 2022-06-02 Jason Merrill <jason@redhat.com>
2087 * constexpr.cc (cxx_eval_bare_aggregate): Always call
2090 2022-06-01 Jason Merrill <jason@redhat.com>
2093 * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
2094 if the expression has auto type.
2096 2022-06-01 Jason Merrill <jason@redhat.com>
2099 * call.cc (resolve_args): Call mark_single_function here.
2100 * pt.cc (unify_one_argument): Not here.
2102 2022-06-01 Nathan Sidwell <nathan@acm.org>
2104 * decl2.cc (fix_temporary_vars_context_r): Use data argument
2106 (one_static_initialization_or_destruction): Adjust tree walk
2107 call. Refactor guard generation.
2109 2022-06-01 Nathan Sidwell <nathan@acm.org>
2111 * decl2.cc (ssdf_decl): Delete global.
2112 (start_static_storage_duration_function): Use some RAII.
2113 (do_static_initialization_or_destruction): Likewise.
2114 (c_parse_final_cleanups): Likewise. Avoid rechecking 'vars'.
2116 2022-06-01 Nathan Sidwell <nathan@acm.org>
2118 * decl2.cc (start_objects): Replace 'method_type' parameter
2119 with 'initp' boolean, rename and retype 'priority' parameter.
2120 (finish_objects): Likewise. Do not expand here.
2121 (one_static_initialization_or_destruction): Move 'initp'
2123 (do_static_initialization_or_destruction): Likewise.
2124 (generate_ctor_or_dtor_function): Rename 'initp' parameter.
2125 Adjust start_objects/finish_obects calls and expand here.
2126 (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
2127 (c_parse_final_cleanups): Likewise.
2128 (vtv_start_verification_constructor_init): Adjust.
2129 (vtv_finish_verification_constructor_init): Use finish_objects.
2131 2022-05-31 Patrick Palka <ppalka@redhat.com>
2134 * call.cc (build_over_call): Use z_candidate::conversion_path
2135 and ::access_path instead of TYPE_BINFO when building the
2136 BASELINK for the templated form.
2138 2022-05-31 Patrick Palka <ppalka@redhat.com>
2140 * parser.cc: Use auto_timevar instead of timevar_push/pop.
2141 Remove wrapper functions.
2144 2022-05-31 Patrick Palka <ppalka@redhat.com>
2146 * cp-tree.h (cp_build_qualified_type_real): Rename to ...
2147 (cp_build_qualified_type): ... this. Give its last parameter
2148 a default argument. Remove macro of the same name.
2149 * decl.cc (grokdeclarator): Adjust accordingly.
2150 * pt.cc (tsubst_aggr_type): Likewise.
2151 (rebuild_function_or_method_type): Likewise.
2153 (maybe_dependent_member_ref): Likewise.
2155 * tree.cc (cp_build_qualified_type_real): Rename to ...
2156 (cp_build_qualified_type): ... this. Adjust accordingly.
2158 2022-05-31 Jason Merrill <jason@redhat.com>
2160 * Make-lang.in (c++.tags): Just look at *.cc.
2162 2022-05-31 Patrick Palka <ppalka@redhat.com>
2164 * cp-tree.h (comp_template_args): Change return type to bool.
2165 * pt.cc (comp_template_args): Document default arguments.
2166 Change return type to bool and adjust returns accordingly.
2168 2022-05-31 Patrick Palka <ppalka@redhat.com>
2170 * decl.cc (grokvardecl): Use current_template_constraints.
2171 (grokdeclarator): Likewise.
2172 (xref_tag): Likewise.
2173 * semantics.cc (finish_template_template_parm): Likewise.
2175 2022-05-31 Jakub Jelinek <jakub@redhat.com>
2177 * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
2180 2022-05-30 Marek Polacek <polacek@redhat.com>
2183 * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
2184 * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
2187 2022-05-28 Jakub Jelinek <jakub@redhat.com>
2189 * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
2190 seen first, use "%<to%>" or "%<enter%>" depending on
2191 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
2192 "%<to%> or %<enter%>" wording.
2194 2022-05-28 Jason Merrill <jason@redhat.com>
2197 * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
2198 instantiate into a class-scope lambda.
2200 2022-05-27 Marek Polacek <polacek@redhat.com>
2203 * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
2205 2022-05-27 Jakub Jelinek <jakub@redhat.com>
2207 * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
2208 (cp_parser_omp_all_clauses): For to clause on declare target, use
2209 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
2210 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
2211 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
2212 (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
2213 OMP_CLAUSE_TO_DECLARE.
2214 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
2215 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
2216 name in diagnostics instead of
2217 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
2219 2022-05-26 Marek Polacek <polacek@redhat.com>
2222 * typeck.cc (warn_for_null_address): Improve the warning when
2223 the POINTER_PLUS_EXPR's base is of reference type.
2225 2022-05-26 Patrick Palka <ppalka@redhat.com>
2228 * decl.cc (shadow_tag): Use the return value of
2229 maybe_process_partial_specialization.
2230 * parser.cc (cp_parser_single_declaration): Call shadow_tag
2231 before associate_classtype_constraints.
2232 * pt.cc (maybe_new_partial_specialization): Change return type
2233 to bool. Take 'type' argument by mutable reference. Set 'type'
2234 to point to the correct constrained specialization when
2236 (maybe_process_partial_specialization): Adjust accordingly.
2238 2022-05-25 Marek Polacek <polacek@redhat.com>
2241 * cp-tree.h (attr_chainon): Declare.
2242 * decl.cc (start_decl): Use attr_chainon.
2243 (grokdeclarator): Likewise.
2244 * parser.cc (cp_parser_statement): No longer static.
2246 2022-05-25 Jason Merrill <jason@redhat.com>
2249 * pt.cc (build_template_decl): Add assert.
2250 (tsubst_function_decl): Don't return a template.
2252 2022-05-25 Jason Merrill <jason@redhat.com>
2255 * decl2.cc (mark_used): Copy type from fn to BASELINK.
2256 * pt.cc (unify_one_argument): Call mark_single_function.
2258 2022-05-25 Jason Merrill <jason@redhat.com>
2260 * constexpr.cc (cxx_eval_call_expression): Check for
2261 heap vars in the result.
2263 2022-05-25 Jason Merrill <jason@redhat.com>
2265 * constexpr.cc (maybe_constant_init_1): Only pass false for
2266 strict when initializing a variable of static duration.
2268 2022-05-25 Marek Polacek <polacek@redhat.com>
2271 * typeck2.cc (potential_prvalue_result_of): New.
2272 (replace_placeholders_for_class_temp_r): New.
2273 (digest_nsdmi_init): Call it.
2275 2022-05-24 Jason Merrill <jason@redhat.com>
2277 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
2278 (cxx_eval_call_expression): Call it.
2279 (cxx_fold_indirect_ref_1): Handle null empty_base.
2281 2022-05-24 Jason Merrill <jason@redhat.com>
2283 * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
2284 from int to value_cat. Change most false to vc_prvalue, most true
2285 to vc_glvalue, cases where the return value is ignored to
2287 (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
2288 (cxx_eval_store_expression): Only build _REF for vc_glvalue.
2289 (cxx_eval_array_reference, cxx_eval_component_reference)
2290 (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
2292 2022-05-24 Jason Merrill <jason@redhat.com>
2295 * constexpr.cc (cxx_eval_store_expression): Adjust assert.
2296 Use initialized_type.
2298 2022-05-24 Patrick Palka <ppalka@redhat.com>
2300 * cp-tree.h (any_template_arguments_need_structural_equality_p):
2302 * pt.cc (struct ctp_hasher): Define.
2303 (ctp_table): Define.
2304 (canonical_type_parameter): Use it.
2305 (process_template_parm): Set TYPE_CANONICAL for
2306 TEMPLATE_TEMPLATE_PARM too.
2307 (lookup_template_class_1): Remove now outdated comment for the
2308 any_template_arguments_need_structural_equality_p test.
2309 (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
2310 clear TYPE_CANONICAL for ttps. Set TYPE_CANONICAL on the
2311 substituted type later.
2312 (any_template_arguments_need_structural_equality_p): Return
2313 true for any_targ_node. Don't return true just because a
2314 template argument uses structural equality. Add comment for
2315 the PARM_DECL special case.
2316 (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
2318 * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
2320 * typeck.cc (structural_comptypes) [check_alias]: Increment
2321 processing_template_decl before checking
2322 dependent_alias_template_spec_p.
2324 2022-05-24 Jakub Jelinek <jakub@redhat.com>
2327 * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
2329 2022-05-20 David Malcolm <dmalcolm@redhat.com>
2331 * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
2332 "final" and "override".
2333 * error.cc: Likewise.
2335 2022-05-18 Marek Polacek <polacek@redhat.com>
2338 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
2340 2022-05-17 Jason Merrill <jason@redhat.com>
2343 * decl.cc (check_initializer): Use build_cplus_new in case of
2346 2022-05-17 Jakub Jelinek <jakub@redhat.com>
2348 * parser.cc (cp_parser_omp_clause_depend): Parse
2349 inoutset depend-kind.
2350 (cp_parser_omp_depobj): Likewise.
2351 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
2352 OMP_CLAUSE_DEPEND_INOUTSET.
2354 2022-05-16 Martin Liska <mliska@suse.cz>
2356 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
2357 * name-lookup.cc (get_std_name_hint): Likewise.
2358 * parser.cc (cp_parser_new): Likewise.
2360 2022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
2362 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
2363 * semantics.cc (finish_omp_clauses): Added template decl processing.
2365 2022-05-15 Jason Merrill <jason@redhat.com>
2369 * friend.cc (is_friend): Hidden friends count as members.
2370 * search.cc (friend_accessible_p): Likewise.
2372 2022-05-15 Jason Merrill <jason@redhat.com>
2374 * parser.cc (cp_parser_template_name): Look through
2375 injected-class-name.
2377 2022-05-15 Jason Merrill <jason@redhat.com>
2382 * init.cc (build_value_init): Handle class in template.
2384 2022-05-13 Nathan Sidwell <nathan@acm.org>
2386 * mangle.cc (maybe_write_module): Check external linkage.
2388 2022-05-13 Richard Biener <rguenther@suse.de>
2390 * constexpr.cc: Remove gimple-fold.h include.
2392 2022-05-12 Patrick Palka <ppalka@redhat.com>
2394 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
2395 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
2396 * pt.cc (try_class_unification): Correctly copy multidimensional
2397 targs. Free the copy of targs.
2398 (unify_pack_expansion): Fix level comparison.
2400 2022-05-12 Nathan Sidwell <nathan@acm.org>
2402 * parser.cc (cp_parser_linkage_specification): Implement
2403 global module attachment semantics.
2405 2022-05-12 Jakub Jelinek <jakub@redhat.com>
2407 * lex.cc (init_reswords): Register omp_all_memory as keyword
2409 * parser.cc (cp_parser_primary_expression): Diagnose uses of
2410 omp_all_memory in postfix expressions.
2411 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
2413 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
2414 keyword in depend clause as null_pointer_node, diagnose invalid
2416 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
2418 2022-05-11 Patrick Palka <ppalka@redhat.com>
2420 * constraint.cc (tsubst_parameter_mapping): Convert loop over
2421 TREE_VEC into a range-based for loop using tree_vec_range.
2422 * pt.cc (iterative_hash_template_arg): Likewise.
2423 (template_parms_level_to_args): Likewise.
2424 (deducible_template_args): Likewise.
2425 (check_undeduced_parms): Likewise.
2426 (dependent_type_p_r): Likewise.
2427 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
2429 (dependent_template_arg_p): Likewise.
2430 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
2433 2022-05-11 Jason Merrill <jason@redhat.com>
2436 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
2437 * parser.cc (cp_parser_enclosed_template_argument_list):
2438 Use 0-length TREE_VEC for <>.
2440 2022-05-11 Jason Merrill <jason@redhat.com>
2443 * typeck.cc (check_return_expr): Don't mess with ctor return value
2444 while parsing a template.
2446 2022-05-11 Nathan Sidwell <nathan@acm.org>
2448 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
2449 (struct lang_decl_base): Add module_attach_p flag.
2450 * decl.cc (duplicate_decls): Rework module redeclaration
2452 * module.cc (trees_out::lang_decl_bools): Write attach flag.
2453 (trees_in::lang_decl_bools): ... and read it back.
2454 (trees_out::decl_value): Rework module attachment handling.
2455 (trees_in::decl_value): Rename local var to reflect meaning.
2456 (trees_in::key_mergeable): Likewise.
2457 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
2458 to special-case mangling.
2459 (module_may_redeclare): Reimplement.
2460 (set_originating_module): Deal with attachment.
2461 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
2463 (mergeable_namespace_slots): Likewise.
2464 (do_nonmember_using_decl): Likewise.
2465 * name-lookup.h (mergeable_namespace_slots): Adjust parm
2467 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
2469 2022-05-11 Martin Liska <mliska@suse.cz>
2472 * lang-specs.h: Use Separate syntax.
2474 2022-05-10 Patrick Palka <ppalka@redhat.com>
2476 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
2477 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
2478 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
2479 (SET_ARGUMENT_PACK_ARGS): Remove.
2480 * module.cc (trees_in::tree_node): Adjust accordingly.
2481 * parser.cc (make_char_string_pack): Likewise.
2482 (make_string_pack): Likewise.
2483 * pt.cc (make_pack_expansion): Likewise.
2484 (template_parm_to_arg): Likewise.
2485 (coerce_template_parameter_pack): Likewise.
2486 (extract_fnparm_pack): Likewise.
2487 (extract_locals_r): Likewise.
2488 (make_argument_pack): Likewise.
2489 (tsubst_argument_pack): Likewise.
2490 (lookup_init_capture_pack): Likewise.
2491 (type_unification_real): Likewise.
2492 (unify_pack_expansion): Likewise.
2493 (tsubst_initializer_list): Likewise.
2495 2022-05-10 Patrick Palka <ppalka@redhat.com>
2497 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
2498 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
2499 (SET_PACK_EXPANSION_PATTERN): Likewise.
2500 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
2501 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
2502 (PACK_EXPANSION_LOCAL_P): Likewise.
2503 (PACK_EXPANSION_SIZEOF_P): Likewise.
2504 (PACK_EXPANSION_AUTO_P): Likewise.
2505 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
2506 (ARGUMENT_PACK_CHECK): Define.
2507 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
2508 (SET_ARGUMENT_PACK_ARGS): Likewise.
2509 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
2510 before setting PACK_EXPANSION_SIZEOF_P.
2512 2022-05-10 Nathan Sidwell <nathan@acm.org>
2514 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
2515 attach, named module vs header-unit.
2516 (global_purview_p, not_module_p): Delete.
2517 (named_module_p): New.
2518 (header_module_p, module_purview_p): Adjust.
2519 (module_attach_p, named_module_purview_p): New.
2520 * decl.cc (duplicate_decls): Adjust.
2521 * module.cc (declare_module, preprocessed_module): Adjust.
2522 * name-lookup.cc (init_global_partition): Adjust.
2523 (get_fixed_binding_slot, pushdecl): Adjust.
2524 * parser.cc (cp_parser_module_declaration): Adjust.
2525 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
2527 2022-05-10 Jason Merrill <jason@redhat.com>
2530 * decl.cc (maybe_return_this): Replace...
2531 (finish_constructor_body, finish_destructor_body): ...these.
2532 (finish_function_body): Call it.
2533 * optimize.cc (build_delete_destructor_body): Call it.
2534 * cp-tree.h (maybe_return_this): Declare.
2536 2022-05-09 Marek Polacek <polacek@redhat.com>
2539 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
2540 Create a modifiable copy. Allow labels at the end of compound
2543 2022-05-09 Patrick Palka <ppalka@redhat.com>
2546 * call.cc (field_in_pset): Adjust after next_initializable_field
2548 (build_aggr_conv): Likewise.
2549 (convert_like_internal): Likewise.
2550 (type_has_extended_temps): Likewise.
2551 * class.cc (default_init_uninitialized_part): Likewise.
2552 (finish_struct): Likewise.
2553 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
2554 (reduced_constant_expression_p): Use next_subobject_field
2556 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
2557 next_initializable_field renaming.
2558 (fold_builtin_source_location): Likewise.
2559 * cp-tree.h (next_initializable_field): Rename to ...
2560 (next_aggregate_field): ... this.
2561 (next_subobject_field): Declare.
2562 * decl.cc (next_aggregate_field): Renamed from ...
2563 (next_initializable_field): ... this. Skip over vptr fields
2565 (next_subobject_field): Define.
2566 (reshape_init_class): Adjust after next_initializable_field
2568 * init.cc (build_value_init_noctor): Likewise.
2569 (emit_mem_initializers): Likewise.
2570 * lambda.cc (build_capture_proxy): Likewise.
2571 * method.cc (build_comparison_op): Likewise.
2572 * pt.cc (maybe_aggr_guide): Likewise.
2573 * tree.cc (structural_type_p): Likewise.
2574 * typeck2.cc (split_nonconstant_init_1): Likewise.
2575 (digest_init_r): Likewise.
2577 2022-05-09 Nathan Sidwell <nathan@acm.org>
2579 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
2580 DECL_MODULE_ATTACHMENTS_P.
2581 (struct lane_decl_base): Rename module_attached_p to
2582 module_keyed_decls_p.
2583 (maybe_key_decl): Renamed from maybe_attach_decl.
2584 * lambda.cc (record_lambda_scope): Adjust.
2585 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
2586 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
2588 (enum merge_kind): Rename MK_attached to MK_keyed.
2589 (trees_out::lang_decl_bools): Adjust.
2590 (trees_in::lang_decl_bools): Adjust.
2591 (trees_in::decl_value): Adjust.
2592 (trees_out::get_merge_kind): Adjust.
2593 (trees_out::key_mergeable): Adjust.
2594 (trees_in::key_mergeable): Adjust.
2595 (maybe_key_decl): Rename from maybe_attach_decl.
2596 (direct_import): Adjust.
2597 (fini_modules): Adjust.
2599 2022-05-09 Martin Liska <mliska@suse.cz>
2601 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
2603 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
2604 (cp_finalize_oacc_routine): Likewise.
2606 2022-05-07 Marek Polacek <polacek@redhat.com>
2610 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
2612 2022-05-06 Jason Merrill <jason@redhat.com>
2614 * error.cc (decl_to_string): Add show_color parameter.
2615 (subst_to_string): Likewise.
2616 (cp_printer): Pass it.
2617 (type_to_string): Set pp_show_color.
2618 (dump_function_name): Use "fnname" color.
2619 (dump_template_bindings): Use "targs" color.
2620 (struct colorize_guard): New.
2621 (reinit_cxx_pp): Clear pp_show_color.
2623 2022-05-06 Jason Merrill <jason@redhat.com>
2627 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
2630 2022-05-05 Marek Polacek <polacek@redhat.com>
2633 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
2634 a vector of parameters that haven't been pushed yet. Push them at the
2635 end of a valid parameter-declaration-clause.
2636 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
2637 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
2638 would result in a hard error.
2639 (cp_parser_cache_defarg): Adjust the call to
2640 cp_parser_parameter_declaration_list.
2642 2022-05-05 Richard Biener <rguenther@suse.de>
2644 * module.cc (trees_in::core_vals): Remove separate allocation
2647 2022-05-04 Jason Merrill <jason@redhat.com>
2650 * pt.cc (maybe_dependent_member_ref): Handle types.
2651 (tsubst, tsubst_copy): Use it.
2652 (tsubst_aggr_type, instantiate_alias_template): Don't handle
2655 2022-05-04 Patrick Palka <ppalka@redhat.com>
2658 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
2659 partially instantiating the guide's parameter list.
2661 2022-05-04 Marek Polacek <polacek@redhat.com>
2664 * parser.cc (cp_parser_init_declarator): Properly handle a series of
2665 operator() calls, they are not part of an init-declarator.
2667 2022-05-04 Jason Merrill <jason@redhat.com>
2669 * decl.cc (reshape_init): Shortcut already-reshaped init.
2670 (reshape_init_class): Assert not getting one here.
2672 2022-05-04 Jason Merrill <jason@redhat.com>
2674 * error.cc (cp_print_error_function): Use %qD.
2675 (function_category): Use %qD.
2677 2022-05-04 Marek Polacek <polacek@redhat.com>
2680 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
2681 return true for CPP_GREATER_EQ.
2683 2022-05-04 Jason Merrill <jason@redhat.com>
2685 * cp-tree.h (struct language_function): Remove x_cdtor_label.
2686 (cdtor_label, LABEL_DECL_CDTOR): Remove.
2687 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
2688 (cxx_eval_constant_expression): Don't call returns.
2689 * decl.cc (check_goto): Don't check cdtor_label.
2690 (start_preparsed_function): And don't set it.
2691 (finish_constructor_body, finish_destructor_body): Remove.
2692 (finish_function_body): Don't call them.
2693 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
2694 * semantics.cc (finish_return_stmt): Not here.
2696 2022-05-04 Jakub Jelinek <jakub@redhat.com>
2698 * lambda.cc: Include decl.h.
2699 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
2700 UNAVAILABLE_DEPRECATED_SUPPRESS.
2702 2022-05-03 Patrick Palka <ppalka@redhat.com>
2705 * cp-tree.h (finish_non_static_data_member): Add defaulted
2707 * pt.cc (tsubst_copy_and_build): Pass complain to
2708 finish_non_static_data_member.
2709 * semantics.cc (finish_non_static_data_member): Respect complain
2711 (finish_qualified_id_expr): Pass complain to
2712 finish_non_static_data_member.
2714 2022-05-02 Jason Merrill <jason@redhat.com>
2716 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
2717 (do_auto_deduction): Use expr location.
2719 2022-05-02 Jason Merrill <jason@redhat.com>
2721 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
2722 classes. Remember location of use.
2723 (note_name_declared_in_class): Adjust.
2725 2022-05-02 Marek Polacek <polacek@redhat.com>
2727 * cp-tree.h (uses_template_parms): Adjust declaration.
2728 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
2730 2022-05-02 Richard Biener <rguenther@suse.de>
2732 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
2733 * cp-gimplify.cc (cp_fold): Likewise.
2734 * pt.cc (tsubst_copy): Likewise.
2736 2022-04-29 Jason Merrill <jason@redhat.com>
2740 * friend.cc (do_friend): Call check_explicit_specialization here.
2741 * decl.cc (grokdeclarator): Not here.
2742 * decl2.cc (check_classfn): Or here.
2744 2022-04-29 Jason Merrill <jason@redhat.com>
2747 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
2748 * pt.cc (tsubst_aggr_type): Check it.
2749 (tsubst_baselink, tsubst_copy): Check it.
2750 (maybe_dependent_member_ref): Check it.
2751 (instantiate_alias_template): Handle it.
2752 (build_deduction_guide): Set it.
2754 2022-04-29 Jason Merrill <jason@redhat.com>
2757 * lambda.cc (type_deducible_expression_p): Allow more types.
2759 2022-04-29 Jason Merrill <jason@redhat.com>
2761 * decl.cc (cp_finish_decl): Only consider auto for vars.
2763 2022-04-29 Marek Polacek <polacek@redhat.com>
2766 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
2767 only when it's followed by a semicolon.
2769 2022-04-29 Jason Merrill <jason@redhat.com>
2772 * decl.cc (cp_finish_decl): Check completeness of deduced type.
2774 2022-04-29 Jason Merrill <jason@redhat.com>
2777 * error.cc (dump_decl) [USING_DECL]: Respect flags.
2779 2022-04-29 Jason Merrill <jason@redhat.com>
2781 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
2783 2022-04-29 Jakub Jelinek <jakub@redhat.com>
2786 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
2787 after a type id by setting maybe_type_id and aborting tentative
2789 (cp_parser_enclosed_template_argument_list): Handle
2790 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
2791 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
2792 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
2793 (cp_parser_next_token_ends_template_argument_p): Return true
2794 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
2796 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
2799 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
2800 temporaries to coroutine frame copies.
2802 2022-04-29 Jason Merrill <jason@redhat.com>
2804 * semantics.cc (check_trait_type): Don't check completeness
2805 of element type of array of unknown bound.
2807 2022-04-29 Jason Merrill <jason@redhat.com>
2811 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
2812 (emit_tinfo_decl): Update tdesc type if needed.
2814 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
2817 * call.cc (extract_call_expr): Return a NULL_TREE on failure
2818 instead of asserting.
2819 (build_new_method_call): Suppress -Wparentheses diagnostic for
2821 * semantics.cc (is_assignment_op_expr_p): Add function to check
2822 if an expression is a call to an op= operator expression.
2823 (maybe_convert_cond): Handle the case of a op= operator expression
2824 for the -Wparentheses diagnostic.
2826 2022-04-28 Patrick Palka <ppalka@redhat.com>
2829 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
2830 DEPENDENT_OPERATOR_TYPE like an empty type.
2832 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
2835 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
2836 non-target expression inputs.
2838 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
2841 * coroutines.cc (coro_promise_type_found_p): Account for possible
2842 mutliple overloads of the promise return_value() method.
2844 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
2847 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
2848 are added to the bind expr.
2849 (add_var_to_bind): Fix local var naming to use portable punctuation.
2850 (register_local_var_uses): Do not add synthetic names to unnamed
2853 2022-04-28 Nathan Sidwell <nathan@acm.org>
2854 Iain Sandoe <iain@sandoe.co.uk>
2857 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
2858 coroutine expressions at template definition time.
2859 (finish_co_yield_expr): Likewise.
2860 (finish_co_return_stmt): Likewise.
2862 2022-04-28 Marek Polacek <polacek@redhat.com>
2865 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
2868 2022-04-27 Jason Merrill <jason@redhat.com>
2870 * tree.cc (strip_typedefs): Add default argument comments.
2872 2022-04-27 Marek Polacek <polacek@redhat.com>
2875 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
2877 2022-04-26 Jason Merrill <jason@redhat.com>
2880 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
2881 TEMPLATE_TYPE_PARAMETER_PACK on auto.
2883 2022-04-26 Patrick Palka <ppalka@redhat.com>
2886 * semantics.cc (finish_decltype_type): Pass tf_decltype to
2887 instantiate_non_dependent_expr_sfinae.
2889 2022-04-26 Jason Merrill <jason@redhat.com>
2892 * pt.cc (check_for_bare_parameter_packs): Check for lambda
2893 function parameter pack.
2895 2022-04-26 Patrick Palka <ppalka@redhat.com>
2899 * pt.cc (process_partial_specialization): Downgrade "partial
2900 specialization isn't more specialized" diagnostic from permerror
2901 to an on-by-default pedwarn.
2902 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
2903 NTTP type a second time, use the original type not the
2906 2022-04-25 Marek Polacek <polacek@redhat.com>
2909 * typeck.cc (build_x_shufflevector): Use
2910 instantiation_dependent_expression_p except for the first two
2913 2022-04-21 Marek Polacek <polacek@redhat.com>
2915 * constexpr.cc (cxx_eval_logical_expression): Remove unused
2917 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
2918 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
2920 2022-04-21 Marek Polacek <polacek@redhat.com>
2923 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
2924 to cxx_eval_constant_expression.
2926 2022-04-20 Ed Catmur <ed@catmur.uk>
2929 * call.cc (compare_ics): When comparing list-initialization
2930 sequences, do not return early.
2932 2022-04-19 Jakub Jelinek <jakub@redhat.com>
2935 * typeck2.cc (process_init_constructor_array,
2936 process_init_constructor_record, process_init_constructor_union): Move
2937 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
2938 containing CONSTRUCTOR.
2940 2022-04-15 Marek Polacek <polacek@redhat.com>
2943 * parser.cc (cp_parser_placeholder_type_specifier): Return
2944 error_mark_node when trying to build up a constrained parameter in
2947 2022-04-15 Jason Merrill <jason@redhat.com>
2950 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
2952 2022-04-15 Jason Merrill <jason@redhat.com>
2955 * error.cc (dump_expr): Handle USING_DECL.
2956 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
2958 2022-04-14 Jason Merrill <jason@redhat.com>
2961 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
2962 checks for defaulted ctors.
2964 2022-04-14 Jason Merrill <jason@redhat.com>
2967 * lambda.cc (type_deducible_expression_p): New.
2968 (lambda_capture_field_type): Check it.
2970 2022-04-14 Jason Merrill <jason@redhat.com>
2973 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
2975 2022-04-14 Jason Merrill <jason@redhat.com>
2978 * name-lookup.cc (dependent_local_decl_p): New.
2979 * cp-tree.h (dependent_local_decl_p): Declare.
2980 * semantics.cc (finish_call_expr): Use it.
2981 * pt.cc (tsubst_arg_types): Also substitute default args
2984 2022-04-14 Jason Merrill <jason@redhat.com>
2987 * pt.cc (tsubst_baselink): Also check dependent optype.
2989 2022-04-14 Jason Merrill <jason@redhat.com>
2992 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
2993 * init.cc (perform_member_init): Likewise.
2994 * semantics.cc (push_cleanup): Adjust comment.
2996 2022-04-13 Jason Merrill <jason@redhat.com>
3000 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
3001 as needed in empty base handling.
3003 2022-04-13 Jakub Jelinek <jakub@redhat.com>
3006 * decl2.cc (cp_check_const_attributes): For aligned attribute
3007 pass manifestly_const_eval=true to fold_non_dependent_expr.
3009 2022-04-13 Marek Polacek <polacek@redhat.com>
3012 * call.cc (direct_reference_binding): strip_top_quals when creating
3015 2022-04-12 Jason Merrill <jason@redhat.com>
3018 * decl.cc (decls_match): Compare versions even if not recording.
3019 (duplicate_decls): Propagate attributes to alias.
3020 * decl2.cc (find_last_decl): Give up if versioned.
3022 2022-04-12 Jason Merrill <jason@redhat.com>
3025 * init.cc (build_new_1): Check array_p for alignment.
3027 2022-04-12 Patrick Palka <ppalka@redhat.com>
3030 * pt.cc (build_extra_args): Call preserve_args.
3032 2022-04-12 Jason Merrill <jason@redhat.com>
3035 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
3037 2022-04-12 Jason Merrill <jason@redhat.com>
3041 * class.cc (finish_struct): Always using op=.
3043 2022-04-11 Jason Merrill <jason@redhat.com>
3046 * call.cc (build_operator_new_call): Just look in ::.
3048 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3050 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
3053 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3055 * semantics.cc (set_cleanup_locs): Propagate locus to call
3056 wrapped in cast-to-void.
3058 2022-04-11 Jason Merrill <jason@redhat.com>
3061 * init.cc (warn_placement_new_too_small): Check deref.
3063 2022-04-09 Jason Merrill <jason@redhat.com>
3067 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
3068 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
3069 for non-aggregate types.
3070 (build_vec_init_expr): Also check constancy of explicit
3071 initializer elements.
3073 2022-04-09 Jason Merrill <jason@redhat.com>
3077 * name-lookup.cc (set_decl_namespace): Set
3078 DECL_IMPLICIT_INSTANTIATION if no non-template match.
3079 * pt.cc (check_explicit_specialization): Check it.
3080 * decl2.cc (check_classfn): Call it.
3082 2022-04-07 Patrick Palka <ppalka@redhat.com>
3085 * name-lookup.cc (name_lookup::using_queue): Change to an
3086 auto_vec (with 16 elements of internal storage).
3087 (name_lookup::queue_namespace): Change return type to void,
3088 take queue parameter by reference and adjust function body
3090 (name_lookup::do_queue_usings): Inline into ...
3091 (name_lookup::queue_usings): ... here. As in queue_namespace.
3092 (name_lookup::search_unqualified): Don't make queue static,
3093 remove length variable, and adjust function body accordingly.
3095 2022-04-07 Jakub Jelinek <jakub@redhat.com>
3097 PR tree-optimization/102586
3098 * cp-objcp-common.h (cp_classtype_as_base): Declare.
3099 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
3100 * cp-objcp-common.cc (cp_classtype_as_base): New function.
3102 2022-04-07 Jason Merrill <jason@redhat.com>
3105 * decl.cc (grokdeclarator): Reject conversion with trailing return
3108 2022-04-07 Jason Merrill <jason@redhat.com>
3111 * lambda.cc (lambda_expr_this_capture): Check all enclosing
3112 lambdas for completeness.
3114 2022-04-07 Jason Merrill <jason@redhat.com>
3117 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
3120 2022-04-06 Jakub Jelinek <jakub@redhat.com>
3123 * decl2.cc (splice_template_attributes): Return NULL if *p is
3125 (cplus_decl_attributes): Return early if attributes is
3126 error_mark_node. Don't check that later.
3128 2022-04-06 Patrick Palka <ppalka@redhat.com>
3131 * pt.cc (do_class_deduction): Check complain before attempting
3132 to issue a -Wctad-maybe-unsupported warning.
3134 2022-04-06 Jason Merrill <jason@redhat.com>
3137 * init.cc (build_vec_init): Use a reference for the result.
3139 2022-04-06 Jason Merrill <jason@redhat.com>
3142 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
3143 if exactly one of 'old' and 'decl' is a type.
3145 2022-04-05 Jason Merrill <jason@redhat.com>
3149 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
3151 2022-04-05 Jason Merrill <jason@redhat.com>
3154 * name-lookup.h (struct cp_binding_level): Add requires_expression
3156 * parser.cc (cp_parser_requires_expression): Set it.
3157 (synthesize_implicit_template_parm): Check it.
3159 2022-04-04 Jason Merrill <jason@redhat.com>
3162 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
3164 2022-04-04 Jason Merrill <jason@redhat.com>
3168 * pt.cc (get_underlying_template): Compare default template args.
3170 2022-04-03 Benno Evers <benno.evers@tenzir.com>
3171 Iain Sandoe <iain@sandoe.co.uk>
3174 * coroutines.cc (morph_fn_to_coro): Reset
3175 current_binding_level->blocks.
3177 2022-04-01 Jason Merrill <jason@redhat.com>
3180 2022-03-31 Jason Merrill <jason@redhat.com>
3183 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3184 (cp_parser_member_declaration): Call it.
3186 2022-04-01 Jason Merrill <jason@redhat.com>
3189 2022-03-24 Jason Merrill <jason@redhat.com>
3192 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3193 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3194 (type_has_non_user_provided_default_constructor_1): Support it.
3195 (type_has_non_user_provided_default_constructor): Now a wrapper.
3196 * method.cc (complain_about_unparsed_dmi): New.
3197 (constructible_expr): Call it.
3199 2022-04-01 Patrick Palka <ppalka@redhat.com>
3202 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
3203 the argument type of an NTTP before deducing from it.
3205 2022-03-31 Jason Merrill <jason@redhat.com>
3208 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3209 (cp_parser_member_declaration): Call it.
3211 2022-03-30 Patrick Palka <ppalka@redhat.com>
3214 * constraint.cc (diagnose_trait_expr): Handle all remaining
3215 traits appropriately. Remove default case.
3217 2022-03-30 Marek Polacek <polacek@redhat.com>
3221 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
3223 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3226 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
3227 DECL_CONTEXT of the iterator var to current_function_decl and
3230 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3233 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
3234 clear parser->colon_corrects_to_scope_p around tentative parsing of
3235 nested name specifier.
3237 2022-03-28 Jason Merrill <jason@redhat.com>
3239 * pt.cc (determine_specialization): Add comment.
3241 2022-03-28 Patrick Palka <ppalka@redhat.com>
3244 * pt.cc (finish_concept_definition): Check that a concept is
3245 declared with exactly one template parameter list.
3247 2022-03-28 Patrick Palka <ppalka@redhat.com>
3250 * constraint.cc (maybe_substitute_reqs_for): Don't assume
3251 DECL_TEMPLATE_INFO is available.
3253 2022-03-28 Jason Merrill <jason@redhat.com>
3258 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
3259 uses_all_template_parms_r, complex_pack_expansion_r.
3260 (complex_alias_template_p): Adjust.
3261 * tree.cc (strip_typedefs): Revert r12-7710 change.
3263 2022-03-28 Jason Merrill <jason@redhat.com>
3266 * init.cc (build_new_1): Include cookie in alignment. Omit
3267 constexpr wrapper from alloc_call.
3269 2022-03-28 Jason Merrill <jason@redhat.com>
3272 * name-lookup.cc (push_local_extern_decl_alias): Call
3273 determine_visibility.
3275 2022-03-28 Jason Merrill <jason@redhat.com>
3278 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
3279 a type template reference.
3281 2022-03-28 Jason Merrill <jason@redhat.com>
3284 * pt.cc (value_dependent_expression_p): Check
3285 has_value_dependent_address for conversion to reference.
3287 2022-03-28 Jason Merrill <jason@redhat.com>
3290 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
3292 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
3294 2022-03-28 Jason Merrill <jason@redhat.com>
3297 * call.cc (make_base_init_ok): Call make_used.
3299 2022-03-28 Jason Merrill <jason@redhat.com>
3302 * mangle.cc (write_expression): Don't write a union designator when
3305 2022-03-28 Jason Merrill <jason@redhat.com>
3309 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
3311 2022-03-26 Patrick Palka <ppalka@redhat.com>
3314 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
3315 Clarify error message when a if-stmt is non-constant because its
3316 branches are non-constant.
3318 2022-03-26 Patrick Palka <ppalka@redhat.com>
3321 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
3322 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
3324 2022-03-26 Jakub Jelinek <jakub@redhat.com>
3326 * parser.cc (cp_parser_postfix_expression)
3327 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
3328 return cp_build_{vec,convert,bit_cast} result right away, instead
3329 set postfix_expression to it and break.
3331 2022-03-25 Marek Polacek <polacek@redhat.com>
3334 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
3335 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
3338 2022-03-24 Marek Polacek <polacek@redhat.com>
3341 * decl.cc (check_initializer): Don't call build_aggr_init in
3344 2022-03-24 Jason Merrill <jason@redhat.com>
3347 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3348 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3349 (type_has_non_user_provided_default_constructor_1): Support it.
3350 (type_has_non_user_provided_default_constructor): Now a wrapper.
3351 * method.cc (complain_about_unparsed_dmi): New.
3352 (constructible_expr): Call it.
3354 2022-03-24 Marek Polacek <polacek@redhat.com>
3357 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
3359 2022-03-24 Patrick Palka <ppalka@redhat.com>
3362 * call.cc (build_over_call): Use cxx_constant_value_sfinae
3363 instead of cxx_constant_value to evaluate a consteval call.
3364 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
3365 and pass it to cxx_eval_outermost_constant_expr.
3366 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
3367 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
3368 cxx_constant_value_sfinae.
3370 2022-03-24 Jakub Jelinek <jakub@redhat.com>
3373 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
3374 through extern thread_local declarations. Change wording from
3375 declaration to definition.
3376 (potential_constant_expression_1): Don't diagnose extern thread_local
3377 declarations. Change wording from declared to defined.
3378 * decl.cc (start_decl): Likewise.
3380 2022-03-23 Jason Merrill <jason@redhat.com>
3383 * decl.cc (reshape_single_init): New.
3384 (reshape_init_class): Use it.
3386 2022-03-23 Jason Merrill <jason@redhat.com>
3389 * name-lookup.cc (lookup_using_decl): Check that scope is
3390 a dependent type before looking for dependent using.
3392 2022-03-23 Jason Merrill <jason@redhat.com>
3395 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
3396 finds a dependent using.
3398 2022-03-21 Jason Merrill <jason@redhat.com>
3401 * init.cc (build_vec_init): Check for vla element type.
3403 2022-03-21 Jason Merrill <jason@redhat.com>
3409 * decl.cc (reshape_init_class): Avoid looking for designator
3411 (reshape_init_r): Keep looking for designator.
3413 2022-03-21 Jason Merrill <jason@redhat.com>
3416 * decl.cc (reshape_init_class): Back out of anon struct
3417 if a designator doesn't match.
3419 2022-03-18 Jason Merrill <jason@redhat.com>
3423 * class.cc (add_method): Avoid adding the same used function twice.
3424 (handle_using_decl): Don't add_method.
3425 (finish_struct): Don't using op= if we have one already.
3426 (maybe_push_used_methods): New.
3427 * semantics.cc (finish_member_declaration): Call it.
3428 * name-lookup.cc (diagnose_name_conflict): No longer static.
3429 (push_class_level_binding): Revert 92918 patch, limit
3431 * cp-tree.h: Adjust.
3433 2022-03-18 Jakub Jelinek <jakub@redhat.com>
3436 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
3437 argument and its handling, instead add ITYPE2 argument. Only
3438 support COOKIE_SIZE != NULL.
3439 (build_new_1): If size is 0, change it to 0 * outer_nelts if
3440 outer_nelts is non-NULL. Pass type rather than elt_type to
3441 maybe_wrap_new_for_constexpr.
3442 * constexpr.cc (build_new_constexpr_heap_type): New function.
3443 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
3444 If elt_size is zero sized type, try to recover outer_nelts from
3445 the size argument to operator new/new[] and pass that as
3446 arg_size to build_new_constexpr_heap_type. Pass ctx,
3447 non_constant_p and overflow_p to that call too.
3449 2022-03-18 Marek Polacek <polacek@redhat.com>
3452 * tree.cc (strip_typedefs): Don't strip an alias template when
3453 doing so would result in losing a parameter pack.
3455 2022-03-16 Patrick Palka <ppalka@redhat.com>
3457 * search.cc (lookup_member): Simplify by handling all values
3458 of protect together in the ambiguous case. Don't modify protect.
3460 2022-03-16 Patrick Palka <ppalka@redhat.com>
3463 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
3464 std::move/forward and other cast-like functions into simple
3467 2022-03-15 Patrick Palka <ppalka@redhat.com>
3470 * search.cc (lookup_field_info::errstr): Remove this data
3472 (lookup_field_r): Don't set errstr.
3473 (lookup_member): Check ambiguity before checking access.
3474 Simplify accordingly after errstr removal. Exit early upon
3475 error or empty result.
3477 2022-03-15 Jakub Jelinek <jakub@redhat.com>
3480 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
3482 2022-03-14 Jakub Jelinek <jakub@redhat.com>
3484 PR tree-optimization/102586
3485 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
3486 first argument's type is pointer to non-trivially-copyable type unless
3487 it is address of a variable or parameter.
3489 2022-03-12 Patrick Palka <ppalka@redhat.com>
3492 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
3493 * decl.cc (make_typename_type): Allow a typename-specifier to
3494 resolve to a template when tf_tst_ok, in which case return
3495 a CTAD placeholder for the template.
3496 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
3497 substituting the type.
3498 (tsubst): Clear tf_tst_ok and remember if it was set.
3499 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
3501 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
3503 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
3504 <case CONSTRUCTOR>: Likewise.
3506 2022-03-12 Patrick Palka <ppalka@redhat.com>
3509 * call.cc (missing_conversion_p): Define.
3510 (add_candidates): Use it.
3511 * pt.cc (check_non_deducible_conversion): Change type of strict
3512 parameter to unification_kind_t and directly test for DEDUCE_CALL.
3514 2022-03-12 Patrick Palka <ppalka@redhat.com>
3517 * constraint.cc (normalize_atom): Set
3518 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
3519 (get_mapped_args): Make static, adjust parameters. Always
3520 return a vector whose depth corresponds to the template depth of
3521 the context of the atomic constraint expression. Micro-optimize
3522 by passing false as exact to safe_grow_cleared and by collapsing
3523 a multi-level depth-one argument vector.
3524 (satisfy_atom): Adjust call to get_mapped_args and
3525 diagnose_atomic_constraint.
3526 (diagnose_atomic_constraint): Replace map parameter with an args
3528 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
3529 (get_mapped_args): Remove declaration.
3531 2022-03-12 Patrick Palka <ppalka@redhat.com>
3532 Jason Merrill <jason@redhat.com>
3535 * constexpr.cc (mark_non_constant): Define, split out from ...
3536 (cxx_eval_outermost_constant_expr): ... here.
3537 (maybe_constant_value): Use it.
3539 2022-03-12 Patrick Palka <ppalka@redhat.com>
3541 * semantics.cc (finish_unary_fold_expr): Use input_location
3542 instead of UNKNOWN_LOCATION.
3543 (finish_binary_fold_expr): Likewise.
3545 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
3548 * semantics.cc (handle_omp_array_sections_1)
3549 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
3550 instead of 'c_omp_map_clause_name'.
3552 2022-03-10 Marek Polacek <polacek@redhat.com>
3555 * parser.cc (cp_parser_template_name): Repeat lookup of
3558 2022-03-10 Marek Polacek <polacek@redhat.com>
3561 * semantics.cc (finish_compound_literal): Disallow auto{x} for
3562 is_constrained_auto.
3563 * typeck2.cc (build_functional_cast_1): Likewise.
3565 2022-03-10 Marek Polacek <polacek@redhat.com>
3568 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
3571 2022-03-10 Jakub Jelinek <jakub@redhat.com>
3574 * decl.cc (grok_op_properties): Allow variadic operator[] for
3577 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
3580 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
3581 consider it to be zero (i.e. treat it like error_mark_node).
3582 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
3583 set VALUE to error_mark_node.
3585 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
3588 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
3589 stream hasn't been purged before processing DECL_PENDING_INLINE.
3591 2022-03-09 Patrick Palka <ppalka@redhat.com>
3594 * except.cc (build_noexcept_spec): Strengthen dependence check
3595 to instantiation_dependent_expression_p.
3596 * parser.cc (cp_parser_parenthesized_expression_list_elt):
3597 Remove fold_expr_p parameter, and don't call
3598 instantiate_non_dependent_expr.
3599 (cp_parser_parenthesized_expression_list): Adjust accordingly.
3600 * pt.cc (expand_integer_pack): Strengthen dependence check
3601 to instantiation_dependent_expression_p.
3602 (instantiate_non_dependent_expr_internal): Adjust comment.
3603 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
3604 the potentially-constant check, and relax and turn the
3605 dependence check into a checking assert.
3606 (instantiate_non_dependent_or_null): Adjust comment.
3607 * semantics.cc (finish_decltype_type): Keep
3608 processing_template_decl cleared after calling
3609 instantiate_non_dependent_expr_sfinae.
3611 2022-03-09 Patrick Palka <ppalka@redhat.com>
3615 * cp-tree.h (is_copy_initialization): Declare.
3616 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
3617 when is_copy_initialization is true.
3618 * init.cc (build_aggr_init): Split out copy-initialization
3620 (is_copy_initialization): ... here.
3621 * pt.cc (instantiate_decl): Pass 0 instead of
3622 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
3624 2022-03-09 Patrick Palka <ppalka@redhat.com>
3627 * cp-tree.h (merge_default_template_args): Declare.
3628 * decl.cc (merge_default_template_args): Define, factored out
3629 from redeclare_class_template.
3630 (duplicate_decls): Use it when merging member function template
3631 and free function declarations.
3632 * pt.cc (redeclare_class_template): Factor out default argument
3633 merging logic into merge_default_template_args. Improve location
3634 of a note when there's a template parameter kind mismatch.
3636 2022-03-09 Jakub Jelinek <jakub@redhat.com>
3639 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
3640 instead of TYPE_UNSIGNED.
3641 * typeck.cc (cp_build_binary_op): Don't emit
3642 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
3644 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3647 * decl.cc (start_decl): Defend against prefix_attributes being
3650 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3653 * parser.cc (synthesize_implicit_template_parm): Check that
3654 TREE_VALUE (new_parm) isn't error_mark_node before setting its
3657 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3660 * parser.cc (cp_parser_linkage_specification): Treat the case where
3661 linkage is error_mark_node as "invalid linkage-specification".
3663 2022-03-08 Marek Polacek <polacek@redhat.com>
3666 * pt.cc (convert_nontype_argument): Recompute
3667 value_dependent_expression_p after build_converted_constant_expr.
3669 2022-03-08 Marek Polacek <polacek@redhat.com>
3671 * decl2.cc (is_late_template_attribute): Do not defer attribute
3673 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
3675 2022-03-08 Jakub Jelinek <jakub@redhat.com>
3678 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
3679 identifiers with space at the end.
3681 2022-03-07 Jason Merrill <jason@redhat.com>
3684 * decl2.cc (mark_single_function): Look through parens and location
3686 * typeck.cc (cp_build_addr_expr_1): Not here.
3688 2022-03-07 Jakub Jelinek <jakub@redhat.com>
3690 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
3693 2022-03-07 Jakub Jelinek <jakub@redhat.com>
3695 * cvt.cc: Fix up duplicated word issue in a comment.
3697 * module.cc: Likewise.
3698 * coroutines.cc: Likewise.
3700 2022-03-04 Nathan Sidwell <nathan@acm.org>
3702 * mangle.cc (is_std_substitution): Check global module.
3703 (is_std_substitution_char): Return bool.
3705 2022-03-04 Nathan Sidwell <nathan@acm.org>
3707 * cp-tree.h (mangle_identifier): Replace with ...
3708 (mangle_module_component): ... this.
3709 * mangle.cc (dump_substitution_candidates): Adjust.
3710 (add_substitution): Likewise.
3711 (find_substitution): Likewise.
3712 (unmangled_name_p): Likewise.
3713 (mangle_module_substitution): Reimplement.
3714 (mangle_module_component): New.
3715 (write_module, maybe_write_module): Adjust.
3716 (write_name): Drop modules here.
3717 (write_unqualified): Do them here instead.
3718 (mangle_global_init): Adjust.
3719 * module.cc (module_state::mangle): Adjust.
3720 (mangle_module): Likewise.
3721 (get_originating_module): Adjust.
3723 2022-02-28 Marek Polacek <polacek@redhat.com>
3726 * cp-tree.h (build_enumerator): Adjust.
3727 * decl.cc (finish_enum): Make it return the new decl.
3728 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
3730 2022-02-28 Marek Polacek <polacek@redhat.com>
3733 * decl2.cc (is_late_template_attribute): Cope with a decl without
3736 2022-02-27 Jason Merrill <jason@redhat.com>
3739 * typeck.cc (cp_build_addr_expr_1): Also
3740 maybe_undo_parenthesized_ref.
3742 2022-02-24 Martin Liska <mliska@suse.cz>
3744 * pt.cc (defarg_insts_for): Use braces for subobject.
3746 2022-02-18 Patrick Palka <ppalka@redhat.com>
3749 * pt.cc (maybe_instantiate_noexcept): For non-static member
3750 functions, set current_class_ptr/ref to the specialized 'this'
3753 2022-02-17 Jason Merrill <jason@redhat.com>
3756 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
3758 2022-02-17 Jason Merrill <jason@redhat.com>
3761 * decl2.cc (mark_single_function): New.
3762 * cp-tree.h: Declare it.
3763 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
3764 * semantics.cc (finish_qualified_id_expr): Not here.
3765 (finish_id_expression_1): Or here.
3766 (finish_decltype_type): Call mark_single_function.
3767 * cvt.cc (convert_to_void): And here.
3768 * pt.cc (convert_nontype_argument): And here.
3769 * init.cc (build_offset_ref): Adjust assert.
3771 2022-02-17 Patrick Palka <ppalka@redhat.com>
3774 * semantics.cc (finish_compound_literal): Don't perform
3775 non-dependent expr folding before calling check_narrowing.
3777 2022-02-16 Patrick Palka <ppalka@redhat.com>
3780 * constexpr.cc (potential_constant_expression_1)
3781 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
3782 Assert tf_error isn't set.
3784 2022-02-15 Jason Merrill <jason@redhat.com>
3788 * pt.cc (coerce_template_template_parms): Take full parms.
3789 Avoid adding too much of outer_args.
3790 (coerce_template_template_parm): Adjust.
3791 (template_template_parm_bindings_ok_p): Adjust.
3792 (convert_template_argument): Adjust.
3794 2022-02-14 Jakub Jelinek <jakub@redhat.com>
3797 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
3798 Don't punt if returns (target).
3800 2022-02-11 Jakub Jelinek <jakub@redhat.com>
3803 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
3804 Only return fold_const_call result if it is non-NULL. Otherwise
3805 fall through into the default: case to return t, set *non_constant_p
3806 and emit diagnostics if needed.
3808 2022-02-10 Jason Merrill <jason@redhat.com>
3810 * module.cc (depset::hash::add_specializations): Use
3813 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
3816 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
3817 members as those are permitted since OpenMP 5.0.
3819 2022-02-10 Patrick Palka <ppalka@redhat.com>
3821 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
3824 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
3826 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
3827 (cp_parser_omp_var_list_no_open): Handle array sections.
3828 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
3830 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
3831 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
3832 (finish_omp_clauses): Handle array sections.
3834 2022-02-09 Patrick Palka <ppalka@redhat.com>
3837 * call.cc (build_new_method_call): When a non-dependent call
3838 resolves to a specialization of a member template, always build
3839 the pruned overload set using the member template, not the
3841 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
3842 and correct how members from the new lookup set are matched to
3843 those from the old one.
3844 (tsubst_baselink): Pass binfo_type as newtype to
3845 filter_memfn_lookup.
3847 2022-02-09 Jason Merrill <jason@redhat.com>
3850 * module.cc (trees_out::core_vals): Stream explicit specifier.
3851 (trees_in::core_vals): Likewise.
3852 * pt.cc (store_explicit_specifier): No longer static.
3853 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
3854 * cp-tree.h (lookup_explicit_specifier): Declare.
3856 2022-02-09 Jason Merrill <jason@redhat.com>
3859 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
3860 preceding members with constant initialization.
3861 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
3863 2022-02-08 Jakub Jelinek <jakub@redhat.com>
3866 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
3867 of a member or global declaration, add warning suppression for
3868 the decl and don't warn again on it.
3870 2022-02-08 Jakub Jelinek <jakub@redhat.com>
3873 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
3874 of TREE_STATIC vars may only appear in -std=c++23.
3876 2022-02-08 Patrick Palka <ppalka@redhat.com>
3879 * pt.cc (uses_deducible_template_parms): Consider the
3880 noexcept-spec of a function type.
3882 2022-02-08 Patrick Palka <ppalka@redhat.com>
3885 * constraint.cc (satisfaction_value): Relax assert to accept
3888 2022-02-08 Patrick Palka <ppalka@redhat.com>
3891 * pt.cc (preserve_args): New function.
3892 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
3894 2022-02-08 Patrick Palka <ppalka@redhat.com>
3897 * constraint.cc (satisfy_declaration_constraints): Use
3898 lambda_regenerating_args instead.
3899 * cp-tree.h (lambda_regenerating_args): Declare.
3900 * pt.cc (lambda_regenerating_args): Define, split out from
3901 satisfy_declaration_constraints.
3902 (do_auto_deduction): Use lambda_regenerating_args to obtain the
3903 full set of outer template arguments for satisfaction when
3906 2022-02-06 Patrick Palka <ppalka@redhat.com>
3909 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
3910 fn by calling maybe_synthesize_method instead of relying on
3911 maybe_instantiate_noexcept. Move call to m_i_n after the
3912 DECL_DELETED_FN handling.
3913 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
3914 fn synthesis to only those with an implicit noexcept-spec, and
3915 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
3917 2022-02-06 Jakub Jelinek <jakub@redhat.com>
3921 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
3922 folding_cxx_constexpr.
3924 2022-02-05 Jason Merrill <jason@redhat.com>
3928 * cp-tree.h (get_vec_init_expr): New.
3929 (target_expr_needs_replace): New.
3930 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
3931 (struct cp_fold_data): New.
3932 (cp_fold_r): Only genericize inits at end of fn.
3933 (cp_fold_function): Here.
3934 (cp_fully_fold_init): Not here.
3935 * init.cc (build_vec_init): Use get_vec_init_expr.
3936 * tree.cc (build_vec_init_expr): Likewise.
3937 * typeck2.cc (split_nonconstant_init_1): Likewise.
3938 (process_init_constructor): Wrap VEC_INIT_EXPR in
3941 2022-02-05 Jason Merrill <jason@redhat.com>
3943 * pt.cc (iterative_hash_template_arg): Add comment.
3945 2022-02-03 Patrick Palka <ppalka@redhat.com>
3948 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
3950 (dependent_type_p_r): ... here.
3951 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
3952 to consider dependence of a noexcept-spec before C++17.
3953 * tree.cc (fixup_deferred_exception_variants): Clear
3954 TYPE_DEPENDENT_P_VALID.
3956 2022-02-03 Jason Merrill <jason@redhat.com>
3959 * decl.cc (maybe_deduce_size_from_array_init): Give up
3960 on type-dependent init.
3961 (cp_complete_array_type): Only call reshape_init for character
3964 2022-02-01 Jason Merrill <jason@redhat.com>
3967 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
3968 (defarg_insts_for): New.
3969 (tsubst_default_argument): Adjust.
3971 2022-01-31 Marek Polacek <polacek@redhat.com>
3975 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
3976 Sorry on a variable-length array of auto.
3978 2022-01-31 Marek Polacek <polacek@redhat.com>
3981 * class.cc (finish_struct): Don't allow union initializer_list.
3983 2022-01-31 Patrick Palka <ppalka@redhat.com>
3986 * pt.cc (ctor_deduction_guides_for): Correct computation of
3989 2022-01-31 Patrick Palka <ppalka@redhat.com>
3992 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
3993 walk_subtrees if !include_nondeduced_p. Simplify given that
3994 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
3996 2022-01-28 Patrick Palka <ppalka@redhat.com>
3997 Jason Merrill <jason@redhat.com>
4000 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
4001 unqualified pointer type not the qualified one.
4003 2022-01-28 Patrick Palka <ppalka@redhat.com>
4006 * decl.cc (cp_finish_decl): Pass the template arguments of a
4007 variable template specialization or a templated static data
4008 member to do_auto_deduction when the auto is constrained.
4010 2022-01-28 Jason Merrill <jason@redhat.com>
4015 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
4017 (cp_parser_class_head): And in class attributes.
4018 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
4021 2022-01-27 Jason Merrill <jason@redhat.com>
4025 * decl2.cc (save_template_attributes): Take late attrs as parm.
4026 (cplus_decl_attributes): Call it after decl_attributes,
4027 splice_template_attributes before.
4029 2022-01-27 Patrick Palka <ppalka@redhat.com>
4032 * call.cc (build_over_call): For a non-dependent member call,
4033 build up a CALL_EXPR using a COMPONENT_REF callee, as in
4034 build_new_method_call.
4035 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
4036 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
4037 after the build_over_call change.
4039 2022-01-27 Patrick Palka <ppalka@redhat.com>
4043 * parser.cc (cp_parser_class_head): Update 'type' with the result
4044 of maybe_process_partial_specialization in the
4045 nested_name_specifier branch. Refactor nearby code to accomodate
4046 that maybe_process_partial_specialization returns a _TYPE, not a
4047 TYPE_DECL, and eliminate local variable 'class_type' in passing.
4049 2022-01-27 Marek Polacek <polacek@redhat.com>
4052 * decl.cc (create_array_type_for_decl): Reject forming an array of
4053 placeholder for a deduced class type.
4055 2022-01-26 Jason Merrill <jason@redhat.com>
4059 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
4061 2022-01-26 Jakub Jelinek <jakub@redhat.com>
4064 * constexpr.cc (init_subob_ctx): For vector ctors containing
4065 vector elements, ensure appending to the same ctor instead of
4066 creating another one.
4068 2022-01-26 Marek Polacek <polacek@redhat.com>
4071 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
4072 (finish_destructor_body): Likewise.
4073 * optimize.cc (build_delete_destructor_body): Likewise.
4075 2022-01-26 Jason Merrill <jason@redhat.com>
4078 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
4080 2022-01-26 Jason Merrill <jason@redhat.com>
4083 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
4086 2022-01-25 Patrick Palka <ppalka@redhat.com>
4090 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
4091 on a deleted function.
4093 2022-01-25 Jason Merrill <jason@redhat.com>
4096 * call.cc (build_over_call): Use cp_build_indirect_ref.
4098 2022-01-24 Patrick Palka <ppalka@redhat.com>
4101 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
4104 2022-01-24 Patrick Palka <ppalka@redhat.com>
4107 * typeck.cc (build_class_member_access_expr): Extend
4108 unary_complex_lvalue result adjustment to preserve all
4109 rvalues, not just xvalues.
4111 2022-01-23 Will Wray <wjwray@gmail.com>
4114 * decl.cc (reshape_init_r): Only call has_designator_check when
4115 first_initializer_p or for the inner constructor element.
4116 (cp_complete_array_type): Call reshape_init on braced-init-list.
4118 2022-01-23 Jason Merrill <jason@redhat.com>
4121 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
4122 has set DECL_INITIAL on a TARGET_EXPR slot.
4123 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
4125 2022-01-23 Jason Merrill <jason@redhat.com>
4128 * cp-tree.h (build_implicit_conv_flags): Declare.
4129 * call.cc (build_implicit_conv_flags): Split out from...
4130 (perform_implicit_conversion_flags): ...here.
4131 * decl.cc (check_initializer): Use it.
4132 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
4133 * semantics.cc (finish_compound_literal): Don't treat
4134 scalar values like CONSTRUCTORs.
4136 2022-01-21 Jason Merrill <jason@redhat.com>
4138 * semantics.cc (find_failing_clause): Return expr if not
4140 (finish_static_assert): Show constant values in failing
4143 2022-01-21 Jason Merrill <jason@redhat.com>
4147 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
4148 alloc_expr is a TARGET_EXPR.
4150 2022-01-21 Marek Polacek <polacek@redhat.com>
4153 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
4154 variants after parsing the exception specifications.
4156 2022-01-21 Jason Merrill <jason@redhat.com>
4160 * class.cc (end_of_class): Use base_binfo.
4162 2022-01-20 Jason Merrill <jason@redhat.com>
4165 * decl.cc (reshape_init_class): Reject designator for a member of
4168 2022-01-20 Patrick Palka <ppalka@redhat.com>
4172 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
4173 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
4174 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
4176 (make_auto_1): Add defaulted 'level' parameter.
4177 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
4179 2022-01-20 Patrick Palka <ppalka@redhat.com>
4181 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
4182 function return type even when !funcdecl_p.
4184 2022-01-20 Martin Liska <mliska@suse.cz>
4187 * error.cc (dump_aggr_type): Partially disable the warning.
4189 2022-01-20 Jason Merrill <jason@redhat.com>
4192 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
4194 2022-01-19 David Malcolm <dmalcolm@redhat.com>
4196 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
4198 * cp-tree.h (cp_pt_c_tests): Rename to...
4199 (cp_pt_cc_tests): ...this.
4200 (cp_tree_c_tests): Rename to...
4201 (cp_tree_cc_tests): ...this.
4202 * pt.cc (cp_pt_c_tests): Rename to...
4203 (cp_pt_cc_tests): ...this.
4204 * tree.cc (cp_tree_c_tests): Rename to...
4205 (cp_tree_cc_tests): ...this.
4207 2022-01-19 Jason Merrill <jason@redhat.com>
4209 * parser.cc (saved_token_sentinel::rollback): Use
4210 cp_lexer_previous_token.
4212 2022-01-18 Jakub Jelinek <jakub@redhat.com>
4215 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
4216 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
4217 than get_target_expr_sfinae with tf_no_cleanup, and don't set
4220 2022-01-18 Jason Merrill <jason@redhat.com>
4221 Jakub Jelinek <jakub@redhat.com>
4224 * parser.cc (saved_token_sentinel::rollback): Call
4225 cp_lexer_set_source_position.
4226 (~saved_token_sentinel): Call rollback.
4228 2022-01-18 Patrick Palka <ppalka@redhat.com>
4231 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
4232 that we return false for DEPENDENT_OPERATOR_TYPE too.
4234 2022-01-17 Martin Liska <mliska@suse.cz>
4236 * Make-lang.in: Rename .c names to .cc.
4237 * config-lang.in: Likewise.
4238 * constexpr.cc (cxx_eval_constant_expression): Likewise.
4239 * coroutines.cc (morph_fn_to_coro): Likewise.
4240 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
4241 * cp-lang.cc (struct lang_hooks): Likewise.
4242 (get_template_argument_pack_elems_folded): Likewise.
4243 * cp-objcp-common.cc (cp_tree_size): Likewise.
4244 (cp_unit_size_without_reusable_padding): Likewise.
4245 (pop_file_scope): Likewise.
4246 (cp_pushdecl): Likewise.
4247 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
4248 (cxx_simulate_record_decl): Likewise.
4249 * cp-tree.h (struct named_label_entry): Likewise.
4250 (current_function_return_value): Likewise.
4251 (more_aggr_init_expr_args_p): Likewise.
4252 (get_function_version_dispatcher): Likewise.
4253 (common_enclosing_class): Likewise.
4254 (strip_fnptr_conv): Likewise.
4255 (current_decl_namespace): Likewise.
4256 (do_aggregate_paren_init): Likewise.
4257 (cp_check_const_attributes): Likewise.
4258 (qualified_name_lookup_error): Likewise.
4259 (generic_targs_for): Likewise.
4260 (mark_exp_read): Likewise.
4261 (is_global_friend): Likewise.
4262 (maybe_reject_flexarray_init): Likewise.
4263 (module_token_lang): Likewise.
4264 (handle_module_option): Likewise.
4265 (literal_integer_zerop): Likewise.
4266 (build_extra_args): Likewise.
4267 (build_if_nonnull): Likewise.
4268 (maybe_check_overriding_exception_spec): Likewise.
4269 (finish_omp_target_clauses): Likewise.
4270 (maybe_warn_zero_as_null_pointer_constant): Likewise.
4271 (cxx_print_error_function): Likewise.
4272 (decl_in_std_namespace_p): Likewise.
4273 (merge_exception_specifiers): Likewise.
4274 (mangle_module_global_init): Likewise.
4275 (cxx_block_may_fallthru): Likewise.
4276 (fold_builtin_source_location): Likewise.
4277 (enum cp_oracle_request): Likewise.
4278 (subsumes): Likewise.
4279 (cp_finish_injected_record_type): Likewise.
4280 (vtv_build_vtable_verify_fndecl): Likewise.
4281 (cp_tree_c_finish_parsing): Likewise.
4282 * cvt.cc (diagnose_ref_binding): Likewise.
4283 (convert_to_void): Likewise.
4284 (convert_force): Likewise.
4285 (type_promotes_to): Likewise.
4286 * decl.cc (make_unbound_class_template_raw): Likewise.
4287 (cxx_init_decl_processing): Likewise.
4288 (check_class_member_definition_namespace): Likewise.
4289 (cxx_maybe_build_cleanup): Likewise.
4290 * decl2.cc (maybe_emit_vtables): Likewise.
4291 * error.cc (dump_function_name): Likewise.
4292 * init.cc (is_class_type): Likewise.
4293 (build_new_1): Likewise.
4294 * lang-specs.h: Likewise.
4295 * method.cc (make_alias_for_thunk): Likewise.
4296 * module.cc (specialization_add): Likewise.
4297 (module_state::read_cluster): Likewise.
4298 * name-lookup.cc (check_extern_c_conflict): Likewise.
4299 * name-lookup.h (struct cxx_binding): Likewise.
4300 * parser.cc (cp_parser_identifier): Likewise.
4301 * parser.h (struct cp_parser): Likewise.
4302 * pt.cc (has_value_dependent_address): Likewise.
4303 (push_tinst_level_loc): Likewise.
4304 * semantics.cc (finish_omp_clauses): Likewise.
4305 (finish_omp_atomic): Likewise.
4306 * tree.cc (cp_save_expr): Likewise.
4307 (cp_free_lang_data): Likewise.
4308 * typeck.cc (cp_common_type): Likewise.
4309 (strip_array_domain): Likewise.
4310 (rationalize_conditional_expr): Likewise.
4311 (check_return_expr): Likewise.
4312 * vtable-class-hierarchy.cc: Likewise.
4314 2022-01-17 Martin Liska <mliska@suse.cz>
4316 * call.c: Moved to...
4318 * class.c: Moved to...
4319 * class.cc: ...here.
4320 * constexpr.c: Moved to...
4321 * constexpr.cc: ...here.
4322 * cp-gimplify.c: Moved to...
4323 * cp-gimplify.cc: ...here.
4324 * cp-lang.c: Moved to...
4325 * cp-lang.cc: ...here.
4326 * cp-objcp-common.c: Moved to...
4327 * cp-objcp-common.cc: ...here.
4328 * cp-ubsan.c: Moved to...
4329 * cp-ubsan.cc: ...here.
4330 * cvt.c: Moved to...
4332 * cxx-pretty-print.c: Moved to...
4333 * cxx-pretty-print.cc: ...here.
4334 * decl.c: Moved to...
4336 * decl2.c: Moved to...
4337 * decl2.cc: ...here.
4338 * dump.c: Moved to...
4340 * error.c: Moved to...
4341 * error.cc: ...here.
4342 * except.c: Moved to...
4343 * except.cc: ...here.
4344 * expr.c: Moved to...
4346 * friend.c: Moved to...
4347 * friend.cc: ...here.
4348 * g++spec.c: Moved to...
4349 * g++spec.cc: ...here.
4350 * init.c: Moved to...
4352 * lambda.c: Moved to...
4353 * lambda.cc: ...here.
4354 * lex.c: Moved to...
4356 * mangle.c: Moved to...
4357 * mangle.cc: ...here.
4358 * method.c: Moved to...
4359 * method.cc: ...here.
4360 * name-lookup.c: Moved to...
4361 * name-lookup.cc: ...here.
4362 * optimize.c: Moved to...
4363 * optimize.cc: ...here.
4364 * parser.c: Moved to...
4365 * parser.cc: ...here.
4368 * ptree.c: Moved to...
4369 * ptree.cc: ...here.
4370 * rtti.c: Moved to...
4372 * search.c: Moved to...
4373 * search.cc: ...here.
4374 * semantics.c: Moved to...
4375 * semantics.cc: ...here.
4376 * tree.c: Moved to...
4378 * typeck.c: Moved to...
4379 * typeck.cc: ...here.
4380 * typeck2.c: Moved to...
4381 * typeck2.cc: ...here.
4382 * vtable-class-hierarchy.c: Moved to...
4383 * vtable-class-hierarchy.cc: ...here.
4385 2022-01-17 Jakub Jelinek <jakub@redhat.com>
4388 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
4389 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
4391 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
4393 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
4395 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
4398 * semantics.c (finish_omp_clauses): Also continue peeling off of
4399 outer node for ARRAY_REFs.
4401 2022-01-14 Jakub Jelinek <jakub@redhat.com>
4404 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
4405 IF_STMT_CONSTEXPR_P with constant false or true condition only
4406 check if the taken clause may fall through.
4407 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
4408 to r12-5638^ behavior if then_ block can't fall through. For
4409 constexpr if, revert to r12-5638^ behavior.
4411 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
4412 Jason Merrill <jason@redhat.com>
4415 * parser.c (cp_parser_id_expression): Handle
4416 -Wmissing-template-keyword.
4417 (struct saved_token_sentinel): Add modes to control what happens
4419 (cp_parser_statement): Adjust.
4420 (cp_parser_skip_entire_template_parameter_list): New function that
4421 skips an entire template parameter list.
4422 (cp_parser_require_end_of_template_parameter_list): Rename old
4423 cp_parser_skip_to_end_of_template_parameter_list.
4424 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
4425 called from one of the above two functions.
4426 (cp_parser_lambda_declarator_opt)
4427 (cp_parser_explicit_template_declaration)
4428 (cp_parser_enclosed_template_argument_list): Adjust.
4430 2022-01-12 Jakub Jelinek <jakub@redhat.com>
4431 Jason Merrill <jason@redhat.com>
4434 * tree.c (move): If expr is xvalue_p, just return expr without
4437 2022-01-11 Jakub Jelinek <jakub@redhat.com>
4440 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
4441 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
4442 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
4443 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
4446 2022-01-11 Patrick Palka <ppalka@redhat.com>
4449 * call.c (build_new_method_call): Consider dependent bases only
4450 if 'this' is available.
4452 2022-01-11 Olivier Hainque <hainque@adacore.com>
4454 * decl.c (cxx_init_decl_processing): Move code possibly
4455 altering flag_weak before code testing it.
4457 2022-01-10 Patrick Palka <ppalka@redhat.com>
4460 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
4461 canonicalization step into a local lambda. Strengthen it to
4462 absorb more components at position 0. Use it before both calls
4463 to cxx_fold_indirect_ref_1.
4465 2022-01-10 Patrick Palka <ppalka@redhat.com>
4468 * call.c (cand_parms_match): Skip over 'this' when given one
4469 static and one non-static member function.
4471 2022-01-10 Jakub Jelinek <jakub@redhat.com>
4474 * semantics.c (expand_or_defer_fn): For immediate functions, set
4475 node->body_removed to true and clear analyzed, definition and
4477 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
4480 2022-01-08 Jakub Jelinek <jakub@redhat.com>
4483 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
4484 (cxx_eval_binary_expression): Use it.
4486 2022-01-08 Jason Merrill <jason@redhat.com>
4489 * init.c (build_vec_init): Remove assert.
4490 * tree.c (build_vec_init_expr): Likewise.
4492 2022-01-08 Jason Merrill <jason@redhat.com>
4495 * call.c (build_op_delete_call): Ignore destroying delete
4498 2022-01-07 Jason Merrill <jason@redhat.com>
4501 * init.c (build_new_1): Also build pointer cleanup if
4503 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
4505 2022-01-07 Jason Merrill <jason@redhat.com>
4509 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
4511 2022-01-07 Jason Merrill <jason@redhat.com>
4514 * init.c (perform_target_ctor): Select destructor by in_chrg.
4516 2022-01-07 Jason Merrill <jason@redhat.com>
4519 * except.c (in_nested_catch): New.
4520 (expand_end_catch_block): Check it.
4522 2022-01-07 Jason Merrill <jason@redhat.com>
4526 * except.c (maybe_splice_retval_cleanup): Check
4527 current_binding_level.
4528 * semantics.c (do_poplevel): Call it here.
4529 * parser.c (cp_parser_compound_statement): Not here.
4531 2022-01-07 Jason Merrill <jason@redhat.com>
4534 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
4535 cleanups from set_up_extended_ref_temp.
4536 (wrap_temporary_cleanups): Ignore array cleanups.
4537 (initialize_local_var): Don't check for array here.
4538 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
4539 * init.c (build_vec_delete_1): Set it.
4541 2022-01-07 Jason Merrill <jason@redhat.com>
4544 * init.c (build_vec_delete_1): Handle throwing dtor.
4545 (build_vec_init): Tell it we're in a cleanup already.
4547 2022-01-07 Jason Merrill <jason@redhat.com>
4549 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
4550 (split_nonconstant_init): Adjust.
4552 2022-01-07 Jason Merrill <jason@redhat.com>
4556 * constexpr.c (replace_decl): Rename from replace_result_decl.
4557 * cp-tree.h (replace_decl): Declare it.
4558 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
4559 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
4560 (cp_genericize_init, cp_genericize_init_expr)
4561 (cp_genericize_target_expr): New.
4562 (cp_fold_r): Call them.
4563 * tree.c (build_array_copy): Add a TARGET_EXPR.
4564 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
4566 2022-01-07 Jason Merrill <jason@redhat.com>
4569 * decl.c (initialize_local_var): Fix comment.
4570 * init.c (build_new_1): Do stabilize array init.
4571 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
4572 of an element from an explicit initializer is not a
4574 * tree.c (expand_vec_init_expr): Pass flags through.
4575 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
4576 (split_nonconstant_init): Handle array cleanups.
4577 * cp-tree.h: Adjust.
4579 2022-01-07 Jason Merrill <jason@redhat.com>
4582 * decl.c (check_initializer): Remove obsolete comment.
4583 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
4584 (initialize_local_var): Change assert to test.
4585 * typeck2.c (maybe_push_temp_cleanup): New.
4586 (split_nonconstant_init_1): Use it.
4587 (split_nonconstant_init): Clear cleanup flags.
4589 2022-01-07 Jason Merrill <jason@redhat.com>
4592 * typeck2.c (PICFLAG_VEC_INIT): New.
4593 (process_init_constructor_array): Set it.
4594 (process_init_constructor): Handle it.
4595 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
4596 * init.c (build_vec_init): Likewise.
4597 * cp-gimplify.c (cp_gimplify_expr): Factor out...
4598 * tree.c (expand_vec_init_expr): ...this function.
4599 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
4600 (build_vec_init_expr): Likewise.
4601 * constexpr.c (cxx_eval_vec_init): Likewise.
4602 (reduced_constant_expression_p): Check arrays before C++20.
4603 * cp-tree.h (expand_vec_init_expr): Declare.
4605 2022-01-07 Jason Merrill <jason@redhat.com>
4607 * init.c (build_new_1): Remove preevaluation code.
4609 2022-01-05 Nathan Sidwell <nathan@acm.org>
4611 * pt.c (instantiate_class_template_1): Process attribute((used)) set
4614 2022-01-05 Nathan Sidwell <nathan@acm.org>
4616 * init.c (build_new_1): Check complain before alignment warning.
4618 2022-01-04 Jason Merrill <jason@redhat.com>
4620 * cp-tree.h (class releasing_vec): Add begin/end fns.
4622 2022-01-04 Jason Merrill <jason@redhat.com>
4624 * init.c: Include -*- C++ -*- on first line.
4626 2022-01-03 Marek Polacek <polacek@redhat.com>
4629 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
4632 2022-01-03 Marek Polacek <polacek@redhat.com>
4634 * parser.c (make_char_string_pack): Add a cast to const unsigned
4637 2022-01-03 Jakub Jelinek <jakub@redhat.com>
4640 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
4641 to DECL_TINFO_P VAR_DECLs.
4643 2022-01-02 Jason Merrill <jason@redhat.com>
4645 * init.c (build_vec_init): Append the decrement to elt_init.
4647 2022-01-02 Jason Merrill <jason@redhat.com>
4649 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
4652 Copyright (C) 2022 Free Software Foundation, Inc.
4654 Copying and distribution of this file, with or without modification,
4655 are permitted in any medium without royalty provided the copyright
4656 notice and this notice are preserved.