d: Merge upstream dmd, druntime c8ae4adb2e, phobos 792c8b7c1.
[official-gcc.git] / gcc / cp / ChangeLog
blobb1973dde4254a4add2e565b18e1e619be9dec789
1 2022-12-08  Jason Merrill  <jason@redhat.com>
3         PR c++/105838
4         * call.cc (convert_like_internal) [ck_list]: Use
5         maybe_init_list_as_array.
6         * constexpr.cc (cxx_eval_vec_init_1): Init might have
7         a different type.
8         * tree.cc (build_vec_init_elt): Likewise.
9         * init.cc (build_vec_init): Handle from_array from a
10         TARGET_EXPR.  Retain TARGET_EXPR of a different type.
12 2022-12-08  Jason Merrill  <jason@redhat.com>
14         PR c++/105838
15         * call.cc (list_ctor_element_type): New.
16         (braced_init_element_type): New.
17         (has_non_trivial_temporaries): New.
18         (maybe_init_list_as_array): New.
19         (maybe_init_list_as_range): New.
20         (build_user_type_conversion_1): Use maybe_init_list_as_range.
21         * parser.cc (cp_parser_braced_list): Call
22         recompute_constructor_flags.
23         * cp-tree.h (find_temps_r): Declare.
25 2022-12-08  Jason Merrill  <jason@redhat.com>
27         PR c++/105838
28         * cp-tree.h (is_std_allocator): Declare.
29         * constexpr.cc (is_std_allocator): Split out  from...
30         (is_std_allocator_allocate): ...here.
31         * init.cc (find_temps_r): New.
32         (find_allocator_temp): New.
33         (build_vec_init): Use it.
35 2022-12-08  Jason Merrill  <jason@redhat.com>
37         * constexpr.cc (maybe_constant_value): Add default arg comments.
39 2022-12-05  Scott Snyder  <sss@li-snyder.org>
41         PR plugins/107964
42         * Make-lang.in (CP_PLUGIN_HEADERS): Install contracts.h
44 2022-12-04  Patrick Palka  <ppalka@redhat.com>
46         PR c++/107417
47         * pt.cc (for_each_template_parm_r) <case REQUIRES_EXPR>: Move
48         walking of the TREE_TYPE of each parameter to ...
49         * tree.cc (cp_walk_subtrees) <case REQUIRES_EXPR>: ... here.
51 2022-12-04  Iain Sandoe  <iain@sandoe.co.uk>
52             Adrian Perl  <adrian.perl@web.de>
54         PR c++/100611
55         PR c++/101367
56         PR c++/101976
57         PR c++/99576
58         * coroutines.cc (find_interesting_subtree): Do not promote temporaries
59         that are only used as direct initializers for some other object.
61 2022-12-03  Patrick Palka  <ppalka@redhat.com>
63         PR c++/103081
64         * pt.cc (tsubst_copy) <case CONST_DECL>: Generalize
65         early exit test for namespace-scope decls to check dependence of
66         the enclosing scope instead.  Remove dead early exit test.
68 2022-12-02  Bernhard Reutner-Fischer  <rep.dot.nop@gmail.com>
69             Jason Merrill  <jason@redhat.com>
71         * decl.cc (grokdeclarator): Build RESULT_DECL.
72         (start_preparsed_function): Copy location from template.
73         * semantics.cc (apply_deduced_return_type): Handle
74         arg != current_function_decl.
75         * method.cc (implicitly_declare_fn): Use it.
77 2022-12-02  Jason Merrill  <jason@redhat.com>
79         * g++spec.cc (lang_specific_driver): Set SKIPOPT for nostdlib++.
81 2022-12-02  Jakub Jelinek  <jakub@redhat.com>
83         PR c++/84469
84         * parser.cc (cp_convert_omp_range_for): After do_auto_deduction if
85         !processing_template_decl call cp_finish_decomp with
86         processing_template_decl temporarily incremented.
88 2022-12-02  Jakub Jelinek  <jakub@redhat.com>
90         PR c++/84469
91         * parser.cc (do_range_for_auto_deduction): Add DECOMP_FIRST_NAME
92         and DECOMP_CNT arguments.  Call cp_finish_decomp if DECL
93         is a structured binding.
94         (cp_parser_range_for): Adjust do_range_for_auto_deduction caller.
95         (cp_convert_omp_range_for): Likewise.
97 2022-12-02  Patrick Palka  <ppalka@redhat.com>
99         PR c++/107539
100         * constraint.cc (norm_hasher::hash, norm_hasher::equal): Set
101         comparing_specializations.
102         (sat_hasher::hash, sat_hasher::equal): Likewise.
103         * cp-tree.h (atom_hasher::hash, atom_hasher::equal): Likewise.
104         * pt.cc (ctp_hasher::hash, ctp_hasher::equal): Likewise.
106 2022-12-01  Martin Liska  <mliska@suse.cz>
108         * Make-lang.in: Remove extra object dependency.
110 2022-12-01  Jason Merrill  <jason@redhat.com>
112         * contracts.cc (remove_contract_attributes): Actually prepend
113         to the list.
114         * pt.cc (tsubst_contract): Only look for a postcondition if type is
115         nonnull.
117 2022-11-30  Patrick Palka  <ppalka@redhat.com>
119         PR c++/107542
120         * typeck.cc (cp_build_binary_op): In the SPACESHIP_EXPR case,
121         handle an error_mark_node result type.
123 2022-11-29  Patrick Palka  <ppalka@redhat.com>
125         PR c++/107864
126         * decl.cc (function_requirements_equivalent_p): Don't check
127         DECL_TEMPLATE_SPECIALIZATION.
128         * pt.cc (determine_specialization): Propagate constraints when
129         specializing a function template too.  Simplify by using
130         add_outermost_template_args.
132 2022-11-28  Jason Merrill  <jason@redhat.com>
134         PR c++/101733
135         * parser.cc (cp_parser_requirement): Parse tentatively for the
136         'typename' case.
138 2022-11-28  Jason Merrill  <jason@redhat.com>
140         * parser.cc (cp_parser_decl_specifier_seq): Change 'concept bool'
141         diagnostic from pedwarn to permerror.
143 2022-11-28  Torbjörn SVENSSON  <torbjorn.svensson@foss.st.com>
144             Yvan ROUX  <yvan.roux@foss.st.com>
146         * module.cc: On Windows, 'A:Foo' is supposed to be a module
147         and not a path.
149 2022-11-22  Jason Merrill  <jason@redhat.com>
151         PR c++/107781
152         * contracts.cc (role_name_equal): Use strcspn instead
153         of strchrnul.
155 2022-11-22  Jason Merrill  <jason@redhat.com>
157         * contracts.cc (build_contract_condition_function):
158         Set DECL_ARTIFICIAL on return value parm.
159         * g++spec.cc (lang_specific_driver): Add -lstdc++exp
160         just before -lstdc++.
162 2022-11-20  Patrick Palka  <ppalka@redhat.com>
164         * constraint.cc (struct norm_entry): Define.
165         (struct norm_hasher): Define.
166         (norm_cache): Define.
167         (normalize_concept_check): Add function comment.  Cache the
168         the normal form of the substituted concept-id.  Canonicalize
169         generic arguments as NULL_TREE.  Don't coerce arguments unless
170         they were substituted.
171         (normalize_concept_definition): Simplify.  Use norm_cache
172         instead of normalized_map.
174 2022-11-20  Patrick Palka  <ppalka@redhat.com>
176         * pt.cc (coerce_template_parms): Salvage part of the function
177         comment from c_innermost_t_p.  Handle parms being a full
178         template parameter list.
179         (coerce_innermost_template_parms): Remove.
180         (lookup_template_class): Use c_t_p instead of c_innermost_t_p.
181         (finish_template_variable): Likewise.
182         (tsubst_decl): Likewise.
183         (instantiate_alias_template): Likewise.
185 2022-11-19  Jakub Jelinek  <jakub@redhat.com>
187         * constexpr.cc (cxx_eval_constant_expression): Implement C++23
188         P2647R1 - Permitting static constexpr variables in constexpr functions.
189         Allow DECL_EXPRs of decl_constant_var_p static or thread_local vars.
190         (potential_constant_expression_1): Similarly, except use
191         decl_maybe_constant_var_p instead of decl_constant_var_p if
192         processing_template_decl.
194 2022-11-19  Jeff Chapman II  <jchapman@lock3software.com>
195             Andrew Sutton   <asutton@lock3software.com>
196             Andrew Marmaduke  <amarmaduke@lock3software.com>
197             Michael Lopez  <mlopez@lock3software.com>
198             Jason Merrill   <jason@redhat.com>
200         * cp-tree.h (enum cp_tree_index): Add
201         CPTI_PSEUDO_CONTRACT_VIOLATION.
202         (pseudo_contract_violation_type): New macro.
203         (struct saved_scope): Add x_processing_contract_condition.
204         (processing_contract_condition): New macro.
205         (comparing_override_contracts): New variable decl.
206         (find_contract): New inline.
207         (set_decl_contracts): New inline.
208         (get_contract_semantic): New inline.
209         (set_contract_semantic): New inline.
210         * constexpr.cc (cxx_eval_assert): Split out from...
211         (cxx_eval_internal_function): ...here.
212         (cxx_eval_constant_expression): Use it for contracts.
213         (potential_constant_expression_1): Handle contracts.
214         * cp-gimplify.cc (cp_genericize_r): Handle contracts.
215         * cp-objcp-common.cc (cp_tree_size): Handle contracts.
216         (cp_common_init_ts): Handle contracts.
217         (cp_handle_option): Handle contracts.
218         * decl.cc (duplicate_decls): Handle contracts.
219         (check_tag_decl): Check for bogus contracts.
220         (start_decl): Check flag_contracts.
221         (grokfndecl): Call rebuild_postconditions.
222         (grokdeclarator): Handle contract attributes.
223         (start_preparsed_function): Call start_function_contracts.
224         (finish_function): Call finish_function_contracts.
225         * decl2.cc (cp_check_const_attributes): Skip contracts.
226         (comdat_linkage): Handle outlined contracts.
227         * error.cc (dump_type): Handle null TYPE_IDENTIFIER.
228         * g++spec.cc (EXPERIMENTAL): New macro.
229         (lang_specific_driver): Add -lstdc++exp if -fcontracts.
230         * mangle.cc (write_encoding): Handle outlined contracts.
231         * module.cc (trees_out::fn_parms_init): Handle outlined contracts.
232         (trees_in::fn_parms_init): Likewise.
233         (check_mergeable_decl): Likewise.
234         (module_state_config::get_dialect): Record -fcontracts.
235         * parser.h (struct cp_unparsed_functions_entry): Add contracts.
236         * parser.cc (unparsed_contracts): New macro.
237         (push_unparsed_function_queues): Adjust.
238         (contract_attribute_p): New.
239         (cp_parser_statement): Check contracts.
240         (cp_parser_decl_specifier_seq): Handle contracts.
241         (cp_parser_skip_to_closing_square_bracket): Split out...
242         (cp_parser_skip_up_to_closing_square_bracket): ...this fn.
243         (cp_parser_class_specifier): Do contract late parsing.
244         (cp_parser_class_head): Check contracts.
245         (cp_parser_contract_role): New.
246         (cp_parser_contract_mode_opt): New.
247         (find_error, contains_error_p): New.
248         (cp_parser_contract_attribute_spec): New.
249         (cp_parser_late_contract_condition): New.
250         (cp_parser_std_attribute_spec): Handle contracts.
251         (cp_parser_save_default_args): Also save contracts.
252         * pt.cc (register_parameter_specializations): No longer static.
253         (register_local_identity): New.
254         (check_explicit_specialization): Call remove_contract_attributes.
255         (tsubst_contract, tsubst_contract_attribute): New.
256         (tsubst_contract_attributes): New.
257         (tsubst_attribute): Add comment.
258         (tsubst_copy): Also allow parm when processing_contract_condition.
259         (tsubst_expr): Handle contracts.
260         (regenerate_decl_from_template): Handle contracts.
261         * search.cc (check_final_overrider): Compare contracts.
262         * semantics.cc (set_cleanup_locs): Skip POSTCONDITION_STMT.
263         (finish_non_static_data_member): Check contracts.
264         (finish_this_expr): Check contracts.
265         (process_outer_var_ref): Handle contracts.
266         (finish_id_expression_1): Handle contracts.
267         (apply_deduced_return_type): Adjust contracts.
268         * tree.cc (handle_contract_attribute): New.
269         (get_innermost_component, is_this_expression): New.
270         (comparing_this_references): New.
271         (equivalent_member_references): New.
272         (cp_tree_equal): Check it.
273         * typeck.cc (check_return_expr): Apply contracts.
274         * Make-lang.in: Add contracts.o.
275         * config-lang.in: Add contracts.cc.
276         * cp-tree.def (ASSERTION_STMT, PRECONDITION_STMT)
277         (POSTCONDITION_STMT): New.
278         * contracts.h: New file.
279         * contracts.cc: New file.
281 2022-11-18  Jakub Jelinek  <jakub@redhat.com>
283         * decl.cc (grokdeclarator): Implement
284         CWG2635 - Constrained structured bindings.  Emit a pedwarn on
285         constrained auto type.  Add auto_diagnostic_group for error_at
286         and inform for non-auto type on structured bindings declaration.
288 2022-11-18  Marek Polacek  <polacek@redhat.com>
290         PR c++/104066
291         * decl.cc (grokdeclarator): Check funcdecl_p before complaining
292         about constinit.
294 2022-11-16  Marek Polacek  <polacek@redhat.com>
296         PR c++/106649
297         * constexpr.cc (constexpr_error): New function.
298         (is_valid_constexpr_fn): Use constexpr_error.
299         (maybe_save_constexpr_fundef): Call
300         require_potential_rvalue_constant_expression_fncheck rather than
301         require_potential_rvalue_constant_expression.  Register the
302         function if -Wno-invalid-constexpr was specified.
303         (explain_invalid_constexpr_fn): Don't return early if a function marked
304         'constexpr' that isn't actually a constant expression was called.
305         (non_const_var_error): Add a bool parameter.  Use constexpr_error.
306         (inline_asm_in_constexpr_error): Likewise.
307         (cxx_eval_constant_expression): Adjust calls to non_const_var_error
308         and inline_asm_in_constexpr_error.
309         (potential_constant_expression_1): Add a bool parameter.  Use
310         constexpr_error.
311         (require_potential_rvalue_constant_expression_fncheck): New function.
312         * cp-tree.h (require_potential_rvalue_constant_expression_fncheck):
313         Declare.
314         * method.cc (struct comp_info): Call
315         require_potential_rvalue_constant_expression_fncheck rather than
316         require_potential_rvalue_constant_expression.
318 2022-11-16  Jakub Jelinek  <jakub@redhat.com>
320         * typeck.cc (next_common_initial_sequence): Return false members have
321         different DECL_ALIGN.
322         (layout_compatible_type_p): Don't test TYPE_ALIGN of ENUMERAL_TYPE
323         or CLASS_TYPE_P.
325 2022-11-16  Jakub Jelinek  <jakub@redhat.com>
327         PR c++/107624
328         * call.cc (keep_unused_object_arg): New function.
329         (build_op_call): Use it.
330         (build_op_subscript): Likewise.
331         (build_new_op): Similarly for ARRAY_REF.
332         (build_new_method_call): Use it.
333         * decl.cc (grok_op_properties): For C++20 and earlier, if operator[]
334         is static member function, require exactly one parameter rather than
335         exactly two parameters.
337 2022-11-16  Jakub Jelinek  <jakub@redhat.com>
339         * typeck.cc (cp_build_modify_expr): Implement CWG 2654
340         - Un-deprecation of compound volatile assignments.  Remove
341         -Wvolatile warning about compound volatile assignments.
343 2022-11-16  Jakub Jelinek  <jakub@redhat.com>
345         * cp-tree.def (CONCEPT_DECL): Move to c-common.def.
346         * cp-objcp-common.cc (cp_common_init_ts): Don't handle CONCEPT_DECL
347         here.
348         * cp-tree.h (finish_concept_definition): Add ATTRS parameter.
349         * parser.cc (cp_parser_concept_definition): Parse attributes in
350         between identifier and =.  Adjust finish_concept_definition
351         caller.
352         * pt.cc (finish_concept_definition): Add ATTRS parameter.  Call
353         cplus_decl_attributes.
354         * constraint.cc (build_standard_check): If CONCEPT_DECL is
355         TREE_DEPRECATED, emit -Wdeprecated-declaration warnings.
357 2022-11-15  Marek Polacek  <polacek@redhat.com>
359         PR c++/107492
360         * decl.cc (grokdeclarator): Only emit a -Wignored-qualifiers warning
361         when funcdecl_p.
363 2022-11-15  Patrick Palka  <ppalka@redhat.com>
365         * constexpr.cc (potential_constant_expression_1)
366         <case *_CAST_EXPR>: Use
367         cast_valid_in_integral_constant_expression_p instead of
368         open coding it.
369         * constraint.cc (tsubst_valid_expression_requirement): Adjust
370         calls to tsubst_copy_and_build and tsubst_expr.
371         (tsubst_constraint): Likewise.
372         (satisfy_atom): Likewise.
373         (diagnose_trait_expr): Likewise.
374         * cp-tree.h (tsubst_copy_and_build): Remove i_c_e_p parameter.
375         (tsubst_expr): Likewise.
376         * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build
377         and tsubst_expr.
378         * pt.cc (expand_integer_pack): Likewise.
379         (instantiate_non_dependent_expr_internal): Likewise.
380         (tsubst_friend_function): Likewise.
381         (tsubst_attribute): Likewise.
382         (instantiate_class_template): Likewise.
383         (tsubst_template_arg): Likewise.
384         (gen_elem_of_pack_expansion_instantiation): Likewise.
385         (tsubst_fold_expr_init): Likewise.
386         (tsubst_pack_expansion): Likewise.
387         (tsubst_default_argument): Likewise.
388         (tsubst_function_decl): Likewise.
389         (tsubst_decl): Likewise.
390         (tsubst_arg_types): Likewise.
391         (tsubst_exception_specification): Likewise.
392         (tsubst): Likewise.
393         (tsubst_init): Likewise.
394         (tsubst_copy): Likewise.
395         (tsubst_omp_clause_decl): Likewise.
396         (tsubst_omp_clauses): Likewise.
397         (tsubst_copy_asm_operands): Likewise.
398         (tsubst_omp_for_iterator): Likewise.
399         (tsubst_expr): Likewise.  Remove i_c_e_p parameter.
400         (tsubst_omp_udr): Likewise.
401         (tsubst_non_call_postfix_expression): Likewise.  Remove i_c_e_p parameter.
402         (tsubst_lambda_expr): Likewise.
403         (tsubst_copy_and_build_call_args): Likewise.
404         (tsubst_copy_and_build): Likewise.  Remove i_c_e_p parameter.
405         <case IDENTIFIER_NODE>: Adjust call to finish_id_expression
406         following removal of i_c_e_p.
407         <case *_CAST_EXPR>: Remove C++98-specific cast validity check
408         guarded by i_c_e_p.
409         (maybe_instantiate_noexcept): Adjust calls to
410         tsubst_copy_and_build and tsubst_expr.
411         (instantiate_body): Likewise.
412         (instantiate_decl): Likewise.
413         (tsubst_initializer_list): Likewise.
414         (tsubst_enum): Likewise.
416 2022-11-15  Patrick Palka  <ppalka@redhat.com>
418         * cp-lang.cc (objcp_tsubst_copy_and_build): Remove
419         function_p parameter.
420         * cp-objcp-common.h (objcp_tsubst_copy_and_build):
421         Likewise.
422         * cp-tree.h (tsubst_copy_and_build): Likewise.
423         * init.cc (get_nsdmi): Adjust calls to tsubst_copy_and_build.
424         * pt.cc (expand_integer_pack): Likewise.
425         (instantiate_non_dependent_expr_internal): Likewise.
426         (tsubst_function_decl): Likewise.
427         (tsubst_arg_types): Likewise.
428         (tsubst_exception_specification): Likewise.
429         (tsubst): Likewise.
430         (tsubst_copy_asm_operands): Likewise.
431         (tsubst_expr): Likewise.
432         (tsubst_non_call_postfix_expression): Likewise.
433         (tsubst_lambda_expr): Likewise.
434         (tsubst_copy_and_build_call_args): Likewise.
435         (tsubst_copy_and_build): Remove function_p parameter
436         and adjust function comment.  Adjust recursive calls.
437         <case CALL_EXPR>: Update outdated comment about when
438         we can see an IDENTIFIER_NODE callee with koenig_p=false.
439         (maybe_instantiate_noexcept): Adjust calls to
440         tsubst_copy_and_build.
442 2022-11-15  Jakub Jelinek  <jakub@redhat.com>
444         * cp-tree.h (next_common_initial_seqence): Rename to ...
445         (next_common_initial_sequence): ... this.
446         * typeck.cc (next_common_initial_seqence): Rename to ...
447         (next_common_initial_sequence): ... this.
448         (layout_compatible_type_p): Call next_common_initial_sequence
449         rather than next_common_initial_seqence.
450         * semantics.cc (is_corresponding_member_aggr): Likewise.
452 2022-11-15  Jakub Jelinek  <jakub@redhat.com>
454         * decl.cc (grok_op_properties): Implement C++23 P2589R1
455         - static operator[].  Handle operator[] similarly to operator()
456         - allow static member functions, but pedwarn on it for C++20 and
457         older.  Unlike operator(), perform rest of checks on it though for
458         C++20.
459         * call.cc (add_operator_candidates): For operator[] with class
460         typed first parameter, pass that parameter as first_arg and
461         an adjusted arglist without that parameter.
463 2022-11-15  Patrick Palka  <ppalka@redhat.com>
465         PR c++/107638
466         * tree.cc (cxx_attribute_table): Don't conditionally exclude
467         the init_priority entry.
468         (handle_init_priority_attribute): Remove ATTRIBUTE_UNUSED.
469         Return error_mark_node if !SUPPORTS_INIT_PRIORITY.
471 2022-11-15  Marek Polacek  <polacek@redhat.com>
473         * call.cc (maybe_warn_dangling_reference): Don't warn when initializing
474         a non-const lvalue reference.
476 2022-11-14  Jason Merrill  <jason@redhat.com>
478         * pt.cc (tsubst_friend_function): Check satisfaction.
480 2022-11-14  Martin Liska  <mliska@suse.cz>
482         Revert:
483         2022-11-14  Martin Liska  <mliska@suse.cz>
485         * Make-lang.in: Support Sphinx based documentation.
487 2022-11-14  Martin Liska  <mliska@suse.cz>
489         Revert:
490         2022-11-14  Martin Liska  <mliska@suse.cz>
492         * Make-lang.in:
493         Support installation if sphinx-build is missing.
495 2022-11-10  Marek Polacek  <polacek@redhat.com>
497         * call.cc (std_pair_ref_ref_p): New.
498         (do_warn_dangling_reference): Also warn when the function returns
499         std::pair<const T&, const T&>.  Recurse into TARGET_EXPR_INITIAL.
500         (maybe_warn_dangling_reference): Don't return early if we're
501         initializing a std_pair_ref_ref_p.
503 2022-11-09  Jakub Jelinek  <jakub@redhat.com>
505         * tree.cc (handle_carries_dependency_attribute): New function.
506         (std_attribute_table): Add carries_dependency attribute.
507         * parser.cc (cp_parser_check_std_attribute): Add carries_dependency
508         attribute.
510 2022-11-09  Martin Liska  <mliska@suse.cz>
512         * Make-lang.in:
513         Support installation if sphinx-build is missing.
515 2022-11-09  Martin Liska  <mliska@suse.cz>
517         * Make-lang.in: Support Sphinx based documentation.
519 2022-11-09  Marek Polacek  <polacek@redhat.com>
521         PR c++/107363
522         * semantics.cc (finish_call_expr): Suppress OPT_Wpessimizing_move.
523         * typeck.cc (maybe_warn_pessimizing_move): Check warn_redundant_move
524         and warning_suppressed_p.  Adjust a message depending on return_p.
525         (check_return_expr): Don't suppress OPT_Wpessimizing_move here.
527 2022-11-08  Jason Merrill  <jason@redhat.com>
528             Jakub Jelinek  <jakub@redhat.com>
530         * cp-tree.h (fns_correspond): Declare.
531         * decl.cc (fns_correspond): New.
532         * call.cc (add_candidates): Look for op!= matching op==.
533         (joust): Complain about non-standard reversed tiebreaker.
534         (tourney): Fix champ_compared_to_predecessor logic.
535         (build_new_op): Don't complain about error_mark_node not having
536         'bool' type.
537         * pt.cc (tsubst_copy_and_build): Don't try to be permissive
538         when seen_error().
540 2022-11-06  Patrick Palka  <ppalka@redhat.com>
542         * tree.cc (cxx_attribute_table): Include init_priority entry
543         only if SUPPORTS_INIT_PRIORITY.
544         (handle_init_priority_attribute): Add ATTRIBUTE_UNUSED.  Assert
545         SUPPORTS_INIT_PRIORITY is true.
547 2022-11-04  Torbjörn SVENSSON  <torbjorn.svensson@foss.st.com>
548             Yvan ROUX  <yvan.roux@foss.st.com>
550         * mapper-client.cc: Use in-process client when networking is
551         disabled.
553 2022-11-03  Marek Polacek  <polacek@redhat.com>
555         PR c++/107488
556         * call.cc (do_warn_dangling_reference): Quash -Wdangling-reference
557         for member operator*.
559 2022-11-03  Patrick Palka  <ppalka@redhat.com>
561         PR c++/107179
562         * constraint.cc (tsubst_requires_expr): Make sure we're not
563         deferring access checks.
565 2022-11-03  Jason Merrill  <jason@redhat.com>
567         * parser.cc (cp_parser_template_declaration_after_parameters): Fix
568         concept parsing below C++20.
570 2022-11-03  Patrick Palka  <ppalka@redhat.com>
572         PR c++/93413
573         * decl2.cc (mark_used): Don't defer synthesis of virtual
574         functions.
576 2022-11-01  Nathan Sidwell  <nathan@acm.org>
578         * cp-tree.h (LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR): New.
579         (struct tree_lambda_expr): Add discriminator_sig bitfield.
580         (recrd_lambda_scope_sig_discriminator): Declare.
581         * lambda.cc (struct lambda_sig_count): New.
582         (lambda_discriminator): Add signature vector.
583         (start_lambda_scope): Adjust.
584         (compare_lambda_template_head, compare_lambda_sig): New.
585         (record_lambda_scope_sig_discriminator): New.
586         * mangle.cc (write_closure_type): Use the scope-sig discriminator for
587         ABI >= 18.  Emit abi mangling warning if needed.
588         * module.cc (trees_out::core_vals): Stream the new discriminator.
589         (trees_in::core_vals): Likewise.
590         * parser.cc (cp_parser_lambda_declarator_opt): Call
591         record_lambda_scope_sig_discriminator.
592         * pt.cc (tsubst_lambda_expr): Likewise.
594 2022-11-01  Nathan Sidwell  <nathan@acm.org>
596         * cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
597         (LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
598         (struct tree_lambda_expr): Make default_capture_mode &
599         discriminator_scope bitfields.
600         (record_null_lambda_scope) Delete.
601         (record_lambda_scope_discriminator): Declare.
602         * lambda.cc (struct lambda_discriminator): New struct.
603         (lambda_scope, lambda_scope_stack): Adjust types.
604         (lambda_count): Delete.
605         (struct tree_int): Delete.
606         (start_lambda_scope, finish_lambda_scope): Adjust.
607         (record_lambda_scope): Only record the scope.
608         (record_lambda_scope_discriminator): New.
609         * mangle.cc (write_closure_type_name): Adjust.
610         * module.cc (trees_out::core_vals): Likewise,
611         (trees_in::core_vals): Likewise.
612         * parser.cc (cp_parser_lambda_expression): Call
613         record_lambda_scope_discriminator.
614         * pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling.  Call
615         record_lambda_scope_discriminator. Commonize control flow on tsubsting
616         the operator function.
618 2022-11-01  Jason Merrill  <jason@redhat.com>
620         * parser.cc (make_call_declarator): Add std_attrs parm.
621         (cp_parser_lambda_declarator_opt): Pass it.
622         (cp_parser_direct_declarator): Pass it.
624 2022-11-01  Jason Merrill  <jason@redhat.com>
626         * decl.cc (finish_function): Set TREE_NOTHROW later in the function.
628 2022-11-01  Jason Merrill  <jason@redhat.com>
630         * decl.cc (duplicate_decls): Reformat loop.
631         * parser.cc (cp_parser_member_declaration): Add newline.
632         * semantics.cc: Remove newline.
634 2022-10-28  Marek Polacek  <polacek@redhat.com>
636         * call.cc (maybe_warn_dangling_reference): Enable the warning in
637         system headers if the decl isn't in a system header.
639 2022-10-28  Jason Merrill  <jason@redhat.com>
641         * decl.cc (grokdeclarator): Call decl_attributes before do_friend.
643 2022-10-28  Jakub Jelinek  <jakub@redhat.com>
645         * parser.cc (cp_parser_omp_all_clauses): Allow optional comma
646         before the first clause even in pragma syntax.
647         (cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj,
648         cp_parser_omp_flush, cp_parser_omp_scan_loop_body,
649         cp_parser_omp_ordered, cp_parser_omp_assumption_clauses,
650         cp_finish_omp_declare_variant, cp_parser_omp_declare_target,
651         cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires,
652         cp_parser_omp_error): Likewise.
654 2022-10-28  Joseph Myers  <joseph@codesourcery.com>
656         PR c/61469
657         * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P, ENUM_UNDERLYING_TYPE):
658         Remove.  Moved to c-common.h.
660 2022-10-27  Jakub Jelinek  <jakub@redhat.com>
662         PR c++/107379
663         * name-lookup.cc (push_namespace): Call find_namespace_slot again
664         after pushdecl as the hash table might be expanded during pushdecl.
666 2022-10-27  Nathan Sidwell  <nathan@acm.org>
668         * mangle.cc (write_closure_template_head): New.
669         (write_closure_type_name): Call it.
671 2022-10-27  Jakub Jelinek  <jakub@redhat.com>
673         PR c++/107382
674         PR c++/107383
675         * typeck.cc (cp_build_binary_op): Don't compute semantic_result_type
676         if result_type is NULL.
678 2022-10-26  Marek Polacek  <polacek@redhat.com>
680         PR c++/106393
681         * call.cc (expr_represents_temporary_p): New, factored out of...
682         (conv_binds_ref_to_temporary): ...here.  Don't return false just
683         because a ck_base is missing.  Use expr_represents_temporary_p.
684         (do_warn_dangling_reference): New.
685         (maybe_warn_dangling_reference): New.
686         (extend_ref_init_temps): Call maybe_warn_dangling_reference.
687         * cp-tree.h: Adjust comment.
688         * typeck.cc (check_return_expr): Suppress -Wdangling-reference
689         warnings.
691 2022-10-25  Nathan Sidwell  <nathan@acm.org>
693         * parser.cc (synthesize_implicit_template_parm): Fix thinko about
694         mark the new parm DECL_VIRTUAL_P.  Avoid unneccessary tree_last call.
696 2022-10-25  Patrick Palka  <ppalka@redhat.com>
698         * constraint.cc (resolve_function_concept_overload): Explicitly
699         pass complain=tf_none to coerce_template_parms.
700         (resolve_concept_check): Likewise.
701         (normalize_concept_check): Likewise.
702         * cp-tree.h (coerce_template_parms): Declare the main overload
703         and default its last parameter to true.  Remove wrapper overloads.
704         * pt.cc (determine_specialization): Adjust calls to
705         coerce_template_parms and coerce_innermost_template_parms after
706         removing their last parameter.
707         (coerce_template_args_for_ttp): Likewise.
708         (coerce_ttp_args_for_tta): Likewise.
709         (coerce_template_template_parms): Likewise.
710         (coerce_template_parms): Remove use_default_args parameter and
711         adjust function comment.  Document default argument.  Remove
712         wrapper overloads.  No longer static.
713         (coerce_innermost_template_parms): Remove use_default_args
714         parameter.  Default require_all_args to true.
715         (lookup_template_class): As with determine_specialization.
716         (finish_template_variable): Likewise.
717         (tsubst_decl): Likewise.
718         (instantiate_alias_template): Likewise.
719         (fn_type_unification): Likewise.
720         (resolve_overloaded_unification): Likewise.
721         (resolve_nondeduced_context): Likewise.
722         (get_partial_spec_bindings): Likewise.
724 2022-10-25  Jason Merrill  <jason@redhat.com>
726         * constexpr.cc (find_failing_clause_r): Re-add the call to
727         contextual_conv_bool.
729 2022-10-25  Patrick Palka  <ppalka@redhat.com>
731         PR c++/106848
732         PR c++/102600
733         * module.cc (trees_out::core_vals): Stream TYPE_MAX_VALUE and
734         TYPE_MIN_VALUE of ENUMERAL_TYPE.
735         (trees_in::core_vals): Likewise.
736         (trees_out::write_enum_def): Don't stream them here.
737         (trees_in::read_enum_def): Likewise.
739 2022-10-25  Jason Merrill  <jason@redhat.com>
741         * constexpr.cc (class constexpr_global_ctx): Add modifiable field,
742         get_value, get_value_ptr, put_value, remove_value, flush_modifiable
743         member functions.
744         (class modifiable_tracker): New.
745         (cxx_eval_internal_function): Use it.
746         (diagnose_failing_condition): Strip CLEANUP_POINT_EXPR.
748 2022-10-25  Jason Merrill  <jason@redhat.com>
750         * constexpr.cc (fold_operand): New function.
751         (find_failing_clause_r): Add const.
752         (find_failing_clause): Add const.
753         (diagnose_failing_condition): Add ctx parameter.
754         (cxx_eval_internal_function): Pass it.
755         * semantics.cc (diagnose_failing_condition): Move to constexpr.cc.
756         * cp-tree.h: Adjust.
758 2022-10-24  Jason Merrill  <jason@redhat.com>
760         * cp-gimplify.cc (fold_builtin_source_location)
761         * vtable-class-hierarchy.cc (register_all_pairs): Simplify calls to
762         build_string_literal.
763         (build_string_from_id): Remove.
765 2022-10-24  Marek Polacek  <polacek@redhat.com>
767         PR c++/107276
768         * typeck.cc (treat_lvalue_as_rvalue_p): Check the return value of move.
770 2022-10-24  Jakub Jelinek  <jakub@redhat.com>
772         PR c++/107358
773         * typeck.cc (cp_build_binary_op): Pass operands before excess precision
774         promotions to scalar_to_vector call.
776 2022-10-24  Jakub Jelinek  <jakub@redhat.com>
778         PR c++/105774
779         * constexpr.cc (cxx_eval_increment_expression): For signed types
780         that promote to int, evaluate PLUS_EXPR or MINUS_EXPR in int type.
782 2022-10-24  Arsen Arsenović  <arsen@aarsen.me>
784         * cp-tree.h (DECL_MAIN_P): Move most logic, besides the hosted
785         check, from here...
786         (DECL_MAIN_ANY_P): ... to here, so that it can be reused ...
787         (DECL_MAIN_FREESTANDING_P): ... here, with an additional
788         constraint on (hosted OR return type == int)
789         * decl.cc (finish_function): Use DECL_MAIN_FREESTANDING_P
790         instead of DECL_MAIN_P, to loosen the hosted requirement, but
791         check noreturn, before adding implicit returns.
793 2022-10-21  Jakub Jelinek  <jakub@redhat.com>
795         PR c++/107295
796         * constexpr.cc (reduced_constant_expression_p) <case CONSTRUCTOR>:
797         Return false for VECTOR_TYPE CONSTRUCTORs even without
798         CONSTRUCTOR_NO_CLEARING set on them.
799         (cxx_eval_bare_aggregate): If constant but !changed, fold before
800         returning VECTOR_TYPE_P CONSTRUCTOR.
801         (cxx_eval_constant_expression) <case CONSTRUCTOR>: Don't fold
802         TREE_CONSTANT CONSTRUCTOR, just return it.
804 2022-10-21  Jakub Jelinek  <jakub@redhat.com>
806         PR c++/106863
807         * semantics.cc (finish_compound_literal): For void{}, if
808         processing_template_decl return a COMPOUND_LITERAL_P
809         CONSTRUCTOR rather than void_node.
811 2022-10-20  Patrick Palka  <ppalka@redhat.com>
813         * pt.cc (lookup_and_finish_template_variable): Don't
814         instantiate if the template's scope is dependent.
815         (tsubst_copy) <case TEMPLATE_DECL>: Pass entering_scope=true
816         when substituting the class scope.
818 2022-10-20  Patrick Palka  <ppalka@redhat.com>
820         PR c++/102963
821         * module.cc (node_template_info): Handle CONCEPT_DECL.
823 2022-10-20  Jonathan Wakely   <jwakely@redhat.com>
824             Ulrich Drepper  <drepper@redhat.com>
826         * Make-lang.in: Add rules to generate std-name-hint.gperf.  Adjust
827         rule to generate std-name-hint.h to allow chain rule.
828         * std-name-hint.h: Regenerated.
829         * std-name-hint.gperf: This file is now generated.
830         * cxxapi-data.csv: New file.  CSV file with C++ API data.
831         * gen-cxxapi-file.py: New file.  Generate std-name-hint.gperf
832         and module export source (in future).
834 2022-10-19  Marek Polacek  <polacek@redhat.com>
836         PR c++/85043
837         * typeck.cc (maybe_warn_about_useless_cast): Don't warn when
838         a glvalue is cast to a non-reference type.
840 2022-10-18  Patrick Palka  <ppalka@redhat.com>
842         PR c++/105045
843         * module.cc (trees_out::tpl_parms_fini): Don't assume default
844         template arguments must be trailing.
845         (trees_in::tpl_parms_fini): Likewise.
847 2022-10-18  Jakub Jelinek  <jakub@redhat.com>
849         PR c++/106654
850         * cp-tree.h (build_assume_call): Declare.
851         * parser.cc (cp_parser_omp_assumption_clauses): Use build_assume_call.
852         * cp-gimplify.cc (build_assume_call): New function.
853         (process_stmt_assume_attribute): Use build_assume_call.
854         * pt.cc (tsubst_copy_and_build): Likewise.
856 2022-10-17  Patrick Palka  <ppalka@redhat.com>
858         PR c++/101449
859         * module.cc (trees_out::write_function_def): Stream the
860         parms and result of the constexpr_fundef entry.
861         (trees_in::read_function_def): Likewise.
863 2022-10-14  Patrick Palka  <ppalka@redhat.com>
865         PR c++/106304
866         * constexpr.cc (cxx_dynamic_cast_fn_p): Check for abi_node
867         instead of global_namespace.
868         * rtti.cc (build_dynamic_cast_1): Set DECL_CONTEXT and
869         DECL_SOURCE_LOCATION when building dynamic_cast_node.  Push
870         it into the namespace.
872 2022-10-14  Jakub Jelinek  <jakub@redhat.com>
874         * cp-tree.h (extended_float_type_p): Return true for
875         bfloat16_type_node.
876         * typeck.cc (cp_compare_floating_point_conversion_ranks): Set
877         extended{1,2} if mv{1,2} is bfloat16_type_node.  Adjust comment.
879 2022-10-14  Jakub Jelinek  <jakub@redhat.com>
881         PR c/82071
882         PR c/87390
883         PR c++/107097
884         * cp-tree.h (cp_ep_convert_and_check): Remove.
885         * cvt.cc (cp_ep_convert_and_check): Remove.
886         * call.cc (build_conditional_expr): Use excess precision for ?: with
887         one arm floating and another integral.  Don't convert first to
888         semantic result type from integral types.
889         (convert_like_internal): Don't call cp_ep_convert_and_check, instead
890         just strip EXCESS_PRECISION_EXPR before calling cp_convert_and_check
891         or cp_convert.
892         * typeck.cc (cp_build_binary_op): Set may_need_excess_precision
893         for comparisons or SPACESHIP_EXPR with at least one operand integral.
894         Don't compute semantic_result_type if build_type is non-NULL.  Call
895         cp_convert_and_check instead of cp_ep_convert_and_check.
897 2022-10-14  Jakub Jelinek  <jakub@redhat.com>
899         PR middle-end/323
900         PR c++/107097
901         * parser.cc (cp_parser_primary_expression): Handle
902         EXCESS_PRECISION_EXPR with REAL_CST operand the same as REAL_CST.
903         * cvt.cc (cp_ep_convert_and_check): New function.
904         * call.cc (build_conditional_expr): Add excess precision support.
905         When type_after_usual_arithmetic_conversions returns error_mark_node,
906         use gcc_checking_assert that it is because of uncomparable floating
907         point ranks instead of checking all those conditions and make it
908         work also with complex types.
909         (convert_like_internal): Likewise.  Add NESTED_P argument, pass true
910         to recursive calls to convert_like.
911         (convert_like): Add NESTED_P argument, pass it through to
912         convert_like_internal.  For other overload pass false to it.
913         (convert_like_with_context): Pass false to NESTED_P.
914         (convert_arg_to_ellipsis): Add excess precision support.
915         (magic_varargs_p): For __builtin_is{finite,inf,inf_sign,nan,normal}
916         and __builtin_fpclassify return 2 instead of 1, document what it
917         means.
918         (build_over_call): Don't handle former magic 2 which is no longer
919         used, instead for magic 1 remove EXCESS_PRECISION_EXPR.
920         (perform_direct_initialization_if_possible): Pass false to NESTED_P
921         convert_like argument.
922         * constexpr.cc (cxx_eval_constant_expression): Handle
923         EXCESS_PRECISION_EXPR.
924         (potential_constant_expression_1): Likewise.
925         * pt.cc (tsubst_copy, tsubst_copy_and_build): Likewise.
926         * cp-tree.h (cp_ep_convert_and_check): Declare.
927         * cp-gimplify.cc (cp_fold): Handle EXCESS_PRECISION_EXPR.
928         * typeck.cc (cp_common_type): For COMPLEX_TYPEs, return error_mark_node
929         if recursive call returned it.
930         (convert_arguments): For magic 1 remove EXCESS_PRECISION_EXPR.
931         (cp_build_binary_op): Add excess precision support.  When
932         cp_common_type returns error_mark_node, use gcc_checking_assert that
933         it is because of uncomparable floating point ranks instead of checking
934         all those conditions and make it work also with complex types.
935         (cp_build_unary_op): Likewise.
936         (cp_build_compound_expr): Likewise.
937         (build_static_cast_1): Remove EXCESS_PRECISION_EXPR.
939 2022-10-13  Jason Merrill  <jason@redhat.com>
941         * cp-tree.h: Fix whitespace.
942         * parser.h: Fix whitespace.
943         * decl.cc: Fix whitespace.
944         * parser.cc: Fix whitespace.
945         * pt.cc: Fix whitespace.
947 2022-10-13  Martin Liska  <mliska@suse.cz>
949         * vtable-class-hierarchy.cc (vtv_generate_init_routine): Emit
950         an artificial variable that would be put into .preinit_array
951         section.
953 2022-10-13  Marek Polacek  <polacek@redhat.com>
955         PR c++/106925
956         * except.cc (maybe_splice_retval_cleanup): Check current_function_decl.
957         Make the bool const.
959 2022-10-12  Marek Polacek  <polacek@redhat.com>
961         * call.cc (standard_conversion): Remove LOOKUP_PREFER_RVALUE code.
962         (reference_binding): Honor clk_implicit_rval even pre-C++20.
963         (implicit_conversion_1): Remove LOOKUP_PREFER_RVALUE code.
964         (build_user_type_conversion_1): Likewise.
965         (convert_like_internal): Likewise.
966         (build_over_call): Likewise.
967         * cp-tree.h (LOOKUP_PREFER_RVALUE): Remove.
968         (LOOKUP_NO_NARROWING): Adjust definition.
969         * except.cc (build_throw): Don't perform two overload resolutions.
970         * typeck.cc (maybe_warn_pessimizing_move): Don't use
971         LOOKUP_PREFER_RVALUE.
972         (check_return_expr): Don't perform two overload resolutions.
974 2022-10-12  Jason Merrill  <jason@redhat.com>
976         DR 2631
977         * cp-tree.h (source_location_current_p): Remove.
978         * name-lookup.h (struct cp_binding_level): Remove
979         immediate_fn_ctx_p.
980         * call.cc (in_immediate_context): All default args
981         and DMI are potentially immediate context.
982         (immediate_invocation_p): Don't treat source_location specially.
983         (struct in_consteval_if_p_temp_override): Move to cp-tree.h.
984         * constexpr.cc (get_nth_callarg): Move to cp-tree.h.
985         * cp-gimplify.cc (cp_fold_r): Don't fold consteval.
986         * name-lookup.cc (begin_scope): Don't set immediate_fn_ctx_p.
987         * parser.cc (cp_parser_lambda_declarator_opt): Likewise.
988         (cp_parser_direct_declarator): Likewise.
989         * pt.cc (tsubst_default_argument): Open sk_function_parms level.
990         * tree.cc (source_location_current_p): Remove.
991         (bot_replace): Fold consteval here.
992         (break_out_target_exprs): Handle errors.
994 2022-10-11  Patrick Palka  <ppalka@redhat.com>
996         PR c++/100134
997         * pt.cc (tsubst_friend_function): Propagate DECL_MODULE_PURVIEW_P
998         from the introduced namespace-scope function to the namespace.
1000 2022-10-11  Patrick Palka  <ppalka@redhat.com>
1002         PR c++/99377
1003         * module.cc (lazy_load_binding): Clear processing_template_decl.
1004         (lazy_load_pendings): Likewise.
1006 2022-10-10  Nathan Sidwell  <nathan@acm.org>
1008         * mangle.cc (write_prefix): Add VAR_DECL & FIELD_DECL to
1009         substitution table under abi=18.  Note possible mismatch.
1011 2022-10-10  Marek Polacek  <polacek@redhat.com>
1013         PR c++/106937
1014         * error.cc: Include "attribs.h".
1015         (dump_type_prefix): Print only GNU attributes here.
1016         (dump_type_suffix): Print standard attributes here.
1018 2022-10-08  Jason Merrill  <jason@redhat.com>
1020         * cp-tree.h (TARGET_EXPR_ELIDING_P): New.
1021         (unsafe_copy_elision_p, set_target_expr_eliding)
1022         (cp_build_init_expr): Declare.
1023         * call.cc (unsafe_copy_elision_p): No longer static.
1024         (build_over_call, build_special_member_call)
1025         (build_new_method_call): Use cp_build_init_expr.
1026         * coroutines.cc (expand_one_await_expression)
1027         (build_actor_fn, flatten_await_stmt, handle_nested_conditionals)
1028         (await_statement_walker, morph_fn_to_coro): Use cp_build_init_expr.
1029         * cp-gimplify.cc (cp_gimplify_init_expr)
1030         (cp_gimplify_expr): Check TARGET_EXPR_ELIDING_P.
1031         (cp_fold_r): Propagate it.
1032         (cp_fold): Use cp_build_init_expr.
1033         * decl.cc (check_initializer): Use cp_build_init_expr.
1034         * except.cc (build_throw): Use cp_build_init_expr.
1035         * init.cc (get_nsdmi): Call set_target_expr_eliding.
1036         (perform_member_init, expand_default_init, expand_aggr_init_1)
1037         (build_new_1, build_vec_init): Use cp_build_init_expr.
1038         * method.cc (do_build_copy_constructor): Use cp_build_init_expr.
1039         * semantics.cc (simplify_aggr_init_expr, finalize_nrv_r)
1040         (finish_omp_reduction_clause): Use cp_build_init_expr.
1041         * tree.cc (build_target_expr): Call set_target_expr_eliding.
1042         (bot_manip): Copy TARGET_EXPR_ELIDING_P.
1043         * typeck.cc (cp_build_modify_expr): Call set_target_expr_eliding.
1044         (check_return_expr): Use cp_build_modify_expr.
1045         * typeck2.cc (split_nonconstant_init_1)
1046         (split_nonconstant_init): Use cp_build_init_expr.
1047         (massage_init_elt): Call set_target_expr_eliding.
1048         (process_init_constructor_record): Clear TARGET_EXPR_ELIDING_P on
1049         unsafe copy elision.
1050         (set_target_expr_eliding, cp_build_init_expr): New.
1052 2022-10-07  Marek Polacek  <polacek@redhat.com>
1054         PR c++/107085
1055         * call.cc (conv_binds_ref_to_temporary): New.
1056         (ref_conv_binds_directly): Rename to...
1057         (ref_conv_binds_to_temporary): ...this.  Use
1058         conv_binds_ref_to_temporary.
1059         * cp-tree.h (ref_conv_binds_directly): Rename to...
1060         (ref_conv_binds_to_temporary): ...this.
1061         * method.cc (ref_xes_from_temporary): Use ref_conv_binds_to_temporary.
1062         * parser.cc (warn_for_range_copy): Likewise.
1064 2022-10-07  Qing Zhao  <qing.zhao@oracle.com>
1066         * module.cc (trees_out::core_bools): Stream out new bit
1067         decl_not_flexarray.
1068         (trees_in::core_bools): Stream in new bit decl_not_flexarray.
1070 2022-10-07  Patrick Palka  <ppalka@redhat.com>
1072         * module.cc (trees_out::mark_class_def): Guard against
1073         DECL_BIT_FIELD_REPRESENTATIVE not being a decl.
1075 2022-10-07  Jason Merrill  <jason@redhat.com>
1077         * init.cc (expand_default_init): Also push the INIT_EXPR inside a
1078         CLEANUP_POINT_EXPR.
1080 2022-10-07  Patrick Palka  <ppalka@redhat.com>
1082         PR c++/104433
1083         * module.cc (trees_out::core_bools): Don't override
1084         DECL_EXTERNAL to true for static variables from an inline
1085         function.
1087 2022-10-07  Martin Liska  <mliska@suse.cz>
1089         * module.cc (enum module_state_counts): Use array size.
1090         * name-lookup.cc (class namespace_limit_reached): Likewise.
1091         (class module_state): Move up in the file.
1093 2022-10-07  Jakub Jelinek  <jakub@redhat.com>
1095         * parser.cc (cp_parser_check_std_attribute): Only do checks if
1096         attribute is a standard attribute or in gnu namespace and only
1097         lookup other attributes in those namespaces.
1098         * cp-gimplify.cc (lookup_hotness_attribute): Adjust function comment.
1099         Only return true for standard attribute or gnu namespace attribute.
1100         (remove_hotness_attribute): Only remove hotness attributes when
1101         they are standard or in gnu namespace, implement it in a single
1102         loop rather than former 4 now 8 remove_attribute calls.
1104 2022-10-06  Jason Merrill  <jason@redhat.com>
1106         * coroutines.cc (expand_one_await_expression): Change conversion
1107         to VIEW_CONVERT_EXPR.
1108         * cp-gimplify.cc (cp_genericize_r) [CONVERT_EXPR]: Add assert.
1110 2022-10-06  Joseph Myers  <joseph@codesourcery.com>
1112         * lex.cc (init_reswords): Handle D_EXT11.
1114 2022-10-06  Patrick Palka  <ppalka@redhat.com>
1116         * pt.cc (optimize_specialization_lookup_p): Remove.
1117         (retrieve_specialization): Assume the above returns false
1118         and simplify accordingly.
1119         (register_specialization): Likewise.
1121 2022-10-06  Jakub Jelinek  <jakub@redhat.com>
1123         * parser.cc (cp_parser_omp_assumption_clauses): Emit IFN_ASSUME
1124         call for holds clause on assume construct.
1126 2022-10-06  Jakub Jelinek  <jakub@redhat.com>
1128         PR c++/106654
1129         * cp-tree.h (process_stmt_assume_attribute): Implement C++23
1130         P1774R8 - Portable assumptions.  Declare.
1131         (diagnose_failing_condition): Declare.
1132         (find_failing_clause): Likewise.
1133         * parser.cc (assume_attr): New enumerator.
1134         (cp_parser_parenthesized_expression_list): Handle assume_attr.
1135         Remove identifier variable, for id_attr push the identifier into
1136         expression_list right away instead of inserting it before all the
1137         others at the end.
1138         (cp_parser_conditional_expression): New function.
1139         (cp_parser_constant_expression): Use it.
1140         (cp_parser_statement): Handle assume attribute.
1141         (cp_parser_expression_statement): Likewise.
1142         (cp_parser_gnu_attribute_list): Use assume_attr for assume
1143         attribute.
1144         (cp_parser_std_attribute): Likewise.  Handle standard assume
1145         attribute like gnu::assume.
1146         * cp-gimplify.cc (process_stmt_assume_attribute): New function.
1147         * constexpr.cc: Include fold-const.h.
1148         (find_failing_clause_r, find_failing_clause): New functions,
1149         moved from semantics.cc with ctx argument added and if non-NULL,
1150         call cxx_eval_constant_expression rather than fold_non_dependent_expr.
1151         (cxx_eval_internal_function): Handle IFN_ASSUME.
1152         (potential_constant_expression_1): Likewise.
1153         * pt.cc (tsubst_copy_and_build): Likewise.
1154         * semantics.cc (diagnose_failing_condition): New function.
1155         (find_failing_clause_r, find_failing_clause): Moved to constexpr.cc.
1156         (finish_static_assert): Use it.  Add auto_diagnostic_group.
1158 2022-10-05  Jason Merrill  <jason@redhat.com>
1160         * tree.cc (lvalue_kind) [VIEW_CONVERT_EXPR]: Change prvalue to
1161         xvalue.
1163 2022-10-04  Jason Merrill  <jason@redhat.com>
1165         PR c++/107154
1166         * cp-gimplify.cc (cp_genericize_init_expr): Use iloc_sentinel.
1167         (cp_genericize_target_expr): Likewise.
1169 2022-10-04  Patrick Palka  <ppalka@redhat.com>
1171         PR c++/107136
1172         * Make-lang.in (CP_PLUGIN_HEADERS): Add cp-trait.def.
1174 2022-10-04  Jakub Jelinek  <jakub@redhat.com>
1176         * cp-tree.h (struct omp_declare_target_attr): Rename to ...
1177         (cp_omp_declare_target_attr): ... this.  Add device_type member.
1178         (omp_begin_assumes_data): Rename to ...
1179         (cp_omp_begin_assumes_data): ... this.
1180         (struct saved_scope): Change types of omp_declare_target_attribute
1181         and omp_begin_assumes.
1182         * parser.cc (cp_parser_omp_clause_device_type): Uncomment
1183         check_no_duplicate_clause call.
1184         (cp_parser_omp_all_clauses): Fix up pasto, c_name for OMP_CLAUSE_LINK
1185         should be "link" rather than "to".
1186         (cp_parser_omp_declare_target): Adjust for omp_declare_target_attr
1187         to cp_omp_declare_target_attr changes, push -1 as device_type.  Use
1188         error_at rather than warning_at for declare target with only
1189         device_type clauses.
1190         (OMP_BEGIN_DECLARE_TARGET_CLAUSE_MASK): Define.
1191         (cp_parser_omp_begin): Add begin declare target support.  Adjust
1192         for omp_begin_assumes_data to cp_omp_begin_assumes_data change.
1193         (cp_parser_omp_end): Adjust for the
1194         omp_declare_target_attr to cp_omp_declare_target_attr and
1195         omp_begin_assumes_data to cp_omp_begin_assumes_data type changes,
1196         adjust diagnostics wording and simplify format strings for easier
1197         translations.
1198         * semantics.cc (finish_translation_unit): Likewise.
1199         * decl2.cc (cplus_decl_attributes): If device_type was present on
1200         begin declare target, add "omp declare target host" and/or
1201         "omp declare target nohost" attributes.
1203 2022-10-03  Jakub Jelinek  <jakub@redhat.com>
1205         * cp-tree.h (BCS_STMT_EXPR): New enumerator.
1206         * name-lookup.h (enum scope_kind): Add sk_stmt_expr.
1207         * name-lookup.cc (begin_scope): Handle sk_stmt_expr like sk_block.
1208         * semantics.cc (begin_compound_stmt): For BCS_STMT_EXPR use
1209         sk_stmt_expr.
1210         * parser.cc (cp_parser_statement_expr): Use BCS_STMT_EXPR instead of
1211         BCS_NORMAL.
1212         * decl.cc (struct named_label_entry): Add in_stmt_expr.
1213         (poplevel_named_label_1): Handle sk_stmt_expr.
1214         (check_previous_goto_1): Diagnose entering of statement expression.
1215         (check_goto): Likewise.
1217 2022-10-03  Patrick Palka  <ppalka@redhat.com>
1219         * constraint.cc (diagnose_trait_expr): Use CPTK_IS_SAME instead
1220         of CPTK_IS_SAME_AS.
1221         * cp-trait.def (IS_SAME_AS): Rename to ...
1222         (IS_SAME): ... this.
1223         * pt.cc (alias_ctad_tweaks): Use CPTK_IS_SAME instead of
1224         CPTK_IS_SAME_AS.
1225         * semantics.cc (trait_expr_value): Likewise.
1226         (finish_trait_expr): Likewise.
1228 2022-10-01  Patrick Palka  <ppalka@redhat.com>
1230         * semantics.cc (trait_expr_value): Make cp_trait_kind switch
1231         statement exhaustive.
1232         (finish_trait_expr): Likewise.
1233         (finish_trait_type): Likewise.
1235 2022-10-01  Jason Merrill  <jason@redhat.com>
1237         * init.cc (build_vec_init): Clear from_array for CONSTRUCTOR
1238         initializer.
1240 2022-10-01  Jason Merrill  <jason@redhat.com>
1242         * cp-gimplify.cc (cp_genericize_init): Also convert the result of
1243         split_nonconstant_init to void.
1245 2022-09-30  Patrick Palka  <ppalka@redhat.com>
1247         * constraint.cc (diagnose_trait_expr): Likewise.
1248         * cp-objcp-common.cc (names_builtin_p): Likewise.
1249         * cp-tree.h (enum cp_trait_kind): Likewise.
1250         * cxx-pretty-print.cc (pp_cxx_trait): Likewise.
1251         * parser.cc (cp_keyword_starts_decl_specifier_p): Likewise.
1252         (cp_parser_primary_expression): Likewise.
1253         (cp_parser_trait): Likewise.
1254         (cp_parser_simple_type_specifier): Likewise.
1255         * cp-trait.def: New file.
1257 2022-09-30  Jason Merrill  <jason@redhat.com>
1259         * cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: Collapse
1260         TARGET_EXPR within TARGET_EXPR.
1261         * constexpr.cc (cxx_eval_outermost_constant_expr): Avoid
1262         adding redundant TARGET_EXPR.
1263         * cp-tree.h (target_expr_needs_replace): VEC_INIT_EXPR doesn't.
1265 2022-09-29  Patrick Palka  <ppalka@redhat.com>
1267         PR c++/102576
1268         * pt.cc (listify): Use lookup_qualified_name instead of
1269         get_namespace_binding.
1271 2022-09-29  Jason Merrill  <jason@redhat.com>
1273         * class.cc (check_methods): Call constraints_satisfied_p.
1275 2022-09-29  Jason Merrill  <jason@redhat.com>
1277         * constexpr.cc (potential_constant_expression_1): Look into
1278         DECL_INITIAL.  Use location wrappers.
1280 2022-09-29  Jason Merrill  <jason@redhat.com>
1282         PR c++/93046
1283         * call.cc (build_conditional_expr): For a?:c extension, treat
1284         a reused class prvalue as an xvalue.
1286 2022-09-29  Jason Merrill  <jason@redhat.com>
1288         * call.cc (build_conditional_expr): Set TARGET_EXPR_NO_ELIDE on the
1289         outer TARGET_EXPR.
1291 2022-09-29  Patrick Palka  <ppalka@redhat.com>
1293         * constraint.cc (diagnose_trait_expr): Handle CPTK_REMOVE_CV,
1294         CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1295         * cp-objcp-common.cc (names_builtin_p): Likewise.
1296         * cp-tree.h (enum cp_trait_kind): Add CPTK_REMOVE_CV,
1297         CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1298         * cxx-pretty-print.cc (pp_cxx_trait): Handle CPTK_REMOVE_CV,
1299         CPTK_REMOVE_REFERENCE and CPTK_REMOVE_CVREF.
1300         * parser.cc (cp_keyword_starts_decl_specifier_p): Return true
1301         for RID_REMOVE_CV, RID_REMOVE_REFERENCE and RID_REMOVE_CVREF.
1302         (cp_parser_trait): Handle RID_REMOVE_CV, RID_REMOVE_REFERENCE
1303         and RID_REMOVE_CVREF.
1304         (cp_parser_simple_type_specifier): Likewise.
1305         * semantics.cc (finish_trait_type): Likewise.
1307 2022-09-29  Patrick Palka  <ppalka@redhat.com>
1309         * cp-objcp-common.cc (cp_common_init_ts): Replace
1310         UNDERLYING_TYPE with TRAIT_TYPE.
1311         * cp-tree.def (TRAIT_TYPE): Define.
1312         (UNDERLYING_TYPE): Remove.
1313         * cp-tree.h (TRAIT_TYPE_KIND_RAW): Define.
1314         (TRAIT_TYPE_KIND): Define.
1315         (TRAIT_TYPE_TYPE1): Define.
1316         (TRAIT_TYPE_TYPE2): Define.
1317         (WILDCARD_TYPE_P): Return true for TRAIT_TYPE.
1318         (finish_trait_type): Declare.
1319         * cxx-pretty-print.cc (cxx_pretty_printer::primary_expression):
1320         Adjust after renaming pp_cxx_trait_expression.
1321         (cxx_pretty_printer::simple_type_specifier) <case TRAIT_TYPE>:
1322         New.
1323         (cxx_pretty_printer::type_id): Replace UNDERLYING_TYPE with
1324         TRAIT_TYPE.
1325         (pp_cxx_trait_expression): Rename to ...
1326         (pp_cxx_trait): ... this.  Handle TRAIT_TYPE as well.  Correct
1327         pretty printing of the trailing arguments.
1328         * cxx-pretty-print.h (pp_cxx_trait_expression): Rename to ...
1329         (pp_cxx_trait_type): ... this.
1330         * error.cc (dump_type) <case UNDERLYING_TYPE>: Remove.
1331         <case TRAIT_TYPE>: New.
1332         (dump_type_prefix): Replace UNDERLYING_WITH with TRAIT_TYPE.
1333         (dump_type_suffix): Likewise.
1334         * mangle.cc (write_type) <case UNDERLYING_TYPE>: Remove.
1335         <case TRAIT_TYPE>: New.
1336         * module.cc (trees_out::type_node) <case UNDERLYING_TYPE>:
1337         Remove.
1338         <case TRAIT_TYPE>: New.
1339         (trees_in::tree_node): Likewise.
1340         * parser.cc (cp_parser_primary_expression): Adjust after
1341         renaming cp_parser_trait_expr.
1342         (cp_parser_trait_expr): Rename to ...
1343         (cp_parser_trait): ... this.  Call finish_trait_type for traits
1344         that yield a type.
1345         (cp_parser_simple_type_specifier): Adjust after renaming
1346         cp_parser_trait_expr.
1347         * pt.cc (for_each_template_parm_r) <case UNDERLYING_TYPE>:
1348         Remove.
1349         <case TRAIT_TYPE>: New.
1350         (tsubst): Likewise.
1351         (unify): Replace UNDERLYING_TYPE with TRAIT_TYPE.
1352         (dependent_type_p_r): Likewise.
1353         * semantics.cc (finish_underlying_type): Don't return
1354         UNDERLYING_TYPE anymore when processing_template_decl.
1355         (finish_trait_type): Define.
1356         * tree.cc (strip_typedefs) <case UNDERLYING_TYPE>: Remove.
1357         <case TRAIT_TYPE>: New.
1358         (cp_walk_subtrees): Likewise.
1359         * typeck.cc (structural_comptypes): Likewise.
1361 2022-09-29  Nathan Sidwell  <nathan@acm.org>
1363         PR c++/100616
1364         * module.cc (enum tree_tag): Add tt_nttp_var.
1365         (trees_out::decl_node): Handle NTTP objects.
1366         (trees_in::tree_node): Handle tt_nttp_var.
1367         (depset::hash::add_binding_entry): Skip NTTP objects.
1369 2022-09-28  Eugene Rozenfeld  <erozen@microsoft.com>
1371         * module.cc (write_location): Write discriminator.
1372         (read_location): Read discriminator.
1374 2022-09-28  Nathan Sidwell  <nathan@acm.org>
1376         * cp-tree.h (DECL_NTTP_OBJECT_P): New.
1377         (template_parm_object_p): Delete.
1378         (build_template_parm_object): Declare.
1379         * cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P.
1380         * error.cc (dump_simple_decl): Likewise.
1381         * mangle.cc (write_template_arg): Likewise.
1382         * pt.cc (template_parm_object_p): Delete.
1383         (create_template_parm_object): Separated out checking from ...
1384         (get_template_parm_object): ... this, new external entry point.
1386 2022-09-27  Marek Polacek  <polacek@redhat.com>
1388         PR c++/101165
1389         PR c++/106882
1390         * call.cc (reference_binding): Check clk_implicit_rval in C++20 only.
1391         * cp-tree.h (unparenthesized_id_or_class_member_access_p): Declare.
1392         * pt.cc (unparenthesized_id_or_class_member_access_p): New function,
1393         broken out of...
1394         (do_auto_deduction): ...here.  Use it.  In C++23, maybe call
1395         treat_lvalue_as_rvalue_p.
1396         * tree.cc (xvalue_p): Check & clk_rvalueref, not == clk_rvalueref.
1397         * typeck.cc (check_return_expr): Allow implicit move for functions
1398         returning a reference as well, or when the return value type is not
1399         a scalar type.
1401 2022-09-27  Marek Polacek  <polacek@redhat.com>
1403         * constraint.cc (diagnose_trait_expr): Say "nothrow" without quotes
1404         rather than in quotes.
1406 2022-09-27  Jonathan Wakely  <jwakely@redhat.com>
1408         PR c++/107049
1409         * method.cc (is_convertible_helper): Use access check sentinel.
1411 2022-09-27  Jakub Jelinek  <jakub@redhat.com>
1413         PR c++/106651
1414         * cp-tree.h (LAMBDA_EXPR_STATIC_P): Implement C++23
1415         P1169R4 - static operator().  Define.
1416         * parser.cc (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Document
1417         that it also allows static.
1418         (cp_parser_lambda_declarator_opt): Handle static lambda specifier.
1419         (cp_parser_decl_specifier_seq): Allow RID_STATIC for
1420         CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
1421         * decl.cc (grok_op_properties): If operator() isn't a method,
1422         use a different error wording, if it is static member function,
1423         allow it (for C++20 and older with a pedwarn unless it is
1424         a lambda function or template instantiation).
1425         * call.cc (joust): Don't ICE if one candidate is static member
1426         function and the other is an indirect call.  If the parameter
1427         conversion on the other candidate is user defined conversion,
1428         ellipsis or bad conversion, make static member function candidate
1429         a winner for that parameter.
1430         * lambda.cc (maybe_add_lambda_conv_op): Handle static lambdas.
1431         * error.cc (dump_lambda_function): Print static for static lambdas.
1433 2022-09-27  Jakub Jelinek  <jakub@redhat.com>
1435         * cp-tree.h (struct omp_begin_assumes_data): New type.
1436         (struct saved_scope): Add omp_begin_assumes member.
1437         * parser.cc: Include bitmap.h.
1438         (cp_parser_omp_assumption_clauses, cp_parser_omp_assume,
1439         cp_parser_omp_assumes, cp_parser_omp_begin): New functions.
1440         (cp_parser_omp_end_declare_target): Rename to ...
1441         (cp_parser_omp_end): ... this.  Handle also end assumes.
1442         (cp_parser_omp_construct): Handle PRAGMA_OMP_ASSUME.
1443         (cp_parser_pragma): Handle PRAGMA_OMP_ASSUME, PRAGMA_OMP_ASSUMES
1444         and PRAGMA_OMP_BEGIN.  Handle PRAGMA_OMP_END rather than
1445         PRAGMA_OMP_END_DECLARE_TARGET and call cp_parser_omp_end
1446         for it rather than cp_parser_omp_end_declare_target.
1447         * pt.cc (apply_late_template_attributes): Also temporarily clear
1448         omp_begin_assumes.
1449         * semantics.cc (finish_translation_unit): Also diagnose
1450         #pragma omp begin assumes without corresponding
1451         #pragma omp end assumes.
1453 2022-09-27  Jakub Jelinek  <jakub@redhat.com>
1455         * parser.cc (cp_parser_lambda_declarator_opt): Don't diagnose
1456         conflicting specifiers here.
1457         (cp_storage_class_name): New variable.
1458         (cp_parser_decl_specifier_seq): When setting conflicting_specifiers_p
1459         for the first time, diagnose which exact specifiers conflict.
1460         (cp_parser_set_storage_class): Likewise.  Move storage_class
1461         computation earlier.
1462         * decl.cc (grokdeclarator): Don't diagnose conflicting specifiers
1463         here, just return error_mark_node.
1465 2022-09-27  Jakub Jelinek  <jakub@redhat.com>
1467         PR c++/106652
1468         PR c++/85518
1469         * cp-tree.h (cp_compare_floating_point_conversion_ranks): Implement
1470         P1467R9 - Extended floating-point types and standard names except
1471         for std::bfloat16_t for now.  Declare.
1472         (extended_float_type_p): New inline function.
1473         * mangle.cc (write_builtin_type): Mangle float{16,32,64,128}_type_node
1474         as DF{16,32,64,128}_.  Mangle float{32,64,128}x_type_node as
1475         DF{32,64,128}x.  Remove FIXED_POINT_TYPE mangling that conflicts
1476         with that.
1477         * typeck2.cc (check_narrowing): If one of ftype or type is extended
1478         floating-point type, compare floating-point conversion ranks.
1479         * parser.cc (cp_keyword_starts_decl_specifier_p): Handle
1480         CASE_RID_FLOATN_NX.
1481         (cp_parser_simple_type_specifier): Likewise and diagnose missing
1482         _Float<N> or _Float<N>x support if not supported by target.
1483         * typeck.cc (cp_compare_floating_point_conversion_ranks): New function.
1484         (cp_common_type): If both types are REAL_TYPE and one or both are
1485         extended floating-point types, select common type based on comparison
1486         of floating-point conversion ranks and subranks.
1487         (cp_build_binary_op): Diagnose operation with floating point arguments
1488         with unordered conversion ranks.
1489         * call.cc (standard_conversion): For floating-point conversion, if
1490         either from or to are extended floating-point types, set conv->bad_p
1491         for implicit conversion from larger to smaller conversion rank or
1492         with unordered conversion ranks.
1493         (convert_like_internal): Emit a pedwarn on such conversions.
1494         (build_conditional_expr): Diagnose operation with floating point
1495         arguments with unordered conversion ranks.
1496         (convert_arg_to_ellipsis): Don't promote extended floating-point types
1497         narrower than double to double.
1498         (compare_ics): Implement P1467R9 [over.ics.rank]/4 changes.
1500 2022-09-26  Marek Polacek  <polacek@redhat.com>
1502         PR c++/106656
1503         * typeck2.cc (array_string_literal_compatible_p): Allow
1504         initializing arrays of char or unsigned char by a UTF-8 string literal.
1506 2022-09-26  Marek Polacek  <polacek@redhat.com>
1508         PR c++/106784
1509         * method.cc (is_convertible_helper): New.
1510         (is_convertible): Use it.
1511         (is_nothrow_convertible): Likewise.
1513 2022-09-26  Patrick Palka  <ppalka@redhat.com>
1515         PR c++/107033
1516         * module.cc (trees_in::decl_value): In the MK_partial case for
1517         a variable template partial specialization, pass decl_p=true to
1518         add_mergeable_specialization, and set spec to the VAR_DECL not
1519         the TEMPLATE_DECL.
1520         * pt.cc (add_mergeable_specialization): For a variable template
1521         partial specialization, set the TREE_TYPE of the new
1522         DECL_TEMPLATE_SPECIALIZATIONS node to the TREE_TYPE of the
1523         VAR_DECL not the VAR_DECL itself.
1525 2022-09-23  Marek Polacek  <polacek@redhat.com>
1527         PR c++/106784
1528         * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONVERTIBLE
1529         and CPTK_IS_NOTHROW_CONVERTIBLE.
1530         * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_CONVERTIBLE
1531         RID_IS_NOTHROW_CONVERTIBLE.
1532         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_CONVERTIBLE and
1533         CPTK_IS_NOTHROW_CONVERTIBLE.
1534         (is_convertible): Declare.
1535         (is_nothrow_convertible): Likewise.
1536         * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
1537         CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE.
1538         * method.cc (is_convertible): New.
1539         (is_nothrow_convertible): Likewise.
1540         * parser.cc (cp_parser_primary_expression): Handle RID_IS_CONVERTIBLE
1541         and RID_IS_NOTHROW_CONVERTIBLE.
1542         (cp_parser_trait_expr): Likewise.
1543         * semantics.cc (trait_expr_value): Handle CPTK_IS_CONVERTIBLE and
1544         CPTK_IS_NOTHROW_CONVERTIBLE.
1545         (finish_trait_expr): Likewise.
1547 2022-09-23  Marek Polacek  <polacek@redhat.com>
1549         PR c++/106983
1550         * typeck2.cc (split_nonconstant_init_1): Check TYPE_P.
1552 2022-09-22  Patrick Palka  <ppalka@redhat.com>
1554         PR c++/106826
1555         * module.cc (trees_out::decl_value): Use get_template_info in
1556         the MK_partial case to handle both VAR_DECL and TYPE_DECL.
1557         (trees_out::key_mergeable): Likewise.
1558         (trees_in::key_mergeable): Likewise.
1559         (has_definition): Consider DECL_INITIAL of a partial variable
1560         template specialization.
1561         (depset::hash::make_dependency): Handle partial variable template
1562         specializations too.
1564 2022-09-20  Patrick Palka  <ppalka@redhat.com>
1566         * decl.cc (cp_finish_decl): After updating the deduced type of a
1567         VAR_DECL, also update the corresponding TEMPLATE_DECL if there
1568         is one.
1570 2022-09-20  Patrick Palka  <ppalka@redhat.com>
1572         PR c++/106761
1573         * module.cc (trees_out::type_node) <case TYPE_PACK_EXPANSION>:
1574         Stream PACK_EXPANSION_EXTRA_ARGS.
1575         (trees_in::tree_node) <case TYPE_PACK_EXPANSION>: Likewise.
1577 2022-09-17  Patrick Palka  <ppalka@redhat.com>
1579         * module.cc (friend_from_decl_list): Don't consider
1580         CLASSTYPE_TEMPLATE_INFO for a TYPENAME_TYPE friend.
1581         (trees_in::read_class_def): Don't add to
1582         CLASSTYPE_BEFRIENDING_CLASSES for a TYPENAME_TYPE friend.
1584 2022-09-16  Patrick Palka  <ppalka@redhat.com>
1586         PR c++/92505
1587         * constexpr.cc (cxx_eval_component_reference): Check non_constant_p
1588         sooner.  In C++14 or later, reject a DECL_MUTABLE_P member access
1589         only if CONSTRUCTOR_MUTABLE_POISION is also set.
1591 2022-09-16  Jason Merrill  <jason@redhat.com>
1593         PR c++/106858
1594         * parser.cc (cp_parser_omp_var_list_no_open): Pass the
1595         initial token location down.
1596         * semantics.cc (finish_omp_clauses): Check
1597         invalid_nonstatic_memfn_p.
1598         * typeck.cc (invalid_nonstatic_memfn_p): Handle null TREE_TYPE.
1600 2022-09-15  Richard Biener  <rguenther@suse.de>
1602         * decl.cc (cxx_init_decl_processing): Inline last
1603         build_void_list_node call.
1604         (build_void_list_node): Remove.
1606 2022-09-14  Julian Brown  <julian@codesourcery.com>
1608         * semantics.cc (finish_omp_clauses): Likewise.
1610 2022-09-13  Patrick Palka  <ppalka@redhat.com>
1612         * cp-tree.h (mark_used): Remove single-parameter overload.  Add
1613         default argument to the two-parameter overload.
1614         * decl2.cc (mark_used): Likewise.
1616 2022-09-13  Patrick Palka  <ppalka@redhat.com>
1618         * cp-tree.h (cxx_constant_value): Define two-parameter version
1619         that omits the object parameter.
1620         * decl.cc (build_explicit_specifier): Omit NULL_TREE object
1621         argument to cxx_constant_value.
1622         * except.cc (build_noexcept_spec): Likewise.
1623         * pt.cc (expand_integer_pack): Likewise.
1624         (fold_targs_r): Likewise.
1625         * semantics.cc (finish_if_stmt_cond): Likewise.
1627 2022-09-13  Patrick Palka  <ppalka@redhat.com>
1629         * decl.cc (build_explicit_specifier): Pass complain to
1630         cxx_constant_value.
1631         * except.cc (build_noexcept_spec): Likewise.
1632         * pt.cc (expand_integer_pack): Likewise.
1633         (tsubst_function_decl): Propagate error_mark_node returned
1634         from build_explicit_specifier.
1636 2022-09-12  Patrick Palka  <ppalka@redhat.com>
1638         * call.cc (build_conditional_expr): Adjust calls to
1639         '_sfinae'-suffixed functions.
1640         (build_temp): Likewise.
1641         (convert_like_internal): Likewise.
1642         (convert_arg_to_ellipsis): Likewise.
1643         (build_over_call): Likewise.
1644         (build_cxx_call): Likewise.
1645         (build_new_method_call): Likewise.
1646         * constexpr.cc (cxx_eval_outermost_constant_expr): Likewise.
1647         (cxx_constant_value_sfinae): Rename to ...
1648         (cxx_constant_value): ... this.  Document its default arguments.
1649         (fold_non_dependent_expr): Adjust function comment.
1650         * cp-tree.h (instantiate_non_dependent_expr_sfinae): Rename to ...
1651         (instantiate_non_dependent_expr): ... this.  Give its 'complain'
1652         parameter a default argument.
1653         (get_target_expr_sfinae, get_target_expr): Likewise.
1654         (require_complete_type_sfinae, require_complete_type): Likewise.
1655         (abstract_virtuals_error_sfinae, abstract_virtuals_error):
1656         Likewise.
1657         (cxx_constant_value_sfinae, cxx_constant_value): Likewise.
1658         * cvt.cc (build_up_reference): Adjust calls to '_sfinae'-suffixed
1659         functions.
1660         (ocp_convert): Likewise.
1661         * decl.cc (build_explicit_specifier): Likewise.
1662         * except.cc (build_noexcept_spec): Likewise.
1663         * init.cc (build_new_1): Likewise.
1664         * pt.cc (expand_integer_pack): Likewise.
1665         (instantiate_non_dependent_expr_internal): Adjust function
1666         comment.
1667         (instantiate_non_dependent_expr): Rename to ...
1668         (instantiate_non_dependent_expr_sfinae): ... this.  Document its
1669         default argument.
1670         (tsubst_init): Adjust calls to '_sfinae'-suffixed functions.
1671         (fold_targs_r): Likewise.
1672         * semantics.cc (finish_compound_literal): Likewise.
1673         (finish_decltype_type): Likewise.
1674         (cp_build_bit_cast): Likewise.
1675         * tree.cc (build_cplus_new): Likewise.
1676         (get_target_expr): Rename to ...
1677         (get_target_expr_sfinae): ... this.  Document its default
1678         argument.
1679         * typeck.cc (require_complete_type): Rename to ...
1680         (require_complete_type_sfinae): ... this.  Document its default
1681         argument.
1682         (cp_build_array_ref): Adjust calls to '_sfinae'-suffixed
1683         functions.
1684         (convert_arguments): Likewise.
1685         (cp_build_binary_op): Likewise.
1686         (build_static_cast_1): Likewise.
1687         (cp_build_modify_expr): Likewise.
1688         (convert_for_initialization): Likewise.
1689         * typeck2.cc (abstract_virtuals_error): Rename to ...
1690         (abstract_virtuals_error_sfinae): ... this. Document its default
1691         argument.
1692         (build_functional_cast_1): Adjust calls to '_sfinae'-suffixed
1693         functions.
1695 2022-09-12  Patrick Palka  <ppalka@redhat.com>
1697         PR c++/101906
1698         * pt.cc (tsubst_template_args): Set cp_evaluated here.
1699         (tsubst_aggr_type): Not here.
1701 2022-09-12  Jason Merrill  <jason@redhat.com>
1703         PR c++/106893
1704         PR c++/90451
1705         * decl.cc (cp_finish_decl): Call mark_single_function.
1707 2022-09-12  Jason Merrill  <jason@redhat.com>
1709         PR c++/93259
1710         * pt.cc (type_dependent_expression_p): Treat a compound
1711         literal of array-of-unknown-bound type like a variable.
1713 2022-09-12  Jason Merrill  <jason@redhat.com>
1715         PR c++/106567
1716         * lambda.cc (type_deducible_expression_p): Check
1717         array_of_unknown_bound_p.
1719 2022-09-12  Jonathan Wakely  <jwakely@redhat.com>
1721         PR c++/86491
1722         * decl2.cc (constrain_class_visibility): Adjust wording of
1723         -Wsubobject-linkage for cases where anonymous
1724         namespaces aren't used.
1725         * tree.cc (decl_anon_ns_mem_p): Now only true for actual anonymous
1726         namespace members, rename old semantics to...
1727         (decl_internal_context_p): ...this.
1728         * cp-tree.h, name-lookup.cc, pt.cc: Adjust.
1730 2022-09-08  Jonathan Wakely  <jwakely@redhat.com>
1732         PR c++/106838
1733         * class.cc (type_has_virtual_destructor): Return false for
1734         union types.
1735         * semantics.cc (check_trait_type): Add KIND parameter to support
1736         different sets of requirements.
1737         (finish_trait_expr): Pass KIND argument for relevant traits.
1739 2022-09-08  Patrick Palka  <ppalka@redhat.com>
1741         PR c++/99130
1742         * decl2.cc (maybe_instantiate_decl): Adjust function comment.
1743         Check VAR_OR_FUNCTION_DECL_P.  Pull out the disjunction into ...
1744         (mark_used): ... here, removing the decl_maybe_constant_var_p
1745         part of it.
1747 2022-09-07  Jason Merrill  <jason@redhat.com>
1749         PR c++/106793
1750         * decl.cc (grokdeclarator): Improve placeholder diagnostics.
1751         * parser.cc (cp_parser_type_id_1): Add fixit.
1753 2022-09-07  Arsen Arsenović  <arsen@aarsen.me>
1755         PR c++/106188
1756         PR c++/106713
1757         * coroutines.cc (coro_rewrite_function_body): Ensure we have a
1758         BIND_EXPR wrapping the function body.
1760 2022-09-07  Jakub Jelinek  <jakub@redhat.com>
1762         PR c++/106829
1763         * semantics.cc (finish_omp_target_clauses): If current_function_decl
1764         isn't a nonstatic member function, don't set data.current_object to
1765         non-NULL.
1767 2022-09-06  Jason Merrill  <jason@redhat.com>
1769         * decl.cc (grok_op_properties): Return sooner for C++23 op[].
1771 2022-09-06  Jakub Jelinek  <jakub@redhat.com>
1773         * parser.cc (cp_parser_omp_clause_doacross_sink): Don't verify val
1774         in omp_cur_iteration - 1 has integer_type_node type.
1776 2022-09-06  Jakub Jelinek  <jakub@redhat.com>
1778         * pt.cc (tsubst_expr) <case OMP_ORDERED>: If OMP_BODY was NULL, keep
1779         it NULL after instantiation too.
1781 2022-09-03  Jakub Jelinek  <jakub@redhat.com>
1783         * parser.cc (cp_parser_omp_clause_name): Handle doacross.
1784         (cp_parser_omp_clause_depend_sink): Renamed to ...
1785         (cp_parser_omp_clause_doacross_sink): ... this.  Add depend_p
1786         argument.  Handle parsing of doacross(sink:omp_cur_iteration-1).  Use
1787         OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1788         OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS instead
1789         of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND flag on it.
1790         (cp_parser_omp_clause_depend): Use OMP_CLAUSE_DOACROSS_SINK and
1791         OMP_CLAUSE_DOACROSS_SOURCE instead of OMP_CLAUSE_DEPEND_SINK and
1792         OMP_CLAUSE_DEPEND_SOURCE, build OMP_CLAUSE_DOACROSS for depend(source)
1793         and set OMP_CLAUSE_DOACROSS_DEPEND on it.
1794         (cp_parser_omp_clause_doacross): New function.
1795         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DOACROSS.
1796         (cp_parser_omp_depobj): Use OMP_CLAUSE_DEPEND_INVALID instead of
1797         OMP_CLAUSE_DEPEND_SOURCE.
1798         (cp_parser_omp_for_loop): Don't diagnose here linear clause together
1799         with ordered with argument.
1800         (cp_parser_omp_simd): Don't diagnose ordered clause with argument on
1801         for simd.
1802         (OMP_ORDERED_DEPEND_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DOACROSS.
1803         (cp_parser_omp_ordered): Handle also doacross and adjust for it
1804         diagnostic wording.
1805         * pt.cc (tsubst_omp_clause_decl): Use
1806         OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
1807         OMP_CLAUSE_DEPEND_SINK_NEGATIVE.
1808         (tsubst_omp_clauses): Handle OMP_CLAUSE_DOACROSS.
1809         (tsubst_expr): Use OMP_CLAUSE_DEPEND_INVALID instead of
1810         OMP_CLAUSE_DEPEND_SOURCE.
1811         * semantics.cc (cp_finish_omp_clause_depend_sink): Rename to ...
1812         (cp_finish_omp_clause_doacross_sink): ... this.
1813         (finish_omp_clauses): Handle OMP_CLAUSE_DOACROSS.  Don't handle
1814         OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK.
1816 2022-09-02  David Malcolm  <dmalcolm@redhat.com>
1818         PR c/90885
1819         * cp-tree.h (class cp_expr): Add bitfield m_decimal.  Clear it in
1820         existing ctors.  Add ctor that allows specifying its value.
1821         (cp_expr::decimal_p): New accessor.
1822         * parser.cc (cp_parser_expression_stack_entry::flags): New field.
1823         (cp_parser_primary_expression): Set m_decimal of cp_expr when
1824         handling numbers.
1825         (cp_parser_binary_expression): Extract flags from token when
1826         populating stack.  Call check_for_xor_used_as_pow.
1828 2022-09-01  Marek Polacek  <polacek@redhat.com>
1830         * cp-tree.h (maybe_strip_ref_conversion): Remove.
1832 2022-08-30  Ulrich Drepper  <drepper@gmail.com>
1834         * Make-lang.in: Add rule to rebuild std-name-hint.h from
1835         std-name-hint.gperf.
1836         * name-lookup.cc (get_std_name_hint): Remove hints array.
1837         Use gperf-generated class std_name_hint_lookup.
1838         Include "std-name-hint.h".
1839         * std-name-hint.gperf: New file.
1840         * std-name-hint.h: New file.  Generated from the .gperf file.
1842 2022-08-30  Marek Polacek  <polacek@redhat.com>
1844         PR c++/106759
1845         * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_NOTHROW_ASSIGNABLE
1846         and RID_IS_NOTHROW_CONSTRUCTIBLE.
1848 2022-08-29  Marek Polacek  <polacek@redhat.com>
1850         PR c++/106712
1851         * decl.cc (grokdeclarator): Reverse the order of arguments to
1852         attr_chainon.
1854 2022-08-26  Marek Polacek  <polacek@redhat.com>
1856         PR c++/81159
1857         * typeck.cc (maybe_warn_self_move): New.
1858         (cp_build_modify_expr): Call maybe_warn_self_move.
1860 2022-08-25  Marek Polacek  <polacek@redhat.com>
1862         * cp-tree.h (enum cp_tree_index): Remove CTI_NULLPTR, CTI_NULLPTR_TYPE.
1863         Move it to c_tree_index.
1864         (nullptr_node): No longer define here.
1865         (nullptr_type_node): Likewise.
1866         (NULLPTR_TYPE_P): Likewise.
1867         * decl.cc (cxx_init_decl_processing): Only keep C++-specific nullptr
1868         initialization; move the shared code to c_common_nodes_and_builtins.
1870 2022-08-25  Jason Merrill  <jason@redhat.com>
1872         * call.cc (unsafe_return_slot_p): Return 2 for *this in a
1873         constructor.
1875 2022-08-23  Marek Polacek  <polacek@redhat.com>
1877         * typeck.cc (maybe_warn_pessimizing_move): Don't warn about
1878         redundant std::move when the expression was wrapped in { }.
1880 2022-08-17  Marek Polacek  <polacek@redhat.com>
1882         PR c++/90428
1883         * typeck.cc (can_do_rvo_p): Rename to ...
1884         (can_elide_copy_prvalue_p): ... this.
1885         (maybe_warn_pessimizing_move): Extend the
1886         -Wredundant-move warning to warn about std::move on a
1887         const-qualified object.
1889 2022-08-17  Marek Polacek  <polacek@redhat.com>
1891         PR c++/89780
1892         * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Maybe suppress
1893         -Wpessimizing-move.
1894         * typeck.cc (maybe_warn_pessimizing_move): Don't issue warnings
1895         if they are suppressed.
1896         (check_return_expr): Disable -Wpessimizing-move when returning
1897         a dependent expression.
1899 2022-08-17  Marek Polacek  <polacek@redhat.com>
1901         PR c++/106276
1902         * call.cc (build_over_call): Call maybe_warn_pessimizing_move.
1903         * cp-tree.h (maybe_warn_pessimizing_move): Declare.
1904         * decl.cc (build_aggr_init_full_exprs): Call
1905         maybe_warn_pessimizing_move.
1906         * typeck.cc (maybe_warn_pessimizing_move): Handle TREE_LIST and
1907         CONSTRUCTOR.  Add a bool parameter and use it.  Adjust a diagnostic
1908         message.
1909         (check_return_expr): Adjust the call to maybe_warn_pessimizing_move.
1911 2022-08-17  Tobias Burnus  <tobias@codesourcery.com>
1912             Chung-Lin Tang  <cltang@codesourcery.com>
1914         PR c++/104493
1915         * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove.
1916         * cp-tree.h (cp_omp_mappable_type, cp_omp_emit_unmappable_type_notes):
1917         Remove.
1918         * decl2.cc (cp_omp_mappable_type_1, cp_omp_mappable_type,
1919         cp_omp_emit_unmappable_type_notes): Remove.
1920         (cplus_decl_attributes): Call omp_mappable_type instead of
1921         removed langhook.
1922         * decl.cc (cp_finish_decl): Likewise; call cxx_incomplete_type_inform
1923         in lieu of cp_omp_emit_unmappable_type_notes.
1924         * semantics.cc (finish_omp_clauses): Likewise.
1926 2022-08-16  Tom Honermann  <tom@honermann.net>
1928         PR c++/106423
1929         * parser.cc (cp_lexer_saving_tokens): Add comment regarding
1930         diagnostic requirements.
1932 2022-08-16  Jakub Jelinek  <jakub@redhat.com>
1934         * typeck.cc (cp_build_modify_expr): Implement
1935         P2327R1 - De-deprecating volatile compound operations.  Don't warn
1936         for |=, &= or ^= with volatile lhs.
1937         * expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording,
1938         leave out simple.
1940 2022-08-15  Marek Polacek  <polacek@redhat.com>
1942         PR c++/106276
1943         * typeck.cc (can_do_rvo_p): New.
1944         (maybe_warn_pessimizing_move): Warn when moving a temporary object
1945         in a return statement prevents copy elision.
1947 2022-08-11  Marek Polacek  <polacek@redhat.com>
1949         PR middle-end/102633
1950         * decl.cc (cp_finish_decl): Call suppress_warning.
1952 2022-08-07  Jakub Jelinek  <jakub@redhat.com>
1954         PR c++/88174
1955         * constexpr.cc (cxx_eval_store_expression): Handle REALPART_EXPR
1956         and IMAGPART_EXPR.  Change ctors from releasing_vec to
1957         auto_vec<tree *>, adjust all uses.  For !preeval, update ctors
1958         vector.
1960 2022-07-31  Lewis Hyatt  <lhyatt@gmail.com>
1962         PR c++/66290
1963         * parser.cc (cp_lexer_new_main): Rename global done_lexing to
1964         override_libcpp_locations.
1966 2022-07-31  Jason Merrill  <jason@redhat.com>
1968         PR c++/106369
1969         * constexpr.cc (reduced_constant_expression_p): Return false
1970         if a CONSTRUCTOR initializes an empty field.
1972 2022-07-29  Jakub Jelinek  <jakub@redhat.com>
1974         PR c++/106448
1975         * parser.cc (cp_parser_omp_atomic): For simple cast followed by
1976         CPP_QUERY token, don't try cp_parser_binary_operation if compare
1977         is true.
1979 2022-07-26  Marek Polacek  <polacek@redhat.com>
1981         PR c++/106311
1982         * pt.cc (redeclare_class_template): Check DECL_P before accessing
1983         DECL_SOURCE_LOCATION.
1985 2022-07-26  Jason Merrill  <jason@redhat.com>
1987         PR c++/106230
1988         * semantics.cc (finish_for_stmt): Check stmts_are_full_exprs_p.
1990 2022-07-25  Jason Merrill  <jason@redhat.com>
1992         PR c++/87729
1993         * class.cc (warn_hidden): Remove shortcut.
1995 2022-07-22  Patrick Palka  <ppalka@redhat.com>
1997         PR c++/106366
1998         * pt.cc (do_class_deduction): Don't consider TYPE_HAS_LIST_CTOR
1999         when setting try_list_ctor.  Reset args even when try_list_ctor
2000         is true and there are no list candidates.  Call resolve_args on
2001         the reset args.  Rename try_list_ctor to try_list_cand.
2003 2022-07-22  Martin Liska  <mliska@suse.cz>
2005         PR other/106370
2006         * init.cc (sort_mem_initializers): Remove continue as last stmt
2007         in a loop.
2009 2022-07-21  Jason Merrill  <jason@redhat.com>
2011         PR c++/106361
2012         * decl.cc (move_fn_p): Remove assert.
2014 2022-07-21  Jason Merrill  <jason@redhat.com>
2016         DR 2084
2017         PR c++/98423
2018         * method.cc (walk_field_subobs): Fix DMI in union case.
2020 2022-07-19  Patrick Palka  <ppalka@redhat.com>
2022         PR c++/94894
2023         PR c++/105766
2024         PR c++/106201
2025         * call.cc (enum conversion_kind): Add ck_deferred_bad enumerator.
2026         (has_next): Return false for it.
2027         (reference_binding): Return a ck_deferred_bad conversion instead
2028         of an actual bad conversion when LOOKUP_SHORTCUT_BAD_CONVS is set.
2029         Remove now obsolete early exit for the incomplete TO case.
2030         (implicit_conversion_1): Don't mask out LOOKUP_SHORTCUT_BAD_CONVS.
2031         (add_function_candidate): Set LOOKUP_SHORTCUT_BAD_CONVS iff
2032         shortcut_bad_convs.
2033         (missing_conversion_p): Also return true for a ck_deferred_bad
2034         conversion.
2035         * cp-tree.h (LOOKUP_SHORTCUT_BAD_CONVS): Define.
2037 2022-07-19  Jonathan Wakely  <jwakely@redhat.com>
2039         * cp-objcp-common.cc (names_builtin_p): Return true for
2040         RID_REF_CONSTRUCTS_FROM_TEMPORARY and
2041         RID_REF_CONVERTS_FROM_TEMPORARY.
2043 2022-07-15  Marek Polacek  <polacek@redhat.com>
2045         PR c++/104477
2046         * call.cc (ref_conv_binds_directly_p): Rename to ...
2047         (ref_conv_binds_directly): ... this.  Add a new bool parameter.  Change
2048         the return type to tristate.
2049         * constraint.cc (diagnose_trait_expr): Handle
2050         CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2051         * cp-tree.h: Include "tristate.h".
2052         (enum cp_trait_kind): Add CPTK_REF_CONSTRUCTS_FROM_TEMPORARY
2053         and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2054         (ref_conv_binds_directly_p): Rename to ...
2055         (ref_conv_binds_directly): ... this.
2056         (ref_xes_from_temporary): Declare.
2057         * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
2058         CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2059         * method.cc (ref_xes_from_temporary): New.
2060         * parser.cc (cp_parser_primary_expression): Handle
2061         RID_REF_CONSTRUCTS_FROM_TEMPORARY and RID_REF_CONVERTS_FROM_TEMPORARY.
2062         (cp_parser_trait_expr): Likewise.
2063         (warn_for_range_copy): Adjust to call ref_conv_binds_directly.
2064         * semantics.cc (trait_expr_value): Handle
2065         CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
2066         (finish_trait_expr): Likewise.
2068 2022-07-13  Patrick Palka  <ppalka@redhat.com>
2070         PR c++/105912
2071         * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
2072         NULL_TREE extract_call_expr result.
2074 2022-07-13  Patrick Palka  <ppalka@redhat.com>
2076         PR c++/105842
2077         * constraint.cc (satisfy_declaration_constraints): Refine early
2078         exit test for argument dependence.
2079         * cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
2080         * pt.cc (template_class_depth): Handle TI_TEMPLATE being a
2081         FIELD_DECL.
2082         (usse_outer_template_parms): Factor out constraint dependence
2083         test into ...
2084         (uses_outer_template_parms_in_constraints): ... here.
2085         (type_dependent_expression_p): Use it for FUNCTION_DECL.
2087 2022-07-07  Patrick Palka  <ppalka@redhat.com>
2089         PR c++/105956
2090         * pt.cc (template_arg_to_parm): Define.
2091         (tsubst_argument_pack): Try to reuse the corresponding
2092         ARGUMENT_PACK from 'args' when substituting into a generic
2093         ARGUMENT_PACK for a variadic template parameter.
2094         (tsubst_template_args): Move variable declarations closer to
2095         their first use.  Replace 'orig_t' with 'r'.  Rename 'need_new'
2096         to 'const_subst_p'.  Heuristically detect if the substituted
2097         elements are identical to that of a level from 'args' and avoid
2098         allocating a new TREE_VEC if so.  Add sanity check for the
2099         length of the new TREE_VEC, and remove dead ARGUMENT_PACK_P test.
2100         (tsubst_decl) <case TYPE_DECL, case VAR_DECL>: Revert
2101         r13-1045-gcb7fd1ea85feea change for avoiding substitution into
2102         DECL_TI_ARGS, but still avoid coercion in this case.
2104 2022-07-07  Jason Merrill  <jason@redhat.com>
2106         PR c++/87729
2107         * class.cc (warn_hidden): Ignore [cd]tors.
2109 2022-07-06  Lewis Hyatt  <lhyatt@gmail.com>
2111         PR c++/53431
2112         * parser.cc (cp_parser_pragma_kind): Move earlier in the file.
2113         (cp_lexer_handle_early_pragma): New function.
2114         (cp_lexer_new_main): Support parsing and handling early pragmas.
2115         (c_parse_file): Adapt to changes in cp_lexer_new_main.
2117 2022-07-06  Jason Merrill  <jason@redhat.com>
2119         PR c++/106179
2120         PR c++/106024
2121         * parser.cc (cp_parser_lookup_name): Remove :: requirement
2122         for using unqualified lookup result.
2124 2022-07-05  Nathan Sidwell  <nathan@acm.org>
2126         * module.cc
2127         (struct ord_loc_info, ord_loc_traits): New.
2128         (ord_loc_tabke, ord_loc_remap): New globals.
2129         (struct location_map_info): Delete.
2130         (struct module_state_config): Rename ordinary_loc_align to
2131         loc_range_bits.
2132         (module_for_ordinary_loc): Adjust.
2133         (module_state::note_location): Note ordinary locations,
2134         return bool.
2135         (module_state::write_location): Adjust ordinary location
2136         streaming.
2137         (module_state::read_location): Likewise.
2138         (module_state::write_init_maps): Allocate ord_loc_table.
2139         (module_state::write_prepare_maps): Reimplement ordinary
2140         map preparation.
2141         (module_state::read_prepare_maps): Adjust.
2142         (module_state::write_ordinary_maps): Reimplement.
2143         (module_state::write_macro_maps): Adjust.
2144         (module_state::read_ordinary_maps): Reimplement.
2145         (module_state::write_macros): Adjust.
2146         (module_state::write_config): Adjust.
2147         (module_state::read_config): Adjust.
2148         (module_state::write_begin): Adjust.
2149         (module_state::read_initial): Adjust.
2151 2022-07-04  Tobias Burnus  <tobias@codesourcery.com>
2152             Chung-Lin Tang  <cltang@codesourcery.com>
2153             Thomas Schwinge  <thomas@codesourcery.com>
2155         * parser.cc (cp_parser_omp_target_data,
2156         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2157         cp_parser_omp_target_update): Set OMP_REQUIRES_TARGET_USED.
2158         (cp_parser_omp_requires): Remove sorry.
2160 2022-07-01  Lewis Hyatt  <lhyatt@gmail.com>
2162         * parser.cc (cp_token_is_module_directive): New function
2163         refactoring common code.
2164         (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
2165         (cp_parser_skip_to_end_of_statement): Likewise.
2166         (cp_parser_skip_to_end_of_block_or_statement): Likewise.
2167         (cp_parser_declaration): Likewise.
2169 2022-07-01  Marek Polacek  <polacek@redhat.com>
2171         PR c++/105550
2172         * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
2174 2022-07-01  Tobias Burnus  <tobias@codesourcery.com>
2176         * parser.cc (cp_parser_omp_target_enter_data,
2177         cp_parser_omp_target_exit_data): Accept tofrom
2178         map-type modifier but use 'to' / 'from' internally.
2180 2022-07-01  Marek Polacek  <polacek@redhat.com>
2182         PR c++/106111
2183         * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
2184         RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
2186 2022-07-01  Jason Merrill  <jason@redhat.com>
2188         PR c++/105779
2189         * call.cc (resolve_args): Use complain.
2191 2022-07-01  Jason Merrill  <jason@redhat.com>
2193         * parser.cc (missing_template_diag): Split out...
2194         (cp_parser_id_expression): ...from here.
2196 2022-07-01  Jason Merrill  <jason@redhat.com>
2198         PR c++/106024
2199         * parser.cc (missing_template_diag): Factor out...
2200         (cp_parser_id_expression): ...from here.
2201         (cp_parser_lookup_name): Don't look in dependent object_type.
2203 2022-06-30  Nathan Sidwell  <nathan@acm.org>
2205         * module.cc (module_state::write_define): Drop located param.
2206         (module_state::read_define): Likewise.
2207         (module_state::prepare_macros): New, broken out of ...
2208         (module_state::write_macros): ... here.  Adjust.
2209         (module_state::write_begin): Adjust.
2211 2022-06-29  Nathan Sidwell  <nathan@acm.org>
2213         * module.cc (macro_info, macro_traits, macro_table,
2214         macro_remap): Rename to ...
2215         (macro_loc_info, macro_loc_traits, macro_loc_table,
2216         macro_loc_remap): ... these.  Update all uses.
2217         (module_state::write_prepare_maps): Remove unneeded macro checking.
2218         (module_state::write_begin): Free macro_loc_remap.
2220 2022-06-27  Sergei Trofimovich  <siarheit@google.com>
2222         PR c++/106102
2223         * mapper-client.cc: Include <memory> via "system.h".
2224         * mapper-resolver.cc: Ditto.
2225         * module.cc: Ditto.
2227 2022-06-27  David Malcolm  <dmalcolm@redhat.com>
2229         * cxx-pretty-print.h: Add "final" and "override" to various vfunc
2230         implementations, removing redundant "virtual" as appropriate.
2231         * module.cc: Likewise.
2233 2022-06-24  Jason Merrill  <jason@redhat.com>
2235         PR c++/87729
2236         PR c++/20423
2237         * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
2239 2022-06-24  Alexandre Oliva  <oliva@adacore.com>
2241         * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
2243 2022-06-23  Jason Merrill  <jason@redhat.com>
2245         PR c++/105925
2246         * call.cc (build_aggr_conv): Don't depend on
2247         CONSTRUCTOR_IS_DESIGNATED_INIT.
2249 2022-06-23  Jason Merrill  <jason@redhat.com>
2251         PR c++/105925
2252         * decl.cc (reshape_init_array_1): Set
2253         CONSTRUCTOR_IS_DESIGNATED_INIT here.
2254         (reshape_init_class): And here.
2255         (reshape_init): Not here.
2257 2022-06-23  Patrick Palka  <ppalka@redhat.com>
2259         PR c++/105931
2260         * expr.cc (fold_for_warn): Don't fold when in an unevaluated
2261         context.
2263 2022-06-23  Patrick Palka  <ppalka@redhat.com>
2265         PR c++/105982
2266         * pt.cc (lookup_template_class): After calling complete_type for
2267         the substituted context, check the table again iff the type was
2268         previously incomplete and complete_type made it complete.
2270 2022-06-23  Jason Merrill  <jason@redhat.com>
2272         PR c++/94554
2273         * pt.cc (dependent_operand_p): Split out from...
2274         (tsubst_copy_and_build): ...here.
2275         (tsubst_expr) [IF_STMT]: Use it.
2276         * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
2277         condition in the template tree.
2279 2022-06-23  Jason Merrill  <jason@redhat.com>
2281         PR c++/105885
2282         * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
2283         comparison of dependent operands.
2285 2022-06-23  Nathan Sidwell  <nathan@acm.org>
2287         * module.cc (struct macro_info): New.
2288         (struct macro_traits): New.
2289         (macro_remap, macro_table): New globals.
2290         (depset::hash::find_dependencies): Note namespace location.
2291         (module_for_macro_loc): Adjust.
2292         (module_state::note_location): New.
2293         (module_state::Write_location): Note location when not
2294         streaming. Adjust macro location streaming.
2295         (module_state::read_location): Adjust macro location
2296         streaming.
2297         (module_state::write_init_maps): New.
2298         (module_state::write_prepare_maps): Reimplement macro map
2299         preparation.
2300         (module_state::write_macro_maps): Reimplement.
2301         (module_state::read_macro_maps): Likewise.
2302         (module_state::write_begin): Adjust.
2304 2022-06-23  Jason Merrill  <jason@redhat.com>
2306         * pt.cc (type_unification_real): An auto tparm can't
2307         be affected by other deductions.
2309 2022-06-23  Jason Merrill  <jason@redhat.com>
2311         PR c++/105964
2312         * pt.cc (type_dependent_expression_p): Look through BASELINK.
2314 2022-06-22  Jason Merrill  <jason@redhat.com>
2316         PR c++/105908
2317         * name-lookup.cc (outer_binding): Strip BASELINK.
2319 2022-06-22  Nathan Sidwell  <nathan@acm.org>
2321         * module.cc (struct duplicate_hash): Remove.
2322         (duplicate_hash_map): Adjust.
2324 2022-06-22  Jason Merrill  <jason@redhat.com>
2326         PR c++/104642
2327         * constexpr.cc (cxx_eval_builtin_function_call): Handle
2328         unreachable/trap earlier.
2329         * cp-gimplify.cc (cp_maybe_instrument_return): Use
2330         build_builtin_unreachable.
2332 2022-06-18  Jakub Jelinek  <jakub@redhat.com>
2334         * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
2335         flag_sanitize_trap & SANITIZE_VPTR instead of
2336         flag_sanitize_undefined_trap_on_error.
2338 2022-06-17  Jakub Jelinek  <jakub@redhat.com>
2340         PR c++/106001
2341         * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
2342         instead of maybe_constant_value.
2344 2022-06-16  Nathan Sidwell  <nathan@acm.org>
2346         * decl2.cc (finish_objects): Add startp parameter, adjust.
2347         (generate_ctor_or_dtor_function): Detect empty fn, and don't
2348         generate unnecessary code.  Remove objc startup here ...
2349         (c_parse_final_cleanyps): ... do it here.
2351 2022-06-16  Martin Liska  <mliska@suse.cz>
2353         * decl2.cc (struct priority_map_traits): Remove unused param.
2355 2022-06-15  Nathan Sidwell  <nathan@acm.org>
2357         * module.cc (module_state::write_readme): Use less confusing
2358         importable unit names.
2360 2022-06-14  Nathan Sidwell  <nathan@acm.org>
2362         * cp-tree.h (fini_modules): Add has_inits parm.
2363         * decl2.cc (c_parse_final_cleanups): Check for
2364         inits, adjust fini_modules flags.
2365         * module.cc (module_state): Rename call_init_p to
2366         active_init_p.
2367         (module_state::write_config): Write active_init.
2368         (module_state::read_config): Read it.
2369         (module_determine_import_inits): Clear active_init_p
2370         of covered inits.
2371         (late_finish_module): Add has_init parm.  Record it.
2372         (fini_modules): Adjust.
2374 2022-06-13  Nathan Sidwell  <nathan@acm.org>
2376         * module.cc (module_state::write): Separate to ...
2377         (module_state::write_begin, module_state::write_end): ...
2378         these.
2379         (module_state::write_readme): Drop extensions parameter.
2380         (struct module_processing_cookie): Add more fields.
2381         (finish_module_processing): Adjust state writing call.
2382         (late_finish_module): Call write_end.
2384 2022-06-10  Patrick Palka  <ppalka@redhat.com>
2386         PR c++/65328
2387         * decl.cc (typename_hasher::hash): Add extra overloads.
2388         Use iterative_hash_object instead of htab_hash_pointer.
2389         Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
2390         (build_typename_type): Use typename_hasher::hash.
2391         * pt.cc (spec_hasher::hash): Add two-parameter overload.
2392         Set comparing_specializations around the call to
2393         hash_tmpl_and_args.
2394         (iterative_hash_template_arg) <case TYPENAME_TYPE>:
2395         When comparing_specializations, hash the TYPE_CONTEXT
2396         and TYPENAME_TYPE_FULLNAME.
2397         (tsubst_function_decl): Use spec_hasher::hash instead of
2398         hash_tmpl_and_args.
2399         (tsubst_template_decl): Likewise.
2400         (tsubst_decl): Likewise.
2402 2022-06-10  Patrick Palka  <ppalka@redhat.com>
2404         * pt.cc (instantiate_template): Don't substitute the context
2405         of the most general template if that of the partially
2406         instantiated template is already non-dependent.
2408 2022-06-10  Patrick Palka  <ppalka@redhat.com>
2410         * pt.cc (lookup_template_class): Remove dead stores to
2411         context parameter.  Don't substitute the context of the
2412         most general template if that of the partially instantiated
2413         template is already non-dependent.  Check the specializations
2414         table again after completing the context of a nested dependent
2415         specialization.
2416         (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
2417         TYPE_CONTEXT or pass it to lookup_template_class.
2418         (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
2419         the TREE_TYPE for DECL_SELF_REFERENCE_P.  Avoid template argument
2420         substitution or coercion in some cases.
2422 2022-06-10  Nathan Sidwell  <nathan@acm.org>
2424         * cp-tree.h (fini_modules): Add some parameters.
2425         (finish_module_processing): Return an opaque pointer.
2426         * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
2427         finish_module_processing to fini_modules.
2428         * module.cc (struct module_processing_cookie): New.
2429         (finish_module_processing): Return a heap-allocated cookie.
2430         (late_finish_module): New.  Finish out the module writing.
2431         (fini_modules): Adjust.
2433 2022-06-10  Nathan Sidwell  <nathan@acm.org>
2435         * cp-tree.h (module_has_import_init): Rename to ...
2436         (module_determined_import_inits): ... here.
2437         * decl2.cc (start_objects): Do not handle module initializers
2438         here.
2439         (c_parse_final_cleanups): Generate a separate module
2440         initializer calling function and add it to the list.  Shrink
2441         the c-lang region.
2442         * module.cc (num_init_calls_needed): Delete.
2443         (module_has_import_init): Rename to ...
2444         (module_determined_import_inits): ... here. Do the
2445         calculation here ...
2446         (finish_module_processing): ... rather than here.
2447         (module_add_import_initializers): Reformat.
2449 2022-06-09  Jakub Jelinek  <jakub@redhat.com>
2451         PR c++/105871
2452         * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
2453         non-integral result type use fold_ternary too like for BIT_FIELD_REFs
2454         from VECTOR_CST.  If fold_ternary returns NULL, diagnose non-constant
2455         expression, set *non_constant_p and return t, instead of returning
2456         NULL.
2458 2022-06-09  Nathan Sidwell  <nathan@acm.org>
2460         * cp-tree.h (module_initializer_kind): Replace with ...
2461         (module_global_init_needed, module_has_import_inits): ...
2462         these.
2463         * decl2.cc (start_objects): Add has_body parm.  Reorganize
2464         module initializer creation.
2465         (generate_ctor_or_dtor_function): Adjust.
2466         (c_parse_final_cleanups): Adjust.
2467         (vtv_start_verification_constructor_init_function): Adjust.
2468         * module.cc (module_initializer_kind): Replace with ...
2469         (module_global_init_needed, module_has_import_inits): ...
2470         these.
2472 2022-06-08  Jason Merrill  <jason@redhat.com>
2474         PR c++/105852
2475         * decl.cc (duplicate_decls): Change non-templated friend
2476         check to an assert.
2477         * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
2478         on non-templated friends.
2479         (tsubst_friend_function): Adjust.
2481 2022-06-08  Jason Merrill  <jason@redhat.com>
2483         PR c++/105852
2484         PR c++/105761
2485         * decl.cc (duplicate_decls): Avoid copying template info
2486         from non-templated friend even if newdecl isn't a definition.
2487         Correct handling of DECL_UNIQUE_FRIEND_P on templates.
2488         * pt.cc (non_templated_friend_p): New.
2489         * cp-tree.h (non_templated_friend_p): Declare it.
2491 2022-06-08  Nathan Sidwell  <nathan@acm.org>
2493         * decl2.cc (struct priority_info_s, priority_info): Delete.
2494         (priority_map_traits, priority_map_t): New.
2495         (static_init_fini_fns): New.
2496         (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
2497         (initialize_p_decl, priority_decl): Delete.
2498         (ssdf_decls, priority_info_map): Delete.
2499         (start_static_storage_duration_function): Rename to ...
2500         (start_partial_init_fini_fn): ... here. Create a void arg fn.
2501         Add it to the slot in the appropriate static_init_fini_fns
2502         hash table.
2503         (finish_static_storage_duration_function): Rename to ...
2504         (finish_partial_init_fini_fn): ... here.
2505         (get_priority_info): Delete.
2506         (one_static_initialization_or_destruction): Assert not
2507         trivial dtor.
2508         (do_static_initialization_or_destruction): Rename to ...
2509         (emit_partial_init_fini_fn) ... here.  Start & finish the fn.
2510         Simply init/fini each var.
2511         (partition_vars_for_init_fini): Partition vars according to
2512         priority and add to init and/or fini list.
2513         (generate_ctor_or_dtor_function): Start and finish the function.
2514         Do santitizer calls here.
2515         (generate_ctor_and_dtor_functions_for_priority): Delete.
2516         (c_parse_final_cleanups): Reimplement global init/fini
2517         processing.
2519 2022-06-07  Jakub Jelinek  <jakub@redhat.com>
2521         * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
2522         style linear clause modifiers.  Set
2523         OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
2524         old style modifiers are used.
2525         * semantics.cc (finish_omp_clauses): Only reject linear clause
2526         with val modifier on simd or for if the old style modifiers are
2527         used.
2529 2022-06-07  Roger Sayle  <roger@nextmovesoftware.com>
2531         PR c++/96442
2532         * decl.cc (start_enum): When emitting a "must be integral" error,
2533         set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
2534         downstream in build_enumeration.
2536 2022-06-06  Patrick Palka  <ppalka@redhat.com>
2538         PR c++/53164
2539         PR c++/105848
2540         * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
2541         ADDR_EXPR callee when calling mark_used.
2543 2022-06-04  Marek Polacek  <polacek@redhat.com>
2545         PR c++/102399
2546         PR c++/69585
2547         * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
2548         followed by [[]] attributes and vice versa.
2550 2022-06-03  Patrick Palka  <ppalka@redhat.com>
2552         PR c++/105756
2553         * typeck.cc (cp_build_binary_op): Don't fold operands
2554         when c_inhibit_evaluation_warnings.
2556 2022-06-03  Jason Merrill  <jason@redhat.com>
2558         PR c++/105761
2559         * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
2560         from a hidden friend.
2562 2022-06-03  Patrick Palka  <ppalka@redhat.com>
2564         PR c++/105637
2565         * tree.cc (maybe_dummy_object): When returning a dummy
2566         object, respect the cv-quals of 'this' if available.
2568 2022-06-03  Patrick Palka  <ppalka@redhat.com>
2570         PR c++/100374
2571         * pt.cc (determine_specialization): Compare overall constraints
2572         not just the trailing constraints.
2573         (tsubst_each_template_parm_constraints): Define.
2574         (tsubst_friend_function): Use it.
2575         (tsubst_friend_class): Use it.
2576         (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
2578 2022-06-03  Patrick Palka  <ppalka@redhat.com>
2580         PR c++/105797
2581         * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
2582         Don't walk DECL_CONTEXT.
2583         <case PARM_DECL>: Likewise.  Walk TREE_TYPE.
2584         <case CONST_DECL>: Simplify.
2585         (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
2587 2022-06-02  Marek Polacek  <polacek@redhat.com>
2589         * constexpr.cc (potential_constant_expression_1): Treat
2590         {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
2592 2022-06-02  Marek Polacek  <polacek@redhat.com>
2594         PR c++/105803
2595         * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
2596         in the switch.
2598 2022-06-02  David Malcolm  <dmalcolm@redhat.com>
2600         * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
2601         (cp_get_sarif_source_language): New.
2603 2022-06-02  Jason Merrill  <jason@redhat.com>
2605         PR c++/105795
2606         * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
2607         (cxx_eval_store_expression): Likewise.
2608         (cxx_eval_bare_aggregate): Handle null ctx->ctor.
2610 2022-06-02  Jason Merrill  <jason@redhat.com>
2612         PR c++/105795
2613         * constexpr.cc (cxx_eval_bare_aggregate): Always call
2614         init_subob_ctx.
2616 2022-06-01  Jason Merrill  <jason@redhat.com>
2618         PR c++/105734
2619         * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
2620         if the expression has auto type.
2622 2022-06-01  Jason Merrill  <jason@redhat.com>
2624         PR c++/105779
2625         * call.cc (resolve_args): Call mark_single_function here.
2626         * pt.cc (unify_one_argument): Not here.
2628 2022-06-01  Nathan Sidwell  <nathan@acm.org>
2630         * decl2.cc (fix_temporary_vars_context_r): Use data argument
2631         for new context.
2632         (one_static_initialization_or_destruction): Adjust tree walk
2633         call.  Refactor guard generation.
2635 2022-06-01  Nathan Sidwell  <nathan@acm.org>
2637         * decl2.cc (ssdf_decl): Delete global.
2638         (start_static_storage_duration_function): Use some RAII.
2639         (do_static_initialization_or_destruction): Likewise.
2640         (c_parse_final_cleanups): Likewise.  Avoid rechecking 'vars'.
2642 2022-06-01  Nathan Sidwell  <nathan@acm.org>
2644         * decl2.cc (start_objects): Replace 'method_type' parameter
2645         with 'initp' boolean, rename and retype 'priority' parameter.
2646         (finish_objects): Likewise.  Do not expand here.
2647         (one_static_initialization_or_destruction): Move 'initp'
2648         parameter first.
2649         (do_static_initialization_or_destruction): Likewise.
2650         (generate_ctor_or_dtor_function): Rename 'initp' parameter.
2651         Adjust start_objects/finish_obects calls and expand here.
2652         (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
2653         (c_parse_final_cleanups): Likewise.
2654         (vtv_start_verification_constructor_init): Adjust.
2655         (vtv_finish_verification_constructor_init): Use finish_objects.
2657 2022-05-31  Patrick Palka  <ppalka@redhat.com>
2659         PR c++/105758
2660         * call.cc (build_over_call): Use z_candidate::conversion_path
2661         and ::access_path instead of TYPE_BINFO when building the
2662         BASELINK for the templated form.
2664 2022-05-31  Patrick Palka  <ppalka@redhat.com>
2666         * parser.cc: Use auto_timevar instead of timevar_push/pop.
2667         Remove wrapper functions.
2668         * pt.cc: Likewise.
2670 2022-05-31  Patrick Palka  <ppalka@redhat.com>
2672         * cp-tree.h (cp_build_qualified_type_real): Rename to ...
2673         (cp_build_qualified_type): ... this.  Give its last parameter
2674         a default argument.  Remove macro of the same name.
2675         * decl.cc (grokdeclarator): Adjust accordingly.
2676         * pt.cc (tsubst_aggr_type): Likewise.
2677         (rebuild_function_or_method_type): Likewise.
2678         (tsubst): Likewise.
2679         (maybe_dependent_member_ref): Likewise.
2680         (unify): Likewise.
2681         * tree.cc (cp_build_qualified_type_real): Rename to ...
2682         (cp_build_qualified_type): ... this.  Adjust accordingly.
2684 2022-05-31  Jason Merrill  <jason@redhat.com>
2686         * Make-lang.in (c++.tags): Just look at *.cc.
2688 2022-05-31  Patrick Palka  <ppalka@redhat.com>
2690         * cp-tree.h (comp_template_args): Change return type to bool.
2691         * pt.cc (comp_template_args): Document default arguments.
2692         Change return type to bool and adjust returns accordingly.
2694 2022-05-31  Patrick Palka  <ppalka@redhat.com>
2696         * decl.cc (grokvardecl): Use current_template_constraints.
2697         (grokdeclarator): Likewise.
2698         (xref_tag): Likewise.
2699         * semantics.cc (finish_template_template_parm): Likewise.
2701 2022-05-31  Jakub Jelinek  <jakub@redhat.com>
2703         * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
2704         clauses.
2706 2022-05-30  Marek Polacek  <polacek@redhat.com>
2708         PR c++/99080
2709         * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
2710         * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
2711         specifically.
2713 2022-05-28  Jakub Jelinek  <jakub@redhat.com>
2715         * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
2716         seen first, use "%<to%>" or "%<enter%>" depending on
2717         OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
2718         "%<to%> or %<enter%>" wording.
2720 2022-05-28  Jason Merrill  <jason@redhat.com>
2722         PR c++/105652
2723         * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
2724         instantiate into a class-scope lambda.
2726 2022-05-27  Marek Polacek  <polacek@redhat.com>
2728         PR c++/105725
2729         * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
2731 2022-05-27  Jakub Jelinek  <jakub@redhat.com>
2733         * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
2734         (cp_parser_omp_all_clauses): For to clause on declare target, use
2735         OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
2736         OMP_CLAUSE_TO_DECLARE clause.  Handle PRAGMA_OMP_CLAUSE_ENTER.
2737         (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
2738         (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
2739         OMP_CLAUSE_TO_DECLARE.
2740         * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
2741         of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
2742         name in diagnostics instead of
2743         omp_clause_code_name[OMP_CLAUSE_CODE (c)].
2745 2022-05-26  Marek Polacek  <polacek@redhat.com>
2747         PR c++/105569
2748         * typeck.cc (warn_for_null_address): Improve the warning when
2749         the POINTER_PLUS_EXPR's base is of reference type.
2751 2022-05-26  Patrick Palka  <ppalka@redhat.com>
2753         PR c++/96363
2754         * decl.cc (shadow_tag): Use the return value of
2755         maybe_process_partial_specialization.
2756         * parser.cc (cp_parser_single_declaration): Call shadow_tag
2757         before associate_classtype_constraints.
2758         * pt.cc (maybe_new_partial_specialization): Change return type
2759         to bool.  Take 'type' argument by mutable reference.  Set 'type'
2760         to point to the correct constrained specialization when
2761         appropriate.
2762         (maybe_process_partial_specialization): Adjust accordingly.
2764 2022-05-25  Marek Polacek  <polacek@redhat.com>
2766         PR c++/96637
2767         * cp-tree.h (attr_chainon): Declare.
2768         * decl.cc (start_decl): Use attr_chainon.
2769         (grokdeclarator): Likewise.
2770         * parser.cc (cp_parser_statement): No longer static.
2772 2022-05-25  Jason Merrill  <jason@redhat.com>
2774         PR c++/105655
2775         * pt.cc (build_template_decl): Add assert.
2776         (tsubst_function_decl): Don't return a template.
2778 2022-05-25  Jason Merrill  <jason@redhat.com>
2780         PR c++/105623
2781         * decl2.cc (mark_used): Copy type from fn to BASELINK.
2782         * pt.cc (unify_one_argument): Call mark_single_function.
2784 2022-05-25  Jason Merrill  <jason@redhat.com>
2786         * constexpr.cc (cxx_eval_call_expression): Check for
2787         heap vars in the result.
2789 2022-05-25  Jason Merrill  <jason@redhat.com>
2791         * constexpr.cc (maybe_constant_init_1): Only pass false for
2792         strict when initializing a variable of static duration.
2794 2022-05-25  Marek Polacek  <polacek@redhat.com>
2796         PR c++/100252
2797         * typeck2.cc (potential_prvalue_result_of): New.
2798         (replace_placeholders_for_class_temp_r): New.
2799         (digest_nsdmi_init): Call it.
2801 2022-05-24  Jason Merrill  <jason@redhat.com>
2803         * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
2804         (cxx_eval_call_expression): Call it.
2805         (cxx_fold_indirect_ref_1): Handle null empty_base.
2807 2022-05-24  Jason Merrill  <jason@redhat.com>
2809         * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
2810         from int to value_cat.  Change most false to vc_prvalue, most true
2811         to vc_glvalue, cases where the return value is ignored to
2812         vc_discard.
2813         (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
2814         (cxx_eval_store_expression): Only build _REF for vc_glvalue.
2815         (cxx_eval_array_reference, cxx_eval_component_reference)
2816         (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
2818 2022-05-24  Jason Merrill  <jason@redhat.com>
2820         PR c++/105622
2821         * constexpr.cc (cxx_eval_store_expression): Adjust assert.
2822         Use initialized_type.
2824 2022-05-24  Patrick Palka  <ppalka@redhat.com>
2826         * cp-tree.h (any_template_arguments_need_structural_equality_p):
2827         Declare.
2828         * pt.cc (struct ctp_hasher): Define.
2829         (ctp_table): Define.
2830         (canonical_type_parameter): Use it.
2831         (process_template_parm): Set TYPE_CANONICAL for
2832         TEMPLATE_TEMPLATE_PARM too.
2833         (lookup_template_class_1): Remove now outdated comment for the
2834         any_template_arguments_need_structural_equality_p test.
2835         (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
2836         clear TYPE_CANONICAL for ttps.  Set TYPE_CANONICAL on the
2837         substituted type later.
2838         (any_template_arguments_need_structural_equality_p): Return
2839         true for any_targ_node.  Don't return true just because a
2840         template argument uses structural equality.  Add comment for
2841         the PARM_DECL special case.
2842         (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
2843         parm's type later.
2844         * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
2845         when safe to do so.
2846         * typeck.cc (structural_comptypes) [check_alias]: Increment
2847         processing_template_decl before checking
2848         dependent_alias_template_spec_p.
2850 2022-05-24  Jakub Jelinek  <jakub@redhat.com>
2852         PR c/105378
2853         * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
2855 2022-05-20  David Malcolm  <dmalcolm@redhat.com>
2857         * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
2858         "final" and "override".
2859         * error.cc: Likewise.
2861 2022-05-18  Marek Polacek  <polacek@redhat.com>
2863         PR c++/105634
2864         * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
2866 2022-05-17  Jason Merrill  <jason@redhat.com>
2868         PR c++/102307
2869         * decl.cc (check_initializer): Use build_cplus_new in case of
2870         constexpr failure.
2872 2022-05-17  Jakub Jelinek  <jakub@redhat.com>
2874         * parser.cc (cp_parser_omp_clause_depend): Parse
2875         inoutset depend-kind.
2876         (cp_parser_omp_depobj): Likewise.
2877         * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
2878         OMP_CLAUSE_DEPEND_INOUTSET.
2880 2022-05-16  Martin Liska  <mliska@suse.cz>
2882         * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
2883         * name-lookup.cc (get_std_name_hint): Likewise.
2884         * parser.cc (cp_parser_new): Likewise.
2886 2022-05-16  Marcel Vollweiler  <marcel@codesourcery.com>
2888         * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
2889         * semantics.cc (finish_omp_clauses): Added template decl processing.
2891 2022-05-15  Jason Merrill  <jason@redhat.com>
2893         PR c++/100502
2894         PR c++/58993
2895         * friend.cc (is_friend): Hidden friends count as members.
2896         * search.cc (friend_accessible_p): Likewise.
2898 2022-05-15  Jason Merrill  <jason@redhat.com>
2900         * parser.cc (cp_parser_template_name): Look through
2901         injected-class-name.
2903 2022-05-15  Jason Merrill  <jason@redhat.com>
2905         PR c++/105589
2906         PR c++/105191
2907         PR c++/92385
2908         * init.cc (build_value_init): Handle class in template.
2910 2022-05-13  Nathan Sidwell  <nathan@acm.org>
2912         * mangle.cc (maybe_write_module): Check external linkage.
2914 2022-05-13  Richard Biener  <rguenther@suse.de>
2916         * constexpr.cc: Remove gimple-fold.h include.
2918 2022-05-12  Patrick Palka  <ppalka@redhat.com>
2920         * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
2921         TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
2922         * pt.cc (try_class_unification): Correctly copy multidimensional
2923         targs.  Free the copy of targs.
2924         (unify_pack_expansion): Fix level comparison.
2926 2022-05-12  Nathan Sidwell  <nathan@acm.org>
2928         * parser.cc (cp_parser_linkage_specification): Implement
2929         global module attachment semantics.
2931 2022-05-12  Jakub Jelinek  <jakub@redhat.com>
2933         * lex.cc (init_reswords): Register omp_all_memory as keyword
2934         if flag_openmp.
2935         * parser.cc (cp_parser_primary_expression): Diagnose uses of
2936         omp_all_memory in postfix expressions.
2937         (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
2938         clause.
2939         * semantics.cc (finish_omp_clauses): Handle omp_all_memory
2940         keyword in depend clause as null_pointer_node, diagnose invalid
2941         uses.
2942         * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
2944 2022-05-11  Patrick Palka  <ppalka@redhat.com>
2946         * constraint.cc (tsubst_parameter_mapping): Convert loop over
2947         TREE_VEC into a range-based for loop using tree_vec_range.
2948         * pt.cc (iterative_hash_template_arg): Likewise.
2949         (template_parms_level_to_args): Likewise.
2950         (deducible_template_args): Likewise.
2951         (check_undeduced_parms): Likewise.
2952         (dependent_type_p_r): Likewise.
2953         (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
2954         Likewise.
2955         (dependent_template_arg_p): Likewise.
2956         * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
2957         Likewise.
2959 2022-05-11  Jason Merrill  <jason@redhat.com>
2961         PR c++/105541
2962         * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
2963         * parser.cc (cp_parser_enclosed_template_argument_list):
2964         Use 0-length TREE_VEC for <>.
2966 2022-05-11  Jason Merrill  <jason@redhat.com>
2968         PR bootstrap/105567
2969         * typeck.cc (check_return_expr): Don't mess with ctor return value
2970         while parsing a template.
2972 2022-05-11  Nathan Sidwell  <nathan@acm.org>
2974         * cp-tree.h (DECL_MODULE_ATTACH_P): New.
2975         (struct lang_decl_base): Add module_attach_p flag.
2976         * decl.cc (duplicate_decls): Rework module redeclaration
2977         checking.
2978         * module.cc (trees_out::lang_decl_bools): Write attach flag.
2979         (trees_in::lang_decl_bools): ... and read it back.
2980         (trees_out::decl_value): Rework module attachment handling.
2981         (trees_in::decl_value): Rename local var to reflect meaning.
2982         (trees_in::key_mergeable): Likewise.
2983         (get_originating_module): Use DECL_MODULE_ATTACH_P.  No need
2984         to special-case mangling.
2985         (module_may_redeclare): Reimplement.
2986         (set_originating_module): Deal with attachment.
2987         * name-lookup.cc (maybe_record_mergeable_decl): Deal with
2988         attachment.
2989         (mergeable_namespace_slots): Likewise.
2990         (do_nonmember_using_decl): Likewise.
2991         * name-lookup.h (mergeable_namespace_slots): Adjust parm
2992         meaning.
2993         * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
2995 2022-05-11  Martin Liska  <mliska@suse.cz>
2997         PR target/105355
2998         * lang-specs.h: Use Separate syntax.
3000 2022-05-10  Patrick Palka  <ppalka@redhat.com>
3002         * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
3003         * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
3004         * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
3005         (SET_ARGUMENT_PACK_ARGS): Remove.
3006         * module.cc (trees_in::tree_node): Adjust accordingly.
3007         * parser.cc (make_char_string_pack): Likewise.
3008         (make_string_pack): Likewise.
3009         * pt.cc (make_pack_expansion): Likewise.
3010         (template_parm_to_arg): Likewise.
3011         (coerce_template_parameter_pack): Likewise.
3012         (extract_fnparm_pack): Likewise.
3013         (extract_locals_r): Likewise.
3014         (make_argument_pack): Likewise.
3015         (tsubst_argument_pack): Likewise.
3016         (lookup_init_capture_pack): Likewise.
3017         (type_unification_real): Likewise.
3018         (unify_pack_expansion): Likewise.
3019         (tsubst_initializer_list): Likewise.
3021 2022-05-10  Patrick Palka  <ppalka@redhat.com>
3023         * cp-tree.h (PACK_EXPANSION_CHECK): Define.
3024         (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
3025         (SET_PACK_EXPANSION_PATTERN): Likewise.
3026         (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
3027         (PACK_EXPANSION_EXTRA_ARGS): Likewise.
3028         (PACK_EXPANSION_LOCAL_P): Likewise.
3029         (PACK_EXPANSION_SIZEOF_P): Likewise.
3030         (PACK_EXPANSION_AUTO_P): Likewise.
3031         (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
3032         (ARGUMENT_PACK_CHECK): Define.
3033         (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
3034         (SET_ARGUMENT_PACK_ARGS): Likewise.
3035         * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
3036         before setting PACK_EXPANSION_SIZEOF_P.
3038 2022-05-10  Nathan Sidwell  <nathan@acm.org>
3040         * cp-tree.h (enum module_kind_bits): Disambiguate purview,
3041         attach, named module vs header-unit.
3042         (global_purview_p, not_module_p): Delete.
3043         (named_module_p): New.
3044         (header_module_p, module_purview_p): Adjust.
3045         (module_attach_p, named_module_purview_p): New.
3046         * decl.cc (duplicate_decls): Adjust.
3047         * module.cc (declare_module, preprocessed_module): Adjust.
3048         * name-lookup.cc (init_global_partition): Adjust.
3049         (get_fixed_binding_slot, pushdecl): Adjust.
3050         * parser.cc (cp_parser_module_declaration): Adjust.
3051         (cp_parser_import_declaration, cp_parser_declaration): Adjust.
3053 2022-05-10  Jason Merrill  <jason@redhat.com>
3055         PR c++/105529
3056         * decl.cc (maybe_return_this): Replace...
3057         (finish_constructor_body, finish_destructor_body): ...these.
3058         (finish_function_body): Call it.
3059         * optimize.cc (build_delete_destructor_body): Call it.
3060         * cp-tree.h (maybe_return_this): Declare.
3062 2022-05-09  Marek Polacek  <polacek@redhat.com>
3064         PR c++/103539
3065         * parser.cc (cp_parser_statement): Constify the in_compound parameter.
3066         Create a modifiable copy.  Allow labels at the end of compound
3067         statements.
3069 2022-05-09  Patrick Palka  <ppalka@redhat.com>
3071         PR c++/105491
3072         * call.cc (field_in_pset): Adjust after next_initializable_field
3073         renaming.
3074         (build_aggr_conv): Likewise.
3075         (convert_like_internal): Likewise.
3076         (type_has_extended_temps): Likewise.
3077         * class.cc (default_init_uninitialized_part): Likewise.
3078         (finish_struct): Likewise.
3079         * constexpr.cc (cx_check_missing_mem_inits): Likewise.
3080         (reduced_constant_expression_p): Use next_subobject_field
3081         instead.
3082         * cp-gimplify.cc (get_source_location_impl_type): Adjust after
3083         next_initializable_field renaming.
3084         (fold_builtin_source_location): Likewise.
3085         * cp-tree.h (next_initializable_field): Rename to ...
3086         (next_aggregate_field): ... this.
3087         (next_subobject_field): Declare.
3088         * decl.cc (next_aggregate_field): Renamed from ...
3089         (next_initializable_field): ... this.  Skip over vptr fields
3090         again.
3091         (next_subobject_field): Define.
3092         (reshape_init_class): Adjust after next_initializable_field
3093         renaming.
3094         * init.cc (build_value_init_noctor): Likewise.
3095         (emit_mem_initializers): Likewise.
3096         * lambda.cc (build_capture_proxy): Likewise.
3097         * method.cc (build_comparison_op): Likewise.
3098         * pt.cc (maybe_aggr_guide): Likewise.
3099         * tree.cc (structural_type_p): Likewise.
3100         * typeck2.cc (split_nonconstant_init_1): Likewise.
3101         (digest_init_r): Likewise.
3103 2022-05-09  Nathan Sidwell  <nathan@acm.org>
3105         * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
3106         DECL_MODULE_ATTACHMENTS_P.
3107         (struct lane_decl_base): Rename module_attached_p to
3108         module_keyed_decls_p.
3109         (maybe_key_decl): Renamed from maybe_attach_decl.
3110         * lambda.cc (record_lambda_scope): Adjust.
3111         * lex.cc (cxx_dup_lang_specific_decl): Adjust.
3112         * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
3113         attached_table.
3114         (enum merge_kind): Rename MK_attached to MK_keyed.
3115         (trees_out::lang_decl_bools): Adjust.
3116         (trees_in::lang_decl_bools): Adjust.
3117         (trees_in::decl_value): Adjust.
3118         (trees_out::get_merge_kind): Adjust.
3119         (trees_out::key_mergeable): Adjust.
3120         (trees_in::key_mergeable): Adjust.
3121         (maybe_key_decl): Rename from maybe_attach_decl.
3122         (direct_import): Adjust.
3123         (fini_modules): Adjust.
3125 2022-05-09  Martin Liska  <mliska@suse.cz>
3127         * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
3128         macros.
3129         * parser.cc (cp_finalize_omp_declare_simd): Likewise.
3130         (cp_finalize_oacc_routine): Likewise.
3132 2022-05-07  Marek Polacek  <polacek@redhat.com>
3134         PR c++/101833
3135         PR c++/47634
3136         * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
3138 2022-05-06  Jason Merrill  <jason@redhat.com>
3140         * error.cc (decl_to_string): Add show_color parameter.
3141         (subst_to_string): Likewise.
3142         (cp_printer): Pass it.
3143         (type_to_string): Set pp_show_color.
3144         (dump_function_name): Use "fnname" color.
3145         (dump_template_bindings): Use "targs" color.
3146         (struct colorize_guard): New.
3147         (reinit_cxx_pp): Clear pp_show_color.
3149 2022-05-06  Jason Merrill  <jason@redhat.com>
3151         PR c++/105245
3152         PR c++/100111
3153         * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
3154         handling.
3156 2022-05-05  Marek Polacek  <polacek@redhat.com>
3158         PR c++/64679
3159         * parser.cc (cp_parser_parameter_declaration_clause): Maintain
3160         a vector of parameters that haven't been pushed yet.  Push them at the
3161         end of a valid parameter-declaration-clause.
3162         (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
3163         Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
3164         would result in a hard error.
3165         (cp_parser_cache_defarg): Adjust the call to
3166         cp_parser_parameter_declaration_list.
3168 2022-05-05  Richard Biener  <rguenther@suse.de>
3170         * module.cc (trees_in::core_vals): Remove separate allocation
3171         for REAL_CST.
3173 2022-05-04  Jason Merrill  <jason@redhat.com>
3175         PR c++/104470
3176         * pt.cc (maybe_dependent_member_ref): Handle types.
3177         (tsubst, tsubst_copy): Use it.
3178         (tsubst_aggr_type, instantiate_alias_template): Don't handle
3179         tf_dguide here.
3181 2022-05-04  Patrick Palka  <ppalka@redhat.com>
3183         PR c++/105476
3184         * pt.cc (maybe_aggr_guide): Set processing_template_decl when
3185         partially instantiating the guide's parameter list.
3187 2022-05-04  Marek Polacek  <polacek@redhat.com>
3189         PR c++/64679
3190         * parser.cc (cp_parser_init_declarator): Properly handle a series of
3191         operator() calls, they are not part of an init-declarator.
3193 2022-05-04  Jason Merrill  <jason@redhat.com>
3195         * decl.cc (reshape_init): Shortcut already-reshaped init.
3196         (reshape_init_class): Assert not getting one here.
3198 2022-05-04  Jason Merrill  <jason@redhat.com>
3200         * error.cc (cp_print_error_function): Use %qD.
3201         (function_category): Use %qD.
3203 2022-05-04  Marek Polacek  <polacek@redhat.com>
3205         PR c++/105436
3206         * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
3207         return true for CPP_GREATER_EQ.
3209 2022-05-04  Jason Merrill  <jason@redhat.com>
3211         * cp-tree.h (struct language_function): Remove x_cdtor_label.
3212         (cdtor_label, LABEL_DECL_CDTOR): Remove.
3213         * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
3214         (cxx_eval_constant_expression): Don't call returns.
3215         * decl.cc (check_goto): Don't check cdtor_label.
3216         (start_preparsed_function): And don't set it.
3217         (finish_constructor_body, finish_destructor_body): Remove.
3218         (finish_function_body): Don't call them.
3219         * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
3220         * semantics.cc (finish_return_stmt): Not here.
3222 2022-05-04  Jakub Jelinek  <jakub@redhat.com>
3224         * lambda.cc: Include decl.h.
3225         (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
3226         UNAVAILABLE_DEPRECATED_SUPPRESS.
3228 2022-05-03  Patrick Palka  <ppalka@redhat.com>
3230         PR c++/105351
3231         * cp-tree.h (finish_non_static_data_member): Add defaulted
3232         complain parameter.
3233         * pt.cc (tsubst_copy_and_build): Pass complain to
3234         finish_non_static_data_member.
3235         * semantics.cc (finish_non_static_data_member): Respect complain
3236         parameter.
3237         (finish_qualified_id_expr): Pass complain to
3238         finish_non_static_data_member.
3240 2022-05-02  Jason Merrill  <jason@redhat.com>
3242         * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
3243         (do_auto_deduction): Use expr location.
3245 2022-05-02  Jason Merrill  <jason@redhat.com>
3247         * class.cc (maybe_note_name_used_in_class): Note in all enclosing
3248         classes.  Remember location of use.
3249         (note_name_declared_in_class): Adjust.
3251 2022-05-02  Marek Polacek  <polacek@redhat.com>
3253         * cp-tree.h (uses_template_parms): Adjust declaration.
3254         * pt.cc (uses_template_parms): Return bool.  Use a RAII sentinel.
3256 2022-05-02  Richard Biener  <rguenther@suse.de>
3258         * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
3259         * cp-gimplify.cc (cp_fold): Likewise.
3260         * pt.cc (tsubst_copy): Likewise.
3262 2022-04-29  Jason Merrill  <jason@redhat.com>
3264         PR c++/91618
3265         PR c++/96604
3266         * friend.cc (do_friend): Call check_explicit_specialization here.
3267         * decl.cc (grokdeclarator): Not here.
3268         * decl2.cc (check_classfn): Or here.
3270 2022-04-29  Jason Merrill  <jason@redhat.com>
3272         PR c++/104470
3273         * cp-tree.h (enum tsubst_flags): Add tf_dguide.
3274         * pt.cc (tsubst_aggr_type): Check it.
3275         (tsubst_baselink, tsubst_copy): Check it.
3276         (maybe_dependent_member_ref): Check it.
3277         (instantiate_alias_template): Handle it.
3278         (build_deduction_guide): Set it.
3280 2022-04-29  Jason Merrill  <jason@redhat.com>
3282         PR c++/82980
3283         * lambda.cc (type_deducible_expression_p): Allow more types.
3285 2022-04-29  Jason Merrill  <jason@redhat.com>
3287         * decl.cc (cp_finish_decl): Only consider auto for vars.
3289 2022-04-29  Marek Polacek  <polacek@redhat.com>
3291         PR c++/67048
3292         * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
3293         only when it's followed by a semicolon.
3295 2022-04-29  Jason Merrill  <jason@redhat.com>
3297         PR c++/80351
3298         * decl.cc (cp_finish_decl): Check completeness of deduced type.
3300 2022-04-29  Jason Merrill  <jason@redhat.com>
3302         PR c++/102987
3303         * error.cc (dump_decl) [USING_DECL]: Respect flags.
3305 2022-04-29  Jason Merrill  <jason@redhat.com>
3307         * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
3309 2022-04-29  Jakub Jelinek  <jakub@redhat.com>
3311         PR c++/104319
3312         * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
3313         after a type id by setting maybe_type_id and aborting tentative
3314         parse.
3315         (cp_parser_enclosed_template_argument_list): Handle
3316         CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
3317         CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
3318         or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
3319         (cp_parser_next_token_ends_template_argument_p): Return true
3320         also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
3322 2022-04-29  Iain Sandoe  <iain@sandoe.co.uk>
3324         PR c++/105426
3325         * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
3326         temporaries to coroutine frame copies.
3328 2022-04-29  Jason Merrill  <jason@redhat.com>
3330         * semantics.cc (check_trait_type): Don't check completeness
3331         of element type of array of unknown bound.
3333 2022-04-29  Jason Merrill  <jason@redhat.com>
3335         PR c++/102651
3336         PR c++/49387
3337         * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
3338         (emit_tinfo_decl): Update tdesc type if needed.
3340 2022-04-29  Zhao Wei Liew  <zhaoweiliew@gmail.com>
3342         PR c++/25689
3343         * call.cc (extract_call_expr): Return a NULL_TREE on failure
3344         instead of asserting.
3345         (build_new_method_call): Suppress -Wparentheses diagnostic for
3346         MODIFY_EXPR.
3347         * semantics.cc (is_assignment_op_expr_p): Add function to check
3348         if an expression is a call to an op= operator expression.
3349         (maybe_convert_cond): Handle the case of a op= operator expression
3350         for the -Wparentheses diagnostic.
3352 2022-04-28  Patrick Palka  <ppalka@redhat.com>
3354         PR c++/105425
3355         * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
3356         DEPENDENT_OPERATOR_TYPE like an empty type.
3358 2022-04-28  Iain Sandoe  <iain@sandoe.co.uk>
3360         PR c++/104051
3361         * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
3362         non-target expression inputs.
3364 2022-04-28  Iain Sandoe  <iain@sandoe.co.uk>
3366         PR c++/105301
3367         * coroutines.cc (coro_promise_type_found_p): Account for possible
3368         mutliple overloads of the promise return_value() method.
3370 2022-04-28  Iain Sandoe  <iain@sandoe.co.uk>
3372         PR c++/105287
3373         * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
3374         are added to the bind expr.
3375         (add_var_to_bind): Fix local var naming to use portable punctuation.
3376         (register_local_var_uses): Do not add synthetic names to unnamed
3377         temporaries.
3379 2022-04-28  Nathan Sidwell  <nathan@acm.org>
3380             Iain Sandoe  <iain@sandoe.co.uk>
3382         PR c++/103868
3383         * coroutines.cc (finish_co_await_expr): Do not process non-dependent
3384         coroutine expressions at template definition time.
3385         (finish_co_yield_expr): Likewise.
3386         (finish_co_return_stmt): Likewise.
3388 2022-04-28  Marek Polacek  <polacek@redhat.com>
3390         PR c++/90107
3391         * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
3392         definition.
3394 2022-04-27  Jason Merrill  <jason@redhat.com>
3396         * tree.cc (strip_typedefs): Add default argument comments.
3398 2022-04-27  Marek Polacek  <polacek@redhat.com>
3400         PR c++/105398
3401         * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
3403 2022-04-26  Jason Merrill  <jason@redhat.com>
3405         PR c++/102629
3406         * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
3407         TEMPLATE_TYPE_PARAMETER_PACK on auto.
3409 2022-04-26  Patrick Palka  <ppalka@redhat.com>
3411         PR c++/105386
3412         * semantics.cc (finish_decltype_type): Pass tf_decltype to
3413         instantiate_non_dependent_expr_sfinae.
3415 2022-04-26  Jason Merrill  <jason@redhat.com>
3417         PR c++/104624
3418         * pt.cc (check_for_bare_parameter_packs): Check for lambda
3419         function parameter pack.
3421 2022-04-26  Patrick Palka  <ppalka@redhat.com>
3423         PR c++/105289
3424         PR c++/86193
3425         * pt.cc (process_partial_specialization): Downgrade "partial
3426         specialization isn't more specialized" diagnostic from permerror
3427         to an on-by-default pedwarn.
3428         (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
3429         NTTP type a second time, use the original type not the
3430         substituted type.
3432 2022-04-25  Marek Polacek  <polacek@redhat.com>
3434         PR c++/105353
3435         * typeck.cc (build_x_shufflevector): Use
3436         instantiation_dependent_expression_p except for the first two
3437         arguments.
3439 2022-04-21  Marek Polacek  <polacek@redhat.com>
3441         * constexpr.cc (cxx_eval_logical_expression): Remove unused
3442         parameter.
3443         (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
3444         <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
3446 2022-04-21  Marek Polacek  <polacek@redhat.com>
3448         PR c++/105321
3449         * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
3450         to cxx_eval_constant_expression.
3452 2022-04-20  Ed Catmur  <ed@catmur.uk>
3454         PR c++/104996
3455         * call.cc (compare_ics): When comparing list-initialization
3456         sequences, do not return early.
3458 2022-04-19  Jakub Jelinek  <jakub@redhat.com>
3460         PR c++/105256
3461         * typeck2.cc (process_init_constructor_array,
3462         process_init_constructor_record, process_init_constructor_union): Move
3463         CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
3464         containing CONSTRUCTOR.
3466 2022-04-15  Marek Polacek  <polacek@redhat.com>
3468         PR c++/105268
3469         * parser.cc (cp_parser_placeholder_type_specifier): Return
3470         error_mark_node when trying to build up a constrained parameter in
3471         a default argument.
3473 2022-04-15  Jason Merrill  <jason@redhat.com>
3475         PR c++/102804
3476         * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
3478 2022-04-15  Jason Merrill  <jason@redhat.com>
3480         PR c++/102987
3481         * error.cc (dump_expr): Handle USING_DECL.
3482         [VIEW_CONVERT_EXPR]: Just look through location wrapper.
3484 2022-04-14  Jason Merrill  <jason@redhat.com>
3486         PR c++/104646
3487         * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
3488         checks for defaulted ctors.
3490 2022-04-14  Jason Merrill  <jason@redhat.com>
3492         PR c++/82980
3493         * lambda.cc (type_deducible_expression_p): New.
3494         (lambda_capture_field_type): Check it.
3496 2022-04-14  Jason Merrill  <jason@redhat.com>
3498         PR c++/65211
3499         * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
3501 2022-04-14  Jason Merrill  <jason@redhat.com>
3503         PR c++/97219
3504         * name-lookup.cc (dependent_local_decl_p): New.
3505         * cp-tree.h (dependent_local_decl_p): Declare.
3506         * semantics.cc (finish_call_expr): Use it.
3507         * pt.cc (tsubst_arg_types): Also substitute default args
3508         for local externs.
3510 2022-04-14  Jason Merrill  <jason@redhat.com>
3512         PR c++/101698
3513         * pt.cc (tsubst_baselink): Also check dependent optype.
3515 2022-04-14  Jason Merrill  <jason@redhat.com>
3517         PR c++/101442
3518         * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
3519         * init.cc (perform_member_init): Likewise.
3520         * semantics.cc (push_cleanup): Adjust comment.
3522 2022-04-13  Jason Merrill  <jason@redhat.com>
3524         PR c++/105245
3525         PR c++/100111
3526         * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
3527         as needed in empty base handling.
3529 2022-04-13  Jakub Jelinek  <jakub@redhat.com>
3531         PR c++/105233
3532         * decl2.cc (cp_check_const_attributes): For aligned attribute
3533         pass manifestly_const_eval=true to fold_non_dependent_expr.
3535 2022-04-13  Marek Polacek  <polacek@redhat.com>
3537         PR c++/97296
3538         * call.cc (direct_reference_binding): strip_top_quals when creating
3539         a ck_qual.
3541 2022-04-12  Jason Merrill  <jason@redhat.com>
3543         PR c++/104669
3544         * decl.cc (decls_match): Compare versions even if not recording.
3545         (duplicate_decls): Propagate attributes to alias.
3546         * decl2.cc (find_last_decl): Give up if versioned.
3548 2022-04-12  Jason Merrill  <jason@redhat.com>
3550         PR c++/102071
3551         * init.cc (build_new_1): Check array_p for alignment.
3553 2022-04-12  Patrick Palka  <ppalka@redhat.com>
3555         PR c++/103105
3556         * pt.cc (build_extra_args): Call preserve_args.
3558 2022-04-12  Jason Merrill  <jason@redhat.com>
3560         PR c++/104142
3561         * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
3563 2022-04-12  Jason Merrill  <jason@redhat.com>
3565         PR c++/105223
3566         PR c++/92918
3567         * class.cc (finish_struct): Always using op=.
3569 2022-04-11  Jason Merrill  <jason@redhat.com>
3571         PR c++/98249
3572         * call.cc (build_operator_new_call): Just look in ::.
3574 2022-04-11  Alexandre Oliva  <oliva@adacore.com>
3576         * constexpr.cc (cxx_eval_call_expression): Disregard dtor
3577         result.
3579 2022-04-11  Alexandre Oliva  <oliva@adacore.com>
3581         * semantics.cc (set_cleanup_locs): Propagate locus to call
3582         wrapped in cast-to-void.
3584 2022-04-11  Jason Merrill  <jason@redhat.com>
3586         PR c++/100370
3587         * init.cc (warn_placement_new_too_small): Check deref.
3589 2022-04-09  Jason Merrill  <jason@redhat.com>
3591         PR c++/105191
3592         PR c++/92385
3593         * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
3594         * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
3595         for non-aggregate types.
3596         (build_vec_init_expr): Also check constancy of explicit
3597         initializer elements.
3599 2022-04-09  Jason Merrill  <jason@redhat.com>
3601         PR c++/91618
3602         PR c++/96604
3603         * name-lookup.cc (set_decl_namespace): Set
3604         DECL_IMPLICIT_INSTANTIATION if no non-template match.
3605         * pt.cc (check_explicit_specialization): Check it.
3606         * decl2.cc (check_classfn): Call it.
3608 2022-04-07  Patrick Palka  <ppalka@redhat.com>
3610         PR c++/99479
3611         * name-lookup.cc (name_lookup::using_queue): Change to an
3612         auto_vec (with 16 elements of internal storage).
3613         (name_lookup::queue_namespace): Change return type to void,
3614         take queue parameter by reference and adjust function body
3615         accordingly.
3616         (name_lookup::do_queue_usings): Inline into ...
3617         (name_lookup::queue_usings): ... here.  As in queue_namespace.
3618         (name_lookup::search_unqualified): Don't make queue static,
3619         remove length variable, and adjust function body accordingly.
3621 2022-04-07  Jakub Jelinek  <jakub@redhat.com>
3623         PR tree-optimization/102586
3624         * cp-objcp-common.h (cp_classtype_as_base): Declare.
3625         (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
3626         * cp-objcp-common.cc (cp_classtype_as_base): New function.
3628 2022-04-07  Jason Merrill  <jason@redhat.com>
3630         PR c++/101051
3631         * decl.cc (grokdeclarator): Reject conversion with trailing return
3632         sooner.
3634 2022-04-07  Jason Merrill  <jason@redhat.com>
3636         PR c++/101717
3637         * lambda.cc (lambda_expr_this_capture): Check all enclosing
3638         lambdas for completeness.
3640 2022-04-07  Jason Merrill  <jason@redhat.com>
3642         PR c++/105187
3643         * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
3644         vectors.
3646 2022-04-06  Jakub Jelinek  <jakub@redhat.com>
3648         PR c++/104668
3649         * decl2.cc (splice_template_attributes): Return NULL if *p is
3650         error_mark_node.
3651         (cplus_decl_attributes): Return early if attributes is
3652         error_mark_node.  Don't check that later.
3654 2022-04-06  Patrick Palka  <ppalka@redhat.com>
3656         PR c++/105143
3657         * pt.cc (do_class_deduction): Check complain before attempting
3658         to issue a -Wctad-maybe-unsupported warning.
3660 2022-04-06  Jason Merrill  <jason@redhat.com>
3662         PR c++/104702
3663         * init.cc (build_vec_init): Use a reference for the result.
3665 2022-04-06  Jason Merrill  <jason@redhat.com>
3667         PR c++/100608
3668         * name-lookup.cc (check_local_shadow): Use -Wshadow=local
3669         if exactly one of 'old' and 'decl' is a type.
3671 2022-04-05  Jason Merrill  <jason@redhat.com>
3673         PR c++/103852
3674         DR 1286
3675         * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
3677 2022-04-05  Jason Merrill  <jason@redhat.com>
3679         PR c++/101677
3680         * name-lookup.h (struct cp_binding_level): Add requires_expression
3681         bit-field.
3682         * parser.cc (cp_parser_requires_expression): Set it.
3683         (synthesize_implicit_template_parm): Check it.
3685 2022-04-04  Jason Merrill  <jason@redhat.com>
3687         PR c++/101894
3688         * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
3690 2022-04-04  Jason Merrill  <jason@redhat.com>
3692         PR c++/103852
3693         DR 1286
3694         * pt.cc (get_underlying_template): Compare default template args.
3696 2022-04-03  Benno Evers  <benno.evers@tenzir.com>
3697             Iain Sandoe  <iain@sandoe.co.uk>
3699         PR c++/103328
3700         * coroutines.cc (morph_fn_to_coro): Reset
3701         current_binding_level->blocks.
3703 2022-04-01  Jason Merrill  <jason@redhat.com>
3705         Revert:
3706         2022-03-31  Jason Merrill  <jason@redhat.com>
3708         PR c++/96645
3709         * parser.cc (cp_parser_early_parsing_nsdmi): New.
3710         (cp_parser_member_declaration): Call it.
3712 2022-04-01  Jason Merrill  <jason@redhat.com>
3714         Revert:
3715         2022-03-24  Jason Merrill  <jason@redhat.com>
3717         PR c++/96645
3718         * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3719         * class.cc (type_has_default_ctor_to_be_synthesized): New.
3720         (type_has_non_user_provided_default_constructor_1): Support it.
3721         (type_has_non_user_provided_default_constructor): Now a wrapper.
3722         * method.cc (complain_about_unparsed_dmi): New.
3723         (constructible_expr): Call it.
3725 2022-04-01  Patrick Palka  <ppalka@redhat.com>
3727         PR c++/105110
3728         * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
3729         the argument type of an NTTP before deducing from it.
3731 2022-03-31  Jason Merrill  <jason@redhat.com>
3733         PR c++/96645
3734         * parser.cc (cp_parser_early_parsing_nsdmi): New.
3735         (cp_parser_member_declaration): Call it.
3737 2022-03-30  Patrick Palka  <ppalka@redhat.com>
3739         PR c++/100474
3740         * constraint.cc (diagnose_trait_expr): Handle all remaining
3741         traits appropriately.  Remove default case.
3743 2022-03-30  Marek Polacek  <polacek@redhat.com>
3745         PR c++/93280
3746         PR c++/104583
3747         * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
3749 2022-03-30  Jakub Jelinek  <jakub@redhat.com>
3751         PR c++/105092
3752         * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
3753         DECL_CONTEXT of the iterator var to current_function_decl and
3754         call pushdecl.
3756 2022-03-30  Jakub Jelinek  <jakub@redhat.com>
3758         PR c++/105061
3759         * parser.cc (cp_parser_template_introduction): If member_p, temporarily
3760         clear parser->colon_corrects_to_scope_p around tentative parsing of
3761         nested name specifier.
3763 2022-03-28  Jason Merrill  <jason@redhat.com>
3765         * pt.cc (determine_specialization): Add comment.
3767 2022-03-28  Patrick Palka  <ppalka@redhat.com>
3769         PR c++/105067
3770         * pt.cc (finish_concept_definition): Check that a concept is
3771         declared with exactly one template parameter list.
3773 2022-03-28  Patrick Palka  <ppalka@redhat.com>
3775         PR c++/105064
3776         * constraint.cc (maybe_substitute_reqs_for): Don't assume
3777         DECL_TEMPLATE_INFO is available.
3779 2022-03-28  Jason Merrill  <jason@redhat.com>
3781         PR c++/105003
3782         PR c++/104008
3783         PR c++/102869
3784         * pt.cc (complex_alias_template_r): walk_tree callback, replacing
3785         uses_all_template_parms_r, complex_pack_expansion_r.
3786         (complex_alias_template_p): Adjust.
3787         * tree.cc (strip_typedefs): Revert r12-7710 change.
3789 2022-03-28  Jason Merrill  <jason@redhat.com>
3791         PR c++/102071
3792         * init.cc (build_new_1): Include cookie in alignment.  Omit
3793         constexpr wrapper from alloc_call.
3795 2022-03-28  Jason Merrill  <jason@redhat.com>
3797         PR c++/103291
3798         * name-lookup.cc (push_local_extern_decl_alias): Call
3799         determine_visibility.
3801 2022-03-28  Jason Merrill  <jason@redhat.com>
3803         PR c++/102123
3804         * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
3805         a type template reference.
3807 2022-03-28  Jason Merrill  <jason@redhat.com>
3809         PR c++/103968
3810         * pt.cc (value_dependent_expression_p): Check
3811         has_value_dependent_address for conversion to reference.
3813 2022-03-28  Jason Merrill  <jason@redhat.com>
3815         PR c++/103943
3816         * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
3817         tsubst_baselink.
3818         (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
3820 2022-03-28  Jason Merrill  <jason@redhat.com>
3822         PR c++/102045
3823         * call.cc (make_base_init_ok): Call make_used.
3825 2022-03-28  Jason Merrill  <jason@redhat.com>
3827         PR c++/104847
3828         * mangle.cc (write_expression): Don't write a union designator when
3829         undigested.
3831 2022-03-28  Jason Merrill  <jason@redhat.com>
3833         PR c++/99445
3834         PR c++/103769
3835         * tree.cc (strip_typedefs): Use build_distinct_type_copy.
3837 2022-03-26  Patrick Palka  <ppalka@redhat.com>
3839         PR c++/105050
3840         * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
3841         Clarify error message when a if-stmt is non-constant because its
3842         branches are non-constant.
3844 2022-03-26  Patrick Palka  <ppalka@redhat.com>
3846         PR c++/103455
3847         * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
3848         CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
3850 2022-03-26  Jakub Jelinek  <jakub@redhat.com>
3852         * parser.cc (cp_parser_postfix_expression)
3853         <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
3854         return cp_build_{vec,convert,bit_cast} result right away, instead
3855         set postfix_expression to it and break.
3857 2022-03-25  Marek Polacek  <polacek@redhat.com>
3859         PR c++/104944
3860         * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
3861         (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
3862         complain == true.
3864 2022-03-24  Marek Polacek  <polacek@redhat.com>
3866         PR c++/104284
3867         * decl.cc (check_initializer): Don't call build_aggr_init in
3868         a template.
3870 2022-03-24  Jason Merrill  <jason@redhat.com>
3872         PR c++/96645
3873         * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
3874         * class.cc (type_has_default_ctor_to_be_synthesized): New.
3875         (type_has_non_user_provided_default_constructor_1): Support it.
3876         (type_has_non_user_provided_default_constructor): Now a wrapper.
3877         * method.cc (complain_about_unparsed_dmi): New.
3878         (constructible_expr): Call it.
3880 2022-03-24  Marek Polacek  <polacek@redhat.com>
3882         PR c++/102990
3883         * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
3885 2022-03-24  Patrick Palka  <ppalka@redhat.com>
3887         PR c++/104620
3888         * call.cc (build_over_call): Use cxx_constant_value_sfinae
3889         instead of cxx_constant_value to evaluate a consteval call.
3890         * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
3891         and pass it to cxx_eval_outermost_constant_expr.
3892         * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
3893         * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
3894         cxx_constant_value_sfinae.
3896 2022-03-24  Jakub Jelinek  <jakub@redhat.com>
3898         PR c++/104994
3899         * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
3900         through extern thread_local declarations.  Change wording from
3901         declaration to definition.
3902         (potential_constant_expression_1): Don't diagnose extern thread_local
3903         declarations.  Change wording from declared to defined.
3904         * decl.cc (start_decl): Likewise.
3906 2022-03-23  Jason Merrill  <jason@redhat.com>
3908         PR c++/103337
3909         * decl.cc (reshape_single_init): New.
3910         (reshape_init_class): Use it.
3912 2022-03-23  Jason Merrill  <jason@redhat.com>
3914         PR c++/105006
3915         * name-lookup.cc (lookup_using_decl): Check that scope is
3916         a dependent type before looking for dependent using.
3918 2022-03-23  Jason Merrill  <jason@redhat.com>
3920         PR c++/105006
3921         * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
3922         finds a dependent using.
3924 2022-03-21  Jason Merrill  <jason@redhat.com>
3926         PR c++/58646
3927         * init.cc (build_vec_init): Check for vla element type.
3929 2022-03-21  Jason Merrill  <jason@redhat.com>
3931         PR c++/103337
3932         PR c++/102740
3933         PR c++/103299
3934         PR c++/102538
3935         * decl.cc (reshape_init_class): Avoid looking for designator
3936         after we found it.
3937         (reshape_init_r): Keep looking for designator.
3939 2022-03-21  Jason Merrill  <jason@redhat.com>
3941         PR c++/101767
3942         * decl.cc (reshape_init_class): Back out of anon struct
3943         if a designator doesn't match.
3945 2022-03-18  Jason Merrill  <jason@redhat.com>
3947         PR c++/92918
3948         PR c++/104476
3949         * class.cc (add_method): Avoid adding the same used function twice.
3950         (handle_using_decl): Don't add_method.
3951         (finish_struct): Don't using op= if we have one already.
3952         (maybe_push_used_methods): New.
3953         * semantics.cc (finish_member_declaration): Call it.
3954         * name-lookup.cc (diagnose_name_conflict): No longer static.
3955         (push_class_level_binding): Revert 92918 patch, limit
3956         to dependent using.
3957         * cp-tree.h: Adjust.
3959 2022-03-18  Jakub Jelinek  <jakub@redhat.com>
3961         PR c++/104568
3962         * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
3963         argument and its handling, instead add ITYPE2 argument.  Only
3964         support COOKIE_SIZE != NULL.
3965         (build_new_1): If size is 0, change it to 0 * outer_nelts if
3966         outer_nelts is non-NULL.  Pass type rather than elt_type to
3967         maybe_wrap_new_for_constexpr.
3968         * constexpr.cc (build_new_constexpr_heap_type): New function.
3969         (cxx_eval_constant_expression) <case CONVERT_EXPR>:
3970         If elt_size is zero sized type, try to recover outer_nelts from
3971         the size argument to operator new/new[] and pass that as
3972         arg_size to build_new_constexpr_heap_type.  Pass ctx,
3973         non_constant_p and overflow_p to that call too.
3975 2022-03-18  Marek Polacek  <polacek@redhat.com>
3977         PR c++/104008
3978         * tree.cc (strip_typedefs): Don't strip an alias template when
3979         doing so would result in losing a parameter pack.
3981 2022-03-16  Patrick Palka  <ppalka@redhat.com>
3983         * search.cc (lookup_member): Simplify by handling all values
3984         of protect together in the ambiguous case.  Don't modify protect.
3986 2022-03-16  Patrick Palka  <ppalka@redhat.com>
3988         PR c++/96780
3989         * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
3990         std::move/forward and other cast-like functions into simple
3991         casts.
3993 2022-03-15  Patrick Palka  <ppalka@redhat.com>
3995         PR c++/103177
3996         * search.cc (lookup_field_info::errstr): Remove this data
3997         member.
3998         (lookup_field_r): Don't set errstr.
3999         (lookup_member): Check ambiguity before checking access.
4000         Simplify accordingly after errstr removal.  Exit early upon
4001         error or empty result.
4003 2022-03-15  Jakub Jelinek  <jakub@redhat.com>
4005         PR c++/104623
4006         * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
4008 2022-03-14  Jakub Jelinek  <jakub@redhat.com>
4010         PR tree-optimization/102586
4011         * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
4012         first argument's type is pointer to non-trivially-copyable type unless
4013         it is address of a variable or parameter.
4015 2022-03-12  Patrick Palka  <ppalka@redhat.com>
4017         PR c++/104641
4018         * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
4019         * decl.cc (make_typename_type): Allow a typename-specifier to
4020         resolve to a template when tf_tst_ok, in which case return
4021         a CTAD placeholder for the template.
4022         * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
4023         substituting the type.
4024         (tsubst): Clear tf_tst_ok and remember if it was set.
4025         <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
4026         appropriately.
4027         (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
4028         the type.
4029         (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
4030         <case CONSTRUCTOR>: Likewise.
4032 2022-03-12  Patrick Palka  <ppalka@redhat.com>
4034         PR c++/104622
4035         * call.cc (missing_conversion_p): Define.
4036         (add_candidates): Use it.
4037         * pt.cc (check_non_deducible_conversion): Change type of strict
4038         parameter to unification_kind_t and directly test for DEDUCE_CALL.
4040 2022-03-12  Patrick Palka  <ppalka@redhat.com>
4042         PR c++/104527
4043         * constraint.cc (normalize_atom): Set
4044         ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
4045         (get_mapped_args):  Make static, adjust parameters.  Always
4046         return a vector whose depth corresponds to the template depth of
4047         the context of the atomic constraint expression.  Micro-optimize
4048         by passing false as exact to safe_grow_cleared and by collapsing
4049         a multi-level depth-one argument vector.
4050         (satisfy_atom): Adjust call to get_mapped_args and
4051         diagnose_atomic_constraint.
4052         (diagnose_atomic_constraint): Replace map parameter with an args
4053         parameter.
4054         * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
4055         (get_mapped_args): Remove declaration.
4057 2022-03-12  Patrick Palka  <ppalka@redhat.com>
4058             Jason Merrill  <jason@redhat.com>
4060         PR c++/98644
4061         * constexpr.cc (mark_non_constant): Define, split out from ...
4062         (cxx_eval_outermost_constant_expr): ... here.
4063         (maybe_constant_value): Use it.
4065 2022-03-12  Patrick Palka  <ppalka@redhat.com>
4067         * semantics.cc (finish_unary_fold_expr): Use input_location
4068         instead of UNKNOWN_LOCATION.
4069         (finish_binary_fold_expr): Likewise.
4071 2022-03-12  Thomas Schwinge  <thomas@codesourcery.com>
4073         PR other/65095
4074         * semantics.cc (handle_omp_array_sections_1)
4075         (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
4076         instead of 'c_omp_map_clause_name'.
4078 2022-03-10  Marek Polacek  <polacek@redhat.com>
4080         PR c++/104608
4081         * parser.cc (cp_parser_template_name): Repeat lookup of
4082         TYPE_DECLs.
4084 2022-03-10  Marek Polacek  <polacek@redhat.com>
4086         PR c++/104752
4087         * semantics.cc (finish_compound_literal): Disallow auto{x} for
4088         is_constrained_auto.
4089         * typeck2.cc (build_functional_cast_1): Likewise.
4091 2022-03-10  Marek Polacek  <polacek@redhat.com>
4093         PR c++/104846
4094         * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
4095         data member errors.
4097 2022-03-10  Jakub Jelinek  <jakub@redhat.com>
4099         PR c++/103460
4100         * decl.cc (grok_op_properties): Allow variadic operator[] for
4101         C++23.
4103 2022-03-10  Roger Sayle  <roger@nextmovesoftware.com>
4105         PR c++/95999
4106         * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
4107         consider it to be zero (i.e. treat it like error_mark_node).
4108         (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
4109         set VALUE to error_mark_node.
4111 2022-03-10  Roger Sayle  <roger@nextmovesoftware.com>
4113         PR c++/39751
4114         * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
4115         stream hasn't been purged before processing DECL_PENDING_INLINE.
4117 2022-03-09  Patrick Palka  <ppalka@redhat.com>
4119         PR c++/104823
4120         * except.cc (build_noexcept_spec): Strengthen dependence check
4121         to instantiation_dependent_expression_p.
4122         * parser.cc (cp_parser_parenthesized_expression_list_elt):
4123         Remove fold_expr_p parameter, and don't call
4124         instantiate_non_dependent_expr.
4125         (cp_parser_parenthesized_expression_list): Adjust accordingly.
4126         * pt.cc (expand_integer_pack): Strengthen dependence check
4127         to instantiation_dependent_expression_p.
4128         (instantiate_non_dependent_expr_internal): Adjust comment.
4129         (instantiate_non_dependent_expr_sfinae): Likewise.  Drop
4130         the potentially-constant check, and relax and turn the
4131         dependence check into a checking assert.
4132         (instantiate_non_dependent_or_null): Adjust comment.
4133         * semantics.cc (finish_decltype_type): Keep
4134         processing_template_decl cleared after calling
4135         instantiate_non_dependent_expr_sfinae.
4137 2022-03-09  Patrick Palka  <ppalka@redhat.com>
4139         PR c++/102137
4140         PR c++/87820
4141         * cp-tree.h (is_copy_initialization): Declare.
4142         * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
4143         when is_copy_initialization is true.
4144         * init.cc (build_aggr_init): Split out copy-initialization
4145         check into ...
4146         (is_copy_initialization): ... here.
4147         * pt.cc (instantiate_decl): Pass 0 instead of
4148         LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
4150 2022-03-09  Patrick Palka  <ppalka@redhat.com>
4152         PR c++/65396
4153         * cp-tree.h (merge_default_template_args): Declare.
4154         * decl.cc (merge_default_template_args): Define, factored out
4155         from redeclare_class_template.
4156         (duplicate_decls): Use it when merging member function template
4157         and free function declarations.
4158         * pt.cc (redeclare_class_template): Factor out default argument
4159         merging logic into merge_default_template_args.  Improve location
4160         of a note when there's a template parameter kind mismatch.
4162 2022-03-09  Jakub Jelinek  <jakub@redhat.com>
4164         PR c/104711
4165         * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
4166         instead of TYPE_UNSIGNED.
4167         * typeck.cc (cp_build_binary_op): Don't emit
4168         -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
4170 2022-03-08  Roger Sayle  <roger@nextmovesoftware.com>
4172         PR c++/96440
4173         * decl.cc (start_decl): Defend against prefix_attributes being
4174         error_mark_node.
4176 2022-03-08  Roger Sayle  <roger@nextmovesoftware.com>
4178         PR c++/96437
4179         * parser.cc (synthesize_implicit_template_parm): Check that
4180         TREE_VALUE (new_parm) isn't error_mark_node before setting its
4181         DECL_VIRTUAL_P.
4183 2022-03-08  Roger Sayle  <roger@nextmovesoftware.com>
4185         PR c++/96329
4186         * parser.cc (cp_parser_linkage_specification): Treat the case where
4187         linkage is error_mark_node as "invalid linkage-specification".
4189 2022-03-08  Marek Polacek  <polacek@redhat.com>
4191         PR c++/104108
4192         * pt.cc (convert_nontype_argument): Recompute
4193         value_dependent_expression_p after build_converted_constant_expr.
4195 2022-03-08  Marek Polacek  <polacek@redhat.com>
4197         * decl2.cc (is_late_template_attribute): Do not defer attribute
4198         unavailable.
4199         * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
4201 2022-03-08  Jakub Jelinek  <jakub@redhat.com>
4203         PR c++/104806
4204         * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
4205         identifiers with space at the end.
4207 2022-03-07  Jason Merrill  <jason@redhat.com>
4209         PR c++/104618
4210         * decl2.cc (mark_single_function): Look through parens and location
4211         wrapper.
4212         * typeck.cc (cp_build_addr_expr_1): Not here.
4214 2022-03-07  Jakub Jelinek  <jakub@redhat.com>
4216         * parser.cc (cp_parser_omp_clause_map): Add missing space in string
4217         literal.
4219 2022-03-07  Jakub Jelinek  <jakub@redhat.com>
4221         * cvt.cc: Fix up duplicated word issue in a comment.
4222         * pt.cc: Likewise.
4223         * module.cc: Likewise.
4224         * coroutines.cc: Likewise.
4226 2022-03-04  Nathan Sidwell  <nathan@acm.org>
4228         * mangle.cc (is_std_substitution): Check global module.
4229         (is_std_substitution_char): Return bool.
4231 2022-03-04  Nathan Sidwell  <nathan@acm.org>
4233         * cp-tree.h (mangle_identifier): Replace with ...
4234         (mangle_module_component): ... this.
4235         * mangle.cc (dump_substitution_candidates): Adjust.
4236         (add_substitution): Likewise.
4237         (find_substitution): Likewise.
4238         (unmangled_name_p): Likewise.
4239         (mangle_module_substitution): Reimplement.
4240         (mangle_module_component): New.
4241         (write_module, maybe_write_module): Adjust.
4242         (write_name): Drop modules here.
4243         (write_unqualified): Do them here instead.
4244         (mangle_global_init): Adjust.
4245         * module.cc (module_state::mangle): Adjust.
4246         (mangle_module): Likewise.
4247         (get_originating_module): Adjust.
4249 2022-02-28  Marek Polacek  <polacek@redhat.com>
4251         PR c++/104682
4252         * cp-tree.h (build_enumerator): Adjust.
4253         * decl.cc (finish_enum): Make it return the new decl.
4254         * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
4256 2022-02-28  Marek Polacek  <polacek@redhat.com>
4258         PR c++/104667
4259         * decl2.cc (is_late_template_attribute): Cope with a decl without
4260         a type.
4262 2022-02-27  Jason Merrill  <jason@redhat.com>
4264         PR c++/104618
4265         * typeck.cc (cp_build_addr_expr_1): Also
4266         maybe_undo_parenthesized_ref.
4268 2022-02-24  Martin Liska  <mliska@suse.cz>
4270         * pt.cc (defarg_insts_for): Use braces for subobject.
4272 2022-02-18  Patrick Palka  <ppalka@redhat.com>
4274         PR c++/94944
4275         * pt.cc (maybe_instantiate_noexcept): For non-static member
4276         functions, set current_class_ptr/ref to the specialized 'this'
4277         instead.
4279 2022-02-17  Jason Merrill  <jason@redhat.com>
4281         PR c++/104539
4282         * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
4284 2022-02-17  Jason Merrill  <jason@redhat.com>
4286         PR c++/90451
4287         * decl2.cc (mark_single_function): New.
4288         * cp-tree.h: Declare it.
4289         * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
4290         * semantics.cc (finish_qualified_id_expr): Not here.
4291         (finish_id_expression_1): Or here.
4292         (finish_decltype_type): Call mark_single_function.
4293         * cvt.cc (convert_to_void): And here.
4294         * pt.cc (convert_nontype_argument): And here.
4295         * init.cc (build_offset_ref): Adjust assert.
4297 2022-02-17  Patrick Palka  <ppalka@redhat.com>
4299         PR c++/104565
4300         * semantics.cc (finish_compound_literal): Don't perform
4301         non-dependent expr folding before calling check_narrowing.
4303 2022-02-16  Patrick Palka  <ppalka@redhat.com>
4305         PR c++/104507
4306         * constexpr.cc (potential_constant_expression_1)
4307         <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
4308         Assert tf_error isn't set.
4310 2022-02-15  Jason Merrill  <jason@redhat.com>
4312         PR c++/104107
4313         PR c++/95036
4314         * pt.cc (coerce_template_template_parms): Take full parms.
4315         Avoid adding too much of outer_args.
4316         (coerce_template_template_parm): Adjust.
4317         (template_template_parm_bindings_ok_p): Adjust.
4318         (convert_template_argument): Adjust.
4320 2022-02-14  Jakub Jelinek  <jakub@redhat.com>
4322         PR c++/104513
4323         * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
4324         Don't punt if returns (target).
4326 2022-02-11  Jakub Jelinek  <jakub@redhat.com>
4328         PR c++/104472
4329         * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
4330         Only return fold_const_call result if it is non-NULL.  Otherwise
4331         fall through into the default: case to return t, set *non_constant_p
4332         and emit diagnostics if needed.
4334 2022-02-10  Jason Merrill  <jason@redhat.com>
4336         * module.cc (depset::hash::add_specializations): Use
4337         STRIP_TEMPLATE.
4339 2022-02-10  Tobias Burnus  <tobias@codesourcery.com>
4341         PR c++/102204
4342         * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
4343         members as those are permitted since OpenMP 5.0.
4345 2022-02-10  Patrick Palka  <ppalka@redhat.com>
4347         * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
4348         better.
4350 2022-02-10  Marcel Vollweiler  <marcel@codesourcery.com>
4352         * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
4353         (cp_parser_omp_var_list_no_open): Handle array sections.
4354         (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
4355         case.
4356         (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
4357         * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
4358         (finish_omp_clauses): Handle array sections.
4360 2022-02-09  Patrick Palka  <ppalka@redhat.com>
4362         PR c++/104432
4363         * call.cc (build_new_method_call): When a non-dependent call
4364         resolves to a specialization of a member template, always build
4365         the pruned overload set using the member template, not the
4366         specialization.
4367         * pt.cc (filter_memfn_lookup): New parameter newtype.  Simplify
4368         and correct how members from the new lookup set are matched to
4369         those from the old one.
4370         (tsubst_baselink): Pass binfo_type as newtype to
4371         filter_memfn_lookup.
4373 2022-02-09  Jason Merrill  <jason@redhat.com>
4375         PR c++/103752
4376         * module.cc (trees_out::core_vals): Stream explicit specifier.
4377         (trees_in::core_vals): Likewise.
4378         * pt.cc (store_explicit_specifier): No longer static.
4379         (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
4380         * cp-tree.h (lookup_explicit_specifier): Declare.
4382 2022-02-09  Jason Merrill  <jason@redhat.com>
4384         PR c++/96876
4385         * typeck2.cc (split_nonconstant_init_1): Push cleanups for
4386         preceding members with constant initialization.
4387         (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
4389 2022-02-08  Jakub Jelinek  <jakub@redhat.com>
4391         PR c++/104379
4392         * name-lookup.cc (check_local_shadow): When diagnosing shadowing
4393         of a member or global declaration, add warning suppression for
4394         the decl and don't warn again on it.
4396 2022-02-08  Jakub Jelinek  <jakub@redhat.com>
4398         PR c++/104403
4399         * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
4400         of TREE_STATIC vars may only appear in -std=c++23.
4402 2022-02-08  Patrick Palka  <ppalka@redhat.com>
4404         PR c++/80951
4405         * pt.cc (uses_deducible_template_parms): Consider the
4406         noexcept-spec of a function type.
4408 2022-02-08  Patrick Palka  <ppalka@redhat.com>
4410         PR c++/104410
4411         * constraint.cc (satisfaction_value): Relax assert to accept
4412         cv-qualified bool.
4414 2022-02-08  Patrick Palka  <ppalka@redhat.com>
4416         PR c++/103706
4417         * pt.cc (preserve_args): New function.
4418         (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
4420 2022-02-08  Patrick Palka  <ppalka@redhat.com>
4422         PR c++/103706
4423         * constraint.cc (satisfy_declaration_constraints): Use
4424         lambda_regenerating_args instead.
4425         * cp-tree.h (lambda_regenerating_args): Declare.
4426         * pt.cc (lambda_regenerating_args): Define, split out from
4427         satisfy_declaration_constraints.
4428         (do_auto_deduction): Use lambda_regenerating_args to obtain the
4429         full set of outer template arguments for satisfaction when
4430         inside a lambda.
4432 2022-02-06  Patrick Palka  <ppalka@redhat.com>
4434         PR c++/96242
4435         * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
4436         fn by calling maybe_synthesize_method instead of relying on
4437         maybe_instantiate_noexcept.  Move call to m_i_n after the
4438         DECL_DELETED_FN handling.
4439         * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
4440         fn synthesis to only those with an implicit noexcept-spec, and
4441         return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
4443 2022-02-06  Jakub Jelinek  <jakub@redhat.com>
4445         PR c++/89074
4446         PR c++/104033
4447         * constexpr.cc (cxx_eval_binary_expression): Temporarily set
4448         folding_cxx_constexpr.
4450 2022-02-05  Jason Merrill  <jason@redhat.com>
4452         PR c++/104300
4453         PR c++/92385
4454         * cp-tree.h (get_vec_init_expr): New.
4455         (target_expr_needs_replace): New.
4456         * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
4457         (struct cp_fold_data): New.
4458         (cp_fold_r): Only genericize inits at end of fn.
4459         (cp_fold_function): Here.
4460         (cp_fully_fold_init): Not here.
4461         * init.cc (build_vec_init): Use get_vec_init_expr.
4462         * tree.cc (build_vec_init_expr): Likewise.
4463         * typeck2.cc (split_nonconstant_init_1): Likewise.
4464         (process_init_constructor): Wrap VEC_INIT_EXPR in
4465         TARGET_EXPR.
4467 2022-02-05  Jason Merrill  <jason@redhat.com>
4469         * pt.cc (iterative_hash_template_arg): Add comment.
4471 2022-02-03  Patrick Palka  <ppalka@redhat.com>
4473         PR c++/104079
4474         * pt.cc (value_dependent_noexcept_spec_p): New predicate split
4475         out from ...
4476         (dependent_type_p_r): ... here.
4477         (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
4478         to consider dependence of a noexcept-spec before C++17.
4479         * tree.cc (fixup_deferred_exception_variants): Clear
4480         TYPE_DEPENDENT_P_VALID.
4482 2022-02-03  Jason Merrill  <jason@redhat.com>
4484         PR c++/104302
4485         * decl.cc (maybe_deduce_size_from_array_init): Give up
4486         on type-dependent init.
4487         (cp_complete_array_type): Only call reshape_init for character
4488         array.
4490 2022-02-01  Jason Merrill  <jason@redhat.com>
4492         PR c++/103186
4493         * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
4494         (defarg_insts_for): New.
4495         (tsubst_default_argument): Adjust.
4497 2022-01-31  Marek Polacek  <polacek@redhat.com>
4499         PR c++/102414
4500         PR c++/101874
4501         * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
4502         Sorry on a variable-length array of auto.
4504 2022-01-31  Marek Polacek  <polacek@redhat.com>
4506         PR c++/102434
4507         * class.cc (finish_struct): Don't allow union initializer_list.
4509 2022-01-31  Patrick Palka  <ppalka@redhat.com>
4511         PR c++/104294
4512         * pt.cc (ctor_deduction_guides_for): Correct computation of
4513         outer_args.
4515 2022-01-31  Patrick Palka  <ppalka@redhat.com>
4517         PR c++/104291
4518         * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
4519         walk_subtrees if !include_nondeduced_p.  Simplify given that
4520         cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
4522 2022-01-28  Patrick Palka  <ppalka@redhat.com>
4523             Jason Merrill  <jason@redhat.com>
4525         PR c++/92752
4526         * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
4527         unqualified pointer type not the qualified one.
4529 2022-01-28  Patrick Palka  <ppalka@redhat.com>
4531         PR c++/103341
4532         * decl.cc (cp_finish_decl): Pass the template arguments of a
4533         variable template specialization or a templated static data
4534         member to do_auto_deduction when the auto is constrained.
4536 2022-01-28  Jason Merrill  <jason@redhat.com>
4538         PR c++/100198
4539         PR c++/100030
4540         PR c++/100282
4541         * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
4542         pack in lambda.
4543         (cp_parser_class_head): And in class attributes.
4544         * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
4545         in lambda.
4547 2022-01-27  Jason Merrill  <jason@redhat.com>
4549         PR c++/104245
4550         PR c++/51344
4551         * decl2.cc (save_template_attributes): Take late attrs as parm.
4552         (cplus_decl_attributes): Call it after decl_attributes,
4553         splice_template_attributes before.
4555 2022-01-27  Patrick Palka  <ppalka@redhat.com>
4557         PR c++/99895
4558         * call.cc (build_over_call): For a non-dependent member call,
4559         build up a CALL_EXPR using a COMPONENT_REF callee, as in
4560         build_new_method_call.
4561         * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
4562         * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
4563         after the build_over_call change.
4565 2022-01-27  Patrick Palka  <ppalka@redhat.com>
4567         PR c++/92944
4568         PR c++/103678
4569         * parser.cc (cp_parser_class_head): Update 'type' with the result
4570         of maybe_process_partial_specialization in the
4571         nested_name_specifier branch.  Refactor nearby code to accomodate
4572         that maybe_process_partial_specialization returns a _TYPE, not a
4573         TYPE_DECL, and eliminate local variable 'class_type' in passing.
4575 2022-01-27  Marek Polacek  <polacek@redhat.com>
4577         PR c++/101988
4578         * decl.cc (create_array_type_for_decl): Reject forming an array of
4579         placeholder for a deduced class type.
4581 2022-01-26  Jason Merrill  <jason@redhat.com>
4583         PR c++/104206
4584         PR c++/101072
4585         * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
4587 2022-01-26  Jakub Jelinek  <jakub@redhat.com>
4589         PR c++/104226
4590         * constexpr.cc (init_subob_ctx): For vector ctors containing
4591         vector elements, ensure appending to the same ctor instead of
4592         creating another one.
4594 2022-01-26  Marek Polacek  <polacek@redhat.com>
4596         PR target/104213
4597         * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
4598         (finish_destructor_body): Likewise.
4599         * optimize.cc (build_delete_destructor_body): Likewise.
4601 2022-01-26  Jason Merrill  <jason@redhat.com>
4603         PR c++/104235
4604         * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
4606 2022-01-26  Jason Merrill  <jason@redhat.com>
4608         PR c++/103057
4609         * pt.cc (tsubst_aggr_type): Call tsubst for alias template
4610         specialization.
4612 2022-01-25  Patrick Palka  <ppalka@redhat.com>
4614         PR c++/101532
4615         PR c++/104225
4616         * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
4617         on a deleted function.
4619 2022-01-25  Jason Merrill  <jason@redhat.com>
4621         PR c++/59950
4622         * call.cc (build_over_call): Use cp_build_indirect_ref.
4624 2022-01-24  Patrick Palka  <ppalka@redhat.com>
4626         PR c++/104197
4627         * pt.cc (make_auto_1): Use -1 as a placeholder default argument
4628         for level.
4630 2022-01-24  Patrick Palka  <ppalka@redhat.com>
4632         PR c++/104173
4633         * typeck.cc (build_class_member_access_expr): Extend
4634         unary_complex_lvalue result adjustment to preserve all
4635         rvalues, not just xvalues.
4637 2022-01-23  Will Wray  <wjwray@gmail.com>
4639         PR c++/55227
4640         * decl.cc (reshape_init_r): Only call has_designator_check when
4641         first_initializer_p or for the inner constructor element.
4642         (cp_complete_array_type): Call reshape_init on braced-init-list.
4644 2022-01-23  Jason Merrill  <jason@redhat.com>
4646         PR c++/104182
4647         * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
4648         has set DECL_INITIAL on a TARGET_EXPR slot.
4649         * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
4651 2022-01-23  Jason Merrill  <jason@redhat.com>
4653         PR c++/101072
4654         * cp-tree.h (build_implicit_conv_flags): Declare.
4655         * call.cc (build_implicit_conv_flags): Split out from...
4656         (perform_implicit_conversion_flags): ...here.
4657         * decl.cc (check_initializer): Use it.
4658         * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
4659         * semantics.cc (finish_compound_literal): Don't treat
4660         scalar values like CONSTRUCTORs.
4662 2022-01-21  Jason Merrill  <jason@redhat.com>
4664         * semantics.cc (find_failing_clause): Return expr if not
4665         decomposable.
4666         (finish_static_assert): Show constant values in failing
4667         comparison.
4669 2022-01-21  Jason Merrill  <jason@redhat.com>
4671         PR c++/104084
4672         PR c++/20040
4673         * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
4674         alloc_expr is a TARGET_EXPR.
4676 2022-01-21  Marek Polacek  <polacek@redhat.com>
4678         PR c++/101715
4679         * tree.cc (fixup_deferred_exception_variants): Remove duplicate
4680         variants after parsing the exception specifications.
4682 2022-01-21  Jason Merrill  <jason@redhat.com>
4684         PR c++/104139
4685         PR c++/103681
4686         * class.cc (end_of_class): Use base_binfo.
4688 2022-01-20  Jason Merrill  <jason@redhat.com>
4690         PR c++/101405
4691         * decl.cc (reshape_init_class): Reject designator for a member of
4692         another class.
4694 2022-01-20  Patrick Palka  <ppalka@redhat.com>
4696         PR c++/91911
4697         PR c++/103672
4698         * pt.cc (keep_template_parm): Punt on a level 0 template parm.
4699         (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
4700         (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
4701         specially.
4702         (make_auto_1): Add defaulted 'level' parameter.
4703         (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
4705 2022-01-20  Patrick Palka  <ppalka@redhat.com>
4707         * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
4708         function return type even when !funcdecl_p.
4710 2022-01-20  Martin Liska  <mliska@suse.cz>
4712         PR c++/104134
4713         * error.cc (dump_aggr_type): Partially disable the warning.
4715 2022-01-20  Jason Merrill  <jason@redhat.com>
4717         PR c++/102300
4718         * parser.cc (cp_parser_template_name): Use dependent_scope_p.
4720 2022-01-19  David Malcolm  <dmalcolm@redhat.com>
4722         * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
4723         renaming.
4724         * cp-tree.h (cp_pt_c_tests): Rename to...
4725         (cp_pt_cc_tests): ...this.
4726         (cp_tree_c_tests): Rename to...
4727         (cp_tree_cc_tests): ...this.
4728         * pt.cc (cp_pt_c_tests): Rename to...
4729         (cp_pt_cc_tests): ...this.
4730         * tree.cc (cp_tree_c_tests): Rename to...
4731         (cp_tree_cc_tests): ...this.
4733 2022-01-19  Jason Merrill  <jason@redhat.com>
4735         * parser.cc (saved_token_sentinel::rollback): Use
4736         cp_lexer_previous_token.
4738 2022-01-18  Jakub Jelinek  <jakub@redhat.com>
4740         PR c++/104055
4741         * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
4742         TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
4743         than get_target_expr_sfinae with tf_no_cleanup, and don't set
4744         TREE_CONSTANT.
4746 2022-01-18  Jason Merrill  <jason@redhat.com>
4747             Jakub Jelinek   <jakub@redhat.com>
4749         PR c++/104025
4750         * parser.cc (saved_token_sentinel::rollback): Call
4751         cp_lexer_set_source_position.
4752         (~saved_token_sentinel): Call rollback.
4754 2022-01-18  Patrick Palka  <ppalka@redhat.com>
4756         PR c++/104074
4757         * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
4758         that we return false for DEPENDENT_OPERATOR_TYPE too.
4760 2022-01-17  Martin Liska  <mliska@suse.cz>
4762         * Make-lang.in: Rename .c names to .cc.
4763         * config-lang.in: Likewise.
4764         * constexpr.cc (cxx_eval_constant_expression): Likewise.
4765         * coroutines.cc (morph_fn_to_coro): Likewise.
4766         * cp-gimplify.cc (cp_gimplify_expr): Likewise.
4767         * cp-lang.cc (struct lang_hooks): Likewise.
4768         (get_template_argument_pack_elems_folded): Likewise.
4769         * cp-objcp-common.cc (cp_tree_size): Likewise.
4770         (cp_unit_size_without_reusable_padding): Likewise.
4771         (pop_file_scope): Likewise.
4772         (cp_pushdecl): Likewise.
4773         * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
4774         (cxx_simulate_record_decl): Likewise.
4775         * cp-tree.h (struct named_label_entry): Likewise.
4776         (current_function_return_value): Likewise.
4777         (more_aggr_init_expr_args_p): Likewise.
4778         (get_function_version_dispatcher): Likewise.
4779         (common_enclosing_class): Likewise.
4780         (strip_fnptr_conv): Likewise.
4781         (current_decl_namespace): Likewise.
4782         (do_aggregate_paren_init): Likewise.
4783         (cp_check_const_attributes): Likewise.
4784         (qualified_name_lookup_error): Likewise.
4785         (generic_targs_for): Likewise.
4786         (mark_exp_read): Likewise.
4787         (is_global_friend): Likewise.
4788         (maybe_reject_flexarray_init): Likewise.
4789         (module_token_lang): Likewise.
4790         (handle_module_option): Likewise.
4791         (literal_integer_zerop): Likewise.
4792         (build_extra_args): Likewise.
4793         (build_if_nonnull): Likewise.
4794         (maybe_check_overriding_exception_spec): Likewise.
4795         (finish_omp_target_clauses): Likewise.
4796         (maybe_warn_zero_as_null_pointer_constant): Likewise.
4797         (cxx_print_error_function): Likewise.
4798         (decl_in_std_namespace_p): Likewise.
4799         (merge_exception_specifiers): Likewise.
4800         (mangle_module_global_init): Likewise.
4801         (cxx_block_may_fallthru): Likewise.
4802         (fold_builtin_source_location): Likewise.
4803         (enum cp_oracle_request): Likewise.
4804         (subsumes): Likewise.
4805         (cp_finish_injected_record_type): Likewise.
4806         (vtv_build_vtable_verify_fndecl): Likewise.
4807         (cp_tree_c_finish_parsing): Likewise.
4808         * cvt.cc (diagnose_ref_binding): Likewise.
4809         (convert_to_void): Likewise.
4810         (convert_force): Likewise.
4811         (type_promotes_to): Likewise.
4812         * decl.cc (make_unbound_class_template_raw): Likewise.
4813         (cxx_init_decl_processing): Likewise.
4814         (check_class_member_definition_namespace): Likewise.
4815         (cxx_maybe_build_cleanup): Likewise.
4816         * decl2.cc (maybe_emit_vtables): Likewise.
4817         * error.cc (dump_function_name): Likewise.
4818         * init.cc (is_class_type): Likewise.
4819         (build_new_1): Likewise.
4820         * lang-specs.h: Likewise.
4821         * method.cc (make_alias_for_thunk): Likewise.
4822         * module.cc (specialization_add): Likewise.
4823         (module_state::read_cluster): Likewise.
4824         * name-lookup.cc (check_extern_c_conflict): Likewise.
4825         * name-lookup.h (struct cxx_binding): Likewise.
4826         * parser.cc (cp_parser_identifier): Likewise.
4827         * parser.h (struct cp_parser): Likewise.
4828         * pt.cc (has_value_dependent_address): Likewise.
4829         (push_tinst_level_loc): Likewise.
4830         * semantics.cc (finish_omp_clauses): Likewise.
4831         (finish_omp_atomic): Likewise.
4832         * tree.cc (cp_save_expr): Likewise.
4833         (cp_free_lang_data): Likewise.
4834         * typeck.cc (cp_common_type): Likewise.
4835         (strip_array_domain): Likewise.
4836         (rationalize_conditional_expr): Likewise.
4837         (check_return_expr): Likewise.
4838         * vtable-class-hierarchy.cc: Likewise.
4840 2022-01-17  Martin Liska  <mliska@suse.cz>
4842         * call.c: Moved to...
4843         * call.cc: ...here.
4844         * class.c: Moved to...
4845         * class.cc: ...here.
4846         * constexpr.c: Moved to...
4847         * constexpr.cc: ...here.
4848         * cp-gimplify.c: Moved to...
4849         * cp-gimplify.cc: ...here.
4850         * cp-lang.c: Moved to...
4851         * cp-lang.cc: ...here.
4852         * cp-objcp-common.c: Moved to...
4853         * cp-objcp-common.cc: ...here.
4854         * cp-ubsan.c: Moved to...
4855         * cp-ubsan.cc: ...here.
4856         * cvt.c: Moved to...
4857         * cvt.cc: ...here.
4858         * cxx-pretty-print.c: Moved to...
4859         * cxx-pretty-print.cc: ...here.
4860         * decl.c: Moved to...
4861         * decl.cc: ...here.
4862         * decl2.c: Moved to...
4863         * decl2.cc: ...here.
4864         * dump.c: Moved to...
4865         * dump.cc: ...here.
4866         * error.c: Moved to...
4867         * error.cc: ...here.
4868         * except.c: Moved to...
4869         * except.cc: ...here.
4870         * expr.c: Moved to...
4871         * expr.cc: ...here.
4872         * friend.c: Moved to...
4873         * friend.cc: ...here.
4874         * g++spec.c: Moved to...
4875         * g++spec.cc: ...here.
4876         * init.c: Moved to...
4877         * init.cc: ...here.
4878         * lambda.c: Moved to...
4879         * lambda.cc: ...here.
4880         * lex.c: Moved to...
4881         * lex.cc: ...here.
4882         * mangle.c: Moved to...
4883         * mangle.cc: ...here.
4884         * method.c: Moved to...
4885         * method.cc: ...here.
4886         * name-lookup.c: Moved to...
4887         * name-lookup.cc: ...here.
4888         * optimize.c: Moved to...
4889         * optimize.cc: ...here.
4890         * parser.c: Moved to...
4891         * parser.cc: ...here.
4892         * pt.c: Moved to...
4893         * pt.cc: ...here.
4894         * ptree.c: Moved to...
4895         * ptree.cc: ...here.
4896         * rtti.c: Moved to...
4897         * rtti.cc: ...here.
4898         * search.c: Moved to...
4899         * search.cc: ...here.
4900         * semantics.c: Moved to...
4901         * semantics.cc: ...here.
4902         * tree.c: Moved to...
4903         * tree.cc: ...here.
4904         * typeck.c: Moved to...
4905         * typeck.cc: ...here.
4906         * typeck2.c: Moved to...
4907         * typeck2.cc: ...here.
4908         * vtable-class-hierarchy.c: Moved to...
4909         * vtable-class-hierarchy.cc: ...here.
4911 2022-01-17  Jakub Jelinek  <jakub@redhat.com>
4913         PR c++/104031
4914         * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
4915         TARGET_EXPR_SLOT to current_function_decl if it was NULL.
4917 2022-01-17  Andrew Stubbs  <ams@codesourcery.com>
4919         * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
4921 2022-01-14  Chung-Lin Tang  <cltang@codesourcery.com>
4923         PR c++/103705
4924         * semantics.c (finish_omp_clauses): Also continue peeling off of
4925         outer node for ARRAY_REFs.
4927 2022-01-14  Jakub Jelinek  <jakub@redhat.com>
4929         PR c++/103991
4930         * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
4931         IF_STMT_CONSTEXPR_P with constant false or true condition only
4932         check if the taken clause may fall through.
4933         * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
4934         to r12-5638^ behavior if then_ block can't fall through.  For
4935         constexpr if, revert to r12-5638^ behavior.
4937 2022-01-13  Anthony Sharp  <anthonysharp15@gmail.com>
4938             Jason Merrill  <jason@redhat.com>
4940         PR c++/70417
4941         * parser.c (cp_parser_id_expression): Handle
4942         -Wmissing-template-keyword.
4943         (struct saved_token_sentinel): Add modes to control what happens
4944         on destruction.
4945         (cp_parser_statement): Adjust.
4946         (cp_parser_skip_entire_template_parameter_list): New function that
4947         skips an entire template parameter list.
4948         (cp_parser_require_end_of_template_parameter_list): Rename old
4949         cp_parser_skip_to_end_of_template_parameter_list.
4950         (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
4951         called from one of the above two functions.
4952         (cp_parser_lambda_declarator_opt)
4953         (cp_parser_explicit_template_declaration)
4954         (cp_parser_enclosed_template_argument_list): Adjust.
4956 2022-01-12  Jakub Jelinek  <jakub@redhat.com>
4957             Jason Merrill  <jason@redhat.com>
4959         PR c++/103480
4960         * tree.c (move): If expr is xvalue_p, just return expr without
4961         build_static_cast.
4963 2022-01-11  Jakub Jelinek  <jakub@redhat.com>
4965         PR c++/101597
4966         * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
4967         OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
4968         * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
4969         OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
4970         obj_type.
4972 2022-01-11  Patrick Palka  <ppalka@redhat.com>
4974         PR c++/103831
4975         * call.c (build_new_method_call): Consider dependent bases only
4976         if 'this' is available.
4978 2022-01-11  Olivier Hainque  <hainque@adacore.com>
4980         * decl.c (cxx_init_decl_processing): Move code possibly
4981         altering flag_weak before code testing it.
4983 2022-01-10  Patrick Palka  <ppalka@redhat.com>
4985         PR c++/103879
4986         * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
4987         canonicalization step into a local lambda.  Strengthen it to
4988         absorb more components at position 0.  Use it before both calls
4989         to cxx_fold_indirect_ref_1.
4991 2022-01-10  Patrick Palka  <ppalka@redhat.com>
4993         PR c++/103783
4994         * call.c (cand_parms_match): Skip over 'this' when given one
4995         static and one non-static member function.
4997 2022-01-10  Jakub Jelinek  <jakub@redhat.com>
4999         PR c++/103912
5000         * semantics.c (expand_or_defer_fn): For immediate functions, set
5001         node->body_removed to true and clear analyzed, definition and
5002         force_output.
5003         * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
5004         expand_or_defer_fn.
5006 2022-01-08  Jakub Jelinek  <jakub@redhat.com>
5008         PR c++/89074
5009         * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
5010         (cxx_eval_binary_expression): Use it.
5012 2022-01-08  Jason Merrill  <jason@redhat.com>
5014         PR c++/103946
5015         * init.c (build_vec_init): Remove assert.
5016         * tree.c (build_vec_init_expr): Likewise.
5018 2022-01-08  Jason Merrill  <jason@redhat.com>
5020         PR c++/100588
5021         * call.c (build_op_delete_call): Ignore destroying delete
5022         if alloc_fn.
5024 2022-01-07  Jason Merrill  <jason@redhat.com>
5026         PR c++/20040
5027         * init.c (build_new_1): Also build pointer cleanup if
5028         TYPE_GETS_DELETE.
5029         * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
5031 2022-01-07  Jason Merrill  <jason@redhat.com>
5033         PR c++/103936
5034         PR c++/65591
5035         * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
5037 2022-01-07  Jason Merrill  <jason@redhat.com>
5039         PR c++/103711
5040         * init.c (perform_target_ctor): Select destructor by in_chrg.
5042 2022-01-07  Jason Merrill  <jason@redhat.com>
5044         PR c++/61611
5045         * except.c (in_nested_catch): New.
5046         (expand_end_catch_block): Check it.
5048 2022-01-07  Jason Merrill  <jason@redhat.com>
5050         PR c++/33799
5051         PR c++/102191
5052         * except.c (maybe_splice_retval_cleanup): Check
5053         current_binding_level.
5054         * semantics.c (do_poplevel): Call it here.
5055         * parser.c (cp_parser_compound_statement): Not here.
5057 2022-01-07  Jason Merrill  <jason@redhat.com>
5059         PR c++/53868
5060         * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
5061         cleanups from set_up_extended_ref_temp.
5062         (wrap_temporary_cleanups): Ignore array cleanups.
5063         (initialize_local_var): Don't check for array here.
5064         * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
5065         * init.c (build_vec_delete_1): Set it.
5067 2022-01-07  Jason Merrill  <jason@redhat.com>
5069         PR c++/66451
5070         * init.c (build_vec_delete_1): Handle throwing dtor.
5071         (build_vec_init): Tell it we're in a cleanup already.
5073 2022-01-07  Jason Merrill  <jason@redhat.com>
5075         * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
5076         (split_nonconstant_init): Adjust.
5078 2022-01-07  Jason Merrill  <jason@redhat.com>
5080         PR c++/66139
5081         PR c++/52320
5082         * constexpr.c (replace_decl): Rename from replace_result_decl.
5083         * cp-tree.h (replace_decl): Declare it.
5084         * cp-gimplify.c (cp_gimplify_init_expr): Call it.
5085         (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
5086         (cp_genericize_init, cp_genericize_init_expr)
5087         (cp_genericize_target_expr): New.
5088         (cp_fold_r): Call them.
5089         * tree.c (build_array_copy): Add a TARGET_EXPR.
5090         * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
5092 2022-01-07  Jason Merrill  <jason@redhat.com>
5094         PR c++/94041
5095         * decl.c (initialize_local_var): Fix comment.
5096         * init.c (build_new_1): Do stabilize array init.
5097         (build_vec_init): Use TARGET_EXPR for cleanup.  Initialization
5098         of an element from an explicit initializer is not a
5099         full-expression.
5100         * tree.c (expand_vec_init_expr): Pass flags through.
5101         * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
5102         (split_nonconstant_init): Handle array cleanups.
5103         * cp-tree.h: Adjust.
5105 2022-01-07  Jason Merrill  <jason@redhat.com>
5107         PR c++/94041
5108         * decl.c (check_initializer): Remove obsolete comment.
5109         (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
5110         (initialize_local_var): Change assert to test.
5111         * typeck2.c (maybe_push_temp_cleanup): New.
5112         (split_nonconstant_init_1): Use it.
5113         (split_nonconstant_init): Clear cleanup flags.
5115 2022-01-07  Jason Merrill  <jason@redhat.com>
5117         PR c++/92385
5118         * typeck2.c (PICFLAG_VEC_INIT): New.
5119         (process_init_constructor_array): Set it.
5120         (process_init_constructor): Handle it.
5121         (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
5122         * init.c (build_vec_init): Likewise.
5123         * cp-gimplify.c (cp_gimplify_expr): Factor out...
5124         * tree.c (expand_vec_init_expr): ...this function.
5125         (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
5126         (build_vec_init_expr): Likewise.
5127         * constexpr.c (cxx_eval_vec_init): Likewise.
5128         (reduced_constant_expression_p): Check arrays before C++20.
5129         * cp-tree.h (expand_vec_init_expr): Declare.
5131 2022-01-07  Jason Merrill  <jason@redhat.com>
5133         * init.c (build_new_1): Remove preevaluation code.
5135 2022-01-05  Nathan Sidwell  <nathan@acm.org>
5137         * pt.c (instantiate_class_template_1): Process attribute((used)) set
5138         in class's context.
5140 2022-01-05  Nathan Sidwell  <nathan@acm.org>
5142         * init.c (build_new_1): Check complain before alignment warning.
5144 2022-01-04  Jason Merrill  <jason@redhat.com>
5146         * cp-tree.h (class releasing_vec): Add begin/end fns.
5148 2022-01-04  Jason Merrill  <jason@redhat.com>
5150         * init.c: Include -*- C++ -*- on first line.
5152 2022-01-03  Marek Polacek  <polacek@redhat.com>
5154         PR c++/103758
5155         * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
5156         with %qD.
5158 2022-01-03  Marek Polacek  <polacek@redhat.com>
5160         * parser.c (make_char_string_pack): Add a cast to const unsigned
5161         char *.
5163 2022-01-03  Jakub Jelinek  <jakub@redhat.com>
5165         PR c++/103600
5166         * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
5167         to DECL_TINFO_P VAR_DECLs.
5169 2022-01-02  Jason Merrill  <jason@redhat.com>
5171         * init.c (build_vec_init): Append the decrement to elt_init.
5173 2022-01-02  Jason Merrill  <jason@redhat.com>
5175         * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
5178 Copyright (C) 2022 Free Software Foundation, Inc.
5180 Copying and distribution of this file, with or without modification,
5181 are permitted in any medium without royalty provided the copyright
5182 notice and this notice are preserved.