c++: correct ChangeLog PR number
[official-gcc.git] / gcc / cp / ChangeLog
blob9266161b9121228dc16241acc01810908df5b2c6
1 2022-07-21  Jason Merrill  <jason@redhat.com>
3         PR c++/106361
4         * decl.cc (move_fn_p): Remove assert.
6 2022-07-21  Jason Merrill  <jason@redhat.com>
8         DR 2084
9         PR c++/98423
10         * method.cc (walk_field_subobs): Fix DMI in union case.
12 2022-07-19  Patrick Palka  <ppalka@redhat.com>
14         PR c++/94894
15         PR c++/105766
16         PR c++/106201
17         * call.cc (enum conversion_kind): Add ck_deferred_bad enumerator.
18         (has_next): Return false for it.
19         (reference_binding): Return a ck_deferred_bad conversion instead
20         of an actual bad conversion when LOOKUP_SHORTCUT_BAD_CONVS is set.
21         Remove now obsolete early exit for the incomplete TO case.
22         (implicit_conversion_1): Don't mask out LOOKUP_SHORTCUT_BAD_CONVS.
23         (add_function_candidate): Set LOOKUP_SHORTCUT_BAD_CONVS iff
24         shortcut_bad_convs.
25         (missing_conversion_p): Also return true for a ck_deferred_bad
26         conversion.
27         * cp-tree.h (LOOKUP_SHORTCUT_BAD_CONVS): Define.
29 2022-07-19  Jonathan Wakely  <jwakely@redhat.com>
31         * cp-objcp-common.cc (names_builtin_p): Return true for
32         RID_REF_CONSTRUCTS_FROM_TEMPORARY and
33         RID_REF_CONVERTS_FROM_TEMPORARY.
35 2022-07-15  Marek Polacek  <polacek@redhat.com>
37         PR c++/104477
38         * call.cc (ref_conv_binds_directly_p): Rename to ...
39         (ref_conv_binds_directly): ... this.  Add a new bool parameter.  Change
40         the return type to tristate.
41         * constraint.cc (diagnose_trait_expr): Handle
42         CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
43         * cp-tree.h: Include "tristate.h".
44         (enum cp_trait_kind): Add CPTK_REF_CONSTRUCTS_FROM_TEMPORARY
45         and CPTK_REF_CONVERTS_FROM_TEMPORARY.
46         (ref_conv_binds_directly_p): Rename to ...
47         (ref_conv_binds_directly): ... this.
48         (ref_xes_from_temporary): Declare.
49         * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle
50         CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
51         * method.cc (ref_xes_from_temporary): New.
52         * parser.cc (cp_parser_primary_expression): Handle
53         RID_REF_CONSTRUCTS_FROM_TEMPORARY and RID_REF_CONVERTS_FROM_TEMPORARY.
54         (cp_parser_trait_expr): Likewise.
55         (warn_for_range_copy): Adjust to call ref_conv_binds_directly.
56         * semantics.cc (trait_expr_value): Handle
57         CPTK_REF_CONSTRUCTS_FROM_TEMPORARY and CPTK_REF_CONVERTS_FROM_TEMPORARY.
58         (finish_trait_expr): Likewise.
60 2022-07-13  Patrick Palka  <ppalka@redhat.com>
62         PR c++/105912
63         * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
64         NULL_TREE extract_call_expr result.
66 2022-07-13  Patrick Palka  <ppalka@redhat.com>
68         PR c++/105842
69         * constraint.cc (satisfy_declaration_constraints): Refine early
70         exit test for argument dependence.
71         * cp-tree.h (uses_outer_template_parms_in_constraints): Declare.
72         * pt.cc (template_class_depth): Handle TI_TEMPLATE being a
73         FIELD_DECL.
74         (usse_outer_template_parms): Factor out constraint dependence
75         test into ...
76         (uses_outer_template_parms_in_constraints): ... here.
77         (type_dependent_expression_p): Use it for FUNCTION_DECL.
79 2022-07-07  Patrick Palka  <ppalka@redhat.com>
81         PR c++/105956
82         * pt.cc (template_arg_to_parm): Define.
83         (tsubst_argument_pack): Try to reuse the corresponding
84         ARGUMENT_PACK from 'args' when substituting into a generic
85         ARGUMENT_PACK for a variadic template parameter.
86         (tsubst_template_args): Move variable declarations closer to
87         their first use.  Replace 'orig_t' with 'r'.  Rename 'need_new'
88         to 'const_subst_p'.  Heuristically detect if the substituted
89         elements are identical to that of a level from 'args' and avoid
90         allocating a new TREE_VEC if so.  Add sanity check for the
91         length of the new TREE_VEC, and remove dead ARGUMENT_PACK_P test.
92         (tsubst_decl) <case TYPE_DECL, case VAR_DECL>: Revert
93         r13-1045-gcb7fd1ea85feea change for avoiding substitution into
94         DECL_TI_ARGS, but still avoid coercion in this case.
96 2022-07-07  Jason Merrill  <jason@redhat.com>
98         PR c++/87729
99         * class.cc (warn_hidden): Ignore [cd]tors.
101 2022-07-06  Lewis Hyatt  <lhyatt@gmail.com>
103         PR c++/53431
104         * parser.cc (cp_parser_pragma_kind): Move earlier in the file.
105         (cp_lexer_handle_early_pragma): New function.
106         (cp_lexer_new_main): Support parsing and handling early pragmas.
107         (c_parse_file): Adapt to changes in cp_lexer_new_main.
109 2022-07-06  Jason Merrill  <jason@redhat.com>
111         PR c++/106179
112         PR c++/106024
113         * parser.cc (cp_parser_lookup_name): Remove :: requirement
114         for using unqualified lookup result.
116 2022-07-05  Nathan Sidwell  <nathan@acm.org>
118         * module.cc
119         (struct ord_loc_info, ord_loc_traits): New.
120         (ord_loc_tabke, ord_loc_remap): New globals.
121         (struct location_map_info): Delete.
122         (struct module_state_config): Rename ordinary_loc_align to
123         loc_range_bits.
124         (module_for_ordinary_loc): Adjust.
125         (module_state::note_location): Note ordinary locations,
126         return bool.
127         (module_state::write_location): Adjust ordinary location
128         streaming.
129         (module_state::read_location): Likewise.
130         (module_state::write_init_maps): Allocate ord_loc_table.
131         (module_state::write_prepare_maps): Reimplement ordinary
132         map preparation.
133         (module_state::read_prepare_maps): Adjust.
134         (module_state::write_ordinary_maps): Reimplement.
135         (module_state::write_macro_maps): Adjust.
136         (module_state::read_ordinary_maps): Reimplement.
137         (module_state::write_macros): Adjust.
138         (module_state::write_config): Adjust.
139         (module_state::read_config): Adjust.
140         (module_state::write_begin): Adjust.
141         (module_state::read_initial): Adjust.
143 2022-07-04  Tobias Burnus  <tobias@codesourcery.com>
144             Chung-Lin Tang  <cltang@codesourcery.com>
145             Thomas Schwinge  <thomas@codesourcery.com>
147         * parser.cc (cp_parser_omp_target_data,
148         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
149         cp_parser_omp_target_update): Set OMP_REQUIRES_TARGET_USED.
150         (cp_parser_omp_requires): Remove sorry.
152 2022-07-01  Lewis Hyatt  <lhyatt@gmail.com>
154         * parser.cc (cp_token_is_module_directive): New function
155         refactoring common code.
156         (cp_parser_skip_to_closing_parenthesis_1): Use the new function.
157         (cp_parser_skip_to_end_of_statement): Likewise.
158         (cp_parser_skip_to_end_of_block_or_statement): Likewise.
159         (cp_parser_declaration): Likewise.
161 2022-07-01  Marek Polacek  <polacek@redhat.com>
163         PR c++/105550
164         * constexpr.cc (cxx_eval_conditional_expression): Strip TARGET_EXPRs.
166 2022-07-01  Tobias Burnus  <tobias@codesourcery.com>
168         * parser.cc (cp_parser_omp_target_enter_data,
169         cp_parser_omp_target_exit_data): Accept tofrom
170         map-type modifier but use 'to' / 'from' internally.
172 2022-07-01  Marek Polacek  <polacek@redhat.com>
174         PR c++/106111
175         * parser.cc (cp_lexer_get_preprocessor_token): Also warn about
176         RID_ALIGNOF, RID_ALIGNAS, RID_THREAD.
178 2022-07-01  Jason Merrill  <jason@redhat.com>
180         PR c++/105779
181         * call.cc (resolve_args): Use complain.
183 2022-07-01  Jason Merrill  <jason@redhat.com>
185         * parser.cc (missing_template_diag): Split out...
186         (cp_parser_id_expression): ...from here.
188 2022-07-01  Jason Merrill  <jason@redhat.com>
190         PR c++/106024
191         * parser.cc (missing_template_diag): Factor out...
192         (cp_parser_id_expression): ...from here.
193         (cp_parser_lookup_name): Don't look in dependent object_type.
195 2022-06-30  Nathan Sidwell  <nathan@acm.org>
197         * module.cc (module_state::write_define): Drop located param.
198         (module_state::read_define): Likewise.
199         (module_state::prepare_macros): New, broken out of ...
200         (module_state::write_macros): ... here.  Adjust.
201         (module_state::write_begin): Adjust.
203 2022-06-29  Nathan Sidwell  <nathan@acm.org>
205         * module.cc (macro_info, macro_traits, macro_table,
206         macro_remap): Rename to ...
207         (macro_loc_info, macro_loc_traits, macro_loc_table,
208         macro_loc_remap): ... these.  Update all uses.
209         (module_state::write_prepare_maps): Remove unneeded macro checking.
210         (module_state::write_begin): Free macro_loc_remap.
212 2022-06-27  Sergei Trofimovich  <siarheit@google.com>
214         PR c++/106102
215         * mapper-client.cc: Include <memory> via "system.h".
216         * mapper-resolver.cc: Ditto.
217         * module.cc: Ditto.
219 2022-06-27  David Malcolm  <dmalcolm@redhat.com>
221         * cxx-pretty-print.h: Add "final" and "override" to various vfunc
222         implementations, removing redundant "virtual" as appropriate.
223         * module.cc: Likewise.
225 2022-06-24  Jason Merrill  <jason@redhat.com>
227         PR c++/87729
228         PR c++/20423
229         * class.cc (warn_hidden): Handle -Woverloaded-virtual=1.
231 2022-06-24  Alexandre Oliva  <oliva@adacore.com>
233         * g++spec.cc (lang_specific_driver): Implement -nostdlib++.
235 2022-06-23  Jason Merrill  <jason@redhat.com>
237         PR c++/105925
238         * call.cc (build_aggr_conv): Don't depend on
239         CONSTRUCTOR_IS_DESIGNATED_INIT.
241 2022-06-23  Jason Merrill  <jason@redhat.com>
243         PR c++/105925
244         * decl.cc (reshape_init_array_1): Set
245         CONSTRUCTOR_IS_DESIGNATED_INIT here.
246         (reshape_init_class): And here.
247         (reshape_init): Not here.
249 2022-06-23  Patrick Palka  <ppalka@redhat.com>
251         PR c++/105931
252         * expr.cc (fold_for_warn): Don't fold when in an unevaluated
253         context.
255 2022-06-23  Patrick Palka  <ppalka@redhat.com>
257         PR c++/105982
258         * pt.cc (lookup_template_class): After calling complete_type for
259         the substituted context, check the table again iff the type was
260         previously incomplete and complete_type made it complete.
262 2022-06-23  Jason Merrill  <jason@redhat.com>
264         PR c++/94554
265         * pt.cc (dependent_operand_p): Split out from...
266         (tsubst_copy_and_build): ...here.
267         (tsubst_expr) [IF_STMT]: Use it.
268         * semantics.cc (finish_if_stmt_cond): Keep the pre-conversion
269         condition in the template tree.
271 2022-06-23  Jason Merrill  <jason@redhat.com>
273         PR c++/105885
274         * pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
275         comparison of dependent operands.
277 2022-06-23  Nathan Sidwell  <nathan@acm.org>
279         * module.cc (struct macro_info): New.
280         (struct macro_traits): New.
281         (macro_remap, macro_table): New globals.
282         (depset::hash::find_dependencies): Note namespace location.
283         (module_for_macro_loc): Adjust.
284         (module_state::note_location): New.
285         (module_state::Write_location): Note location when not
286         streaming. Adjust macro location streaming.
287         (module_state::read_location): Adjust macro location
288         streaming.
289         (module_state::write_init_maps): New.
290         (module_state::write_prepare_maps): Reimplement macro map
291         preparation.
292         (module_state::write_macro_maps): Reimplement.
293         (module_state::read_macro_maps): Likewise.
294         (module_state::write_begin): Adjust.
296 2022-06-23  Jason Merrill  <jason@redhat.com>
298         * pt.cc (type_unification_real): An auto tparm can't
299         be affected by other deductions.
301 2022-06-23  Jason Merrill  <jason@redhat.com>
303         PR c++/105964
304         * pt.cc (type_dependent_expression_p): Look through BASELINK.
306 2022-06-22  Jason Merrill  <jason@redhat.com>
308         PR c++/105908
309         * name-lookup.cc (outer_binding): Strip BASELINK.
311 2022-06-22  Nathan Sidwell  <nathan@acm.org>
313         * module.cc (struct duplicate_hash): Remove.
314         (duplicate_hash_map): Adjust.
316 2022-06-22  Jason Merrill  <jason@redhat.com>
318         PR c++/104642
319         * constexpr.cc (cxx_eval_builtin_function_call): Handle
320         unreachable/trap earlier.
321         * cp-gimplify.cc (cp_maybe_instrument_return): Use
322         build_builtin_unreachable.
324 2022-06-18  Jakub Jelinek  <jakub@redhat.com>
326         * cp-ubsan.cc (cp_ubsan_instrument_vptr_p): Use
327         flag_sanitize_trap & SANITIZE_VPTR instead of
328         flag_sanitize_undefined_trap_on_error.
330 2022-06-17  Jakub Jelinek  <jakub@redhat.com>
332         PR c++/106001
333         * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr
334         instead of maybe_constant_value.
336 2022-06-16  Nathan Sidwell  <nathan@acm.org>
338         * decl2.cc (finish_objects): Add startp parameter, adjust.
339         (generate_ctor_or_dtor_function): Detect empty fn, and don't
340         generate unnecessary code.  Remove objc startup here ...
341         (c_parse_final_cleanyps): ... do it here.
343 2022-06-16  Martin Liska  <mliska@suse.cz>
345         * decl2.cc (struct priority_map_traits): Remove unused param.
347 2022-06-15  Nathan Sidwell  <nathan@acm.org>
349         * module.cc (module_state::write_readme): Use less confusing
350         importable unit names.
352 2022-06-14  Nathan Sidwell  <nathan@acm.org>
354         * cp-tree.h (fini_modules): Add has_inits parm.
355         * decl2.cc (c_parse_final_cleanups): Check for
356         inits, adjust fini_modules flags.
357         * module.cc (module_state): Rename call_init_p to
358         active_init_p.
359         (module_state::write_config): Write active_init.
360         (module_state::read_config): Read it.
361         (module_determine_import_inits): Clear active_init_p
362         of covered inits.
363         (late_finish_module): Add has_init parm.  Record it.
364         (fini_modules): Adjust.
366 2022-06-13  Nathan Sidwell  <nathan@acm.org>
368         * module.cc (module_state::write): Separate to ...
369         (module_state::write_begin, module_state::write_end): ...
370         these.
371         (module_state::write_readme): Drop extensions parameter.
372         (struct module_processing_cookie): Add more fields.
373         (finish_module_processing): Adjust state writing call.
374         (late_finish_module): Call write_end.
376 2022-06-10  Patrick Palka  <ppalka@redhat.com>
378         PR c++/65328
379         * decl.cc (typename_hasher::hash): Add extra overloads.
380         Use iterative_hash_object instead of htab_hash_pointer.
381         Hash TYPENAME_TYPE_FULLNAME instead of TYPE_IDENTIFIER.
382         (build_typename_type): Use typename_hasher::hash.
383         * pt.cc (spec_hasher::hash): Add two-parameter overload.
384         Set comparing_specializations around the call to
385         hash_tmpl_and_args.
386         (iterative_hash_template_arg) <case TYPENAME_TYPE>:
387         When comparing_specializations, hash the TYPE_CONTEXT
388         and TYPENAME_TYPE_FULLNAME.
389         (tsubst_function_decl): Use spec_hasher::hash instead of
390         hash_tmpl_and_args.
391         (tsubst_template_decl): Likewise.
392         (tsubst_decl): Likewise.
394 2022-06-10  Patrick Palka  <ppalka@redhat.com>
396         * pt.cc (instantiate_template): Don't substitute the context
397         of the most general template if that of the partially
398         instantiated template is already non-dependent.
400 2022-06-10  Patrick Palka  <ppalka@redhat.com>
402         * pt.cc (lookup_template_class): Remove dead stores to
403         context parameter.  Don't substitute the context of the
404         most general template if that of the partially instantiated
405         template is already non-dependent.  Check the specializations
406         table again after completing the context of a nested dependent
407         specialization.
408         (tsubst_aggr_type) <case RECORD_TYPE>: Don't substitute
409         TYPE_CONTEXT or pass it to lookup_template_class.
410         (tsubst_decl) <case TYPE_DECL, case TYPE_DECL>: Avoid substituting
411         the TREE_TYPE for DECL_SELF_REFERENCE_P.  Avoid template argument
412         substitution or coercion in some cases.
414 2022-06-10  Nathan Sidwell  <nathan@acm.org>
416         * cp-tree.h (fini_modules): Add some parameters.
417         (finish_module_processing): Return an opaque pointer.
418         * decl2.cc (c_parse_final_cleanups): Propagate a cookie from
419         finish_module_processing to fini_modules.
420         * module.cc (struct module_processing_cookie): New.
421         (finish_module_processing): Return a heap-allocated cookie.
422         (late_finish_module): New.  Finish out the module writing.
423         (fini_modules): Adjust.
425 2022-06-10  Nathan Sidwell  <nathan@acm.org>
427         * cp-tree.h (module_has_import_init): Rename to ...
428         (module_determined_import_inits): ... here.
429         * decl2.cc (start_objects): Do not handle module initializers
430         here.
431         (c_parse_final_cleanups): Generate a separate module
432         initializer calling function and add it to the list.  Shrink
433         the c-lang region.
434         * module.cc (num_init_calls_needed): Delete.
435          (module_has_import_init): Rename to ...
436         (module_determined_import_inits): ... here. Do the
437         calculation here ...
438         (finish_module_processing): ... rather than here.
439         (module_add_import_initializers): Reformat.
441 2022-06-09  Jakub Jelinek  <jakub@redhat.com>
443         PR c++/105871
444         * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with
445         non-integral result type use fold_ternary too like for BIT_FIELD_REFs
446         from VECTOR_CST.  If fold_ternary returns NULL, diagnose non-constant
447         expression, set *non_constant_p and return t, instead of returning
448         NULL.
450 2022-06-09  Nathan Sidwell  <nathan@acm.org>
452         * cp-tree.h (module_initializer_kind): Replace with ...
453         (module_global_init_needed, module_has_import_inits): ...
454         these.
455         * decl2.cc (start_objects): Add has_body parm.  Reorganize
456         module initializer creation.
457         (generate_ctor_or_dtor_function): Adjust.
458         (c_parse_final_cleanups): Adjust.
459         (vtv_start_verification_constructor_init_function): Adjust.
460         * module.cc (module_initializer_kind): Replace with ...
461         (module_global_init_needed, module_has_import_inits): ...
462         these.
464 2022-06-08  Jason Merrill  <jason@redhat.com>
466         PR c++/105852
467         * decl.cc (duplicate_decls): Change non-templated friend
468         check to an assert.
469         * pt.cc (tsubst_function_decl): Don't set DECL_TEMPLATE_INFO
470         on non-templated friends.
471         (tsubst_friend_function): Adjust.
473 2022-06-08  Jason Merrill  <jason@redhat.com>
475         PR c++/105852
476         PR c++/105761
477         * decl.cc (duplicate_decls): Avoid copying template info
478         from non-templated friend even if newdecl isn't a definition.
479         Correct handling of DECL_UNIQUE_FRIEND_P on templates.
480         * pt.cc (non_templated_friend_p): New.
481         * cp-tree.h (non_templated_friend_p): Declare it.
483 2022-06-08  Nathan Sidwell  <nathan@acm.org>
485         * decl2.cc (struct priority_info_s, priority_info): Delete.
486         (priority_map_traits, priority_map_t): New.
487         (static_init_fini_fns): New.
488         (INITIALIZE_P_IDENTIFIER, PRIORITY_IDENTIFIER): Delete.
489         (initialize_p_decl, priority_decl): Delete.
490         (ssdf_decls, priority_info_map): Delete.
491         (start_static_storage_duration_function): Rename to ...
492         (start_partial_init_fini_fn): ... here. Create a void arg fn.
493         Add it to the slot in the appropriate static_init_fini_fns
494         hash table.
495         (finish_static_storage_duration_function): Rename to ...
496         (finish_partial_init_fini_fn): ... here.
497         (get_priority_info): Delete.
498         (one_static_initialization_or_destruction): Assert not
499         trivial dtor.
500         (do_static_initialization_or_destruction): Rename to ...
501         (emit_partial_init_fini_fn) ... here.  Start & finish the fn.
502         Simply init/fini each var.
503         (partition_vars_for_init_fini): Partition vars according to
504         priority and add to init and/or fini list.
505         (generate_ctor_or_dtor_function): Start and finish the function.
506         Do santitizer calls here.
507         (generate_ctor_and_dtor_functions_for_priority): Delete.
508         (c_parse_final_cleanups): Reimplement global init/fini
509         processing.
511 2022-06-07  Jakub Jelinek  <jakub@redhat.com>
513         * parser.cc (cp_parser_omp_clause_linear): Parse OpenMP 5.2
514         style linear clause modifiers.  Set
515         OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER flag on the clauses when
516         old style modifiers are used.
517         * semantics.cc (finish_omp_clauses): Only reject linear clause
518         with val modifier on simd or for if the old style modifiers are
519         used.
521 2022-06-07  Roger Sayle  <roger@nextmovesoftware.com>
523         PR c++/96442
524         * decl.cc (start_enum): When emitting a "must be integral" error,
525         set ENUM_UNDERLYING_TYPE to integer_type_node, to avoid an ICE
526         downstream in build_enumeration.
528 2022-06-06  Patrick Palka  <ppalka@redhat.com>
530         PR c++/53164
531         PR c++/105848
532         * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Look through an
533         ADDR_EXPR callee when calling mark_used.
535 2022-06-04  Marek Polacek  <polacek@redhat.com>
537         PR c++/102399
538         PR c++/69585
539         * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
540         followed by [[]] attributes and vice versa.
542 2022-06-03  Patrick Palka  <ppalka@redhat.com>
544         PR c++/105756
545         * typeck.cc (cp_build_binary_op): Don't fold operands
546         when c_inhibit_evaluation_warnings.
548 2022-06-03  Jason Merrill  <jason@redhat.com>
550         PR c++/105761
551         * decl.cc (duplicate_decls): Don't copy DECL_TEMPLATE_INFO
552         from a hidden friend.
554 2022-06-03  Patrick Palka  <ppalka@redhat.com>
556         PR c++/105637
557         * tree.cc (maybe_dummy_object): When returning a dummy
558         object, respect the cv-quals of 'this' if available.
560 2022-06-03  Patrick Palka  <ppalka@redhat.com>
562         PR c++/100374
563         * pt.cc (determine_specialization): Compare overall constraints
564         not just the trailing constraints.
565         (tsubst_each_template_parm_constraints): Define.
566         (tsubst_friend_function): Use it.
567         (tsubst_friend_class): Use it.
568         (tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
570 2022-06-03  Patrick Palka  <ppalka@redhat.com>
572         PR c++/105797
573         * pt.cc (for_each_template_parm_r) <case FUNCTION_DECL, VAR_DECL>:
574         Don't walk DECL_CONTEXT.
575         <case PARM_DECL>: Likewise.  Walk TREE_TYPE.
576         <case CONST_DECL>: Simplify.
577         (any_template_parm_r) <case PARM_DECL>: Don't walk TREE_TYPE.
579 2022-06-02  Marek Polacek  <polacek@redhat.com>
581         * constexpr.cc (potential_constant_expression_1): Treat
582         {,VEC_}NEW_EXPR and {,VEC_}DELETE_EXPRas potentially constant in C++20.
584 2022-06-02  Marek Polacek  <polacek@redhat.com>
586         PR c++/105803
587         * pt.cc (value_dependent_expression_p): Handle {,VEC_}NEW_EXPR
588         in the switch.
590 2022-06-02  David Malcolm  <dmalcolm@redhat.com>
592         * cp-lang.cc (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
593         (cp_get_sarif_source_language): New.
595 2022-06-02  Jason Merrill  <jason@redhat.com>
597         PR c++/105795
598         * constexpr.cc (init_subob_ctx): Clear ctx->ctor for empty subob.
599         (cxx_eval_store_expression): Likewise.
600         (cxx_eval_bare_aggregate): Handle null ctx->ctor.
602 2022-06-02  Jason Merrill  <jason@redhat.com>
604         PR c++/105795
605         * constexpr.cc (cxx_eval_bare_aggregate): Always call
606         init_subob_ctx.
608 2022-06-01  Jason Merrill  <jason@redhat.com>
610         PR c++/105734
611         * parser.cc (cp_parser_postfix_dot_deref_expression): Use typeof
612         if the expression has auto type.
614 2022-06-01  Jason Merrill  <jason@redhat.com>
616         PR c++/105779
617         * call.cc (resolve_args): Call mark_single_function here.
618         * pt.cc (unify_one_argument): Not here.
620 2022-06-01  Nathan Sidwell  <nathan@acm.org>
622         * decl2.cc (fix_temporary_vars_context_r): Use data argument
623         for new context.
624         (one_static_initialization_or_destruction): Adjust tree walk
625         call.  Refactor guard generation.
627 2022-06-01  Nathan Sidwell  <nathan@acm.org>
629         * decl2.cc (ssdf_decl): Delete global.
630         (start_static_storage_duration_function): Use some RAII.
631         (do_static_initialization_or_destruction): Likewise.
632         (c_parse_final_cleanups): Likewise.  Avoid rechecking 'vars'.
634 2022-06-01  Nathan Sidwell  <nathan@acm.org>
636         * decl2.cc (start_objects): Replace 'method_type' parameter
637         with 'initp' boolean, rename and retype 'priority' parameter.
638         (finish_objects): Likewise.  Do not expand here.
639         (one_static_initialization_or_destruction): Move 'initp'
640         parameter first.
641         (do_static_initialization_or_destruction): Likewise.
642         (generate_ctor_or_dtor_function): Rename 'initp' parameter.
643         Adjust start_objects/finish_obects calls and expand here.
644         (generate_ctor_and_dtor_functions_for_priority): Adjust calls.
645         (c_parse_final_cleanups): Likewise.
646         (vtv_start_verification_constructor_init): Adjust.
647         (vtv_finish_verification_constructor_init): Use finish_objects.
649 2022-05-31  Patrick Palka  <ppalka@redhat.com>
651         PR c++/105758
652         * call.cc (build_over_call): Use z_candidate::conversion_path
653         and ::access_path instead of TYPE_BINFO when building the
654         BASELINK for the templated form.
656 2022-05-31  Patrick Palka  <ppalka@redhat.com>
658         * parser.cc: Use auto_timevar instead of timevar_push/pop.
659         Remove wrapper functions.
660         * pt.cc: Likewise.
662 2022-05-31  Patrick Palka  <ppalka@redhat.com>
664         * cp-tree.h (cp_build_qualified_type_real): Rename to ...
665         (cp_build_qualified_type): ... this.  Give its last parameter
666         a default argument.  Remove macro of the same name.
667         * decl.cc (grokdeclarator): Adjust accordingly.
668         * pt.cc (tsubst_aggr_type): Likewise.
669         (rebuild_function_or_method_type): Likewise.
670         (tsubst): Likewise.
671         (maybe_dependent_member_ref): Likewise.
672         (unify): Likewise.
673         * tree.cc (cp_build_qualified_type_real): Rename to ...
674         (cp_build_qualified_type): ... this.  Adjust accordingly.
676 2022-05-31  Jason Merrill  <jason@redhat.com>
678         * Make-lang.in (c++.tags): Just look at *.cc.
680 2022-05-31  Patrick Palka  <ppalka@redhat.com>
682         * cp-tree.h (comp_template_args): Change return type to bool.
683         * pt.cc (comp_template_args): Document default arguments.
684         Change return type to bool and adjust returns accordingly.
686 2022-05-31  Patrick Palka  <ppalka@redhat.com>
688         * decl.cc (grokvardecl): Use current_template_constraints.
689         (grokdeclarator): Likewise.
690         (xref_tag): Likewise.
691         * semantics.cc (finish_template_template_parm): Likewise.
693 2022-05-31  Jakub Jelinek  <jakub@redhat.com>
695         * parser.cc (OMP_SCOPE_CLAUSE_MASK): Add firstprivate and allocate
696         clauses.
698 2022-05-30  Marek Polacek  <polacek@redhat.com>
700         PR c++/99080
701         * pt.cc (type_dependent_expression_p): Assert !TYPE_P.
702         * semantics.cc (finish_id_expression_1): Handle UNBOUND_CLASS_TEMPLATE
703         specifically.
705 2022-05-28  Jakub Jelinek  <jakub@redhat.com>
707         * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was
708         seen first, use "%<to%>" or "%<enter%>" depending on
709         OMP_CLAUSE_ENTER_TO of the current clause, otherwise use
710         "%<to%> or %<enter%>" wording.
712 2022-05-28  Jason Merrill  <jason@redhat.com>
714         PR c++/105652
715         * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda
716         instantiate into a class-scope lambda.
718 2022-05-27  Marek Polacek  <polacek@redhat.com>
720         PR c++/105725
721         * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.
723 2022-05-27  Jakub Jelinek  <jakub@redhat.com>
725         * parser.cc (cp_parser_omp_clause_name): Parse enter clause.
726         (cp_parser_omp_all_clauses): For to clause on declare target, use
727         OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of
728         OMP_CLAUSE_TO_DECLARE clause.  Handle PRAGMA_OMP_CLAUSE_ENTER.
729         (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause.
730         (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of
731         OMP_CLAUSE_TO_DECLARE.
732         * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead
733         of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause
734         name in diagnostics instead of
735         omp_clause_code_name[OMP_CLAUSE_CODE (c)].
737 2022-05-26  Marek Polacek  <polacek@redhat.com>
739         PR c++/105569
740         * typeck.cc (warn_for_null_address): Improve the warning when
741         the POINTER_PLUS_EXPR's base is of reference type.
743 2022-05-26  Patrick Palka  <ppalka@redhat.com>
745         PR c++/96363
746         * decl.cc (shadow_tag): Use the return value of
747         maybe_process_partial_specialization.
748         * parser.cc (cp_parser_single_declaration): Call shadow_tag
749         before associate_classtype_constraints.
750         * pt.cc (maybe_new_partial_specialization): Change return type
751         to bool.  Take 'type' argument by mutable reference.  Set 'type'
752         to point to the correct constrained specialization when
753         appropriate.
754         (maybe_process_partial_specialization): Adjust accordingly.
756 2022-05-25  Marek Polacek  <polacek@redhat.com>
758         PR c++/96637
759         * cp-tree.h (attr_chainon): Declare.
760         * decl.cc (start_decl): Use attr_chainon.
761         (grokdeclarator): Likewise.
762         * parser.cc (cp_parser_statement): No longer static.
764 2022-05-25  Jason Merrill  <jason@redhat.com>
766         PR c++/105655
767         * pt.cc (build_template_decl): Add assert.
768         (tsubst_function_decl): Don't return a template.
770 2022-05-25  Jason Merrill  <jason@redhat.com>
772         PR c++/105623
773         * decl2.cc (mark_used): Copy type from fn to BASELINK.
774         * pt.cc (unify_one_argument): Call mark_single_function.
776 2022-05-25  Jason Merrill  <jason@redhat.com>
778         * constexpr.cc (cxx_eval_call_expression): Check for
779         heap vars in the result.
781 2022-05-25  Jason Merrill  <jason@redhat.com>
783         * constexpr.cc (maybe_constant_init_1): Only pass false for
784         strict when initializing a variable of static duration.
786 2022-05-25  Marek Polacek  <polacek@redhat.com>
788         PR c++/100252
789         * typeck2.cc (potential_prvalue_result_of): New.
790         (replace_placeholders_for_class_temp_r): New.
791         (digest_nsdmi_init): Call it.
793 2022-05-24  Jason Merrill  <jason@redhat.com>
795         * constexpr.cc (cxx_fold_indirect_ref): Add default arg.
796         (cxx_eval_call_expression): Call it.
797         (cxx_fold_indirect_ref_1): Handle null empty_base.
799 2022-05-24  Jason Merrill  <jason@redhat.com>
801         * constexpr.cc (enum value_cat): New. Change all 'lval' parameters
802         from int to value_cat.  Change most false to vc_prvalue, most true
803         to vc_glvalue, cases where the return value is ignored to
804         vc_discard.
805         (cxx_eval_statement_list): Only vc_prvalue for stmt-expr result.
806         (cxx_eval_store_expression): Only build _REF for vc_glvalue.
807         (cxx_eval_array_reference, cxx_eval_component_reference)
808         (cxx_eval_indirect_ref, cxx_eval_constant_expression): Likewise.
810 2022-05-24  Jason Merrill  <jason@redhat.com>
812         PR c++/105622
813         * constexpr.cc (cxx_eval_store_expression): Adjust assert.
814         Use initialized_type.
816 2022-05-24  Patrick Palka  <ppalka@redhat.com>
818         * cp-tree.h (any_template_arguments_need_structural_equality_p):
819         Declare.
820         * pt.cc (struct ctp_hasher): Define.
821         (ctp_table): Define.
822         (canonical_type_parameter): Use it.
823         (process_template_parm): Set TYPE_CANONICAL for
824         TEMPLATE_TEMPLATE_PARM too.
825         (lookup_template_class_1): Remove now outdated comment for the
826         any_template_arguments_need_structural_equality_p test.
827         (tsubst) <case TEMPLATE_TEMPLATE_PARM, etc>: Don't specifically
828         clear TYPE_CANONICAL for ttps.  Set TYPE_CANONICAL on the
829         substituted type later.
830         (any_template_arguments_need_structural_equality_p): Return
831         true for any_targ_node.  Don't return true just because a
832         template argument uses structural equality.  Add comment for
833         the PARM_DECL special case.
834         (rewrite_template_parm): Set TYPE_CANONICAL on the rewritten
835         parm's type later.
836         * tree.cc (bind_template_template_parm): Set TYPE_CANONICAL
837         when safe to do so.
838         * typeck.cc (structural_comptypes) [check_alias]: Increment
839         processing_template_decl before checking
840         dependent_alias_template_spec_p.
842 2022-05-24  Jakub Jelinek  <jakub@redhat.com>
844         PR c/105378
845         * parser.cc (OMP_TASKWAIT_CLAUSE_MASK): Add nowait clause.
847 2022-05-20  David Malcolm  <dmalcolm@redhat.com>
849         * cxx-pretty-print.h: Replace uses of "FINAL" and "OVERRIDE" with
850         "final" and "override".
851         * error.cc: Likewise.
853 2022-05-18  Marek Polacek  <polacek@redhat.com>
855         PR c++/105634
856         * call.cc (maybe_warn_class_memaccess): Avoid % by zero.
858 2022-05-17  Jason Merrill  <jason@redhat.com>
860         PR c++/102307
861         * decl.cc (check_initializer): Use build_cplus_new in case of
862         constexpr failure.
864 2022-05-17  Jakub Jelinek  <jakub@redhat.com>
866         * parser.cc (cp_parser_omp_clause_depend): Parse
867         inoutset depend-kind.
868         (cp_parser_omp_depobj): Likewise.
869         * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
870         OMP_CLAUSE_DEPEND_INOUTSET.
872 2022-05-16  Martin Liska  <mliska@suse.cz>
874         * module.cc (depset::entity_kind_name): Use ARRAY_SIZE.
875         * name-lookup.cc (get_std_name_hint): Likewise.
876         * parser.cc (cp_parser_new): Likewise.
878 2022-05-16  Marcel Vollweiler  <marcel@codesourcery.com>
880         * pt.cc (tsubst_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
881         * semantics.cc (finish_omp_clauses): Added template decl processing.
883 2022-05-15  Jason Merrill  <jason@redhat.com>
885         PR c++/100502
886         PR c++/58993
887         * friend.cc (is_friend): Hidden friends count as members.
888         * search.cc (friend_accessible_p): Likewise.
890 2022-05-15  Jason Merrill  <jason@redhat.com>
892         * parser.cc (cp_parser_template_name): Look through
893         injected-class-name.
895 2022-05-15  Jason Merrill  <jason@redhat.com>
897         PR c++/105589
898         PR c++/105191
899         PR c++/92385
900         * init.cc (build_value_init): Handle class in template.
902 2022-05-13  Nathan Sidwell  <nathan@acm.org>
904         * mangle.cc (maybe_write_module): Check external linkage.
906 2022-05-13  Richard Biener  <rguenther@suse.de>
908         * constexpr.cc: Remove gimple-fold.h include.
910 2022-05-12  Patrick Palka  <ppalka@redhat.com>
912         * cp-tree.h (TMPL_ARGS_LEVEL): Assert LEVEL is 1 when
913         TMPL_ARGS_HAVE_MULTIPLE_LEVELS is false.
914         * pt.cc (try_class_unification): Correctly copy multidimensional
915         targs.  Free the copy of targs.
916         (unify_pack_expansion): Fix level comparison.
918 2022-05-12  Nathan Sidwell  <nathan@acm.org>
920         * parser.cc (cp_parser_linkage_specification): Implement
921         global module attachment semantics.
923 2022-05-12  Jakub Jelinek  <jakub@redhat.com>
925         * lex.cc (init_reswords): Register omp_all_memory as keyword
926         if flag_openmp.
927         * parser.cc (cp_parser_primary_expression): Diagnose uses of
928         omp_all_memory in postfix expressions.
929         (cp_parser_omp_var_list_no_open): Handle omp_all_memory in depend
930         clause.
931         * semantics.cc (finish_omp_clauses): Handle omp_all_memory
932         keyword in depend clause as null_pointer_node, diagnose invalid
933         uses.
934         * pt.cc (tsubst_omp_clause_decl): Pass through omp_all_memory.
936 2022-05-11  Patrick Palka  <ppalka@redhat.com>
938         * constraint.cc (tsubst_parameter_mapping): Convert loop over
939         TREE_VEC into a range-based for loop using tree_vec_range.
940         * pt.cc (iterative_hash_template_arg): Likewise.
941         (template_parms_level_to_args): Likewise.
942         (deducible_template_args): Likewise.
943         (check_undeduced_parms): Likewise.
944         (dependent_type_p_r): Likewise.
945         (value_dependent_expression_p) <case NONTYPE_ARGUMENT_PACK>:
946         Likewise.
947         (dependent_template_arg_p): Likewise.
948         * tree.cc (cp_walk_subtrees) <case NONTYPE_ARGUMENT_PACK>:
949         Likewise.
951 2022-05-11  Jason Merrill  <jason@redhat.com>
953         PR c++/105541
954         * cp-tree.h (TMPL_ARGS_DEPTH): 0 for null args.
955         * parser.cc (cp_parser_enclosed_template_argument_list):
956         Use 0-length TREE_VEC for <>.
958 2022-05-11  Jason Merrill  <jason@redhat.com>
960         PR bootstrap/105567
961         * typeck.cc (check_return_expr): Don't mess with ctor return value
962         while parsing a template.
964 2022-05-11  Nathan Sidwell  <nathan@acm.org>
966         * cp-tree.h (DECL_MODULE_ATTACH_P): New.
967         (struct lang_decl_base): Add module_attach_p flag.
968         * decl.cc (duplicate_decls): Rework module redeclaration
969         checking.
970         * module.cc (trees_out::lang_decl_bools): Write attach flag.
971         (trees_in::lang_decl_bools): ... and read it back.
972         (trees_out::decl_value): Rework module attachment handling.
973         (trees_in::decl_value): Rename local var to reflect meaning.
974         (trees_in::key_mergeable): Likewise.
975         (get_originating_module): Use DECL_MODULE_ATTACH_P.  No need
976         to special-case mangling.
977         (module_may_redeclare): Reimplement.
978         (set_originating_module): Deal with attachment.
979         * name-lookup.cc (maybe_record_mergeable_decl): Deal with
980         attachment.
981         (mergeable_namespace_slots): Likewise.
982         (do_nonmember_using_decl): Likewise.
983         * name-lookup.h (mergeable_namespace_slots): Adjust parm
984         meaning.
985         * ptree.cc (cxx_print_decl): Adjust purview & attach printing.
987 2022-05-11  Martin Liska  <mliska@suse.cz>
989         PR target/105355
990         * lang-specs.h: Use Separate syntax.
992 2022-05-10  Patrick Palka  <ppalka@redhat.com>
994         * coroutines.cc (instantiate_coro_traits): Adjust accordingly.
995         * cp-tree.def: Remove mention of SET_PACK_EXPANSION_PATTERN.
996         * cp-tree.h (SET_PACK_EXPANSION_PATTERN): Remove.
997         (SET_ARGUMENT_PACK_ARGS): Remove.
998         * module.cc (trees_in::tree_node): Adjust accordingly.
999         * parser.cc (make_char_string_pack): Likewise.
1000         (make_string_pack): Likewise.
1001         * pt.cc (make_pack_expansion): Likewise.
1002         (template_parm_to_arg): Likewise.
1003         (coerce_template_parameter_pack): Likewise.
1004         (extract_fnparm_pack): Likewise.
1005         (extract_locals_r): Likewise.
1006         (make_argument_pack): Likewise.
1007         (tsubst_argument_pack): Likewise.
1008         (lookup_init_capture_pack): Likewise.
1009         (type_unification_real): Likewise.
1010         (unify_pack_expansion): Likewise.
1011         (tsubst_initializer_list): Likewise.
1013 2022-05-10  Patrick Palka  <ppalka@redhat.com>
1015         * cp-tree.h (PACK_EXPANSION_CHECK): Define.
1016         (PACK_EXPANSION_PATTERN): Use PACK_EXPANSION_CHECK.
1017         (SET_PACK_EXPANSION_PATTERN): Likewise.
1018         (PACK_EXPANSION_PARAMETER_PACKS): Likewise.
1019         (PACK_EXPANSION_EXTRA_ARGS): Likewise.
1020         (PACK_EXPANSION_LOCAL_P): Likewise.
1021         (PACK_EXPANSION_SIZEOF_P): Likewise.
1022         (PACK_EXPANSION_AUTO_P): Likewise.
1023         (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): Likewise.
1024         (ARGUMENT_PACK_CHECK): Define.
1025         (ARGUMENT_PACK_ARGS): Use ARGUMENT_PACK_CHECK.
1026         (SET_ARGUMENT_PACK_ARGS): Likewise.
1027         * parser.cc (cp_parser_sizeof_pack): Check for error_mark_node
1028         before setting PACK_EXPANSION_SIZEOF_P.
1030 2022-05-10  Nathan Sidwell  <nathan@acm.org>
1032         * cp-tree.h (enum module_kind_bits): Disambiguate purview,
1033         attach, named module vs header-unit.
1034         (global_purview_p, not_module_p): Delete.
1035         (named_module_p): New.
1036         (header_module_p, module_purview_p): Adjust.
1037         (module_attach_p, named_module_purview_p): New.
1038         * decl.cc (duplicate_decls): Adjust.
1039         * module.cc (declare_module, preprocessed_module): Adjust.
1040         * name-lookup.cc (init_global_partition): Adjust.
1041         (get_fixed_binding_slot, pushdecl): Adjust.
1042         * parser.cc (cp_parser_module_declaration): Adjust.
1043         (cp_parser_import_declaration, cp_parser_declaration): Adjust.
1045 2022-05-10  Jason Merrill  <jason@redhat.com>
1047         PR c++/105529
1048         * decl.cc (maybe_return_this): Replace...
1049         (finish_constructor_body, finish_destructor_body): ...these.
1050         (finish_function_body): Call it.
1051         * optimize.cc (build_delete_destructor_body): Call it.
1052         * cp-tree.h (maybe_return_this): Declare.
1054 2022-05-09  Marek Polacek  <polacek@redhat.com>
1056         PR c++/103539
1057         * parser.cc (cp_parser_statement): Constify the in_compound parameter.
1058         Create a modifiable copy.  Allow labels at the end of compound
1059         statements.
1061 2022-05-09  Patrick Palka  <ppalka@redhat.com>
1063         PR c++/105491
1064         * call.cc (field_in_pset): Adjust after next_initializable_field
1065         renaming.
1066         (build_aggr_conv): Likewise.
1067         (convert_like_internal): Likewise.
1068         (type_has_extended_temps): Likewise.
1069         * class.cc (default_init_uninitialized_part): Likewise.
1070         (finish_struct): Likewise.
1071         * constexpr.cc (cx_check_missing_mem_inits): Likewise.
1072         (reduced_constant_expression_p): Use next_subobject_field
1073         instead.
1074         * cp-gimplify.cc (get_source_location_impl_type): Adjust after
1075         next_initializable_field renaming.
1076         (fold_builtin_source_location): Likewise.
1077         * cp-tree.h (next_initializable_field): Rename to ...
1078         (next_aggregate_field): ... this.
1079         (next_subobject_field): Declare.
1080         * decl.cc (next_aggregate_field): Renamed from ...
1081         (next_initializable_field): ... this.  Skip over vptr fields
1082         again.
1083         (next_subobject_field): Define.
1084         (reshape_init_class): Adjust after next_initializable_field
1085         renaming.
1086         * init.cc (build_value_init_noctor): Likewise.
1087         (emit_mem_initializers): Likewise.
1088         * lambda.cc (build_capture_proxy): Likewise.
1089         * method.cc (build_comparison_op): Likewise.
1090         * pt.cc (maybe_aggr_guide): Likewise.
1091         * tree.cc (structural_type_p): Likewise.
1092         * typeck2.cc (split_nonconstant_init_1): Likewise.
1093         (digest_init_r): Likewise.
1095 2022-05-09  Nathan Sidwell  <nathan@acm.org>
1097         * cp-tree.h (DECL_MODULE_KEYED_DECLS_P): Renamed from
1098         DECL_MODULE_ATTACHMENTS_P.
1099         (struct lane_decl_base): Rename module_attached_p to
1100         module_keyed_decls_p.
1101         (maybe_key_decl): Renamed from maybe_attach_decl.
1102         * lambda.cc (record_lambda_scope): Adjust.
1103         * lex.cc (cxx_dup_lang_specific_decl): Adjust.
1104         * module.cc (keyed_map_t, keyed_table): Renamed from attached_map_t,
1105         attached_table.
1106         (enum merge_kind): Rename MK_attached to MK_keyed.
1107         (trees_out::lang_decl_bools): Adjust.
1108         (trees_in::lang_decl_bools): Adjust.
1109         (trees_in::decl_value): Adjust.
1110         (trees_out::get_merge_kind): Adjust.
1111         (trees_out::key_mergeable): Adjust.
1112         (trees_in::key_mergeable): Adjust.
1113         (maybe_key_decl): Rename from maybe_attach_decl.
1114         (direct_import): Adjust.
1115         (fini_modules): Adjust.
1117 2022-05-09  Martin Liska  <mliska@suse.cz>
1119         * cp-gimplify.cc (cp_genericize_r): Use {,UN}LIKELY
1120         macros.
1121         * parser.cc (cp_finalize_omp_declare_simd): Likewise.
1122         (cp_finalize_oacc_routine): Likewise.
1124 2022-05-07  Marek Polacek  <polacek@redhat.com>
1126         PR c++/101833
1127         PR c++/47634
1128         * tree.cc (maybe_adjust_arg_pos_for_attribute): New.
1130 2022-05-06  Jason Merrill  <jason@redhat.com>
1132         * error.cc (decl_to_string): Add show_color parameter.
1133         (subst_to_string): Likewise.
1134         (cp_printer): Pass it.
1135         (type_to_string): Set pp_show_color.
1136         (dump_function_name): Use "fnname" color.
1137         (dump_template_bindings): Use "targs" color.
1138         (struct colorize_guard): New.
1139         (reinit_cxx_pp): Clear pp_show_color.
1141 2022-05-06  Jason Merrill  <jason@redhat.com>
1143         PR c++/105245
1144         PR c++/100111
1145         * constexpr.cc (cxx_eval_store_expression): Reorganize empty base
1146         handling.
1148 2022-05-05  Marek Polacek  <polacek@redhat.com>
1150         PR c++/64679
1151         * parser.cc (cp_parser_parameter_declaration_clause): Maintain
1152         a vector of parameters that haven't been pushed yet.  Push them at the
1153         end of a valid parameter-declaration-clause.
1154         (cp_parser_parameter_declaration_list): Take a new auto_vec parameter.
1155         Do not pushdecl while parsing tentatively when pushdecl-ing a parameter
1156         would result in a hard error.
1157         (cp_parser_cache_defarg): Adjust the call to
1158         cp_parser_parameter_declaration_list.
1160 2022-05-05  Richard Biener  <rguenther@suse.de>
1162         * module.cc (trees_in::core_vals): Remove separate allocation
1163         for REAL_CST.
1165 2022-05-04  Jason Merrill  <jason@redhat.com>
1167         PR c++/104470
1168         * pt.cc (maybe_dependent_member_ref): Handle types.
1169         (tsubst, tsubst_copy): Use it.
1170         (tsubst_aggr_type, instantiate_alias_template): Don't handle
1171         tf_dguide here.
1173 2022-05-04  Patrick Palka  <ppalka@redhat.com>
1175         PR c++/105476
1176         * pt.cc (maybe_aggr_guide): Set processing_template_decl when
1177         partially instantiating the guide's parameter list.
1179 2022-05-04  Marek Polacek  <polacek@redhat.com>
1181         PR c++/64679
1182         * parser.cc (cp_parser_init_declarator): Properly handle a series of
1183         operator() calls, they are not part of an init-declarator.
1185 2022-05-04  Jason Merrill  <jason@redhat.com>
1187         * decl.cc (reshape_init): Shortcut already-reshaped init.
1188          (reshape_init_class): Assert not getting one here.
1190 2022-05-04  Jason Merrill  <jason@redhat.com>
1192         * error.cc (cp_print_error_function): Use %qD.
1193         (function_category): Use %qD.
1195 2022-05-04  Marek Polacek  <polacek@redhat.com>
1197         PR c++/105436
1198         * parser.cc (cp_parser_next_token_ends_template_argument_p): Don't
1199         return true for CPP_GREATER_EQ.
1201 2022-05-04  Jason Merrill  <jason@redhat.com>
1203         * cp-tree.h (struct language_function): Remove x_cdtor_label.
1204         (cdtor_label, LABEL_DECL_CDTOR): Remove.
1205         * constexpr.cc (returns): Don't check LABEL_DECL_CDTOR.
1206         (cxx_eval_constant_expression): Don't call returns.
1207         * decl.cc (check_goto): Don't check cdtor_label.
1208         (start_preparsed_function): And don't set it.
1209         (finish_constructor_body, finish_destructor_body): Remove.
1210         (finish_function_body): Don't call them.
1211         * typeck.cc (check_return_expr): Handle cdtor_returns_this here.
1212         * semantics.cc (finish_return_stmt): Not here.
1214 2022-05-04  Jakub Jelinek  <jakub@redhat.com>
1216         * lambda.cc: Include decl.h.
1217         (maybe_add_lambda_conv_op): Temporarily override deprecated_state to
1218         UNAVAILABLE_DEPRECATED_SUPPRESS.
1220 2022-05-03  Patrick Palka  <ppalka@redhat.com>
1222         PR c++/105351
1223         * cp-tree.h (finish_non_static_data_member): Add defaulted
1224         complain parameter.
1225         * pt.cc (tsubst_copy_and_build): Pass complain to
1226         finish_non_static_data_member.
1227         * semantics.cc (finish_non_static_data_member): Respect complain
1228         parameter.
1229         (finish_qualified_id_expr): Pass complain to
1230         finish_non_static_data_member.
1232 2022-05-02  Jason Merrill  <jason@redhat.com>
1234         * pt.cc (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Copy location.
1235         (do_auto_deduction): Use expr location.
1237 2022-05-02  Jason Merrill  <jason@redhat.com>
1239         * class.cc (maybe_note_name_used_in_class): Note in all enclosing
1240         classes.  Remember location of use.
1241         (note_name_declared_in_class): Adjust.
1243 2022-05-02  Marek Polacek  <polacek@redhat.com>
1245         * cp-tree.h (uses_template_parms): Adjust declaration.
1246         * pt.cc (uses_template_parms): Return bool.  Use a RAII sentinel.
1248 2022-05-02  Richard Biener  <rguenther@suse.de>
1250         * constexpr.cc (fold_simple_1): Use CASE_CONVERT.
1251         * cp-gimplify.cc (cp_fold): Likewise.
1252         * pt.cc (tsubst_copy): Likewise.
1254 2022-04-29  Jason Merrill  <jason@redhat.com>
1256         PR c++/91618
1257         PR c++/96604
1258         * friend.cc (do_friend): Call check_explicit_specialization here.
1259         * decl.cc (grokdeclarator): Not here.
1260         * decl2.cc (check_classfn): Or here.
1262 2022-04-29  Jason Merrill  <jason@redhat.com>
1264         PR c++/104470
1265         * cp-tree.h (enum tsubst_flags): Add tf_dguide.
1266         * pt.cc (tsubst_aggr_type): Check it.
1267         (tsubst_baselink, tsubst_copy): Check it.
1268         (maybe_dependent_member_ref): Check it.
1269         (instantiate_alias_template): Handle it.
1270         (build_deduction_guide): Set it.
1272 2022-04-29  Jason Merrill  <jason@redhat.com>
1274         PR c++/82980
1275         * lambda.cc (type_deducible_expression_p): Allow more types.
1277 2022-04-29  Jason Merrill  <jason@redhat.com>
1279         * decl.cc (cp_finish_decl): Only consider auto for vars.
1281 2022-04-29  Marek Polacek  <polacek@redhat.com>
1283         PR c++/67048
1284         * parser.cc (cp_parser_enum_specifier): Warn about empty unnamed enum
1285         only when it's followed by a semicolon.
1287 2022-04-29  Jason Merrill  <jason@redhat.com>
1289         PR c++/80351
1290         * decl.cc (cp_finish_decl): Check completeness of deduced type.
1292 2022-04-29  Jason Merrill  <jason@redhat.com>
1294         PR c++/102987
1295         * error.cc (dump_decl) [USING_DECL]: Respect flags.
1297 2022-04-29  Jason Merrill  <jason@redhat.com>
1299         * error.cc (dump_decl): Check TFF_UNQUALIFIED_NAME.
1301 2022-04-29  Jakub Jelinek  <jakub@redhat.com>
1303         PR c++/104319
1304         * parser.cc (cp_parser_template_argument): Treat >= like C++98 >>
1305         after a type id by setting maybe_type_id and aborting tentative
1306         parse.
1307         (cp_parser_enclosed_template_argument_list): Handle
1308         CPP_GREATER_EQ like misspelled CPP_GREATER CPP_RQ and
1309         CPP_RSHIFT_EQ like misspelled CPP_GREATER CPP_GREATER_EQ
1310         or CPP_RSHIFT CPP_EQ or CPP_GREATER CPP_GREATER CPP_EQ.
1311         (cp_parser_next_token_ends_template_argument_p): Return true
1312         also for CPP_GREATER_EQ and CPP_RSHIFT_EQ.
1314 2022-04-29  Iain Sandoe  <iain@sandoe.co.uk>
1316         PR c++/105426
1317         * coroutines.cc (register_local_var_uses): Allow promotion of unnamed
1318         temporaries to coroutine frame copies.
1320 2022-04-29  Jason Merrill  <jason@redhat.com>
1322         * semantics.cc (check_trait_type): Don't check completeness
1323         of element type of array of unknown bound.
1325 2022-04-29  Jason Merrill  <jason@redhat.com>
1327         PR c++/102651
1328         PR c++/49387
1329         * rtti.cc (get_tinfo_decl_direct): Don't complete_type.
1330         (emit_tinfo_decl): Update tdesc type if needed.
1332 2022-04-29  Zhao Wei Liew  <zhaoweiliew@gmail.com>
1334         PR c++/25689
1335         * call.cc (extract_call_expr): Return a NULL_TREE on failure
1336         instead of asserting.
1337         (build_new_method_call): Suppress -Wparentheses diagnostic for
1338         MODIFY_EXPR.
1339         * semantics.cc (is_assignment_op_expr_p): Add function to check
1340         if an expression is a call to an op= operator expression.
1341         (maybe_convert_cond): Handle the case of a op= operator expression
1342         for the -Wparentheses diagnostic.
1344 2022-04-28  Patrick Palka  <ppalka@redhat.com>
1346         PR c++/105425
1347         * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
1348         DEPENDENT_OPERATOR_TYPE like an empty type.
1350 2022-04-28  Iain Sandoe  <iain@sandoe.co.uk>
1352         PR c++/104051
1353         * coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
1354         non-target expression inputs.
1356 2022-04-28  Iain Sandoe  <iain@sandoe.co.uk>
1358         PR c++/105301
1359         * coroutines.cc (coro_promise_type_found_p): Account for possible
1360         mutliple overloads of the promise return_value() method.
1362 2022-04-28  Iain Sandoe  <iain@sandoe.co.uk>
1364         PR c++/105287
1365         * coroutines.cc (maybe_promote_temps): Ensure generated temporaries
1366         are added to the bind expr.
1367         (add_var_to_bind): Fix local var naming to use portable punctuation.
1368         (register_local_var_uses): Do not add synthetic names to unnamed
1369         temporaries.
1371 2022-04-28  Nathan Sidwell  <nathan@acm.org>
1372             Iain Sandoe  <iain@sandoe.co.uk>
1374         PR c++/103868
1375         * coroutines.cc (finish_co_await_expr): Do not process non-dependent
1376         coroutine expressions at template definition time.
1377         (finish_co_yield_expr): Likewise.
1378         (finish_co_return_stmt): Likewise.
1380 2022-04-28  Marek Polacek  <polacek@redhat.com>
1382         PR c++/90107
1383         * parser.cc (cp_parser_class_specifier_1): Accept :: after a class
1384         definition.
1386 2022-04-27  Jason Merrill  <jason@redhat.com>
1388         * tree.cc (strip_typedefs): Add default argument comments.
1390 2022-04-27  Marek Polacek  <polacek@redhat.com>
1392         PR c++/105398
1393         * pt.cc (uses_template_parms): Return false for any NAMESPACE_DECL.
1395 2022-04-26  Jason Merrill  <jason@redhat.com>
1397         PR c++/102629
1398         * pt.cc (gen_elem_of_pack_expansion_instantiation): Clear
1399         TEMPLATE_TYPE_PARAMETER_PACK on auto.
1401 2022-04-26  Patrick Palka  <ppalka@redhat.com>
1403         PR c++/105386
1404         * semantics.cc (finish_decltype_type): Pass tf_decltype to
1405         instantiate_non_dependent_expr_sfinae.
1407 2022-04-26  Jason Merrill  <jason@redhat.com>
1409         PR c++/104624
1410         * pt.cc (check_for_bare_parameter_packs): Check for lambda
1411         function parameter pack.
1413 2022-04-26  Patrick Palka  <ppalka@redhat.com>
1415         PR c++/105289
1416         PR c++/86193
1417         * pt.cc (process_partial_specialization): Downgrade "partial
1418         specialization isn't more specialized" diagnostic from permerror
1419         to an on-by-default pedwarn.
1420         (unify) <case TEMPLATE_PARM_INDEX>: When substituting into the
1421         NTTP type a second time, use the original type not the
1422         substituted type.
1424 2022-04-25  Marek Polacek  <polacek@redhat.com>
1426         PR c++/105353
1427         * typeck.cc (build_x_shufflevector): Use
1428         instantiation_dependent_expression_p except for the first two
1429         arguments.
1431 2022-04-21  Marek Polacek  <polacek@redhat.com>
1433         * constexpr.cc (cxx_eval_logical_expression): Remove unused
1434         parameter.
1435         (cxx_eval_constant_expression) <case TRUTH_ANDIF_EXPR>,
1436         <case TRUTH_OR_EXPR>: Adjust calls to cxx_eval_logical_expression.
1438 2022-04-21  Marek Polacek  <polacek@redhat.com>
1440         PR c++/105321
1441         * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval
1442         to cxx_eval_constant_expression.
1444 2022-04-20  Ed Catmur  <ed@catmur.uk>
1446         PR c++/104996
1447         * call.cc (compare_ics): When comparing list-initialization
1448         sequences, do not return early.
1450 2022-04-19  Jakub Jelinek  <jakub@redhat.com>
1452         PR c++/105256
1453         * typeck2.cc (process_init_constructor_array,
1454         process_init_constructor_record, process_init_constructor_union): Move
1455         CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag from CONSTRUCTOR elements to the
1456         containing CONSTRUCTOR.
1458 2022-04-15  Marek Polacek  <polacek@redhat.com>
1460         PR c++/105268
1461         * parser.cc (cp_parser_placeholder_type_specifier): Return
1462         error_mark_node when trying to build up a constrained parameter in
1463         a default argument.
1465 2022-04-15  Jason Merrill  <jason@redhat.com>
1467         PR c++/102804
1468         * decl.cc (grokdeclarator): Drop typedef used with 'unsigned'.
1470 2022-04-15  Jason Merrill  <jason@redhat.com>
1472         PR c++/102987
1473         * error.cc (dump_expr): Handle USING_DECL.
1474         [VIEW_CONVERT_EXPR]: Just look through location wrapper.
1476 2022-04-14  Jason Merrill  <jason@redhat.com>
1478         PR c++/104646
1479         * constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
1480         checks for defaulted ctors.
1482 2022-04-14  Jason Merrill  <jason@redhat.com>
1484         PR c++/82980
1485         * lambda.cc (type_deducible_expression_p): New.
1486         (lambda_capture_field_type): Check it.
1488 2022-04-14  Jason Merrill  <jason@redhat.com>
1490         PR c++/65211
1491         * pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.
1493 2022-04-14  Jason Merrill  <jason@redhat.com>
1495         PR c++/97219
1496         * name-lookup.cc (dependent_local_decl_p): New.
1497         * cp-tree.h (dependent_local_decl_p): Declare.
1498         * semantics.cc (finish_call_expr): Use it.
1499         * pt.cc (tsubst_arg_types): Also substitute default args
1500         for local externs.
1502 2022-04-14  Jason Merrill  <jason@redhat.com>
1504         PR c++/101698
1505         * pt.cc (tsubst_baselink): Also check dependent optype.
1507 2022-04-14  Jason Merrill  <jason@redhat.com>
1509         PR c++/101442
1510         * decl.cc (cp_finish_decl): Don't pass decl to push_cleanup.
1511         * init.cc (perform_member_init): Likewise.
1512         * semantics.cc (push_cleanup): Adjust comment.
1514 2022-04-13  Jason Merrill  <jason@redhat.com>
1516         PR c++/105245
1517         PR c++/100111
1518         * constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
1519         as needed in empty base handling.
1521 2022-04-13  Jakub Jelinek  <jakub@redhat.com>
1523         PR c++/105233
1524         * decl2.cc (cp_check_const_attributes): For aligned attribute
1525         pass manifestly_const_eval=true to fold_non_dependent_expr.
1527 2022-04-13  Marek Polacek  <polacek@redhat.com>
1529         PR c++/97296
1530         * call.cc (direct_reference_binding): strip_top_quals when creating
1531         a ck_qual.
1533 2022-04-12  Jason Merrill  <jason@redhat.com>
1535         PR c++/104669
1536         * decl.cc (decls_match): Compare versions even if not recording.
1537         (duplicate_decls): Propagate attributes to alias.
1538         * decl2.cc (find_last_decl): Give up if versioned.
1540 2022-04-12  Jason Merrill  <jason@redhat.com>
1542         PR c++/102071
1543         * init.cc (build_new_1): Check array_p for alignment.
1545 2022-04-12  Patrick Palka  <ppalka@redhat.com>
1547         PR c++/103105
1548         * pt.cc (build_extra_args): Call preserve_args.
1550 2022-04-12  Jason Merrill  <jason@redhat.com>
1552         PR c++/104142
1553         * decl.cc (check_initializer): Check TREE_SIDE_EFFECTS.
1555 2022-04-12  Jason Merrill  <jason@redhat.com>
1557         PR c++/105223
1558         PR c++/92918
1559         * class.cc (finish_struct): Always using op=.
1561 2022-04-11  Jason Merrill  <jason@redhat.com>
1563         PR c++/98249
1564         * call.cc (build_operator_new_call): Just look in ::.
1566 2022-04-11  Alexandre Oliva  <oliva@adacore.com>
1568         * constexpr.cc (cxx_eval_call_expression): Disregard dtor
1569         result.
1571 2022-04-11  Alexandre Oliva  <oliva@adacore.com>
1573         * semantics.cc (set_cleanup_locs): Propagate locus to call
1574         wrapped in cast-to-void.
1576 2022-04-11  Jason Merrill  <jason@redhat.com>
1578         PR c++/100370
1579         * init.cc (warn_placement_new_too_small): Check deref.
1581 2022-04-09  Jason Merrill  <jason@redhat.com>
1583         PR c++/105191
1584         PR c++/92385
1585         * tree.cc (build_vec_init_elt): Do {}-init for aggregates.
1586         * constexpr.cc (cxx_eval_vec_init): Only treat {} as value-init
1587         for non-aggregate types.
1588         (build_vec_init_expr): Also check constancy of explicit
1589         initializer elements.
1591 2022-04-09  Jason Merrill  <jason@redhat.com>
1593         PR c++/91618
1594         PR c++/96604
1595         * name-lookup.cc (set_decl_namespace): Set
1596         DECL_IMPLICIT_INSTANTIATION if no non-template match.
1597         * pt.cc (check_explicit_specialization): Check it.
1598         * decl2.cc (check_classfn): Call it.
1600 2022-04-07  Patrick Palka  <ppalka@redhat.com>
1602         PR c++/99479
1603         * name-lookup.cc (name_lookup::using_queue): Change to an
1604         auto_vec (with 16 elements of internal storage).
1605         (name_lookup::queue_namespace): Change return type to void,
1606         take queue parameter by reference and adjust function body
1607         accordingly.
1608         (name_lookup::do_queue_usings): Inline into ...
1609         (name_lookup::queue_usings): ... here.  As in queue_namespace.
1610         (name_lookup::search_unqualified): Don't make queue static,
1611         remove length variable, and adjust function body accordingly.
1613 2022-04-07  Jakub Jelinek  <jakub@redhat.com>
1615         PR tree-optimization/102586
1616         * cp-objcp-common.h (cp_classtype_as_base): Declare.
1617         (LANG_HOOKS_CLASSTYPE_AS_BASE): Redefine.
1618         * cp-objcp-common.cc (cp_classtype_as_base): New function.
1620 2022-04-07  Jason Merrill  <jason@redhat.com>
1622         PR c++/101051
1623         * decl.cc (grokdeclarator): Reject conversion with trailing return
1624         sooner.
1626 2022-04-07  Jason Merrill  <jason@redhat.com>
1628         PR c++/101717
1629         * lambda.cc (lambda_expr_this_capture): Check all enclosing
1630         lambdas for completeness.
1632 2022-04-07  Jason Merrill  <jason@redhat.com>
1634         PR c++/105187
1635         * typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
1636         vectors.
1638 2022-04-06  Jakub Jelinek  <jakub@redhat.com>
1640         PR c++/104668
1641         * decl2.cc (splice_template_attributes): Return NULL if *p is
1642         error_mark_node.
1643         (cplus_decl_attributes): Return early if attributes is
1644         error_mark_node.  Don't check that later.
1646 2022-04-06  Patrick Palka  <ppalka@redhat.com>
1648         PR c++/105143
1649         * pt.cc (do_class_deduction): Check complain before attempting
1650         to issue a -Wctad-maybe-unsupported warning.
1652 2022-04-06  Jason Merrill  <jason@redhat.com>
1654         PR c++/104702
1655         * init.cc (build_vec_init): Use a reference for the result.
1657 2022-04-06  Jason Merrill  <jason@redhat.com>
1659         PR c++/100608
1660         * name-lookup.cc (check_local_shadow): Use -Wshadow=local
1661         if exactly one of 'old' and 'decl' is a type.
1663 2022-04-05  Jason Merrill  <jason@redhat.com>
1665         PR c++/103852
1666         DR 1286
1667         * pt.cc (do_class_deduction): Pedwarn for renaming alias in C++17.
1669 2022-04-05  Jason Merrill  <jason@redhat.com>
1671         PR c++/101677
1672         * name-lookup.h (struct cp_binding_level): Add requires_expression
1673         bit-field.
1674         * parser.cc (cp_parser_requires_expression): Set it.
1675         (synthesize_implicit_template_parm): Check it.
1677 2022-04-04  Jason Merrill  <jason@redhat.com>
1679         PR c++/101894
1680         * decl.cc (duplicate_decls): Copy DECL_FRIEND_CONTEXT.
1682 2022-04-04  Jason Merrill  <jason@redhat.com>
1684         PR c++/103852
1685         DR 1286
1686         * pt.cc (get_underlying_template): Compare default template args.
1688 2022-04-03  Benno Evers  <benno.evers@tenzir.com>
1689             Iain Sandoe  <iain@sandoe.co.uk>
1691         PR c++/103328
1692         * coroutines.cc (morph_fn_to_coro): Reset
1693         current_binding_level->blocks.
1695 2022-04-01  Jason Merrill  <jason@redhat.com>
1697         Revert:
1698         2022-03-31  Jason Merrill  <jason@redhat.com>
1700         PR c++/96645
1701         * parser.cc (cp_parser_early_parsing_nsdmi): New.
1702         (cp_parser_member_declaration): Call it.
1704 2022-04-01  Jason Merrill  <jason@redhat.com>
1706         Revert:
1707         2022-03-24  Jason Merrill  <jason@redhat.com>
1709         PR c++/96645
1710         * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
1711         * class.cc (type_has_default_ctor_to_be_synthesized): New.
1712         (type_has_non_user_provided_default_constructor_1): Support it.
1713         (type_has_non_user_provided_default_constructor): Now a wrapper.
1714         * method.cc (complain_about_unparsed_dmi): New.
1715         (constructible_expr): Call it.
1717 2022-04-01  Patrick Palka  <ppalka@redhat.com>
1719         PR c++/105110
1720         * pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
1721         the argument type of an NTTP before deducing from it.
1723 2022-03-31  Jason Merrill  <jason@redhat.com>
1725         PR c++/96645
1726         * parser.cc (cp_parser_early_parsing_nsdmi): New.
1727         (cp_parser_member_declaration): Call it.
1729 2022-03-30  Patrick Palka  <ppalka@redhat.com>
1731         PR c++/100474
1732         * constraint.cc (diagnose_trait_expr): Handle all remaining
1733         traits appropriately.  Remove default case.
1735 2022-03-30  Marek Polacek  <polacek@redhat.com>
1737         PR c++/93280
1738         PR c++/104583
1739         * init.cc (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P to in_ctor.
1741 2022-03-30  Jakub Jelinek  <jakub@redhat.com>
1743         PR c++/105092
1744         * pt.cc (tsubst_omp_clause_decl): When handling iterators, set
1745         DECL_CONTEXT of the iterator var to current_function_decl and
1746         call pushdecl.
1748 2022-03-30  Jakub Jelinek  <jakub@redhat.com>
1750         PR c++/105061
1751         * parser.cc (cp_parser_template_introduction): If member_p, temporarily
1752         clear parser->colon_corrects_to_scope_p around tentative parsing of
1753         nested name specifier.
1755 2022-03-28  Jason Merrill  <jason@redhat.com>
1757         * pt.cc (determine_specialization): Add comment.
1759 2022-03-28  Patrick Palka  <ppalka@redhat.com>
1761         PR c++/105067
1762         * pt.cc (finish_concept_definition): Check that a concept is
1763         declared with exactly one template parameter list.
1765 2022-03-28  Patrick Palka  <ppalka@redhat.com>
1767         PR c++/105064
1768         * constraint.cc (maybe_substitute_reqs_for): Don't assume
1769         DECL_TEMPLATE_INFO is available.
1771 2022-03-28  Jason Merrill  <jason@redhat.com>
1773         PR c++/105003
1774         PR c++/104008
1775         PR c++/102869
1776         * pt.cc (complex_alias_template_r): walk_tree callback, replacing
1777         uses_all_template_parms_r, complex_pack_expansion_r.
1778         (complex_alias_template_p): Adjust.
1779         * tree.cc (strip_typedefs): Revert r12-7710 change.
1781 2022-03-28  Jason Merrill  <jason@redhat.com>
1783         PR c++/102071
1784         * init.cc (build_new_1): Include cookie in alignment.  Omit
1785         constexpr wrapper from alloc_call.
1787 2022-03-28  Jason Merrill  <jason@redhat.com>
1789         PR c++/103291
1790         * name-lookup.cc (push_local_extern_decl_alias): Call
1791         determine_visibility.
1793 2022-03-28  Jason Merrill  <jason@redhat.com>
1795         PR c++/102123
1796         * pt.cc (tsubst_copy): Use make_unbound_class_template for rewriting
1797         a type template reference.
1799 2022-03-28  Jason Merrill  <jason@redhat.com>
1801         PR c++/103968
1802         * pt.cc (value_dependent_expression_p): Check
1803         has_value_dependent_address for conversion to reference.
1805 2022-03-28  Jason Merrill  <jason@redhat.com>
1807         PR c++/103943
1808         * pt.cc (tsubst_qualified_id): Handle getting SCOPE_REF from
1809         tsubst_baselink.
1810         (instantiation_dependent_scope_ref_p): Check dependent_scope_p.
1812 2022-03-28  Jason Merrill  <jason@redhat.com>
1814         PR c++/102045
1815         * call.cc (make_base_init_ok): Call make_used.
1817 2022-03-28  Jason Merrill  <jason@redhat.com>
1819         PR c++/104847
1820         * mangle.cc (write_expression): Don't write a union designator when
1821         undigested.
1823 2022-03-28  Jason Merrill  <jason@redhat.com>
1825         PR c++/99445
1826         PR c++/103769
1827         * tree.cc (strip_typedefs): Use build_distinct_type_copy.
1829 2022-03-26  Patrick Palka  <ppalka@redhat.com>
1831         PR c++/105050
1832         * constexpr.cc (potential_constant_expression_1) <case IF_STMT>:
1833         Clarify error message when a if-stmt is non-constant because its
1834         branches are non-constant.
1836 2022-03-26  Patrick Palka  <ppalka@redhat.com>
1838         PR c++/103455
1839         * call.cc (add_builtin_candidate) <case MEMBER_REF>: Test
1840         CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
1842 2022-03-26  Jakub Jelinek  <jakub@redhat.com>
1844         * parser.cc (cp_parser_postfix_expression)
1845         <case RID_BILTIN_CONVERTVECTOR, case RID_BUILTIN_BIT_CAST>: Don't
1846         return cp_build_{vec,convert,bit_cast} result right away, instead
1847         set postfix_expression to it and break.
1849 2022-03-25  Marek Polacek  <polacek@redhat.com>
1851         PR c++/104944
1852         * typeck.cc (cxx_sizeof_or_alignof_type): Diagnose alignof(void).
1853         (cxx_alignas_expr): Call cxx_sizeof_or_alignof_type with
1854         complain == true.
1856 2022-03-24  Marek Polacek  <polacek@redhat.com>
1858         PR c++/104284
1859         * decl.cc (check_initializer): Don't call build_aggr_init in
1860         a template.
1862 2022-03-24  Jason Merrill  <jason@redhat.com>
1864         PR c++/96645
1865         * cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
1866         * class.cc (type_has_default_ctor_to_be_synthesized): New.
1867         (type_has_non_user_provided_default_constructor_1): Support it.
1868         (type_has_non_user_provided_default_constructor): Now a wrapper.
1869         * method.cc (complain_about_unparsed_dmi): New.
1870         (constructible_expr): Call it.
1872 2022-03-24  Marek Polacek  <polacek@redhat.com>
1874         PR c++/102990
1875         * typeck2.cc (massage_init_elt): Avoid folding CONSTRUCTORs.
1877 2022-03-24  Patrick Palka  <ppalka@redhat.com>
1879         PR c++/104620
1880         * call.cc (build_over_call): Use cxx_constant_value_sfinae
1881         instead of cxx_constant_value to evaluate a consteval call.
1882         * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter
1883         and pass it to cxx_eval_outermost_constant_expr.
1884         * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter.
1885         * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to
1886         cxx_constant_value_sfinae.
1888 2022-03-24  Jakub Jelinek  <jakub@redhat.com>
1890         PR c++/104994
1891         * constexpr.cc (cxx_eval_constant_expression): Don't diagnose passing
1892         through extern thread_local declarations.  Change wording from
1893         declaration to definition.
1894         (potential_constant_expression_1): Don't diagnose extern thread_local
1895         declarations.  Change wording from declared to defined.
1896         * decl.cc (start_decl): Likewise.
1898 2022-03-23  Jason Merrill  <jason@redhat.com>
1900         PR c++/103337
1901         * decl.cc (reshape_single_init): New.
1902         (reshape_init_class): Use it.
1904 2022-03-23  Jason Merrill  <jason@redhat.com>
1906         PR c++/105006
1907         * name-lookup.cc (lookup_using_decl): Check that scope is
1908         a dependent type before looking for dependent using.
1910 2022-03-23  Jason Merrill  <jason@redhat.com>
1912         PR c++/105006
1913         * name-lookup.cc (lookup_using_decl): Set DECL_DEPENDENT_P if lookup
1914         finds a dependent using.
1916 2022-03-21  Jason Merrill  <jason@redhat.com>
1918         PR c++/58646
1919         * init.cc (build_vec_init): Check for vla element type.
1921 2022-03-21  Jason Merrill  <jason@redhat.com>
1923         PR c++/103337
1924         PR c++/102740
1925         PR c++/103299
1926         PR c++/102538
1927         * decl.cc (reshape_init_class): Avoid looking for designator
1928         after we found it.
1929         (reshape_init_r): Keep looking for designator.
1931 2022-03-21  Jason Merrill  <jason@redhat.com>
1933         PR c++/101767
1934         * decl.cc (reshape_init_class): Back out of anon struct
1935         if a designator doesn't match.
1937 2022-03-18  Jason Merrill  <jason@redhat.com>
1939         PR c++/92918
1940         PR c++/104476
1941         * class.cc (add_method): Avoid adding the same used function twice.
1942         (handle_using_decl): Don't add_method.
1943         (finish_struct): Don't using op= if we have one already.
1944         (maybe_push_used_methods): New.
1945         * semantics.cc (finish_member_declaration): Call it.
1946         * name-lookup.cc (diagnose_name_conflict): No longer static.
1947         (push_class_level_binding): Revert 92918 patch, limit
1948         to dependent using.
1949         * cp-tree.h: Adjust.
1951 2022-03-18  Jakub Jelinek  <jakub@redhat.com>
1953         PR c++/104568
1954         * init.cc (build_new_constexpr_heap_type): Remove FULL_SIZE
1955         argument and its handling, instead add ITYPE2 argument.  Only
1956         support COOKIE_SIZE != NULL.
1957         (build_new_1): If size is 0, change it to 0 * outer_nelts if
1958         outer_nelts is non-NULL.  Pass type rather than elt_type to
1959         maybe_wrap_new_for_constexpr.
1960         * constexpr.cc (build_new_constexpr_heap_type): New function.
1961         (cxx_eval_constant_expression) <case CONVERT_EXPR>:
1962         If elt_size is zero sized type, try to recover outer_nelts from
1963         the size argument to operator new/new[] and pass that as
1964         arg_size to build_new_constexpr_heap_type.  Pass ctx,
1965         non_constant_p and overflow_p to that call too.
1967 2022-03-18  Marek Polacek  <polacek@redhat.com>
1969         PR c++/104008
1970         * tree.cc (strip_typedefs): Don't strip an alias template when
1971         doing so would result in losing a parameter pack.
1973 2022-03-16  Patrick Palka  <ppalka@redhat.com>
1975         * search.cc (lookup_member): Simplify by handling all values
1976         of protect together in the ambiguous case.  Don't modify protect.
1978 2022-03-16  Patrick Palka  <ppalka@redhat.com>
1980         PR c++/96780
1981         * cp-gimplify.cc (cp_fold) <case CALL_EXPR>: Fold calls to
1982         std::move/forward and other cast-like functions into simple
1983         casts.
1985 2022-03-15  Patrick Palka  <ppalka@redhat.com>
1987         PR c++/103177
1988         * search.cc (lookup_field_info::errstr): Remove this data
1989         member.
1990         (lookup_field_r): Don't set errstr.
1991         (lookup_member): Check ambiguity before checking access.
1992         Simplify accordingly after errstr removal.  Exit early upon
1993         error or empty result.
1995 2022-03-15  Jakub Jelinek  <jakub@redhat.com>
1997         PR c++/104623
1998         * parser.cc (cp_parser_skip_to_pragma_eol): Don't purge any tokens.
2000 2022-03-14  Jakub Jelinek  <jakub@redhat.com>
2002         PR tree-optimization/102586
2003         * call.cc (build_cxx_call): Diagnose __builtin_clear_padding where
2004         first argument's type is pointer to non-trivially-copyable type unless
2005         it is address of a variable or parameter.
2007 2022-03-12  Patrick Palka  <ppalka@redhat.com>
2009         PR c++/104641
2010         * cp-tree.h (tsubst_flags::tf_tst_ok): New flag.
2011         * decl.cc (make_typename_type): Allow a typename-specifier to
2012         resolve to a template when tf_tst_ok, in which case return
2013         a CTAD placeholder for the template.
2014         * pt.cc (tsubst_decl) <case VAR_DECL>: Set tf_tst_ok when
2015         substituting the type.
2016         (tsubst): Clear tf_tst_ok and remember if it was set.
2017         <case TYPENAME_TYPE>: Pass tf_tst_ok to make_typename_type
2018         appropriately.
2019         (tsubst_copy) <case CAST_EXPR>: Set tf_tst_ok when substituting
2020         the type.
2021         (tsubst_copy_and_build) <case CAST_EXPR>: Likewise.
2022         <case CONSTRUCTOR>: Likewise.
2024 2022-03-12  Patrick Palka  <ppalka@redhat.com>
2026         PR c++/104622
2027         * call.cc (missing_conversion_p): Define.
2028         (add_candidates): Use it.
2029         * pt.cc (check_non_deducible_conversion): Change type of strict
2030         parameter to unification_kind_t and directly test for DEDUCE_CALL.
2032 2022-03-12  Patrick Palka  <ppalka@redhat.com>
2034         PR c++/104527
2035         * constraint.cc (normalize_atom): Set
2036         ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P appropriately.
2037         (get_mapped_args):  Make static, adjust parameters.  Always
2038         return a vector whose depth corresponds to the template depth of
2039         the context of the atomic constraint expression.  Micro-optimize
2040         by passing false as exact to safe_grow_cleared and by collapsing
2041         a multi-level depth-one argument vector.
2042         (satisfy_atom): Adjust call to get_mapped_args and
2043         diagnose_atomic_constraint.
2044         (diagnose_atomic_constraint): Replace map parameter with an args
2045         parameter.
2046         * cp-tree.h (ATOMIC_CONSTR_EXPR_FROM_CONCEPT_P): Define.
2047         (get_mapped_args): Remove declaration.
2049 2022-03-12  Patrick Palka  <ppalka@redhat.com>
2050             Jason Merrill  <jason@redhat.com>
2052         PR c++/98644
2053         * constexpr.cc (mark_non_constant): Define, split out from ...
2054         (cxx_eval_outermost_constant_expr): ... here.
2055         (maybe_constant_value): Use it.
2057 2022-03-12  Patrick Palka  <ppalka@redhat.com>
2059         * semantics.cc (finish_unary_fold_expr): Use input_location
2060         instead of UNKNOWN_LOCATION.
2061         (finish_binary_fold_expr): Likewise.
2063 2022-03-12  Thomas Schwinge  <thomas@codesourcery.com>
2065         PR other/65095
2066         * semantics.cc (handle_omp_array_sections_1)
2067         (cp_oacc_check_attachments): Call 'user_omp_clause_code_name'
2068         instead of 'c_omp_map_clause_name'.
2070 2022-03-10  Marek Polacek  <polacek@redhat.com>
2072         PR c++/104608
2073         * parser.cc (cp_parser_template_name): Repeat lookup of
2074         TYPE_DECLs.
2076 2022-03-10  Marek Polacek  <polacek@redhat.com>
2078         PR c++/104752
2079         * semantics.cc (finish_compound_literal): Disallow auto{x} for
2080         is_constrained_auto.
2081         * typeck2.cc (build_functional_cast_1): Likewise.
2083 2022-03-10  Marek Polacek  <polacek@redhat.com>
2085         PR c++/104846
2086         * decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
2087         data member errors.
2089 2022-03-10  Jakub Jelinek  <jakub@redhat.com>
2091         PR c++/103460
2092         * decl.cc (grok_op_properties): Allow variadic operator[] for
2093         C++23.
2095 2022-03-10  Roger Sayle  <roger@nextmovesoftware.com>
2097         PR c++/95999
2098         * decl.cc (finish_enum_value_list): If VALUE isn't an INTEGER_CST
2099         consider it to be zero (i.e. treat it like error_mark_node).
2100         (build_enumerator): Likewise, if PREV_VALUE isn't an INTEGER_CST,
2101         set VALUE to error_mark_node.
2103 2022-03-10  Roger Sayle  <roger@nextmovesoftware.com>
2105         PR c++/39751
2106         * parser.cc (cp_parser_late_parsing_for_member): Confirm the token
2107         stream hasn't been purged before processing DECL_PENDING_INLINE.
2109 2022-03-09  Patrick Palka  <ppalka@redhat.com>
2111         PR c++/104823
2112         * except.cc (build_noexcept_spec): Strengthen dependence check
2113         to instantiation_dependent_expression_p.
2114         * parser.cc (cp_parser_parenthesized_expression_list_elt):
2115         Remove fold_expr_p parameter, and don't call
2116         instantiate_non_dependent_expr.
2117         (cp_parser_parenthesized_expression_list): Adjust accordingly.
2118         * pt.cc (expand_integer_pack): Strengthen dependence check
2119         to instantiation_dependent_expression_p.
2120         (instantiate_non_dependent_expr_internal): Adjust comment.
2121         (instantiate_non_dependent_expr_sfinae): Likewise.  Drop
2122         the potentially-constant check, and relax and turn the
2123         dependence check into a checking assert.
2124         (instantiate_non_dependent_or_null): Adjust comment.
2125         * semantics.cc (finish_decltype_type): Keep
2126         processing_template_decl cleared after calling
2127         instantiate_non_dependent_expr_sfinae.
2129 2022-03-09  Patrick Palka  <ppalka@redhat.com>
2131         PR c++/102137
2132         PR c++/87820
2133         * cp-tree.h (is_copy_initialization): Declare.
2134         * decl.cc (cp_finish_decl): Set LOOKUP_ONLYCONVERTING
2135         when is_copy_initialization is true.
2136         * init.cc (build_aggr_init): Split out copy-initialization
2137         check into ...
2138         (is_copy_initialization): ... here.
2139         * pt.cc (instantiate_decl): Pass 0 instead of
2140         LOOKUP_ONLYCONVERTING as flags to cp_finish_decl.
2142 2022-03-09  Patrick Palka  <ppalka@redhat.com>
2144         PR c++/65396
2145         * cp-tree.h (merge_default_template_args): Declare.
2146         * decl.cc (merge_default_template_args): Define, factored out
2147         from redeclare_class_template.
2148         (duplicate_decls): Use it when merging member function template
2149         and free function declarations.
2150         * pt.cc (redeclare_class_template): Factor out default argument
2151         merging logic into merge_default_template_args.  Improve location
2152         of a note when there's a template parameter kind mismatch.
2154 2022-03-09  Jakub Jelinek  <jakub@redhat.com>
2156         PR c/104711
2157         * constexpr.cc (cxx_eval_check_shift_p): Use TYPE_OVERFLOW_WRAPS
2158         instead of TYPE_UNSIGNED.
2159         * typeck.cc (cp_build_binary_op): Don't emit
2160         -Wshift-negative-value warning if TYPE_OVERFLOW_WRAPS.
2162 2022-03-08  Roger Sayle  <roger@nextmovesoftware.com>
2164         PR c++/96440
2165         * decl.cc (start_decl): Defend against prefix_attributes being
2166         error_mark_node.
2168 2022-03-08  Roger Sayle  <roger@nextmovesoftware.com>
2170         PR c++/96437
2171         * parser.cc (synthesize_implicit_template_parm): Check that
2172         TREE_VALUE (new_parm) isn't error_mark_node before setting its
2173         DECL_VIRTUAL_P.
2175 2022-03-08  Roger Sayle  <roger@nextmovesoftware.com>
2177         PR c++/96329
2178         * parser.cc (cp_parser_linkage_specification): Treat the case where
2179         linkage is error_mark_node as "invalid linkage-specification".
2181 2022-03-08  Marek Polacek  <polacek@redhat.com>
2183         PR c++/104108
2184         * pt.cc (convert_nontype_argument): Recompute
2185         value_dependent_expression_p after build_converted_constant_expr.
2187 2022-03-08  Marek Polacek  <polacek@redhat.com>
2189         * decl2.cc (is_late_template_attribute): Do not defer attribute
2190         unavailable.
2191         * pt.cc (tsubst_enum): Set TREE_UNAVAILABLE.
2193 2022-03-08  Jakub Jelinek  <jakub@redhat.com>
2195         PR c++/104806
2196         * search.cc (lookup_field_fuzzy_info::fuzzy_lookup_field): Ignore
2197         identifiers with space at the end.
2199 2022-03-07  Jason Merrill  <jason@redhat.com>
2201         PR c++/104618
2202         * decl2.cc (mark_single_function): Look through parens and location
2203         wrapper.
2204         * typeck.cc (cp_build_addr_expr_1): Not here.
2206 2022-03-07  Jakub Jelinek  <jakub@redhat.com>
2208         * parser.cc (cp_parser_omp_clause_map): Add missing space in string
2209         literal.
2211 2022-03-07  Jakub Jelinek  <jakub@redhat.com>
2213         * cvt.cc: Fix up duplicated word issue in a comment.
2214         * pt.cc: Likewise.
2215         * module.cc: Likewise.
2216         * coroutines.cc: Likewise.
2218 2022-03-04  Nathan Sidwell  <nathan@acm.org>
2220         * mangle.cc (is_std_substitution): Check global module.
2221         (is_std_substitution_char): Return bool.
2223 2022-03-04  Nathan Sidwell  <nathan@acm.org>
2225         * cp-tree.h (mangle_identifier): Replace with ...
2226         (mangle_module_component): ... this.
2227         * mangle.cc (dump_substitution_candidates): Adjust.
2228         (add_substitution): Likewise.
2229         (find_substitution): Likewise.
2230         (unmangled_name_p): Likewise.
2231         (mangle_module_substitution): Reimplement.
2232         (mangle_module_component): New.
2233         (write_module, maybe_write_module): Adjust.
2234         (write_name): Drop modules here.
2235         (write_unqualified): Do them here instead.
2236         (mangle_global_init): Adjust.
2237         * module.cc (module_state::mangle): Adjust.
2238         (mangle_module): Likewise.
2239         (get_originating_module): Adjust.
2241 2022-02-28  Marek Polacek  <polacek@redhat.com>
2243         PR c++/104682
2244         * cp-tree.h (build_enumerator): Adjust.
2245         * decl.cc (finish_enum): Make it return the new decl.
2246         * pt.cc (tsubst_enum): Propagate TREE_DEPRECATED and TREE_UNAVAILABLE.
2248 2022-02-28  Marek Polacek  <polacek@redhat.com>
2250         PR c++/104667
2251         * decl2.cc (is_late_template_attribute): Cope with a decl without
2252         a type.
2254 2022-02-27  Jason Merrill  <jason@redhat.com>
2256         PR c++/104618
2257         * typeck.cc (cp_build_addr_expr_1): Also
2258         maybe_undo_parenthesized_ref.
2260 2022-02-24  Martin Liska  <mliska@suse.cz>
2262         * pt.cc (defarg_insts_for): Use braces for subobject.
2264 2022-02-18  Patrick Palka  <ppalka@redhat.com>
2266         PR c++/94944
2267         * pt.cc (maybe_instantiate_noexcept): For non-static member
2268         functions, set current_class_ptr/ref to the specialized 'this'
2269         instead.
2271 2022-02-17  Jason Merrill  <jason@redhat.com>
2273         PR c++/104539
2274         * pt.cc (mark_decl_instantiated): Don't clear DECL_COMDAT.
2276 2022-02-17  Jason Merrill  <jason@redhat.com>
2278         PR c++/90451
2279         * decl2.cc (mark_single_function): New.
2280         * cp-tree.h: Declare it.
2281         * typeck.cc (cp_build_addr_expr_1): mark_used when making a PMF.
2282         * semantics.cc (finish_qualified_id_expr): Not here.
2283         (finish_id_expression_1): Or here.
2284         (finish_decltype_type): Call mark_single_function.
2285         * cvt.cc (convert_to_void): And here.
2286         * pt.cc (convert_nontype_argument): And here.
2287         * init.cc (build_offset_ref): Adjust assert.
2289 2022-02-17  Patrick Palka  <ppalka@redhat.com>
2291         PR c++/104565
2292         * semantics.cc (finish_compound_literal): Don't perform
2293         non-dependent expr folding before calling check_narrowing.
2295 2022-02-16  Patrick Palka  <ppalka@redhat.com>
2297         PR c++/104507
2298         * constexpr.cc (potential_constant_expression_1)
2299         <case NON_DEPENDENT_EXPR>: Return false instead of recursing.
2300         Assert tf_error isn't set.
2302 2022-02-15  Jason Merrill  <jason@redhat.com>
2304         PR c++/104107
2305         PR c++/95036
2306         * pt.cc (coerce_template_template_parms): Take full parms.
2307         Avoid adding too much of outer_args.
2308         (coerce_template_template_parm): Adjust.
2309         (template_template_parm_bindings_ok_p): Adjust.
2310         (convert_template_argument): Adjust.
2312 2022-02-14  Jakub Jelinek  <jakub@redhat.com>
2314         PR c++/104513
2315         * constexpr.cc (potential_constant_expression_1) <case GOTO_EXPR>:
2316         Don't punt if returns (target).
2318 2022-02-11  Jakub Jelinek  <jakub@redhat.com>
2320         PR c++/104472
2321         * constexpr.cc (cxx_eval_internal_function) <case IFN_VEC_CONVERT>:
2322         Only return fold_const_call result if it is non-NULL.  Otherwise
2323         fall through into the default: case to return t, set *non_constant_p
2324         and emit diagnostics if needed.
2326 2022-02-10  Jason Merrill  <jason@redhat.com>
2328         * module.cc (depset::hash::add_specializations): Use
2329         STRIP_TEMPLATE.
2331 2022-02-10  Tobias Burnus  <tobias@codesourcery.com>
2333         PR c++/102204
2334         * decl2.cc (cp_omp_mappable_type_1): Remove check for virtual
2335         members as those are permitted since OpenMP 5.0.
2337 2022-02-10  Patrick Palka  <ppalka@redhat.com>
2339         * pt.cc (filter_memfn_lookup): Handle dependent USING_DECL
2340         better.
2342 2022-02-10  Marcel Vollweiler  <marcel@codesourcery.com>
2344         * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
2345         (cp_parser_omp_var_list_no_open): Handle array sections.
2346         (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
2347         case.
2348         (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
2349         * semantics.cc (handle_omp_array_sections): Handle clause restrictions.
2350         (finish_omp_clauses): Handle array sections.
2352 2022-02-09  Patrick Palka  <ppalka@redhat.com>
2354         PR c++/104432
2355         * call.cc (build_new_method_call): When a non-dependent call
2356         resolves to a specialization of a member template, always build
2357         the pruned overload set using the member template, not the
2358         specialization.
2359         * pt.cc (filter_memfn_lookup): New parameter newtype.  Simplify
2360         and correct how members from the new lookup set are matched to
2361         those from the old one.
2362         (tsubst_baselink): Pass binfo_type as newtype to
2363         filter_memfn_lookup.
2365 2022-02-09  Jason Merrill  <jason@redhat.com>
2367         PR c++/103752
2368         * module.cc (trees_out::core_vals): Stream explicit specifier.
2369         (trees_in::core_vals): Likewise.
2370         * pt.cc (store_explicit_specifier): No longer static.
2371         (tsubst_function_decl): Clear DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
2372         * cp-tree.h (lookup_explicit_specifier): Declare.
2374 2022-02-09  Jason Merrill  <jason@redhat.com>
2376         PR c++/96876
2377         * typeck2.cc (split_nonconstant_init_1): Push cleanups for
2378         preceding members with constant initialization.
2379         (maybe_push_temp_cleanup): Do nothing if -fno-exceptions.
2381 2022-02-08  Jakub Jelinek  <jakub@redhat.com>
2383         PR c++/104379
2384         * name-lookup.cc (check_local_shadow): When diagnosing shadowing
2385         of a member or global declaration, add warning suppression for
2386         the decl and don't warn again on it.
2388 2022-02-08  Jakub Jelinek  <jakub@redhat.com>
2390         PR c++/104403
2391         * constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
2392         of TREE_STATIC vars may only appear in -std=c++23.
2394 2022-02-08  Patrick Palka  <ppalka@redhat.com>
2396         PR c++/80951
2397         * pt.cc (uses_deducible_template_parms): Consider the
2398         noexcept-spec of a function type.
2400 2022-02-08  Patrick Palka  <ppalka@redhat.com>
2402         PR c++/104410
2403         * constraint.cc (satisfaction_value): Relax assert to accept
2404         cv-qualified bool.
2406 2022-02-08  Patrick Palka  <ppalka@redhat.com>
2408         PR c++/103706
2409         * pt.cc (preserve_args): New function.
2410         (tsubst_lambda_expr): Use it when setting LAMBDA_EXPR_REGEN_INFO.
2412 2022-02-08  Patrick Palka  <ppalka@redhat.com>
2414         PR c++/103706
2415         * constraint.cc (satisfy_declaration_constraints): Use
2416         lambda_regenerating_args instead.
2417         * cp-tree.h (lambda_regenerating_args): Declare.
2418         * pt.cc (lambda_regenerating_args): Define, split out from
2419         satisfy_declaration_constraints.
2420         (do_auto_deduction): Use lambda_regenerating_args to obtain the
2421         full set of outer template arguments for satisfaction when
2422         inside a lambda.
2424 2022-02-06  Patrick Palka  <ppalka@redhat.com>
2426         PR c++/96242
2427         * decl2.cc (mark_used): Directly synthesize a DECL_MAYBE_DELETED
2428         fn by calling maybe_synthesize_method instead of relying on
2429         maybe_instantiate_noexcept.  Move call to m_i_n after the
2430         DECL_DELETED_FN handling.
2431         * pt.cc (maybe_instantiate_noexcept): Restrict DECL_MAYBE_DELETED
2432         fn synthesis to only those with an implicit noexcept-spec, and
2433         return !DECL_DELETED_FN instead of !DECL_MAYBE_DELETED afterwards.
2435 2022-02-06  Jakub Jelinek  <jakub@redhat.com>
2437         PR c++/89074
2438         PR c++/104033
2439         * constexpr.cc (cxx_eval_binary_expression): Temporarily set
2440         folding_cxx_constexpr.
2442 2022-02-05  Jason Merrill  <jason@redhat.com>
2444         PR c++/104300
2445         PR c++/92385
2446         * cp-tree.h (get_vec_init_expr): New.
2447         (target_expr_needs_replace): New.
2448         * cp-gimplify.cc (cp_gimplify_init_expr): Use it.
2449         (struct cp_fold_data): New.
2450         (cp_fold_r): Only genericize inits at end of fn.
2451         (cp_fold_function): Here.
2452         (cp_fully_fold_init): Not here.
2453         * init.cc (build_vec_init): Use get_vec_init_expr.
2454         * tree.cc (build_vec_init_expr): Likewise.
2455         * typeck2.cc (split_nonconstant_init_1): Likewise.
2456         (process_init_constructor): Wrap VEC_INIT_EXPR in
2457         TARGET_EXPR.
2459 2022-02-05  Jason Merrill  <jason@redhat.com>
2461         * pt.cc (iterative_hash_template_arg): Add comment.
2463 2022-02-03  Patrick Palka  <ppalka@redhat.com>
2465         PR c++/104079
2466         * pt.cc (value_dependent_noexcept_spec_p): New predicate split
2467         out from ...
2468         (dependent_type_p_r): ... here.
2469         (instantiation_dependent_r): Use value_dependent_noexcept_spec_p
2470         to consider dependence of a noexcept-spec before C++17.
2471         * tree.cc (fixup_deferred_exception_variants): Clear
2472         TYPE_DEPENDENT_P_VALID.
2474 2022-02-03  Jason Merrill  <jason@redhat.com>
2476         PR c++/104302
2477         * decl.cc (maybe_deduce_size_from_array_init): Give up
2478         on type-dependent init.
2479         (cp_complete_array_type): Only call reshape_init for character
2480         array.
2482 2022-02-01  Jason Merrill  <jason@redhat.com>
2484         PR c++/103186
2485         * pt.cc (defarg_inst): Use tree_vec_map_cache_hasher.
2486         (defarg_insts_for): New.
2487         (tsubst_default_argument): Adjust.
2489 2022-01-31  Marek Polacek  <polacek@redhat.com>
2491         PR c++/102414
2492         PR c++/101874
2493         * decl.cc (create_array_type_for_decl): Use template_placeholder_p.
2494         Sorry on a variable-length array of auto.
2496 2022-01-31  Marek Polacek  <polacek@redhat.com>
2498         PR c++/102434
2499         * class.cc (finish_struct): Don't allow union initializer_list.
2501 2022-01-31  Patrick Palka  <ppalka@redhat.com>
2503         PR c++/104294
2504         * pt.cc (ctor_deduction_guides_for): Correct computation of
2505         outer_args.
2507 2022-01-31  Patrick Palka  <ppalka@redhat.com>
2509         PR c++/104291
2510         * pt.cc (for_each_template_parm_r) <case CONSTRUCTOR>: Clear
2511         walk_subtrees if !include_nondeduced_p.  Simplify given that
2512         cp_walk_subtrees already walks TYPE_PTRMEMFUNC_FN_TYPE_RAW.
2514 2022-01-28  Patrick Palka  <ppalka@redhat.com>
2515             Jason Merrill  <jason@redhat.com>
2517         PR c++/92752
2518         * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the
2519         unqualified pointer type not the qualified one.
2521 2022-01-28  Patrick Palka  <ppalka@redhat.com>
2523         PR c++/103341
2524         * decl.cc (cp_finish_decl): Pass the template arguments of a
2525         variable template specialization or a templated static data
2526         member to do_auto_deduction when the auto is constrained.
2528 2022-01-28  Jason Merrill  <jason@redhat.com>
2530         PR c++/100198
2531         PR c++/100030
2532         PR c++/100282
2533         * parser.cc (cp_parser_enumerator_definition): Sorry on parameter
2534         pack in lambda.
2535         (cp_parser_class_head): And in class attributes.
2536         * pt.cc (check_for_bare_parameter_packs): Sorry instead of error
2537         in lambda.
2539 2022-01-27  Jason Merrill  <jason@redhat.com>
2541         PR c++/104245
2542         PR c++/51344
2543         * decl2.cc (save_template_attributes): Take late attrs as parm.
2544         (cplus_decl_attributes): Call it after decl_attributes,
2545         splice_template_attributes before.
2547 2022-01-27  Patrick Palka  <ppalka@redhat.com>
2549         PR c++/99895
2550         * call.cc (build_over_call): For a non-dependent member call,
2551         build up a CALL_EXPR using a COMPONENT_REF callee, as in
2552         build_new_method_call.
2553         * pt.cc (build_non_dependent_expr): Don't wrap PARM_DECL either.
2554         * tree.cc (build_min_non_dep_op_overload): Adjust accordingly
2555         after the build_over_call change.
2557 2022-01-27  Patrick Palka  <ppalka@redhat.com>
2559         PR c++/92944
2560         PR c++/103678
2561         * parser.cc (cp_parser_class_head): Update 'type' with the result
2562         of maybe_process_partial_specialization in the
2563         nested_name_specifier branch.  Refactor nearby code to accomodate
2564         that maybe_process_partial_specialization returns a _TYPE, not a
2565         TYPE_DECL, and eliminate local variable 'class_type' in passing.
2567 2022-01-27  Marek Polacek  <polacek@redhat.com>
2569         PR c++/101988
2570         * decl.cc (create_array_type_for_decl): Reject forming an array of
2571         placeholder for a deduced class type.
2573 2022-01-26  Jason Merrill  <jason@redhat.com>
2575         PR c++/104206
2576         PR c++/101072
2577         * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check.
2579 2022-01-26  Jakub Jelinek  <jakub@redhat.com>
2581         PR c++/104226
2582         * constexpr.cc (init_subob_ctx): For vector ctors containing
2583         vector elements, ensure appending to the same ctor instead of
2584         creating another one.
2586 2022-01-26  Marek Polacek  <polacek@redhat.com>
2588         PR target/104213
2589         * decl.cc (finish_constructor_body): Suppress -Wuse-after-free.
2590         (finish_destructor_body): Likewise.
2591         * optimize.cc (build_delete_destructor_body): Likewise.
2593 2022-01-26  Jason Merrill  <jason@redhat.com>
2595         PR c++/104235
2596         * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.
2598 2022-01-26  Jason Merrill  <jason@redhat.com>
2600         PR c++/103057
2601         * pt.cc (tsubst_aggr_type): Call tsubst for alias template
2602         specialization.
2604 2022-01-25  Patrick Palka  <ppalka@redhat.com>
2606         PR c++/101532
2607         PR c++/104225
2608         * decl2.cc (mark_used): Don't consider maybe_instantiate_noexcept
2609         on a deleted function.
2611 2022-01-25  Jason Merrill  <jason@redhat.com>
2613         PR c++/59950
2614         * call.cc (build_over_call): Use cp_build_indirect_ref.
2616 2022-01-24  Patrick Palka  <ppalka@redhat.com>
2618         PR c++/104197
2619         * pt.cc (make_auto_1): Use -1 as a placeholder default argument
2620         for level.
2622 2022-01-24  Patrick Palka  <ppalka@redhat.com>
2624         PR c++/104173
2625         * typeck.cc (build_class_member_access_expr): Extend
2626         unary_complex_lvalue result adjustment to preserve all
2627         rvalues, not just xvalues.
2629 2022-01-23  Will Wray  <wjwray@gmail.com>
2631         PR c++/55227
2632         * decl.cc (reshape_init_r): Only call has_designator_check when
2633         first_initializer_p or for the inner constructor element.
2634         (cp_complete_array_type): Call reshape_init on braced-init-list.
2636 2022-01-23  Jason Merrill  <jason@redhat.com>
2638         PR c++/104182
2639         * cp-gimplify.cc (cp_genericize_target_expr): Make sure nothing
2640         has set DECL_INITIAL on a TARGET_EXPR slot.
2641         * tree.cc (is_local_temp): Don't check DECL_CONTEXT.
2643 2022-01-23  Jason Merrill  <jason@redhat.com>
2645         PR c++/101072
2646         * cp-tree.h (build_implicit_conv_flags): Declare.
2647         * call.cc (build_implicit_conv_flags): Split out from...
2648         (perform_implicit_conversion_flags): ...here.
2649         * decl.cc (check_initializer): Use it.
2650         * pt.cc (tsubst_copy_and_build): Remove TARGET_EXPR handling.
2651         * semantics.cc (finish_compound_literal): Don't treat
2652         scalar values like CONSTRUCTORs.
2654 2022-01-21  Jason Merrill  <jason@redhat.com>
2656         * semantics.cc (find_failing_clause): Return expr if not
2657         decomposable.
2658         (finish_static_assert): Show constant values in failing
2659         comparison.
2661 2022-01-21  Jason Merrill  <jason@redhat.com>
2663         PR c++/104084
2664         PR c++/20040
2665         * init.cc (build_new_1): Only pull out TARGET_EXPR_INITIAL if
2666         alloc_expr is a TARGET_EXPR.
2668 2022-01-21  Marek Polacek  <polacek@redhat.com>
2670         PR c++/101715
2671         * tree.cc (fixup_deferred_exception_variants): Remove duplicate
2672         variants after parsing the exception specifications.
2674 2022-01-21  Jason Merrill  <jason@redhat.com>
2676         PR c++/104139
2677         PR c++/103681
2678         * class.cc (end_of_class): Use base_binfo.
2680 2022-01-20  Jason Merrill  <jason@redhat.com>
2682         PR c++/101405
2683         * decl.cc (reshape_init_class): Reject designator for a member of
2684         another class.
2686 2022-01-20  Patrick Palka  <ppalka@redhat.com>
2688         PR c++/91911
2689         PR c++/103672
2690         * pt.cc (keep_template_parm): Punt on a level 0 template parm.
2691         (tsubst_decl) <case VAR_DECL>: Remove !CHECKING_P safeguard.
2692         (tsubst) <case TEMPLATE_TYPE_PARM>: Handle CTAD placeholders
2693         specially.
2694         (make_auto_1): Add defaulted 'level' parameter.
2695         (make_template_placeholder): Pass 0 as 'level' to make_auto_1.
2697 2022-01-20  Patrick Palka  <ppalka@redhat.com>
2699         * decl.cc (grokdeclarator): Diagnose a CTAD placeholder as
2700         function return type even when !funcdecl_p.
2702 2022-01-20  Martin Liska  <mliska@suse.cz>
2704         PR c++/104134
2705         * error.cc (dump_aggr_type): Partially disable the warning.
2707 2022-01-20  Jason Merrill  <jason@redhat.com>
2709         PR c++/102300
2710         * parser.cc (cp_parser_template_name): Use dependent_scope_p.
2712 2022-01-19  David Malcolm  <dmalcolm@redhat.com>
2714         * cp-lang.cc (selftest::run_cp_tests): Update calls for .c to .cc
2715         renaming.
2716         * cp-tree.h (cp_pt_c_tests): Rename to...
2717         (cp_pt_cc_tests): ...this.
2718         (cp_tree_c_tests): Rename to...
2719         (cp_tree_cc_tests): ...this.
2720         * pt.cc (cp_pt_c_tests): Rename to...
2721         (cp_pt_cc_tests): ...this.
2722         * tree.cc (cp_tree_c_tests): Rename to...
2723         (cp_tree_cc_tests): ...this.
2725 2022-01-19  Jason Merrill  <jason@redhat.com>
2727         * parser.cc (saved_token_sentinel::rollback): Use
2728         cp_lexer_previous_token.
2730 2022-01-18  Jakub Jelinek  <jakub@redhat.com>
2732         PR c++/104055
2733         * constexpr.cc (cxx_eval_outermost_constant_expr): If t is a
2734         TARGET_EXPR with TARGET_EXPR_CLEANUP, use get_target_expr rather
2735         than get_target_expr_sfinae with tf_no_cleanup, and don't set
2736         TREE_CONSTANT.
2738 2022-01-18  Jason Merrill  <jason@redhat.com>
2739             Jakub Jelinek   <jakub@redhat.com>
2741         PR c++/104025
2742         * parser.cc (saved_token_sentinel::rollback): Call
2743         cp_lexer_set_source_position.
2744         (~saved_token_sentinel): Call rollback.
2746 2022-01-18  Patrick Palka  <ppalka@redhat.com>
2748         PR c++/104074
2749         * pt.cc (invalid_nontype_parm_type_p): Use WILDCARD_TYPE_P so
2750         that we return false for DEPENDENT_OPERATOR_TYPE too.
2752 2022-01-17  Martin Liska  <mliska@suse.cz>
2754         * Make-lang.in: Rename .c names to .cc.
2755         * config-lang.in: Likewise.
2756         * constexpr.cc (cxx_eval_constant_expression): Likewise.
2757         * coroutines.cc (morph_fn_to_coro): Likewise.
2758         * cp-gimplify.cc (cp_gimplify_expr): Likewise.
2759         * cp-lang.cc (struct lang_hooks): Likewise.
2760         (get_template_argument_pack_elems_folded): Likewise.
2761         * cp-objcp-common.cc (cp_tree_size): Likewise.
2762         (cp_unit_size_without_reusable_padding): Likewise.
2763         (pop_file_scope): Likewise.
2764         (cp_pushdecl): Likewise.
2765         * cp-objcp-common.h (GCC_CP_OBJCP_COMMON): Likewise.
2766         (cxx_simulate_record_decl): Likewise.
2767         * cp-tree.h (struct named_label_entry): Likewise.
2768         (current_function_return_value): Likewise.
2769         (more_aggr_init_expr_args_p): Likewise.
2770         (get_function_version_dispatcher): Likewise.
2771         (common_enclosing_class): Likewise.
2772         (strip_fnptr_conv): Likewise.
2773         (current_decl_namespace): Likewise.
2774         (do_aggregate_paren_init): Likewise.
2775         (cp_check_const_attributes): Likewise.
2776         (qualified_name_lookup_error): Likewise.
2777         (generic_targs_for): Likewise.
2778         (mark_exp_read): Likewise.
2779         (is_global_friend): Likewise.
2780         (maybe_reject_flexarray_init): Likewise.
2781         (module_token_lang): Likewise.
2782         (handle_module_option): Likewise.
2783         (literal_integer_zerop): Likewise.
2784         (build_extra_args): Likewise.
2785         (build_if_nonnull): Likewise.
2786         (maybe_check_overriding_exception_spec): Likewise.
2787         (finish_omp_target_clauses): Likewise.
2788         (maybe_warn_zero_as_null_pointer_constant): Likewise.
2789         (cxx_print_error_function): Likewise.
2790         (decl_in_std_namespace_p): Likewise.
2791         (merge_exception_specifiers): Likewise.
2792         (mangle_module_global_init): Likewise.
2793         (cxx_block_may_fallthru): Likewise.
2794         (fold_builtin_source_location): Likewise.
2795         (enum cp_oracle_request): Likewise.
2796         (subsumes): Likewise.
2797         (cp_finish_injected_record_type): Likewise.
2798         (vtv_build_vtable_verify_fndecl): Likewise.
2799         (cp_tree_c_finish_parsing): Likewise.
2800         * cvt.cc (diagnose_ref_binding): Likewise.
2801         (convert_to_void): Likewise.
2802         (convert_force): Likewise.
2803         (type_promotes_to): Likewise.
2804         * decl.cc (make_unbound_class_template_raw): Likewise.
2805         (cxx_init_decl_processing): Likewise.
2806         (check_class_member_definition_namespace): Likewise.
2807         (cxx_maybe_build_cleanup): Likewise.
2808         * decl2.cc (maybe_emit_vtables): Likewise.
2809         * error.cc (dump_function_name): Likewise.
2810         * init.cc (is_class_type): Likewise.
2811         (build_new_1): Likewise.
2812         * lang-specs.h: Likewise.
2813         * method.cc (make_alias_for_thunk): Likewise.
2814         * module.cc (specialization_add): Likewise.
2815         (module_state::read_cluster): Likewise.
2816         * name-lookup.cc (check_extern_c_conflict): Likewise.
2817         * name-lookup.h (struct cxx_binding): Likewise.
2818         * parser.cc (cp_parser_identifier): Likewise.
2819         * parser.h (struct cp_parser): Likewise.
2820         * pt.cc (has_value_dependent_address): Likewise.
2821         (push_tinst_level_loc): Likewise.
2822         * semantics.cc (finish_omp_clauses): Likewise.
2823         (finish_omp_atomic): Likewise.
2824         * tree.cc (cp_save_expr): Likewise.
2825         (cp_free_lang_data): Likewise.
2826         * typeck.cc (cp_common_type): Likewise.
2827         (strip_array_domain): Likewise.
2828         (rationalize_conditional_expr): Likewise.
2829         (check_return_expr): Likewise.
2830         * vtable-class-hierarchy.cc: Likewise.
2832 2022-01-17  Martin Liska  <mliska@suse.cz>
2834         * call.c: Moved to...
2835         * call.cc: ...here.
2836         * class.c: Moved to...
2837         * class.cc: ...here.
2838         * constexpr.c: Moved to...
2839         * constexpr.cc: ...here.
2840         * cp-gimplify.c: Moved to...
2841         * cp-gimplify.cc: ...here.
2842         * cp-lang.c: Moved to...
2843         * cp-lang.cc: ...here.
2844         * cp-objcp-common.c: Moved to...
2845         * cp-objcp-common.cc: ...here.
2846         * cp-ubsan.c: Moved to...
2847         * cp-ubsan.cc: ...here.
2848         * cvt.c: Moved to...
2849         * cvt.cc: ...here.
2850         * cxx-pretty-print.c: Moved to...
2851         * cxx-pretty-print.cc: ...here.
2852         * decl.c: Moved to...
2853         * decl.cc: ...here.
2854         * decl2.c: Moved to...
2855         * decl2.cc: ...here.
2856         * dump.c: Moved to...
2857         * dump.cc: ...here.
2858         * error.c: Moved to...
2859         * error.cc: ...here.
2860         * except.c: Moved to...
2861         * except.cc: ...here.
2862         * expr.c: Moved to...
2863         * expr.cc: ...here.
2864         * friend.c: Moved to...
2865         * friend.cc: ...here.
2866         * g++spec.c: Moved to...
2867         * g++spec.cc: ...here.
2868         * init.c: Moved to...
2869         * init.cc: ...here.
2870         * lambda.c: Moved to...
2871         * lambda.cc: ...here.
2872         * lex.c: Moved to...
2873         * lex.cc: ...here.
2874         * mangle.c: Moved to...
2875         * mangle.cc: ...here.
2876         * method.c: Moved to...
2877         * method.cc: ...here.
2878         * name-lookup.c: Moved to...
2879         * name-lookup.cc: ...here.
2880         * optimize.c: Moved to...
2881         * optimize.cc: ...here.
2882         * parser.c: Moved to...
2883         * parser.cc: ...here.
2884         * pt.c: Moved to...
2885         * pt.cc: ...here.
2886         * ptree.c: Moved to...
2887         * ptree.cc: ...here.
2888         * rtti.c: Moved to...
2889         * rtti.cc: ...here.
2890         * search.c: Moved to...
2891         * search.cc: ...here.
2892         * semantics.c: Moved to...
2893         * semantics.cc: ...here.
2894         * tree.c: Moved to...
2895         * tree.cc: ...here.
2896         * typeck.c: Moved to...
2897         * typeck.cc: ...here.
2898         * typeck2.c: Moved to...
2899         * typeck2.cc: ...here.
2900         * vtable-class-hierarchy.c: Moved to...
2901         * vtable-class-hierarchy.cc: ...here.
2903 2022-01-17  Jakub Jelinek  <jakub@redhat.com>
2905         PR c++/104031
2906         * cp-gimplify.c (cp_genericize_target_expr): Set DECL_CONTEXT of
2907         TARGET_EXPR_SLOT to current_function_decl if it was NULL.
2909 2022-01-17  Andrew Stubbs  <ams@codesourcery.com>
2911         * parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.
2913 2022-01-14  Chung-Lin Tang  <cltang@codesourcery.com>
2915         PR c++/103705
2916         * semantics.c (finish_omp_clauses): Also continue peeling off of
2917         outer node for ARRAY_REFs.
2919 2022-01-14  Jakub Jelinek  <jakub@redhat.com>
2921         PR c++/103991
2922         * cp-objcp-common.c (cxx_block_may_fallthru) <case IF_STMT>: For
2923         IF_STMT_CONSTEXPR_P with constant false or true condition only
2924         check if the taken clause may fall through.
2925         * cp-gimplify.c (genericize_if_stmt): For consteval if, revert
2926         to r12-5638^ behavior if then_ block can't fall through.  For
2927         constexpr if, revert to r12-5638^ behavior.
2929 2022-01-13  Anthony Sharp  <anthonysharp15@gmail.com>
2930             Jason Merrill  <jason@redhat.com>
2932         PR c++/70417
2933         * parser.c (cp_parser_id_expression): Handle
2934         -Wmissing-template-keyword.
2935         (struct saved_token_sentinel): Add modes to control what happens
2936         on destruction.
2937         (cp_parser_statement): Adjust.
2938         (cp_parser_skip_entire_template_parameter_list): New function that
2939         skips an entire template parameter list.
2940         (cp_parser_require_end_of_template_parameter_list): Rename old
2941         cp_parser_skip_to_end_of_template_parameter_list.
2942         (cp_parser_skip_to_end_of_template_parameter_list): Refactor to be
2943         called from one of the above two functions.
2944         (cp_parser_lambda_declarator_opt)
2945         (cp_parser_explicit_template_declaration)
2946         (cp_parser_enclosed_template_argument_list): Adjust.
2948 2022-01-12  Jakub Jelinek  <jakub@redhat.com>
2949             Jason Merrill  <jason@redhat.com>
2951         PR c++/103480
2952         * tree.c (move): If expr is xvalue_p, just return expr without
2953         build_static_cast.
2955 2022-01-11  Jakub Jelinek  <jakub@redhat.com>
2957         PR c++/101597
2958         * class.c (build_vfn_ref): Build OBJ_TYPE_REF with INTEGER_CST
2959         OBJ_TYPE_REF_TOKEN with type equal to OBJ_TYPE_REF_OBJECT type.
2960         * error.c (resolve_virtual_fun_from_obj_type_ref): Use type of
2961         OBJ_TYPE_REF_TOKEN rather than type of OBJ_TYPE_REF_OBJECT as
2962         obj_type.
2964 2022-01-11  Patrick Palka  <ppalka@redhat.com>
2966         PR c++/103831
2967         * call.c (build_new_method_call): Consider dependent bases only
2968         if 'this' is available.
2970 2022-01-11  Olivier Hainque  <hainque@adacore.com>
2972         * decl.c (cxx_init_decl_processing): Move code possibly
2973         altering flag_weak before code testing it.
2975 2022-01-10  Patrick Palka  <ppalka@redhat.com>
2977         PR c++/103879
2978         * constexpr.c (cxx_fold_indirect_ref): Split out object/offset
2979         canonicalization step into a local lambda.  Strengthen it to
2980         absorb more components at position 0.  Use it before both calls
2981         to cxx_fold_indirect_ref_1.
2983 2022-01-10  Patrick Palka  <ppalka@redhat.com>
2985         PR c++/103783
2986         * call.c (cand_parms_match): Skip over 'this' when given one
2987         static and one non-static member function.
2989 2022-01-10  Jakub Jelinek  <jakub@redhat.com>
2991         PR c++/103912
2992         * semantics.c (expand_or_defer_fn): For immediate functions, set
2993         node->body_removed to true and clear analyzed, definition and
2994         force_output.
2995         * decl2.c (c_parse_final_cleanups): Ignore immediate functions for
2996         expand_or_defer_fn.
2998 2022-01-08  Jakub Jelinek  <jakub@redhat.com>
3000         PR c++/89074
3001         * constexpr.c (cxx_maybe_fold_addr_pointer_plus): New function.
3002         (cxx_eval_binary_expression): Use it.
3004 2022-01-08  Jason Merrill  <jason@redhat.com>
3006         PR c++/103946
3007         * init.c (build_vec_init): Remove assert.
3008         * tree.c (build_vec_init_expr): Likewise.
3010 2022-01-08  Jason Merrill  <jason@redhat.com>
3012         PR c++/100588
3013         * call.c (build_op_delete_call): Ignore destroying delete
3014         if alloc_fn.
3016 2022-01-07  Jason Merrill  <jason@redhat.com>
3018         PR c++/20040
3019         * init.c (build_new_1): Also build pointer cleanup if
3020         TYPE_GETS_DELETE.
3021         * cp-tree.h (TYPE_GETS_VEC_DELETE): New.
3023 2022-01-07  Jason Merrill  <jason@redhat.com>
3025         PR c++/103936
3026         PR c++/65591
3027         * cp-gimplify.c (cp_gimplify_expr): Restore VEC_INIT_EXPR handling.
3029 2022-01-07  Jason Merrill  <jason@redhat.com>
3031         PR c++/103711
3032         * init.c (perform_target_ctor): Select destructor by in_chrg.
3034 2022-01-07  Jason Merrill  <jason@redhat.com>
3036         PR c++/61611
3037         * except.c (in_nested_catch): New.
3038         (expand_end_catch_block): Check it.
3040 2022-01-07  Jason Merrill  <jason@redhat.com>
3042         PR c++/33799
3043         PR c++/102191
3044         * except.c (maybe_splice_retval_cleanup): Check
3045         current_binding_level.
3046         * semantics.c (do_poplevel): Call it here.
3047         * parser.c (cp_parser_compound_statement): Not here.
3049 2022-01-07  Jason Merrill  <jason@redhat.com>
3051         PR c++/53868
3052         * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
3053         cleanups from set_up_extended_ref_temp.
3054         (wrap_temporary_cleanups): Ignore array cleanups.
3055         (initialize_local_var): Don't check for array here.
3056         * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
3057         * init.c (build_vec_delete_1): Set it.
3059 2022-01-07  Jason Merrill  <jason@redhat.com>
3061         PR c++/66451
3062         * init.c (build_vec_delete_1): Handle throwing dtor.
3063         (build_vec_init): Tell it we're in a cleanup already.
3065 2022-01-07  Jason Merrill  <jason@redhat.com>
3067         * typeck2.c (split_nonconstant_init_1): Don't cleanup the last elt.
3068         (split_nonconstant_init): Adjust.
3070 2022-01-07  Jason Merrill  <jason@redhat.com>
3072         PR c++/66139
3073         PR c++/52320
3074         * constexpr.c (replace_decl): Rename from replace_result_decl.
3075         * cp-tree.h (replace_decl): Declare it.
3076         * cp-gimplify.c (cp_gimplify_init_expr): Call it.
3077         (cp_gimplify_expr): Don't handle VEC_INIT_EXPR.
3078         (cp_genericize_init, cp_genericize_init_expr)
3079         (cp_genericize_target_expr): New.
3080         (cp_fold_r): Call them.
3081         * tree.c (build_array_copy): Add a TARGET_EXPR.
3082         * typeck2.c (digest_init_r): Look through a TARGET_EXPR.
3084 2022-01-07  Jason Merrill  <jason@redhat.com>
3086         PR c++/94041
3087         * decl.c (initialize_local_var): Fix comment.
3088         * init.c (build_new_1): Do stabilize array init.
3089         (build_vec_init): Use TARGET_EXPR for cleanup.  Initialization
3090         of an element from an explicit initializer is not a
3091         full-expression.
3092         * tree.c (expand_vec_init_expr): Pass flags through.
3093         * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
3094         (split_nonconstant_init): Handle array cleanups.
3095         * cp-tree.h: Adjust.
3097 2022-01-07  Jason Merrill  <jason@redhat.com>
3099         PR c++/94041
3100         * decl.c (check_initializer): Remove obsolete comment.
3101         (wrap_cleanups_r): Don't wrap CLEANUP_EH_ONLY.
3102         (initialize_local_var): Change assert to test.
3103         * typeck2.c (maybe_push_temp_cleanup): New.
3104         (split_nonconstant_init_1): Use it.
3105         (split_nonconstant_init): Clear cleanup flags.
3107 2022-01-07  Jason Merrill  <jason@redhat.com>
3109         PR c++/92385
3110         * typeck2.c (PICFLAG_VEC_INIT): New.
3111         (process_init_constructor_array): Set it.
3112         (process_init_constructor): Handle it.
3113         (split_nonconstant_init_1): Handle VEC_INIT_EXPR.
3114         * init.c (build_vec_init): Likewise.
3115         * cp-gimplify.c (cp_gimplify_expr): Factor out...
3116         * tree.c (expand_vec_init_expr): ...this function.
3117         (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P.
3118         (build_vec_init_expr): Likewise.
3119         * constexpr.c (cxx_eval_vec_init): Likewise.
3120         (reduced_constant_expression_p): Check arrays before C++20.
3121         * cp-tree.h (expand_vec_init_expr): Declare.
3123 2022-01-07  Jason Merrill  <jason@redhat.com>
3125         * init.c (build_new_1): Remove preevaluation code.
3127 2022-01-05  Nathan Sidwell  <nathan@acm.org>
3129         * pt.c (instantiate_class_template_1): Process attribute((used)) set
3130         in class's context.
3132 2022-01-05  Nathan Sidwell  <nathan@acm.org>
3134         * init.c (build_new_1): Check complain before alignment warning.
3136 2022-01-04  Jason Merrill  <jason@redhat.com>
3138         * cp-tree.h (class releasing_vec): Add begin/end fns.
3140 2022-01-04  Jason Merrill  <jason@redhat.com>
3142         * init.c: Include -*- C++ -*- on first line.
3144 2022-01-03  Marek Polacek  <polacek@redhat.com>
3146         PR c++/103758
3147         * parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
3148         with %qD.
3150 2022-01-03  Marek Polacek  <polacek@redhat.com>
3152         * parser.c (make_char_string_pack): Add a cast to const unsigned
3153         char *.
3155 2022-01-03  Jakub Jelinek  <jakub@redhat.com>
3157         PR c++/103600
3158         * rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
3159         to DECL_TINFO_P VAR_DECLs.
3161 2022-01-02  Jason Merrill  <jason@redhat.com>
3163         * init.c (build_vec_init): Append the decrement to elt_init.
3165 2022-01-02  Jason Merrill  <jason@redhat.com>
3167         * decl.c (wrap_cleanups_r): Don't wrap if noexcept.
3170 Copyright (C) 2022 Free Software Foundation, Inc.
3172 Copying and distribution of this file, with or without modification,
3173 are permitted in any medium without royalty provided the copyright
3174 notice and this notice are preserved.