1 2022-12-29 Alexandre Oliva <oliva@adacore.com>
3 * constexpr.cc (cxx_eval_call_expression): Do not request an
4 INSERT that would not be completed.
6 2022-12-29 Alexandre Oliva <oliva@adacore.com>
8 * constraint.cc (normalize_concept_check): Use NO_INSERT for
11 2022-12-23 Patrick Palka <ppalka@redhat.com>
14 * constexpr.cc (maybe_constant_value): Clear
15 processing_template_decl before calling break_out_target_exprs.
16 * init.cc (get_nsdmi): Likewise.
17 * tree.cc (break_out_target_exprs): Assert processing_template_decl
20 2022-12-23 Patrick Palka <ppalka@redhat.com>
23 * constraint.cc (maybe_substitute_reqs_for): Substitute into
24 the template-head requirements of a template friend using only
25 its outer arguments via outer_template_args.
26 * cp-tree.h (outer_template_args): Declare.
27 * pt.cc (outer_template_args): Define, factored out and
29 (ctor_deduction_guides_for): ... here.
31 2022-12-23 Iain Sandoe <iain@sandoe.co.uk>
33 * g++spec.cc (lang_specific_driver): Preserve -static-libstdc++ in
34 the driver command line for targets without -Bstatic/dynamic support
35 in their static linker.
37 2022-12-21 Jakub Jelinek <jakub@redhat.com>
40 * pt.cc (tsubst_expr): Don't call cp_finish_decl on
41 DECL_OMP_PRIVATIZED_MEMBER vars.
43 2022-12-21 Jason Merrill <jason@redhat.com>
47 * coroutines.cc (transform_local_var_uses): Don't
48 specify a location for DECL_VALUE_EXPR.
49 * decl.cc (cp_finish_decomp): Likewise.
51 2022-12-20 Patrick Palka <ppalka@redhat.com>
54 * pt.cc (find_template_parameter_info::parm_list_tail):
56 (keep_template_parm): Use parm_list_tail to append rather
57 than prepend to parm_list.
59 2022-12-20 Iain Sandoe <iain@sandoe.co.uk>
61 * mangle.cc (write_mangled_name): Append the helper function
63 (write_encoding): ... rather than here.
65 2022-12-20 Patrick Palka <ppalka@redhat.com>
70 * pt.cc (tsubst_copy) <case VIEW_CONVERT_EXPR>: Move the
71 handling of C++20 template parameter object wrappers to ...
72 (tsubst_copy_and_build) <case VIEW_CONVERT_EXPR>: ... here.
73 Accept non-TEMPLATE_PARM_INDEX inner operand. Handle empty
74 TREE_TYPE on substituted inner operand. Remove same_type_p
75 assert. Also handle REF_PARENTHESIZED_P VIEW_CONVERT_EXPRs.
77 2022-12-19 Patrick Palka <ppalka@redhat.com>
80 * constexpr.cc (cxx_eval_builtin_function_call): Adjust calls
81 to fold_builtin_source_location.
82 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
84 (get_source_location_impl_type): Remove location_t parameter and
85 adjust accordingly. No longer static.
86 (fold_builtin_source_location): Take a CALL_EXPR tree instead of a
87 location and obtain the impl type from its return type.
88 * cp-tree.h (enum cp_tree_index): Remove CPTI_SOURCE_LOCATION_IMPL
90 (source_location_impl): Remove.
91 (fold_builtin_source_location): Adjust parameter type.
92 (get_source_location_impl_type): Declare.
93 * decl.cc (cxx_init_decl_processing): Declare
94 __builtin_source_location with auto return type instead of
96 (require_deduced_type): Update the return type of
97 __builtin_source_location.
99 2022-12-19 Patrick Palka <ppalka@redhat.com>
102 * pt.cc (extract_autos_r): Recompute TYPE_CANONICAL after
103 adjusting the template type parameter's index. Simplify
104 by using TEMPLATE_TYPE_IDX. Add some sanity checks.
106 2022-12-19 Arsen Arsenović <arsen@aarsen.me>
108 * contracts.cc: Rename references to
109 contract_violation_continuation_mode constants to be lowercase.
111 2022-12-17 Patrick Palka <ppalka@redhat.com>
115 * pt.cc (convert_nontype_argument): Relax is_nondep_const_expr
116 test to !inst_dep_expr_p.
118 2022-12-16 Andrew Pinski <pinskia@gmail.com>
119 Iain Sandoe <iain@sandoe.co.uk>
122 * coroutines.cc (coro_rewrite_function_body): Initialize pointers
123 from nullptr_node. (morph_fn_to_coro): Likewise.
125 2022-12-15 Patrick Palka <ppalka@redhat.com>
129 * error.cc (dump_decl) <case USING_DECL>: Look through a
130 pack expansion in the name as well.
131 * parser.cc (cp_parser_using_declaration): Handle a parameter
132 pack appearing in the terminal name of a variadic using-decl.
133 * pt.cc (tsubst_decl) <case USING_DECL>: Likewise. Combine the
134 handling of variadic and non-variadic using-decls.
136 2022-12-15 Jason Merrill <jason@redhat.com>
138 * init.cc (build_vec_init): Rename "flags" to "cleanup_flags"
139 to distinguish from LOOKUP_*.
141 2022-12-15 Arsen Arsenović <arsen@aarsen.me>
143 * mangle.cc (write_encoding): Move contract pre/post function
144 mangling from here...
145 (write_mangled_name): ... to here, and make it happen always.
147 2022-12-15 Patrick Palka <ppalka@redhat.com>
150 * parser.cc (cp_parser_using_declaration): Give up early if the
151 scope of an access-declaration isn't possibly a class type.
153 2022-12-15 Patrick Palka <ppalka@redhat.com>
157 * pt.cc (el_data::skip_unevaluated_operands): New data member.
158 (extract_locals_r): If skip_unevaluated_operands is true,
159 don't walk into unevaluated contexts.
160 (extract_local_specs): Walk the pattern twice, first with
161 skip_unevaluated_operands true followed by it set to false.
163 2022-12-15 Patrick Palka <ppalka@redhat.com>
166 * pt.cc (tsubst_aggr_type): Handle typedefs by delegating to
167 tsubst and adjusting the result if entering_scope. Split out
168 the main part of the function into ...
169 (tsubst_aggr_type_1) ... here.
170 (tsubst): Use tsubst_aggr_type_1 instead of tsubst_aggr_type.
171 Handle TYPE_PTRMEMFUNC_P RECORD_TYPEs here instead of in
174 2022-12-15 Patrick Palka <ppalka@redhat.com>
177 * pt.cc (unify) <default>: Relax assert to accept any
178 CONSTRUCTOR parm, not just COMPOUND_LITERAL_P one.
180 2022-12-15 Jakub Jelinek <jakub@redhat.com>
183 * typeck.cc (cp_build_unary_op) <case TRUTH_NOT_EXPR>: If
184 invert_truthvalue_loc returns obvalue_p, wrap it into NON_LVALUE_EXPR.
185 * parser.cc (cp_parser_binary_expression): Don't call
186 warn_logical_not_parentheses if current.lhs is a NON_LVALUE_EXPR
187 of a decl with boolean type.
189 2022-12-15 Jakub Jelinek <jakub@redhat.com>
192 * rtti.cc (emit_support_tinfos): Add pointers to
193 {bfloat16,float{16,32,64,128,32x,64x,128x}}_type_node to fundamentals
196 2022-12-15 Jason Merrill <jason@redhat.com>
200 * call.cc (struct conversion_obstack_sentinel): New.
201 (maybe_init_list_as_array): Compare conversion of dummy argument.
203 2022-12-12 Jason Merrill <jason@redhat.com>
206 2022-12-08 Jason Merrill <jason@redhat.com>
209 * call.cc (convert_like_internal) [ck_list]: Use
210 maybe_init_list_as_array.
211 * constexpr.cc (cxx_eval_vec_init_1): Init might have
213 * tree.cc (build_vec_init_elt): Likewise.
214 * init.cc (build_vec_init): Handle from_array from a
215 TARGET_EXPR. Retain TARGET_EXPR of a different type.
217 2022-12-08 Jason Merrill <jason@redhat.com>
220 * call.cc (convert_like_internal) [ck_list]: Use
221 maybe_init_list_as_array.
222 * constexpr.cc (cxx_eval_vec_init_1): Init might have
224 * tree.cc (build_vec_init_elt): Likewise.
225 * init.cc (build_vec_init): Handle from_array from a
226 TARGET_EXPR. Retain TARGET_EXPR of a different type.
228 2022-12-08 Jason Merrill <jason@redhat.com>
231 * call.cc (list_ctor_element_type): New.
232 (braced_init_element_type): New.
233 (has_non_trivial_temporaries): New.
234 (maybe_init_list_as_array): New.
235 (maybe_init_list_as_range): New.
236 (build_user_type_conversion_1): Use maybe_init_list_as_range.
237 * parser.cc (cp_parser_braced_list): Call
238 recompute_constructor_flags.
239 * cp-tree.h (find_temps_r): Declare.
241 2022-12-08 Jason Merrill <jason@redhat.com>
244 * cp-tree.h (is_std_allocator): Declare.
245 * constexpr.cc (is_std_allocator): Split out from...
246 (is_std_allocator_allocate): ...here.
247 * init.cc (find_temps_r): New.
248 (find_allocator_temp): New.
249 (build_vec_init): Use it.
251 2022-12-08 Jason Merrill <jason@redhat.com>
253 * constexpr.cc (maybe_constant_value): Add default arg comments.
255 2022-12-05 Scott Snyder <sss@li-snyder.org>
258 * Make-lang.in (CP_PLUGIN_HEADERS): Install contracts.h
260 2022-12-04 Patrick Palka <ppalka@redhat.com>
263 * pt.cc (for_each_template_parm_r) <case REQUIRES_EXPR>: Move
264 walking of the TREE_TYPE of each parameter to ...
265 * tree.cc (cp_walk_subtrees) <case REQUIRES_EXPR>: ... here.
267 2022-12-04 Iain Sandoe <iain@sandoe.co.uk>
268 Adrian Perl <adrian.perl@web.de>
274 * coroutines.cc (find_interesting_subtree): Do not promote temporaries
275 that are only used as direct initializers for some other object.
277 2022-12-03 Patrick Palka <ppalka@redhat.com>
280 * pt.cc (tsubst_copy) <case CONST_DECL>: Generalize
281 early exit test for namespace-scope decls to check dependence of
282 the enclosing scope instead. Remove dead early exit test.
284 2022-12-02 Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
285 Jason Merrill <jason@redhat.com>
287 * decl.cc (grokdeclarator): Build RESULT_DECL.
288 (start_preparsed_function): Copy location from template.
289 * semantics.cc (apply_deduced_return_type): Handle
290 arg != current_function_decl.
291 * method.cc (implicitly_declare_fn): Use it.
293 2022-12-02 Jason Merrill <jason@redhat.com>
295 * g++spec.cc (lang_specific_driver): Set SKIPOPT for nostdlib++.
297 2022-12-02 Jakub Jelinek <jakub@redhat.com>
300 * parser.cc (cp_convert_omp_range_for): After do_auto_deduction if
301 !processing_template_decl call cp_finish_decomp with
302 processing_template_decl temporarily incremented.
304 2022-12-02 Jakub Jelinek <jakub@redhat.com>
307 * parser.cc (do_range_for_auto_deduction): Add DECOMP_FIRST_NAME
308 and DECOMP_CNT arguments. Call cp_finish_decomp if DECL
309 is a structured binding.
310 (cp_parser_range_for): Adjust do_range_for_auto_deduction caller.
311 (cp_convert_omp_range_for): Likewise.
313 2022-12-02 Patrick Palka <ppalka@redhat.com>
316 * constraint.cc (norm_hasher::hash, norm_hasher::equal): Set
317 comparing_specializations.
318 (sat_hasher::hash, sat_hasher::equal): Likewise.
319 * cp-tree.h (atom_hasher::hash, atom_hasher::equal): Likewise.
320 * pt.cc (ctp_hasher::hash, ctp_hasher::equal): Likewise.
322 2022-12-01 Martin Liska <mliska@suse.cz>
324 * Make-lang.in: Remove extra object dependency.
326 2022-12-01 Jason Merrill <jason@redhat.com>
328 * contracts.cc (remove_contract_attributes): Actually prepend
330 * pt.cc (tsubst_contract): Only look for a postcondition if type is
333 2022-11-30 Patrick Palka <ppalka@redhat.com>
336 * typeck.cc (cp_build_binary_op): In the SPACESHIP_EXPR case,
337 handle an error_mark_node result type.
339 2022-11-29 Patrick Palka <ppalka@redhat.com>
342 * decl.cc (function_requirements_equivalent_p): Don't check
343 DECL_TEMPLATE_SPECIALIZATION.
344 * pt.cc (determine_specialization): Propagate constraints when
345 specializing a function template too. Simplify by using
346 add_outermost_template_args.
348 2022-11-28 Jason Merrill <jason@redhat.com>
351 * parser.cc (cp_parser_requirement): Parse tentatively for the
354 2022-11-28 Jason Merrill <jason@redhat.com>
356 * parser.cc (cp_parser_decl_specifier_seq): Change 'concept bool'
357 diagnostic from pedwarn to permerror.
359 2022-11-28 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
360 Yvan ROUX <yvan.roux@foss.st.com>
362 * module.cc: On Windows, 'A:Foo' is supposed to be a module
365 2022-11-22 Jason Merrill <jason@redhat.com>
368 * contracts.cc (role_name_equal): Use strcspn instead
371 2022-11-22 Jason Merrill <jason@redhat.com>
373 * contracts.cc (build_contract_condition_function):
374 Set DECL_ARTIFICIAL on return value parm.
375 * g++spec.cc (lang_specific_driver): Add -lstdc++exp
376 just before -lstdc++.
378 2022-11-20 Patrick Palka <ppalka@redhat.com>
380 * constraint.cc (struct norm_entry): Define.
381 (struct norm_hasher): Define.
382 (norm_cache): Define.
383 (normalize_concept_check): Add function comment. Cache the
384 the normal form of the substituted concept-id. Canonicalize
385 generic arguments as NULL_TREE. Don't coerce arguments unless
386 they were substituted.
387 (normalize_concept_definition): Simplify. Use norm_cache
388 instead of normalized_map.
390 2022-11-20 Patrick Palka <ppalka@redhat.com>
392 * pt.cc (coerce_template_parms): Salvage part of the function
393 comment from c_innermost_t_p. Handle parms being a full
394 template parameter list.
395 (coerce_innermost_template_parms): Remove.
396 (lookup_template_class): Use c_t_p instead of c_innermost_t_p.
397 (finish_template_variable): Likewise.
398 (tsubst_decl): Likewise.
399 (instantiate_alias_template): Likewise.
401 2022-11-19 Jakub Jelinek <jakub@redhat.com>
403 * constexpr.cc (cxx_eval_constant_expression): Implement C++23
404 P2647R1 - Permitting static constexpr variables in constexpr functions.
405 Allow DECL_EXPRs of decl_constant_var_p static or thread_local vars.
406 (potential_constant_expression_1): Similarly, except use
407 decl_maybe_constant_var_p instead of decl_constant_var_p if
408 processing_template_decl.
410 2022-11-19 Jeff Chapman II <jchapman@lock3software.com>
411 Andrew Sutton <asutton@lock3software.com>
412 Andrew Marmaduke <amarmaduke@lock3software.com>
413 Michael Lopez <mlopez@lock3software.com>
414 Jason Merrill <jason@redhat.com>
416 * cp-tree.h (enum cp_tree_index): Add
417 CPTI_PSEUDO_CONTRACT_VIOLATION.
418 (pseudo_contract_violation_type): New macro.
419 (struct saved_scope): Add x_processing_contract_condition.
420 (processing_contract_condition): New macro.
421 (comparing_override_contracts): New variable decl.
422 (find_contract): New inline.
423 (set_decl_contracts): New inline.
424 (get_contract_semantic): New inline.
425 (set_contract_semantic): New inline.
426 * constexpr.cc (cxx_eval_assert): Split out from...
427 (cxx_eval_internal_function): ...here.
428 (cxx_eval_constant_expression): Use it for contracts.
429 (potential_constant_expression_1): Handle contracts.
430 * cp-gimplify.cc (cp_genericize_r): Handle contracts.
431 * cp-objcp-common.cc (cp_tree_size): Handle contracts.
432 (cp_common_init_ts): Handle contracts.
433 (cp_handle_option): Handle contracts.
434 * decl.cc (duplicate_decls): Handle contracts.
435 (check_tag_decl): Check for bogus contracts.
436 (start_decl): Check flag_contracts.
437 (grokfndecl): Call rebuild_postconditions.
438 (grokdeclarator): Handle contract attributes.
439 (start_preparsed_function): Call start_function_contracts.
440 (finish_function): Call finish_function_contracts.
441 * decl2.cc (cp_check_const_attributes): Skip contracts.
442 (comdat_linkage): Handle outlined contracts.
443 * error.cc (dump_type): Handle null TYPE_IDENTIFIER.
444 * g++spec.cc (EXPERIMENTAL): New macro.
445 (lang_specific_driver): Add -lstdc++exp if -fcontracts.
446 * mangle.cc (write_encoding): Handle outlined contracts.
447 * module.cc (trees_out::fn_parms_init): Handle outlined contracts.
448 (trees_in::fn_parms_init): Likewise.
449 (check_mergeable_decl): Likewise.
450 (module_state_config::get_dialect): Record -fcontracts.
451 * parser.h (struct cp_unparsed_functions_entry): Add contracts.
452 * parser.cc (unparsed_contracts): New macro.
453 (push_unparsed_function_queues): Adjust.
454 (contract_attribute_p): New.
455 (cp_parser_statement): Check contracts.
456 (cp_parser_decl_specifier_seq): Handle contracts.
457 (cp_parser_skip_to_closing_square_bracket): Split out...
458 (cp_parser_skip_up_to_closing_square_bracket): ...this fn.
459 (cp_parser_class_specifier): Do contract late parsing.
460 (cp_parser_class_head): Check contracts.
461 (cp_parser_contract_role): New.
462 (cp_parser_contract_mode_opt): New.
463 (find_error, contains_error_p): New.
464 (cp_parser_contract_attribute_spec): New.
465 (cp_parser_late_contract_condition): New.
466 (cp_parser_std_attribute_spec): Handle contracts.
467 (cp_parser_save_default_args): Also save contracts.
468 * pt.cc (register_parameter_specializations): No longer static.
469 (register_local_identity): New.
470 (check_explicit_specialization): Call remove_contract_attributes.
471 (tsubst_contract, tsubst_contract_attribute): New.
472 (tsubst_contract_attributes): New.
473 (tsubst_attribute): Add comment.
474 (tsubst_copy): Also allow parm when processing_contract_condition.
475 (tsubst_expr): Handle contracts.
476 (regenerate_decl_from_template): Handle contracts.
477 * search.cc (check_final_overrider): Compare contracts.
478 * semantics.cc (set_cleanup_locs): Skip POSTCONDITION_STMT.
479 (finish_non_static_data_member): Check contracts.
480 (finish_this_expr): Check contracts.
481 (process_outer_var_ref): Handle contracts.
482 (finish_id_expression_1): Handle contracts.
483 (apply_deduced_return_type): Adjust contracts.
484 * tree.cc (handle_contract_attribute): New.
485 (get_innermost_component, is_this_expression): New.
486 (comparing_this_references): New.
487 (equivalent_member_references): New.
488 (cp_tree_equal): Check it.
489 * typeck.cc (check_return_expr): Apply contracts.
490 * Make-lang.in: Add contracts.o.
491 * config-lang.in: Add contracts.cc.
492 * cp-tree.def (ASSERTION_STMT, PRECONDITION_STMT)
493 (POSTCONDITION_STMT): New.
494 * contracts.h: New file.
495 * contracts.cc: New file.
497 2022-11-18 Jakub Jelinek <jakub@redhat.com>
499 * decl.cc (grokdeclarator): Implement
500 CWG2635 - Constrained structured bindings. Emit a pedwarn on
501 constrained auto type. Add auto_diagnostic_group for error_at
502 and inform for non-auto type on structured bindings declaration.
504 2022-11-18 Marek Polacek <polacek@redhat.com>
507 * decl.cc (grokdeclarator): Check funcdecl_p before complaining
510 2022-11-16 Marek Polacek <polacek@redhat.com>
513 * constexpr.cc (constexpr_error): New function.
514 (is_valid_constexpr_fn): Use constexpr_error.
515 (maybe_save_constexpr_fundef): Call
516 require_potential_rvalue_constant_expression_fncheck rather than
517 require_potential_rvalue_constant_expression. Register the
518 function if -Wno-invalid-constexpr was specified.
519 (explain_invalid_constexpr_fn): Don't return early if a function marked
520 'constexpr' that isn't actually a constant expression was called.
521 (non_const_var_error): Add a bool parameter. Use constexpr_error.
522 (inline_asm_in_constexpr_error): Likewise.
523 (cxx_eval_constant_expression): Adjust calls to non_const_var_error
524 and inline_asm_in_constexpr_error.
525 (potential_constant_expression_1): Add a bool parameter. Use
527 (require_potential_rvalue_constant_expression_fncheck): New function.
528 * cp-tree.h (require_potential_rvalue_constant_expression_fncheck):
530 * method.cc (struct comp_info): Call
531 require_potential_rvalue_constant_expression_fncheck rather than
532 require_potential_rvalue_constant_expression.
534 2022-11-16 Jakub Jelinek <jakub@redhat.com>
536 * typeck.cc (next_common_initial_sequence): Return false members have
537 different DECL_ALIGN.
538 (layout_compatible_type_p): Don't test TYPE_ALIGN of ENUMERAL_TYPE
541 2022-11-16 Jakub Jelinek <jakub@redhat.com>
544 * call.cc (keep_unused_object_arg): New function.
545 (build_op_call): Use it.
546 (build_op_subscript): Likewise.
547 (build_new_op): Similarly for ARRAY_REF.
548 (build_new_method_call): Use it.
549 * decl.cc (grok_op_properties): For C++20 and earlier, if operator[]
550 is static member function, require exactly one parameter rather than
551 exactly two parameters.
553 2022-11-16 Jakub Jelinek <jakub@redhat.com>
555 * typeck.cc (cp_build_modify_expr): Implement CWG 2654
556 - Un-deprecation of compound volatile assignments. Remove
557 -Wvolatile warning about compound volatile assignments.
559 2022-11-16 Jakub Jelinek <jakub@redhat.com>
561 * cp-tree.def (CONCEPT_DECL): Move to c-common.def.
562 * cp-objcp-common.cc (cp_common_init_ts): Don't handle CONCEPT_DECL
564 * cp-tree.h (finish_concept_definition): Add ATTRS parameter.
565 * parser.cc (cp_parser_concept_definition): Parse attributes in
566 between identifier and =. Adjust finish_concept_definition
568 * pt.cc (finish_concept_definition): Add ATTRS parameter. Call
569 cplus_decl_attributes.
570 * constraint.cc (build_standard_check): If CONCEPT_DECL is
571 TREE_DEPRECATED, emit -Wdeprecated-declaration warnings.
573 2022-11-15 Marek Polacek <polacek@redhat.com>
576 * decl.cc (grokdeclarator): Only emit a -Wignored-qualifiers warning
579 2022-11-15 Patrick Palka <ppalka@redhat.com>
581 * constexpr.cc (potential_constant_expression_1)
582 <case *_CAST_EXPR>: Use
583 cast_valid_in_integral_constant_expression_p instead of
585 * constraint.cc (tsubst_valid_expression_requirement): Adjust
586 calls to tsubst_copy_and_build and tsubst_expr.
587 (tsubst_constraint): Likewise.
588 (satisfy_atom): Likewise.
589 (diagnose_trait_expr): Likewise.
590 * cp-tree.h (tsubst_copy_and_build): Remove i_c_e_p parameter.
591 (tsubst_expr): Likewise.
592 * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build
594 * pt.cc (expand_integer_pack): Likewise.
595 (instantiate_non_dependent_expr_internal): Likewise.
596 (tsubst_friend_function): Likewise.
597 (tsubst_attribute): Likewise.
598 (instantiate_class_template): Likewise.
599 (tsubst_template_arg): Likewise.
600 (gen_elem_of_pack_expansion_instantiation): Likewise.
601 (tsubst_fold_expr_init): Likewise.
602 (tsubst_pack_expansion): Likewise.
603 (tsubst_default_argument): Likewise.
604 (tsubst_function_decl): Likewise.
605 (tsubst_decl): Likewise.
606 (tsubst_arg_types): Likewise.
607 (tsubst_exception_specification): Likewise.
609 (tsubst_init): Likewise.
610 (tsubst_copy): Likewise.
611 (tsubst_omp_clause_decl): Likewise.
612 (tsubst_omp_clauses): Likewise.
613 (tsubst_copy_asm_operands): Likewise.
614 (tsubst_omp_for_iterator): Likewise.
615 (tsubst_expr): Likewise. Remove i_c_e_p parameter.
616 (tsubst_omp_udr): Likewise.
617 (tsubst_non_call_postfix_expression): Likewise. Remove i_c_e_p parameter.
618 (tsubst_lambda_expr): Likewise.
619 (tsubst_copy_and_build_call_args): Likewise.
620 (tsubst_copy_and_build): Likewise. Remove i_c_e_p parameter.
621 <case IDENTIFIER_NODE>: Adjust call to finish_id_expression
622 following removal of i_c_e_p.
623 <case *_CAST_EXPR>: Remove C++98-specific cast validity check
625 (maybe_instantiate_noexcept): Adjust calls to
626 tsubst_copy_and_build and tsubst_expr.
627 (instantiate_body): Likewise.
628 (instantiate_decl): Likewise.
629 (tsubst_initializer_list): Likewise.
630 (tsubst_enum): Likewise.
632 2022-11-15 Patrick Palka <ppalka@redhat.com>
634 * cp-lang.cc (objcp_tsubst_copy_and_build): Remove
635 function_p parameter.
636 * cp-objcp-common.h (objcp_tsubst_copy_and_build):
638 * cp-tree.h (tsubst_copy_and_build): Likewise.
639 * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build.
640 * pt.cc (expand_integer_pack): Likewise.
641 (instantiate_non_dependent_expr_internal): Likewise.
642 (tsubst_function_decl): Likewise.
643 (tsubst_arg_types): Likewise.
644 (tsubst_exception_specification): Likewise.
646 (tsubst_copy_asm_operands): Likewise.
647 (tsubst_expr): Likewise.
648 (tsubst_non_call_postfix_expression): Likewise.
649 (tsubst_lambda_expr): Likewise.
650 (tsubst_copy_and_build_call_args): Likewise.
651 (tsubst_copy_and_build): Remove function_p parameter
652 and adjust function comment. Adjust recursive calls.
653 <case CALL_EXPR>: Update outdated comment about when
654 we can see an IDENTIFIER_NODE callee with koenig_p=false.
655 (maybe_instantiate_noexcept): Adjust calls to
656 tsubst_copy_and_build.
658 2022-11-15 Jakub Jelinek <jakub@redhat.com>
660 * cp-tree.h (next_common_initial_seqence): Rename to ...
661 (next_common_initial_sequence): ... this.
662 * typeck.cc (next_common_initial_seqence): Rename to ...
663 (next_common_initial_sequence): ... this.
664 (layout_compatible_type_p): Call next_common_initial_sequence
665 rather than next_common_initial_seqence.
666 * semantics.cc (is_corresponding_member_aggr): Likewise.
668 2022-11-15 Jakub Jelinek <jakub@redhat.com>
670 * decl.cc (grok_op_properties): Implement C++23 P2589R1
671 - static operator[]. Handle operator[] similarly to operator()
672 - allow static member functions, but pedwarn on it for C++20 and
673 older. Unlike operator(), perform rest of checks on it though for
675 * call.cc (add_operator_candidates): For operator[] with class
676 typed first parameter, pass that parameter as first_arg and
677 an adjusted arglist without that parameter.
679 2022-11-15 Patrick Palka <ppalka@redhat.com>
682 * tree.cc (cxx_attribute_table): Don't conditionally exclude
683 the init_priority entry.
684 (handle_init_priority_attribute): Remove ATTRIBUTE_UNUSED.
685 Return error_mark_node if !SUPPORTS_INIT_PRIORITY.
687 2022-11-15 Marek Polacek <polacek@redhat.com>
689 * call.cc (maybe_warn_dangling_reference): Don't warn when initializing
690 a non-const lvalue reference.
692 2022-11-14 Jason Merrill <jason@redhat.com>
694 * pt.cc (tsubst_friend_function): Check satisfaction.
696 2022-11-14 Martin Liska <mliska@suse.cz>
699 2022-11-14 Martin Liska <mliska@suse.cz>
701 * Make-lang.in: Support Sphinx based documentation.
703 2022-11-14 Martin Liska <mliska@suse.cz>
706 2022-11-14 Martin Liska <mliska@suse.cz>
709 Support installation if sphinx-build is missing.
711 2022-11-10 Marek Polacek <polacek@redhat.com>
713 * call.cc (std_pair_ref_ref_p): New.
714 (do_warn_dangling_reference): Also warn when the function returns
715 std::pair<const T&, const T&>. Recurse into TARGET_EXPR_INITIAL.
716 (maybe_warn_dangling_reference): Don't return early if we're
717 initializing a std_pair_ref_ref_p.
719 2022-11-09 Jakub Jelinek <jakub@redhat.com>
721 * tree.cc (handle_carries_dependency_attribute): New function.
722 (std_attribute_table): Add carries_dependency attribute.
723 * parser.cc (cp_parser_check_std_attribute): Add carries_dependency
726 2022-11-09 Martin Liska <mliska@suse.cz>
729 Support installation if sphinx-build is missing.
731 2022-11-09 Martin Liska <mliska@suse.cz>
733 * Make-lang.in: Support Sphinx based documentation.
735 2022-11-09 Marek Polacek <polacek@redhat.com>
738 * semantics.cc (finish_call_expr): Suppress OPT_Wpessimizing_move.
739 * typeck.cc (maybe_warn_pessimizing_move): Check warn_redundant_move
740 and warning_suppressed_p. Adjust a message depending on return_p.
741 (check_return_expr): Don't suppress OPT_Wpessimizing_move here.
743 2022-11-08 Jason Merrill <jason@redhat.com>
744 Jakub Jelinek <jakub@redhat.com>
746 * cp-tree.h (fns_correspond): Declare.
747 * decl.cc (fns_correspond): New.
748 * call.cc (add_candidates): Look for op!= matching op==.
749 (joust): Complain about non-standard reversed tiebreaker.
750 (tourney): Fix champ_compared_to_predecessor logic.
751 (build_new_op): Don't complain about error_mark_node not having
753 * pt.cc (tsubst_copy_and_build): Don't try to be permissive
756 2022-11-06 Patrick Palka <ppalka@redhat.com>
758 * tree.cc (cxx_attribute_table): Include init_priority entry
759 only if SUPPORTS_INIT_PRIORITY.
760 (handle_init_priority_attribute): Add ATTRIBUTE_UNUSED. Assert
761 SUPPORTS_INIT_PRIORITY is true.
763 2022-11-04 Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
764 Yvan ROUX <yvan.roux@foss.st.com>
766 * mapper-client.cc: Use in-process client when networking is
769 2022-11-03 Marek Polacek <polacek@redhat.com>
772 * call.cc (do_warn_dangling_reference): Quash -Wdangling-reference
773 for member operator*.
775 2022-11-03 Patrick Palka <ppalka@redhat.com>
778 * constraint.cc (tsubst_requires_expr): Make sure we're not
779 deferring access checks.
781 2022-11-03 Jason Merrill <jason@redhat.com>
783 * parser.cc (cp_parser_template_declaration_after_parameters): Fix
784 concept parsing below C++20.
786 2022-11-03 Patrick Palka <ppalka@redhat.com>
789 * decl2.cc (mark_used): Don't defer synthesis of virtual
792 2022-11-01 Nathan Sidwell <nathan@acm.org>
794 * cp-tree.h (LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR): New.
795 (struct tree_lambda_expr): Add discriminator_sig bitfield.
796 (recrd_lambda_scope_sig_discriminator): Declare.
797 * lambda.cc (struct lambda_sig_count): New.
798 (lambda_discriminator): Add signature vector.
799 (start_lambda_scope): Adjust.
800 (compare_lambda_template_head, compare_lambda_sig): New.
801 (record_lambda_scope_sig_discriminator): New.
802 * mangle.cc (write_closure_type): Use the scope-sig discriminator for
803 ABI >= 18. Emit abi mangling warning if needed.
804 * module.cc (trees_out::core_vals): Stream the new discriminator.
805 (trees_in::core_vals): Likewise.
806 * parser.cc (cp_parser_lambda_declarator_opt): Call
807 record_lambda_scope_sig_discriminator.
808 * pt.cc (tsubst_lambda_expr): Likewise.
810 2022-11-01 Nathan Sidwell <nathan@acm.org>
812 * cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
813 (LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
814 (struct tree_lambda_expr): Make default_capture_mode &
815 discriminator_scope bitfields.
816 (record_null_lambda_scope) Delete.
817 (record_lambda_scope_discriminator): Declare.
818 * lambda.cc (struct lambda_discriminator): New struct.
819 (lambda_scope, lambda_scope_stack): Adjust types.
820 (lambda_count): Delete.
821 (struct tree_int): Delete.
822 (start_lambda_scope, finish_lambda_scope): Adjust.
823 (record_lambda_scope): Only record the scope.
824 (record_lambda_scope_discriminator): New.
825 * mangle.cc (write_closure_type_name): Adjust.
826 * module.cc (trees_out::core_vals): Likewise,
827 (trees_in::core_vals): Likewise.
828 * parser.cc (cp_parser_lambda_expression): Call
829 record_lambda_scope_discriminator.
830 * pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling. Call
831 record_lambda_scope_discriminator. Commonize control flow on tsubsting
832 the operator function.
834 2022-11-01 Jason Merrill <jason@redhat.com>
836 * parser.cc (make_call_declarator): Add std_attrs parm.
837 (cp_parser_lambda_declarator_opt): Pass it.
838 (cp_parser_direct_declarator): Pass it.
840 2022-11-01 Jason Merrill <jason@redhat.com>
842 * decl.cc (finish_function): Set TREE_NOTHROW later in the function.
844 2022-11-01 Jason Merrill <jason@redhat.com>
846 * decl.cc (duplicate_decls): Reformat loop.
847 * parser.cc (cp_parser_member_declaration): Add newline.
848 * semantics.cc: Remove newline.
850 2022-10-28 Marek Polacek <polacek@redhat.com>
852 * call.cc (maybe_warn_dangling_reference): Enable the warning in
853 system headers if the decl isn't in a system header.
855 2022-10-28 Jason Merrill <jason@redhat.com>
857 * decl.cc (grokdeclarator): Call decl_attributes before do_friend.
859 2022-10-28 Jakub Jelinek <jakub@redhat.com>
861 * parser.cc (cp_parser_omp_all_clauses): Allow optional comma
862 before the first clause even in pragma syntax.
863 (cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj,
864 cp_parser_omp_flush, cp_parser_omp_scan_loop_body,
865 cp_parser_omp_ordered, cp_parser_omp_assumption_clauses,
866 cp_finish_omp_declare_variant, cp_parser_omp_declare_target,
867 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires,
868 cp_parser_omp_error): Likewise.
870 2022-10-28 Joseph Myers <joseph@codesourcery.com>
873 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P, ENUM_UNDERLYING_TYPE):
874 Remove. Moved to c-common.h.
876 2022-10-27 Jakub Jelinek <jakub@redhat.com>
879 * name-lookup.cc (push_namespace): Call find_namespace_slot again
880 after pushdecl as the hash table might be expanded during pushdecl.
882 2022-10-27 Nathan Sidwell <nathan@acm.org>
884 * mangle.cc (write_closure_template_head): New.
885 (write_closure_type_name): Call it.
887 2022-10-27 Jakub Jelinek <jakub@redhat.com>
891 * typeck.cc (cp_build_binary_op): Don't compute semantic_result_type
892 if result_type is NULL.
894 2022-10-26 Marek Polacek <polacek@redhat.com>
897 * call.cc (expr_represents_temporary_p): New, factored out of...
898 (conv_binds_ref_to_temporary): ...here. Don't return false just
899 because a ck_base is missing. Use expr_represents_temporary_p.
900 (do_warn_dangling_reference): New.
901 (maybe_warn_dangling_reference): New.
902 (extend_ref_init_temps): Call maybe_warn_dangling_reference.
903 * cp-tree.h: Adjust comment.
904 * typeck.cc (check_return_expr): Suppress -Wdangling-reference
907 2022-10-25 Nathan Sidwell <nathan@acm.org>
909 * parser.cc (synthesize_implicit_template_parm): Fix thinko about
910 mark the new parm DECL_VIRTUAL_P. Avoid unneccessary tree_last call.
912 2022-10-25 Patrick Palka <ppalka@redhat.com>
914 * constraint.cc (resolve_function_concept_overload): Explicitly
915 pass complain=tf_none to coerce_template_parms.
916 (resolve_concept_check): Likewise.
917 (normalize_concept_check): Likewise.
918 * cp-tree.h (coerce_template_parms): Declare the main overload
919 and default its last parameter to true. Remove wrapper overloads.
920 * pt.cc (determine_specialization): Adjust calls to
921 coerce_template_parms and coerce_innermost_template_parms after
922 removing their last parameter.
923 (coerce_template_args_for_ttp): Likewise.
924 (coerce_ttp_args_for_tta): Likewise.
925 (coerce_template_template_parms): Likewise.
926 (coerce_template_parms): Remove use_default_args parameter and
927 adjust function comment. Document default argument. Remove
928 wrapper overloads. No longer static.
929 (coerce_innermost_template_parms): Remove use_default_args
930 parameter. Default require_all_args to true.
931 (lookup_template_class): As with determine_specialization.
932 (finish_template_variable): Likewise.
933 (tsubst_decl): Likewise.
934 (instantiate_alias_template): Likewise.
935 (fn_type_unification): Likewise.
936 (resolve_overloaded_unification): Likewise.
937 (resolve_nondeduced_context): Likewise.
938 (get_partial_spec_bindings): Likewise.
940 2022-10-25 Jason Merrill <jason@redhat.com>
942 * constexpr.cc (find_failing_clause_r): Re-add the call to
943 contextual_conv_bool.
945 2022-10-25 Patrick Palka <ppalka@redhat.com>
949 * module.cc (trees_out::core_vals): Stream TYPE_MAX_VALUE and
950 TYPE_MIN_VALUE of ENUMERAL_TYPE.
951 (trees_in::core_vals): Likewise.
952 (trees_out::write_enum_def): Don't stream them here.
953 (trees_in::read_enum_def): Likewise.
955 2022-10-25 Jason Merrill <jason@redhat.com>
957 * constexpr.cc (class constexpr_global_ctx): Add modifiable field,
958 get_value, get_value_ptr, put_value, remove_value, flush_modifiable
960 (class modifiable_tracker): New.
961 (cxx_eval_internal_function): Use it.
962 (diagnose_failing_condition): Strip CLEANUP_POINT_EXPR.
964 2022-10-25 Jason Merrill <jason@redhat.com>
966 * constexpr.cc (fold_operand): New function.
967 (find_failing_clause_r): Add const.
968 (find_failing_clause): Add const.
969 (diagnose_failing_condition): Add ctx parameter.
970 (cxx_eval_internal_function): Pass it.
971 * semantics.cc (diagnose_failing_condition): Move to constexpr.cc.
974 2022-10-24 Jason Merrill <jason@redhat.com>
976 * cp-gimplify.cc (fold_builtin_source_location)
977 * vtable-class-hierarchy.cc (register_all_pairs): Simplify calls to
978 build_string_literal.
979 (build_string_from_id): Remove.
981 2022-10-24 Marek Polacek <polacek@redhat.com>
984 * typeck.cc (treat_lvalue_as_rvalue_p): Check the return value of move.
986 2022-10-24 Jakub Jelinek <jakub@redhat.com>
989 * typeck.cc (cp_build_binary_op): Pass operands before excess precision
990 promotions to scalar_to_vector call.
992 2022-10-24 Jakub Jelinek <jakub@redhat.com>
995 * constexpr.cc (cxx_eval_increment_expression): For signed types
996 that promote to int, evaluate PLUS_EXPR or MINUS_EXPR in int type.
998 2022-10-24 Arsen Arsenović <arsen@aarsen.me>
1000 * cp-tree.h (DECL_MAIN_P): Move most logic, besides the hosted
1002 (DECL_MAIN_ANY_P): ... to here, so that it can be reused ...
1003 (DECL_MAIN_FREESTANDING_P): ... here, with an additional
1004 constraint on (hosted OR return type == int)
1005 * decl.cc (finish_function): Use DECL_MAIN_FREESTANDING_P
1006 instead of DECL_MAIN_P, to loosen the hosted requirement, but
1007 check noreturn, before adding implicit returns.
1009 2022-10-21 Jakub Jelinek <jakub@redhat.com>
1012 * constexpr.cc (reduced_constant_expression_p) <case CONSTRUCTOR>:
1013 Return false for VECTOR_TYPE CONSTRUCTORs even without
1014 CONSTRUCTOR_NO_CLEARING set on them.
1015 (cxx_eval_bare_aggregate): If constant but !changed, fold before
1016 returning VECTOR_TYPE_P CONSTRUCTOR.
1017 (cxx_eval_constant_expression) <case CONSTRUCTOR>: Don't fold
1018 TREE_CONSTANT CONSTRUCTOR, just return it.
1020 2022-10-21 Jakub Jelinek <jakub@redhat.com>
1023 * semantics.cc (finish_compound_literal): For void{}, if
1024 processing_template_decl return a COMPOUND_LITERAL_P
1025 CONSTRUCTOR rather than void_node.
1027 2022-10-20 Patrick Palka <ppalka@redhat.com>
1029 * pt.cc (lookup_and_finish_template_variable): Don't
1030 instantiate if the template's scope is dependent.
1031 (tsubst_copy) <case TEMPLATE_DECL>: Pass entering_scope=true
1032 when substituting the class scope.
1034 2022-10-20 Patrick Palka <ppalka@redhat.com>
1037 * module.cc (node_template_info): Handle CONCEPT_DECL.
1039 2022-10-20 Jonathan Wakely <jwakely@redhat.com>
1040 Ulrich Drepper <drepper@redhat.com>
1042 * Make-lang.in: Add rules to generate std-name-hint.gperf. Adjust
1043 rule to generate std-name-hint.h to allow chain rule.
1044 * std-name-hint.h: Regenerated.
1045 * std-name-hint.gperf: This file is now generated.
1046 * cxxapi-data.csv: New file. CSV file with C++ API data.
1047 * gen-cxxapi-file.py: New file. Generate std-name-hint.gperf
1048 and module export source (in future).
1050 2022-10-19 Marek Polacek <polacek@redhat.com>
1053 * typeck.cc (maybe_warn_about_useless_cast): Don't warn when
1054 a glvalue is cast to a non-reference type.
1056 2022-10-18 Patrick Palka <ppalka@redhat.com>
1059 * module.cc (trees_out::tpl_parms_fini): Don't assume default
1060 template arguments must be trailing.
1061 (trees_in::tpl_parms_fini): Likewise.
1063 2022-10-18 Jakub Jelinek <jakub@redhat.com>
1066 * cp-tree.h (build_assume_call): Declare.
1067 * parser.cc (cp_parser_omp_assumption_clauses): Use build_assume_call.
1068 * cp-gimplify.cc (build_assume_call): New function.
1069 (process_stmt_assume_attribute): Use build_assume_call.
1070 * pt.cc (tsubst_copy_and_build): Likewise.
1072 2022-10-17 Patrick Palka <ppalka@redhat.com>
1075 * module.cc (trees_out::write_function_def): Stream the
1076 parms and result of the constexpr_fundef entry.
1077 (trees_in::read_function_def): Likewise.
1079 2022-10-14 Patrick Palka <ppalka@redhat.com>
1082 * constexpr.cc (cxx_dynamic_cast_fn_p): Check for abi_node
1083 instead of global_namespace.
1084 * rtti.cc (build_dynamic_cast_1): Set DECL_CONTEXT and
1085 DECL_SOURCE_LOCATION when building dynamic_cast_node. Push
1086 it into the namespace.
1088 2022-10-14 Jakub Jelinek <jakub@redhat.com>
1090 * cp-tree.h (extended_float_type_p): Return true for
1092 * typeck.cc (cp_compare_floating_point_conversion_ranks): Set
1093 extended{1,2} if mv{1,2} is bfloat16_type_node. Adjust comment.
1095 2022-10-14 Jakub Jelinek <jakub@redhat.com>
1100 * cp-tree.h (cp_ep_convert_and_check): Remove.
1101 * cvt.cc (cp_ep_convert_and_check): Remove.
1102 * call.cc (build_conditional_expr): Use excess precision for ?: with
1103 one arm floating and another integral. Don't convert first to
1104 semantic result type from integral types.
1105 (convert_like_internal): Don't call cp_ep_convert_and_check, instead
1106 just strip EXCESS_PRECISION_EXPR before calling cp_convert_and_check
1108 * typeck.cc (cp_build_binary_op): Set may_need_excess_precision
1109 for comparisons or SPACESHIP_EXPR with at least one operand integral.
1110 Don't compute semantic_result_type if build_type is non-NULL. Call
1111 cp_convert_and_check instead of cp_ep_convert_and_check.
1113 2022-10-14 Jakub Jelinek <jakub@redhat.com>
1117 * parser.cc (cp_parser_primary_expression): Handle
1118 EXCESS_PRECISION_EXPR with REAL_CST operand the same as REAL_CST.
1119 * cvt.cc (cp_ep_convert_and_check): New function.
1120 * call.cc (build_conditional_expr): Add excess precision support.
1121 When type_after_usual_arithmetic_conversions returns error_mark_node,
1122 use gcc_checking_assert that it is because of uncomparable floating
1123 point ranks instead of checking all those conditions and make it
1124 work also with complex types.
1125 (convert_like_internal): Likewise. Add NESTED_P argument, pass true
1126 to recursive calls to convert_like.
1127 (convert_like): Add NESTED_P argument, pass it through to
1128 convert_like_internal. For other overload pass false to it.
1129 (convert_like_with_context): Pass false to NESTED_P.
1130 (convert_arg_to_ellipsis): Add excess precision support.
1131 (magic_varargs_p): For __builtin_is{finite,inf,inf_sign,nan,normal}
1132 and __builtin_fpclassify return 2 instead of 1, document what it
1134 (build_over_call): Don't handle former magic 2 which is no longer
1135 used, instead for magic 1 remove EXCESS_PRECISION_EXPR.
1136 (perform_direct_initialization_if_possible): Pass false to NESTED_P
1137 convert_like argument.
1138 * constexpr.cc (cxx_eval_constant_expression): Handle
1139 EXCESS_PRECISION_EXPR.
1140 (potential_constant_expression_1): Likewise.
1141 * pt.cc (tsubst_copy, tsubst_copy_and_build): Likewise.
1142 * cp-tree.h (cp_ep_convert_and_check): Declare.
1143 * cp-gimplify.cc (cp_fold): Handle EXCESS_PRECISION_EXPR.
1144 * typeck.cc (cp_common_type): For COMPLEX_TYPEs, return error_mark_node
1145 if recursive call returned it.
1146 (convert_arguments): For magic 1 remove EXCESS_PRECISION_EXPR.
1147 (cp_build_binary_op): Add excess precision support. When
1148 cp_common_type returns error_mark_node, use gcc_checking_assert that
1149 it is because of uncomparable floating point ranks instead of checking
1150 all those conditions and make it work also with complex types.
1151 (cp_build_unary_op): Likewise.
1152 (cp_build_compound_expr): Likewise.
1153 (build_static_cast_1): Remove EXCESS_PRECISION_EXPR.
1155 2022-10-13 Jason Merrill <jason@redhat.com>
1157 * cp-tree.h: Fix whitespace.
1158 * parser.h: Fix whitespace.
1159 * decl.cc: Fix whitespace.
1160 * parser.cc: Fix whitespace.
1161 * pt.cc: Fix whitespace.
1163 2022-10-13 Martin Liska <mliska@suse.cz>
1165 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Emit
1166 an artificial variable that would be put into .preinit_array
1169 2022-10-13 Marek Polacek <polacek@redhat.com>
1172 * except.cc (maybe_splice_retval_cleanup): Check current_function_decl.
1173 Make the bool const.
1175 2022-10-12 Marek Polacek <polacek@redhat.com>
1177 * call.cc (standard_conversion): Remove LOOKUP_PREFER_RVALUE code.
1178 (reference_binding): Honor clk_implicit_rval even pre-C++20.
1179 (implicit_conversion_1): Remove LOOKUP_PREFER_RVALUE code.
1180 (build_user_type_conversion_1): Likewise.
1181 (convert_like_internal): Likewise.
1182 (build_over_call): Likewise.
1183 * cp-tree.h (LOOKUP_PREFER_RVALUE): Remove.
1184 (LOOKUP_NO_NARROWING): Adjust definition.
1185 * except.cc (build_throw): Don't perform two overload resolutions.
1186 * typeck.cc (maybe_warn_pessimizing_move): Don't use
1187 LOOKUP_PREFER_RVALUE.
1188 (check_return_expr): Don't perform two overload resolutions.
1190 2022-10-12 Jason Merrill <jason@redhat.com>
1193 * cp-tree.h (source_location_current_p): Remove.
1194 * name-lookup.h (struct cp_binding_level): Remove
1196 * call.cc (in_immediate_context): All default args
1197 and DMI are potentially immediate context.
1198 (immediate_invocation_p): Don't treat source_location specially.
1199 (struct in_consteval_if_p_temp_override): Move to cp-tree.h.
1200 * constexpr.cc (get_nth_callarg): Move to cp-tree.h.
1201 * cp-gimplify.cc (cp_fold_r): Don't fold consteval.
1202 * name-lookup.cc (begin_scope): Don't set immediate_fn_ctx_p.
1203 * parser.cc (cp_parser_lambda_declarator_opt): Likewise.
1204 (cp_parser_direct_declarator): Likewise.
1205 * pt.cc (tsubst_default_argument): Open sk_function_parms level.
1206 * tree.cc (source_location_current_p): Remove.
1207 (bot_replace): Fold consteval here.
1208 (break_out_target_exprs): Handle errors.
1210 2022-10-11 Patrick Palka <ppalka@redhat.com>
1213 * pt.cc (tsubst_friend_function): Propagate DECL_MODULE_PURVIEW_P
1214 from the introduced namespace-scope function to the namespace.
1216 2022-10-11 Patrick Palka <ppalka@redhat.com>
1219 * module.cc (lazy_load_binding): Clear processing_template_decl.
1220 (lazy_load_pendings): Likewise.
1222 2022-10-10 Nathan Sidwell <nathan@acm.org>
1224 * mangle.cc (write_prefix): Add VAR_DECL & FIELD_DECL to
1225 substitution table under abi=18. Note possible mismatch.
1227 2022-10-10 Marek Polacek <polacek@redhat.com>
1230 * error.cc: Include "attribs.h".
1231 (dump_type_prefix): Print only GNU attributes here.
1232 (dump_type_suffix): Print standard attributes here.
1234 2022-10-08 Jason Merrill <jason@redhat.com>
1236 * cp-tree.h (TARGET_EXPR_ELIDING_P): New.
1237 (unsafe_copy_elision_p, set_target_expr_eliding)
1238 (cp_build_init_expr): Declare.
1239 * call.cc (unsafe_copy_elision_p): No longer static.
1240 (build_over_call, build_special_member_call)
1241 (build_new_method_call): Use cp_build_init_expr.
1242 * coroutines.cc (expand_one_await_expression)
1243 (build_actor_fn, flatten_await_stmt, handle_nested_conditionals)
1244 (await_statement_walker, morph_fn_to_coro): Use cp_build_init_expr.
1245 * cp-gimplify.cc (cp_gimplify_init_expr)
1246 (cp_gimplify_expr): Check TARGET_EXPR_ELIDING_P.
1247 (cp_fold_r): Propagate it.
1248 (cp_fold): Use cp_build_init_expr.
1249 * decl.cc (check_initializer): Use cp_build_init_expr.
1250 * except.cc (build_throw): Use cp_build_init_expr.
1251 * init.cc (get_nsdmi): Call set_target_expr_eliding.
1252 (perform_member_init, expand_default_init, expand_aggr_init_1)
1253 (build_new_1, build_vec_init): Use cp_build_init_expr.
1254 * method.cc (do_build_copy_constructor): Use cp_build_init_expr.
1255 * semantics.cc (simplify_aggr_init_expr, finalize_nrv_r)
1256 (finish_omp_reduction_clause): Use cp_build_init_expr.
1257 * tree.cc (build_target_expr): Call set_target_expr_eliding.
1258 (bot_manip): Copy TARGET_EXPR_ELIDING_P.
1259 * typeck.cc (cp_build_modify_expr): Call set_target_expr_eliding.
1260 (check_return_expr): Use cp_build_modify_expr.
1261 * typeck2.cc (split_nonconstant_init_1)
1262 (split_nonconstant_init): Use cp_build_init_expr.
1263 (massage_init_elt): Call set_target_expr_eliding.
1264 (process_init_constructor_record): Clear TARGET_EXPR_ELIDING_P on
1265 unsafe copy elision.
1266 (set_target_expr_eliding, cp_build_init_expr): New.
1268 2022-10-07 Marek Polacek <polacek@redhat.com>
1271 * call.cc (conv_binds_ref_to_temporary): New.
1272 (ref_conv_binds_directly): Rename to...
1273 (ref_conv_binds_to_temporary): ...this. Use
1274 conv_binds_ref_to_temporary.
1275 * cp-tree.h (ref_conv_binds_directly): Rename to...
1276 (ref_conv_binds_to_temporary): ...this.
1277 * method.cc (ref_xes_from_temporary): Use ref_conv_binds_to_temporary.
1278 * parser.cc (warn_for_range_copy): Likewise.
1280 2022-10-07 Qing Zhao <qing.zhao@oracle.com>
1282 * module.cc (trees_out::core_bools): Stream out new bit
1284 (trees_in::core_bools): Stream in new bit decl_not_flexarray.
1286 2022-10-07 Patrick Palka <ppalka@redhat.com>
1288 * module.cc (trees_out::mark_class_def): Guard against
1289 DECL_BIT_FIELD_REPRESENTATIVE not being a decl.
1291 2022-10-07 Jason Merrill <jason@redhat.com>
1293 * init.cc (expand_default_init): Also push the INIT_EXPR inside a
1296 2022-10-07 Patrick Palka <ppalka@redhat.com>
1299 * module.cc (trees_out::core_bools): Don't override
1300 DECL_EXTERNAL to true for static variables from an inline
1303 2022-10-07 Martin Liska <mliska@suse.cz>
1305 * module.cc (enum module_state_counts): Use array size.
1306 * name-lookup.cc (class namespace_limit_reached): Likewise.
1307 (class module_state): Move up in the file.
1309 2022-10-07 Jakub Jelinek <jakub@redhat.com>
1311 * parser.cc (cp_parser_check_std_attribute): Only do checks if
1312 attribute is a standard attribute or in gnu namespace and only
1313 lookup other attributes in those namespaces.
1314 * cp-gimplify.cc (lookup_hotness_attribute): Adjust function comment.
1315 Only return true for standard attribute or gnu namespace attribute.
1316 (remove_hotness_attribute): Only remove hotness attributes when
1317 they are standard or in gnu namespace, implement it in a single
1318 loop rather than former 4 now 8 remove_attribute calls.
1320 2022-10-06 Jason Merrill <jason@redhat.com>
1322 * coroutines.cc (expand_one_await_expression): Change conversion
1323 to VIEW_CONVERT_EXPR.
1324 * cp-gimplify.cc (cp_genericize_r) [CONVERT_EXPR]: Add assert.
1326 2022-10-06 Joseph Myers <joseph@codesourcery.com>
1328 * lex.cc (init_reswords): Handle D_EXT11.
1330 2022-10-06 Patrick Palka <ppalka@redhat.com>
1332 * pt.cc (optimize_specialization_lookup_p): Remove.
1333 (retrieve_specialization): Assume the above returns false
1334 and simplify accordingly.
1335 (register_specialization): Likewise.
1337 2022-10-06 Jakub Jelinek <jakub@redhat.com>
1339 * parser.cc (cp_parser_omp_assumption_clauses): Emit IFN_ASSUME
1340 call for holds clause on assume construct.
1342 2022-10-06 Jakub Jelinek <jakub@redhat.com>
1345 * cp-tree.h (process_stmt_assume_attribute): Implement C++23
1346 P1774R8 - Portable assumptions. Declare.
1347 (diagnose_failing_condition): Declare.
1348 (find_failing_clause): Likewise.
1349 * parser.cc (assume_attr): New enumerator.
1350 (cp_parser_parenthesized_expression_list): Handle assume_attr.
1351 Remove identifier variable, for id_attr push the identifier into
1352 expression_list right away instead of inserting it before all the
1354 (cp_parser_conditional_expression): New function.
1355 (cp_parser_constant_expression): Use it.
1356 (cp_parser_statement): Handle assume attribute.
1357 (cp_parser_expression_statement): Likewise.
1358 (cp_parser_gnu_attribute_list): Use assume_attr for assume
1360 (cp_parser_std_attribute): Likewise. Handle standard assume
1361 attribute like gnu::assume.
1362 * cp-gimplify.cc (process_stmt_assume_attribute): New function.
1363 * constexpr.cc: Include fold-const.h.
1364 (find_failing_clause_r, find_failing_clause): New functions,
1365 moved from semantics.cc with ctx argument added and if non-NULL,
1366 call cxx_eval_constant_expression rather than fold_non_dependent_expr.
1367 (cxx_eval_internal_function): Handle IFN_ASSUME.
1368 (potential_constant_expression_1): Likewise.
1369 * pt.cc (tsubst_copy_and_build): Likewise.
1370 * semantics.cc (diagnose_failing_condition): New function.
1371 (find_failing_clause_r, find_failing_clause): Moved to constexpr.cc.
1372 (finish_static_assert): Use it. Add auto_diagnostic_group.
1374 2022-10-05 Jason Merrill <jason@redhat.com>
1376 * tree.cc (lvalue_kind) [VIEW_CONVERT_EXPR]: Change prvalue to
1379 2022-10-04 Jason Merrill <jason@redhat.com>
1382 * cp-gimplify.cc (cp_genericize_init_expr): Use iloc_sentinel.
1383 (cp_genericize_target_expr): Likewise.
1385 2022-10-04 Patrick Palka <ppalka@redhat.com>
1388 * Make-lang.in (CP_PLUGIN_HEADERS): Add cp-trait.def.
1390 2022-10-04 Jakub Jelinek <jakub@redhat.com>
1392 * cp-tree.h (struct omp_declare_target_attr): Rename to ...
1393 (cp_omp_declare_target_attr): ... this. Add device_type member.
1394 (omp_begin_assumes_data): Rename to ...
1395 (cp_omp_begin_assumes_data): ... this.
1396 (struct saved_scope): Change types of omp_declare_target_attribute
1397 and omp_begin_assumes.
1398 * parser.cc (cp_parser_omp_clause_device_type): Uncomment
1399 check_no_duplicate_clause call.
1400 (cp_parser_omp_all_clauses): Fix up pasto, c_name for OMP_CLAUSE_LINK
1401 should be "link" rather than "to".
1402 (cp_parser_omp_declare_target): Adjust for omp_declare_target_attr
1403 to cp_omp_declare_target_attr changes, push -1 as device_type. Use
1404 error_at rather than warning_at for declare target with only
1405 device_type clauses.
1406 (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
1407 (cp_parser_omp_begin): Add begin declare target support. Adjust
1408 for omp_begin_assumes_data to cp_omp_begin_assumes_data change.
1409 (cp_parser_omp_end): Adjust for the
1410 omp_declare_target_attr to cp_omp_declare_target_attr and
1411 omp_begin_assumes_data to cp_omp_begin_assumes_data type changes,
1412 adjust diagnostics wording and simplify format strings for easier
1414 * semantics.cc (finish_translation_unit): Likewise.
1415 * decl2.cc (cplus_decl_attributes): If device_type was present on
1416 begin declare target, add "omp declare target host" and/or
1417 "omp declare target nohost" attributes.
1419 2022-10-03 Jakub Jelinek <jakub@redhat.com>
1421 * cp-tree.h (BCS_STMT_EXPR): New enumerator.
1422 * name-lookup.h (enum scope_kind): Add sk_stmt_expr.
1423 * name-lookup.cc (begin_scope): Handle sk_stmt_expr like sk_block.
1424 * semantics.cc (begin_compound_stmt): For BCS_STMT_EXPR use
1426 * parser.cc (cp_parser_statement_expr): Use BCS_STMT_EXPR instead of
1428 * decl.cc (struct named_label_entry): Add in_stmt_expr.
1429 (poplevel_named_label_1): Handle sk_stmt_expr.
1430 (check_previous_goto_1): Diagnose entering of statement expression.
1431 (check_goto): Likewise.
1433 2022-10-03 Patrick Palka <ppalka@redhat.com>
1435 * constraint.cc (diagnose_trait_expr): Use CPTK_IS_SAME instead
1437 * cp-trait.def (IS_SAME_AS): Rename to ...
1438 (IS_SAME): ... this.
1439 * pt.cc (alias_ctad_tweaks): Use CPTK_IS_SAME instead of
1441 * semantics.cc (trait_expr_value): Likewise.
1442 (finish_trait_expr): Likewise.
1444 2022-10-01 Patrick Palka <ppalka@redhat.com>
1446 * semantics.cc (trait_expr_value): Make cp_trait_kind switch
1447 statement exhaustive.
1448 (finish_trait_expr): Likewise.
1449 (finish_trait_type): Likewise.
1451 2022-10-01 Jason Merrill <jason@redhat.com>
1453 * init.cc (build_vec_init): Clear from_array for CONSTRUCTOR
1456 2022-10-01 Jason Merrill <jason@redhat.com>
1458 * cp-gimplify.cc (cp_genericize_init): Also convert the result of
1459 split_nonconstant_init to void.
1461 2022-09-30 Patrick Palka <ppalka@redhat.com>
1463 * constraint.cc (diagnose_trait_expr): Likewise.
1464 * cp-objcp-common.cc (names_builtin_p): Likewise.
1465 * cp-tree.h (enum cp_trait_kind): Likewise.
1466 * cxx-pretty-print.cc (pp_cxx_trait): Likewise.
1467 * parser.cc (cp_keyword_starts_decl_specifier_p): Likewise.
1468 (cp_parser_primary_expression): Likewise.
1469 (cp_parser_trait): Likewise.
1470 (cp_parser_simple_type_specifier): Likewise.
1471 * cp-trait.def: New file.
1473 2022-09-30 Jason Merrill <jason@redhat.com>
1475 * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: Collapse
1476 TARGET_EXPR within TARGET_EXPR.
1477 * constexpr.cc (cxx_eval_outermost_constant_expr): Avoid
1478 adding redundant TARGET_EXPR.
1479 * cp-tree.h (target_expr_needs_replace): VEC_INIT_EXPR doesn't.
1481 2022-09-29 Patrick Palka <ppalka@redhat.com>
1484 * pt.cc (listify): Use lookup_qualified_name instead of
1485 get_namespace_binding.
1487 2022-09-29 Jason Merrill <jason@redhat.com>
1489 * class.cc (check_methods): Call constraints_satisfied_p.
1491 2022-09-29 Jason Merrill <jason@redhat.com>
1493 * constexpr.cc (potential_constant_expression_1): Look into
1494 DECL_INITIAL. Use location wrappers.
1496 2022-09-29 Jason Merrill <jason@redhat.com>
1499 * call.cc (build_conditional_expr): For a?:c extension, treat
1500 a reused class prvalue as an xvalue.
1502 2022-09-29 Jason Merrill <jason@redhat.com>
1504 * call.cc (build_conditional_expr): Set TARGET_EXPR_NO_ELIDE on the
1507 2022-09-29 Patrick Palka <ppalka@redhat.com>
1509 * constraint.cc (diagnose_trait_expr): Handle CPTK_REMOVE_CV,
1510 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1511 * cp-objcp-common.cc (names_builtin_p): Likewise.
1512 * cp-tree.h (enum cp_trait_kind): Add CPTK_REMOVE_CV,
1513 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1514 * cxx-pretty-print.cc (pp_cxx_trait): Handle CPTK_REMOVE_CV,
1515 CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1516 * parser.cc (cp_keyword_starts_decl_specifier_p): Return true
1517 for RID_REMOVE_CV, RID_REMOVE_REFERENCE and RID_REMOVE_CVREF.
1518 (cp_parser_trait): Handle RID_REMOVE_CV, RID_REMOVE_REFERENCE
1519 and RID_REMOVE_CVREF.
1520 (cp_parser_simple_type_specifier): Likewise.
1521 * semantics.cc (finish_trait_type): Likewise.
1523 2022-09-29 Patrick Palka <ppalka@redhat.com>
1525 * cp-objcp-common.cc (cp_common_init_ts): Replace
1526 UNDERLYING_TYPE with TRAIT_TYPE.
1527 * cp-tree.def (TRAIT_TYPE): Define.
1528 (UNDERLYING_TYPE): Remove.
1529 * cp-tree.h (TRAIT_TYPE_KIND_RAW): Define.
1530 (TRAIT_TYPE_KIND): Define.
1531 (TRAIT_TYPE_TYPE1): Define.
1532 (TRAIT_TYPE_TYPE2): Define.
1533 (WILDCARD_TYPE_P): Return true for TRAIT_TYPE.
1534 (finish_trait_type): Declare.
1535 * cxx-pretty-print.cc (cxx_pretty_printer::primary_expression):
1536 Adjust after renaming pp_cxx_trait_expression.
1537 (cxx_pretty_printer::simple_type_specifier) <case TRAIT_TYPE>:
1539 (cxx_pretty_printer::type_id): Replace UNDERLYING_TYPE with
1541 (pp_cxx_trait_expression): Rename to ...
1542 (pp_cxx_trait): ... this. Handle TRAIT_TYPE as well. Correct
1543 pretty printing of the trailing arguments.
1544 * cxx-pretty-print.h (pp_cxx_trait_expression): Rename to ...
1545 (pp_cxx_trait_type): ... this.
1546 * error.cc (dump_type) <case UNDERLYING_TYPE>: Remove.
1547 <case TRAIT_TYPE>: New.
1548 (dump_type_prefix): Replace UNDERLYING_WITH with TRAIT_TYPE.
1549 (dump_type_suffix): Likewise.
1550 * mangle.cc (write_type) <case UNDERLYING_TYPE>: Remove.
1551 <case TRAIT_TYPE>: New.
1552 * module.cc (trees_out::type_node) <case UNDERLYING_TYPE>:
1554 <case TRAIT_TYPE>: New.
1555 (trees_in::tree_node): Likewise.
1556 * parser.cc (cp_parser_primary_expression): Adjust after
1557 renaming cp_parser_trait_expr.
1558 (cp_parser_trait_expr): Rename to ...
1559 (cp_parser_trait): ... this. Call finish_trait_type for traits
1561 (cp_parser_simple_type_specifier): Adjust after renaming
1562 cp_parser_trait_expr.
1563 * pt.cc (for_each_template_parm_r) <case UNDERLYING_TYPE>:
1565 <case TRAIT_TYPE>: New.
1567 (unify): Replace UNDERLYING_TYPE with TRAIT_TYPE.
1568 (dependent_type_p_r): Likewise.
1569 * semantics.cc (finish_underlying_type): Don't return
1570 UNDERLYING_TYPE anymore when processing_template_decl.
1571 (finish_trait_type): Define.
1572 * tree.cc (strip_typedefs) <case UNDERLYING_TYPE>: Remove.
1573 <case TRAIT_TYPE>: New.
1574 (cp_walk_subtrees): Likewise.
1575 * typeck.cc (structural_comptypes): Likewise.
1577 2022-09-29 Nathan Sidwell <nathan@acm.org>
1580 * module.cc (enum tree_tag): Add tt_nttp_var.
1581 (trees_out::decl_node): Handle NTTP objects.
1582 (trees_in::tree_node): Handle tt_nttp_var.
1583 (depset::hash::add_binding_entry): Skip NTTP objects.
1585 2022-09-28 Eugene Rozenfeld <erozen@microsoft.com>
1587 * module.cc (write_location): Write discriminator.
1588 (read_location): Read discriminator.
1590 2022-09-28 Nathan Sidwell <nathan@acm.org>
1592 * cp-tree.h (DECL_NTTP_OBJECT_P): New.
1593 (template_parm_object_p): Delete.
1594 (build_template_parm_object): Declare.
1595 * cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P.
1596 * error.cc (dump_simple_decl): Likewise.
1597 * mangle.cc (write_template_arg): Likewise.
1598 * pt.cc (template_parm_object_p): Delete.
1599 (create_template_parm_object): Separated out checking from ...
1600 (get_template_parm_object): ... this, new external entry point.
1602 2022-09-27 Marek Polacek <polacek@redhat.com>
1606 * call.cc (reference_binding): Check clk_implicit_rval in C++20 only.
1607 * cp-tree.h (unparenthesized_id_or_class_member_access_p): Declare.
1608 * pt.cc (unparenthesized_id_or_class_member_access_p): New function,
1610 (do_auto_deduction): ...here. Use it. In C++23, maybe call
1611 treat_lvalue_as_rvalue_p.
1612 * tree.cc (xvalue_p): Check & clk_rvalueref, not == clk_rvalueref.
1613 * typeck.cc (check_return_expr): Allow implicit move for functions
1614 returning a reference as well, or when the return value type is not
1617 2022-09-27 Marek Polacek <polacek@redhat.com>
1619 * constraint.cc (diagnose_trait_expr): Say "nothrow" without quotes
1620 rather than in quotes.
1622 2022-09-27 Jonathan Wakely <jwakely@redhat.com>
1625 * method.cc (is_convertible_helper): Use access check sentinel.
1627 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1630 * cp-tree.h (LAMBDA_EXPR_STATIC_P): Implement C++23
1631 P1169R4 - static operator(). Define.
1632 * parser.cc (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Document
1633 that it also allows static.
1634 (cp_parser_lambda_declarator_opt): Handle static lambda specifier.
1635 (cp_parser_decl_specifier_seq): Allow RID_STATIC for
1636 CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
1637 * decl.cc (grok_op_properties): If operator() isn't a method,
1638 use a different error wording, if it is static member function,
1639 allow it (for C++20 and older with a pedwarn unless it is
1640 a lambda function or template instantiation).
1641 * call.cc (joust): Don't ICE if one candidate is static member
1642 function and the other is an indirect call. If the parameter
1643 conversion on the other candidate is user defined conversion,
1644 ellipsis or bad conversion, make static member function candidate
1645 a winner for that parameter.
1646 * lambda.cc (maybe_add_lambda_conv_op): Handle static lambdas.
1647 * error.cc (dump_lambda_function): Print static for static lambdas.
1649 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1651 * cp-tree.h (struct omp_begin_assumes_data): New type.
1652 (struct saved_scope): Add omp_begin_assumes member.
1653 * parser.cc: Include bitmap.h.
1654 (cp_parser_omp_assumption_clauses, cp_parser_omp_assume,
1655 cp_parser_omp_assumes, cp_parser_omp_begin): New functions.
1656 (cp_parser_omp_end_declare_target): Rename to ...
1657 (cp_parser_omp_end): ... this. Handle also end assumes.
1658 (cp_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
1659 (cp_parser_pragma): Handle PRAGMA_OMP_ASSUME, PRAGMA_OMP_ASSUMES
1660 and PRAGMA_OMP_BEGIN. Handle PRAGMA_OMP_END rather than
1661 PRAGMA_OMP_END_DECLARE_TARGET and call cp_parser_omp_end
1662 for it rather than cp_parser_omp_end_declare_target.
1663 * pt.cc (apply_late_template_attributes): Also temporarily clear
1665 * semantics.cc (finish_translation_unit): Also diagnose
1666 #pragma omp begin assumes without corresponding
1667 #pragma omp end assumes.
1669 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1671 * parser.cc (cp_parser_lambda_declarator_opt): Don't diagnose
1672 conflicting specifiers here.
1673 (cp_storage_class_name): New variable.
1674 (cp_parser_decl_specifier_seq): When setting conflicting_specifiers_p
1675 for the first time, diagnose which exact specifiers conflict.
1676 (cp_parser_set_storage_class): Likewise. Move storage_class
1677 computation earlier.
1678 * decl.cc (grokdeclarator): Don't diagnose conflicting specifiers
1679 here, just return error_mark_node.
1681 2022-09-27 Jakub Jelinek <jakub@redhat.com>
1685 * cp-tree.h (cp_compare_floating_point_conversion_ranks): Implement
1686 P1467R9 - Extended floating-point types and standard names except
1687 for std::bfloat16_t for now. Declare.
1688 (extended_float_type_p): New inline function.
1689 * mangle.cc (write_builtin_type): Mangle float{16,32,64,128}_type_node
1690 as DF{16,32,64,128}_. Mangle float{32,64,128}x_type_node as
1691 DF{32,64,128}x. Remove FIXED_POINT_TYPE mangling that conflicts
1693 * typeck2.cc (check_narrowing): If one of ftype or type is extended
1694 floating-point type, compare floating-point conversion ranks.
1695 * parser.cc (cp_keyword_starts_decl_specifier_p): Handle
1697 (cp_parser_simple_type_specifier): Likewise and diagnose missing
1698 _Float<N> or _Float<N>x support if not supported by target.
1699 * typeck.cc (cp_compare_floating_point_conversion_ranks): New function.
1700 (cp_common_type): If both types are REAL_TYPE and one or both are
1701 extended floating-point types, select common type based on comparison
1702 of floating-point conversion ranks and subranks.
1703 (cp_build_binary_op): Diagnose operation with floating point arguments
1704 with unordered conversion ranks.
1705 * call.cc (standard_conversion): For floating-point conversion, if
1706 either from or to are extended floating-point types, set conv->bad_p
1707 for implicit conversion from larger to smaller conversion rank or
1708 with unordered conversion ranks.
1709 (convert_like_internal): Emit a pedwarn on such conversions.
1710 (build_conditional_expr): Diagnose operation with floating point
1711 arguments with unordered conversion ranks.
1712 (convert_arg_to_ellipsis): Don't promote extended floating-point types
1713 narrower than double to double.
1714 (compare_ics): Implement P1467R9 [over.ics.rank]/4 changes.
1716 2022-09-26 Marek Polacek <polacek@redhat.com>
1719 * typeck2.cc (array_string_literal_compatible_p): Allow
1720 initializing arrays of char or unsigned char by a UTF-8 string literal.
1722 2022-09-26 Marek Polacek <polacek@redhat.com>
1725 * method.cc (is_convertible_helper): New.
1726 (is_convertible): Use it.
1727 (is_nothrow_convertible): Likewise.
1729 2022-09-26 Patrick Palka <ppalka@redhat.com>
1732 * module.cc (trees_in::decl_value): In the MK_partial case for
1733 a variable template partial specialization, pass decl_p=true to
1734 add_mergeable_specialization, and set spec to the VAR_DECL not
1736 * pt.cc (add_mergeable_specialization): For a variable template
1737 partial specialization, set the TREE_TYPE of the new
1738 DECL_TEMPLATE_SPECIALIZATIONS node to the TREE_TYPE of the
1739 VAR_DECL not the VAR_DECL itself.
1741 2022-09-23 Marek Polacek <polacek@redhat.com>
1744 * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONVERTIBLE
1745 and CPTK_IS_NOTHROW_CONVERTIBLE.
1746 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_CONVERTIBLE
1747 RID_IS_NOTHROW_CONVERTIBLE.
1748 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_CONVERTIBLE and
1749 CPTK_IS_NOTHROW_CONVERTIBLE.
1750 (is_convertible): Declare.
1751 (is_nothrow_convertible): Likewise.
1752 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1753 CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE.
1754 * method.cc (is_convertible): New.
1755 (is_nothrow_convertible): Likewise.
1756 * parser.cc (cp_parser_primary_expression): Handle RID_IS_CONVERTIBLE
1757 and RID_IS_NOTHROW_CONVERTIBLE.
1758 (cp_parser_trait_expr): Likewise.
1759 * semantics.cc (trait_expr_value): Handle CPTK_IS_CONVERTIBLE and
1760 CPTK_IS_NOTHROW_CONVERTIBLE.
1761 (finish_trait_expr): Likewise.
1763 2022-09-23 Marek Polacek <polacek@redhat.com>
1766 * typeck2.cc (split_nonconstant_init_1): Check TYPE_P.
1768 2022-09-22 Patrick Palka <ppalka@redhat.com>
1771 * module.cc (trees_out::decl_value): Use get_template_info in
1772 the MK_partial case to handle both VAR_DECL and TYPE_DECL.
1773 (trees_out::key_mergeable): Likewise.
1774 (trees_in::key_mergeable): Likewise.
1775 (has_definition): Consider DECL_INITIAL of a partial variable
1776 template specialization.
1777 (depset::hash::make_dependency): Handle partial variable template
1778 specializations too.
1780 2022-09-20 Patrick Palka <ppalka@redhat.com>
1782 * decl.cc (cp_finish_decl): After updating the deduced type of a
1783 VAR_DECL, also update the corresponding TEMPLATE_DECL if there
1786 2022-09-20 Patrick Palka <ppalka@redhat.com>
1789 * module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
1790 Stream PACK_EXPANSION_EXTRA_ARGS.
1791 (trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
1793 2022-09-17 Patrick Palka <ppalka@redhat.com>
1795 * module.cc (friend_from_decl_list): Don't consider
1796 CLASSTYPE_TEMPLATE_INFO for a TYPENAME_TYPE friend.
1797 (trees_in::read_class_def): Don't add to
1798 CLASSTYPE_BEFRIENDING_CLASSES for a TYPENAME_TYPE friend.
1800 2022-09-16 Patrick Palka <ppalka@redhat.com>
1803 * constexpr.cc (cxx_eval_component_reference): Check non_constant_p
1804 sooner. In C++14 or later, reject a DECL_MUTABLE_P member access
1805 only if CONSTRUCTOR_MUTABLE_POISION is also set.
1807 2022-09-16 Jason Merrill <jason@redhat.com>
1810 * parser.cc (cp_parser_omp_var_list_no_open): Pass the
1811 initial token location down.
1812 * semantics.cc (finish_omp_clauses): Check
1813 invalid_nonstatic_memfn_p.
1814 * typeck.cc (invalid_nonstatic_memfn_p): Handle null TREE_TYPE.
1816 2022-09-15 Richard Biener <rguenther@suse.de>
1818 * decl.cc (cxx_init_decl_processing): Inline last
1819 build_void_list_node call.
1820 (build_void_list_node): Remove.
1822 2022-09-14 Julian Brown <julian@codesourcery.com>
1824 * semantics.cc (finish_omp_clauses): Likewise.
1826 2022-09-13 Patrick Palka <ppalka@redhat.com>
1828 * cp-tree.h (mark_used): Remove single-parameter overload. Add
1829 default argument to the two-parameter overload.
1830 * decl2.cc (mark_used): Likewise.
1832 2022-09-13 Patrick Palka <ppalka@redhat.com>
1834 * cp-tree.h (cxx_constant_value): Define two-parameter version
1835 that omits the object parameter.
1836 * decl.cc (build_explicit_specifier): Omit NULL_TREE object
1837 argument to cxx_constant_value.
1838 * except.cc (build_noexcept_spec): Likewise.
1839 * pt.cc (expand_integer_pack): Likewise.
1840 (fold_targs_r): Likewise.
1841 * semantics.cc (finish_if_stmt_cond): Likewise.
1843 2022-09-13 Patrick Palka <ppalka@redhat.com>
1845 * decl.cc (build_explicit_specifier): Pass complain to
1847 * except.cc (build_noexcept_spec): Likewise.
1848 * pt.cc (expand_integer_pack): Likewise.
1849 (tsubst_function_decl): Propagate error_mark_node returned
1850 from build_explicit_specifier.
1852 2022-09-12 Patrick Palka <ppalka@redhat.com>
1854 * call.cc (build_conditional_expr): Adjust calls to
1855 '_sfinae'-suffixed functions.
1856 (build_temp): Likewise.
1857 (convert_like_internal): Likewise.
1858 (convert_arg_to_ellipsis): Likewise.
1859 (build_over_call): Likewise.
1860 (build_cxx_call): Likewise.
1861 (build_new_method_call): Likewise.
1862 * constexpr.cc (cxx_eval_outermost_constant_expr): Likewise.
1863 (cxx_constant_value_sfinae): Rename to ...
1864 (cxx_constant_value): ... this. Document its default arguments.
1865 (fold_non_dependent_expr): Adjust function comment.
1866 * cp-tree.h (instantiate_non_dependent_expr_sfinae): Rename to ...
1867 (instantiate_non_dependent_expr): ... this. Give its 'complain'
1868 parameter a default argument.
1869 (get_target_expr_sfinae, get_target_expr): Likewise.
1870 (require_complete_type_sfinae, require_complete_type): Likewise.
1871 (abstract_virtuals_error_sfinae, abstract_virtuals_error):
1873 (cxx_constant_value_sfinae, cxx_constant_value): Likewise.
1874 * cvt.cc (build_up_reference): Adjust calls to '_sfinae'-suffixed
1876 (ocp_convert): Likewise.
1877 * decl.cc (build_explicit_specifier): Likewise.
1878 * except.cc (build_noexcept_spec): Likewise.
1879 * init.cc (build_new_1): Likewise.
1880 * pt.cc (expand_integer_pack): Likewise.
1881 (instantiate_non_dependent_expr_internal): Adjust function
1883 (instantiate_non_dependent_expr): Rename to ...
1884 (instantiate_non_dependent_expr_sfinae): ... this. Document its
1886 (tsubst_init): Adjust calls to '_sfinae'-suffixed functions.
1887 (fold_targs_r): Likewise.
1888 * semantics.cc (finish_compound_literal): Likewise.
1889 (finish_decltype_type): Likewise.
1890 (cp_build_bit_cast): Likewise.
1891 * tree.cc (build_cplus_new): Likewise.
1892 (get_target_expr): Rename to ...
1893 (get_target_expr_sfinae): ... this. Document its default
1895 * typeck.cc (require_complete_type): Rename to ...
1896 (require_complete_type_sfinae): ... this. Document its default
1898 (cp_build_array_ref): Adjust calls to '_sfinae'-suffixed
1900 (convert_arguments): Likewise.
1901 (cp_build_binary_op): Likewise.
1902 (build_static_cast_1): Likewise.
1903 (cp_build_modify_expr): Likewise.
1904 (convert_for_initialization): Likewise.
1905 * typeck2.cc (abstract_virtuals_error): Rename to ...
1906 (abstract_virtuals_error_sfinae): ... this. Document its default
1908 (build_functional_cast_1): Adjust calls to '_sfinae'-suffixed
1911 2022-09-12 Patrick Palka <ppalka@redhat.com>
1914 * pt.cc (tsubst_template_args): Set cp_evaluated here.
1915 (tsubst_aggr_type): Not here.
1917 2022-09-12 Jason Merrill <jason@redhat.com>
1921 * decl.cc (cp_finish_decl): Call mark_single_function.
1923 2022-09-12 Jason Merrill <jason@redhat.com>
1926 * pt.cc (type_dependent_expression_p): Treat a compound
1927 literal of array-of-unknown-bound type like a variable.
1929 2022-09-12 Jason Merrill <jason@redhat.com>
1932 * lambda.cc (type_deducible_expression_p): Check
1933 array_of_unknown_bound_p.
1935 2022-09-12 Jonathan Wakely <jwakely@redhat.com>
1938 * decl2.cc (constrain_class_visibility): Adjust wording of
1939 -Wsubobject-linkage for cases where anonymous
1940 namespaces aren't used.
1941 * tree.cc (decl_anon_ns_mem_p): Now only true for actual anonymous
1942 namespace members, rename old semantics to...
1943 (decl_internal_context_p): ...this.
1944 * cp-tree.h, name-lookup.cc, pt.cc: Adjust.
1946 2022-09-08 Jonathan Wakely <jwakely@redhat.com>
1949 * class.cc (type_has_virtual_destructor): Return false for
1951 * semantics.cc (check_trait_type): Add KIND parameter to support
1952 different sets of requirements.
1953 (finish_trait_expr): Pass KIND argument for relevant traits.
1955 2022-09-08 Patrick Palka <ppalka@redhat.com>
1958 * decl2.cc (maybe_instantiate_decl): Adjust function comment.
1959 Check VAR_OR_FUNCTION_DECL_P. Pull out the disjunction into ...
1960 (mark_used): ... here, removing the decl_maybe_constant_var_p
1963 2022-09-07 Jason Merrill <jason@redhat.com>
1966 * decl.cc (grokdeclarator): Improve placeholder diagnostics.
1967 * parser.cc (cp_parser_type_id_1): Add fixit.
1969 2022-09-07 Arsen Arsenović <arsen@aarsen.me>
1973 * coroutines.cc (coro_rewrite_function_body): Ensure we have a
1974 BIND_EXPR wrapping the function body.
1976 2022-09-07 Jakub Jelinek <jakub@redhat.com>
1979 * semantics.cc (finish_omp_target_clauses): If current_function_decl
1980 isn't a nonstatic member function, don't set data.current_object to
1983 2022-09-06 Jason Merrill <jason@redhat.com>
1985 * decl.cc (grok_op_properties): Return sooner for C++23 op[].
1987 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1989 * parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
1990 in omp_cur_iteration - 1 has integer_type_node type.
1992 2022-09-06 Jakub Jelinek <jakub@redhat.com>
1994 * pt.cc (tsubst_expr) <case OMP_ORDERED>: If OMP_BODY was NULL, keep
1995 it NULL after instantiation too.
1997 2022-09-03 Jakub Jelinek <jakub@redhat.com>
1999 * parser.cc (cp_parser_omp_clause_name): Handle doacross.
2000 (cp_parser_omp_clause_depend_sink): Renamed to ...
2001 (cp_parser_omp_clause_doacross_sink): ... this. Add depend_p
2002 argument. Handle parsing of doacross(sink:omp_cur_iteration-1). Use
2003 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
2004 OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS instead
2005 of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND flag on it.
2006 (cp_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
2007 OMP_CLAUSE_DOACROSS_SOURCE instead of OMP_CLAUSE_DEPEND_SINK and
2008 OMP_CLAUSE_DEPEND_SOURCE, build OMP_CLAUSE_DOACROSS for depend(source)
2009 and set OMP_CLAUSE_DOACROSS_DEPEND on it.
2010 (cp_parser_omp_clause_doacross): New function.
2011 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
2012 (cp_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
2013 OMP_CLAUSE_DEPEND_SOURCE.
2014 (cp_parser_omp_for_loop): Don't diagnose here linear clause together
2015 with ordered with argument.
2016 (cp_parser_omp_simd): Don't diagnose ordered clause with argument on
2018 (OMP_ORDERED_DEPEND_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DOACROSS.
2019 (cp_parser_omp_ordered): Handle also doacross and adjust for it
2021 * pt.cc (tsubst_omp_clause_decl): Use
2022 OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
2023 OMP_CLAUSE_DEPEND_SINK_NEGATIVE.
2024 (tsubst_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
2025 (tsubst_expr): Use OMP_CLAUSE_DEPEND_INVALID instead of
2026 OMP_CLAUSE_DEPEND_SOURCE.
2027 * semantics.cc (cp_finish_omp_clause_depend_sink): Rename to ...
2028 (cp_finish_omp_clause_doacross_sink): ... this.
2029 (finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS. Don't handle
2030 OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK.
2032 2022-09-02 David Malcolm <dmalcolm@redhat.com>
2035 * cp-tree.h (class cp_expr): Add bitfield m_decimal. Clear it in
2036 existing ctors. Add ctor that allows specifying its value.
2037 (cp_expr::decimal_p): New accessor.
2038 * parser.cc (cp_parser_expression_stack_entry::flags): New field.
2039 (cp_parser_primary_expression): Set m_decimal of cp_expr when
2041 (cp_parser_binary_expression): Extract flags from token when
2042 populating stack. Call check_for_xor_used_as_pow.
2044 2022-09-01 Marek Polacek <polacek@redhat.com>
2046 * cp-tree.h (maybe_strip_ref_conversion): Remove.
2048 2022-08-30 Ulrich Drepper <drepper@gmail.com>
2050 * Make-lang.in: Add rule to rebuild std-name-hint.h from
2051 std-name-hint.gperf.
2052 * name-lookup.cc (get_std_name_hint): Remove hints array.
2053 Use gperf-generated class std_name_hint_lookup.
2054 Include "std-name-hint.h".
2055 * std-name-hint.gperf: New file.
2056 * std-name-hint.h: New file. Generated from the .gperf file.
2058 2022-08-30 Marek Polacek <polacek@redhat.com>
2061 * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
2062 and RID_IS_NOTHROW_CONSTRUCTIBLE.
2064 2022-08-29 Marek Polacek <polacek@redhat.com>
2067 * decl.cc (grokdeclarator): Reverse the order of arguments to
2070 2022-08-26 Marek Polacek <polacek@redhat.com>
2073 * typeck.cc (maybe_warn_self_move): New.
2074 (cp_build_modify_expr): Call maybe_warn_self_move.
2076 2022-08-25 Marek Polacek <polacek@redhat.com>
2078 * cp-tree.h (enum cp_tree_index): Remove CTI_NULLPTR, CTI_NULLPTR_TYPE.
2079 Move it to c_tree_index.
2080 (nullptr_node): No longer define here.
2081 (nullptr_type_node): Likewise.
2082 (NULLPTR_TYPE_P): Likewise.
2083 * decl.cc (cxx_init_decl_processing): Only keep C++-specific nullptr
2084 initialization; move the shared code to c_common_nodes_and_builtins.
2086 2022-08-25 Jason Merrill <jason@redhat.com>
2088 * call.cc (unsafe_return_slot_p): Return 2 for *this in a
2091 2022-08-23 Marek Polacek <polacek@redhat.com>
2093 * typeck.cc (maybe_warn_pessimizing_move): Don't warn about
2094 redundant std::move when the expression was wrapped in { }.
2096 2022-08-17 Marek Polacek <polacek@redhat.com>
2099 * typeck.cc (can_do_rvo_p): Rename to ...
2100 (can_elide_copy_prvalue_p): ... this.
2101 (maybe_warn_pessimizing_move): Extend the
2102 -Wredundant-move warning to warn about std::move on a
2103 const-qualified object.
2105 2022-08-17 Marek Polacek <polacek@redhat.com>
2108 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Maybe suppress
2110 * typeck.cc (maybe_warn_pessimizing_move): Don't issue warnings
2111 if they are suppressed.
2112 (check_return_expr): Disable -Wpessimizing-move when returning
2113 a dependent expression.
2115 2022-08-17 Marek Polacek <polacek@redhat.com>
2118 * call.cc (build_over_call): Call maybe_warn_pessimizing_move.
2119 * cp-tree.h (maybe_warn_pessimizing_move): Declare.
2120 * decl.cc (build_aggr_init_full_exprs): Call
2121 maybe_warn_pessimizing_move.
2122 * typeck.cc (maybe_warn_pessimizing_move): Handle TREE_LIST and
2123 CONSTRUCTOR. Add a bool parameter and use it. Adjust a diagnostic
2125 (check_return_expr): Adjust the call to maybe_warn_pessimizing_move.
2127 2022-08-17 Tobias Burnus <tobias@codesourcery.com>
2128 Chung-Lin Tang <cltang@codesourcery.com>
2131 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove.
2132 * cp-tree.h (cp_omp_mappable_type, cp_omp_emit_unmappable_type_notes):
2134 * decl2.cc (cp_omp_mappable_type_1, cp_omp_mappable_type,
2135 cp_omp_emit_unmappable_type_notes): Remove.
2136 (cplus_decl_attributes): Call omp_mappable_type instead of
2138 * decl.cc (cp_finish_decl): Likewise; call cxx_incomplete_type_inform
2139 in lieu of cp_omp_emit_unmappable_type_notes.
2140 * semantics.cc (finish_omp_clauses): Likewise.
2142 2022-08-16 Tom Honermann <tom@honermann.net>
2145 * parser.cc (cp_lexer_saving_tokens): Add comment regarding
2146 diagnostic requirements.
2148 2022-08-16 Jakub Jelinek <jakub@redhat.com>
2150 * typeck.cc (cp_build_modify_expr): Implement
2151 P2327R1 - De-deprecating volatile compound operations. Don't warn
2152 for |=, &= or ^= with volatile lhs.
2153 * expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
2156 2022-08-15 Marek Polacek <polacek@redhat.com>
2159 * typeck.cc (can_do_rvo_p): New.
2160 (maybe_warn_pessimizing_move): Warn when moving a temporary object
2161 in a return statement prevents copy elision.
2163 2022-08-11 Marek Polacek <polacek@redhat.com>
2165 PR middle-end/102633
2166 * decl.cc (cp_finish_decl): Call suppress_warning.
2168 2022-08-07 Jakub Jelinek <jakub@redhat.com>
2171 * constexpr.cc (cxx_eval_store_expression): Handle REALPART_EXPR
2172 and IMAGPART_EXPR. Change ctors from releasing_vec to
2173 auto_vec<tree *>, adjust all uses. For !preeval, update ctors
2176 2022-07-31 Lewis Hyatt <lhyatt@gmail.com>
2179 * parser.cc (cp_lexer_new_main): Rename global done_lexing to
2180 override_libcpp_locations.
2182 2022-07-31 Jason Merrill <jason@redhat.com>
2185 * constexpr.cc (reduced_constant_expression_p): Return false
2186 if a CONSTRUCTOR initializes an empty field.
2188 2022-07-29 Jakub Jelinek <jakub@redhat.com>
2191 * parser.cc (cp_parser_omp_atomic): For simple cast followed by
2192 CPP_QUERY token, don't try cp_parser_binary_operation if compare
2195 2022-07-26 Marek Polacek <polacek@redhat.com>
2198 * pt.cc (redeclare_class_template): Check DECL_P before accessing
2199 DECL_SOURCE_LOCATION.
2201 2022-07-26 Jason Merrill <jason@redhat.com>
2204 * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.
2206 2022-07-25 Jason Merrill <jason@redhat.com>
2209 * class.cc (warn_hidden): Remove shortcut.
2211 2022-07-22 Patrick Palka <ppalka@redhat.com>
2214 * pt.cc (do_class_deduction): Don't consider TYPE_HAS_LIST_CTOR
2215 when setting try_list_ctor. Reset args even when try_list_ctor
2216 is true and there are no list candidates. Call resolve_args on
2217 the reset args. Rename try_list_ctor to try_list_cand.
2219 2022-07-22 Martin Liska <mliska@suse.cz>
2222 * init.cc (sort_mem_initializers): Remove continue as last stmt
2225 2022-07-21 Jason Merrill <jason@redhat.com>
2228 * decl.cc (move_fn_p): Remove assert.
2230 2022-07-21 Jason Merrill <jason@redhat.com>
2234 * method.cc (walk_field_subobs): Fix DMI in union case.
2236 2022-07-19 Patrick Palka <ppalka@redhat.com>
2241 * call.cc (enum conversion_kind): Add ck_deferred_bad enumerator.
2242 (has_next): Return false for it.
2243 (reference_binding): Return a ck_deferred_bad conversion instead
2244 of an actual bad conversion when LOOKUP_SHORTCUT_BAD_CONVS is set.
2245 Remove now obsolete early exit for the incomplete TO case.
2246 (implicit_conversion_1): Don't mask out LOOKUP_SHORTCUT_BAD_CONVS.
2247 (add_function_candidate): Set LOOKUP_SHORTCUT_BAD_CONVS iff
2249 (missing_conversion_p): Also return true for a ck_deferred_bad
2251 * cp-tree.h (LOOKUP_SHORTCUT_BAD_CONVS): Define.
2253 2022-07-19 Jonathan Wakely <jwakely@redhat.com>
2255 * cp-objcp-common.cc (names_builtin_p): Return true for
2256 RID_REF_CONSTRUCTS_FROM_TEMPORARY and
2257 RID_REF_CONVERTS_FROM_TEMPORARY.
2259 2022-07-15 Marek Polacek <polacek@redhat.com>
2262 * call.cc (ref_conv_binds_directly_p): Rename to ...
2263 (ref_conv_binds_directly): ... this. Add a new bool parameter. Change
2264 the return type to tristate.
2265 * constraint.cc (diagnose_trait_expr): Handle
2266 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2267 * cp-tree.h: Include "tristate.h".
2268 (enum cp_trait_kind): Add CPTK_REF_CONSTRUCTS_FROM_TEMPORARY
2269 and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2270 (ref_conv_binds_directly_p): Rename to ...
2271 (ref_conv_binds_directly): ... this.
2272 (ref_xes_from_temporary): Declare.
2273 * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
2274 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2275 * method.cc (ref_xes_from_temporary): New.
2276 * parser.cc (cp_parser_primary_expression): Handle
2277 RID_REF_CONSTRUCTS_FROM_TEMPORARY and RID_REF_CONVERTS_FROM_TEMPORARY.
2278 (cp_parser_trait_expr): Likewise.
2279 (warn_for_range_copy): Adjust to call ref_conv_binds_directly.
2280 * semantics.cc (trait_expr_value): Handle
2281 CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2282 (finish_trait_expr): Likewise.
2284 2022-07-13 Patrick Palka <ppalka@redhat.com>
2287 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
2288 NULL_TREE extract_call_expr result.
2290 2022-07-13 Patrick Palka <ppalka@redhat.com>
2293 * constraint.cc (satisfy_declaration_constraints): Refine early
2294 exit test for argument dependence.
2295 * cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
2296 * pt.cc (template_class_depth): Handle TI_TEMPLATE being a
2298 (usse_outer_template_parms): Factor out constraint dependence
2300 (uses_outer_template_parms_in_constraints): ... here.
2301 (type_dependent_expression_p): Use it for FUNCTION_DECL.
2303 2022-07-07 Patrick Palka <ppalka@redhat.com>
2306 * pt.cc (template_arg_to_parm): Define.
2307 (tsubst_argument_pack): Try to reuse the corresponding
2308 ARGUMENT_PACK from 'args' when substituting into a generic
2309 ARGUMENT_PACK for a variadic template parameter.
2310 (tsubst_template_args): Move variable declarations closer to
2311 their first use. Replace 'orig_t' with 'r'. Rename 'need_new'
2312 to 'const_subst_p'. Heuristically detect if the substituted
2313 elements are identical to that of a level from 'args' and avoid
2314 allocating a new TREE_VEC if so. Add sanity check for the
2315 length of the new TREE_VEC, and remove dead ARGUMENT_PACK_P test.
2316 (tsubst_decl) <case TYPE_DECL, case VAR_DECL>: Revert
2317 r13-1045-gcb7fd1ea85feea change for avoiding substitution into
2318 DECL_TI_ARGS, but still avoid coercion in this case.
2320 2022-07-07 Jason Merrill <jason@redhat.com>
2323 * class.cc (warn_hidden): Ignore [cd]tors.
2325 2022-07-06 Lewis Hyatt <lhyatt@gmail.com>
2328 * parser.cc (cp_parser_pragma_kind): Move earlier in the file.
2329 (cp_lexer_handle_early_pragma): New function.
2330 (cp_lexer_new_main): Support parsing and handling early pragmas.
2331 (c_parse_file): Adapt to changes in cp_lexer_new_main.
2333 2022-07-06 Jason Merrill <jason@redhat.com>
2337 * parser.cc (cp_parser_lookup_name): Remove :: requirement
2338 for using unqualified lookup result.
2340 2022-07-05 Nathan Sidwell <nathan@acm.org>
2343 (struct ord_loc_info, ord_loc_traits): New.
2344 (ord_loc_tabke, ord_loc_remap): New globals.
2345 (struct location_map_info): Delete.
2346 (struct module_state_config): Rename ordinary_loc_align to
2348 (module_for_ordinary_loc): Adjust.
2349 (module_state::note_location): Note ordinary locations,
2351 (module_state::write_location): Adjust ordinary location
2353 (module_state::read_location): Likewise.
2354 (module_state::write_init_maps): Allocate ord_loc_table.
2355 (module_state::write_prepare_maps): Reimplement ordinary
2357 (module_state::read_prepare_maps): Adjust.
2358 (module_state::write_ordinary_maps): Reimplement.
2359 (module_state::write_macro_maps): Adjust.
2360 (module_state::read_ordinary_maps): Reimplement.
2361 (module_state::write_macros): Adjust.
2362 (module_state::write_config): Adjust.
2363 (module_state::read_config): Adjust.
2364 (module_state::write_begin): Adjust.
2365 (module_state::read_initial): Adjust.
2367 2022-07-04 Tobias Burnus <tobias@codesourcery.com>
2368 Chung-Lin Tang <cltang@codesourcery.com>
2369 Thomas Schwinge <thomas@codesourcery.com>
2371 * parser.cc (cp_parser_omp_target_data,
2372 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2373 cp_parser_omp_target_update): Set OMP_REQUIRES_TARGET_USED.
2374 (cp_parser_omp_requires): Remove sorry.
2376 2022-07-01 Lewis Hyatt <lhyatt@gmail.com>
2378 * parser.cc (cp_token_is_module_directive): New function
2379 refactoring common code.
2380 (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
2381 (cp_parser_skip_to_end_of_statement): Likewise.
2382 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
2383 (cp_parser_declaration): Likewise.
2385 2022-07-01 Marek Polacek <polacek@redhat.com>
2388 * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
2390 2022-07-01 Tobias Burnus <tobias@codesourcery.com>
2392 * parser.cc (cp_parser_omp_target_enter_data,
2393 cp_parser_omp_target_exit_data): Accept tofrom
2394 map-type modifier but use 'to' / 'from' internally.
2396 2022-07-01 Marek Polacek <polacek@redhat.com>
2399 * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
2400 RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
2402 2022-07-01 Jason Merrill <jason@redhat.com>
2405 * call.cc (resolve_args): Use complain.
2407 2022-07-01 Jason Merrill <jason@redhat.com>
2409 * parser.cc (missing_template_diag): Split out...
2410 (cp_parser_id_expression): ...from here.
2412 2022-07-01 Jason Merrill <jason@redhat.com>
2415 * parser.cc (missing_template_diag): Factor out...
2416 (cp_parser_id_expression): ...from here.
2417 (cp_parser_lookup_name): Don't look in dependent object_type.
2419 2022-06-30 Nathan Sidwell <nathan@acm.org>
2421 * module.cc (module_state::write_define): Drop located param.
2422 (module_state::read_define): Likewise.
2423 (module_state::prepare_macros): New, broken out of ...
2424 (module_state::write_macros): ... here. Adjust.
2425 (module_state::write_begin): Adjust.
2427 2022-06-29 Nathan Sidwell <nathan@acm.org>
2429 * module.cc (macro_info, macro_traits, macro_table,
2430 macro_remap): Rename to ...
2431 (macro_loc_info, macro_loc_traits, macro_loc_table,
2432 macro_loc_remap): ... these. Update all uses.
2433 (module_state::write_prepare_maps): Remove unneeded macro checking.
2434 (module_state::write_begin): Free macro_loc_remap.
2436 2022-06-27 Sergei Trofimovich <siarheit@google.com>
2439 * mapper-client.cc: Include <memory> via "system.h".
2440 * mapper-resolver.cc: Ditto.
2443 2022-06-27 David Malcolm <dmalcolm@redhat.com>
2445 * cxx-pretty-print.h: Add "final" and "override" to various vfunc
2446 implementations, removing redundant "virtual" as appropriate.
2447 * module.cc: Likewise.
2449 2022-06-24 Jason Merrill <jason@redhat.com>
2453 * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
2455 2022-06-24 Alexandre Oliva <oliva@adacore.com>
2457 * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
2459 2022-06-23 Jason Merrill <jason@redhat.com>
2462 * call.cc (build_aggr_conv): Don't depend on
2463 CONSTRUCTOR_IS_DESIGNATED_INIT.
2465 2022-06-23 Jason Merrill <jason@redhat.com>
2468 * decl.cc (reshape_init_array_1): Set
2469 CONSTRUCTOR_IS_DESIGNATED_INIT here.
2470 (reshape_init_class): And here.
2471 (reshape_init): Not here.
2473 2022-06-23 Patrick Palka <ppalka@redhat.com>
2476 * expr.cc (fold_for_warn): Don't fold when in an unevaluated
2479 2022-06-23 Patrick Palka <ppalka@redhat.com>
2482 * pt.cc (lookup_template_class): After calling complete_type for
2483 the substituted context, check the table again iff the type was
2484 previously incomplete and complete_type made it complete.
2486 2022-06-23 Jason Merrill <jason@redhat.com>
2489 * pt.cc (dependent_operand_p): Split out from...
2490 (tsubst_copy_and_build): ...here.
2491 (tsubst_expr) [IF_STMT]: Use it.
2492 * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
2493 condition in the template tree.
2495 2022-06-23 Jason Merrill <jason@redhat.com>
2498 * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
2499 comparison of dependent operands.
2501 2022-06-23 Nathan Sidwell <nathan@acm.org>
2503 * module.cc (struct macro_info): New.
2504 (struct macro_traits): New.
2505 (macro_remap, macro_table): New globals.
2506 (depset::hash::find_dependencies): Note namespace location.
2507 (module_for_macro_loc): Adjust.
2508 (module_state::note_location): New.
2509 (module_state::Write_location): Note location when not
2510 streaming. Adjust macro location streaming.
2511 (module_state::read_location): Adjust macro location
2513 (module_state::write_init_maps): New.
2514 (module_state::write_prepare_maps): Reimplement macro map
2516 (module_state::write_macro_maps): Reimplement.
2517 (module_state::read_macro_maps): Likewise.
2518 (module_state::write_begin): Adjust.
2520 2022-06-23 Jason Merrill <jason@redhat.com>
2522 * pt.cc (type_unification_real): An auto tparm can't
2523 be affected by other deductions.
2525 2022-06-23 Jason Merrill <jason@redhat.com>
2528 * pt.cc (type_dependent_expression_p): Look through BASELINK.
2530 2022-06-22 Jason Merrill <jason@redhat.com>
2533 * name-lookup.cc (outer_binding): Strip BASELINK.
2535 2022-06-22 Nathan Sidwell <nathan@acm.org>
2537 * module.cc (struct duplicate_hash): Remove.
2538 (duplicate_hash_map): Adjust.
2540 2022-06-22 Jason Merrill <jason@redhat.com>
2543 * constexpr.cc (cxx_eval_builtin_function_call): Handle
2544 unreachable/trap earlier.
2545 * cp-gimplify.cc (cp_maybe_instrument_return): Use
2546 build_builtin_unreachable.
2548 2022-06-18 Jakub Jelinek <jakub@redhat.com>
2550 * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
2551 flag_sanitize_trap & SANITIZE_VPTR instead of
2552 flag_sanitize_undefined_trap_on_error.
2554 2022-06-17 Jakub Jelinek <jakub@redhat.com>
2557 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
2558 instead of maybe_constant_value.
2560 2022-06-16 Nathan Sidwell <nathan@acm.org>
2562 * decl2.cc (finish_objects): Add startp parameter, adjust.
2563 (generate_ctor_or_dtor_function): Detect empty fn, and don't
2564 generate unnecessary code. Remove objc startup here ...
2565 (c_parse_final_cleanyps): ... do it here.
2567 2022-06-16 Martin Liska <mliska@suse.cz>
2569 * decl2.cc (struct priority_map_traits): Remove unused param.
2571 2022-06-15 Nathan Sidwell <nathan@acm.org>
2573 * module.cc (module_state::write_readme): Use less confusing
2574 importable unit names.
2576 2022-06-14 Nathan Sidwell <nathan@acm.org>
2578 * cp-tree.h (fini_modules): Add has_inits parm.
2579 * decl2.cc (c_parse_final_cleanups): Check for
2580 inits, adjust fini_modules flags.
2581 * module.cc (module_state): Rename call_init_p to
2583 (module_state::write_config): Write active_init.
2584 (module_state::read_config): Read it.
2585 (module_determine_import_inits): Clear active_init_p
2587 (late_finish_module): Add has_init parm. Record it.
2588 (fini_modules): Adjust.
2590 2022-06-13 Nathan Sidwell <nathan@acm.org>
2592 * module.cc (module_state::write): Separate to ...
2593 (module_state::write_begin, module_state::write_end): ...
2595 (module_state::write_readme): Drop extensions parameter.
2596 (struct module_processing_cookie): Add more fields.
2597 (finish_module_processing): Adjust state writing call.
2598 (late_finish_module): Call write_end.
2600 2022-06-10 Patrick Palka <ppalka@redhat.com>
2603 * decl.cc (typename_hasher::hash): Add extra overloads.
2604 Use iterative_hash_object instead of htab_hash_pointer.
2605 Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
2606 (build_typename_type): Use typename_hasher::hash.
2607 * pt.cc (spec_hasher::hash): Add two-parameter overload.
2608 Set comparing_specializations around the call to
2610 (iterative_hash_template_arg) <case TYPENAME_TYPE>:
2611 When comparing_specializations, hash the TYPE_CONTEXT
2612 and TYPENAME_TYPE_FULLNAME.
2613 (tsubst_function_decl): Use spec_hasher::hash instead of
2615 (tsubst_template_decl): Likewise.
2616 (tsubst_decl): Likewise.
2618 2022-06-10 Patrick Palka <ppalka@redhat.com>
2620 * pt.cc (instantiate_template): Don't substitute the context
2621 of the most general template if that of the partially
2622 instantiated template is already non-dependent.
2624 2022-06-10 Patrick Palka <ppalka@redhat.com>
2626 * pt.cc (lookup_template_class): Remove dead stores to
2627 context parameter. Don't substitute the context of the
2628 most general template if that of the partially instantiated
2629 template is already non-dependent. Check the specializations
2630 table again after completing the context of a nested dependent
2632 (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
2633 TYPE_CONTEXT or pass it to lookup_template_class.
2634 (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
2635 the TREE_TYPE for DECL_SELF_REFERENCE_P. Avoid template argument
2636 substitution or coercion in some cases.
2638 2022-06-10 Nathan Sidwell <nathan@acm.org>
2640 * cp-tree.h (fini_modules): Add some parameters.
2641 (finish_module_processing): Return an opaque pointer.
2642 * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
2643 finish_module_processing to fini_modules.
2644 * module.cc (struct module_processing_cookie): New.
2645 (finish_module_processing): Return a heap-allocated cookie.
2646 (late_finish_module): New. Finish out the module writing.
2647 (fini_modules): Adjust.
2649 2022-06-10 Nathan Sidwell <nathan@acm.org>
2651 * cp-tree.h (module_has_import_init): Rename to ...
2652 (module_determined_import_inits): ... here.
2653 * decl2.cc (start_objects): Do not handle module initializers
2655 (c_parse_final_cleanups): Generate a separate module
2656 initializer calling function and add it to the list. Shrink
2658 * module.cc (num_init_calls_needed): Delete.
2659 (module_has_import_init): Rename to ...
2660 (module_determined_import_inits): ... here. Do the
2661 calculation here ...
2662 (finish_module_processing): ... rather than here.
2663 (module_add_import_initializers): Reformat.
2665 2022-06-09 Jakub Jelinek <jakub@redhat.com>
2668 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
2669 non-integral result type use fold_ternary too like for BIT_FIELD_REFs
2670 from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant
2671 expression, set *non_constant_p and return t, instead of returning
2674 2022-06-09 Nathan Sidwell <nathan@acm.org>
2676 * cp-tree.h (module_initializer_kind): Replace with ...
2677 (module_global_init_needed, module_has_import_inits): ...
2679 * decl2.cc (start_objects): Add has_body parm. Reorganize
2680 module initializer creation.
2681 (generate_ctor_or_dtor_function): Adjust.
2682 (c_parse_final_cleanups): Adjust.
2683 (vtv_start_verification_constructor_init_function): Adjust.
2684 * module.cc (module_initializer_kind): Replace with ...
2685 (module_global_init_needed, module_has_import_inits): ...
2688 2022-06-08 Jason Merrill <jason@redhat.com>
2691 * decl.cc (duplicate_decls): Change non-templated friend
2693 * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
2694 on non-templated friends.
2695 (tsubst_friend_function): Adjust.
2697 2022-06-08 Jason Merrill <jason@redhat.com>
2701 * decl.cc (duplicate_decls): Avoid copying template info
2702 from non-templated friend even if newdecl isn't a definition.
2703 Correct handling of DECL_UNIQUE_FRIEND_P on templates.
2704 * pt.cc (non_templated_friend_p): New.
2705 * cp-tree.h (non_templated_friend_p): Declare it.
2707 2022-06-08 Nathan Sidwell <nathan@acm.org>
2709 * decl2.cc (struct priority_info_s, priority_info): Delete.
2710 (priority_map_traits, priority_map_t): New.
2711 (static_init_fini_fns): New.
2712 (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
2713 (initialize_p_decl, priority_decl): Delete.
2714 (ssdf_decls, priority_info_map): Delete.
2715 (start_static_storage_duration_function): Rename to ...
2716 (start_partial_init_fini_fn): ... here. Create a void arg fn.
2717 Add it to the slot in the appropriate static_init_fini_fns
2719 (finish_static_storage_duration_function): Rename to ...
2720 (finish_partial_init_fini_fn): ... here.
2721 (get_priority_info): Delete.
2722 (one_static_initialization_or_destruction): Assert not
2724 (do_static_initialization_or_destruction): Rename to ...
2725 (emit_partial_init_fini_fn) ... here. Start & finish the fn.
2726 Simply init/fini each var.
2727 (partition_vars_for_init_fini): Partition vars according to
2728 priority and add to init and/or fini list.
2729 (generate_ctor_or_dtor_function): Start and finish the function.
2730 Do santitizer calls here.
2731 (generate_ctor_and_dtor_functions_for_priority): Delete.
2732 (c_parse_final_cleanups): Reimplement global init/fini
2735 2022-06-07 Jakub Jelinek <jakub@redhat.com>
2737 * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
2738 style linear clause modifiers. Set
2739 OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
2740 old style modifiers are used.
2741 * semantics.cc (finish_omp_clauses): Only reject linear clause
2742 with val modifier on simd or for if the old style modifiers are
2745 2022-06-07 Roger Sayle <roger@nextmovesoftware.com>
2748 * decl.cc (start_enum): When emitting a "must be integral" error,
2749 set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
2750 downstream in build_enumeration.
2752 2022-06-06 Patrick Palka <ppalka@redhat.com>
2756 * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
2757 ADDR_EXPR callee when calling mark_used.
2759 2022-06-04 Marek Polacek <polacek@redhat.com>
2763 * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
2764 followed by [[]] attributes and vice versa.
2766 2022-06-03 Patrick Palka <ppalka@redhat.com>
2769 * typeck.cc (cp_build_binary_op): Don't fold operands
2770 when c_inhibit_evaluation_warnings.
2772 2022-06-03 Jason Merrill <jason@redhat.com>
2775 * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
2776 from a hidden friend.
2778 2022-06-03 Patrick Palka <ppalka@redhat.com>
2781 * tree.cc (maybe_dummy_object): When returning a dummy
2782 object, respect the cv-quals of 'this' if available.
2784 2022-06-03 Patrick Palka <ppalka@redhat.com>
2787 * pt.cc (determine_specialization): Compare overall constraints
2788 not just the trailing constraints.
2789 (tsubst_each_template_parm_constraints): Define.
2790 (tsubst_friend_function): Use it.
2791 (tsubst_friend_class): Use it.
2792 (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
2794 2022-06-03 Patrick Palka <ppalka@redhat.com>
2797 * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
2798 Don't walk DECL_CONTEXT.
2799 <case PARM_DECL>: Likewise. Walk TREE_TYPE.
2800 <case CONST_DECL>: Simplify.
2801 (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
2803 2022-06-02 Marek Polacek <polacek@redhat.com>
2805 * constexpr.cc (potential_constant_expression_1): Treat
2806 {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
2808 2022-06-02 Marek Polacek <polacek@redhat.com>
2811 * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
2814 2022-06-02 David Malcolm <dmalcolm@redhat.com>
2816 * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
2817 (cp_get_sarif_source_language): New.
2819 2022-06-02 Jason Merrill <jason@redhat.com>
2822 * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
2823 (cxx_eval_store_expression): Likewise.
2824 (cxx_eval_bare_aggregate): Handle null ctx->ctor.
2826 2022-06-02 Jason Merrill <jason@redhat.com>
2829 * constexpr.cc (cxx_eval_bare_aggregate): Always call
2832 2022-06-01 Jason Merrill <jason@redhat.com>
2835 * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
2836 if the expression has auto type.
2838 2022-06-01 Jason Merrill <jason@redhat.com>
2841 * call.cc (resolve_args): Call mark_single_function here.
2842 * pt.cc (unify_one_argument): Not here.
2844 2022-06-01 Nathan Sidwell <nathan@acm.org>
2846 * decl2.cc (fix_temporary_vars_context_r): Use data argument
2848 (one_static_initialization_or_destruction): Adjust tree walk
2849 call. Refactor guard generation.
2851 2022-06-01 Nathan Sidwell <nathan@acm.org>
2853 * decl2.cc (ssdf_decl): Delete global.
2854 (start_static_storage_duration_function): Use some RAII.
2855 (do_static_initialization_or_destruction): Likewise.
2856 (c_parse_final_cleanups): Likewise. Avoid rechecking 'vars'.
2858 2022-06-01 Nathan Sidwell <nathan@acm.org>
2860 * decl2.cc (start_objects): Replace 'method_type' parameter
2861 with 'initp' boolean, rename and retype 'priority' parameter.
2862 (finish_objects): Likewise. Do not expand here.
2863 (one_static_initialization_or_destruction): Move 'initp'
2865 (do_static_initialization_or_destruction): Likewise.
2866 (generate_ctor_or_dtor_function): Rename 'initp' parameter.
2867 Adjust start_objects/finish_obects calls and expand here.
2868 (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
2869 (c_parse_final_cleanups): Likewise.
2870 (vtv_start_verification_constructor_init): Adjust.
2871 (vtv_finish_verification_constructor_init): Use finish_objects.
2873 2022-05-31 Patrick Palka <ppalka@redhat.com>
2876 * call.cc (build_over_call): Use z_candidate::conversion_path
2877 and ::access_path instead of TYPE_BINFO when building the
2878 BASELINK for the templated form.
2880 2022-05-31 Patrick Palka <ppalka@redhat.com>
2882 * parser.cc: Use auto_timevar instead of timevar_push/pop.
2883 Remove wrapper functions.
2886 2022-05-31 Patrick Palka <ppalka@redhat.com>
2888 * cp-tree.h (cp_build_qualified_type_real): Rename to ...
2889 (cp_build_qualified_type): ... this. Give its last parameter
2890 a default argument. Remove macro of the same name.
2891 * decl.cc (grokdeclarator): Adjust accordingly.
2892 * pt.cc (tsubst_aggr_type): Likewise.
2893 (rebuild_function_or_method_type): Likewise.
2895 (maybe_dependent_member_ref): Likewise.
2897 * tree.cc (cp_build_qualified_type_real): Rename to ...
2898 (cp_build_qualified_type): ... this. Adjust accordingly.
2900 2022-05-31 Jason Merrill <jason@redhat.com>
2902 * Make-lang.in (c++.tags): Just look at *.cc.
2904 2022-05-31 Patrick Palka <ppalka@redhat.com>
2906 * cp-tree.h (comp_template_args): Change return type to bool.
2907 * pt.cc (comp_template_args): Document default arguments.
2908 Change return type to bool and adjust returns accordingly.
2910 2022-05-31 Patrick Palka <ppalka@redhat.com>
2912 * decl.cc (grokvardecl): Use current_template_constraints.
2913 (grokdeclarator): Likewise.
2914 (xref_tag): Likewise.
2915 * semantics.cc (finish_template_template_parm): Likewise.
2917 2022-05-31 Jakub Jelinek <jakub@redhat.com>
2919 * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
2922 2022-05-30 Marek Polacek <polacek@redhat.com>
2925 * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
2926 * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
2929 2022-05-28 Jakub Jelinek <jakub@redhat.com>
2931 * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
2932 seen first, use "%<to%>" or "%<enter%>" depending on
2933 OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
2934 "%<to%> or %<enter%>" wording.
2936 2022-05-28 Jason Merrill <jason@redhat.com>
2939 * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
2940 instantiate into a class-scope lambda.
2942 2022-05-27 Marek Polacek <polacek@redhat.com>
2945 * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
2947 2022-05-27 Jakub Jelinek <jakub@redhat.com>
2949 * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
2950 (cp_parser_omp_all_clauses): For to clause on declare target, use
2951 OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
2952 OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER.
2953 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
2954 (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
2955 OMP_CLAUSE_TO_DECLARE.
2956 * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
2957 of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
2958 name in diagnostics instead of
2959 omp_clause_code_name[OMP_CLAUSE_CODE (c)].
2961 2022-05-26 Marek Polacek <polacek@redhat.com>
2964 * typeck.cc (warn_for_null_address): Improve the warning when
2965 the POINTER_PLUS_EXPR's base is of reference type.
2967 2022-05-26 Patrick Palka <ppalka@redhat.com>
2970 * decl.cc (shadow_tag): Use the return value of
2971 maybe_process_partial_specialization.
2972 * parser.cc (cp_parser_single_declaration): Call shadow_tag
2973 before associate_classtype_constraints.
2974 * pt.cc (maybe_new_partial_specialization): Change return type
2975 to bool. Take 'type' argument by mutable reference. Set 'type'
2976 to point to the correct constrained specialization when
2978 (maybe_process_partial_specialization): Adjust accordingly.
2980 2022-05-25 Marek Polacek <polacek@redhat.com>
2983 * cp-tree.h (attr_chainon): Declare.
2984 * decl.cc (start_decl): Use attr_chainon.
2985 (grokdeclarator): Likewise.
2986 * parser.cc (cp_parser_statement): No longer static.
2988 2022-05-25 Jason Merrill <jason@redhat.com>
2991 * pt.cc (build_template_decl): Add assert.
2992 (tsubst_function_decl): Don't return a template.
2994 2022-05-25 Jason Merrill <jason@redhat.com>
2997 * decl2.cc (mark_used): Copy type from fn to BASELINK.
2998 * pt.cc (unify_one_argument): Call mark_single_function.
3000 2022-05-25 Jason Merrill <jason@redhat.com>
3002 * constexpr.cc (cxx_eval_call_expression): Check for
3003 heap vars in the result.
3005 2022-05-25 Jason Merrill <jason@redhat.com>
3007 * constexpr.cc (maybe_constant_init_1): Only pass false for
3008 strict when initializing a variable of static duration.
3010 2022-05-25 Marek Polacek <polacek@redhat.com>
3013 * typeck2.cc (potential_prvalue_result_of): New.
3014 (replace_placeholders_for_class_temp_r): New.
3015 (digest_nsdmi_init): Call it.
3017 2022-05-24 Jason Merrill <jason@redhat.com>
3019 * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
3020 (cxx_eval_call_expression): Call it.
3021 (cxx_fold_indirect_ref_1): Handle null empty_base.
3023 2022-05-24 Jason Merrill <jason@redhat.com>
3025 * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
3026 from int to value_cat. Change most false to vc_prvalue, most true
3027 to vc_glvalue, cases where the return value is ignored to
3029 (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
3030 (cxx_eval_store_expression): Only build _REF for vc_glvalue.
3031 (cxx_eval_array_reference, cxx_eval_component_reference)
3032 (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
3034 2022-05-24 Jason Merrill <jason@redhat.com>
3037 * constexpr.cc (cxx_eval_store_expression): Adjust assert.
3038 Use initialized_type.
3040 2022-05-24 Patrick Palka <ppalka@redhat.com>
3042 * cp-tree.h (any_template_arguments_need_structural_equality_p):
3044 * pt.cc (struct ctp_hasher): Define.
3045 (ctp_table): Define.
3046 (canonical_type_parameter): Use it.
3047 (process_template_parm): Set TYPE_CANONICAL for
3048 TEMPLATE_TEMPLATE_PARM too.
3049 (lookup_template_class_1): Remove now outdated comment for the
3050 any_template_arguments_need_structural_equality_p test.
3051 (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
3052 clear TYPE_CANONICAL for ttps. Set TYPE_CANONICAL on the
3053 substituted type later.
3054 (any_template_arguments_need_structural_equality_p): Return
3055 true for any_targ_node. Don't return true just because a
3056 template argument uses structural equality. Add comment for
3057 the PARM_DECL special case.
3058 (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
3060 * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
3062 * typeck.cc (structural_comptypes) [check_alias]: Increment
3063 processing_template_decl before checking
3064 dependent_alias_template_spec_p.
3066 2022-05-24 Jakub Jelinek <jakub@redhat.com>
3069 * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
3071 2022-05-20 David Malcolm <dmalcolm@redhat.com>
3073 * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
3074 "final" and "override".
3075 * error.cc: Likewise.
3077 2022-05-18 Marek Polacek <polacek@redhat.com>
3080 * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
3082 2022-05-17 Jason Merrill <jason@redhat.com>
3085 * decl.cc (check_initializer): Use build_cplus_new in case of
3088 2022-05-17 Jakub Jelinek <jakub@redhat.com>
3090 * parser.cc (cp_parser_omp_clause_depend): Parse
3091 inoutset depend-kind.
3092 (cp_parser_omp_depobj): Likewise.
3093 * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
3094 OMP_CLAUSE_DEPEND_INOUTSET.
3096 2022-05-16 Martin Liska <mliska@suse.cz>
3098 * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
3099 * name-lookup.cc (get_std_name_hint): Likewise.
3100 * parser.cc (cp_parser_new): Likewise.
3102 2022-05-16 Marcel Vollweiler <marcel@codesourcery.com>
3104 * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
3105 * semantics.cc (finish_omp_clauses): Added template decl processing.
3107 2022-05-15 Jason Merrill <jason@redhat.com>
3111 * friend.cc (is_friend): Hidden friends count as members.
3112 * search.cc (friend_accessible_p): Likewise.
3114 2022-05-15 Jason Merrill <jason@redhat.com>
3116 * parser.cc (cp_parser_template_name): Look through
3117 injected-class-name.
3119 2022-05-15 Jason Merrill <jason@redhat.com>
3124 * init.cc (build_value_init): Handle class in template.
3126 2022-05-13 Nathan Sidwell <nathan@acm.org>
3128 * mangle.cc (maybe_write_module): Check external linkage.
3130 2022-05-13 Richard Biener <rguenther@suse.de>
3132 * constexpr.cc: Remove gimple-fold.h include.
3134 2022-05-12 Patrick Palka <ppalka@redhat.com>
3136 * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
3137 TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
3138 * pt.cc (try_class_unification): Correctly copy multidimensional
3139 targs. Free the copy of targs.
3140 (unify_pack_expansion): Fix level comparison.
3142 2022-05-12 Nathan Sidwell <nathan@acm.org>
3144 * parser.cc (cp_parser_linkage_specification): Implement
3145 global module attachment semantics.
3147 2022-05-12 Jakub Jelinek <jakub@redhat.com>
3149 * lex.cc (init_reswords): Register omp_all_memory as keyword
3151 * parser.cc (cp_parser_primary_expression): Diagnose uses of
3152 omp_all_memory in postfix expressions.
3153 (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
3155 * semantics.cc (finish_omp_clauses): Handle omp_all_memory
3156 keyword in depend clause as null_pointer_node, diagnose invalid
3158 * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
3160 2022-05-11 Patrick Palka <ppalka@redhat.com>
3162 * constraint.cc (tsubst_parameter_mapping): Convert loop over
3163 TREE_VEC into a range-based for loop using tree_vec_range.
3164 * pt.cc (iterative_hash_template_arg): Likewise.
3165 (template_parms_level_to_args): Likewise.
3166 (deducible_template_args): Likewise.
3167 (check_undeduced_parms): Likewise.
3168 (dependent_type_p_r): Likewise.
3169 (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
3171 (dependent_template_arg_p): Likewise.
3172 * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
3175 2022-05-11 Jason Merrill <jason@redhat.com>
3178 * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
3179 * parser.cc (cp_parser_enclosed_template_argument_list):
3180 Use 0-length TREE_VEC for <>.
3182 2022-05-11 Jason Merrill <jason@redhat.com>
3185 * typeck.cc (check_return_expr): Don't mess with ctor return value
3186 while parsing a template.
3188 2022-05-11 Nathan Sidwell <nathan@acm.org>
3190 * cp-tree.h (DECL_MODULE_ATTACH_P): New.
3191 (struct lang_decl_base): Add module_attach_p flag.
3192 * decl.cc (duplicate_decls): Rework module redeclaration
3194 * module.cc (trees_out::lang_decl_bools): Write attach flag.
3195 (trees_in::lang_decl_bools): ... and read it back.
3196 (trees_out::decl_value): Rework module attachment handling.
3197 (trees_in::decl_value): Rename local var to reflect meaning.
3198 (trees_in::key_mergeable): Likewise.
3199 (get_originating_module): Use DECL_MODULE_ATTACH_P. No need
3200 to special-case mangling.
3201 (module_may_redeclare): Reimplement.
3202 (set_originating_module): Deal with attachment.
3203 * name-lookup.cc (maybe_record_mergeable_decl): Deal with
3205 (mergeable_namespace_slots): Likewise.
3206 (do_nonmember_using_decl): Likewise.
3207 * name-lookup.h (mergeable_namespace_slots): Adjust parm
3209 * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
3211 2022-05-11 Martin Liska <mliska@suse.cz>
3214 * lang-specs.h: Use Separate syntax.
3216 2022-05-10 Patrick Palka <ppalka@redhat.com>
3218 * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
3219 * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
3220 * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
3221 (SET_ARGUMENT_PACK_ARGS): Remove.
3222 * module.cc (trees_in::tree_node): Adjust accordingly.
3223 * parser.cc (make_char_string_pack): Likewise.
3224 (make_string_pack): Likewise.
3225 * pt.cc (make_pack_expansion): Likewise.
3226 (template_parm_to_arg): Likewise.
3227 (coerce_template_parameter_pack): Likewise.
3228 (extract_fnparm_pack): Likewise.
3229 (extract_locals_r): Likewise.
3230 (make_argument_pack): Likewise.
3231 (tsubst_argument_pack): Likewise.
3232 (lookup_init_capture_pack): Likewise.
3233 (type_unification_real): Likewise.
3234 (unify_pack_expansion): Likewise.
3235 (tsubst_initializer_list): Likewise.
3237 2022-05-10 Patrick Palka <ppalka@redhat.com>
3239 * cp-tree.h (PACK_EXPANSION_CHECK): Define.
3240 (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
3241 (SET_PACK_EXPANSION_PATTERN): Likewise.
3242 (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
3243 (PACK_EXPANSION_EXTRA_ARGS): Likewise.
3244 (PACK_EXPANSION_LOCAL_P): Likewise.
3245 (PACK_EXPANSION_SIZEOF_P): Likewise.
3246 (PACK_EXPANSION_AUTO_P): Likewise.
3247 (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
3248 (ARGUMENT_PACK_CHECK): Define.
3249 (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
3250 (SET_ARGUMENT_PACK_ARGS): Likewise.
3251 * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
3252 before setting PACK_EXPANSION_SIZEOF_P.
3254 2022-05-10 Nathan Sidwell <nathan@acm.org>
3256 * cp-tree.h (enum module_kind_bits): Disambiguate purview,
3257 attach, named module vs header-unit.
3258 (global_purview_p, not_module_p): Delete.
3259 (named_module_p): New.
3260 (header_module_p, module_purview_p): Adjust.
3261 (module_attach_p, named_module_purview_p): New.
3262 * decl.cc (duplicate_decls): Adjust.
3263 * module.cc (declare_module, preprocessed_module): Adjust.
3264 * name-lookup.cc (init_global_partition): Adjust.
3265 (get_fixed_binding_slot, pushdecl): Adjust.
3266 * parser.cc (cp_parser_module_declaration): Adjust.
3267 (cp_parser_import_declaration, cp_parser_declaration): Adjust.
3269 2022-05-10 Jason Merrill <jason@redhat.com>
3272 * decl.cc (maybe_return_this): Replace...
3273 (finish_constructor_body, finish_destructor_body): ...these.
3274 (finish_function_body): Call it.
3275 * optimize.cc (build_delete_destructor_body): Call it.
3276 * cp-tree.h (maybe_return_this): Declare.
3278 2022-05-09 Marek Polacek <polacek@redhat.com>
3281 * parser.cc (cp_parser_statement): Constify the in_compound parameter.
3282 Create a modifiable copy. Allow labels at the end of compound
3285 2022-05-09 Patrick Palka <ppalka@redhat.com>
3288 * call.cc (field_in_pset): Adjust after next_initializable_field
3290 (build_aggr_conv): Likewise.
3291 (convert_like_internal): Likewise.
3292 (type_has_extended_temps): Likewise.
3293 * class.cc (default_init_uninitialized_part): Likewise.
3294 (finish_struct): Likewise.
3295 * constexpr.cc (cx_check_missing_mem_inits): Likewise.
3296 (reduced_constant_expression_p): Use next_subobject_field
3298 * cp-gimplify.cc (get_source_location_impl_type): Adjust after
3299 next_initializable_field renaming.
3300 (fold_builtin_source_location): Likewise.
3301 * cp-tree.h (next_initializable_field): Rename to ...
3302 (next_aggregate_field): ... this.
3303 (next_subobject_field): Declare.
3304 * decl.cc (next_aggregate_field): Renamed from ...
3305 (next_initializable_field): ... this. Skip over vptr fields
3307 (next_subobject_field): Define.
3308 (reshape_init_class): Adjust after next_initializable_field
3310 * init.cc (build_value_init_noctor): Likewise.
3311 (emit_mem_initializers): Likewise.
3312 * lambda.cc (build_capture_proxy): Likewise.
3313 * method.cc (build_comparison_op): Likewise.
3314 * pt.cc (maybe_aggr_guide): Likewise.
3315 * tree.cc (structural_type_p): Likewise.
3316 * typeck2.cc (split_nonconstant_init_1): Likewise.
3317 (digest_init_r): Likewise.
3319 2022-05-09 Nathan Sidwell <nathan@acm.org>
3321 * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
3322 DECL_MODULE_ATTACHMENTS_P.
3323 (struct lane_decl_base): Rename module_attached_p to
3324 module_keyed_decls_p.
3325 (maybe_key_decl): Renamed from maybe_attach_decl.
3326 * lambda.cc (record_lambda_scope): Adjust.
3327 * lex.cc (cxx_dup_lang_specific_decl): Adjust.
3328 * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
3330 (enum merge_kind): Rename MK_attached to MK_keyed.
3331 (trees_out::lang_decl_bools): Adjust.
3332 (trees_in::lang_decl_bools): Adjust.
3333 (trees_in::decl_value): Adjust.
3334 (trees_out::get_merge_kind): Adjust.
3335 (trees_out::key_mergeable): Adjust.
3336 (trees_in::key_mergeable): Adjust.
3337 (maybe_key_decl): Rename from maybe_attach_decl.
3338 (direct_import): Adjust.
3339 (fini_modules): Adjust.
3341 2022-05-09 Martin Liska <mliska@suse.cz>
3343 * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
3345 * parser.cc (cp_finalize_omp_declare_simd): Likewise.
3346 (cp_finalize_oacc_routine): Likewise.
3348 2022-05-07 Marek Polacek <polacek@redhat.com>
3352 * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
3354 2022-05-06 Jason Merrill <jason@redhat.com>
3356 * error.cc (decl_to_string): Add show_color parameter.
3357 (subst_to_string): Likewise.
3358 (cp_printer): Pass it.
3359 (type_to_string): Set pp_show_color.
3360 (dump_function_name): Use "fnname" color.
3361 (dump_template_bindings): Use "targs" color.
3362 (struct colorize_guard): New.
3363 (reinit_cxx_pp): Clear pp_show_color.
3365 2022-05-06 Jason Merrill <jason@redhat.com>
3369 * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
3372 2022-05-05 Marek Polacek <polacek@redhat.com>
3375 * parser.cc (cp_parser_parameter_declaration_clause): Maintain
3376 a vector of parameters that haven't been pushed yet. Push them at the
3377 end of a valid parameter-declaration-clause.
3378 (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
3379 Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
3380 would result in a hard error.
3381 (cp_parser_cache_defarg): Adjust the call to
3382 cp_parser_parameter_declaration_list.
3384 2022-05-05 Richard Biener <rguenther@suse.de>
3386 * module.cc (trees_in::core_vals): Remove separate allocation
3389 2022-05-04 Jason Merrill <jason@redhat.com>
3392 * pt.cc (maybe_dependent_member_ref): Handle types.
3393 (tsubst, tsubst_copy): Use it.
3394 (tsubst_aggr_type, instantiate_alias_template): Don't handle
3397 2022-05-04 Patrick Palka <ppalka@redhat.com>
3400 * pt.cc (maybe_aggr_guide): Set processing_template_decl when
3401 partially instantiating the guide's parameter list.
3403 2022-05-04 Marek Polacek <polacek@redhat.com>
3406 * parser.cc (cp_parser_init_declarator): Properly handle a series of
3407 operator() calls, they are not part of an init-declarator.
3409 2022-05-04 Jason Merrill <jason@redhat.com>
3411 * decl.cc (reshape_init): Shortcut already-reshaped init.
3412 (reshape_init_class): Assert not getting one here.
3414 2022-05-04 Jason Merrill <jason@redhat.com>
3416 * error.cc (cp_print_error_function): Use %qD.
3417 (function_category): Use %qD.
3419 2022-05-04 Marek Polacek <polacek@redhat.com>
3422 * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
3423 return true for CPP_GREATER_EQ.
3425 2022-05-04 Jason Merrill <jason@redhat.com>
3427 * cp-tree.h (struct language_function): Remove x_cdtor_label.
3428 (cdtor_label, LABEL_DECL_CDTOR): Remove.
3429 * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
3430 (cxx_eval_constant_expression): Don't call returns.
3431 * decl.cc (check_goto): Don't check cdtor_label.
3432 (start_preparsed_function): And don't set it.
3433 (finish_constructor_body, finish_destructor_body): Remove.
3434 (finish_function_body): Don't call them.
3435 * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
3436 * semantics.cc (finish_return_stmt): Not here.
3438 2022-05-04 Jakub Jelinek <jakub@redhat.com>
3440 * lambda.cc: Include decl.h.
3441 (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
3442 UNAVAILABLE_DEPRECATED_SUPPRESS.
3444 2022-05-03 Patrick Palka <ppalka@redhat.com>
3447 * cp-tree.h (finish_non_static_data_member): Add defaulted
3449 * pt.cc (tsubst_copy_and_build): Pass complain to
3450 finish_non_static_data_member.
3451 * semantics.cc (finish_non_static_data_member): Respect complain
3453 (finish_qualified_id_expr): Pass complain to
3454 finish_non_static_data_member.
3456 2022-05-02 Jason Merrill <jason@redhat.com>
3458 * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
3459 (do_auto_deduction): Use expr location.
3461 2022-05-02 Jason Merrill <jason@redhat.com>
3463 * class.cc (maybe_note_name_used_in_class): Note in all enclosing
3464 classes. Remember location of use.
3465 (note_name_declared_in_class): Adjust.
3467 2022-05-02 Marek Polacek <polacek@redhat.com>
3469 * cp-tree.h (uses_template_parms): Adjust declaration.
3470 * pt.cc (uses_template_parms): Return bool. Use a RAII sentinel.
3472 2022-05-02 Richard Biener <rguenther@suse.de>
3474 * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
3475 * cp-gimplify.cc (cp_fold): Likewise.
3476 * pt.cc (tsubst_copy): Likewise.
3478 2022-04-29 Jason Merrill <jason@redhat.com>
3482 * friend.cc (do_friend): Call check_explicit_specialization here.
3483 * decl.cc (grokdeclarator): Not here.
3484 * decl2.cc (check_classfn): Or here.
3486 2022-04-29 Jason Merrill <jason@redhat.com>
3489 * cp-tree.h (enum tsubst_flags): Add tf_dguide.
3490 * pt.cc (tsubst_aggr_type): Check it.
3491 (tsubst_baselink, tsubst_copy): Check it.
3492 (maybe_dependent_member_ref): Check it.
3493 (instantiate_alias_template): Handle it.
3494 (build_deduction_guide): Set it.
3496 2022-04-29 Jason Merrill <jason@redhat.com>
3499 * lambda.cc (type_deducible_expression_p): Allow more types.
3501 2022-04-29 Jason Merrill <jason@redhat.com>
3503 * decl.cc (cp_finish_decl): Only consider auto for vars.
3505 2022-04-29 Marek Polacek <polacek@redhat.com>
3508 * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
3509 only when it's followed by a semicolon.
3511 2022-04-29 Jason Merrill <jason@redhat.com>
3514 * decl.cc (cp_finish_decl): Check completeness of deduced type.
3516 2022-04-29 Jason Merrill <jason@redhat.com>
3519 * error.cc (dump_decl) [USING_DECL]: Respect flags.
3521 2022-04-29 Jason Merrill <jason@redhat.com>
3523 * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
3525 2022-04-29 Jakub Jelinek <jakub@redhat.com>
3528 * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
3529 after a type id by setting maybe_type_id and aborting tentative
3531 (cp_parser_enclosed_template_argument_list): Handle
3532 CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
3533 CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
3534 or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
3535 (cp_parser_next_token_ends_template_argument_p): Return true
3536 also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
3538 2022-04-29 Iain Sandoe <iain@sandoe.co.uk>
3541 * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
3542 temporaries to coroutine frame copies.
3544 2022-04-29 Jason Merrill <jason@redhat.com>
3546 * semantics.cc (check_trait_type): Don't check completeness
3547 of element type of array of unknown bound.
3549 2022-04-29 Jason Merrill <jason@redhat.com>
3553 * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
3554 (emit_tinfo_decl): Update tdesc type if needed.
3556 2022-04-29 Zhao Wei Liew <zhaoweiliew@gmail.com>
3559 * call.cc (extract_call_expr): Return a NULL_TREE on failure
3560 instead of asserting.
3561 (build_new_method_call): Suppress -Wparentheses diagnostic for
3563 * semantics.cc (is_assignment_op_expr_p): Add function to check
3564 if an expression is a call to an op= operator expression.
3565 (maybe_convert_cond): Handle the case of a op= operator expression
3566 for the -Wparentheses diagnostic.
3568 2022-04-28 Patrick Palka <ppalka@redhat.com>
3571 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
3572 DEPENDENT_OPERATOR_TYPE like an empty type.
3574 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3577 * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
3578 non-target expression inputs.
3580 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3583 * coroutines.cc (coro_promise_type_found_p): Account for possible
3584 mutliple overloads of the promise return_value() method.
3586 2022-04-28 Iain Sandoe <iain@sandoe.co.uk>
3589 * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
3590 are added to the bind expr.
3591 (add_var_to_bind): Fix local var naming to use portable punctuation.
3592 (register_local_var_uses): Do not add synthetic names to unnamed
3595 2022-04-28 Nathan Sidwell <nathan@acm.org>
3596 Iain Sandoe <iain@sandoe.co.uk>
3599 * coroutines.cc (finish_co_await_expr): Do not process non-dependent
3600 coroutine expressions at template definition time.
3601 (finish_co_yield_expr): Likewise.
3602 (finish_co_return_stmt): Likewise.
3604 2022-04-28 Marek Polacek <polacek@redhat.com>
3607 * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
3610 2022-04-27 Jason Merrill <jason@redhat.com>
3612 * tree.cc (strip_typedefs): Add default argument comments.
3614 2022-04-27 Marek Polacek <polacek@redhat.com>
3617 * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
3619 2022-04-26 Jason Merrill <jason@redhat.com>
3622 * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
3623 TEMPLATE_TYPE_PARAMETER_PACK on auto.
3625 2022-04-26 Patrick Palka <ppalka@redhat.com>
3628 * semantics.cc (finish_decltype_type): Pass tf_decltype to
3629 instantiate_non_dependent_expr_sfinae.
3631 2022-04-26 Jason Merrill <jason@redhat.com>
3634 * pt.cc (check_for_bare_parameter_packs): Check for lambda
3635 function parameter pack.
3637 2022-04-26 Patrick Palka <ppalka@redhat.com>
3641 * pt.cc (process_partial_specialization): Downgrade "partial
3642 specialization isn't more specialized" diagnostic from permerror
3643 to an on-by-default pedwarn.
3644 (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
3645 NTTP type a second time, use the original type not the
3648 2022-04-25 Marek Polacek <polacek@redhat.com>
3651 * typeck.cc (build_x_shufflevector): Use
3652 instantiation_dependent_expression_p except for the first two
3655 2022-04-21 Marek Polacek <polacek@redhat.com>
3657 * constexpr.cc (cxx_eval_logical_expression): Remove unused
3659 (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
3660 <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
3662 2022-04-21 Marek Polacek <polacek@redhat.com>
3665 * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
3666 to cxx_eval_constant_expression.
3668 2022-04-20 Ed Catmur <ed@catmur.uk>
3671 * call.cc (compare_ics): When comparing list-initialization
3672 sequences, do not return early.
3674 2022-04-19 Jakub Jelinek <jakub@redhat.com>
3677 * typeck2.cc (process_init_constructor_array,
3678 process_init_constructor_record, process_init_constructor_union): Move
3679 CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
3680 containing CONSTRUCTOR.
3682 2022-04-15 Marek Polacek <polacek@redhat.com>
3685 * parser.cc (cp_parser_placeholder_type_specifier): Return
3686 error_mark_node when trying to build up a constrained parameter in
3689 2022-04-15 Jason Merrill <jason@redhat.com>
3692 * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
3694 2022-04-15 Jason Merrill <jason@redhat.com>
3697 * error.cc (dump_expr): Handle USING_DECL.
3698 [VIEW_CONVERT_EXPR]: Just look through location wrapper.
3700 2022-04-14 Jason Merrill <jason@redhat.com>
3703 * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
3704 checks for defaulted ctors.
3706 2022-04-14 Jason Merrill <jason@redhat.com>
3709 * lambda.cc (type_deducible_expression_p): New.
3710 (lambda_capture_field_type): Check it.
3712 2022-04-14 Jason Merrill <jason@redhat.com>
3715 * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
3717 2022-04-14 Jason Merrill <jason@redhat.com>
3720 * name-lookup.cc (dependent_local_decl_p): New.
3721 * cp-tree.h (dependent_local_decl_p): Declare.
3722 * semantics.cc (finish_call_expr): Use it.
3723 * pt.cc (tsubst_arg_types): Also substitute default args
3726 2022-04-14 Jason Merrill <jason@redhat.com>
3729 * pt.cc (tsubst_baselink): Also check dependent optype.
3731 2022-04-14 Jason Merrill <jason@redhat.com>
3734 * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
3735 * init.cc (perform_member_init): Likewise.
3736 * semantics.cc (push_cleanup): Adjust comment.
3738 2022-04-13 Jason Merrill <jason@redhat.com>
3742 * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
3743 as needed in empty base handling.
3745 2022-04-13 Jakub Jelinek <jakub@redhat.com>
3748 * decl2.cc (cp_check_const_attributes): For aligned attribute
3749 pass manifestly_const_eval=true to fold_non_dependent_expr.
3751 2022-04-13 Marek Polacek <polacek@redhat.com>
3754 * call.cc (direct_reference_binding): strip_top_quals when creating
3757 2022-04-12 Jason Merrill <jason@redhat.com>
3760 * decl.cc (decls_match): Compare versions even if not recording.
3761 (duplicate_decls): Propagate attributes to alias.
3762 * decl2.cc (find_last_decl): Give up if versioned.
3764 2022-04-12 Jason Merrill <jason@redhat.com>
3767 * init.cc (build_new_1): Check array_p for alignment.
3769 2022-04-12 Patrick Palka <ppalka@redhat.com>
3772 * pt.cc (build_extra_args): Call preserve_args.
3774 2022-04-12 Jason Merrill <jason@redhat.com>
3777 * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
3779 2022-04-12 Jason Merrill <jason@redhat.com>
3783 * class.cc (finish_struct): Always using op=.
3785 2022-04-11 Jason Merrill <jason@redhat.com>
3788 * call.cc (build_operator_new_call): Just look in ::.
3790 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3792 * constexpr.cc (cxx_eval_call_expression): Disregard dtor
3795 2022-04-11 Alexandre Oliva <oliva@adacore.com>
3797 * semantics.cc (set_cleanup_locs): Propagate locus to call
3798 wrapped in cast-to-void.
3800 2022-04-11 Jason Merrill <jason@redhat.com>
3803 * init.cc (warn_placement_new_too_small): Check deref.
3805 2022-04-09 Jason Merrill <jason@redhat.com>
3809 * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
3810 * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
3811 for non-aggregate types.
3812 (build_vec_init_expr): Also check constancy of explicit
3813 initializer elements.
3815 2022-04-09 Jason Merrill <jason@redhat.com>
3819 * name-lookup.cc (set_decl_namespace): Set
3820 DECL_IMPLICIT_INSTANTIATION if no non-template match.
3821 * pt.cc (check_explicit_specialization): Check it.
3822 * decl2.cc (check_classfn): Call it.
3824 2022-04-07 Patrick Palka <ppalka@redhat.com>
3827 * name-lookup.cc (name_lookup::using_queue): Change to an
3828 auto_vec (with 16 elements of internal storage).
3829 (name_lookup::queue_namespace): Change return type to void,
3830 take queue parameter by reference and adjust function body
3832 (name_lookup::do_queue_usings): Inline into ...
3833 (name_lookup::queue_usings): ... here. As in queue_namespace.
3834 (name_lookup::search_unqualified): Don't make queue static,
3835 remove length variable, and adjust function body accordingly.
3837 2022-04-07 Jakub Jelinek <jakub@redhat.com>
3839 PR tree-optimization/102586
3840 * cp-objcp-common.h (cp_classtype_as_base): Declare.
3841 (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
3842 * cp-objcp-common.cc (cp_classtype_as_base): New function.
3844 2022-04-07 Jason Merrill <jason@redhat.com>
3847 * decl.cc (grokdeclarator): Reject conversion with trailing return
3850 2022-04-07 Jason Merrill <jason@redhat.com>
3853 * lambda.cc (lambda_expr_this_capture): Check all enclosing
3854 lambdas for completeness.
3856 2022-04-07 Jason Merrill <jason@redhat.com>
3859 * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
3862 2022-04-06 Jakub Jelinek <jakub@redhat.com>
3865 * decl2.cc (splice_template_attributes): Return NULL if *p is
3867 (cplus_decl_attributes): Return early if attributes is
3868 error_mark_node. Don't check that later.
3870 2022-04-06 Patrick Palka <ppalka@redhat.com>
3873 * pt.cc (do_class_deduction): Check complain before attempting
3874 to issue a -Wctad-maybe-unsupported warning.
3876 2022-04-06 Jason Merrill <jason@redhat.com>
3879 * init.cc (build_vec_init): Use a reference for the result.
3881 2022-04-06 Jason Merrill <jason@redhat.com>
3884 * name-lookup.cc (check_local_shadow): Use -Wshadow=local
3885 if exactly one of 'old' and 'decl' is a type.
3887 2022-04-05 Jason Merrill <jason@redhat.com>
3891 * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
3893 2022-04-05 Jason Merrill <jason@redhat.com>
3896 * name-lookup.h (struct cp_binding_level): Add requires_expression
3898 * parser.cc (cp_parser_requires_expression): Set it.
3899 (synthesize_implicit_template_parm): Check it.
3901 2022-04-04 Jason Merrill <jason@redhat.com>
3904 * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
3906 2022-04-04 Jason Merrill <jason@redhat.com>
3910 * pt.cc (get_underlying_template): Compare default template args.
3912 2022-04-03 Benno Evers <benno.evers@tenzir.com>
3913 Iain Sandoe <iain@sandoe.co.uk>
3916 * coroutines.cc (morph_fn_to_coro): Reset
3917 current_binding_level->blocks.
3919 2022-04-01 Jason Merrill <jason@redhat.com>
3922 2022-03-31 Jason Merrill <jason@redhat.com>
3925 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3926 (cp_parser_member_declaration): Call it.
3928 2022-04-01 Jason Merrill <jason@redhat.com>
3931 2022-03-24 Jason Merrill <jason@redhat.com>
3934 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3935 * class.cc (type_has_default_ctor_to_be_synthesized): New.
3936 (type_has_non_user_provided_default_constructor_1): Support it.
3937 (type_has_non_user_provided_default_constructor): Now a wrapper.
3938 * method.cc (complain_about_unparsed_dmi): New.
3939 (constructible_expr): Call it.
3941 2022-04-01 Patrick Palka <ppalka@redhat.com>
3944 * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
3945 the argument type of an NTTP before deducing from it.
3947 2022-03-31 Jason Merrill <jason@redhat.com>
3950 * parser.cc (cp_parser_early_parsing_nsdmi): New.
3951 (cp_parser_member_declaration): Call it.
3953 2022-03-30 Patrick Palka <ppalka@redhat.com>
3956 * constraint.cc (diagnose_trait_expr): Handle all remaining
3957 traits appropriately. Remove default case.
3959 2022-03-30 Marek Polacek <polacek@redhat.com>
3963 * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
3965 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3968 * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
3969 DECL_CONTEXT of the iterator var to current_function_decl and
3972 2022-03-30 Jakub Jelinek <jakub@redhat.com>
3975 * parser.cc (cp_parser_template_introduction): If member_p, temporarily
3976 clear parser->colon_corrects_to_scope_p around tentative parsing of
3977 nested name specifier.
3979 2022-03-28 Jason Merrill <jason@redhat.com>
3981 * pt.cc (determine_specialization): Add comment.
3983 2022-03-28 Patrick Palka <ppalka@redhat.com>
3986 * pt.cc (finish_concept_definition): Check that a concept is
3987 declared with exactly one template parameter list.
3989 2022-03-28 Patrick Palka <ppalka@redhat.com>
3992 * constraint.cc (maybe_substitute_reqs_for): Don't assume
3993 DECL_TEMPLATE_INFO is available.
3995 2022-03-28 Jason Merrill <jason@redhat.com>
4000 * pt.cc (complex_alias_template_r): walk_tree callback, replacing
4001 uses_all_template_parms_r, complex_pack_expansion_r.
4002 (complex_alias_template_p): Adjust.
4003 * tree.cc (strip_typedefs): Revert r12-7710 change.
4005 2022-03-28 Jason Merrill <jason@redhat.com>
4008 * init.cc (build_new_1): Include cookie in alignment. Omit
4009 constexpr wrapper from alloc_call.
4011 2022-03-28 Jason Merrill <jason@redhat.com>
4014 * name-lookup.cc (push_local_extern_decl_alias): Call
4015 determine_visibility.
4017 2022-03-28 Jason Merrill <jason@redhat.com>
4020 * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
4021 a type template reference.
4023 2022-03-28 Jason Merrill <jason@redhat.com>
4026 * pt.cc (value_dependent_expression_p): Check
4027 has_value_dependent_address for conversion to reference.
4029 2022-03-28 Jason Merrill <jason@redhat.com>
4032 * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
4034 (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
4036 2022-03-28 Jason Merrill <jason@redhat.com>
4039 * call.cc (make_base_init_ok): Call make_used.
4041 2022-03-28 Jason Merrill <jason@redhat.com>
4044 * mangle.cc (write_expression): Don't write a union designator when
4047 2022-03-28 Jason Merrill <jason@redhat.com>
4051 * tree.cc (strip_typedefs): Use build_distinct_type_copy.
4053 2022-03-26 Patrick Palka <ppalka@redhat.com>
4056 * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
4057 Clarify error message when a if-stmt is non-constant because its
4058 branches are non-constant.
4060 2022-03-26 Patrick Palka <ppalka@redhat.com>
4063 * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
4064 CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
4066 2022-03-26 Jakub Jelinek <jakub@redhat.com>
4068 * parser.cc (cp_parser_postfix_expression)
4069 <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
4070 return cp_build_{vec,convert,bit_cast} result right away, instead
4071 set postfix_expression to it and break.
4073 2022-03-25 Marek Polacek <polacek@redhat.com>
4076 * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
4077 (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
4080 2022-03-24 Marek Polacek <polacek@redhat.com>
4083 * decl.cc (check_initializer): Don't call build_aggr_init in
4086 2022-03-24 Jason Merrill <jason@redhat.com>
4089 * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
4090 * class.cc (type_has_default_ctor_to_be_synthesized): New.
4091 (type_has_non_user_provided_default_constructor_1): Support it.
4092 (type_has_non_user_provided_default_constructor): Now a wrapper.
4093 * method.cc (complain_about_unparsed_dmi): New.
4094 (constructible_expr): Call it.
4096 2022-03-24 Marek Polacek <polacek@redhat.com>
4099 * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
4101 2022-03-24 Patrick Palka <ppalka@redhat.com>
4104 * call.cc (build_over_call): Use cxx_constant_value_sfinae
4105 instead of cxx_constant_value to evaluate a consteval call.
4106 * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
4107 and pass it to cxx_eval_outermost_constant_expr.
4108 * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
4109 * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
4110 cxx_constant_value_sfinae.
4112 2022-03-24 Jakub Jelinek <jakub@redhat.com>
4115 * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
4116 through extern thread_local declarations. Change wording from
4117 declaration to definition.
4118 (potential_constant_expression_1): Don't diagnose extern thread_local
4119 declarations. Change wording from declared to defined.
4120 * decl.cc (start_decl): Likewise.
4122 2022-03-23 Jason Merrill <jason@redhat.com>
4125 * decl.cc (reshape_single_init): New.
4126 (reshape_init_class): Use it.
4128 2022-03-23 Jason Merrill <jason@redhat.com>
4131 * name-lookup.cc (lookup_using_decl): Check that scope is
4132 a dependent type before looking for dependent using.
4134 2022-03-23 Jason Merrill <jason@redhat.com>
4137 * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
4138 finds a dependent using.
4140 2022-03-21 Jason Merrill <jason@redhat.com>
4143 * init.cc (build_vec_init): Check for vla element type.
4145 2022-03-21 Jason Merrill <jason@redhat.com>
4151 * decl.cc (reshape_init_class): Avoid looking for designator
4153 (reshape_init_r): Keep looking for designator.
4155 2022-03-21 Jason Merrill <jason@redhat.com>
4158 * decl.cc (reshape_init_class): Back out of anon struct
4159 if a designator doesn't match.
4161 2022-03-18 Jason Merrill <jason@redhat.com>
4165 * class.cc (add_method): Avoid adding the same used function twice.
4166 (handle_using_decl): Don't add_method.
4167 (finish_struct): Don't using op= if we have one already.
4168 (maybe_push_used_methods): New.
4169 * semantics.cc (finish_member_declaration): Call it.
4170 * name-lookup.cc (diagnose_name_conflict): No longer static.
4171 (push_class_level_binding): Revert 92918 patch, limit
4173 * cp-tree.h: Adjust.
4175 2022-03-18 Jakub Jelinek <jakub@redhat.com>
4178 * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
4179 argument and its handling, instead add ITYPE2 argument. Only
4180 support COOKIE_SIZE != NULL.
4181 (build_new_1): If size is 0, change it to 0 * outer_nelts if
4182 outer_nelts is non-NULL. Pass type rather than elt_type to
4183 maybe_wrap_new_for_constexpr.
4184 * constexpr.cc (build_new_constexpr_heap_type): New function.
4185 (cxx_eval_constant_expression) <case CONVERT_EXPR>:
4186 If elt_size is zero sized type, try to recover outer_nelts from
4187 the size argument to operator new/new[] and pass that as
4188 arg_size to build_new_constexpr_heap_type. Pass ctx,
4189 non_constant_p and overflow_p to that call too.
4191 2022-03-18 Marek Polacek <polacek@redhat.com>
4194 * tree.cc (strip_typedefs): Don't strip an alias template when
4195 doing so would result in losing a parameter pack.
4197 2022-03-16 Patrick Palka <ppalka@redhat.com>
4199 * search.cc (lookup_member): Simplify by handling all values
4200 of protect together in the ambiguous case. Don't modify protect.
4202 2022-03-16 Patrick Palka <ppalka@redhat.com>
4205 * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
4206 std::move/forward and other cast-like functions into simple
4209 2022-03-15 Patrick Palka <ppalka@redhat.com>
4212 * search.cc (lookup_field_info::errstr): Remove this data
4214 (lookup_field_r): Don't set errstr.
4215 (lookup_member): Check ambiguity before checking access.
4216 Simplify accordingly after errstr removal. Exit early upon
4217 error or empty result.
4219 2022-03-15 Jakub Jelinek <jakub@redhat.com>
4222 * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
4224 2022-03-14 Jakub Jelinek <jakub@redhat.com>
4226 PR tree-optimization/102586
4227 * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
4228 first argument's type is pointer to non-trivially-copyable type unless
4229 it is address of a variable or parameter.
4231 2022-03-12 Patrick Palka <ppalka@redhat.com>
4234 * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
4235 * decl.cc (make_typename_type): Allow a typename-specifier to
4236 resolve to a template when tf_tst_ok, in which case return
4237 a CTAD placeholder for the template.
4238 * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
4239 substituting the type.
4240 (tsubst): Clear tf_tst_ok and remember if it was set.
4241 <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
4243 (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
4245 (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
4246 <case CONSTRUCTOR>: Likewise.
4248 2022-03-12 Patrick Palka <ppalka@redhat.com>
4251 * call.cc (missing_conversion_p): Define.
4252 (add_candidates): Use it.
4253 * pt.cc (check_non_deducible_conversion): Change type of strict
4254 parameter to unification_kind_t and directly test for DEDUCE_CALL.
4256 2022-03-12 Patrick Palka <ppalka@redhat.com>
4259 * constraint.cc (normalize_atom): Set
4260 ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
4261 (get_mapped_args): Make static, adjust parameters. Always
4262 return a vector whose depth corresponds to the template depth of
4263 the context of the atomic constraint expression. Micro-optimize
4264 by passing false as exact to safe_grow_cleared and by collapsing
4265 a multi-level depth-one argument vector.
4266 (satisfy_atom): Adjust call to get_mapped_args and
4267 diagnose_atomic_constraint.
4268 (diagnose_atomic_constraint): Replace map parameter with an args
4270 * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
4271 (get_mapped_args): Remove declaration.
4273 2022-03-12 Patrick Palka <ppalka@redhat.com>
4274 Jason Merrill <jason@redhat.com>
4277 * constexpr.cc (mark_non_constant): Define, split out from ...
4278 (cxx_eval_outermost_constant_expr): ... here.
4279 (maybe_constant_value): Use it.
4281 2022-03-12 Patrick Palka <ppalka@redhat.com>
4283 * semantics.cc (finish_unary_fold_expr): Use input_location
4284 instead of UNKNOWN_LOCATION.
4285 (finish_binary_fold_expr): Likewise.
4287 2022-03-12 Thomas Schwinge <thomas@codesourcery.com>
4290 * semantics.cc (handle_omp_array_sections_1)
4291 (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
4292 instead of 'c_omp_map_clause_name'.
4294 2022-03-10 Marek Polacek <polacek@redhat.com>
4297 * parser.cc (cp_parser_template_name): Repeat lookup of
4300 2022-03-10 Marek Polacek <polacek@redhat.com>
4303 * semantics.cc (finish_compound_literal): Disallow auto{x} for
4304 is_constrained_auto.
4305 * typeck2.cc (build_functional_cast_1): Likewise.
4307 2022-03-10 Marek Polacek <polacek@redhat.com>
4310 * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
4313 2022-03-10 Jakub Jelinek <jakub@redhat.com>
4316 * decl.cc (grok_op_properties): Allow variadic operator[] for
4319 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
4322 * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
4323 consider it to be zero (i.e. treat it like error_mark_node).
4324 (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
4325 set VALUE to error_mark_node.
4327 2022-03-10 Roger Sayle <roger@nextmovesoftware.com>
4330 * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
4331 stream hasn't been purged before processing DECL_PENDING_INLINE.
4333 2022-03-09 Patrick Palka <ppalka@redhat.com>
4336 * except.cc (build_noexcept_spec): Strengthen dependence check
4337 to instantiation_dependent_expression_p.
4338 * parser.cc (cp_parser_parenthesized_expression_list_elt):
4339 Remove fold_expr_p parameter, and don't call
4340 instantiate_non_dependent_expr.
4341 (cp_parser_parenthesized_expression_list): Adjust accordingly.
4342 * pt.cc (expand_integer_pack): Strengthen dependence check
4343 to instantiation_dependent_expression_p.
4344 (instantiate_non_dependent_expr_internal): Adjust comment.
4345 (instantiate_non_dependent_expr_sfinae): Likewise. Drop
4346 the potentially-constant check, and relax and turn the
4347 dependence check into a checking assert.
4348 (instantiate_non_dependent_or_null): Adjust comment.
4349 * semantics.cc (finish_decltype_type): Keep
4350 processing_template_decl cleared after calling
4351 instantiate_non_dependent_expr_sfinae.
4353 2022-03-09 Patrick Palka <ppalka@redhat.com>
4357 * cp-tree.h (is_copy_initialization): Declare.
4358 * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
4359 when is_copy_initialization is true.
4360 * init.cc (build_aggr_init): Split out copy-initialization
4362 (is_copy_initialization): ... here.
4363 * pt.cc (instantiate_decl): Pass 0 instead of
4364 LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
4366 2022-03-09 Patrick Palka <ppalka@redhat.com>
4369 * cp-tree.h (merge_default_template_args): Declare.
4370 * decl.cc (merge_default_template_args): Define, factored out
4371 from redeclare_class_template.
4372 (duplicate_decls): Use it when merging member function template
4373 and free function declarations.
4374 * pt.cc (redeclare_class_template): Factor out default argument
4375 merging logic into merge_default_template_args. Improve location
4376 of a note when there's a template parameter kind mismatch.
4378 2022-03-09 Jakub Jelinek <jakub@redhat.com>
4381 * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
4382 instead of TYPE_UNSIGNED.
4383 * typeck.cc (cp_build_binary_op): Don't emit
4384 -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
4386 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4389 * decl.cc (start_decl): Defend against prefix_attributes being
4392 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4395 * parser.cc (synthesize_implicit_template_parm): Check that
4396 TREE_VALUE (new_parm) isn't error_mark_node before setting its
4399 2022-03-08 Roger Sayle <roger@nextmovesoftware.com>
4402 * parser.cc (cp_parser_linkage_specification): Treat the case where
4403 linkage is error_mark_node as "invalid linkage-specification".
4405 2022-03-08 Marek Polacek <polacek@redhat.com>
4408 * pt.cc (convert_nontype_argument): Recompute
4409 value_dependent_expression_p after build_converted_constant_expr.
4411 2022-03-08 Marek Polacek <polacek@redhat.com>
4413 * decl2.cc (is_late_template_attribute): Do not defer attribute
4415 * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
4417 2022-03-08 Jakub Jelinek <jakub@redhat.com>
4420 * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
4421 identifiers with space at the end.
4423 2022-03-07 Jason Merrill <jason@redhat.com>
4426 * decl2.cc (mark_single_function): Look through parens and location
4428 * typeck.cc (cp_build_addr_expr_1): Not here.
4430 2022-03-07 Jakub Jelinek <jakub@redhat.com>
4432 * parser.cc (cp_parser_omp_clause_map): Add missing space in string
4435 2022-03-07 Jakub Jelinek <jakub@redhat.com>
4437 * cvt.cc: Fix up duplicated word issue in a comment.
4439 * module.cc: Likewise.
4440 * coroutines.cc: Likewise.
4442 2022-03-04 Nathan Sidwell <nathan@acm.org>
4444 * mangle.cc (is_std_substitution): Check global module.
4445 (is_std_substitution_char): Return bool.
4447 2022-03-04 Nathan Sidwell <nathan@acm.org>
4449 * cp-tree.h (mangle_identifier): Replace with ...
4450 (mangle_module_component): ... this.
4451 * mangle.cc (dump_substitution_candidates): Adjust.
4452 (add_substitution): Likewise.
4453 (find_substitution): Likewise.
4454 (unmangled_name_p): Likewise.
4455 (mangle_module_substitution): Reimplement.
4456 (mangle_module_component): New.
4457 (write_module, maybe_write_module): Adjust.
4458 (write_name): Drop modules here.
4459 (write_unqualified): Do them here instead.
4460 (mangle_global_init): Adjust.
4461 * module.cc (module_state::mangle): Adjust.
4462 (mangle_module): Likewise.
4463 (get_originating_module): Adjust.
4465 2022-02-28 Marek Polacek <polacek@redhat.com>
4468 * cp-tree.h (build_enumerator): Adjust.
4469 * decl.cc (finish_enum): Make it return the new decl.
4470 * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
4472 2022-02-28 Marek Polacek <polacek@redhat.com>
4475 * decl2.cc (is_late_template_attribute): Cope with a decl without
4478 2022-02-27 Jason Merrill <jason@redhat.com>
4481 * typeck.cc (cp_build_addr_expr_1): Also
4482 maybe_undo_parenthesized_ref.
4484 2022-02-24 Martin Liska <mliska@suse.cz>
4486 * pt.cc (defarg_insts_for): Use braces for subobject.
4488 2022-02-18 Patrick Palka <ppalka@redhat.com>
4491 * pt.cc (maybe_instantiate_noexcept): For non-static member
4492 functions, set current_class_ptr/ref to the specialized 'this'
4495 2022-02-17 Jason Merrill <jason@redhat.com>
4498 * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
4500 2022-02-17 Jason Merrill <jason@redhat.com>
4503 * decl2.cc (mark_single_function): New.
4504 * cp-tree.h: Declare it.
4505 * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
4506 * semantics.cc (finish_qualified_id_expr): Not here.
4507 (finish_id_expression_1): Or here.
4508 (finish_decltype_type): Call mark_single_function.
4509 * cvt.cc (convert_to_void): And here.
4510 * pt.cc (convert_nontype_argument): And here.
4511 * init.cc (build_offset_ref): Adjust assert.
4513 2022-02-17 Patrick Palka <ppalka@redhat.com>
4516 * semantics.cc (finish_compound_literal): Don't perform
4517 non-dependent expr folding before calling check_narrowing.
4519 2022-02-16 Patrick Palka <ppalka@redhat.com>
4522 * constexpr.cc (potential_constant_expression_1)
4523 <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
4524 Assert tf_error isn't set.
4526 2022-02-15 Jason Merrill <jason@redhat.com>
4530 * pt.cc (coerce_template_template_parms): Take full parms.
4531 Avoid adding too much of outer_args.
4532 (coerce_template_template_parm): Adjust.
4533 (template_template_parm_bindings_ok_p): Adjust.
4534 (convert_template_argument): Adjust.
4536 2022-02-14 Jakub Jelinek <jakub@redhat.com>
4539 * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
4540 Don't punt if returns (target).
4542 2022-02-11 Jakub Jelinek <jakub@redhat.com>
4545 * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
4546 Only return fold_const_call result if it is non-NULL. Otherwise
4547 fall through into the default: case to return t, set *non_constant_p
4548 and emit diagnostics if needed.
4550 2022-02-10 Jason Merrill <jason@redhat.com>
4552 * module.cc (depset::hash::add_specializations): Use
4555 2022-02-10 Tobias Burnus <tobias@codesourcery.com>
4558 * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
4559 members as those are permitted since OpenMP 5.0.
4561 2022-02-10 Patrick Palka <ppalka@redhat.com>
4563 * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
4566 2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
4568 * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
4569 (cp_parser_omp_var_list_no_open): Handle array sections.
4570 (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
4572 (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
4573 * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
4574 (finish_omp_clauses): Handle array sections.
4576 2022-02-09 Patrick Palka <ppalka@redhat.com>
4579 * call.cc (build_new_method_call): When a non-dependent call
4580 resolves to a specialization of a member template, always build
4581 the pruned overload set using the member template, not the
4583 * pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
4584 and correct how members from the new lookup set are matched to
4585 those from the old one.
4586 (tsubst_baselink): Pass binfo_type as newtype to
4587 filter_memfn_lookup.
4589 2022-02-09 Jason Merrill <jason@redhat.com>
4592 * module.cc (trees_out::core_vals): Stream explicit specifier.
4593 (trees_in::core_vals): Likewise.
4594 * pt.cc (store_explicit_specifier): No longer static.
4595 (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
4596 * cp-tree.h (lookup_explicit_specifier): Declare.
4598 2022-02-09 Jason Merrill <jason@redhat.com>
4601 * typeck2.cc (split_nonconstant_init_1): Push cleanups for
4602 preceding members with constant initialization.
4603 (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
4605 2022-02-08 Jakub Jelinek <jakub@redhat.com>
4608 * name-lookup.cc (check_local_shadow): When diagnosing shadowing
4609 of a member or global declaration, add warning suppression for
4610 the decl and don't warn again on it.
4612 2022-02-08 Jakub Jelinek <jakub@redhat.com>
4615 * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
4616 of TREE_STATIC vars may only appear in -std=c++23.
4618 2022-02-08 Patrick Palka <ppalka@redhat.com>
4621 * pt.cc (uses_deducible_template_parms): Consider the
4622 noexcept-spec of a function type.
4624 2022-02-08 Patrick Palka <ppalka@redhat.com>
4627 * constraint.cc (satisfaction_value): Relax assert to accept
4630 2022-02-08 Patrick Palka <ppalka@redhat.com>
4633 * pt.cc (preserve_args): New function.
4634 (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
4636 2022-02-08 Patrick Palka <ppalka@redhat.com>
4639 * constraint.cc (satisfy_declaration_constraints): Use
4640 lambda_regenerating_args instead.
4641 * cp-tree.h (lambda_regenerating_args): Declare.
4642 * pt.cc (lambda_regenerating_args): Define, split out from
4643 satisfy_declaration_constraints.
4644 (do_auto_deduction): Use lambda_regenerating_args to obtain the
4645 full set of outer template arguments for satisfaction when
4648 2022-02-06 Patrick Palka <ppalka@redhat.com>
4651 * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
4652 fn by calling maybe_synthesize_method instead of relying on
4653 maybe_instantiate_noexcept. Move call to m_i_n after the
4654 DECL_DELETED_FN handling.
4655 * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
4656 fn synthesis to only those with an implicit noexcept-spec, and
4657 return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
4659 2022-02-06 Jakub Jelinek <jakub@redhat.com>
4663 * constexpr.cc (cxx_eval_binary_expression): Temporarily set
4664 folding_cxx_constexpr.
4666 2022-02-05 Jason Merrill <jason@redhat.com>
4670 * cp-tree.h (get_vec_init_expr): New.
4671 (target_expr_needs_replace): New.
4672 * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
4673 (struct cp_fold_data): New.
4674 (cp_fold_r): Only genericize inits at end of fn.
4675 (cp_fold_function): Here.
4676 (cp_fully_fold_init): Not here.
4677 * init.cc (build_vec_init): Use get_vec_init_expr.
4678 * tree.cc (build_vec_init_expr): Likewise.
4679 * typeck2.cc (split_nonconstant_init_1): Likewise.
4680 (process_init_constructor): Wrap VEC_INIT_EXPR in
4683 2022-02-05 Jason Merrill <jason@redhat.com>
4685 * pt.cc (iterative_hash_template_arg): Add comment.
4687 2022-02-03 Patrick Palka <ppalka@redhat.com>
4690 * pt.cc (value_dependent_noexcept_spec_p): New predicate split
4692 (dependent_type_p_r): ... here.
4693 (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
4694 to consider dependence of a noexcept-spec before C++17.
4695 * tree.cc (fixup_deferred_exception_variants): Clear
4696 TYPE_DEPENDENT_P_VALID.
4698 2022-02-03 Jason Merrill <jason@redhat.com>
4701 * decl.cc (maybe_deduce_size_from_array_init): Give up
4702 on type-dependent init.
4703 (cp_complete_array_type): Only call reshape_init for character
4706 2022-02-01 Jason Merrill <jason@redhat.com>
4709 * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
4710 (defarg_insts_for): New.
4711 (tsubst_default_argument): Adjust.
4713 2022-01-31 Marek Polacek <polacek@redhat.com>
4717 * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
4718 Sorry on a variable-length array of auto.
4720 2022-01-31 Marek Polacek <polacek@redhat.com>
4723 * class.cc (finish_struct): Don't allow union initializer_list.
4725 2022-01-31 Patrick Palka <ppalka@redhat.com>
4728 * pt.cc (ctor_deduction_guides_for): Correct computation of
4731 2022-01-31 Patrick Palka <ppalka@redhat.com>
4734 * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
4735 walk_subtrees if !include_nondeduced_p. Simplify given that
4736 cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
4738 2022-01-28 Patrick Palka <ppalka@redhat.com>
4739 Jason Merrill <jason@redhat.com>
4742 * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
4743 unqualified pointer type not the qualified one.
4745 2022-01-28 Patrick Palka <ppalka@redhat.com>
4748 * decl.cc (cp_finish_decl): Pass the template arguments of a
4749 variable template specialization or a templated static data
4750 member to do_auto_deduction when the auto is constrained.
4752 2022-01-28 Jason Merrill <jason@redhat.com>
4757 * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
4759 (cp_parser_class_head): And in class attributes.
4760 * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
4763 2022-01-27 Jason Merrill <jason@redhat.com>
4767 * decl2.cc (save_template_attributes): Take late attrs as parm.
4768 (cplus_decl_attributes): Call it after decl_attributes,
4769 splice_template_attributes before.
4771 2022-01-27 Patrick Palka <ppalka@redhat.com>
4774 * call.cc (build_over_call): For a non-dependent member call,
4775 build up a CALL_EXPR using a COMPONENT_REF callee, as in
4776 build_new_method_call.
4777 * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
4778 * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
4779 after the build_over_call change.
4781 2022-01-27 Patrick Palka <ppalka@redhat.com>
4785 * parser.cc (cp_parser_class_head): Update 'type' with the result
4786 of maybe_process_partial_specialization in the
4787 nested_name_specifier branch. Refactor nearby code to accomodate
4788 that maybe_process_partial_specialization returns a _TYPE, not a
4789 TYPE_DECL, and eliminate local variable 'class_type' in passing.
4791 2022-01-27 Marek Polacek <polacek@redhat.com>
4794 * decl.cc (create_array_type_for_decl): Reject forming an array of
4795 placeholder for a deduced class type.
4797 2022-01-26 Jason Merrill <jason@redhat.com>
4801 * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
4803 2022-01-26 Jakub Jelinek <jakub@redhat.com>
4806 * constexpr.cc (init_subob_ctx): For vector ctors containing
4807 vector elements, ensure appending to the same ctor instead of
4808 creating another one.
4810 2022-01-26 Marek Polacek <polacek@redhat.com>
4813 * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
4814 (finish_destructor_body): Likewise.
4815 * optimize.cc (build_delete_destructor_body): Likewise.
4817 2022-01-26 Jason Merrill <jason@redhat.com>
4820 * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
4822 2022-01-26 Jason Merrill <jason@redhat.com>
4825 * pt.cc (tsubst_aggr_type): Call tsubst for alias template
4828 2022-01-25 Patrick Palka <ppalka@redhat.com>
4832 * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
4833 on a deleted function.
4835 2022-01-25 Jason Merrill <jason@redhat.com>
4838 * call.cc (build_over_call): Use cp_build_indirect_ref.
4840 2022-01-24 Patrick Palka <ppalka@redhat.com>
4843 * pt.cc (make_auto_1): Use -1 as a placeholder default argument
4846 2022-01-24 Patrick Palka <ppalka@redhat.com>
4849 * typeck.cc (build_class_member_access_expr): Extend
4850 unary_complex_lvalue result adjustment to preserve all
4851 rvalues, not just xvalues.
4853 2022-01-23 Will Wray <wjwray@gmail.com>
4856 * decl.cc (reshape_init_r): Only call has_designator_check when
4857 first_initializer_p or for the inner constructor element.
4858 (cp_complete_array_type): Call reshape_init on braced-init-list.
4860 2022-01-23 Jason Merrill <jason@redhat.com>
4863 * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
4864 has set DECL_INITIAL on a TARGET_EXPR slot.
4865 * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
4867 2022-01-23 Jason Merrill <jason@redhat.com>
4870 * cp-tree.h (build_implicit_conv_flags): Declare.
4871 * call.cc (build_implicit_conv_flags): Split out from...
4872 (perform_implicit_conversion_flags): ...here.
4873 * decl.cc (check_initializer): Use it.
4874 * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
4875 * semantics.cc (finish_compound_literal): Don't treat
4876 scalar values like CONSTRUCTORs.
4878 2022-01-21 Jason Merrill <jason@redhat.com>
4880 * semantics.cc (find_failing_clause): Return expr if not
4882 (finish_static_assert): Show constant values in failing
4885 2022-01-21 Jason Merrill <jason@redhat.com>
4889 * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
4890 alloc_expr is a TARGET_EXPR.
4892 2022-01-21 Marek Polacek <polacek@redhat.com>
4895 * tree.cc (fixup_deferred_exception_variants): Remove duplicate
4896 variants after parsing the exception specifications.
4898 2022-01-21 Jason Merrill <jason@redhat.com>
4902 * class.cc (end_of_class): Use base_binfo.
4904 2022-01-20 Jason Merrill <jason@redhat.com>
4907 * decl.cc (reshape_init_class): Reject designator for a member of
4910 2022-01-20 Patrick Palka <ppalka@redhat.com>
4914 * pt.cc (keep_template_parm): Punt on a level 0 template parm.
4915 (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
4916 (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
4918 (make_auto_1): Add defaulted 'level' parameter.
4919 (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
4921 2022-01-20 Patrick Palka <ppalka@redhat.com>
4923 * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
4924 function return type even when !funcdecl_p.
4926 2022-01-20 Martin Liska <mliska@suse.cz>
4929 * error.cc (dump_aggr_type): Partially disable the warning.
4931 2022-01-20 Jason Merrill <jason@redhat.com>
4934 * parser.cc (cp_parser_template_name): Use dependent_scope_p.
4936 2022-01-19 David Malcolm <dmalcolm@redhat.com>
4938 * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
4940 * cp-tree.h (cp_pt_c_tests): Rename to...
4941 (cp_pt_cc_tests): ...this.
4942 (cp_tree_c_tests): Rename to...
4943 (cp_tree_cc_tests): ...this.
4944 * pt.cc (cp_pt_c_tests): Rename to...
4945 (cp_pt_cc_tests): ...this.
4946 * tree.cc (cp_tree_c_tests): Rename to...
4947 (cp_tree_cc_tests): ...this.
4949 2022-01-19 Jason Merrill <jason@redhat.com>
4951 * parser.cc (saved_token_sentinel::rollback): Use
4952 cp_lexer_previous_token.
4954 2022-01-18 Jakub Jelinek <jakub@redhat.com>
4957 * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
4958 TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
4959 than get_target_expr_sfinae with tf_no_cleanup, and don't set
4962 2022-01-18 Jason Merrill <jason@redhat.com>
4963 Jakub Jelinek <jakub@redhat.com>
4966 * parser.cc (saved_token_sentinel::rollback): Call
4967 cp_lexer_set_source_position.
4968 (~saved_token_sentinel): Call rollback.
4970 2022-01-18 Patrick Palka <ppalka@redhat.com>
4973 * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
4974 that we return false for DEPENDENT_OPERATOR_TYPE too.
4976 2022-01-17 Martin Liska <mliska@suse.cz>
4978 * Make-lang.in: Rename .c names to .cc.
4979 * config-lang.in: Likewise.
4980 * constexpr.cc (cxx_eval_constant_expression): Likewise.
4981 * coroutines.cc (morph_fn_to_coro): Likewise.
4982 * cp-gimplify.cc (cp_gimplify_expr): Likewise.
4983 * cp-lang.cc (struct lang_hooks): Likewise.
4984 (get_template_argument_pack_elems_folded): Likewise.
4985 * cp-objcp-common.cc (cp_tree_size): Likewise.
4986 (cp_unit_size_without_reusable_padding): Likewise.
4987 (pop_file_scope): Likewise.
4988 (cp_pushdecl): Likewise.
4989 * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
4990 (cxx_simulate_record_decl): Likewise.
4991 * cp-tree.h (struct named_label_entry): Likewise.
4992 (current_function_return_value): Likewise.
4993 (more_aggr_init_expr_args_p): Likewise.
4994 (get_function_version_dispatcher): Likewise.
4995 (common_enclosing_class): Likewise.
4996 (strip_fnptr_conv): Likewise.
4997 (current_decl_namespace): Likewise.
4998 (do_aggregate_paren_init): Likewise.
4999 (cp_check_const_attributes): Likewise.
5000 (qualified_name_lookup_error): Likewise.
5001 (generic_targs_for): Likewise.
5002 (mark_exp_read): Likewise.
5003 (is_global_friend): Likewise.
5004 (maybe_reject_flexarray_init): Likewise.
5005 (module_token_lang): Likewise.
5006 (handle_module_option): Likewise.
5007 (literal_integer_zerop): Likewise.
5008 (build_extra_args): Likewise.
5009 (build_if_nonnull): Likewise.
5010 (maybe_check_overriding_exception_spec): Likewise.
5011 (finish_omp_target_clauses): Likewise.
5012 (maybe_warn_zero_as_null_pointer_constant): Likewise.
5013 (cxx_print_error_function): Likewise.
5014 (decl_in_std_namespace_p): Likewise.
5015 (merge_exception_specifiers): Likewise.
5016 (mangle_module_global_init): Likewise.
5017 (cxx_block_may_fallthru): Likewise.
5018 (fold_builtin_source_location): Likewise.
5019 (enum cp_oracle_request): Likewise.
5020 (subsumes): Likewise.
5021 (cp_finish_injected_record_type): Likewise.
5022 (vtv_build_vtable_verify_fndecl): Likewise.
5023 (cp_tree_c_finish_parsing): Likewise.
5024 * cvt.cc (diagnose_ref_binding): Likewise.
5025 (convert_to_void): Likewise.
5026 (convert_force): Likewise.
5027 (type_promotes_to): Likewise.
5028 * decl.cc (make_unbound_class_template_raw): Likewise.
5029 (cxx_init_decl_processing): Likewise.
5030 (check_class_member_definition_namespace): Likewise.
5031 (cxx_maybe_build_cleanup): Likewise.
5032 * decl2.cc (maybe_emit_vtables): Likewise.
5033 * error.cc (dump_function_name): Likewise.
5034 * init.cc (is_class_type): Likewise.
5035 (build_new_1): Likewise.
5036 * lang-specs.h: Likewise.
5037 * method.cc (make_alias_for_thunk): Likewise.
5038 * module.cc (specialization_add): Likewise.
5039 (module_state::read_cluster): Likewise.
5040 * name-lookup.cc (check_extern_c_conflict): Likewise.
5041 * name-lookup.h (struct cxx_binding): Likewise.
5042 * parser.cc (cp_parser_identifier): Likewise.
5043 * parser.h (struct cp_parser): Likewise.
5044 * pt.cc (has_value_dependent_address): Likewise.
5045 (push_tinst_level_loc): Likewise.
5046 * semantics.cc (finish_omp_clauses): Likewise.
5047 (finish_omp_atomic): Likewise.
5048 * tree.cc (cp_save_expr): Likewise.
5049 (cp_free_lang_data): Likewise.
5050 * typeck.cc (cp_common_type): Likewise.
5051 (strip_array_domain): Likewise.
5052 (rationalize_conditional_expr): Likewise.
5053 (check_return_expr): Likewise.
5054 * vtable-class-hierarchy.cc: Likewise.
5056 2022-01-17 Martin Liska <mliska@suse.cz>
5058 * call.c: Moved to...
5060 * class.c: Moved to...
5061 * class.cc: ...here.
5062 * constexpr.c: Moved to...
5063 * constexpr.cc: ...here.
5064 * cp-gimplify.c: Moved to...
5065 * cp-gimplify.cc: ...here.
5066 * cp-lang.c: Moved to...
5067 * cp-lang.cc: ...here.
5068 * cp-objcp-common.c: Moved to...
5069 * cp-objcp-common.cc: ...here.
5070 * cp-ubsan.c: Moved to...
5071 * cp-ubsan.cc: ...here.
5072 * cvt.c: Moved to...
5074 * cxx-pretty-print.c: Moved to...
5075 * cxx-pretty-print.cc: ...here.
5076 * decl.c: Moved to...
5078 * decl2.c: Moved to...
5079 * decl2.cc: ...here.
5080 * dump.c: Moved to...
5082 * error.c: Moved to...
5083 * error.cc: ...here.
5084 * except.c: Moved to...
5085 * except.cc: ...here.
5086 * expr.c: Moved to...
5088 * friend.c: Moved to...
5089 * friend.cc: ...here.
5090 * g++spec.c: Moved to...
5091 * g++spec.cc: ...here.
5092 * init.c: Moved to...
5094 * lambda.c: Moved to...
5095 * lambda.cc: ...here.
5096 * lex.c: Moved to...
5098 * mangle.c: Moved to...
5099 * mangle.cc: ...here.
5100 * method.c: Moved to...
5101 * method.cc: ...here.
5102 * name-lookup.c: Moved to...
5103 * name-lookup.cc: ...here.
5104 * optimize.c: Moved to...
5105 * optimize.cc: ...here.
5106 * parser.c: Moved to...
5107 * parser.cc: ...here.
5110 * ptree.c: Moved to...
5111 * ptree.cc: ...here.
5112 * rtti.c: Moved to...
5114 * search.c: Moved to...
5115 * search.cc: ...here.
5116 * semantics.c: Moved to...
5117 * semantics.cc: ...here.
5118 * tree.c: Moved to...
5120 * typeck.c: Moved to...
5121 * typeck.cc: ...here.
5122 * typeck2.c: Moved to...
5123 * typeck2.cc: ...here.
5124 * vtable-class-hierarchy.c: Moved to...
5125 * vtable-class-hierarchy.cc: ...here.
5127 2022-01-17 Jakub Jelinek <jakub@redhat.com>
5130 * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
5131 TARGET_EXPR_SLOT to current_function_decl if it was NULL.
5133 2022-01-17 Andrew Stubbs <ams@codesourcery.com>
5135 * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
5137 2022-01-14 Chung-Lin Tang <cltang@codesourcery.com>
5140 * semantics.c (finish_omp_clauses): Also continue peeling off of
5141 outer node for ARRAY_REFs.
5143 2022-01-14 Jakub Jelinek <jakub@redhat.com>
5146 * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
5147 IF_STMT_CONSTEXPR_P with constant false or true condition only
5148 check if the taken clause may fall through.
5149 * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
5150 to r12-5638^ behavior if then_ block can't fall through. For
5151 constexpr if, revert to r12-5638^ behavior.
5153 2022-01-13 Anthony Sharp <anthonysharp15@gmail.com>
5154 Jason Merrill <jason@redhat.com>
5157 * parser.c (cp_parser_id_expression): Handle
5158 -Wmissing-template-keyword.
5159 (struct saved_token_sentinel): Add modes to control what happens
5161 (cp_parser_statement): Adjust.
5162 (cp_parser_skip_entire_template_parameter_list): New function that
5163 skips an entire template parameter list.
5164 (cp_parser_require_end_of_template_parameter_list): Rename old
5165 cp_parser_skip_to_end_of_template_parameter_list.
5166 (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
5167 called from one of the above two functions.
5168 (cp_parser_lambda_declarator_opt)
5169 (cp_parser_explicit_template_declaration)
5170 (cp_parser_enclosed_template_argument_list): Adjust.
5172 2022-01-12 Jakub Jelinek <jakub@redhat.com>
5173 Jason Merrill <jason@redhat.com>
5176 * tree.c (move): If expr is xvalue_p, just return expr without
5179 2022-01-11 Jakub Jelinek <jakub@redhat.com>
5182 * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
5183 OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
5184 * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
5185 OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
5188 2022-01-11 Patrick Palka <ppalka@redhat.com>
5191 * call.c (build_new_method_call): Consider dependent bases only
5192 if 'this' is available.
5194 2022-01-11 Olivier Hainque <hainque@adacore.com>
5196 * decl.c (cxx_init_decl_processing): Move code possibly
5197 altering flag_weak before code testing it.
5199 2022-01-10 Patrick Palka <ppalka@redhat.com>
5202 * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
5203 canonicalization step into a local lambda. Strengthen it to
5204 absorb more components at position 0. Use it before both calls
5205 to cxx_fold_indirect_ref_1.
5207 2022-01-10 Patrick Palka <ppalka@redhat.com>
5210 * call.c (cand_parms_match): Skip over 'this' when given one
5211 static and one non-static member function.
5213 2022-01-10 Jakub Jelinek <jakub@redhat.com>
5216 * semantics.c (expand_or_defer_fn): For immediate functions, set
5217 node->body_removed to true and clear analyzed, definition and
5219 * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
5222 2022-01-08 Jakub Jelinek <jakub@redhat.com>
5225 * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
5226 (cxx_eval_binary_expression): Use it.
5228 2022-01-08 Jason Merrill <jason@redhat.com>
5231 * init.c (build_vec_init): Remove assert.
5232 * tree.c (build_vec_init_expr): Likewise.
5234 2022-01-08 Jason Merrill <jason@redhat.com>
5237 * call.c (build_op_delete_call): Ignore destroying delete
5240 2022-01-07 Jason Merrill <jason@redhat.com>
5243 * init.c (build_new_1): Also build pointer cleanup if
5245 * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
5247 2022-01-07 Jason Merrill <jason@redhat.com>
5251 * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
5253 2022-01-07 Jason Merrill <jason@redhat.com>
5256 * init.c (perform_target_ctor): Select destructor by in_chrg.
5258 2022-01-07 Jason Merrill <jason@redhat.com>
5261 * except.c (in_nested_catch): New.
5262 (expand_end_catch_block): Check it.
5264 2022-01-07 Jason Merrill <jason@redhat.com>
5268 * except.c (maybe_splice_retval_cleanup): Check
5269 current_binding_level.
5270 * semantics.c (do_poplevel): Call it here.
5271 * parser.c (cp_parser_compound_statement): Not here.
5273 2022-01-07 Jason Merrill <jason@redhat.com>
5276 * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
5277 cleanups from set_up_extended_ref_temp.
5278 (wrap_temporary_cleanups): Ignore array cleanups.
5279 (initialize_local_var): Don't check for array here.
5280 * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
5281 * init.c (build_vec_delete_1): Set it.
5283 2022-01-07 Jason Merrill <jason@redhat.com>
5286 * init.c (build_vec_delete_1): Handle throwing dtor.
5287 (build_vec_init): Tell it we're in a cleanup already.
5289 2022-01-07 Jason Merrill <jason@redhat.com>
5291 * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
5292 (split_nonconstant_init): Adjust.
5294 2022-01-07 Jason Merrill <jason@redhat.com>
5298 * constexpr.c (replace_decl): Rename from replace_result_decl.
5299 * cp-tree.h (replace_decl): Declare it.
5300 * cp-gimplify.c (cp_gimplify_init_expr): Call it.
5301 (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
5302 (cp_genericize_init, cp_genericize_init_expr)
5303 (cp_genericize_target_expr): New.
5304 (cp_fold_r): Call them.
5305 * tree.c (build_array_copy): Add a TARGET_EXPR.
5306 * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
5308 2022-01-07 Jason Merrill <jason@redhat.com>
5311 * decl.c (initialize_local_var): Fix comment.
5312 * init.c (build_new_1): Do stabilize array init.
5313 (build_vec_init): Use TARGET_EXPR for cleanup. Initialization
5314 of an element from an explicit initializer is not a
5316 * tree.c (expand_vec_init_expr): Pass flags through.
5317 * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
5318 (split_nonconstant_init): Handle array cleanups.
5319 * cp-tree.h: Adjust.
5321 2022-01-07 Jason Merrill <jason@redhat.com>
5324 * decl.c (check_initializer): Remove obsolete comment.
5325 (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
5326 (initialize_local_var): Change assert to test.
5327 * typeck2.c (maybe_push_temp_cleanup): New.
5328 (split_nonconstant_init_1): Use it.
5329 (split_nonconstant_init): Clear cleanup flags.
5331 2022-01-07 Jason Merrill <jason@redhat.com>
5334 * typeck2.c (PICFLAG_VEC_INIT): New.
5335 (process_init_constructor_array): Set it.
5336 (process_init_constructor): Handle it.
5337 (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
5338 * init.c (build_vec_init): Likewise.
5339 * cp-gimplify.c (cp_gimplify_expr): Factor out...
5340 * tree.c (expand_vec_init_expr): ...this function.
5341 (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
5342 (build_vec_init_expr): Likewise.
5343 * constexpr.c (cxx_eval_vec_init): Likewise.
5344 (reduced_constant_expression_p): Check arrays before C++20.
5345 * cp-tree.h (expand_vec_init_expr): Declare.
5347 2022-01-07 Jason Merrill <jason@redhat.com>
5349 * init.c (build_new_1): Remove preevaluation code.
5351 2022-01-05 Nathan Sidwell <nathan@acm.org>
5353 * pt.c (instantiate_class_template_1): Process attribute((used)) set
5356 2022-01-05 Nathan Sidwell <nathan@acm.org>
5358 * init.c (build_new_1): Check complain before alignment warning.
5360 2022-01-04 Jason Merrill <jason@redhat.com>
5362 * cp-tree.h (class releasing_vec): Add begin/end fns.
5364 2022-01-04 Jason Merrill <jason@redhat.com>
5366 * init.c: Include -*- C++ -*- on first line.
5368 2022-01-03 Marek Polacek <polacek@redhat.com>
5371 * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
5374 2022-01-03 Marek Polacek <polacek@redhat.com>
5376 * parser.c (make_char_string_pack): Add a cast to const unsigned
5379 2022-01-03 Jakub Jelinek <jakub@redhat.com>
5382 * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
5383 to DECL_TINFO_P VAR_DECLs.
5385 2022-01-02 Jason Merrill <jason@redhat.com>
5387 * init.c (build_vec_init): Append the decrement to elt_init.
5389 2022-01-02 Jason Merrill <jason@redhat.com>
5391 * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
5394 Copyright (C) 2022 Free Software Foundation, Inc.
5396 Copying and distribution of this file, with or without modification,
5397 are permitted in any medium without royalty provided the copyright
5398 notice and this notice are preserved.