1 2022-11-15 Marek Polacek <polacek@redhat.com>
4 * decl.cc (grokdeclarator): Only emit a -Wignored-qualifiers warning
7 2022-11-15 Patrick Palka <ppalka@redhat.com>
9 * constexpr.cc (potential_constant_expression_1)
10 <case *_CAST_EXPR>: Use
11 cast_valid_in_integral_constant_expression_p instead of
13 * constraint.cc (tsubst_valid_expression_requirement): Adjust
14 calls to tsubst_copy_and_build and tsubst_expr.
15 (tsubst_constraint): Likewise.
16 (satisfy_atom): Likewise.
17 (diagnose_trait_expr): Likewise.
18 * cp-tree.h (tsubst_copy_and_build): Remove i_c_e_p parameter.
19 (tsubst_expr): Likewise.
20 * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build
22 * pt.cc (expand_integer_pack): Likewise.
23 (instantiate_non_dependent_expr_internal): Likewise.
24 (tsubst_friend_function): Likewise.
25 (tsubst_attribute): Likewise.
26 (instantiate_class_template): Likewise.
27 (tsubst_template_arg): Likewise.
28 (gen_elem_of_pack_expansion_instantiation): Likewise.
29 (tsubst_fold_expr_init): Likewise.
30 (tsubst_pack_expansion): Likewise.
31 (tsubst_default_argument): Likewise.
32 (tsubst_function_decl): Likewise.
33 (tsubst_decl): Likewise.
34 (tsubst_arg_types): Likewise.
35 (tsubst_exception_specification): Likewise.
37 (tsubst_init): Likewise.
38 (tsubst_copy): Likewise.
39 (tsubst_omp_clause_decl): Likewise.
40 (tsubst_omp_clauses): Likewise.
41 (tsubst_copy_asm_operands): Likewise.
42 (tsubst_omp_for_iterator): Likewise.
43 (tsubst_expr): Likewise. Remove i_c_e_p parameter.
44 (tsubst_omp_udr): Likewise.
45 (tsubst_non_call_postfix_expression): Likewise. Remove i_c_e_p parameter.
46 (tsubst_lambda_expr): Likewise.
47 (tsubst_copy_and_build_call_args): Likewise.
48 (tsubst_copy_and_build): Likewise. Remove i_c_e_p parameter.
49 <case IDENTIFIER_NODE>: Adjust call to finish_id_expression
50 following removal of i_c_e_p.
51 <case *_CAST_EXPR>: Remove C++98-specific cast validity check
53 (maybe_instantiate_noexcept): Adjust calls to
54 tsubst_copy_and_build and tsubst_expr.
55 (instantiate_body): Likewise.
56 (instantiate_decl): Likewise.
57 (tsubst_initializer_list): Likewise.
58 (tsubst_enum): Likewise.
60 2022-11-15 Patrick Palka <ppalka@redhat.com>
62 * cp-lang.cc (objcp_tsubst_copy_and_build): Remove
64 * cp-objcp-common.h (objcp_tsubst_copy_and_build):
66 * cp-tree.h (tsubst_copy_and_build): Likewise.
67 * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build.
68 * pt.cc (expand_integer_pack): Likewise.
69 (instantiate_non_dependent_expr_internal): Likewise.
70 (tsubst_function_decl): Likewise.
71 (tsubst_arg_types): Likewise.
72 (tsubst_exception_specification): Likewise.
74 (tsubst_copy_asm_operands): Likewise.
75 (tsubst_expr): Likewise.
76 (tsubst_non_call_postfix_expression): Likewise.
77 (tsubst_lambda_expr): Likewise.
78 (tsubst_copy_and_build_call_args): Likewise.
79 (tsubst_copy_and_build): Remove function_p parameter
80 and adjust function comment. Adjust recursive calls.
81 <case CALL_EXPR>: Update outdated comment about when
82 we can see an IDENTIFIER_NODE callee with koenig_p=false.
83 (maybe_instantiate_noexcept): Adjust calls to
84 tsubst_copy_and_build.
86 2022-11-15 Jakub Jelinek <jakub@redhat.com>
88 * cp-tree.h (next_common_initial_seqence): Rename to ...
89 (next_common_initial_sequence): ... this.
90 * typeck.cc (next_common_initial_seqence): Rename to ...
91 (next_common_initial_sequence): ... this.
92 (layout_compatible_type_p): Call next_common_initial_sequence
93 rather than next_common_initial_seqence.
94 * semantics.cc (is_corresponding_member_aggr): Likewise.
96 2022-11-15 Jakub Jelinek <jakub@redhat.com>
98 * decl.cc (grok_op_properties): Implement C++23 P2589R1
99 - static operator[]. Handle operator[] similarly to operator()
100 - allow static member functions, but pedwarn on it for C++20 and
101 older. Unlike operator(), perform rest of checks on it though for
103 * call.cc (add_operator_candidates): For operator[] with class
104 typed first parameter, pass that parameter as first_arg and
105 an adjusted arglist without that parameter.
107 2022-11-15 Patrick Palka <ppalka@redhat.com>
110 * tree.cc (cxx_attribute_table): Don't conditionally exclude
111 the init_priority entry.
112 (handle_init_priority_attribute): Remove ATTRIBUTE_UNUSED.
113 Return error_mark_node if !SUPPORTS_INIT_PRIORITY.
115 2022-11-15 Marek Polacek <polacek@redhat.com>
117 * call.cc (maybe_warn_dangling_reference): Don't warn when initializing
118 a non-const lvalue reference.
120 2022-11-14 Jason Merrill <jason@redhat.com>
122 * pt.cc (tsubst_friend_function): Check satisfaction.
124 2022-11-14 Martin Liska <mliska@suse.cz>
127 2022-11-14 Martin Liska <mliska@suse.cz>
129 * Make-lang.in: Support Sphinx based documentation.
131 2022-11-14 Martin Liska <mliska@suse.cz>
134 2022-11-14 Martin Liska <mliska@suse.cz>
137 Support installation if sphinx-build is missing.
139 2022-11-10 Marek Polacek <polacek@redhat.com>
141 * call.cc (std_pair_ref_ref_p): New.
142 (do_warn_dangling_reference): Also warn when the function returns
143 std::pair<const T&, const T&>. Recurse into TARGET_EXPR_INITIAL.
144 (maybe_warn_dangling_reference): Don't return early if we're
145 initializing a std_pair_ref_ref_p.
147 2022-11-09 Jakub Jelinek <jakub@redhat.com>
149 * tree.cc (handle_carries_dependency_attribute): New function.
150 (std_attribute_table): Add carries_dependency attribute.
151 * parser.cc (cp_parser_check_std_attribute): Add carries_dependency
154 2022-11-09 Martin Liska <mliska@suse.cz>
157 Support installation if sphinx-build is missing.
159 2022-11-09 Martin Liska <mliska@suse.cz>
161 * Make-lang.in: Support Sphinx based documentation.
163 2022-11-09 Marek Polacek <polacek@redhat.com>
166 * semantics.cc (finish_call_expr): Suppress OPT_Wpessimizing_move.
167 * typeck.cc (maybe_warn_pessimizing_move): Check warn_redundant_move
168 and warning_suppressed_p. Adjust a message depending on return_p.
169 (check_return_expr): Don't suppress OPT_Wpessimizing_move here.
171 2022-11-08 Jason Merrill <jason@redhat.com>
172 Jakub Jelinek <jakub@redhat.com>
174 * cp-tree.h (fns_correspond): Declare.
175 * decl.cc (fns_correspond): New.
176 * call.cc (add_candidates): Look for op!= matching op==.
177 (joust): Complain about non-standard reversed tiebreaker.
178 (tourney): Fix champ_compared_to_predecessor logic.
179 (build_new_op): Don't complain about error_mark_node not having
181 * pt.cc (tsubst_copy_and_build): Don't try to be permissive
184 2022-11-06 Patrick Palka <ppalka@redhat.com>
186 * tree.cc (cxx_attribute_table): Include init_priority entry
187 only if SUPPORTS_INIT_PRIORITY.
188 (handle_init_priority_attribute): Add ATTRIBUTE_UNUSED. Assert
189 SUPPORTS_INIT_PRIORITY is true.
191 2022-11-04 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
192 Yvan ROUX <yvan.roux@foss.st.com>
194 * mapper-client.cc: Use in-process client when networking is
197 2022-11-03 Marek Polacek <polacek@redhat.com>
200 * call.cc (do_warn_dangling_reference): Quash -Wdangling-reference
201 for member operator*.
203 2022-11-03 Patrick Palka <ppalka@redhat.com>
206 * constraint.cc (tsubst_requires_expr): Make sure we're not
207 deferring access checks.
209 2022-11-03 Jason Merrill <jason@redhat.com>
211 * parser.cc (cp_parser_template_declaration_after_parameters): Fix
212 concept parsing below C++20.
214 2022-11-03 Patrick Palka <ppalka@redhat.com>
217 * decl2.cc (mark_used): Don't defer synthesis of virtual
220 2022-11-01 Nathan Sidwell <nathan@acm.org>
222 * cp-tree.h (LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR): New.
223 (struct tree_lambda_expr): Add discriminator_sig bitfield.
224 (recrd_lambda_scope_sig_discriminator): Declare.
225 * lambda.cc (struct lambda_sig_count): New.
226 (lambda_discriminator): Add signature vector.
227 (start_lambda_scope): Adjust.
228 (compare_lambda_template_head, compare_lambda_sig): New.
229 (record_lambda_scope_sig_discriminator): New.
230 * mangle.cc (write_closure_type): Use the scope-sig discriminator for
231 ABI >= 18. Emit abi mangling warning if needed.
232 * module.cc (trees_out::core_vals): Stream the new discriminator.
233 (trees_in::core_vals): Likewise.
234 * parser.cc (cp_parser_lambda_declarator_opt): Call
235 record_lambda_scope_sig_discriminator.
236 * pt.cc (tsubst_lambda_expr): Likewise.
238 2022-11-01 Nathan Sidwell <nathan@acm.org>
240 * cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
241 (LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
242 (struct tree_lambda_expr): Make default_capture_mode &
243 discriminator_scope bitfields.
244 (record_null_lambda_scope) Delete.
245 (record_lambda_scope_discriminator): Declare.
246 * lambda.cc (struct lambda_discriminator): New struct.
247 (lambda_scope, lambda_scope_stack): Adjust types.
248 (lambda_count): Delete.
249 (struct tree_int): Delete.
250 (start_lambda_scope, finish_lambda_scope): Adjust.
251 (record_lambda_scope): Only record the scope.
252 (record_lambda_scope_discriminator): New.
253 * mangle.cc (write_closure_type_name): Adjust.
254 * module.cc (trees_out::core_vals): Likewise,
255 (trees_in::core_vals): Likewise.
256 * parser.cc (cp_parser_lambda_expression): Call
257 record_lambda_scope_discriminator.
258 * pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling. Call
259 record_lambda_scope_discriminator. Commonize control flow on tsubsting
260 the operator function.
262 2022-11-01 Jason Merrill <jason@redhat.com>
264 * parser.cc (make_call_declarator): Add std_attrs parm.
265 (cp_parser_lambda_declarator_opt): Pass it.
266 (cp_parser_direct_declarator): Pass it.
268 2022-11-01 Jason Merrill <jason@redhat.com>
270 * decl.cc (finish_function): Set TREE_NOTHROW later in the function.
272 2022-11-01 Jason Merrill <jason@redhat.com>
274 * decl.cc (duplicate_decls): Reformat loop.
275 * parser.cc (cp_parser_member_declaration): Add newline.
276 * semantics.cc: Remove newline.
278 2022-10-28 Marek Polacek <polacek@redhat.com>
280 * call.cc (maybe_warn_dangling_reference): Enable the warning in
281 system headers if the decl isn't in a system header.
283 2022-10-28 Jason Merrill <jason@redhat.com>
285 * decl.cc (grokdeclarator): Call decl_attributes before do_friend.
287 2022-10-28 Jakub Jelinek <jakub@redhat.com>
289 * parser.cc (cp_parser_omp_all_clauses): Allow optional comma
290 before the first clause even in pragma syntax.
291 (cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj,
292 cp_parser_omp_flush, cp_parser_omp_scan_loop_body,
293 cp_parser_omp_ordered, cp_parser_omp_assumption_clauses,
294 cp_finish_omp_declare_variant, cp_parser_omp_declare_target,
295 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires,
296 cp_parser_omp_error): Likewise.
298 2022-10-28 Joseph Myers <joseph@codesourcery.com>
301 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P, ENUM_UNDERLYING_TYPE):
302 Remove. Moved to c-common.h.
304 2022-10-27 Jakub Jelinek <jakub@redhat.com>
307 * name-lookup.cc (push_namespace): Call find_namespace_slot again
308 after pushdecl as the hash table might be expanded during pushdecl.
310 2022-10-27 Nathan Sidwell <nathan@acm.org>
312 * mangle.cc (write_closure_template_head): New.
313 (write_closure_type_name): Call it.
315 2022-10-27 Jakub Jelinek <jakub@redhat.com>
319 * typeck.cc (cp_build_binary_op): Don't compute semantic_result_type
320 if result_type is NULL.
322 2022-10-26 Marek Polacek <polacek@redhat.com>
325 * call.cc (expr_represents_temporary_p): New, factored out of...
326 (conv_binds_ref_to_temporary): ...here. Don't return false just
327 because a ck_base is missing. Use expr_represents_temporary_p.
328 (do_warn_dangling_reference): New.
329 (maybe_warn_dangling_reference): New.
330 (extend_ref_init_temps): Call maybe_warn_dangling_reference.
331 * cp-tree.h: Adjust comment.
332 * typeck.cc (check_return_expr): Suppress -Wdangling-reference
335 2022-10-25 Nathan Sidwell <nathan@acm.org>
337 * parser.cc (synthesize_implicit_template_parm): Fix thinko about
338 mark the new parm DECL_VIRTUAL_P. Avoid unneccessary tree_last call.
340 2022-10-25 Patrick Palka <ppalka@redhat.com>
342 * constraint.cc (resolve_function_concept_overload): Explicitly
343 pass complain=tf_none to coerce_template_parms.
344 (resolve_concept_check): Likewise.
345 (normalize_concept_check): Likewise.
346 * cp-tree.h (coerce_template_parms): Declare the main overload
347 and default its last parameter to true. Remove wrapper overloads.
348 * pt.cc (determine_specialization): Adjust calls to
349 coerce_template_parms and coerce_innermost_template_parms after
350 removing their last parameter.
351 (coerce_template_args_for_ttp): Likewise.
352 (coerce_ttp_args_for_tta): Likewise.
353 (coerce_template_template_parms): Likewise.
354 (coerce_template_parms): Remove use_default_args parameter and
355 adjust function comment. Document default argument. Remove
356 wrapper overloads. No longer static.
357 (coerce_innermost_template_parms): Remove use_default_args
358 parameter. Default require_all_args to true.
359 (lookup_template_class): As with determine_specialization.
360 (finish_template_variable): Likewise.
361 (tsubst_decl): Likewise.
362 (instantiate_alias_template): Likewise.
363 (fn_type_unification): Likewise.
364 (resolve_overloaded_unification): Likewise.
365 (resolve_nondeduced_context): Likewise.
366 (get_partial_spec_bindings): Likewise.
368 2022-10-25 Jason Merrill <jason@redhat.com>
370 * constexpr.cc (find_failing_clause_r): Re-add the call to
371 contextual_conv_bool.
373 2022-10-25 Patrick Palka <ppalka@redhat.com>
377 * module.cc (trees_out::core_vals): Stream TYPE_MAX_VALUE and
378 TYPE_MIN_VALUE of ENUMERAL_TYPE.
379 (trees_in::core_vals): Likewise.
380 (trees_out::write_enum_def): Don't stream them here.
381 (trees_in::read_enum_def): Likewise.
383 2022-10-25 Jason Merrill <jason@redhat.com>
385 * constexpr.cc (class constexpr_global_ctx): Add modifiable field,
386 get_value, get_value_ptr, put_value, remove_value, flush_modifiable
388 (class modifiable_tracker): New.
389 (cxx_eval_internal_function): Use it.
390 (diagnose_failing_condition): Strip CLEANUP_POINT_EXPR.
392 2022-10-25 Jason Merrill <jason@redhat.com>
394 * constexpr.cc (fold_operand): New function.
395 (find_failing_clause_r): Add const.
396 (find_failing_clause): Add const.
397 (diagnose_failing_condition): Add ctx parameter.
398 (cxx_eval_internal_function): Pass it.
399 * semantics.cc (diagnose_failing_condition): Move to constexpr.cc.
402 2022-10-24 Jason Merrill <jason@redhat.com>
404 * cp-gimplify.cc (fold_builtin_source_location)
405 * vtable-class-hierarchy.cc (register_all_pairs): Simplify calls to
406 build_string_literal.
407 (build_string_from_id): Remove.
409 2022-10-24 Marek Polacek <polacek@redhat.com>
412 * typeck.cc (treat_lvalue_as_rvalue_p): Check the return value of move.
414 2022-10-24 Jakub Jelinek <jakub@redhat.com>
417 * typeck.cc (cp_build_binary_op): Pass operands before excess precision
418 promotions to scalar_to_vector call.
420 2022-10-24 Jakub Jelinek <jakub@redhat.com>
423 * constexpr.cc (cxx_eval_increment_expression): For signed types
424 that promote to int, evaluate PLUS_EXPR or MINUS_EXPR in int type.
426 2022-10-24 Arsen Arsenović <arsen@aarsen.me>
428 * cp-tree.h (DECL_MAIN_P): Move most logic, besides the hosted
430 (DECL_MAIN_ANY_P): ... to here, so that it can be reused ...
431 (DECL_MAIN_FREESTANDING_P): ... here, with an additional
432 constraint on (hosted OR return type == int)
433 * decl.cc (finish_function): Use DECL_MAIN_FREESTANDING_P
434 instead of DECL_MAIN_P, to loosen the hosted requirement, but
435 check noreturn, before adding implicit returns.
437 2022-10-21 Jakub Jelinek <jakub@redhat.com>
440 * constexpr.cc (reduced_constant_expression_p) <case CONSTRUCTOR>:
441 Return false for VECTOR_TYPE CONSTRUCTORs even without
442 CONSTRUCTOR_NO_CLEARING set on them.
443 (cxx_eval_bare_aggregate): If constant but !changed, fold before
444 returning VECTOR_TYPE_P CONSTRUCTOR.
445 (cxx_eval_constant_expression) <case CONSTRUCTOR>: Don't fold
446 TREE_CONSTANT CONSTRUCTOR, just return it.
448 2022-10-21 Jakub Jelinek <jakub@redhat.com>
451 * semantics.cc (finish_compound_literal): For void{}, if
452 processing_template_decl return a COMPOUND_LITERAL_P
453 CONSTRUCTOR rather than void_node.
455 2022-10-20 Patrick Palka <ppalka@redhat.com>
457 * pt.cc (lookup_and_finish_template_variable): Don't
458 instantiate if the template's scope is dependent.
459 (tsubst_copy) <case TEMPLATE_DECL>: Pass entering_scope=true
460 when substituting the class scope.
462 2022-10-20 Patrick Palka <ppalka@redhat.com>
465 * module.cc (node_template_info): Handle CONCEPT_DECL.
467 2022-10-20 Jonathan Wakely <jwakely@redhat.com>
468 Ulrich Drepper <drepper@redhat.com>
470 * Make-lang.in: Add rules to generate std-name-hint.gperf. Adjust
471 rule to generate std-name-hint.h to allow chain rule.
472 * std-name-hint.h: Regenerated.
473 * std-name-hint.gperf: This file is now generated.
474 * cxxapi-data.csv: New file. CSV file with C++ API data.
475 * gen-cxxapi-file.py: New file. Generate std-name-hint.gperf
476 and module export source (in future).
478 2022-10-19 Marek Polacek <polacek@redhat.com>
481 * typeck.cc (maybe_warn_about_useless_cast): Don't warn when
482 a glvalue is cast to a non-reference type.
484 2022-10-18 Patrick Palka <ppalka@redhat.com>
487 * module.cc (trees_out::tpl_parms_fini): Don't assume default
488 template arguments must be trailing.
489 (trees_in::tpl_parms_fini): Likewise.
491 2022-10-18 Jakub Jelinek <jakub@redhat.com>
494 * cp-tree.h (build_assume_call): Declare.
495 * parser.cc (cp_parser_omp_assumption_clauses): Use build_assume_call.
496 * cp-gimplify.cc (build_assume_call): New function.
497 (process_stmt_assume_attribute): Use build_assume_call.
498 * pt.cc (tsubst_copy_and_build): Likewise.
500 2022-10-17 Patrick Palka <ppalka@redhat.com>
503 * module.cc (trees_out::write_function_def): Stream the
504 parms and result of the constexpr_fundef entry.
505 (trees_in::read_function_def): Likewise.
507 2022-10-14 Patrick Palka <ppalka@redhat.com>
510 * constexpr.cc (cxx_dynamic_cast_fn_p): Check for abi_node
511 instead of global_namespace.
512 * rtti.cc (build_dynamic_cast_1): Set DECL_CONTEXT and
513 DECL_SOURCE_LOCATION when building dynamic_cast_node. Push
514 it into the namespace.
516 2022-10-14 Jakub Jelinek <jakub@redhat.com>
518 * cp-tree.h (extended_float_type_p): Return true for
520 * typeck.cc (cp_compare_floating_point_conversion_ranks): Set
521 extended{1,2} if mv{1,2} is bfloat16_type_node. Adjust comment.
523 2022-10-14 Jakub Jelinek <jakub@redhat.com>
528 * cp-tree.h (cp_ep_convert_and_check): Remove.
529 * cvt.cc (cp_ep_convert_and_check): Remove.
530 * call.cc (build_conditional_expr): Use excess precision for ?: with
531 one arm floating and another integral. Don't convert first to
532 semantic result type from integral types.
533 (convert_like_internal): Don't call cp_ep_convert_and_check, instead
534 just strip EXCESS_PRECISION_EXPR before calling cp_convert_and_check
536 * typeck.cc (cp_build_binary_op): Set may_need_excess_precision
537 for comparisons or SPACESHIP_EXPR with at least one operand integral.
538 Don't compute semantic_result_type if build_type is non-NULL. Call
539 cp_convert_and_check instead of cp_ep_convert_and_check.
541 2022-10-14 Jakub Jelinek <jakub@redhat.com>
545 * parser.cc (cp_parser_primary_expression): Handle
546 EXCESS_PRECISION_EXPR with REAL_CST operand the same as REAL_CST.
547 * cvt.cc (cp_ep_convert_and_check): New function.
548 * call.cc (build_conditional_expr): Add excess precision support.
549 When type_after_usual_arithmetic_conversions returns error_mark_node,
550 use gcc_checking_assert that it is because of uncomparable floating
551 point ranks instead of checking all those conditions and make it
552 work also with complex types.
553 (convert_like_internal): Likewise. Add NESTED_P argument, pass true
554 to recursive calls to convert_like.
555 (convert_like): Add NESTED_P argument, pass it through to
556 convert_like_internal. For other overload pass false to it.
557 (convert_like_with_context): Pass false to NESTED_P.
558 (convert_arg_to_ellipsis): Add excess precision support.
559 (magic_varargs_p): For __builtin_is{finite,inf,inf_sign,nan,normal}
560 and __builtin_fpclassify return 2 instead of 1, document what it
562 (build_over_call): Don't handle former magic 2 which is no longer
563 used, instead for magic 1 remove EXCESS_PRECISION_EXPR.
564 (perform_direct_initialization_if_possible): Pass false to NESTED_P
565 convert_like argument.
566 * constexpr.cc (cxx_eval_constant_expression): Handle
567 EXCESS_PRECISION_EXPR.
568 (potential_constant_expression_1): Likewise.
569 * pt.cc (tsubst_copy, tsubst_copy_and_build): Likewise.
570 * cp-tree.h (cp_ep_convert_and_check): Declare.
571 * cp-gimplify.cc (cp_fold): Handle EXCESS_PRECISION_EXPR.
572 * typeck.cc (cp_common_type): For COMPLEX_TYPEs, return error_mark_node
573 if recursive call returned it.
574 (convert_arguments): For magic 1 remove EXCESS_PRECISION_EXPR.
575 (cp_build_binary_op): Add excess precision support. When
576 cp_common_type returns error_mark_node, use gcc_checking_assert that
577 it is because of uncomparable floating point ranks instead of checking
578 all those conditions and make it work also with complex types.
579 (cp_build_unary_op): Likewise.
580 (cp_build_compound_expr): Likewise.
581 (build_static_cast_1): Remove EXCESS_PRECISION_EXPR.
583 2022-10-13 Jason Merrill <jason@redhat.com>
585 * cp-tree.h: Fix whitespace.
586 * parser.h: Fix whitespace.
587 * decl.cc: Fix whitespace.
588 * parser.cc: Fix whitespace.
589 * pt.cc: Fix whitespace.
591 2022-10-13 Martin Liska <mliska@suse.cz>
593 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Emit
594 an artificial variable that would be put into .preinit_array
597 2022-10-13 Marek Polacek <polacek@redhat.com>
600 * except.cc (maybe_splice_retval_cleanup): Check current_function_decl.
603 2022-10-12 Marek Polacek <polacek@redhat.com>
605 * call.cc (standard_conversion): Remove LOOKUP_PREFER_RVALUE code.
606 (reference_binding): Honor clk_implicit_rval even pre-C++20.
607 (implicit_conversion_1): Remove LOOKUP_PREFER_RVALUE code.
608 (build_user_type_conversion_1): Likewise.
609 (convert_like_internal): Likewise.
610 (build_over_call): Likewise.
611 * cp-tree.h (LOOKUP_PREFER_RVALUE): Remove.
612 (LOOKUP_NO_NARROWING): Adjust definition.
613 * except.cc (build_throw): Don't perform two overload resolutions.
614 * typeck.cc (maybe_warn_pessimizing_move): Don't use
615 LOOKUP_PREFER_RVALUE.
616 (check_return_expr): Don't perform two overload resolutions.
618 2022-10-12 Jason Merrill <jason@redhat.com>
621 * cp-tree.h (source_location_current_p): Remove.
622 * name-lookup.h (struct cp_binding_level): Remove
624 * call.cc (in_immediate_context): All default args
625 and DMI are potentially immediate context.
626 (immediate_invocation_p): Don't treat source_location specially.
627 (struct in_consteval_if_p_temp_override): Move to cp-tree.h.
628 * constexpr.cc (get_nth_callarg): Move to cp-tree.h.
629 * cp-gimplify.cc (cp_fold_r): Don't fold consteval.
630 * name-lookup.cc (begin_scope): Don't set immediate_fn_ctx_p.
631 * parser.cc (cp_parser_lambda_declarator_opt): Likewise.
632 (cp_parser_direct_declarator): Likewise.
633 * pt.cc (tsubst_default_argument): Open sk_function_parms level.
634 * tree.cc (source_location_current_p): Remove.
635 (bot_replace): Fold consteval here.
636 (break_out_target_exprs): Handle errors.
638 2022-10-11 Patrick Palka <ppalka@redhat.com>
641 * pt.cc (tsubst_friend_function): Propagate DECL_MODULE_PURVIEW_P
642 from the introduced namespace-scope function to the namespace.
644 2022-10-11 Patrick Palka <ppalka@redhat.com>
647 * module.cc (lazy_load_binding): Clear processing_template_decl.
648 (lazy_load_pendings): Likewise.
650 2022-10-10 Nathan Sidwell <nathan@acm.org>
652 * mangle.cc (write_prefix): Add VAR_DECL & FIELD_DECL to
653 substitution table under abi=18. Note possible mismatch.
655 2022-10-10 Marek Polacek <polacek@redhat.com>
658 * error.cc: Include "attribs.h".
659 (dump_type_prefix): Print only GNU attributes here.
660 (dump_type_suffix): Print standard attributes here.
662 2022-10-08 Jason Merrill <jason@redhat.com>
664 * cp-tree.h (TARGET_EXPR_ELIDING_P): New.
665 (unsafe_copy_elision_p, set_target_expr_eliding)
666 (cp_build_init_expr): Declare.
667 * call.cc (unsafe_copy_elision_p): No longer static.
668 (build_over_call, build_special_member_call)
669 (build_new_method_call): Use cp_build_init_expr.
670 * coroutines.cc (expand_one_await_expression)
671 (build_actor_fn, flatten_await_stmt, handle_nested_conditionals)
672 (await_statement_walker, morph_fn_to_coro): Use cp_build_init_expr.
673 * cp-gimplify.cc (cp_gimplify_init_expr)
674 (cp_gimplify_expr): Check TARGET_EXPR_ELIDING_P.
675 (cp_fold_r): Propagate it.
676 (cp_fold): Use cp_build_init_expr.
677 * decl.cc (check_initializer): Use cp_build_init_expr.
678 * except.cc (build_throw): Use cp_build_init_expr.
679 * init.cc (get_nsdmi): Call set_target_expr_eliding.
680 (perform_member_init, expand_default_init, expand_aggr_init_1)
681 (build_new_1, build_vec_init): Use cp_build_init_expr.
682 * method.cc (do_build_copy_constructor): Use cp_build_init_expr.
683 * semantics.cc (simplify_aggr_init_expr, finalize_nrv_r)
684 (finish_omp_reduction_clause): Use cp_build_init_expr.
685 * tree.cc (build_target_expr): Call set_target_expr_eliding.
686 (bot_manip): Copy TARGET_EXPR_ELIDING_P.
687 * typeck.cc (cp_build_modify_expr): Call set_target_expr_eliding.
688 (check_return_expr): Use cp_build_modify_expr.
689 * typeck2.cc (split_nonconstant_init_1)
690 (split_nonconstant_init): Use cp_build_init_expr.
691 (massage_init_elt): Call set_target_expr_eliding.
692 (process_init_constructor_record): Clear TARGET_EXPR_ELIDING_P on
694 (set_target_expr_eliding, cp_build_init_expr): New.
696 2022-10-07 Marek Polacek <polacek@redhat.com>
699 * call.cc (conv_binds_ref_to_temporary): New.
700 (ref_conv_binds_directly): Rename to...
701 (ref_conv_binds_to_temporary): ...this. Use
702 conv_binds_ref_to_temporary.
703 * cp-tree.h (ref_conv_binds_directly): Rename to...
704 (ref_conv_binds_to_temporary): ...this.
705 * method.cc (ref_xes_from_temporary): Use ref_conv_binds_to_temporary.
706 * parser.cc (warn_for_range_copy): Likewise.
708 2022-10-07 Qing Zhao <qing.zhao@oracle.com>
710 * module.cc (trees_out::core_bools): Stream out new bit
712 (trees_in::core_bools): Stream in new bit decl_not_flexarray.
714 2022-10-07 Patrick Palka <ppalka@redhat.com>
716 * module.cc (trees_out::mark_class_def): Guard against
717 DECL_BIT_FIELD_REPRESENTATIVE not being a decl.
719 2022-10-07 Jason Merrill <jason@redhat.com>
721 * init.cc (expand_default_init): Also push the INIT_EXPR inside a
724 2022-10-07 Patrick Palka <ppalka@redhat.com>
727 * module.cc (trees_out::core_bools): Don't override
728 DECL_EXTERNAL to true for static variables from an inline
731 2022-10-07 Martin Liska <mliska@suse.cz>
733 * module.cc (enum module_state_counts): Use array size.
734 * name-lookup.cc (class namespace_limit_reached): Likewise.
735 (class module_state): Move up in the file.
737 2022-10-07 Jakub Jelinek <jakub@redhat.com>
739 * parser.cc (cp_parser_check_std_attribute): Only do checks if
740 attribute is a standard attribute or in gnu namespace and only
741 lookup other attributes in those namespaces.
742 * cp-gimplify.cc (lookup_hotness_attribute): Adjust function comment.
743 Only return true for standard attribute or gnu namespace attribute.
744 (remove_hotness_attribute): Only remove hotness attributes when
745 they are standard or in gnu namespace, implement it in a single
746 loop rather than former 4 now 8 remove_attribute calls.
748 2022-10-06 Jason Merrill <jason@redhat.com>
750 * coroutines.cc (expand_one_await_expression): Change conversion
751 to VIEW_CONVERT_EXPR.
752 * cp-gimplify.cc (cp_genericize_r) [CONVERT_EXPR]: Add assert.
754 2022-10-06 Joseph Myers <joseph@codesourcery.com>
756 * lex.cc (init_reswords): Handle D_EXT11.
758 2022-10-06 Patrick Palka <ppalka@redhat.com>
760 * pt.cc (optimize_specialization_lookup_p): Remove.
761 (retrieve_specialization): Assume the above returns false
762 and simplify accordingly.
763 (register_specialization): Likewise.
765 2022-10-06 Jakub Jelinek <jakub@redhat.com>
767 * parser.cc (cp_parser_omp_assumption_clauses): Emit IFN_ASSUME
768 call for holds clause on assume construct.
770 2022-10-06 Jakub Jelinek <jakub@redhat.com>
773 * cp-tree.h (process_stmt_assume_attribute): Implement C++23
774 P1774R8 - Portable assumptions. Declare.
775 (diagnose_failing_condition): Declare.
776 (find_failing_clause): Likewise.
777 * parser.cc (assume_attr): New enumerator.
778 (cp_parser_parenthesized_expression_list): Handle assume_attr.
779 Remove identifier variable, for id_attr push the identifier into
780 expression_list right away instead of inserting it before all the
782 (cp_parser_conditional_expression): New function.
783 (cp_parser_constant_expression): Use it.
784 (cp_parser_statement): Handle assume attribute.
785 (cp_parser_expression_statement): Likewise.
786 (cp_parser_gnu_attribute_list): Use assume_attr for assume
788 (cp_parser_std_attribute): Likewise. Handle standard assume
789 attribute like gnu::assume.
790 * cp-gimplify.cc (process_stmt_assume_attribute): New function.
791 * constexpr.cc: Include fold-const.h.
792 (find_failing_clause_r, find_failing_clause): New functions,
793 moved from semantics.cc with ctx argument added and if non-NULL,
794 call cxx_eval_constant_expression rather than fold_non_dependent_expr.
795 (cxx_eval_internal_function): Handle IFN_ASSUME.
796 (potential_constant_expression_1): Likewise.
797 * pt.cc (tsubst_copy_and_build): Likewise.
798 * semantics.cc (diagnose_failing_condition): New function.
799 (find_failing_clause_r, find_failing_clause): Moved to constexpr.cc.
800 (finish_static_assert): Use it. Add auto_diagnostic_group.
802 2022-10-05 Jason Merrill <jason@redhat.com>
804 * tree.cc (lvalue_kind) [VIEW_CONVERT_EXPR]: Change prvalue to
807 2022-10-04 Jason Merrill <jason@redhat.com>
810 * cp-gimplify.cc (cp_genericize_init_expr): Use iloc_sentinel.
811 (cp_genericize_target_expr): Likewise.
813 2022-10-04 Patrick Palka <ppalka@redhat.com>
816 * Make-lang.in (CP_PLUGIN_HEADERS): Add cp-trait.def.
818 2022-10-04 Jakub Jelinek <jakub@redhat.com>
820 * cp-tree.h (struct omp_declare_target_attr): Rename to ...
821 (cp_omp_declare_target_attr): ... this. Add device_type member.
822 (omp_begin_assumes_data): Rename to ...
823 (cp_omp_begin_assumes_data): ... this.
824 (struct saved_scope): Change types of omp_declare_target_attribute
825 and omp_begin_assumes.
826 * parser.cc (cp_parser_omp_clause_device_type): Uncomment
827 check_no_duplicate_clause call.
828 (cp_parser_omp_all_clauses): Fix up pasto, c_name for OMP_CLAUSE_LINK
829 should be "link" rather than "to".
830 (cp_parser_omp_declare_target): Adjust for omp_declare_target_attr
831 to cp_omp_declare_target_attr changes, push -1 as device_type. Use
832 error_at rather than warning_at for declare target with only
834 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
835 (cp_parser_omp_begin): Add begin declare target support. Adjust
836 for omp_begin_assumes_data to cp_omp_begin_assumes_data change.
837 (cp_parser_omp_end): Adjust for the
838 omp_declare_target_attr to cp_omp_declare_target_attr and
839 omp_begin_assumes_data to cp_omp_begin_assumes_data type changes,
840 adjust diagnostics wording and simplify format strings for easier
842 * semantics.cc (finish_translation_unit): Likewise.
843 * decl2.cc (cplus_decl_attributes): If device_type was present on
844 begin declare target, add "omp declare target host" and/or
845 "omp declare target nohost" attributes.
847 2022-10-03 Jakub Jelinek <jakub@redhat.com>
849 * cp-tree.h (BCS_STMT_EXPR): New enumerator.
850 * name-lookup.h (enum scope_kind): Add sk_stmt_expr.
851 * name-lookup.cc (begin_scope): Handle sk_stmt_expr like sk_block.
852 * semantics.cc (begin_compound_stmt): For BCS_STMT_EXPR use
854 * parser.cc (cp_parser_statement_expr): Use BCS_STMT_EXPR instead of
856 * decl.cc (struct named_label_entry): Add in_stmt_expr.
857 (poplevel_named_label_1): Handle sk_stmt_expr.
858 (check_previous_goto_1): Diagnose entering of statement expression.
859 (check_goto): Likewise.
861 2022-10-03 Patrick Palka <ppalka@redhat.com>
863 * constraint.cc (diagnose_trait_expr): Use CPTK_IS_SAME instead
865 * cp-trait.def (IS_SAME_AS): Rename to ...
867 * pt.cc (alias_ctad_tweaks): Use CPTK_IS_SAME instead of
869 * semantics.cc (trait_expr_value): Likewise.
870 (finish_trait_expr): Likewise.
872 2022-10-01 Patrick Palka <ppalka@redhat.com>
874 * semantics.cc (trait_expr_value): Make cp_trait_kind switch
875 statement exhaustive.
876 (finish_trait_expr): Likewise.
877 (finish_trait_type): Likewise.
879 2022-10-01 Jason Merrill <jason@redhat.com>
881 * init.cc (build_vec_init): Clear from_array for CONSTRUCTOR
884 2022-10-01 Jason Merrill <jason@redhat.com>
886 * cp-gimplify.cc (cp_genericize_init): Also convert the result of
887 split_nonconstant_init to void.
889 2022-09-30 Patrick Palka <ppalka@redhat.com>
891 * constraint.cc (diagnose_trait_expr): Likewise.
892 * cp-objcp-common.cc (names_builtin_p): Likewise.
893 * cp-tree.h (enum cp_trait_kind): Likewise.
894 * cxx-pretty-print.cc (pp_cxx_trait): Likewise.
895 * parser.cc (cp_keyword_starts_decl_specifier_p): Likewise.
896 (cp_parser_primary_expression): Likewise.
897 (cp_parser_trait): Likewise.
898 (cp_parser_simple_type_specifier): Likewise.
899 * cp-trait.def: New file.
901 2022-09-30 Jason Merrill <jason@redhat.com>
903 * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: Collapse
904 TARGET_EXPR within TARGET_EXPR.
905 * constexpr.cc (cxx_eval_outermost_constant_expr): Avoid
906 adding redundant TARGET_EXPR.
907 * cp-tree.h (target_expr_needs_replace): VEC_INIT_EXPR doesn't.
909 2022-09-29 Patrick Palka <ppalka@redhat.com>
912 * pt.cc (listify): Use lookup_qualified_name instead of
913 get_namespace_binding.
915 2022-09-29 Jason Merrill <jason@redhat.com>
917 * class.cc (check_methods): Call constraints_satisfied_p.
919 2022-09-29 Jason Merrill <jason@redhat.com>
921 * constexpr.cc (potential_constant_expression_1): Look into
922 DECL_INITIAL. Use location wrappers.
924 2022-09-29 Jason Merrill <jason@redhat.com>
927 * call.cc (build_conditional_expr): For a?:c extension, treat
928 a reused class prvalue as an xvalue.
930 2022-09-29 Jason Merrill <jason@redhat.com>
932 * call.cc (build_conditional_expr): Set TARGET_EXPR_NO_ELIDE on the
935 2022-09-29 Patrick Palka <ppalka@redhat.com>
937 * constraint.cc (diagnose_trait_expr): Handle CPTK_REMOVE_CV,
938 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
939 * cp-objcp-common.cc (names_builtin_p): Likewise.
940 * cp-tree.h (enum cp_trait_kind): Add CPTK_REMOVE_CV,
941 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
942 * cxx-pretty-print.cc (pp_cxx_trait): Handle CPTK_REMOVE_CV,
943 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
944 * parser.cc (cp_keyword_starts_decl_specifier_p): Return true
945 for RID_REMOVE_CV, RID_REMOVE_REFERENCE and RID_REMOVE_CVREF.
946 (cp_parser_trait): Handle RID_REMOVE_CV, RID_REMOVE_REFERENCE
947 and RID_REMOVE_CVREF.
948 (cp_parser_simple_type_specifier): Likewise.
949 * semantics.cc (finish_trait_type): Likewise.
951 2022-09-29 Patrick Palka <ppalka@redhat.com>
953 * cp-objcp-common.cc (cp_common_init_ts): Replace
954 UNDERLYING_TYPE with TRAIT_TYPE.
955 * cp-tree.def (TRAIT_TYPE): Define.
956 (UNDERLYING_TYPE): Remove.
957 * cp-tree.h (TRAIT_TYPE_KIND_RAW): Define.
958 (TRAIT_TYPE_KIND): Define.
959 (TRAIT_TYPE_TYPE1): Define.
960 (TRAIT_TYPE_TYPE2): Define.
961 (WILDCARD_TYPE_P): Return true for TRAIT_TYPE.
962 (finish_trait_type): Declare.
963 * cxx-pretty-print.cc (cxx_pretty_printer::primary_expression):
964 Adjust after renaming pp_cxx_trait_expression.
965 (cxx_pretty_printer::simple_type_specifier) <case TRAIT_TYPE>:
967 (cxx_pretty_printer::type_id): Replace UNDERLYING_TYPE with
969 (pp_cxx_trait_expression): Rename to ...
970 (pp_cxx_trait): ... this. Handle TRAIT_TYPE as well. Correct
971 pretty printing of the trailing arguments.
972 * cxx-pretty-print.h (pp_cxx_trait_expression): Rename to ...
973 (pp_cxx_trait_type): ... this.
974 * error.cc (dump_type) <case UNDERLYING_TYPE>: Remove.
975 <case TRAIT_TYPE>: New.
976 (dump_type_prefix): Replace UNDERLYING_WITH with TRAIT_TYPE.
977 (dump_type_suffix): Likewise.
978 * mangle.cc (write_type) <case UNDERLYING_TYPE>: Remove.
979 <case TRAIT_TYPE>: New.
980 * module.cc (trees_out::type_node) <case UNDERLYING_TYPE>:
982 <case TRAIT_TYPE>: New.
983 (trees_in::tree_node): Likewise.
984 * parser.cc (cp_parser_primary_expression): Adjust after
985 renaming cp_parser_trait_expr.
986 (cp_parser_trait_expr): Rename to ...
987 (cp_parser_trait): ... this. Call finish_trait_type for traits
989 (cp_parser_simple_type_specifier): Adjust after renaming
990 cp_parser_trait_expr.
991 * pt.cc (for_each_template_parm_r) <case UNDERLYING_TYPE>:
993 <case TRAIT_TYPE>: New.
995 (unify): Replace UNDERLYING_TYPE with TRAIT_TYPE.
996 (dependent_type_p_r): Likewise.
997 * semantics.cc (finish_underlying_type): Don't return
998 UNDERLYING_TYPE anymore when processing_template_decl.
999 (finish_trait_type): Define.
1000 * tree.cc (strip_typedefs) <case UNDERLYING_TYPE>: Remove.
1001 <case TRAIT_TYPE>: New.
1002 (cp_walk_subtrees): Likewise.
1003 * typeck.cc (structural_comptypes): Likewise.
1005 2022-09-29 Nathan Sidwell <nathan@acm.org>
1008 * module.cc (enum tree_tag): Add tt_nttp_var.
1009 (trees_out::decl_node): Handle NTTP objects.
1010 (trees_in::tree_node): Handle tt_nttp_var.
1011 (depset::hash::add_binding_entry): Skip NTTP objects.
1013 2022-09-28 Eugene Rozenfeld <erozen@microsoft.com>
1015 * module.cc (write_location): Write discriminator.
1016 (read_location): Read discriminator.
1018 2022-09-28 Nathan Sidwell <nathan@acm.org>
1020 * cp-tree.h (DECL_NTTP_OBJECT_P): New.
1021 (template_parm_object_p): Delete.
1022 (build_template_parm_object): Declare.
1023 * cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P.
1024 * error.cc (dump_simple_decl): Likewise.
1025 * mangle.cc (write_template_arg): Likewise.
1026 * pt.cc (template_parm_object_p): Delete.
1027 (create_template_parm_object): Separated out checking from ...
1028 (get_template_parm_object): ... this, new external entry point.
1030 2022-09-27 Marek Polacek <polacek@redhat.com>
1034 * call.cc (reference_binding): Check clk_implicit_rval in C++20 only.
1035 * cp-tree.h (unparenthesized_id_or_class_member_access_p): Declare.
1036 * pt.cc (unparenthesized_id_or_class_member_access_p): New function,
1038 (do_auto_deduction): ...here. Use it. In C++23, maybe call
1039 treat_lvalue_as_rvalue_p.
1040 * tree.cc (xvalue_p): Check & clk_rvalueref, not == clk_rvalueref.
1041 * typeck.cc (check_return_expr): Allow implicit move for functions
1042 returning a reference as well, or when the return value type is not
1045 2022-09-27 Marek Polacek <polacek@redhat.com>
1047 * constraint.cc (diagnose_trait_expr): Say "nothrow" without quotes
1048 rather than in quotes.
1050 2022-09-27 Jonathan Wakely <jwakely@redhat.com>
1053 * method.cc (is_convertible_helper): Use access check sentinel.
1055 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1058 * cp-tree.h (LAMBDA_EXPR_STATIC_P): Implement C++23
1059 P1169R4 - static operator(). Define.
1060 * parser.cc (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Document
1061 that it also allows static.
1062 (cp_parser_lambda_declarator_opt): Handle static lambda specifier.
1063 (cp_parser_decl_specifier_seq): Allow RID_STATIC for
1064 CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
1065 * decl.cc (grok_op_properties): If operator() isn't a method,
1066 use a different error wording, if it is static member function,
1067 allow it (for C++20 and older with a pedwarn unless it is
1068 a lambda function or template instantiation).
1069 * call.cc (joust): Don't ICE if one candidate is static member
1070 function and the other is an indirect call. If the parameter
1071 conversion on the other candidate is user defined conversion,
1072 ellipsis or bad conversion, make static member function candidate
1073 a winner for that parameter.
1074 * lambda.cc (maybe_add_lambda_conv_op): Handle static lambdas.
1075 * error.cc (dump_lambda_function): Print static for static lambdas.
1077 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1079 * cp-tree.h (struct omp_begin_assumes_data): New type.
1080 (struct saved_scope): Add omp_begin_assumes member.
1081 * parser.cc: Include bitmap.h.
1082 (cp_parser_omp_assumption_clauses, cp_parser_omp_assume,
1083 cp_parser_omp_assumes, cp_parser_omp_begin): New functions.
1084 (cp_parser_omp_end_declare_target): Rename to ...
1085 (cp_parser_omp_end): ... this. Handle also end assumes.
1086 (cp_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
1087 (cp_parser_pragma): Handle PRAGMA_OMP_ASSUME, PRAGMA_OMP_ASSUMES
1088 and PRAGMA_OMP_BEGIN. Handle PRAGMA_OMP_END rather than
1089 PRAGMA_OMP_END_DECLARE_TARGET and call cp_parser_omp_end
1090 for it rather than cp_parser_omp_end_declare_target.
1091 * pt.cc (apply_late_template_attributes): Also temporarily clear
1093 * semantics.cc (finish_translation_unit): Also diagnose
1094 #pragma omp begin assumes without corresponding
1095 #pragma omp end assumes.
1097 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1099 * parser.cc (cp_parser_lambda_declarator_opt): Don't diagnose
1100 conflicting specifiers here.
1101 (cp_storage_class_name): New variable.
1102 (cp_parser_decl_specifier_seq): When setting conflicting_specifiers_p
1103 for the first time, diagnose which exact specifiers conflict.
1104 (cp_parser_set_storage_class): Likewise. Move storage_class
1105 computation earlier.
1106 * decl.cc (grokdeclarator): Don't diagnose conflicting specifiers
1107 here, just return error_mark_node.
1109 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1113 * cp-tree.h (cp_compare_floating_point_conversion_ranks): Implement
1114 P1467R9 - Extended floating-point types and standard names except
1115 for std::bfloat16_t for now. Declare.
1116 (extended_float_type_p): New inline function.
1117 * mangle.cc (write_builtin_type): Mangle float{16,32,64,128}_type_node
1118 as DF{16,32,64,128}_. Mangle float{32,64,128}x_type_node as
1119 DF{32,64,128}x. Remove FIXED_POINT_TYPE mangling that conflicts
1121 * typeck2.cc (check_narrowing): If one of ftype or type is extended
1122 floating-point type, compare floating-point conversion ranks.
1123 * parser.cc (cp_keyword_starts_decl_specifier_p): Handle
1125 (cp_parser_simple_type_specifier): Likewise and diagnose missing
1126 _Float<N> or _Float<N>x support if not supported by target.
1127 * typeck.cc (cp_compare_floating_point_conversion_ranks): New function.
1128 (cp_common_type): If both types are REAL_TYPE and one or both are
1129 extended floating-point types, select common type based on comparison
1130 of floating-point conversion ranks and subranks.
1131 (cp_build_binary_op): Diagnose operation with floating point arguments
1132 with unordered conversion ranks.
1133 * call.cc (standard_conversion): For floating-point conversion, if
1134 either from or to are extended floating-point types, set conv->bad_p
1135 for implicit conversion from larger to smaller conversion rank or
1136 with unordered conversion ranks.
1137 (convert_like_internal): Emit a pedwarn on such conversions.
1138 (build_conditional_expr): Diagnose operation with floating point
1139 arguments with unordered conversion ranks.
1140 (convert_arg_to_ellipsis): Don't promote extended floating-point types
1141 narrower than double to double.
1142 (compare_ics): Implement P1467R9 [over.ics.rank]/4 changes.
1144 2022-09-26 Marek Polacek <polacek@redhat.com>
1147 * typeck2.cc (array_string_literal_compatible_p): Allow
1148 initializing arrays of char or unsigned char by a UTF-8 string literal.
1150 2022-09-26 Marek Polacek <polacek@redhat.com>
1153 * method.cc (is_convertible_helper): New.
1154 (is_convertible): Use it.
1155 (is_nothrow_convertible): Likewise.
1157 2022-09-26 Patrick Palka <ppalka@redhat.com>
1160 * module.cc (trees_in::decl_value): In the MK_partial case for
1161 a variable template partial specialization, pass decl_p=true to
1162 add_mergeable_specialization, and set spec to the VAR_DECL not
1164 * pt.cc (add_mergeable_specialization): For a variable template
1165 partial specialization, set the TREE_TYPE of the new
1166 DECL_TEMPLATE_SPECIALIZATIONS node to the TREE_TYPE of the
1167 VAR_DECL not the VAR_DECL itself.
1169 2022-09-23 Marek Polacek <polacek@redhat.com>
1172 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONVERTIBLE
1173 and CPTK_IS_NOTHROW_CONVERTIBLE.
1174 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_CONVERTIBLE
1175 RID_IS_NOTHROW_CONVERTIBLE.
1176 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_CONVERTIBLE and
1177 CPTK_IS_NOTHROW_CONVERTIBLE.
1178 (is_convertible): Declare.
1179 (is_nothrow_convertible): Likewise.
1180 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1181 CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE.
1182 * method.cc (is_convertible): New.
1183 (is_nothrow_convertible): Likewise.
1184 * parser.cc (cp_parser_primary_expression): Handle RID_IS_CONVERTIBLE
1185 and RID_IS_NOTHROW_CONVERTIBLE.
1186 (cp_parser_trait_expr): Likewise.
1187 * semantics.cc (trait_expr_value): Handle CPTK_IS_CONVERTIBLE and
1188 CPTK_IS_NOTHROW_CONVERTIBLE.
1189 (finish_trait_expr): Likewise.
1191 2022-09-23 Marek Polacek <polacek@redhat.com>
1194 * typeck2.cc (split_nonconstant_init_1): Check TYPE_P.
1196 2022-09-22 Patrick Palka <ppalka@redhat.com>
1199 * module.cc (trees_out::decl_value): Use get_template_info in
1200 the MK_partial case to handle both VAR_DECL and TYPE_DECL.
1201 (trees_out::key_mergeable): Likewise.
1202 (trees_in::key_mergeable): Likewise.
1203 (has_definition): Consider DECL_INITIAL of a partial variable
1204 template specialization.
1205 (depset::hash::make_dependency): Handle partial variable template
1206 specializations too.
1208 2022-09-20 Patrick Palka <ppalka@redhat.com>
1210 * decl.cc (cp_finish_decl): After updating the deduced type of a
1211 VAR_DECL, also update the corresponding TEMPLATE_DECL if there
1214 2022-09-20 Patrick Palka <ppalka@redhat.com>
1217 * module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
1218 Stream PACK_EXPANSION_EXTRA_ARGS.
1219 (trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
1221 2022-09-17 Patrick Palka <ppalka@redhat.com>
1223 * module.cc (friend_from_decl_list): Don't consider
1224 CLASSTYPE_TEMPLATE_INFO for a TYPENAME_TYPE friend.
1225 (trees_in::read_class_def): Don't add to
1226 CLASSTYPE_BEFRIENDING_CLASSES for a TYPENAME_TYPE friend.
1228 2022-09-16 Patrick Palka <ppalka@redhat.com>
1231 * constexpr.cc (cxx_eval_component_reference): Check non_constant_p
1232 sooner. In C++14 or later, reject a DECL_MUTABLE_P member access
1233 only if CONSTRUCTOR_MUTABLE_POISION is also set.
1235 2022-09-16 Jason Merrill <jason@redhat.com>
1238 * parser.cc (cp_parser_omp_var_list_no_open): Pass the
1239 initial token location down.
1240 * semantics.cc (finish_omp_clauses): Check
1241 invalid_nonstatic_memfn_p.
1242 * typeck.cc (invalid_nonstatic_memfn_p): Handle null TREE_TYPE.
1244 2022-09-15 Richard Biener <rguenther@suse.de>
1246 * decl.cc (cxx_init_decl_processing): Inline last
1247 build_void_list_node call.
1248 (build_void_list_node): Remove.
1250 2022-09-14 Julian Brown <julian@codesourcery.com>
1252 * semantics.cc (finish_omp_clauses): Likewise.
1254 2022-09-13 Patrick Palka <ppalka@redhat.com>
1256 * cp-tree.h (mark_used): Remove single-parameter overload. Add
1257 default argument to the two-parameter overload.
1258 * decl2.cc (mark_used): Likewise.
1260 2022-09-13 Patrick Palka <ppalka@redhat.com>
1262 * cp-tree.h (cxx_constant_value): Define two-parameter version
1263 that omits the object parameter.
1264 * decl.cc (build_explicit_specifier): Omit NULL_TREE object
1265 argument to cxx_constant_value.
1266 * except.cc (build_noexcept_spec): Likewise.
1267 * pt.cc (expand_integer_pack): Likewise.
1268 (fold_targs_r): Likewise.
1269 * semantics.cc (finish_if_stmt_cond): Likewise.
1271 2022-09-13 Patrick Palka <ppalka@redhat.com>
1273 * decl.cc (build_explicit_specifier): Pass complain to
1275 * except.cc (build_noexcept_spec): Likewise.
1276 * pt.cc (expand_integer_pack): Likewise.
1277 (tsubst_function_decl): Propagate error_mark_node returned
1278 from build_explicit_specifier.
1280 2022-09-12 Patrick Palka <ppalka@redhat.com>
1282 * call.cc (build_conditional_expr): Adjust calls to
1283 '_sfinae'-suffixed functions.
1284 (build_temp): Likewise.
1285 (convert_like_internal): Likewise.
1286 (convert_arg_to_ellipsis): Likewise.
1287 (build_over_call): Likewise.
1288 (build_cxx_call): Likewise.
1289 (build_new_method_call): Likewise.
1290 * constexpr.cc (cxx_eval_outermost_constant_expr): Likewise.
1291 (cxx_constant_value_sfinae): Rename to ...
1292 (cxx_constant_value): ... this. Document its default arguments.
1293 (fold_non_dependent_expr): Adjust function comment.
1294 * cp-tree.h (instantiate_non_dependent_expr_sfinae): Rename to ...
1295 (instantiate_non_dependent_expr): ... this. Give its 'complain'
1296 parameter a default argument.
1297 (get_target_expr_sfinae, get_target_expr): Likewise.
1298 (require_complete_type_sfinae, require_complete_type): Likewise.
1299 (abstract_virtuals_error_sfinae, abstract_virtuals_error):
1301 (cxx_constant_value_sfinae, cxx_constant_value): Likewise.
1302 * cvt.cc (build_up_reference): Adjust calls to '_sfinae'-suffixed
1304 (ocp_convert): Likewise.
1305 * decl.cc (build_explicit_specifier): Likewise.
1306 * except.cc (build_noexcept_spec): Likewise.
1307 * init.cc (build_new_1): Likewise.
1308 * pt.cc (expand_integer_pack): Likewise.
1309 (instantiate_non_dependent_expr_internal): Adjust function
1311 (instantiate_non_dependent_expr): Rename to ...
1312 (instantiate_non_dependent_expr_sfinae): ... this. Document its
1314 (tsubst_init): Adjust calls to '_sfinae'-suffixed functions.
1315 (fold_targs_r): Likewise.
1316 * semantics.cc (finish_compound_literal): Likewise.
1317 (finish_decltype_type): Likewise.
1318 (cp_build_bit_cast): Likewise.
1319 * tree.cc (build_cplus_new): Likewise.
1320 (get_target_expr): Rename to ...
1321 (get_target_expr_sfinae): ... this. Document its default
1323 * typeck.cc (require_complete_type): Rename to ...
1324 (require_complete_type_sfinae): ... this. Document its default
1326 (cp_build_array_ref): Adjust calls to '_sfinae'-suffixed
1328 (convert_arguments): Likewise.
1329 (cp_build_binary_op): Likewise.
1330 (build_static_cast_1): Likewise.
1331 (cp_build_modify_expr): Likewise.
1332 (convert_for_initialization): Likewise.
1333 * typeck2.cc (abstract_virtuals_error): Rename to ...
1334 (abstract_virtuals_error_sfinae): ... this. Document its default
1336 (build_functional_cast_1): Adjust calls to '_sfinae'-suffixed
1339 2022-09-12 Patrick Palka <ppalka@redhat.com>
1342 * pt.cc (tsubst_template_args): Set cp_evaluated here.
1343 (tsubst_aggr_type): Not here.
1345 2022-09-12 Jason Merrill <jason@redhat.com>
1349 * decl.cc (cp_finish_decl): Call mark_single_function.
1351 2022-09-12 Jason Merrill <jason@redhat.com>
1354 * pt.cc (type_dependent_expression_p): Treat a compound
1355 literal of array-of-unknown-bound type like a variable.
1357 2022-09-12 Jason Merrill <jason@redhat.com>
1360 * lambda.cc (type_deducible_expression_p): Check
1361 array_of_unknown_bound_p.
1363 2022-09-12 Jonathan Wakely <jwakely@redhat.com>
1366 * decl2.cc (constrain_class_visibility): Adjust wording of
1367 -Wsubobject-linkage for cases where anonymous
1368 namespaces aren't used.
1369 * tree.cc (decl_anon_ns_mem_p): Now only true for actual anonymous
1370 namespace members, rename old semantics to...
1371 (decl_internal_context_p): ...this.
1372 * cp-tree.h, name-lookup.cc, pt.cc: Adjust.
1374 2022-09-08 Jonathan Wakely <jwakely@redhat.com>
1377 * class.cc (type_has_virtual_destructor): Return false for
1379 * semantics.cc (check_trait_type): Add KIND parameter to support
1380 different sets of requirements.
1381 (finish_trait_expr): Pass KIND argument for relevant traits.
1383 2022-09-08 Patrick Palka <ppalka@redhat.com>
1386 * decl2.cc (maybe_instantiate_decl): Adjust function comment.
1387 Check VAR_OR_FUNCTION_DECL_P. Pull out the disjunction into ...
1388 (mark_used): ... here, removing the decl_maybe_constant_var_p
1391 2022-09-07 Jason Merrill <jason@redhat.com>
1394 * decl.cc (grokdeclarator): Improve placeholder diagnostics.
1395 * parser.cc (cp_parser_type_id_1): Add fixit.
1397 2022-09-07 Arsen Arsenović <arsen@aarsen.me>
1401 * coroutines.cc (coro_rewrite_function_body): Ensure we have a
1402 BIND_EXPR wrapping the function body.
1404 2022-09-07 Jakub Jelinek <jakub@redhat.com>
1407 * semantics.cc (finish_omp_target_clauses): If current_function_decl
1408 isn't a nonstatic member function, don't set data.current_object to
1411 2022-09-06 Jason Merrill <jason@redhat.com>
1413 * decl.cc (grok_op_properties): Return sooner for C++23 op[].
1415 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1417 * parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
1418 in omp_cur_iteration - 1 has integer_type_node type.
1420 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1422 * pt.cc (tsubst_expr) <case OMP_ORDERED>: If OMP_BODY was NULL, keep
1423 it NULL after instantiation too.
1425 2022-09-03 Jakub Jelinek <jakub@redhat.com>
1427 * parser.cc (cp_parser_omp_clause_name): Handle doacross.
1428 (cp_parser_omp_clause_depend_sink): Renamed to ...
1429 (cp_parser_omp_clause_doacross_sink): ... this. Add depend_p
1430 argument. Handle parsing of doacross(sink:omp_cur_iteration-1). Use
1431 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1432 OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS instead
1433 of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND flag on it.
1434 (cp_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
1435 OMP_CLAUSE_DOACROSS_SOURCE instead of OMP_CLAUSE_DEPEND_SINK and
1436 OMP_CLAUSE_DEPEND_SOURCE, build OMP_CLAUSE_DOACROSS for depend(source)
1437 and set OMP_CLAUSE_DOACROSS_DEPEND on it.
1438 (cp_parser_omp_clause_doacross): New function.
1439 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
1440 (cp_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
1441 OMP_CLAUSE_DEPEND_SOURCE.
1442 (cp_parser_omp_for_loop): Don't diagnose here linear clause together
1443 with ordered with argument.
1444 (cp_parser_omp_simd): Don't diagnose ordered clause with argument on
1446 (OMP_ORDERED_DEPEND_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DOACROSS.
1447 (cp_parser_omp_ordered): Handle also doacross and adjust for it
1449 * pt.cc (tsubst_omp_clause_decl): Use
1450 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1451 OMP_CLAUSE_DEPEND_SINK_NEGATIVE.
1452 (tsubst_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
1453 (tsubst_expr): Use OMP_CLAUSE_DEPEND_INVALID instead of
1454 OMP_CLAUSE_DEPEND_SOURCE.
1455 * semantics.cc (cp_finish_omp_clause_depend_sink): Rename to ...
1456 (cp_finish_omp_clause_doacross_sink): ... this.
1457 (finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS. Don't handle
1458 OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK.
1460 2022-09-02 David Malcolm <dmalcolm@redhat.com>
1463 * cp-tree.h (class cp_expr): Add bitfield m_decimal. Clear it in
1464 existing ctors. Add ctor that allows specifying its value.
1465 (cp_expr::decimal_p): New accessor.
1466 * parser.cc (cp_parser_expression_stack_entry::flags): New field.
1467 (cp_parser_primary_expression): Set m_decimal of cp_expr when
1469 (cp_parser_binary_expression): Extract flags from token when
1470 populating stack. Call check_for_xor_used_as_pow.
1472 2022-09-01 Marek Polacek <polacek@redhat.com>
1474 * cp-tree.h (maybe_strip_ref_conversion): Remove.
1476 2022-08-30 Ulrich Drepper <drepper@gmail.com>
1478 * Make-lang.in: Add rule to rebuild std-name-hint.h from
1479 std-name-hint.gperf.
1480 * name-lookup.cc (get_std_name_hint): Remove hints array.
1481 Use gperf-generated class std_name_hint_lookup.
1482 Include "std-name-hint.h".
1483 * std-name-hint.gperf: New file.
1484 * std-name-hint.h: New file. Generated from the .gperf file.
1486 2022-08-30 Marek Polacek <polacek@redhat.com>
1489 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
1490 and RID_IS_NOTHROW_CONSTRUCTIBLE.
1492 2022-08-29 Marek Polacek <polacek@redhat.com>
1495 * decl.cc (grokdeclarator): Reverse the order of arguments to
1498 2022-08-26 Marek Polacek <polacek@redhat.com>
1501 * typeck.cc (maybe_warn_self_move): New.
1502 (cp_build_modify_expr): Call maybe_warn_self_move.
1504 2022-08-25 Marek Polacek <polacek@redhat.com>
1506 * cp-tree.h (enum cp_tree_index): Remove CTI_NULLPTR, CTI_NULLPTR_TYPE.
1507 Move it to c_tree_index.
1508 (nullptr_node): No longer define here.
1509 (nullptr_type_node): Likewise.
1510 (NULLPTR_TYPE_P): Likewise.
1511 * decl.cc (cxx_init_decl_processing): Only keep C++-specific nullptr
1512 initialization; move the shared code to c_common_nodes_and_builtins.
1514 2022-08-25 Jason Merrill <jason@redhat.com>
1516 * call.cc (unsafe_return_slot_p): Return 2 for *this in a
1519 2022-08-23 Marek Polacek <polacek@redhat.com>
1521 * typeck.cc (maybe_warn_pessimizing_move): Don't warn about
1522 redundant std::move when the expression was wrapped in { }.
1524 2022-08-17 Marek Polacek <polacek@redhat.com>
1527 * typeck.cc (can_do_rvo_p): Rename to ...
1528 (can_elide_copy_prvalue_p): ... this.
1529 (maybe_warn_pessimizing_move): Extend the
1530 -Wredundant-move warning to warn about std::move on a
1531 const-qualified object.
1533 2022-08-17 Marek Polacek <polacek@redhat.com>
1536 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Maybe suppress
1538 * typeck.cc (maybe_warn_pessimizing_move): Don't issue warnings
1539 if they are suppressed.
1540 (check_return_expr): Disable -Wpessimizing-move when returning
1541 a dependent expression.
1543 2022-08-17 Marek Polacek <polacek@redhat.com>
1546 * call.cc (build_over_call): Call maybe_warn_pessimizing_move.
1547 * cp-tree.h (maybe_warn_pessimizing_move): Declare.
1548 * decl.cc (build_aggr_init_full_exprs): Call
1549 maybe_warn_pessimizing_move.
1550 * typeck.cc (maybe_warn_pessimizing_move): Handle TREE_LIST and
1551 CONSTRUCTOR. Add a bool parameter and use it. Adjust a diagnostic
1553 (check_return_expr): Adjust the call to maybe_warn_pessimizing_move.
1555 2022-08-17 Tobias Burnus <tobias@codesourcery.com>
1556 Chung-Lin Tang <cltang@codesourcery.com>
1559 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove.
1560 * cp-tree.h (cp_omp_mappable_type, cp_omp_emit_unmappable_type_notes):
1562 * decl2.cc (cp_omp_mappable_type_1, cp_omp_mappable_type,
1563 cp_omp_emit_unmappable_type_notes): Remove.
1564 (cplus_decl_attributes): Call omp_mappable_type instead of
1566 * decl.cc (cp_finish_decl): Likewise; call cxx_incomplete_type_inform
1567 in lieu of cp_omp_emit_unmappable_type_notes.
1568 * semantics.cc (finish_omp_clauses): Likewise.
1570 2022-08-16 Tom Honermann <tom@honermann.net>
1573 * parser.cc (cp_lexer_saving_tokens): Add comment regarding
1574 diagnostic requirements.
1576 2022-08-16 Jakub Jelinek <jakub@redhat.com>
1578 * typeck.cc (cp_build_modify_expr): Implement
1579 P2327R1 - De-deprecating volatile compound operations. Don't warn
1580 for |=, &= or ^= with volatile lhs.
1581 * expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
1584 2022-08-15 Marek Polacek <polacek@redhat.com>
1587 * typeck.cc (can_do_rvo_p): New.
1588 (maybe_warn_pessimizing_move): Warn when moving a temporary object
1589 in a return statement prevents copy elision.
1591 2022-08-11 Marek Polacek <polacek@redhat.com>
1593 PR middle-end/102633
1594 * decl.cc (cp_finish_decl): Call suppress_warning.
1596 2022-08-07 Jakub Jelinek <jakub@redhat.com>
1599 * constexpr.cc (cxx_eval_store_expression): Handle REALPART_EXPR
1600 and IMAGPART_EXPR. Change ctors from releasing_vec to
1601 auto_vec<tree *>, adjust all uses. For !preeval, update ctors
1604 2022-07-31 Lewis Hyatt <lhyatt@gmail.com>
1607 * parser.cc (cp_lexer_new_main): Rename global done_lexing to
1608 override_libcpp_locations.
1610 2022-07-31 Jason Merrill <jason@redhat.com>
1613 * constexpr.cc (reduced_constant_expression_p): Return false
1614 if a CONSTRUCTOR initializes an empty field.
1616 2022-07-29 Jakub Jelinek <jakub@redhat.com>
1619 * parser.cc (cp_parser_omp_atomic): For simple cast followed by
1620 CPP_QUERY token, don't try cp_parser_binary_operation if compare
1623 2022-07-26 Marek Polacek <polacek@redhat.com>
1626 * pt.cc (redeclare_class_template): Check DECL_P before accessing
1627 DECL_SOURCE_LOCATION.
1629 2022-07-26 Jason Merrill <jason@redhat.com>
1632 * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.
1634 2022-07-25 Jason Merrill <jason@redhat.com>
1637 * class.cc (warn_hidden): Remove shortcut.
1639 2022-07-22 Patrick Palka <ppalka@redhat.com>
1642 * pt.cc (do_class_deduction): Don't consider TYPE_HAS_LIST_CTOR
1643 when setting try_list_ctor. Reset args even when try_list_ctor
1644 is true and there are no list candidates. Call resolve_args on
1645 the reset args. Rename try_list_ctor to try_list_cand.
1647 2022-07-22 Martin Liska <mliska@suse.cz>
1650 * init.cc (sort_mem_initializers): Remove continue as last stmt
1653 2022-07-21 Jason Merrill <jason@redhat.com>
1656 * decl.cc (move_fn_p): Remove assert.
1658 2022-07-21 Jason Merrill <jason@redhat.com>
1662 * method.cc (walk_field_subobs): Fix DMI in union case.
1664 2022-07-19 Patrick Palka <ppalka@redhat.com>
1669 * call.cc (enum conversion_kind): Add ck_deferred_bad enumerator.
1670 (has_next): Return false for it.
1671 (reference_binding): Return a ck_deferred_bad conversion instead
1672 of an actual bad conversion when LOOKUP_SHORTCUT_BAD_CONVS is set.
1673 Remove now obsolete early exit for the incomplete TO case.
1674 (implicit_conversion_1): Don't mask out LOOKUP_SHORTCUT_BAD_CONVS.
1675 (add_function_candidate): Set LOOKUP_SHORTCUT_BAD_CONVS iff
1677 (missing_conversion_p): Also return true for a ck_deferred_bad
1679 * cp-tree.h (LOOKUP_SHORTCUT_BAD_CONVS): Define.
1681 2022-07-19 Jonathan Wakely <jwakely@redhat.com>
1683 * cp-objcp-common.cc (names_builtin_p): Return true for
1684 RID_REF_CONSTRUCTS_FROM_TEMPORARY and
1685 RID_REF_CONVERTS_FROM_TEMPORARY.
1687 2022-07-15 Marek Polacek <polacek@redhat.com>
1690 * call.cc (ref_conv_binds_directly_p): Rename to ...
1691 (ref_conv_binds_directly): ... this. Add a new bool parameter. Change
1692 the return type to tristate.
1693 * constraint.cc (diagnose_trait_expr): Handle
1694 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1695 * cp-tree.h: Include "tristate.h".
1696 (enum cp_trait_kind): Add CPTK_REF_CONSTRUCTS_FROM_TEMPORARY
1697 and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1698 (ref_conv_binds_directly_p): Rename to ...
1699 (ref_conv_binds_directly): ... this.
1700 (ref_xes_from_temporary): Declare.
1701 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1702 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1703 * method.cc (ref_xes_from_temporary): New.
1704 * parser.cc (cp_parser_primary_expression): Handle
1705 RID_REF_CONSTRUCTS_FROM_TEMPORARY and RID_REF_CONVERTS_FROM_TEMPORARY.
1706 (cp_parser_trait_expr): Likewise.
1707 (warn_for_range_copy): Adjust to call ref_conv_binds_directly.
1708 * semantics.cc (trait_expr_value): Handle
1709 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
1710 (finish_trait_expr): Likewise.
1712 2022-07-13 Patrick Palka <ppalka@redhat.com>
1715 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
1716 NULL_TREE extract_call_expr result.
1718 2022-07-13 Patrick Palka <ppalka@redhat.com>
1721 * constraint.cc (satisfy_declaration_constraints): Refine early
1722 exit test for argument dependence.
1723 * cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
1724 * pt.cc (template_class_depth): Handle TI_TEMPLATE being a
1726 (usse_outer_template_parms): Factor out constraint dependence
1728 (uses_outer_template_parms_in_constraints): ... here.
1729 (type_dependent_expression_p): Use it for FUNCTION_DECL.
1731 2022-07-07 Patrick Palka <ppalka@redhat.com>
1734 * pt.cc (template_arg_to_parm): Define.
1735 (tsubst_argument_pack): Try to reuse the corresponding
1736 ARGUMENT_PACK from 'args' when substituting into a generic
1737 ARGUMENT_PACK for a variadic template parameter.
1738 (tsubst_template_args): Move variable declarations closer to
1739 their first use. Replace 'orig_t' with 'r'. Rename 'need_new'
1740 to 'const_subst_p'. Heuristically detect if the substituted
1741 elements are identical to that of a level from 'args' and avoid
1742 allocating a new TREE_VEC if so. Add sanity check for the
1743 length of the new TREE_VEC, and remove dead ARGUMENT_PACK_P test.
1744 (tsubst_decl) <case TYPE_DECL, case VAR_DECL>: Revert
1745 r13-1045-gcb7fd1ea85feea change for avoiding substitution into
1746 DECL_TI_ARGS, but still avoid coercion in this case.
1748 2022-07-07 Jason Merrill <jason@redhat.com>
1751 * class.cc (warn_hidden): Ignore [cd]tors.
1753 2022-07-06 Lewis Hyatt <lhyatt@gmail.com>
1756 * parser.cc (cp_parser_pragma_kind): Move earlier in the file.
1757 (cp_lexer_handle_early_pragma): New function.
1758 (cp_lexer_new_main): Support parsing and handling early pragmas.
1759 (c_parse_file): Adapt to changes in cp_lexer_new_main.
1761 2022-07-06 Jason Merrill <jason@redhat.com>
1765 * parser.cc (cp_parser_lookup_name): Remove :: requirement
1766 for using unqualified lookup result.
1768 2022-07-05 Nathan Sidwell <nathan@acm.org>
1771 (struct ord_loc_info, ord_loc_traits): New.
1772 (ord_loc_tabke, ord_loc_remap): New globals.
1773 (struct location_map_info): Delete.
1774 (struct module_state_config): Rename ordinary_loc_align to
1776 (module_for_ordinary_loc): Adjust.
1777 (module_state::note_location): Note ordinary locations,
1779 (module_state::write_location): Adjust ordinary location
1781 (module_state::read_location): Likewise.
1782 (module_state::write_init_maps): Allocate ord_loc_table.
1783 (module_state::write_prepare_maps): Reimplement ordinary
1785 (module_state::read_prepare_maps): Adjust.
1786 (module_state::write_ordinary_maps): Reimplement.
1787 (module_state::write_macro_maps): Adjust.
1788 (module_state::read_ordinary_maps): Reimplement.
1789 (module_state::write_macros): Adjust.
1790 (module_state::write_config): Adjust.
1791 (module_state::read_config): Adjust.
1792 (module_state::write_begin): Adjust.
1793 (module_state::read_initial): Adjust.
1795 2022-07-04 Tobias Burnus <tobias@codesourcery.com>
1796 Chung-Lin Tang <cltang@codesourcery.com>
1797 Thomas Schwinge <thomas@codesourcery.com>
1799 * parser.cc (cp_parser_omp_target_data,
1800 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1801 cp_parser_omp_target_update): Set OMP_REQUIRES_TARGET_USED.
1802 (cp_parser_omp_requires): Remove sorry.
1804 2022-07-01 Lewis Hyatt <lhyatt@gmail.com>
1806 * parser.cc (cp_token_is_module_directive): New function
1807 refactoring common code.
1808 (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
1809 (cp_parser_skip_to_end_of_statement): Likewise.
1810 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
1811 (cp_parser_declaration): Likewise.
1813 2022-07-01 Marek Polacek <polacek@redhat.com>
1816 * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
1818 2022-07-01 Tobias Burnus <tobias@codesourcery.com>
1820 * parser.cc (cp_parser_omp_target_enter_data,
1821 cp_parser_omp_target_exit_data): Accept tofrom
1822 map-type modifier but use 'to' / 'from' internally.
1824 2022-07-01 Marek Polacek <polacek@redhat.com>
1827 * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
1828 RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
1830 2022-07-01 Jason Merrill <jason@redhat.com>
1833 * call.cc (resolve_args): Use complain.
1835 2022-07-01 Jason Merrill <jason@redhat.com>
1837 * parser.cc (missing_template_diag): Split out...
1838 (cp_parser_id_expression): ...from here.
1840 2022-07-01 Jason Merrill <jason@redhat.com>
1843 * parser.cc (missing_template_diag): Factor out...
1844 (cp_parser_id_expression): ...from here.
1845 (cp_parser_lookup_name): Don't look in dependent object_type.
1847 2022-06-30 Nathan Sidwell <nathan@acm.org>
1849 * module.cc (module_state::write_define): Drop located param.
1850 (module_state::read_define): Likewise.
1851 (module_state::prepare_macros): New, broken out of ...
1852 (module_state::write_macros): ... here. Adjust.
1853 (module_state::write_begin): Adjust.
1855 2022-06-29 Nathan Sidwell <nathan@acm.org>
1857 * module.cc (macro_info, macro_traits, macro_table,
1858 macro_remap): Rename to ...
1859 (macro_loc_info, macro_loc_traits, macro_loc_table,
1860 macro_loc_remap): ... these. Update all uses.
1861 (module_state::write_prepare_maps): Remove unneeded macro checking.
1862 (module_state::write_begin): Free macro_loc_remap.
1864 2022-06-27 Sergei Trofimovich <siarheit@google.com>
1867 * mapper-client.cc: Include <memory> via "system.h".
1868 * mapper-resolver.cc: Ditto.
1871 2022-06-27 David Malcolm <dmalcolm@redhat.com>
1873 * cxx-pretty-print.h: Add "final" and "override" to various vfunc
1874 implementations, removing redundant "virtual" as appropriate.
1875 * module.cc: Likewise.
1877 2022-06-24 Jason Merrill <jason@redhat.com>
1881 * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
1883 2022-06-24 Alexandre Oliva <oliva@adacore.com>
1885 * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
1887 2022-06-23 Jason Merrill <jason@redhat.com>
1890 * call.cc (build_aggr_conv): Don't depend on
1891 CONSTRUCTOR_IS_DESIGNATED_INIT.
1893 2022-06-23 Jason Merrill <jason@redhat.com>
1896 * decl.cc (reshape_init_array_1): Set
1897 CONSTRUCTOR_IS_DESIGNATED_INIT here.
1898 (reshape_init_class): And here.
1899 (reshape_init): Not here.
1901 2022-06-23 Patrick Palka <ppalka@redhat.com>
1904 * expr.cc (fold_for_warn): Don't fold when in an unevaluated
1907 2022-06-23 Patrick Palka <ppalka@redhat.com>
1910 * pt.cc (lookup_template_class): After calling complete_type for
1911 the substituted context, check the table again iff the type was
1912 previously incomplete and complete_type made it complete.
1914 2022-06-23 Jason Merrill <jason@redhat.com>
1917 * pt.cc (dependent_operand_p): Split out from...
1918 (tsubst_copy_and_build): ...here.
1919 (tsubst_expr) [IF_STMT]: Use it.
1920 * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
1921 condition in the template tree.
1923 2022-06-23 Jason Merrill <jason@redhat.com>
1926 * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
1927 comparison of dependent operands.
1929 2022-06-23 Nathan Sidwell <nathan@acm.org>
1931 * module.cc (struct macro_info): New.
1932 (struct macro_traits): New.
1933 (macro_remap, macro_table): New globals.
1934 (depset::hash::find_dependencies): Note namespace location.
1935 (module_for_macro_loc): Adjust.
1936 (module_state::note_location): New.
1937 (module_state::Write_location): Note location when not
1938 streaming. Adjust macro location streaming.
1939 (module_state::read_location): Adjust macro location
1941 (module_state::write_init_maps): New.
1942 (module_state::write_prepare_maps): Reimplement macro map
1944 (module_state::write_macro_maps): Reimplement.
1945 (module_state::read_macro_maps): Likewise.
1946 (module_state::write_begin): Adjust.
1948 2022-06-23 Jason Merrill <jason@redhat.com>
1950 * pt.cc (type_unification_real): An auto tparm can't
1951 be affected by other deductions.
1953 2022-06-23 Jason Merrill <jason@redhat.com>
1956 * pt.cc (type_dependent_expression_p): Look through BASELINK.
1958 2022-06-22 Jason Merrill <jason@redhat.com>
1961 * name-lookup.cc (outer_binding): Strip BASELINK.
1963 2022-06-22 Nathan Sidwell <nathan@acm.org>
1965 * module.cc (struct duplicate_hash): Remove.
1966 (duplicate_hash_map): Adjust.
1968 2022-06-22 Jason Merrill <jason@redhat.com>
1971 * constexpr.cc (cxx_eval_builtin_function_call): Handle
1972 unreachable/trap earlier.
1973 * cp-gimplify.cc (cp_maybe_instrument_return): Use
1974 build_builtin_unreachable.
1976 2022-06-18 Jakub Jelinek <jakub@redhat.com>
1978 * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
1979 flag_sanitize_trap & SANITIZE_VPTR instead of
1980 flag_sanitize_undefined_trap_on_error.
1982 2022-06-17 Jakub Jelinek <jakub@redhat.com>
1985 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
1986 instead of maybe_constant_value.
1988 2022-06-16 Nathan Sidwell <nathan@acm.org>
1990 * decl2.cc (finish_objects): Add startp parameter, adjust.
1991 (generate_ctor_or_dtor_function): Detect empty fn, and don't
1992 generate unnecessary code. Remove objc startup here ...
1993 (c_parse_final_cleanyps): ... do it here.
1995 2022-06-16 Martin Liska <mliska@suse.cz>
1997 * decl2.cc (struct priority_map_traits): Remove unused param.
1999 2022-06-15 Nathan Sidwell <nathan@acm.org>
2001 * module.cc (module_state::write_readme): Use less confusing
2002 importable unit names.
2004 2022-06-14 Nathan Sidwell <nathan@acm.org>
2006 * cp-tree.h (fini_modules): Add has_inits parm.
2007 * decl2.cc (c_parse_final_cleanups): Check for
2008 inits, adjust fini_modules flags.
2009 * module.cc (module_state): Rename call_init_p to
2011 (module_state::write_config): Write active_init.
2012 (module_state::read_config): Read it.
2013 (module_determine_import_inits): Clear active_init_p
2015 (late_finish_module): Add has_init parm. Record it.
2016 (fini_modules): Adjust.
2018 2022-06-13 Nathan Sidwell <nathan@acm.org>
2020 * module.cc (module_state::write): Separate to ...
2021 (module_state::write_begin, module_state::write_end): ...
2023 (module_state::write_readme): Drop extensions parameter.
2024 (struct module_processing_cookie): Add more fields.
2025 (finish_module_processing): Adjust state writing call.
2026 (late_finish_module): Call write_end.
2028 2022-06-10 Patrick Palka <ppalka@redhat.com>
2031 * decl.cc (typename_hasher::hash): Add extra overloads.
2032 Use iterative_hash_object instead of htab_hash_pointer.
2033 Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
2034 (build_typename_type): Use typename_hasher::hash.
2035 * pt.cc (spec_hasher::hash): Add two-parameter overload.
2036 Set comparing_specializations around the call to
2038 (iterative_hash_template_arg) <case TYPENAME_TYPE>:
2039 When comparing_specializations, hash the TYPE_CONTEXT
2040 and TYPENAME_TYPE_FULLNAME.
2041 (tsubst_function_decl): Use spec_hasher::hash instead of
2043 (tsubst_template_decl): Likewise.
2044 (tsubst_decl): Likewise.
2046 2022-06-10 Patrick Palka <ppalka@redhat.com>
2048 * pt.cc (instantiate_template): Don't substitute the context
2049 of the most general template if that of the partially
2050 instantiated template is already non-dependent.
2052 2022-06-10 Patrick Palka <ppalka@redhat.com>
2054 * pt.cc (lookup_template_class): Remove dead stores to
2055 context parameter. Don't substitute the context of the
2056 most general template if that of the partially instantiated
2057 template is already non-dependent. Check the specializations
2058 table again after completing the context of a nested dependent
2060 (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
2061 TYPE_CONTEXT or pass it to lookup_template_class.
2062 (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
2063 the TREE_TYPE for DECL_SELF_REFERENCE_P. Avoid template argument
2064 substitution or coercion in some cases.
2066 2022-06-10 Nathan Sidwell <nathan@acm.org>
2068 * cp-tree.h (fini_modules): Add some parameters.
2069 (finish_module_processing): Return an opaque pointer.
2070 * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
2071 finish_module_processing to fini_modules.
2072 * module.cc (struct module_processing_cookie): New.
2073 (finish_module_processing): Return a heap-allocated cookie.
2074 (late_finish_module): New. Finish out the module writing.
2075 (fini_modules): Adjust.
2077 2022-06-10 Nathan Sidwell <nathan@acm.org>
2079 * cp-tree.h (module_has_import_init): Rename to ...
2080 (module_determined_import_inits): ... here.
2081 * decl2.cc (start_objects): Do not handle module initializers
2083 (c_parse_final_cleanups): Generate a separate module
2084 initializer calling function and add it to the list. Shrink
2086 * module.cc (num_init_calls_needed): Delete.
2087 (module_has_import_init): Rename to ...
2088 (module_determined_import_inits): ... here. Do the
2089 calculation here ...
2090 (finish_module_processing): ... rather than here.
2091 (module_add_import_initializers): Reformat.
2093 2022-06-09 Jakub Jelinek <jakub@redhat.com>
2096 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
2097 non-integral result type use fold_ternary too like for BIT_FIELD_REFs
2098 from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
2099 expression, set *non_constant_p and return t, instead of returning
2102 2022-06-09 Nathan Sidwell <nathan@acm.org>
2104 * cp-tree.h (module_initializer_kind): Replace with ...
2105 (module_global_init_needed, module_has_import_inits): ...
2107 * decl2.cc (start_objects): Add has_body parm. Reorganize
2108 module initializer creation.
2109 (generate_ctor_or_dtor_function): Adjust.
2110 (c_parse_final_cleanups): Adjust.
2111 (vtv_start_verification_constructor_init_function): Adjust.
2112 * module.cc (module_initializer_kind): Replace with ...
2113 (module_global_init_needed, module_has_import_inits): ...
2116 2022-06-08 Jason Merrill <jason@redhat.com>
2119 * decl.cc (duplicate_decls): Change non-templated friend
2121 * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
2122 on non-templated friends.
2123 (tsubst_friend_function): Adjust.
2125 2022-06-08 Jason Merrill <jason@redhat.com>
2129 * decl.cc (duplicate_decls): Avoid copying template info
2130 from non-templated friend even if newdecl isn't a definition.
2131 Correct handling of DECL_UNIQUE_FRIEND_P on templates.
2132 * pt.cc (non_templated_friend_p): New.
2133 * cp-tree.h (non_templated_friend_p): Declare it.
2135 2022-06-08 Nathan Sidwell <nathan@acm.org>
2137 * decl2.cc (struct priority_info_s, priority_info): Delete.
2138 (priority_map_traits, priority_map_t): New.
2139 (static_init_fini_fns): New.
2140 (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
2141 (initialize_p_decl, priority_decl): Delete.
2142 (ssdf_decls, priority_info_map): Delete.
2143 (start_static_storage_duration_function): Rename to ...
2144 (start_partial_init_fini_fn): ... here. Create a void arg fn.
2145 Add it to the slot in the appropriate static_init_fini_fns
2147 (finish_static_storage_duration_function): Rename to ...
2148 (finish_partial_init_fini_fn): ... here.
2149 (get_priority_info): Delete.
2150 (one_static_initialization_or_destruction): Assert not
2152 (do_static_initialization_or_destruction): Rename to ...
2153 (emit_partial_init_fini_fn) ... here. Start & finish the fn.
2154 Simply init/fini each var.
2155 (partition_vars_for_init_fini): Partition vars according to
2156 priority and add to init and/or fini list.
2157 (generate_ctor_or_dtor_function): Start and finish the function.
2158 Do santitizer calls here.
2159 (generate_ctor_and_dtor_functions_for_priority): Delete.
2160 (c_parse_final_cleanups): Reimplement global init/fini
2163 2022-06-07 Jakub Jelinek <jakub@redhat.com>
2165 * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
2166 style linear clause modifiers. Set
2167 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
2168 old style modifiers are used.
2169 * semantics.cc (finish_omp_clauses): Only reject linear clause
2170 with val modifier on simd or for if the old style modifiers are
2173 2022-06-07 Roger Sayle <roger@nextmovesoftware.com>
2176 * decl.cc (start_enum): When emitting a "must be integral" error,
2177 set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
2178 downstream in build_enumeration.
2180 2022-06-06 Patrick Palka <ppalka@redhat.com>
2184 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
2185 ADDR_EXPR callee when calling mark_used.
2187 2022-06-04 Marek Polacek <polacek@redhat.com>
2191 * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
2192 followed by [[]] attributes and vice versa.
2194 2022-06-03 Patrick Palka <ppalka@redhat.com>
2197 * typeck.cc (cp_build_binary_op): Don't fold operands
2198 when c_inhibit_evaluation_warnings.
2200 2022-06-03 Jason Merrill <jason@redhat.com>
2203 * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
2204 from a hidden friend.
2206 2022-06-03 Patrick Palka <ppalka@redhat.com>
2209 * tree.cc (maybe_dummy_object): When returning a dummy
2210 object, respect the cv-quals of 'this' if available.
2212 2022-06-03 Patrick Palka <ppalka@redhat.com>
2215 * pt.cc (determine_specialization): Compare overall constraints
2216 not just the trailing constraints.
2217 (tsubst_each_template_parm_constraints): Define.
2218 (tsubst_friend_function): Use it.
2219 (tsubst_friend_class): Use it.
2220 (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
2222 2022-06-03 Patrick Palka <ppalka@redhat.com>
2225 * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
2226 Don't walk DECL_CONTEXT.
2227 <case PARM_DECL>: Likewise. Walk TREE_TYPE.
2228 <case CONST_DECL>: Simplify.
2229 (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
2231 2022-06-02 Marek Polacek <polacek@redhat.com>
2233 * constexpr.cc (potential_constant_expression_1): Treat
2234 {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
2236 2022-06-02 Marek Polacek <polacek@redhat.com>
2239 * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
2242 2022-06-02 David Malcolm <dmalcolm@redhat.com>
2244 * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
2245 (cp_get_sarif_source_language): New.
2247 2022-06-02 Jason Merrill <jason@redhat.com>
2250 * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
2251 (cxx_eval_store_expression): Likewise.
2252 (cxx_eval_bare_aggregate): Handle null ctx->ctor.
2254 2022-06-02 Jason Merrill <jason@redhat.com>
2257 * constexpr.cc (cxx_eval_bare_aggregate): Always call
2260 2022-06-01 Jason Merrill <jason@redhat.com>
2263 * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
2264 if the expression has auto type.
2266 2022-06-01 Jason Merrill <jason@redhat.com>
2269 * call.cc (resolve_args): Call mark_single_function here.
2270 * pt.cc (unify_one_argument): Not here.
2272 2022-06-01 Nathan Sidwell <nathan@acm.org>
2274 * decl2.cc (fix_temporary_vars_context_r): Use data argument
2276 (one_static_initialization_or_destruction): Adjust tree walk
2277 call. Refactor guard generation.
2279 2022-06-01 Nathan Sidwell <nathan@acm.org>
2281 * decl2.cc (ssdf_decl): Delete global.
2282 (start_static_storage_duration_function): Use some RAII.
2283 (do_static_initialization_or_destruction): Likewise.
2284 (c_parse_final_cleanups): Likewise. Avoid rechecking 'vars'.
2286 2022-06-01 Nathan Sidwell <nathan@acm.org>
2288 * decl2.cc (start_objects): Replace 'method_type' parameter
2289 with 'initp' boolean, rename and retype 'priority' parameter.
2290 (finish_objects): Likewise. Do not expand here.
2291 (one_static_initialization_or_destruction): Move 'initp'
2293 (do_static_initialization_or_destruction): Likewise.
2294 (generate_ctor_or_dtor_function): Rename 'initp' parameter.
2295 Adjust start_objects/finish_obects calls and expand here.
2296 (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
2297 (c_parse_final_cleanups): Likewise.
2298 (vtv_start_verification_constructor_init): Adjust.
2299 (vtv_finish_verification_constructor_init): Use finish_objects.
2301 2022-05-31 Patrick Palka <ppalka@redhat.com>
2304 * call.cc (build_over_call): Use z_candidate::conversion_path
2305 and ::access_path instead of TYPE_BINFO when building the
2306 BASELINK for the templated form.
2308 2022-05-31 Patrick Palka <ppalka@redhat.com>
2310 * parser.cc: Use auto_timevar instead of timevar_push/pop.
2311 Remove wrapper functions.
2314 2022-05-31 Patrick Palka <ppalka@redhat.com>
2316 * cp-tree.h (cp_build_qualified_type_real): Rename to ...
2317 (cp_build_qualified_type): ... this. Give its last parameter
2318 a default argument. Remove macro of the same name.
2319 * decl.cc (grokdeclarator): Adjust accordingly.
2320 * pt.cc (tsubst_aggr_type): Likewise.
2321 (rebuild_function_or_method_type): Likewise.
2323 (maybe_dependent_member_ref): Likewise.
2325 * tree.cc (cp_build_qualified_type_real): Rename to ...
2326 (cp_build_qualified_type): ... this. Adjust accordingly.
2328 2022-05-31 Jason Merrill <jason@redhat.com>
2330 * Make-lang.in (c++.tags): Just look at *.cc.
2332 2022-05-31 Patrick Palka <ppalka@redhat.com>
2334 * cp-tree.h (comp_template_args): Change return type to bool.
2335 * pt.cc (comp_template_args): Document default arguments.
2336 Change return type to bool and adjust returns accordingly.
2338 2022-05-31 Patrick Palka <ppalka@redhat.com>
2340 * decl.cc (grokvardecl): Use current_template_constraints.
2341 (grokdeclarator): Likewise.
2342 (xref_tag): Likewise.
2343 * semantics.cc (finish_template_template_parm): Likewise.
2345 2022-05-31 Jakub Jelinek <jakub@redhat.com>
2347 * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
2350 2022-05-30 Marek Polacek <polacek@redhat.com>
2353 * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
2354 * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
2357 2022-05-28 Jakub Jelinek <jakub@redhat.com>
2359 * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
2360 seen first, use "%<to%>" or "%<enter%>" depending on
2361 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
2362 "%<to%> or %<enter%>" wording.
2364 2022-05-28 Jason Merrill <jason@redhat.com>
2367 * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
2368 instantiate into a class-scope lambda.
2370 2022-05-27 Marek Polacek <polacek@redhat.com>
2373 * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
2375 2022-05-27 Jakub Jelinek <jakub@redhat.com>
2377 * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
2378 (cp_parser_omp_all_clauses): For to clause on declare target, use
2379 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
2380 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
2381 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
2382 (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
2383 OMP_CLAUSE_TO_DECLARE.
2384 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
2385 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
2386 name in diagnostics instead of
2387 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
2389 2022-05-26 Marek Polacek <polacek@redhat.com>
2392 * typeck.cc (warn_for_null_address): Improve the warning when
2393 the POINTER_PLUS_EXPR's base is of reference type.
2395 2022-05-26 Patrick Palka <ppalka@redhat.com>
2398 * decl.cc (shadow_tag): Use the return value of
2399 maybe_process_partial_specialization.
2400 * parser.cc (cp_parser_single_declaration): Call shadow_tag
2401 before associate_classtype_constraints.
2402 * pt.cc (maybe_new_partial_specialization): Change return type
2403 to bool. Take 'type' argument by mutable reference. Set 'type'
2404 to point to the correct constrained specialization when
2406 (maybe_process_partial_specialization): Adjust accordingly.
2408 2022-05-25 Marek Polacek <polacek@redhat.com>
2411 * cp-tree.h (attr_chainon): Declare.
2412 * decl.cc (start_decl): Use attr_chainon.
2413 (grokdeclarator): Likewise.
2414 * parser.cc (cp_parser_statement): No longer static.
2416 2022-05-25 Jason Merrill <jason@redhat.com>
2419 * pt.cc (build_template_decl): Add assert.
2420 (tsubst_function_decl): Don't return a template.
2422 2022-05-25 Jason Merrill <jason@redhat.com>
2425 * decl2.cc (mark_used): Copy type from fn to BASELINK.
2426 * pt.cc (unify_one_argument): Call mark_single_function.
2428 2022-05-25 Jason Merrill <jason@redhat.com>
2430 * constexpr.cc (cxx_eval_call_expression): Check for
2431 heap vars in the result.
2433 2022-05-25 Jason Merrill <jason@redhat.com>
2435 * constexpr.cc (maybe_constant_init_1): Only pass false for
2436 strict when initializing a variable of static duration.
2438 2022-05-25 Marek Polacek <polacek@redhat.com>
2441 * typeck2.cc (potential_prvalue_result_of): New.
2442 (replace_placeholders_for_class_temp_r): New.
2443 (digest_nsdmi_init): Call it.
2445 2022-05-24 Jason Merrill <jason@redhat.com>
2447 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
2448 (cxx_eval_call_expression): Call it.
2449 (cxx_fold_indirect_ref_1): Handle null empty_base.
2451 2022-05-24 Jason Merrill <jason@redhat.com>
2453 * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
2454 from int to value_cat. Change most false to vc_prvalue, most true
2455 to vc_glvalue, cases where the return value is ignored to
2457 (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
2458 (cxx_eval_store_expression): Only build _REF for vc_glvalue.
2459 (cxx_eval_array_reference, cxx_eval_component_reference)
2460 (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
2462 2022-05-24 Jason Merrill <jason@redhat.com>
2465 * constexpr.cc (cxx_eval_store_expression): Adjust assert.
2466 Use initialized_type.
2468 2022-05-24 Patrick Palka <ppalka@redhat.com>
2470 * cp-tree.h (any_template_arguments_need_structural_equality_p):
2472 * pt.cc (struct ctp_hasher): Define.
2473 (ctp_table): Define.
2474 (canonical_type_parameter): Use it.
2475 (process_template_parm): Set TYPE_CANONICAL for
2476 TEMPLATE_TEMPLATE_PARM too.
2477 (lookup_template_class_1): Remove now outdated comment for the
2478 any_template_arguments_need_structural_equality_p test.
2479 (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
2480 clear TYPE_CANONICAL for ttps. Set TYPE_CANONICAL on the
2481 substituted type later.
2482 (any_template_arguments_need_structural_equality_p): Return
2483 true for any_targ_node. Don't return true just because a
2484 template argument uses structural equality. Add comment for
2485 the PARM_DECL special case.
2486 (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
2488 * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
2490 * typeck.cc (structural_comptypes) [check_alias]: Increment
2491 processing_template_decl before checking
2492 dependent_alias_template_spec_p.
2494 2022-05-24 Jakub Jelinek <jakub@redhat.com>
2497 * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
2499 2022-05-20 David Malcolm <dmalcolm@redhat.com>
2501 * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
2502 "final" and "override".
2503 * error.cc: Likewise.
2505 2022-05-18 Marek Polacek <polacek@redhat.com>
2508 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
2510 2022-05-17 Jason Merrill <jason@redhat.com>
2513 * decl.cc (check_initializer): Use build_cplus_new in case of
2516 2022-05-17 Jakub Jelinek <jakub@redhat.com>
2518 * parser.cc (cp_parser_omp_clause_depend): Parse
2519 inoutset depend-kind.
2520 (cp_parser_omp_depobj): Likewise.
2521 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
2522 OMP_CLAUSE_DEPEND_INOUTSET.
2524 2022-05-16 Martin Liska <mliska@suse.cz>
2526 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
2527 * name-lookup.cc (get_std_name_hint): Likewise.
2528 * parser.cc (cp_parser_new): Likewise.
2530 2022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
2532 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
2533 * semantics.cc (finish_omp_clauses): Added template decl processing.
2535 2022-05-15 Jason Merrill <jason@redhat.com>
2539 * friend.cc (is_friend): Hidden friends count as members.
2540 * search.cc (friend_accessible_p): Likewise.
2542 2022-05-15 Jason Merrill <jason@redhat.com>
2544 * parser.cc (cp_parser_template_name): Look through
2545 injected-class-name.
2547 2022-05-15 Jason Merrill <jason@redhat.com>
2552 * init.cc (build_value_init): Handle class in template.
2554 2022-05-13 Nathan Sidwell <nathan@acm.org>
2556 * mangle.cc (maybe_write_module): Check external linkage.
2558 2022-05-13 Richard Biener <rguenther@suse.de>
2560 * constexpr.cc: Remove gimple-fold.h include.
2562 2022-05-12 Patrick Palka <ppalka@redhat.com>
2564 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
2565 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
2566 * pt.cc (try_class_unification): Correctly copy multidimensional
2567 targs. Free the copy of targs.
2568 (unify_pack_expansion): Fix level comparison.
2570 2022-05-12 Nathan Sidwell <nathan@acm.org>
2572 * parser.cc (cp_parser_linkage_specification): Implement
2573 global module attachment semantics.
2575 2022-05-12 Jakub Jelinek <jakub@redhat.com>
2577 * lex.cc (init_reswords): Register omp_all_memory as keyword
2579 * parser.cc (cp_parser_primary_expression): Diagnose uses of
2580 omp_all_memory in postfix expressions.
2581 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
2583 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
2584 keyword in depend clause as null_pointer_node, diagnose invalid
2586 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
2588 2022-05-11 Patrick Palka <ppalka@redhat.com>
2590 * constraint.cc (tsubst_parameter_mapping): Convert loop over
2591 TREE_VEC into a range-based for loop using tree_vec_range.
2592 * pt.cc (iterative_hash_template_arg): Likewise.
2593 (template_parms_level_to_args): Likewise.
2594 (deducible_template_args): Likewise.
2595 (check_undeduced_parms): Likewise.
2596 (dependent_type_p_r): Likewise.
2597 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
2599 (dependent_template_arg_p): Likewise.
2600 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
2603 2022-05-11 Jason Merrill <jason@redhat.com>
2606 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
2607 * parser.cc (cp_parser_enclosed_template_argument_list):
2608 Use 0-length TREE_VEC for <>.
2610 2022-05-11 Jason Merrill <jason@redhat.com>
2613 * typeck.cc (check_return_expr): Don't mess with ctor return value
2614 while parsing a template.
2616 2022-05-11 Nathan Sidwell <nathan@acm.org>
2618 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
2619 (struct lang_decl_base): Add module_attach_p flag.
2620 * decl.cc (duplicate_decls): Rework module redeclaration
2622 * module.cc (trees_out::lang_decl_bools): Write attach flag.
2623 (trees_in::lang_decl_bools): ... and read it back.
2624 (trees_out::decl_value): Rework module attachment handling.
2625 (trees_in::decl_value): Rename local var to reflect meaning.
2626 (trees_in::key_mergeable): Likewise.
2627 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
2628 to special-case mangling.
2629 (module_may_redeclare): Reimplement.
2630 (set_originating_module): Deal with attachment.
2631 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
2633 (mergeable_namespace_slots): Likewise.
2634 (do_nonmember_using_decl): Likewise.
2635 * name-lookup.h (mergeable_namespace_slots): Adjust parm
2637 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
2639 2022-05-11 Martin Liska <mliska@suse.cz>
2642 * lang-specs.h: Use Separate syntax.
2644 2022-05-10 Patrick Palka <ppalka@redhat.com>
2646 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
2647 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
2648 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
2649 (SET_ARGUMENT_PACK_ARGS): Remove.
2650 * module.cc (trees_in::tree_node): Adjust accordingly.
2651 * parser.cc (make_char_string_pack): Likewise.
2652 (make_string_pack): Likewise.
2653 * pt.cc (make_pack_expansion): Likewise.
2654 (template_parm_to_arg): Likewise.
2655 (coerce_template_parameter_pack): Likewise.
2656 (extract_fnparm_pack): Likewise.
2657 (extract_locals_r): Likewise.
2658 (make_argument_pack): Likewise.
2659 (tsubst_argument_pack): Likewise.
2660 (lookup_init_capture_pack): Likewise.
2661 (type_unification_real): Likewise.
2662 (unify_pack_expansion): Likewise.
2663 (tsubst_initializer_list): Likewise.
2665 2022-05-10 Patrick Palka <ppalka@redhat.com>
2667 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
2668 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
2669 (SET_PACK_EXPANSION_PATTERN): Likewise.
2670 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
2671 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
2672 (PACK_EXPANSION_LOCAL_P): Likewise.
2673 (PACK_EXPANSION_SIZEOF_P): Likewise.
2674 (PACK_EXPANSION_AUTO_P): Likewise.
2675 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
2676 (ARGUMENT_PACK_CHECK): Define.
2677 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
2678 (SET_ARGUMENT_PACK_ARGS): Likewise.
2679 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
2680 before setting PACK_EXPANSION_SIZEOF_P.
2682 2022-05-10 Nathan Sidwell <nathan@acm.org>
2684 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
2685 attach, named module vs header-unit.
2686 (global_purview_p, not_module_p): Delete.
2687 (named_module_p): New.
2688 (header_module_p, module_purview_p): Adjust.
2689 (module_attach_p, named_module_purview_p): New.
2690 * decl.cc (duplicate_decls): Adjust.
2691 * module.cc (declare_module, preprocessed_module): Adjust.
2692 * name-lookup.cc (init_global_partition): Adjust.
2693 (get_fixed_binding_slot, pushdecl): Adjust.
2694 * parser.cc (cp_parser_module_declaration): Adjust.
2695 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
2697 2022-05-10 Jason Merrill <jason@redhat.com>
2700 * decl.cc (maybe_return_this): Replace...
2701 (finish_constructor_body, finish_destructor_body): ...these.
2702 (finish_function_body): Call it.
2703 * optimize.cc (build_delete_destructor_body): Call it.
2704 * cp-tree.h (maybe_return_this): Declare.
2706 2022-05-09 Marek Polacek <polacek@redhat.com>
2709 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
2710 Create a modifiable copy. Allow labels at the end of compound
2713 2022-05-09 Patrick Palka <ppalka@redhat.com>
2716 * call.cc (field_in_pset): Adjust after next_initializable_field
2718 (build_aggr_conv): Likewise.
2719 (convert_like_internal): Likewise.
2720 (type_has_extended_temps): Likewise.
2721 * class.cc (default_init_uninitialized_part): Likewise.
2722 (finish_struct): Likewise.
2723 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
2724 (reduced_constant_expression_p): Use next_subobject_field
2726 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
2727 next_initializable_field renaming.
2728 (fold_builtin_source_location): Likewise.
2729 * cp-tree.h (next_initializable_field): Rename to ...
2730 (next_aggregate_field): ... this.
2731 (next_subobject_field): Declare.
2732 * decl.cc (next_aggregate_field): Renamed from ...
2733 (next_initializable_field): ... this. Skip over vptr fields
2735 (next_subobject_field): Define.
2736 (reshape_init_class): Adjust after next_initializable_field
2738 * init.cc (build_value_init_noctor): Likewise.
2739 (emit_mem_initializers): Likewise.
2740 * lambda.cc (build_capture_proxy): Likewise.
2741 * method.cc (build_comparison_op): Likewise.
2742 * pt.cc (maybe_aggr_guide): Likewise.
2743 * tree.cc (structural_type_p): Likewise.
2744 * typeck2.cc (split_nonconstant_init_1): Likewise.
2745 (digest_init_r): Likewise.
2747 2022-05-09 Nathan Sidwell <nathan@acm.org>
2749 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
2750 DECL_MODULE_ATTACHMENTS_P.
2751 (struct lane_decl_base): Rename module_attached_p to
2752 module_keyed_decls_p.
2753 (maybe_key_decl): Renamed from maybe_attach_decl.
2754 * lambda.cc (record_lambda_scope): Adjust.
2755 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
2756 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
2758 (enum merge_kind): Rename MK_attached to MK_keyed.
2759 (trees_out::lang_decl_bools): Adjust.
2760 (trees_in::lang_decl_bools): Adjust.
2761 (trees_in::decl_value): Adjust.
2762 (trees_out::get_merge_kind): Adjust.
2763 (trees_out::key_mergeable): Adjust.
2764 (trees_in::key_mergeable): Adjust.
2765 (maybe_key_decl): Rename from maybe_attach_decl.
2766 (direct_import): Adjust.
2767 (fini_modules): Adjust.
2769 2022-05-09 Martin Liska <mliska@suse.cz>
2771 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
2773 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
2774 (cp_finalize_oacc_routine): Likewise.
2776 2022-05-07 Marek Polacek <polacek@redhat.com>
2780 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
2782 2022-05-06 Jason Merrill <jason@redhat.com>
2784 * error.cc (decl_to_string): Add show_color parameter.
2785 (subst_to_string): Likewise.
2786 (cp_printer): Pass it.
2787 (type_to_string): Set pp_show_color.
2788 (dump_function_name): Use "fnname" color.
2789 (dump_template_bindings): Use "targs" color.
2790 (struct colorize_guard): New.
2791 (reinit_cxx_pp): Clear pp_show_color.
2793 2022-05-06 Jason Merrill <jason@redhat.com>
2797 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
2800 2022-05-05 Marek Polacek <polacek@redhat.com>
2803 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
2804 a vector of parameters that haven't been pushed yet. Push them at the
2805 end of a valid parameter-declaration-clause.
2806 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
2807 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
2808 would result in a hard error.
2809 (cp_parser_cache_defarg): Adjust the call to
2810 cp_parser_parameter_declaration_list.
2812 2022-05-05 Richard Biener <rguenther@suse.de>
2814 * module.cc (trees_in::core_vals): Remove separate allocation
2817 2022-05-04 Jason Merrill <jason@redhat.com>
2820 * pt.cc (maybe_dependent_member_ref): Handle types.
2821 (tsubst, tsubst_copy): Use it.
2822 (tsubst_aggr_type, instantiate_alias_template): Don't handle
2825 2022-05-04 Patrick Palka <ppalka@redhat.com>
2828 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
2829 partially instantiating the guide's parameter list.
2831 2022-05-04 Marek Polacek <polacek@redhat.com>
2834 * parser.cc (cp_parser_init_declarator): Properly handle a series of
2835 operator() calls, they are not part of an init-declarator.
2837 2022-05-04 Jason Merrill <jason@redhat.com>
2839 * decl.cc (reshape_init): Shortcut already-reshaped init.
2840 (reshape_init_class): Assert not getting one here.
2842 2022-05-04 Jason Merrill <jason@redhat.com>
2844 * error.cc (cp_print_error_function): Use %qD.
2845 (function_category): Use %qD.
2847 2022-05-04 Marek Polacek <polacek@redhat.com>
2850 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
2851 return true for CPP_GREATER_EQ.
2853 2022-05-04 Jason Merrill <jason@redhat.com>
2855 * cp-tree.h (struct language_function): Remove x_cdtor_label.
2856 (cdtor_label, LABEL_DECL_CDTOR): Remove.
2857 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
2858 (cxx_eval_constant_expression): Don't call returns.
2859 * decl.cc (check_goto): Don't check cdtor_label.
2860 (start_preparsed_function): And don't set it.
2861 (finish_constructor_body, finish_destructor_body): Remove.
2862 (finish_function_body): Don't call them.
2863 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
2864 * semantics.cc (finish_return_stmt): Not here.
2866 2022-05-04 Jakub Jelinek <jakub@redhat.com>
2868 * lambda.cc: Include decl.h.
2869 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
2870 UNAVAILABLE_DEPRECATED_SUPPRESS.
2872 2022-05-03 Patrick Palka <ppalka@redhat.com>
2875 * cp-tree.h (finish_non_static_data_member): Add defaulted
2877 * pt.cc (tsubst_copy_and_build): Pass complain to
2878 finish_non_static_data_member.
2879 * semantics.cc (finish_non_static_data_member): Respect complain
2881 (finish_qualified_id_expr): Pass complain to
2882 finish_non_static_data_member.
2884 2022-05-02 Jason Merrill <jason@redhat.com>
2886 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
2887 (do_auto_deduction): Use expr location.
2889 2022-05-02 Jason Merrill <jason@redhat.com>
2891 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
2892 classes. Remember location of use.
2893 (note_name_declared_in_class): Adjust.
2895 2022-05-02 Marek Polacek <polacek@redhat.com>
2897 * cp-tree.h (uses_template_parms): Adjust declaration.
2898 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
2900 2022-05-02 Richard Biener <rguenther@suse.de>
2902 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
2903 * cp-gimplify.cc (cp_fold): Likewise.
2904 * pt.cc (tsubst_copy): Likewise.
2906 2022-04-29 Jason Merrill <jason@redhat.com>
2910 * friend.cc (do_friend): Call check_explicit_specialization here.
2911 * decl.cc (grokdeclarator): Not here.
2912 * decl2.cc (check_classfn): Or here.
2914 2022-04-29 Jason Merrill <jason@redhat.com>
2917 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
2918 * pt.cc (tsubst_aggr_type): Check it.
2919 (tsubst_baselink, tsubst_copy): Check it.
2920 (maybe_dependent_member_ref): Check it.
2921 (instantiate_alias_template): Handle it.
2922 (build_deduction_guide): Set it.
2924 2022-04-29 Jason Merrill <jason@redhat.com>
2927 * lambda.cc (type_deducible_expression_p): Allow more types.
2929 2022-04-29 Jason Merrill <jason@redhat.com>
2931 * decl.cc (cp_finish_decl): Only consider auto for vars.
2933 2022-04-29 Marek Polacek <polacek@redhat.com>
2936 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
2937 only when it's followed by a semicolon.
2939 2022-04-29 Jason Merrill <jason@redhat.com>
2942 * decl.cc (cp_finish_decl): Check completeness of deduced type.
2944 2022-04-29 Jason Merrill <jason@redhat.com>
2947 * error.cc (dump_decl) [USING_DECL]: Respect flags.
2949 2022-04-29 Jason Merrill <jason@redhat.com>
2951 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
2953 2022-04-29 Jakub Jelinek <jakub@redhat.com>
2956 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
2957 after a type id by setting maybe_type_id and aborting tentative
2959 (cp_parser_enclosed_template_argument_list): Handle
2960 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
2961 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
2962 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
2963 (cp_parser_next_token_ends_template_argument_p): Return true
2964 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
2966 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
2969 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
2970 temporaries to coroutine frame copies.
2972 2022-04-29 Jason Merrill <jason@redhat.com>
2974 * semantics.cc (check_trait_type): Don't check completeness
2975 of element type of array of unknown bound.
2977 2022-04-29 Jason Merrill <jason@redhat.com>
2981 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
2982 (emit_tinfo_decl): Update tdesc type if needed.
2984 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
2987 * call.cc (extract_call_expr): Return a NULL_TREE on failure
2988 instead of asserting.
2989 (build_new_method_call): Suppress -Wparentheses diagnostic for
2991 * semantics.cc (is_assignment_op_expr_p): Add function to check
2992 if an expression is a call to an op= operator expression.
2993 (maybe_convert_cond): Handle the case of a op= operator expression
2994 for the -Wparentheses diagnostic.
2996 2022-04-28 Patrick Palka <ppalka@redhat.com>
2999 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
3000 DEPENDENT_OPERATOR_TYPE like an empty type.
3002 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3005 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
3006 non-target expression inputs.
3008 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3011 * coroutines.cc (coro_promise_type_found_p): Account for possible
3012 mutliple overloads of the promise return_value() method.
3014 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3017 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
3018 are added to the bind expr.
3019 (add_var_to_bind): Fix local var naming to use portable punctuation.
3020 (register_local_var_uses): Do not add synthetic names to unnamed
3023 2022-04-28 Nathan Sidwell <nathan@acm.org>
3024 Iain Sandoe <iain@sandoe.co.uk>
3027 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
3028 coroutine expressions at template definition time.
3029 (finish_co_yield_expr): Likewise.
3030 (finish_co_return_stmt): Likewise.
3032 2022-04-28 Marek Polacek <polacek@redhat.com>
3035 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
3038 2022-04-27 Jason Merrill <jason@redhat.com>
3040 * tree.cc (strip_typedefs): Add default argument comments.
3042 2022-04-27 Marek Polacek <polacek@redhat.com>
3045 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
3047 2022-04-26 Jason Merrill <jason@redhat.com>
3050 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
3051 TEMPLATE_TYPE_PARAMETER_PACK on auto.
3053 2022-04-26 Patrick Palka <ppalka@redhat.com>
3056 * semantics.cc (finish_decltype_type): Pass tf_decltype to
3057 instantiate_non_dependent_expr_sfinae.
3059 2022-04-26 Jason Merrill <jason@redhat.com>
3062 * pt.cc (check_for_bare_parameter_packs): Check for lambda
3063 function parameter pack.
3065 2022-04-26 Patrick Palka <ppalka@redhat.com>
3069 * pt.cc (process_partial_specialization): Downgrade "partial
3070 specialization isn't more specialized" diagnostic from permerror
3071 to an on-by-default pedwarn.
3072 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
3073 NTTP type a second time, use the original type not the
3076 2022-04-25 Marek Polacek <polacek@redhat.com>
3079 * typeck.cc (build_x_shufflevector): Use
3080 instantiation_dependent_expression_p except for the first two
3083 2022-04-21 Marek Polacek <polacek@redhat.com>
3085 * constexpr.cc (cxx_eval_logical_expression): Remove unused
3087 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
3088 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
3090 2022-04-21 Marek Polacek <polacek@redhat.com>
3093 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
3094 to cxx_eval_constant_expression.
3096 2022-04-20 Ed Catmur <ed@catmur.uk>
3099 * call.cc (compare_ics): When comparing list-initialization
3100 sequences, do not return early.
3102 2022-04-19 Jakub Jelinek <jakub@redhat.com>
3105 * typeck2.cc (process_init_constructor_array,
3106 process_init_constructor_record, process_init_constructor_union): Move
3107 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
3108 containing CONSTRUCTOR.
3110 2022-04-15 Marek Polacek <polacek@redhat.com>
3113 * parser.cc (cp_parser_placeholder_type_specifier): Return
3114 error_mark_node when trying to build up a constrained parameter in
3117 2022-04-15 Jason Merrill <jason@redhat.com>
3120 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
3122 2022-04-15 Jason Merrill <jason@redhat.com>
3125 * error.cc (dump_expr): Handle USING_DECL.
3126 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
3128 2022-04-14 Jason Merrill <jason@redhat.com>
3131 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
3132 checks for defaulted ctors.
3134 2022-04-14 Jason Merrill <jason@redhat.com>
3137 * lambda.cc (type_deducible_expression_p): New.
3138 (lambda_capture_field_type): Check it.
3140 2022-04-14 Jason Merrill <jason@redhat.com>
3143 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
3145 2022-04-14 Jason Merrill <jason@redhat.com>
3148 * name-lookup.cc (dependent_local_decl_p): New.
3149 * cp-tree.h (dependent_local_decl_p): Declare.
3150 * semantics.cc (finish_call_expr): Use it.
3151 * pt.cc (tsubst_arg_types): Also substitute default args
3154 2022-04-14 Jason Merrill <jason@redhat.com>
3157 * pt.cc (tsubst_baselink): Also check dependent optype.
3159 2022-04-14 Jason Merrill <jason@redhat.com>
3162 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
3163 * init.cc (perform_member_init): Likewise.
3164 * semantics.cc (push_cleanup): Adjust comment.
3166 2022-04-13 Jason Merrill <jason@redhat.com>
3170 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
3171 as needed in empty base handling.
3173 2022-04-13 Jakub Jelinek <jakub@redhat.com>
3176 * decl2.cc (cp_check_const_attributes): For aligned attribute
3177 pass manifestly_const_eval=true to fold_non_dependent_expr.
3179 2022-04-13 Marek Polacek <polacek@redhat.com>
3182 * call.cc (direct_reference_binding): strip_top_quals when creating
3185 2022-04-12 Jason Merrill <jason@redhat.com>
3188 * decl.cc (decls_match): Compare versions even if not recording.
3189 (duplicate_decls): Propagate attributes to alias.
3190 * decl2.cc (find_last_decl): Give up if versioned.
3192 2022-04-12 Jason Merrill <jason@redhat.com>
3195 * init.cc (build_new_1): Check array_p for alignment.
3197 2022-04-12 Patrick Palka <ppalka@redhat.com>
3200 * pt.cc (build_extra_args): Call preserve_args.
3202 2022-04-12 Jason Merrill <jason@redhat.com>
3205 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
3207 2022-04-12 Jason Merrill <jason@redhat.com>
3211 * class.cc (finish_struct): Always using op=.
3213 2022-04-11 Jason Merrill <jason@redhat.com>
3216 * call.cc (build_operator_new_call): Just look in ::.
3218 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3220 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
3223 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3225 * semantics.cc (set_cleanup_locs): Propagate locus to call
3226 wrapped in cast-to-void.
3228 2022-04-11 Jason Merrill <jason@redhat.com>
3231 * init.cc (warn_placement_new_too_small): Check deref.
3233 2022-04-09 Jason Merrill <jason@redhat.com>
3237 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
3238 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
3239 for non-aggregate types.
3240 (build_vec_init_expr): Also check constancy of explicit
3241 initializer elements.
3243 2022-04-09 Jason Merrill <jason@redhat.com>
3247 * name-lookup.cc (set_decl_namespace): Set
3248 DECL_IMPLICIT_INSTANTIATION if no non-template match.
3249 * pt.cc (check_explicit_specialization): Check it.
3250 * decl2.cc (check_classfn): Call it.
3252 2022-04-07 Patrick Palka <ppalka@redhat.com>
3255 * name-lookup.cc (name_lookup::using_queue): Change to an
3256 auto_vec (with 16 elements of internal storage).
3257 (name_lookup::queue_namespace): Change return type to void,
3258 take queue parameter by reference and adjust function body
3260 (name_lookup::do_queue_usings): Inline into ...
3261 (name_lookup::queue_usings): ... here. As in queue_namespace.
3262 (name_lookup::search_unqualified): Don't make queue static,
3263 remove length variable, and adjust function body accordingly.
3265 2022-04-07 Jakub Jelinek <jakub@redhat.com>
3267 PR tree-optimization/102586
3268 * cp-objcp-common.h (cp_classtype_as_base): Declare.
3269 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
3270 * cp-objcp-common.cc (cp_classtype_as_base): New function.
3272 2022-04-07 Jason Merrill <jason@redhat.com>
3275 * decl.cc (grokdeclarator): Reject conversion with trailing return
3278 2022-04-07 Jason Merrill <jason@redhat.com>
3281 * lambda.cc (lambda_expr_this_capture): Check all enclosing
3282 lambdas for completeness.
3284 2022-04-07 Jason Merrill <jason@redhat.com>
3287 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
3290 2022-04-06 Jakub Jelinek <jakub@redhat.com>
3293 * decl2.cc (splice_template_attributes): Return NULL if *p is
3295 (cplus_decl_attributes): Return early if attributes is
3296 error_mark_node. Don't check that later.
3298 2022-04-06 Patrick Palka <ppalka@redhat.com>
3301 * pt.cc (do_class_deduction): Check complain before attempting
3302 to issue a -Wctad-maybe-unsupported warning.
3304 2022-04-06 Jason Merrill <jason@redhat.com>
3307 * init.cc (build_vec_init): Use a reference for the result.
3309 2022-04-06 Jason Merrill <jason@redhat.com>
3312 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
3313 if exactly one of 'old' and 'decl' is a type.
3315 2022-04-05 Jason Merrill <jason@redhat.com>
3319 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
3321 2022-04-05 Jason Merrill <jason@redhat.com>
3324 * name-lookup.h (struct cp_binding_level): Add requires_expression
3326 * parser.cc (cp_parser_requires_expression): Set it.
3327 (synthesize_implicit_template_parm): Check it.
3329 2022-04-04 Jason Merrill <jason@redhat.com>
3332 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
3334 2022-04-04 Jason Merrill <jason@redhat.com>
3338 * pt.cc (get_underlying_template): Compare default template args.
3340 2022-04-03 Benno Evers <benno.evers@tenzir.com>
3341 Iain Sandoe <iain@sandoe.co.uk>
3344 * coroutines.cc (morph_fn_to_coro): Reset
3345 current_binding_level->blocks.
3347 2022-04-01 Jason Merrill <jason@redhat.com>
3350 2022-03-31 Jason Merrill <jason@redhat.com>
3353 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3354 (cp_parser_member_declaration): Call it.
3356 2022-04-01 Jason Merrill <jason@redhat.com>
3359 2022-03-24 Jason Merrill <jason@redhat.com>
3362 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3363 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3364 (type_has_non_user_provided_default_constructor_1): Support it.
3365 (type_has_non_user_provided_default_constructor): Now a wrapper.
3366 * method.cc (complain_about_unparsed_dmi): New.
3367 (constructible_expr): Call it.
3369 2022-04-01 Patrick Palka <ppalka@redhat.com>
3372 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
3373 the argument type of an NTTP before deducing from it.
3375 2022-03-31 Jason Merrill <jason@redhat.com>
3378 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3379 (cp_parser_member_declaration): Call it.
3381 2022-03-30 Patrick Palka <ppalka@redhat.com>
3384 * constraint.cc (diagnose_trait_expr): Handle all remaining
3385 traits appropriately. Remove default case.
3387 2022-03-30 Marek Polacek <polacek@redhat.com>
3391 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
3393 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3396 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
3397 DECL_CONTEXT of the iterator var to current_function_decl and
3400 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3403 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
3404 clear parser->colon_corrects_to_scope_p around tentative parsing of
3405 nested name specifier.
3407 2022-03-28 Jason Merrill <jason@redhat.com>
3409 * pt.cc (determine_specialization): Add comment.
3411 2022-03-28 Patrick Palka <ppalka@redhat.com>
3414 * pt.cc (finish_concept_definition): Check that a concept is
3415 declared with exactly one template parameter list.
3417 2022-03-28 Patrick Palka <ppalka@redhat.com>
3420 * constraint.cc (maybe_substitute_reqs_for): Don't assume
3421 DECL_TEMPLATE_INFO is available.
3423 2022-03-28 Jason Merrill <jason@redhat.com>
3428 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
3429 uses_all_template_parms_r, complex_pack_expansion_r.
3430 (complex_alias_template_p): Adjust.
3431 * tree.cc (strip_typedefs): Revert r12-7710 change.
3433 2022-03-28 Jason Merrill <jason@redhat.com>
3436 * init.cc (build_new_1): Include cookie in alignment. Omit
3437 constexpr wrapper from alloc_call.
3439 2022-03-28 Jason Merrill <jason@redhat.com>
3442 * name-lookup.cc (push_local_extern_decl_alias): Call
3443 determine_visibility.
3445 2022-03-28 Jason Merrill <jason@redhat.com>
3448 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
3449 a type template reference.
3451 2022-03-28 Jason Merrill <jason@redhat.com>
3454 * pt.cc (value_dependent_expression_p): Check
3455 has_value_dependent_address for conversion to reference.
3457 2022-03-28 Jason Merrill <jason@redhat.com>
3460 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
3462 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
3464 2022-03-28 Jason Merrill <jason@redhat.com>
3467 * call.cc (make_base_init_ok): Call make_used.
3469 2022-03-28 Jason Merrill <jason@redhat.com>
3472 * mangle.cc (write_expression): Don't write a union designator when
3475 2022-03-28 Jason Merrill <jason@redhat.com>
3479 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
3481 2022-03-26 Patrick Palka <ppalka@redhat.com>
3484 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
3485 Clarify error message when a if-stmt is non-constant because its
3486 branches are non-constant.
3488 2022-03-26 Patrick Palka <ppalka@redhat.com>
3491 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
3492 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
3494 2022-03-26 Jakub Jelinek <jakub@redhat.com>
3496 * parser.cc (cp_parser_postfix_expression)
3497 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
3498 return cp_build_{vec,convert,bit_cast} result right away, instead
3499 set postfix_expression to it and break.
3501 2022-03-25 Marek Polacek <polacek@redhat.com>
3504 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
3505 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
3508 2022-03-24 Marek Polacek <polacek@redhat.com>
3511 * decl.cc (check_initializer): Don't call build_aggr_init in
3514 2022-03-24 Jason Merrill <jason@redhat.com>
3517 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3518 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3519 (type_has_non_user_provided_default_constructor_1): Support it.
3520 (type_has_non_user_provided_default_constructor): Now a wrapper.
3521 * method.cc (complain_about_unparsed_dmi): New.
3522 (constructible_expr): Call it.
3524 2022-03-24 Marek Polacek <polacek@redhat.com>
3527 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
3529 2022-03-24 Patrick Palka <ppalka@redhat.com>
3532 * call.cc (build_over_call): Use cxx_constant_value_sfinae
3533 instead of cxx_constant_value to evaluate a consteval call.
3534 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
3535 and pass it to cxx_eval_outermost_constant_expr.
3536 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
3537 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
3538 cxx_constant_value_sfinae.
3540 2022-03-24 Jakub Jelinek <jakub@redhat.com>
3543 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
3544 through extern thread_local declarations. Change wording from
3545 declaration to definition.
3546 (potential_constant_expression_1): Don't diagnose extern thread_local
3547 declarations. Change wording from declared to defined.
3548 * decl.cc (start_decl): Likewise.
3550 2022-03-23 Jason Merrill <jason@redhat.com>
3553 * decl.cc (reshape_single_init): New.
3554 (reshape_init_class): Use it.
3556 2022-03-23 Jason Merrill <jason@redhat.com>
3559 * name-lookup.cc (lookup_using_decl): Check that scope is
3560 a dependent type before looking for dependent using.
3562 2022-03-23 Jason Merrill <jason@redhat.com>
3565 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
3566 finds a dependent using.
3568 2022-03-21 Jason Merrill <jason@redhat.com>
3571 * init.cc (build_vec_init): Check for vla element type.
3573 2022-03-21 Jason Merrill <jason@redhat.com>
3579 * decl.cc (reshape_init_class): Avoid looking for designator
3581 (reshape_init_r): Keep looking for designator.
3583 2022-03-21 Jason Merrill <jason@redhat.com>
3586 * decl.cc (reshape_init_class): Back out of anon struct
3587 if a designator doesn't match.
3589 2022-03-18 Jason Merrill <jason@redhat.com>
3593 * class.cc (add_method): Avoid adding the same used function twice.
3594 (handle_using_decl): Don't add_method.
3595 (finish_struct): Don't using op= if we have one already.
3596 (maybe_push_used_methods): New.
3597 * semantics.cc (finish_member_declaration): Call it.
3598 * name-lookup.cc (diagnose_name_conflict): No longer static.
3599 (push_class_level_binding): Revert 92918 patch, limit
3601 * cp-tree.h: Adjust.
3603 2022-03-18 Jakub Jelinek <jakub@redhat.com>
3606 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
3607 argument and its handling, instead add ITYPE2 argument. Only
3608 support COOKIE_SIZE != NULL.
3609 (build_new_1): If size is 0, change it to 0 * outer_nelts if
3610 outer_nelts is non-NULL. Pass type rather than elt_type to
3611 maybe_wrap_new_for_constexpr.
3612 * constexpr.cc (build_new_constexpr_heap_type): New function.
3613 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
3614 If elt_size is zero sized type, try to recover outer_nelts from
3615 the size argument to operator new/new[] and pass that as
3616 arg_size to build_new_constexpr_heap_type. Pass ctx,
3617 non_constant_p and overflow_p to that call too.
3619 2022-03-18 Marek Polacek <polacek@redhat.com>
3622 * tree.cc (strip_typedefs): Don't strip an alias template when
3623 doing so would result in losing a parameter pack.
3625 2022-03-16 Patrick Palka <ppalka@redhat.com>
3627 * search.cc (lookup_member): Simplify by handling all values
3628 of protect together in the ambiguous case. Don't modify protect.
3630 2022-03-16 Patrick Palka <ppalka@redhat.com>
3633 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
3634 std::move/forward and other cast-like functions into simple
3637 2022-03-15 Patrick Palka <ppalka@redhat.com>
3640 * search.cc (lookup_field_info::errstr): Remove this data
3642 (lookup_field_r): Don't set errstr.
3643 (lookup_member): Check ambiguity before checking access.
3644 Simplify accordingly after errstr removal. Exit early upon
3645 error or empty result.
3647 2022-03-15 Jakub Jelinek <jakub@redhat.com>
3650 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
3652 2022-03-14 Jakub Jelinek <jakub@redhat.com>
3654 PR tree-optimization/102586
3655 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
3656 first argument's type is pointer to non-trivially-copyable type unless
3657 it is address of a variable or parameter.
3659 2022-03-12 Patrick Palka <ppalka@redhat.com>
3662 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
3663 * decl.cc (make_typename_type): Allow a typename-specifier to
3664 resolve to a template when tf_tst_ok, in which case return
3665 a CTAD placeholder for the template.
3666 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
3667 substituting the type.
3668 (tsubst): Clear tf_tst_ok and remember if it was set.
3669 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
3671 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
3673 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
3674 <case CONSTRUCTOR>: Likewise.
3676 2022-03-12 Patrick Palka <ppalka@redhat.com>
3679 * call.cc (missing_conversion_p): Define.
3680 (add_candidates): Use it.
3681 * pt.cc (check_non_deducible_conversion): Change type of strict
3682 parameter to unification_kind_t and directly test for DEDUCE_CALL.
3684 2022-03-12 Patrick Palka <ppalka@redhat.com>
3687 * constraint.cc (normalize_atom): Set
3688 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
3689 (get_mapped_args): Make static, adjust parameters. Always
3690 return a vector whose depth corresponds to the template depth of
3691 the context of the atomic constraint expression. Micro-optimize
3692 by passing false as exact to safe_grow_cleared and by collapsing
3693 a multi-level depth-one argument vector.
3694 (satisfy_atom): Adjust call to get_mapped_args and
3695 diagnose_atomic_constraint.
3696 (diagnose_atomic_constraint): Replace map parameter with an args
3698 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
3699 (get_mapped_args): Remove declaration.
3701 2022-03-12 Patrick Palka <ppalka@redhat.com>
3702 Jason Merrill <jason@redhat.com>
3705 * constexpr.cc (mark_non_constant): Define, split out from ...
3706 (cxx_eval_outermost_constant_expr): ... here.
3707 (maybe_constant_value): Use it.
3709 2022-03-12 Patrick Palka <ppalka@redhat.com>
3711 * semantics.cc (finish_unary_fold_expr): Use input_location
3712 instead of UNKNOWN_LOCATION.
3713 (finish_binary_fold_expr): Likewise.
3715 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
3718 * semantics.cc (handle_omp_array_sections_1)
3719 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
3720 instead of 'c_omp_map_clause_name'.
3722 2022-03-10 Marek Polacek <polacek@redhat.com>
3725 * parser.cc (cp_parser_template_name): Repeat lookup of
3728 2022-03-10 Marek Polacek <polacek@redhat.com>
3731 * semantics.cc (finish_compound_literal): Disallow auto{x} for
3732 is_constrained_auto.
3733 * typeck2.cc (build_functional_cast_1): Likewise.
3735 2022-03-10 Marek Polacek <polacek@redhat.com>
3738 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
3741 2022-03-10 Jakub Jelinek <jakub@redhat.com>
3744 * decl.cc (grok_op_properties): Allow variadic operator[] for
3747 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
3750 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
3751 consider it to be zero (i.e. treat it like error_mark_node).
3752 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
3753 set VALUE to error_mark_node.
3755 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
3758 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
3759 stream hasn't been purged before processing DECL_PENDING_INLINE.
3761 2022-03-09 Patrick Palka <ppalka@redhat.com>
3764 * except.cc (build_noexcept_spec): Strengthen dependence check
3765 to instantiation_dependent_expression_p.
3766 * parser.cc (cp_parser_parenthesized_expression_list_elt):
3767 Remove fold_expr_p parameter, and don't call
3768 instantiate_non_dependent_expr.
3769 (cp_parser_parenthesized_expression_list): Adjust accordingly.
3770 * pt.cc (expand_integer_pack): Strengthen dependence check
3771 to instantiation_dependent_expression_p.
3772 (instantiate_non_dependent_expr_internal): Adjust comment.
3773 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
3774 the potentially-constant check, and relax and turn the
3775 dependence check into a checking assert.
3776 (instantiate_non_dependent_or_null): Adjust comment.
3777 * semantics.cc (finish_decltype_type): Keep
3778 processing_template_decl cleared after calling
3779 instantiate_non_dependent_expr_sfinae.
3781 2022-03-09 Patrick Palka <ppalka@redhat.com>
3785 * cp-tree.h (is_copy_initialization): Declare.
3786 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
3787 when is_copy_initialization is true.
3788 * init.cc (build_aggr_init): Split out copy-initialization
3790 (is_copy_initialization): ... here.
3791 * pt.cc (instantiate_decl): Pass 0 instead of
3792 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
3794 2022-03-09 Patrick Palka <ppalka@redhat.com>
3797 * cp-tree.h (merge_default_template_args): Declare.
3798 * decl.cc (merge_default_template_args): Define, factored out
3799 from redeclare_class_template.
3800 (duplicate_decls): Use it when merging member function template
3801 and free function declarations.
3802 * pt.cc (redeclare_class_template): Factor out default argument
3803 merging logic into merge_default_template_args. Improve location
3804 of a note when there's a template parameter kind mismatch.
3806 2022-03-09 Jakub Jelinek <jakub@redhat.com>
3809 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
3810 instead of TYPE_UNSIGNED.
3811 * typeck.cc (cp_build_binary_op): Don't emit
3812 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
3814 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3817 * decl.cc (start_decl): Defend against prefix_attributes being
3820 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3823 * parser.cc (synthesize_implicit_template_parm): Check that
3824 TREE_VALUE (new_parm) isn't error_mark_node before setting its
3827 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
3830 * parser.cc (cp_parser_linkage_specification): Treat the case where
3831 linkage is error_mark_node as "invalid linkage-specification".
3833 2022-03-08 Marek Polacek <polacek@redhat.com>
3836 * pt.cc (convert_nontype_argument): Recompute
3837 value_dependent_expression_p after build_converted_constant_expr.
3839 2022-03-08 Marek Polacek <polacek@redhat.com>
3841 * decl2.cc (is_late_template_attribute): Do not defer attribute
3843 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
3845 2022-03-08 Jakub Jelinek <jakub@redhat.com>
3848 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
3849 identifiers with space at the end.
3851 2022-03-07 Jason Merrill <jason@redhat.com>
3854 * decl2.cc (mark_single_function): Look through parens and location
3856 * typeck.cc (cp_build_addr_expr_1): Not here.
3858 2022-03-07 Jakub Jelinek <jakub@redhat.com>
3860 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
3863 2022-03-07 Jakub Jelinek <jakub@redhat.com>
3865 * cvt.cc: Fix up duplicated word issue in a comment.
3867 * module.cc: Likewise.
3868 * coroutines.cc: Likewise.
3870 2022-03-04 Nathan Sidwell <nathan@acm.org>
3872 * mangle.cc (is_std_substitution): Check global module.
3873 (is_std_substitution_char): Return bool.
3875 2022-03-04 Nathan Sidwell <nathan@acm.org>
3877 * cp-tree.h (mangle_identifier): Replace with ...
3878 (mangle_module_component): ... this.
3879 * mangle.cc (dump_substitution_candidates): Adjust.
3880 (add_substitution): Likewise.
3881 (find_substitution): Likewise.
3882 (unmangled_name_p): Likewise.
3883 (mangle_module_substitution): Reimplement.
3884 (mangle_module_component): New.
3885 (write_module, maybe_write_module): Adjust.
3886 (write_name): Drop modules here.
3887 (write_unqualified): Do them here instead.
3888 (mangle_global_init): Adjust.
3889 * module.cc (module_state::mangle): Adjust.
3890 (mangle_module): Likewise.
3891 (get_originating_module): Adjust.
3893 2022-02-28 Marek Polacek <polacek@redhat.com>
3896 * cp-tree.h (build_enumerator): Adjust.
3897 * decl.cc (finish_enum): Make it return the new decl.
3898 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
3900 2022-02-28 Marek Polacek <polacek@redhat.com>
3903 * decl2.cc (is_late_template_attribute): Cope with a decl without
3906 2022-02-27 Jason Merrill <jason@redhat.com>
3909 * typeck.cc (cp_build_addr_expr_1): Also
3910 maybe_undo_parenthesized_ref.
3912 2022-02-24 Martin Liska <mliska@suse.cz>
3914 * pt.cc (defarg_insts_for): Use braces for subobject.
3916 2022-02-18 Patrick Palka <ppalka@redhat.com>
3919 * pt.cc (maybe_instantiate_noexcept): For non-static member
3920 functions, set current_class_ptr/ref to the specialized 'this'
3923 2022-02-17 Jason Merrill <jason@redhat.com>
3926 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
3928 2022-02-17 Jason Merrill <jason@redhat.com>
3931 * decl2.cc (mark_single_function): New.
3932 * cp-tree.h: Declare it.
3933 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
3934 * semantics.cc (finish_qualified_id_expr): Not here.
3935 (finish_id_expression_1): Or here.
3936 (finish_decltype_type): Call mark_single_function.
3937 * cvt.cc (convert_to_void): And here.
3938 * pt.cc (convert_nontype_argument): And here.
3939 * init.cc (build_offset_ref): Adjust assert.
3941 2022-02-17 Patrick Palka <ppalka@redhat.com>
3944 * semantics.cc (finish_compound_literal): Don't perform
3945 non-dependent expr folding before calling check_narrowing.
3947 2022-02-16 Patrick Palka <ppalka@redhat.com>
3950 * constexpr.cc (potential_constant_expression_1)
3951 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
3952 Assert tf_error isn't set.
3954 2022-02-15 Jason Merrill <jason@redhat.com>
3958 * pt.cc (coerce_template_template_parms): Take full parms.
3959 Avoid adding too much of outer_args.
3960 (coerce_template_template_parm): Adjust.
3961 (template_template_parm_bindings_ok_p): Adjust.
3962 (convert_template_argument): Adjust.
3964 2022-02-14 Jakub Jelinek <jakub@redhat.com>
3967 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
3968 Don't punt if returns (target).
3970 2022-02-11 Jakub Jelinek <jakub@redhat.com>
3973 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
3974 Only return fold_const_call result if it is non-NULL. Otherwise
3975 fall through into the default: case to return t, set *non_constant_p
3976 and emit diagnostics if needed.
3978 2022-02-10 Jason Merrill <jason@redhat.com>
3980 * module.cc (depset::hash::add_specializations): Use
3983 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
3986 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
3987 members as those are permitted since OpenMP 5.0.
3989 2022-02-10 Patrick Palka <ppalka@redhat.com>
3991 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
3994 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
3996 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
3997 (cp_parser_omp_var_list_no_open): Handle array sections.
3998 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
4000 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
4001 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
4002 (finish_omp_clauses): Handle array sections.
4004 2022-02-09 Patrick Palka <ppalka@redhat.com>
4007 * call.cc (build_new_method_call): When a non-dependent call
4008 resolves to a specialization of a member template, always build
4009 the pruned overload set using the member template, not the
4011 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
4012 and correct how members from the new lookup set are matched to
4013 those from the old one.
4014 (tsubst_baselink): Pass binfo_type as newtype to
4015 filter_memfn_lookup.
4017 2022-02-09 Jason Merrill <jason@redhat.com>
4020 * module.cc (trees_out::core_vals): Stream explicit specifier.
4021 (trees_in::core_vals): Likewise.
4022 * pt.cc (store_explicit_specifier): No longer static.
4023 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
4024 * cp-tree.h (lookup_explicit_specifier): Declare.
4026 2022-02-09 Jason Merrill <jason@redhat.com>
4029 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
4030 preceding members with constant initialization.
4031 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
4033 2022-02-08 Jakub Jelinek <jakub@redhat.com>
4036 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
4037 of a member or global declaration, add warning suppression for
4038 the decl and don't warn again on it.
4040 2022-02-08 Jakub Jelinek <jakub@redhat.com>
4043 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
4044 of TREE_STATIC vars may only appear in -std=c++23.
4046 2022-02-08 Patrick Palka <ppalka@redhat.com>
4049 * pt.cc (uses_deducible_template_parms): Consider the
4050 noexcept-spec of a function type.
4052 2022-02-08 Patrick Palka <ppalka@redhat.com>
4055 * constraint.cc (satisfaction_value): Relax assert to accept
4058 2022-02-08 Patrick Palka <ppalka@redhat.com>
4061 * pt.cc (preserve_args): New function.
4062 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
4064 2022-02-08 Patrick Palka <ppalka@redhat.com>
4067 * constraint.cc (satisfy_declaration_constraints): Use
4068 lambda_regenerating_args instead.
4069 * cp-tree.h (lambda_regenerating_args): Declare.
4070 * pt.cc (lambda_regenerating_args): Define, split out from
4071 satisfy_declaration_constraints.
4072 (do_auto_deduction): Use lambda_regenerating_args to obtain the
4073 full set of outer template arguments for satisfaction when
4076 2022-02-06 Patrick Palka <ppalka@redhat.com>
4079 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
4080 fn by calling maybe_synthesize_method instead of relying on
4081 maybe_instantiate_noexcept. Move call to m_i_n after the
4082 DECL_DELETED_FN handling.
4083 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
4084 fn synthesis to only those with an implicit noexcept-spec, and
4085 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
4087 2022-02-06 Jakub Jelinek <jakub@redhat.com>
4091 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
4092 folding_cxx_constexpr.
4094 2022-02-05 Jason Merrill <jason@redhat.com>
4098 * cp-tree.h (get_vec_init_expr): New.
4099 (target_expr_needs_replace): New.
4100 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
4101 (struct cp_fold_data): New.
4102 (cp_fold_r): Only genericize inits at end of fn.
4103 (cp_fold_function): Here.
4104 (cp_fully_fold_init): Not here.
4105 * init.cc (build_vec_init): Use get_vec_init_expr.
4106 * tree.cc (build_vec_init_expr): Likewise.
4107 * typeck2.cc (split_nonconstant_init_1): Likewise.
4108 (process_init_constructor): Wrap VEC_INIT_EXPR in
4111 2022-02-05 Jason Merrill <jason@redhat.com>
4113 * pt.cc (iterative_hash_template_arg): Add comment.
4115 2022-02-03 Patrick Palka <ppalka@redhat.com>
4118 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
4120 (dependent_type_p_r): ... here.
4121 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
4122 to consider dependence of a noexcept-spec before C++17.
4123 * tree.cc (fixup_deferred_exception_variants): Clear
4124 TYPE_DEPENDENT_P_VALID.
4126 2022-02-03 Jason Merrill <jason@redhat.com>
4129 * decl.cc (maybe_deduce_size_from_array_init): Give up
4130 on type-dependent init.
4131 (cp_complete_array_type): Only call reshape_init for character
4134 2022-02-01 Jason Merrill <jason@redhat.com>
4137 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
4138 (defarg_insts_for): New.
4139 (tsubst_default_argument): Adjust.
4141 2022-01-31 Marek Polacek <polacek@redhat.com>
4145 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
4146 Sorry on a variable-length array of auto.
4148 2022-01-31 Marek Polacek <polacek@redhat.com>
4151 * class.cc (finish_struct): Don't allow union initializer_list.
4153 2022-01-31 Patrick Palka <ppalka@redhat.com>
4156 * pt.cc (ctor_deduction_guides_for): Correct computation of
4159 2022-01-31 Patrick Palka <ppalka@redhat.com>
4162 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
4163 walk_subtrees if !include_nondeduced_p. Simplify given that
4164 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
4166 2022-01-28 Patrick Palka <ppalka@redhat.com>
4167 Jason Merrill <jason@redhat.com>
4170 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
4171 unqualified pointer type not the qualified one.
4173 2022-01-28 Patrick Palka <ppalka@redhat.com>
4176 * decl.cc (cp_finish_decl): Pass the template arguments of a
4177 variable template specialization or a templated static data
4178 member to do_auto_deduction when the auto is constrained.
4180 2022-01-28 Jason Merrill <jason@redhat.com>
4185 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
4187 (cp_parser_class_head): And in class attributes.
4188 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
4191 2022-01-27 Jason Merrill <jason@redhat.com>
4195 * decl2.cc (save_template_attributes): Take late attrs as parm.
4196 (cplus_decl_attributes): Call it after decl_attributes,
4197 splice_template_attributes before.
4199 2022-01-27 Patrick Palka <ppalka@redhat.com>
4202 * call.cc (build_over_call): For a non-dependent member call,
4203 build up a CALL_EXPR using a COMPONENT_REF callee, as in
4204 build_new_method_call.
4205 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
4206 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
4207 after the build_over_call change.
4209 2022-01-27 Patrick Palka <ppalka@redhat.com>
4213 * parser.cc (cp_parser_class_head): Update 'type' with the result
4214 of maybe_process_partial_specialization in the
4215 nested_name_specifier branch. Refactor nearby code to accomodate
4216 that maybe_process_partial_specialization returns a _TYPE, not a
4217 TYPE_DECL, and eliminate local variable 'class_type' in passing.
4219 2022-01-27 Marek Polacek <polacek@redhat.com>
4222 * decl.cc (create_array_type_for_decl): Reject forming an array of
4223 placeholder for a deduced class type.
4225 2022-01-26 Jason Merrill <jason@redhat.com>
4229 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
4231 2022-01-26 Jakub Jelinek <jakub@redhat.com>
4234 * constexpr.cc (init_subob_ctx): For vector ctors containing
4235 vector elements, ensure appending to the same ctor instead of
4236 creating another one.
4238 2022-01-26 Marek Polacek <polacek@redhat.com>
4241 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
4242 (finish_destructor_body): Likewise.
4243 * optimize.cc (build_delete_destructor_body): Likewise.
4245 2022-01-26 Jason Merrill <jason@redhat.com>
4248 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
4250 2022-01-26 Jason Merrill <jason@redhat.com>
4253 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
4256 2022-01-25 Patrick Palka <ppalka@redhat.com>
4260 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
4261 on a deleted function.
4263 2022-01-25 Jason Merrill <jason@redhat.com>
4266 * call.cc (build_over_call): Use cp_build_indirect_ref.
4268 2022-01-24 Patrick Palka <ppalka@redhat.com>
4271 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
4274 2022-01-24 Patrick Palka <ppalka@redhat.com>
4277 * typeck.cc (build_class_member_access_expr): Extend
4278 unary_complex_lvalue result adjustment to preserve all
4279 rvalues, not just xvalues.
4281 2022-01-23 Will Wray <wjwray@gmail.com>
4284 * decl.cc (reshape_init_r): Only call has_designator_check when
4285 first_initializer_p or for the inner constructor element.
4286 (cp_complete_array_type): Call reshape_init on braced-init-list.
4288 2022-01-23 Jason Merrill <jason@redhat.com>
4291 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
4292 has set DECL_INITIAL on a TARGET_EXPR slot.
4293 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
4295 2022-01-23 Jason Merrill <jason@redhat.com>
4298 * cp-tree.h (build_implicit_conv_flags): Declare.
4299 * call.cc (build_implicit_conv_flags): Split out from...
4300 (perform_implicit_conversion_flags): ...here.
4301 * decl.cc (check_initializer): Use it.
4302 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
4303 * semantics.cc (finish_compound_literal): Don't treat
4304 scalar values like CONSTRUCTORs.
4306 2022-01-21 Jason Merrill <jason@redhat.com>
4308 * semantics.cc (find_failing_clause): Return expr if not
4310 (finish_static_assert): Show constant values in failing
4313 2022-01-21 Jason Merrill <jason@redhat.com>
4317 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
4318 alloc_expr is a TARGET_EXPR.
4320 2022-01-21 Marek Polacek <polacek@redhat.com>
4323 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
4324 variants after parsing the exception specifications.
4326 2022-01-21 Jason Merrill <jason@redhat.com>
4330 * class.cc (end_of_class): Use base_binfo.
4332 2022-01-20 Jason Merrill <jason@redhat.com>
4335 * decl.cc (reshape_init_class): Reject designator for a member of
4338 2022-01-20 Patrick Palka <ppalka@redhat.com>
4342 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
4343 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
4344 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
4346 (make_auto_1): Add defaulted 'level' parameter.
4347 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
4349 2022-01-20 Patrick Palka <ppalka@redhat.com>
4351 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
4352 function return type even when !funcdecl_p.
4354 2022-01-20 Martin Liska <mliska@suse.cz>
4357 * error.cc (dump_aggr_type): Partially disable the warning.
4359 2022-01-20 Jason Merrill <jason@redhat.com>
4362 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
4364 2022-01-19 David Malcolm <dmalcolm@redhat.com>
4366 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
4368 * cp-tree.h (cp_pt_c_tests): Rename to...
4369 (cp_pt_cc_tests): ...this.
4370 (cp_tree_c_tests): Rename to...
4371 (cp_tree_cc_tests): ...this.
4372 * pt.cc (cp_pt_c_tests): Rename to...
4373 (cp_pt_cc_tests): ...this.
4374 * tree.cc (cp_tree_c_tests): Rename to...
4375 (cp_tree_cc_tests): ...this.
4377 2022-01-19 Jason Merrill <jason@redhat.com>
4379 * parser.cc (saved_token_sentinel::rollback): Use
4380 cp_lexer_previous_token.
4382 2022-01-18 Jakub Jelinek <jakub@redhat.com>
4385 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
4386 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
4387 than get_target_expr_sfinae with tf_no_cleanup, and don't set
4390 2022-01-18 Jason Merrill <jason@redhat.com>
4391 Jakub Jelinek <jakub@redhat.com>
4394 * parser.cc (saved_token_sentinel::rollback): Call
4395 cp_lexer_set_source_position.
4396 (~saved_token_sentinel): Call rollback.
4398 2022-01-18 Patrick Palka <ppalka@redhat.com>
4401 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
4402 that we return false for DEPENDENT_OPERATOR_TYPE too.
4404 2022-01-17 Martin Liska <mliska@suse.cz>
4406 * Make-lang.in: Rename .c names to .cc.
4407 * config-lang.in: Likewise.
4408 * constexpr.cc (cxx_eval_constant_expression): Likewise.
4409 * coroutines.cc (morph_fn_to_coro): Likewise.
4410 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
4411 * cp-lang.cc (struct lang_hooks): Likewise.
4412 (get_template_argument_pack_elems_folded): Likewise.
4413 * cp-objcp-common.cc (cp_tree_size): Likewise.
4414 (cp_unit_size_without_reusable_padding): Likewise.
4415 (pop_file_scope): Likewise.
4416 (cp_pushdecl): Likewise.
4417 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
4418 (cxx_simulate_record_decl): Likewise.
4419 * cp-tree.h (struct named_label_entry): Likewise.
4420 (current_function_return_value): Likewise.
4421 (more_aggr_init_expr_args_p): Likewise.
4422 (get_function_version_dispatcher): Likewise.
4423 (common_enclosing_class): Likewise.
4424 (strip_fnptr_conv): Likewise.
4425 (current_decl_namespace): Likewise.
4426 (do_aggregate_paren_init): Likewise.
4427 (cp_check_const_attributes): Likewise.
4428 (qualified_name_lookup_error): Likewise.
4429 (generic_targs_for): Likewise.
4430 (mark_exp_read): Likewise.
4431 (is_global_friend): Likewise.
4432 (maybe_reject_flexarray_init): Likewise.
4433 (module_token_lang): Likewise.
4434 (handle_module_option): Likewise.
4435 (literal_integer_zerop): Likewise.
4436 (build_extra_args): Likewise.
4437 (build_if_nonnull): Likewise.
4438 (maybe_check_overriding_exception_spec): Likewise.
4439 (finish_omp_target_clauses): Likewise.
4440 (maybe_warn_zero_as_null_pointer_constant): Likewise.
4441 (cxx_print_error_function): Likewise.
4442 (decl_in_std_namespace_p): Likewise.
4443 (merge_exception_specifiers): Likewise.
4444 (mangle_module_global_init): Likewise.
4445 (cxx_block_may_fallthru): Likewise.
4446 (fold_builtin_source_location): Likewise.
4447 (enum cp_oracle_request): Likewise.
4448 (subsumes): Likewise.
4449 (cp_finish_injected_record_type): Likewise.
4450 (vtv_build_vtable_verify_fndecl): Likewise.
4451 (cp_tree_c_finish_parsing): Likewise.
4452 * cvt.cc (diagnose_ref_binding): Likewise.
4453 (convert_to_void): Likewise.
4454 (convert_force): Likewise.
4455 (type_promotes_to): Likewise.
4456 * decl.cc (make_unbound_class_template_raw): Likewise.
4457 (cxx_init_decl_processing): Likewise.
4458 (check_class_member_definition_namespace): Likewise.
4459 (cxx_maybe_build_cleanup): Likewise.
4460 * decl2.cc (maybe_emit_vtables): Likewise.
4461 * error.cc (dump_function_name): Likewise.
4462 * init.cc (is_class_type): Likewise.
4463 (build_new_1): Likewise.
4464 * lang-specs.h: Likewise.
4465 * method.cc (make_alias_for_thunk): Likewise.
4466 * module.cc (specialization_add): Likewise.
4467 (module_state::read_cluster): Likewise.
4468 * name-lookup.cc (check_extern_c_conflict): Likewise.
4469 * name-lookup.h (struct cxx_binding): Likewise.
4470 * parser.cc (cp_parser_identifier): Likewise.
4471 * parser.h (struct cp_parser): Likewise.
4472 * pt.cc (has_value_dependent_address): Likewise.
4473 (push_tinst_level_loc): Likewise.
4474 * semantics.cc (finish_omp_clauses): Likewise.
4475 (finish_omp_atomic): Likewise.
4476 * tree.cc (cp_save_expr): Likewise.
4477 (cp_free_lang_data): Likewise.
4478 * typeck.cc (cp_common_type): Likewise.
4479 (strip_array_domain): Likewise.
4480 (rationalize_conditional_expr): Likewise.
4481 (check_return_expr): Likewise.
4482 * vtable-class-hierarchy.cc: Likewise.
4484 2022-01-17 Martin Liska <mliska@suse.cz>
4486 * call.c: Moved to...
4488 * class.c: Moved to...
4489 * class.cc: ...here.
4490 * constexpr.c: Moved to...
4491 * constexpr.cc: ...here.
4492 * cp-gimplify.c: Moved to...
4493 * cp-gimplify.cc: ...here.
4494 * cp-lang.c: Moved to...
4495 * cp-lang.cc: ...here.
4496 * cp-objcp-common.c: Moved to...
4497 * cp-objcp-common.cc: ...here.
4498 * cp-ubsan.c: Moved to...
4499 * cp-ubsan.cc: ...here.
4500 * cvt.c: Moved to...
4502 * cxx-pretty-print.c: Moved to...
4503 * cxx-pretty-print.cc: ...here.
4504 * decl.c: Moved to...
4506 * decl2.c: Moved to...
4507 * decl2.cc: ...here.
4508 * dump.c: Moved to...
4510 * error.c: Moved to...
4511 * error.cc: ...here.
4512 * except.c: Moved to...
4513 * except.cc: ...here.
4514 * expr.c: Moved to...
4516 * friend.c: Moved to...
4517 * friend.cc: ...here.
4518 * g++spec.c: Moved to...
4519 * g++spec.cc: ...here.
4520 * init.c: Moved to...
4522 * lambda.c: Moved to...
4523 * lambda.cc: ...here.
4524 * lex.c: Moved to...
4526 * mangle.c: Moved to...
4527 * mangle.cc: ...here.
4528 * method.c: Moved to...
4529 * method.cc: ...here.
4530 * name-lookup.c: Moved to...
4531 * name-lookup.cc: ...here.
4532 * optimize.c: Moved to...
4533 * optimize.cc: ...here.
4534 * parser.c: Moved to...
4535 * parser.cc: ...here.
4538 * ptree.c: Moved to...
4539 * ptree.cc: ...here.
4540 * rtti.c: Moved to...
4542 * search.c: Moved to...
4543 * search.cc: ...here.
4544 * semantics.c: Moved to...
4545 * semantics.cc: ...here.
4546 * tree.c: Moved to...
4548 * typeck.c: Moved to...
4549 * typeck.cc: ...here.
4550 * typeck2.c: Moved to...
4551 * typeck2.cc: ...here.
4552 * vtable-class-hierarchy.c: Moved to...
4553 * vtable-class-hierarchy.cc: ...here.
4555 2022-01-17 Jakub Jelinek <jakub@redhat.com>
4558 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
4559 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
4561 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
4563 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
4565 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
4568 * semantics.c (finish_omp_clauses): Also continue peeling off of
4569 outer node for ARRAY_REFs.
4571 2022-01-14 Jakub Jelinek <jakub@redhat.com>
4574 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
4575 IF_STMT_CONSTEXPR_P with constant false or true condition only
4576 check if the taken clause may fall through.
4577 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
4578 to r12-5638^ behavior if then_ block can't fall through. For
4579 constexpr if, revert to r12-5638^ behavior.
4581 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
4582 Jason Merrill <jason@redhat.com>
4585 * parser.c (cp_parser_id_expression): Handle
4586 -Wmissing-template-keyword.
4587 (struct saved_token_sentinel): Add modes to control what happens
4589 (cp_parser_statement): Adjust.
4590 (cp_parser_skip_entire_template_parameter_list): New function that
4591 skips an entire template parameter list.
4592 (cp_parser_require_end_of_template_parameter_list): Rename old
4593 cp_parser_skip_to_end_of_template_parameter_list.
4594 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
4595 called from one of the above two functions.
4596 (cp_parser_lambda_declarator_opt)
4597 (cp_parser_explicit_template_declaration)
4598 (cp_parser_enclosed_template_argument_list): Adjust.
4600 2022-01-12 Jakub Jelinek <jakub@redhat.com>
4601 Jason Merrill <jason@redhat.com>
4604 * tree.c (move): If expr is xvalue_p, just return expr without
4607 2022-01-11 Jakub Jelinek <jakub@redhat.com>
4610 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
4611 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
4612 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
4613 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
4616 2022-01-11 Patrick Palka <ppalka@redhat.com>
4619 * call.c (build_new_method_call): Consider dependent bases only
4620 if 'this' is available.
4622 2022-01-11 Olivier Hainque <hainque@adacore.com>
4624 * decl.c (cxx_init_decl_processing): Move code possibly
4625 altering flag_weak before code testing it.
4627 2022-01-10 Patrick Palka <ppalka@redhat.com>
4630 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
4631 canonicalization step into a local lambda. Strengthen it to
4632 absorb more components at position 0. Use it before both calls
4633 to cxx_fold_indirect_ref_1.
4635 2022-01-10 Patrick Palka <ppalka@redhat.com>
4638 * call.c (cand_parms_match): Skip over 'this' when given one
4639 static and one non-static member function.
4641 2022-01-10 Jakub Jelinek <jakub@redhat.com>
4644 * semantics.c (expand_or_defer_fn): For immediate functions, set
4645 node->body_removed to true and clear analyzed, definition and
4647 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
4650 2022-01-08 Jakub Jelinek <jakub@redhat.com>
4653 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
4654 (cxx_eval_binary_expression): Use it.
4656 2022-01-08 Jason Merrill <jason@redhat.com>
4659 * init.c (build_vec_init): Remove assert.
4660 * tree.c (build_vec_init_expr): Likewise.
4662 2022-01-08 Jason Merrill <jason@redhat.com>
4665 * call.c (build_op_delete_call): Ignore destroying delete
4668 2022-01-07 Jason Merrill <jason@redhat.com>
4671 * init.c (build_new_1): Also build pointer cleanup if
4673 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
4675 2022-01-07 Jason Merrill <jason@redhat.com>
4679 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
4681 2022-01-07 Jason Merrill <jason@redhat.com>
4684 * init.c (perform_target_ctor): Select destructor by in_chrg.
4686 2022-01-07 Jason Merrill <jason@redhat.com>
4689 * except.c (in_nested_catch): New.
4690 (expand_end_catch_block): Check it.
4692 2022-01-07 Jason Merrill <jason@redhat.com>
4696 * except.c (maybe_splice_retval_cleanup): Check
4697 current_binding_level.
4698 * semantics.c (do_poplevel): Call it here.
4699 * parser.c (cp_parser_compound_statement): Not here.
4701 2022-01-07 Jason Merrill <jason@redhat.com>
4704 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
4705 cleanups from set_up_extended_ref_temp.
4706 (wrap_temporary_cleanups): Ignore array cleanups.
4707 (initialize_local_var): Don't check for array here.
4708 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
4709 * init.c (build_vec_delete_1): Set it.
4711 2022-01-07 Jason Merrill <jason@redhat.com>
4714 * init.c (build_vec_delete_1): Handle throwing dtor.
4715 (build_vec_init): Tell it we're in a cleanup already.
4717 2022-01-07 Jason Merrill <jason@redhat.com>
4719 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
4720 (split_nonconstant_init): Adjust.
4722 2022-01-07 Jason Merrill <jason@redhat.com>
4726 * constexpr.c (replace_decl): Rename from replace_result_decl.
4727 * cp-tree.h (replace_decl): Declare it.
4728 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
4729 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
4730 (cp_genericize_init, cp_genericize_init_expr)
4731 (cp_genericize_target_expr): New.
4732 (cp_fold_r): Call them.
4733 * tree.c (build_array_copy): Add a TARGET_EXPR.
4734 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
4736 2022-01-07 Jason Merrill <jason@redhat.com>
4739 * decl.c (initialize_local_var): Fix comment.
4740 * init.c (build_new_1): Do stabilize array init.
4741 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
4742 of an element from an explicit initializer is not a
4744 * tree.c (expand_vec_init_expr): Pass flags through.
4745 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
4746 (split_nonconstant_init): Handle array cleanups.
4747 * cp-tree.h: Adjust.
4749 2022-01-07 Jason Merrill <jason@redhat.com>
4752 * decl.c (check_initializer): Remove obsolete comment.
4753 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
4754 (initialize_local_var): Change assert to test.
4755 * typeck2.c (maybe_push_temp_cleanup): New.
4756 (split_nonconstant_init_1): Use it.
4757 (split_nonconstant_init): Clear cleanup flags.
4759 2022-01-07 Jason Merrill <jason@redhat.com>
4762 * typeck2.c (PICFLAG_VEC_INIT): New.
4763 (process_init_constructor_array): Set it.
4764 (process_init_constructor): Handle it.
4765 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
4766 * init.c (build_vec_init): Likewise.
4767 * cp-gimplify.c (cp_gimplify_expr): Factor out...
4768 * tree.c (expand_vec_init_expr): ...this function.
4769 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
4770 (build_vec_init_expr): Likewise.
4771 * constexpr.c (cxx_eval_vec_init): Likewise.
4772 (reduced_constant_expression_p): Check arrays before C++20.
4773 * cp-tree.h (expand_vec_init_expr): Declare.
4775 2022-01-07 Jason Merrill <jason@redhat.com>
4777 * init.c (build_new_1): Remove preevaluation code.
4779 2022-01-05 Nathan Sidwell <nathan@acm.org>
4781 * pt.c (instantiate_class_template_1): Process attribute((used)) set
4784 2022-01-05 Nathan Sidwell <nathan@acm.org>
4786 * init.c (build_new_1): Check complain before alignment warning.
4788 2022-01-04 Jason Merrill <jason@redhat.com>
4790 * cp-tree.h (class releasing_vec): Add begin/end fns.
4792 2022-01-04 Jason Merrill <jason@redhat.com>
4794 * init.c: Include -*- C++ -*- on first line.
4796 2022-01-03 Marek Polacek <polacek@redhat.com>
4799 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
4802 2022-01-03 Marek Polacek <polacek@redhat.com>
4804 * parser.c (make_char_string_pack): Add a cast to const unsigned
4807 2022-01-03 Jakub Jelinek <jakub@redhat.com>
4810 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
4811 to DECL_TINFO_P VAR_DECLs.
4813 2022-01-02 Jason Merrill <jason@redhat.com>
4815 * init.c (build_vec_init): Append the decrement to elt_init.
4817 2022-01-02 Jason Merrill <jason@redhat.com>
4819 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
4822 Copyright (C) 2022 Free Software Foundation, Inc.
4824 Copying and distribution of this file, with or without modification,
4825 are permitted in any medium without royalty provided the copyright
4826 notice and this notice are preserved.