Daily bump.
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2021-10-28  Patrick Palka  <ppalka@redhat.com>
2
3         PR c++/102933
4         * parser.c (cp_parser_simple_type_specifier): Adjust diagnostic
5         for using auto in parameter declaration.
6         * pt.c (extract_autos_r): Ignore CTAD placeholders.
7         (extract_autos): Use range-based for.
8         (do_auto_deduction): Use extract_autos only for the concepts TS
9         and not also for standard concepts.
10         (type_uses_auto): Likewise with for_each_template_parm.
11         (check_auto_in_tmpl_args): Just return false outside of the
12         concepts TS.  Simplify.
13
14 2021-10-28  Patrick Palka  <ppalka@redhat.com>
15
16         PR c++/102780
17         * constexpr.c (potential_constant_expression_1) <case TRUTH_*_EXPR>:
18         When tf_error isn't set, preemptively check potentiality of the
19         second operand before performing trial evaluation of the first
20         operand.
21         (potential_constant_expression_1): When tf_error is set, first check
22         potentiality quietly and return true if successful, otherwise
23         proceed noisily to give errors.
24
25 2021-10-27  Jakub Jelinek  <jakub@redhat.com>
26
27         PR c++/102854
28         * semantics.c (handle_omp_for_class_iterator,
29         finish_omp_for): Adjust c_omp_check_loop_iv_exprs caller.
30
31 2021-10-27  Jakub Jelinek  <jakub@redhat.com>
32
33         PR c++/102753
34         * constexpr.c (cxx_eval_outermost_constant_expr): Perform
35         find_immediate_fndecl discovery if is_consteval or
36         in_immediate_context () rather than if is_consteval, t != r
37         and not in immediate function's body.
38
39 2021-10-27  Jakub Jelinek  <jakub@redhat.com>
40
41         PR c++/102753
42         * cp-tree.h (saved_scope): Document that consteval_if_p member
43         is also set while processing immediate invocation.
44         (in_immediate_context): Declare.
45         * call.c (in_immediate_context): New function.
46         (immediate_invocation_p): Use it.
47         (struct in_consteval_if_p_temp_override): New class.
48         (build_over_call): Temporarily set in_consteval_if_p for processing
49         immediate invocation arguments.
50         * typeck.c (cp_build_addr_expr_1): Diagnose taking address of
51         an immediate method.  Use t instead of TREE_OPERAND (arg, 1).
52         Use in_immediate_context function.
53         * constexpr.c (find_immediate_fndecl): Handle PTRMEM_CST
54         which refers to immediate function decl.
55
56 2021-10-26  Marek Polacek  <polacek@redhat.com>
57
58         PR c++/102617
59         * parser.c (cp_parser_for): Maybe call cp_parser_init_statement
60         twice.  Warn about range-based for loops with initializer here.
61         (cp_parser_init_statement): Don't duplicate code.  Allow
62         alias-declaration in init-statement.
63
64 2021-10-22  Eric Gallager  <egallager@gcc.gnu.org>
65
66         PR other/102663
67         * Make-lang.in: Add dummy c++.install-dvi target.
68
69 2021-10-20  Jason Merrill  <jason@redhat.com>
70
71         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
72         Pass true for declarator_p.
73         (cp_parser_nested_name_specifier_opt): Only look through
74         TYPENAME_TYPE if check_dependency_p is false.
75
76 2021-10-20  Jakub Jelinek  <jakub@redhat.com>
77
78         PR c++/102642
79         * name-lookup.c (push_local_extern_decl_alias): Don't call
80         set_decl_tls_model on error_mark_node.
81         * decl.c (make_rtl_for_nonlocal_decl): Don't call
82         set_user_assembler_name on error_mark_node.
83         * parser.c (cp_parser_oacc_declare): Ignore DECL_LOCAL_DECL_ALIAS
84         if it is error_mark_node.
85         (cp_parser_omp_declare_target): Likewise.
86
87 2021-10-19  Jakub Jelinek  <jakub@redhat.com>
88
89         PR c++/102786
90         * constexpr.c (cxx_eval_constant_expression): Don't reject
91         INTEGER_CSTs with type POINTER_TYPE to METHOD_TYPE.
92
93 2021-10-15  Jason Merrill  <jason@redhat.com>
94
95         PR c++/51851
96         PR c++/101402
97         PR c++/102033
98         PR c++/102034
99         PR c++/102039
100         PR c++/102044
101         * pt.c (determine_specialization): Remove redundant code.
102         (fn_type_unification): Check for mismatched length.
103         (type_unification_real): Ignore terminal void.
104         (get_bindings): Don't stop at void_list_node.
105         * class.c (resolve_address_of_overloaded_function): Likewise.
106
107 2021-10-15  Jason Merrill  <jason@redhat.com>
108
109         * constexpr.c (cxx_bind_parameters_in_call): Replace
110         new_call parameter with fun.
111         (cxx_eval_call_expression): Call it before instantiation.
112         (cxx_eval_outermost_constant_expr): Only instantiate fns
113         when manifestly_const_eval.
114         * typeck2.c (check_narrowing): This context is manifestly
115         constant-evaluated.
116
117 2021-10-14  Kwok Cheung Yeung  <kcy@codesourcery.com>
118
119         * decl.c (omp_declare_variant_finalize_one): Change call from
120         c_omp_mark_declare_variant to omp_mark_declare_variant.
121         * parser.c (cp_finish_omp_declare_variant): Change call from
122         c_omp_check_context_selector to omp_check_context_selector.
123
124 2021-10-09  Jakub Jelinek  <jakub@redhat.com>
125
126         * parser.c (cp_parser_omp_structured_block): Remove disallow_omp_attrs
127         argument.
128         (cp_parser_omp_structured_block_sequence): New function.
129         (cp_parser_omp_scan_loop_body): Use it.
130         (cp_parser_omp_sections_scope): Likewise.
131
132 2021-10-08  Martin Liska  <mliska@suse.cz>
133
134         * constexpr.c (maybe_warn_about_constant_value): Use new macro
135         OPTION_SET_P.
136         * decl.c (redeclaration_error_message): Likewise.
137         (cxx_init_decl_processing): Likewise.
138
139 2021-10-08  Jakub Jelinek  <jakub@redhat.com>
140
141         PR c++/102640
142         * parser.c (handle_omp_declare_target_clause): New function.
143         (cp_parser_omp_declare_target): Use it.
144
145 2021-10-07  Patrick Palka  <ppalka@redhat.com>
146
147         PR c++/61355
148         * pt.c (convert_template_argument): Perform array/function to
149         pointer conversion on the substituted type of an NTTP.
150
151 2021-10-07  Patrick Palka  <ppalka@redhat.com>
152
153         PR c++/99904
154         * pt.c (is_compatible_template_arg): Set processing_template_decl
155         around tsubst_constraint_info.
156
157 2021-10-07  Jonathan Wakely  <jwakely@redhat.com>
158
159         PR c++/102482
160         * init.c (maybe_warn_list_ctor): Do not warn for a reference to
161         a non-const std::initializer_list.
162
163 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
164
165         PR c++/102612
166         * parser.c (cp_parser_jump_statement): Implement C++23 P2242R3.
167         Allow goto expressions in constexpr function bodies for C++23.
168         Adjust error message for older standards to mention it.
169         * decl.c (start_decl): Allow static and thread_local declarations
170         in constexpr function bodies for C++23.  Adjust error message for
171         older standards to mention it.
172         * constexpr.c (ensure_literal_type_for_constexpr_object): Allow
173         declarations of variables with non-literal type in constexpr function
174         bodies for C++23.  Adjust error message for older standards to mention
175         it.
176         (cxx_eval_constant_expression) <case DECL_EXPR>: Diagnose declarations
177         of initialization of static or thread_local vars.
178         (cxx_eval_constant_expression) <case GOTO_EXPR>: Diagnose goto
179         statements for C++23.
180         (potential_constant_expression_1) <case DECL_EXPR>: Swap the
181         CP_DECL_THREAD_LOCAL_P and TREE_STATIC checks.
182         (potential_constant_expression_1) <case LABEL_EXPR>: Allow labels for
183         C++23.  Adjust error message for older standards to mention it.
184
185 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
186             Jason Merrill  <jason@redhat.com>
187
188         PR c++/98712
189         PR c++/102490
190         * cp-tree.h (maybe_synthesize_method): Declare.
191         * method.c (genericize_spaceship): Use
192         LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
193         LOOKUP_NORMAL for flags.
194         (comp_info): Remove defining member.  Add complain, code, retcat.
195         (comp_info::comp_info): Adjust.
196         (do_one_comp): Split out from build_comparison_op.   Use
197         LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
198         LOOKUP_NORMAL for flags.
199         (build_comparison_op): Add defining argument. Adjust comp_info
200         construction.  Use defining instead of info.defining.  Assert that
201         if defining, ctype is a complete type.  Walk base binfos.
202         (synthesize_method, maybe_explain_implicit_delete,
203         explain_implicit_non_constexpr): Adjust build_comparison_op callers.
204         (maybe_synthesize_method): New function.
205         * class.c (check_bases_and_members): Don't call defaulted_late_check
206         for sfk_comparison.
207         (finish_struct_1): Call it here instead after class has been
208         completed.
209         * pt.c (maybe_instantiate_noexcept): Call maybe_synthesize_method
210         instead of synthesize_method.
211
212 2021-10-05  Jakub Jelinek  <jakub@redhat.com>
213
214         PR c++/102548
215         * tree.c (apply_identity_attributes): Fix handling of the
216         case where an attribute in the list doesn't affect type
217         identity but some attribute before it does.
218
219 2021-10-05  Patrick Palka  <ppalka@redhat.com>
220
221         PR c++/102547
222         * constexpr.c (potential_constant_expression_1): Handle
223         NONTYPE_ARGUMENT_PACK.
224
225 2021-10-05  Patrick Palka  <ppalka@redhat.com>
226
227         PR c++/98930
228         * pt.c (has_value_dependent_address): Return true for a static
229         local variable from a function template.
230
231 2021-10-04  Marek Polacek  <polacek@redhat.com>
232
233         PR c++/97573
234         * typeck.c (cp_build_binary_op): Call do_warn_array_compare.
235
236 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
237
238         PR c++/101765
239         * coroutines.cc (register_local_var_uses): Emit a sorry if
240         we encounter a VLA in the coroutine local variables.
241
242 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
243
244         PR c++/99710
245         * coroutines.cc (await_statement_walker): Report an error if
246         an await expression is found in a handler body.
247
248 2021-10-03  John Eivind Helset  <jehelset@gmail.com>
249
250         PR c++/100673
251         * coroutines.cc (build_co_await): Guard against NULL
252         await_suspend types.
253
254 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
255
256         PR c++/101133
257         * coroutines.cc (build_co_await): Mark co_await_expr trees
258         with TREE_SIDE_EFFECTS, also mark any containing expression.
259         (finish_co_await_expr): Mark type-dependent co_await_expr
260         trees with TREE_SIDE_EFFECTS.
261
262 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
263
264         PR c++/99575
265         * coroutines.cc (build_co_await): Strip NOPs from
266         candidate awaiter expressions before testing to see
267         if they need a temporary.
268
269 2021-10-01  Martin Sebor  <msebor@redhat.com>
270
271         PR c/102103
272         * typeck.c (warn_for_null_address): Enhance.
273         (cp_build_binary_op): Call it also for member pointers.
274
275 2021-10-01  qingzhe huang  <nickhuang99@hotmail.com>
276
277         PR c++/101783
278         * tree.c (cp_build_qualified_type_real): Exclude typedef from
279         error.
280
281 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
282             Richard Biener  <rguenther@suse.de>
283
284         PR sanitizer/102515
285         * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
286         for division even for SANITIZE_SI_OVERFLOW.
287
288 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
289
290         * parser.c (cp_parser_omp_clause_order): Set
291         OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
292
293 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
294
295         PR c++/102496
296         * name-lookup.c (push_local_extern_decl_alias): Return early even for
297         tls vars with non-dependent type when processing_template_decl.  For
298         CP_DECL_THREAD_LOCAL_P vars call set_decl_tls_model on alias.
299
300 2021-09-30  Patrick Palka  <ppalka@redhat.com>
301
302         PR c++/102535
303         * method.c (is_xible_helper): Don't exit early for multi-arg
304         ctors in C++20.
305
306 2021-09-30  Patrick Palka  <ppalka@redhat.com>
307
308         * parser.c (cp_parser_trait_expr): Call nreverse on the reversed
309         list of trailing arguments.
310
311 2021-09-30  Patrick Palka  <ppalka@redhat.com>
312
313         PR c++/95567
314         * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields.
315
316 2021-09-28  Patrick Palka  <ppalka@redhat.com>
317
318         PR c++/99909
319         * pt.c (coerce_template_template_parms): Keep
320         processing_template_decl set around the call to unify as well.
321
322 2021-09-28  Iain Sandoe  <iain@sandoe.co.uk>
323
324         PR c++/102454
325         * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
326         unnamed function params.
327         (morph_fn_to_coro): Do not try to set a guard variable for param
328         DTORs in the ramp, unless we have exceptions active.
329
330 2021-09-27  Patrick Palka  <ppalka@redhat.com>
331
332         PR c++/102479
333         * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
334         Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
335         rewritten ttp.
336         (alias_ctad_tweaks): Set current_template_parms accordingly.
337
338 2021-09-23  Michel Morin  <mimomorin@gmail.com>
339
340         * parser.c (cp_keyword_starts_decl_specifier_p): Do not
341         handle RID_ATTRIBUTE.
342         (cp_parser_constructor_declarator_p): Remove now-redundant
343         checks.
344         (cp_parser_lambda_declarator_opt): Likewise.
345
346 2021-09-23  Michel Morin  <mimomorin@gmail.com>
347
348         PR c++/77565
349         * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
350         decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
351
352 2021-09-23  Patrick Palka  <ppalka@redhat.com>
353
354         * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
355         a TEMPLATE_DECL.  Dump the DECL_TEMPLATE_INFO rather than just
356         printing its pointer value.
357
358 2021-09-23  Jakub Jelinek  <jakub@redhat.com>
359
360         PR c++/102413
361         * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
362         is not followed by a balanced token sequence starting with open paren.
363
364 2021-09-22  Patrick Palka  <ppalka@redhat.com>
365
366         DR 2446
367         PR c++/102412
368         * constexpr.c (cxx_eval_constant_expression)
369         <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
370         instead of processing_template_decl.
371         * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
372         Return true only if any_dependent_template_arguments_p.
373         (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
374         <case TEMPLATE_ID_EXPR>: Likewise.
375
376 2021-09-22  Jakub Jelinek  <jakub@redhat.com>
377
378         * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
379         modifiers.
380         * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
381         semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
382         * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
383         also OMP_CLAUSE_ALLOCATE_ALIGN.
384
385 2021-09-22  Barrett Adair  <barrettellisadair@gmail.com>
386
387         * pt.c (find_parm_usage_r): New walk_tree callback to find func
388         parms.
389         (any_template_arguments_need_structural_equality_p): New special
390         case.
391
392 2021-09-21  wangpc  <pc.wang@linux.alibaba.com>
393
394         * decl.c (start_decl_1): Move verify_type_context to ...
395         (cp_finish_decl): ... to here.
396
397 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
398
399         * parser.c (cp_parser_omp_clause_order): Parse unconstrained
400         and reproducible modifiers.
401         (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
402
403 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
404
405         * parser.c (cp_parser_omp_clause_default): Handle private and
406         firstprivate arguments, adjust diagnostics on unknown argument.
407         * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
408
409 2021-09-18  Jason Merrill  <jason@redhat.com>
410
411         * cp-tree.h (dependentish_scope_p): Declare.
412         * pt.c (dependentish_scope_p): New.
413         * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
414         for lookup of a type in a dependent object.
415         (cp_parser_template_id): Handle TYPENAME_TYPE.
416         (cp_parser_template_name): If we're looking for a type,
417         a name followed by < names a template.
418
419 2021-09-18  Jason Merrill  <jason@redhat.com>
420
421         * cp-tree.h: Fix typo in LANG_FLAG list.
422
423 2021-09-17  Jakub Jelinek  <jakub@redhat.com>
424
425         * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
426         * parser.c (cp_parser_omp_atomic): Update function comment for
427         OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
428         weak clauses.
429         * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
430         them, handle COND_EXPRs.
431         * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
432         finish_omp_atomic can now produce.
433
434 2021-09-16  Patrick Palka  <ppalka@redhat.com>
435
436         PR c++/98486
437         * constraint.cc (get_normalized_constraints_from_decl): Always
438         look up constraints using the most general template.
439         * decl.c (grokdeclarator): Set constraints on a static data
440         member template.
441         * pt.c (determine_specialization): Check constraints on a
442         variable template.
443
444 2021-09-16  Iain Sandoe  <iain@sandoe.co.uk>
445
446         * coroutines.cc (await_statement_walker): Code cleanups.
447
448 2021-09-16  Jason Merrill  <jason@redhat.com>
449
450         * constexpr.c (cxx_eval_outermost_constant_expr): Use
451         protected_set_expr_location.
452
453 2021-09-15  Patrick Palka  <ppalka@redhat.com>
454
455         PR c++/101904
456         * call.c (build_user_type_conversion_1): Add tf_conv to complain.
457         (add_candidates): When in a SFINAE context, instead of adding a
458         candidate to bad_fns just mark it unviable.
459
460 2021-09-15  Jason Merrill  <jason@redhat.com>
461
462         * cp-tree.h (parsing_function_declarator): Declare.
463         * name-lookup.c (set_decl_context_in_fn): Use it.
464         * parser.c (cp_parser_direct_declarator): Use it.
465         (parsing_function_declarator): New.
466
467 2021-09-15  Jakub Jelinek  <jakub@redhat.com>
468
469         PR c++/88578
470         PR c++/102295
471         * typeck2.c (split_nonconstant_init_1): Don't throw away empty
472         initializers of flexible array members if they have non-zero type
473         size.
474
475 2021-09-15  Patrick Palka  <ppalka@redhat.com>
476
477         PR c++/102050
478         * decl.c (grok_special_member_properties): Set
479         TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
480         and TYPE_HAS_LIST_CTOR independently from each other.
481
482 2021-09-15  Jason Merrill  <jason@redhat.com>
483
484         * decl.c (cxx_init_decl_processing): Only warn about odd
485         interference sizes if they were specified with --param.
486
487 2021-09-15  Jason Merrill  <jason@redhat.com>
488
489         PR c++/48396
490         * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
491         (type_info_ptr_type): Remove.
492         * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
493         (typeid_ok_p): Check for null const_type_info_type_node.
494         (type_info_ptr_type, get_void_tinfo_ptr): New fns.
495         (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
496         (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
497         (get_tinfo_desc): Use const_ptr_type_node.
498
499 2021-09-15  Jason Merrill  <jason@redhat.com>
500
501         * parser.c (cp_parser_template_name): Move object type.
502         (cp_parser_pre_parsed_nested_name_specifier): Likewise.
503
504 2021-09-15  Jason Merrill  <jason@redhat.com>
505
506         * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
507         a declarator.
508
509 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
510
511         * coroutines.cc (struct param_info): Add copy_var.
512         (build_actor_fn): Use simplified param references.
513         (register_param_uses): Likewise.
514         (rewrite_param_uses): Likewise.
515         (analyze_fn_parms): New function.
516         (coro_rewrite_function_body): Add proxies for the fn
517         parameters to the outer bind scope of the rewritten code.
518         (morph_fn_to_coro): Use simplified version of param ref.
519
520 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
521
522         * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
523         coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
524         coro_self_handle_id, coro_actor_continue_id,
525         coro_frame_i_a_r_c_id): New.
526         (coro_init_identifiers): Initialize new name identifiers.
527         (coro_promise_type_found_p): Use pre-built identifiers.
528         (struct await_xform_data): Remove unused fields.
529         (transform_await_expr): Delete code that is now unused.
530         (build_actor_fn): Simplify interface, use pre-built identifiers and
531         remove transforms that are no longer needed.
532         (build_destroy_fn): Use revised field names.
533         (register_local_var_uses): Use pre-built identifiers.
534         (coro_rewrite_function_body): Simplify interface, use pre-built
535         identifiers.  Generate proxy vars in the outer bind expr scope for the
536         implementation state that we wish to expose.
537         (morph_fn_to_coro): Adjust comments for new variable names, use pre-
538         built identifiers.  Remove unused code to generate frame entries for
539         the implementation state.  Adjust call for build_actor_fn.
540
541 2021-09-14  Patrick Palka  <ppalka@redhat.com>
542
543         PR c++/102163
544         * constexpr.c (cxx_eval_call_expression): After evaluating a
545         subobject constructor call for an empty union member, produce a
546         side effect that makes sure the member gets activated.
547
548 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
549
550         PR c++/102295
551         * decl.c (layout_var_decl): For aggregates ending with a flexible
552         array member, add the size of the initializer for that member to
553         DECL_SIZE and DECL_SIZE_UNIT.
554
555 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
556
557         PR c++/102305
558         * method.c (is_xible_helper): Call complete_type on to.
559
560 2021-09-14  Jason Merrill  <jason@redhat.com>
561
562         * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
563         size is smaller than maxalign.
564
565 2021-09-13  Jason Merrill  <jason@redhat.com>
566
567         * constexpr.c (maybe_warn_about_constant_value):
568         Complain about std::hardware_destructive_interference_size.
569         (cxx_eval_constant_expression): Call it.
570         * decl.c (cxx_init_decl_processing): Check
571         --param *-interference-size values.
572
573 2021-09-13  Patrick Palka  <ppalka@redhat.com>
574
575         PR c++/101764
576         * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
577         macro.
578         * pt.c (has_extra_args_mechanism_p): New function.
579         (find_parameter_pack_data::found_extra_args_tree_p): New data
580         member.
581         (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
582         appropriately.
583         (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
584         ppd.found_extra_args_tree_p.
585         (use_pack_expansion_extra_args_p): Return true if there were
586         unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
587         (tsubst_pack_expansion): Pass the pack expansion to
588         use_pack_expansion_extra_args_p.
589
590 2021-09-10  Jakub Jelinek  <jakub@redhat.com>
591
592         * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
593         and acq_rel/acquire clauses on update.
594         * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
595
596 2021-09-08  Richard Biener  <rguenther@suse.de>
597
598         PR c++/102228
599         * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
600         * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
601         place on invalid code.
602         * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
603         access.
604         * module.cc (trees_in::read_class_def): Likewise.  Reconstruct
605         ANON_AGGR_TYPE_FIELD.
606         * semantics.c (finish_member_declaration): Populate
607         ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
608         * typeck.c (lookup_anon_field): Remove DFS search and return
609         ANON_AGGR_TYPE_FIELD directly.
610
611 2021-09-07  Jakub Jelinek  <jakub@redhat.com>
612
613         PR c++/100495
614         * constexpr.c (maybe_save_constexpr_fundef): Save body even for
615         constexpr deleting dtors.
616         (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
617         deleting dtors.
618
619 2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>
620
621         * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
622         directive.
623         * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
624
625 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
626
627         * coroutines.cc (register_local_var_uses): Do not mangle
628         frame entries for the outermost scope.  Record the outer
629         scope as nesting depth 0.
630
631 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
632
633         * coroutines.cc (coro_build_artificial_var): New.
634         (build_actor_fn): Use var builder, rename vars to use
635         implementation namespace.
636         (coro_rewrite_function_body): Likewise.
637         (morph_fn_to_coro): Likewise.
638
639 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
640
641         * coroutines.cc (transform_local_var_uses): Record
642         frame offset expressions as DECL_VALUE_EXPRs instead of
643         rewriting them.
644
645 2021-09-03  Patrick Palka  <ppalka@redhat.com>
646
647         PR c++/101904
648         * call.c (build_this_conversion): New function, split out from
649         add_function_candidate.
650         (add_function_candidate): New parameter shortcut_bad_convs.
651         Document it.  Use build_this_conversion.  Stop at the first bad
652         argument conversion when shortcut_bad_convs is true.
653         (add_template_candidate_real): New parameter shortcut_bad_convs.
654         Use build_this_conversion to check the 'this' conversion before
655         attempting deduction.  When the rejection reason code is
656         rr_bad_arg_conversion, pass -1 instead of 0 as the viable
657         parameter to add_candidate.  Pass 'convs' to add_candidate.
658         (add_template_candidate): New parameter shortcut_bad_convs.
659         (add_template_conv_candidate): Pass false as shortcut_bad_convs
660         to add_template_candidate_real.
661         (add_candidates): Prefer to shortcut bad conversions during
662         overload resolution under the assumption that we'll eventually
663         see a strictly viable candidate.  If this assumption turns out
664         to be false, re-process the non-strictly viable candidates
665         without shortcutting those bad conversions.
666
667 2021-09-03  Jason Merrill  <jason@redhat.com>
668
669         * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
670         we decide not to instantiate.
671
672 2021-09-03  Jakub Jelinek  <jakub@redhat.com>
673
674         PR target/102024
675         * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
676         instead of writing to DECL_FIELD_ABI_IGNORED.
677         (layout_class_type): Likewise.  In the place where zero-width
678         bitfields used to be removed, use
679         SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
680
681 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
682
683         * call.c (build_over_call): Handle unavailable state in addition to
684         deprecation.
685         * class.c (type_build_ctor_call): Likewise.
686         (type_build_dtor_call): Likewise.
687         * cp-tree.h: Rename cp_warn_deprecated_use to
688         cp_handle_deprecated_or_unavailable.
689         * decl.c (duplicate_decls): Merge unavailability.
690         (grokdeclarator): Handle unavailability in addition to deprecation.
691         (type_is_unavailable): New.
692         (grokparms): Handle unavailability in addition to deprecation.
693         * decl.h (enum deprecated_states): Add
694         UNAVAILABLE_DEPRECATED_SUPPRESS.
695         * decl2.c (cplus_decl_attributes): Propagate unavailability to
696         templates.
697         (cp_warn_deprecated_use): Rename to ...
698         (cp_handle_deprecated_or_unavailable): ... this and amend to handle
699         the unavailable case. It remains a warning in the case of deprecation
700         but becomes an error in the case of unavailability.
701         (cp_warn_deprecated_use_scopes): Handle unavailability.
702         (mark_used): Likewise.
703         * parser.c (cp_parser_template_name): Likewise.
704         (cp_parser_template_argument): Likewise.
705         (cp_parser_parameter_declaration_list): Likewise.
706         * typeck.c (build_class_member_access_expr): Likewise.
707         (finish_class_member_access_expr): Likewise.
708         * typeck2.c (build_functional_cast_1): Likewise.
709
710 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
711
712         * coroutines.cc (build_actor_fn): Add begin/finish clauses
713         to the initial test in the actor function.
714
715 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
716
717         * coroutines.cc (await_statement_walker): Use build_stmt and
718         add_stmt instead of build1 and finish_expr_stmt.
719
720 2021-08-31  Jason Merrill  <jason@redhat.com>
721
722         * coroutines.cc (flatten_await_stmt): Fix copyo.
723         * decl.c (reshape_init_class): Simplify.
724         * module.cc (module_state::read_language): Add null check.
725         * parser.c (build_range_temp): Avoid type_uses_auto.
726         (cp_parser_class_specifier_1): Add null check.
727
728 2021-08-31  Patrick Palka  <ppalka@redhat.com>
729
730         PR c++/12672
731         * call.c (rejection_reason::call_varargs_p): Rename this
732         previously unused member to ...
733         (rejection_reason::least_p): ... this.
734         (arity_rejection): Add least_p parameter.
735         (add_template_candidate_real): When there are explicit
736         template arguments, check that the arity of the call agrees with
737         the arity of the function before attempting deduction.
738         (print_arity_information): Add least_p parameter.
739         (print_z_candidate): Adjust call to print_arity_information.
740
741 2021-08-31  Martin Sebor  <msebor@redhat.com>
742
743         * parser.c (cp_parser_selection_statement): Use direct initialization
744         instead of copy.
745
746 2021-08-31  Jason Merrill  <jason@redhat.com>
747
748         * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
749
750 2021-08-31  Jason Merrill  <jason@redhat.com>
751
752         PR c++/92193
753         * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
754         * constexpr.c (cxx_eval_call_expression): Set it.
755         * pt.c (neglectable_inst_p): Check it.
756
757 2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>
758
759         * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
760         and 'ancestor' in 'target device' clauses.
761         * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
762         evaluate to '1' if 'ancestor' is used.
763
764 2021-08-30  Jason Merrill  <jason@redhat.com>
765
766         PR c++/96286
767         * cp-tree.h (struct lang_type): Add erroneous bit-field.
768         (CLASSTYPE_ERRONEOUS): New.
769         * pt.c (limit_bad_template_recursion): Check it.
770         (instantiate_class_template_1): Set it.
771
772 2021-08-30  Jason Merrill  <jason@redhat.com>
773
774         * constexpr.c (cxx_eval_outermost_constant_expr): Copy
775         expr location to result.
776
777 2021-08-30  Jason Merrill  <jason@redhat.com>
778
779         PR c++/101460
780         * cp-tree.h (cxx_constant_value_sfinae): Declare.
781         * constexpr.c (cxx_constant_value_sfinae): New.
782         * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
783         (tsubst_copy_and_build) [CALL_EXPR]: Call
784         maybe_fold_fn_template_args.
785
786 2021-08-30  Jason Merrill  <jason@redhat.com>
787
788         * parser.c (cp_parser_simple_requirement): Warn about missing
789         requires.
790
791 2021-08-27  Jason Merrill  <jason@redhat.com>
792
793         * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
794         a dependent pointer.
795
796 2021-08-25  Andrew Pinski  <apinski@marvell.com>
797
798         PR c++/66590
799         * cp-objcp-common.c (cxx_block_may_fallthru): Handle
800         CLEANUP_STMT for the case which will be try/finally.
801
802 2021-08-25  Jakub Jelinek  <jakub@redhat.com>
803
804         PR c++/102019
805         * init.c (build_value_init_noctor): Ignore unnamed zero-width
806         bitfields.
807
808 2021-08-23  Jakub Jelinek  <jakub@redhat.com>
809
810         * parser.c (cp_parser_omp_clause_num_tasks,
811         cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
812
813 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
814
815         * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
816         PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
817         (cp_parser_omp_error): New function.
818         (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
819
820 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
821
822         * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
823         comma at the end of list.  Don't parse closing paren here...
824         (cp_parser_omp_clause_depend): ... but here instead.
825
826 2021-08-19  Patrick Palka  <ppalka@redhat.com>
827
828         PR c++/101803
829         * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
830
831 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
832
833         * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
834         and optionally consume token if current token is CPP_EOF,
835         CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
836
837 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
838
839         * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
840         instead of cp_parser_skip_to_pragma_eol.
841
842 2021-08-18  Patrick Palka  <ppalka@redhat.com>
843
844         PR c++/101344
845         PR c++/101803
846         * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
847         * decl.c (reshape_init_r): Set it.
848         * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
849         iff CONSTRUCTOR_BRACES_ELIDED_P.
850
851 2021-08-18  Patrick Palka  <ppalka@redhat.com>
852
853         PR c++/101883
854         * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
855         do_auto_deduction.
856
857 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
858
859         * parser.c (cp_parser_omp_nothing): New function.
860         (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
861
862 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
863
864         * parser.c (cp_parser_omp_ordered): Return true instead of
865         false after emitting errors that the directive is not allowed in
866         pragma_stmt context.
867         (cp_parser_omp_target_update): Likewise.
868         (cp_parser_omp_cancellation_point): Change return type from void to
869         bool, return false if the directive should be ignored in pragma_stmt
870         contexts.
871         (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
872         Change return type from tree to bool, return false if the
873         directive should be ignored in pragma_stmt contexts.
874         (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
875         return their result directly.
876         (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
877         cp_parser_omp_cancellation_point returned.  Return true instead of
878         false after emitting errors that the directive is not allowed in
879         pragma_stmt context.
880
881 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
882
883         PR c++/101539
884         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
885         (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
886         (fold_builtin_is_corresponding_member, next_common_initial_seqence,
887         layout_compatible_type_p): Declare.
888         * parser.c (cp_parser_primary_expression): Handle
889         RID_IS_LAYOUT_COMPATIBLE.
890         (cp_parser_trait_expr): Likewise.
891         * cp-objcp-common.c (names_builtin_p): Likewise.
892         * constraint.cc (diagnose_trait_expr): Handle
893         CPTK_IS_LAYOUT_COMPATIBLE.
894         * decl.c (cxx_init_decl_processing): Register
895         __builtin_is_corresponding_member builtin.
896         * constexpr.c (cxx_eval_builtin_function_call): Handle
897         CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
898         * semantics.c (is_corresponding_member_union,
899         is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
900         New functions.
901         (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
902         (finish_trait_expr): Likewise.
903         * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
904         New functions.
905         * cp-gimplify.c (cp_gimplify_expr): Fold
906         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
907         (cp_fold): Likewise.
908         * tree.c (builtin_valid_in_constant_expr_p): Handle
909         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
910         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
911         CPTK_IS_LAYOUT_COMPATIBLE.
912         * class.c (remove_zero_width_bit_fields): Remove.
913         (layout_class_type): Don't call it.
914
915 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
916
917         * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
918         (cp_parser_omp_scope): New function.
919         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
920         * pt.c (tsubst_expr): Handle OMP_SCOPE.
921
922 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
923
924         * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
925         (cp_parser_omp_clause_filter): New function.
926         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
927         (OMP_MASKED_CLAUSE_MASK): Define.
928         (cp_parser_omp_masked): New function.
929         (cp_parser_omp_parallel): Handle parallel masked.
930         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
931         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
932         * pt.c (tsubst_omp_clauses): Likewise.
933         (tsubst_expr): Handle OMP_MASKED.
934
935 2021-08-12  Sergei Trofimovich  <siarheit@google.com>
936
937         PR c++/101219
938         * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
939         to construct ptrmemfunc expression instantiation.
940
941 2021-08-12  Tobias Burnus  <tobias@codesourcery.com>
942
943         * parser.c (cp_parser_omp_clause_proc_bind): Accept
944         'primary' as alias for 'master'.
945
946 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
947
948         * cp-tree.h (omp_declare_target_attr): New type.
949         (struct saved_scope): Change type of omp_declare_target_attribute
950         from int to vec<omp_declare_target_attr, va_gc> * and move it.
951         * parser.c (cp_parser_omp_declare_target): Instead of
952         incrementing scope_chain->omp_declare_target_attribute, push
953         a struct containing parser->lexer->in_omp_attribute_pragma to
954         the vector.
955         (cp_parser_omp_end_declare_target): Instead of decrementing
956         scope_chain->omp_declare_target_attribute, pop a structure
957         from it.  Diagnose mismatching declare target vs.
958         end declare target syntax.
959         * semantics.c (finish_translation_unit): Use vec_safe_length
960         and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
961         * decl2.c (cplus_decl_attributes): Use vec_safe_length
962         on scope_chain->omp_declare_target_attributes.
963
964 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
965
966         * parser.c (cp_parser_lambda_body): Add temp overrides
967         for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
968         (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
969         cp_parser_declaration_statement.
970         (cp_parser_default_argument): Add temp override for
971         parser->omp_attrs_forbidden_p.
972         (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
973         or declare variant in attribute syntax on a declaration immediately
974         following an OpenMP construct in pragma syntax.
975
976 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
977
978         PR c++/94162
979         * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
980         or for classes not in std namespace.
981
982 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
983
984         * name-lookup.c (finish_using_directive): Diagnose omp::directive
985         or omp::sequence attributes on using-directive.
986
987 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
988
989         * parser.c (cp_parser_block_declaration): Call
990         cp_parser_using_directive for C++11 attributes followed by
991         using namespace tokens.
992         (cp_parser_using_directive): Parse C++11 attributes at the start
993         of the directive rather than at the end, only parse GNU attributes
994         at the end.
995
996 2021-08-12  Patrick Palka  <ppalka@redhat.com>
997
998         PR c++/101663
999         * constexpr.c (cxx_eval_store_expression): Handle the lval=true
1000         case in the early exit code path for empty stores with mismatched
1001         types.
1002
1003 2021-08-11  Patrick Palka  <ppalka@redhat.com>
1004
1005         PR c++/101725
1006         DR 2082
1007         * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
1008         * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
1009         operands.
1010         * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
1011         reject uses of local variables in unevaluated contexts.
1012         * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
1013         cp_unevaluated_operand.  Use cp_walk_tree directly instead of
1014         WALK_SUBTREE to avoid the goto.  Use REQUIRES_EXPR_REQS instead
1015         of TREE_OPERAND directly.
1016
1017 2021-08-11  Jakub Jelinek  <jakub@redhat.com>
1018
1019         PR c++/101786
1020         * decl2.c (var_defined_without_dynamic_init): Return true for
1021         DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
1022
1023 2021-08-11  Patrick Palka  <ppalka@redhat.com>
1024
1025         PR c++/79501
1026         * parser.c (maybe_adjust_declarator_for_dguide): New, split
1027         out from ...
1028         (cp_parser_init_declarator): ... here.
1029         (cp_parser_member_declaration): Use it.
1030
1031 2021-08-11  Patrick Palka  <ppalka@redhat.com>
1032
1033         PR c++/89062
1034         * parser.c (cp_parser_parameter_declaration_list): Don't call
1035         grokdeclarator if cp_parser_error_occurred.
1036         (cp_parser_parameter_declaration): Simulate an error if we see
1037         the beginning of a CTAD form, i.e. if we see an opening brace
1038         after the decl-specifier-seq and the type is a CTAD placeholder.
1039
1040 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
1041
1042         * parser.c (cp_parser_member_declaration): Move odsd declaration
1043         before cp_parser_using_declaration call to avoid errors with
1044         GCC 4.8 to 6.
1045
1046 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
1047
1048         * parser.h (struct cp_omp_declare_simd_data): Remove
1049         in_omp_attribute_pragma and clauses members, add loc and attribs.
1050         (struct cp_oacc_routine_data): Remove loc member, add clauses
1051         member.
1052         * parser.c (cp_finalize_omp_declare_simd): New function.
1053         (cp_parser_handle_statement_omp_attributes): Mention in
1054         function comment the function is used also for
1055         attribute-declaration.
1056         (cp_parser_handle_directive_omp_attributes): New function.
1057         (cp_parser_statement): Don't call
1058         cp_parser_handle_statement_omp_attributes if statement doesn't
1059         have attribute-specifier-seq at the beginning at all or if
1060         if those attributes don't appertain to the statement.
1061         (cp_parser_simple_declaration): Call
1062         cp_parser_handle_directive_omp_attributes and
1063         cp_finalize_omp_declare_simd.
1064         (cp_parser_explicit_instantiation): Likewise.
1065         (cp_parser_init_declarator): Initialize prefix_attributes
1066         only after parsing declarators.
1067         (cp_parser_direct_declarator): Call
1068         cp_parser_handle_directive_omp_attributes and
1069         cp_finalize_omp_declare_simd.
1070         (cp_parser_member_declaration): Likewise.
1071         (cp_parser_single_declaration): Likewise.
1072         (cp_parser_omp_declare_simd): Don't initialize
1073         data.in_omp_attribute_pragma, instead initialize
1074         data.attribs[0] and data.attribs[1].
1075         (cp_finish_omp_declare_variant): Remove
1076         in_omp_attribute_pragma argument, instead use
1077         parser->lexer->in_omp_attribute_pragma.
1078         (cp_parser_late_parsing_omp_declare_simd): Adjust
1079         cp_finish_omp_declare_variant caller.  Handle attribute-syntax
1080         declare simd/variant.
1081
1082 2021-08-06  Tamar Christina  <tamar.christina@arm.com>
1083
1084         * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
1085         * decl.c (cxx_simulate_enum_decl): Likewise.
1086
1087 2021-08-04  Jakub Jelinek  <jakub@redhat.com>
1088
1089         PR c++/101759
1090         * parser.c (cp_parser_default_argument): Temporarily override
1091         parser->omp_declare_simd and parser->oacc_routine to NULL.
1092
1093 2021-08-02  Patrick Palka  <ppalka@redhat.com>
1094
1095         PR c++/100828
1096         * logic.cc (formula::formula): Use emplace_back instead of
1097         push_back.
1098         (formula::branch): Insert a copy of m_current directly after
1099         m_current instead of at the end of the list.
1100         (formula::erase): Define.
1101         (decompose_formula): Remove.
1102         (decompose_antecedents): Remove.
1103         (decompose_consequents): Remove.
1104         (derive_proofs): Remove.
1105         (max_problem_size): Remove.
1106         (diagnose_constraint_size): Remove.
1107         (subsumes_constraints_nonnull): Rewrite directly in terms of
1108         decompose_clause and derive_proof, interleaving decomposition
1109         with implication checking.  Remove limit on constraint complexity.
1110         Use formula::erase to free the current clause before moving on to
1111         the next one.
1112
1113 2021-07-31  Jason Merrill  <jason@redhat.com>
1114
1115         PR c++/96636
1116         * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
1117         after error.
1118
1119 2021-07-31  Jason Merrill  <jason@redhat.com>
1120
1121         * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
1122         PACK_EXPANSION_PATTERN.
1123
1124 2021-07-31  Jakub Jelinek  <jakub@redhat.com>
1125
1126         * parser.c (cp_parser_declaration): Handle OpenMP directives
1127         in attribute-declaration.
1128
1129 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
1130
1131         PR c++/101539
1132         * cp-tree.h (enum cp_trait_kind): Add
1133         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1134         (enum cp_built_in_function): Add
1135         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
1136         (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
1137         * parser.c (cp_parser_primary_expression): Handle
1138         RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1139         (cp_parser_trait_expr): Likewise.
1140         * cp-objcp-common.c (names_builtin_p): Likewise.
1141         * constraint.cc (diagnose_trait_expr): Handle
1142         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1143         * decl.c (cxx_init_decl_processing): Register
1144         __builtin_is_pointer_interconvertible_with_class builtin.
1145         * constexpr.c (cxx_eval_builtin_function_call): Handle
1146         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
1147         * semantics.c (pointer_interconvertible_base_of_p,
1148         first_nonstatic_data_member_p,
1149         fold_builtin_is_pointer_inverconvertible_with_class): New functions.
1150         (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1151         (finish_trait_expr): Likewise.  Formatting fix.
1152         * cp-gimplify.c (cp_gimplify_expr): Fold
1153         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
1154         fndecl_built_in_p just once.
1155         (cp_fold): Likewise.
1156         * tree.c (builtin_valid_in_constant_expr_p): Handle
1157         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
1158         fndecl_built_in_p just once.
1159         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1160         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1161
1162 2021-07-30  Jason Merrill  <jason@redhat.com>
1163
1164         * class.c (finish_struct_anon): Improve comment.
1165         * decl.c (fixup_anonymous_aggr): Reject anonymous struct
1166         with bases.
1167
1168 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
1169
1170         * parser.c (cp_parser_statement): Rollback attributes not just
1171         when std_attrs is non-NULL, but whenever
1172         cp_parser_std_attribute_spec_seq parsed any tokens.
1173
1174 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
1175
1176         PR c++/101582
1177         * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
1178         declaration.
1179         (cp_parser_declaration): Parse empty-declaration and
1180         attribute-declaration.
1181         (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
1182
1183 2021-07-28  Martin Sebor  <msebor@redhat.com>
1184
1185         * init.c: Include new header.
1186
1187 2021-07-27  Marek Polacek  <polacek@redhat.com>
1188
1189         DR 1512
1190         PR c++/99701
1191         * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
1192         a switch.
1193         * typeck.c (cp_build_binary_op): Reject ordered comparison
1194         of two null pointers.
1195
1196 2021-07-26  Jakub Jelinek  <jakub@redhat.com>
1197
1198         * parser.h (struct cp_lexer): Add orphan_p member.
1199         * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
1200         upon restart from CPP_PRAGMA handling.  Fix up condition when a lexer
1201         should be destroyed and adjust saved_tokens if it records tokens from
1202         the to be destroyed lexer.
1203         (cp_parser_omp_section_scan): New function.
1204         (cp_parser_omp_scan_loop_body): Use it.  If
1205         parser->lexer->in_omp_attribute_pragma, allow optional comma
1206         after scan.
1207         (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
1208
1209 2021-07-23  Jakub Jelinek  <jakub@redhat.com>
1210
1211         * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
1212         * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
1213         mixing of attribute and pragma syntax directives when seeing
1214         omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
1215         directives are followed by OpenMP pragma.
1216         (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
1217         the cp_parser_handle_statement_omp_attributes call.
1218         (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
1219         if true, set parser->omp_attrs_forbidden_p.
1220         (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
1221         false as disallow_omp_attrs to cp_parser_omp_structured_block.
1222         (cp_parser_omp_parallel, cp_parser_omp_task): Set
1223         parser->omp_attrs_forbidden_p.
1224
1225 2021-07-21  Thomas Schwinge  <thomas@codesourcery.com>
1226             Joseph Myers  <joseph@codesourcery.com>
1227             Cesar Philippidis  <cesar@codesourcery.com>
1228
1229         * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
1230         (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
1231         (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
1232         * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
1233         * semantics.c (finish_omp_clauses): Likewise.
1234
1235 2021-07-21  Jakub Jelinek  <jakub@redhat.com>
1236
1237         PR c++/101516
1238         * semantics.c (finish_omp_reduction_clause): Also call
1239         complete_type_or_else and return true if it fails.
1240
1241 2021-07-19  Iain Sandoe  <iain@sandoe.co.uk>
1242
1243         PR c++/95520
1244         * coroutines.cc (struct coroutine_info): Add fields for
1245         actor and destroy function decls.
1246         (to_ramp): New.
1247         (coro_get_ramp_function): New.
1248         (coro_get_actor_function): New.
1249         (coro_get_destroy_function): New.
1250         (act_des_fn): Set up mapping between ramp, actor and
1251         destroy functions.
1252         (morph_fn_to_coro): Adjust interface to the builder for
1253         helper function decls.
1254         * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
1255         JOIN_STR): New.
1256         * mangle.c (write_encoding): Handle coroutine helpers.
1257         (write_unqualified_name): Handle lambda coroutine helpers.
1258
1259 2021-07-16  Patrick Palka  <ppalka@redhat.com>
1260
1261         PR c++/101233
1262         * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
1263         substituting DECL_ARGUMENTS.
1264
1265 2021-07-16  Patrick Palka  <ppalka@redhat.com>
1266
1267         DR 960
1268         PR c++/99664
1269         * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
1270         when the return types are references.
1271
1272 2021-07-16  Marek Polacek  <polacek@redhat.com>
1273
1274         * typeck2.c (check_narrowing): Don't suppress the pedantic error
1275         in system headers.
1276
1277 2021-07-15  Jakub Jelinek  <jakub@redhat.com>
1278
1279         PR c++/101443
1280         * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
1281         operands, fold them right away to true or false.
1282
1283 2021-07-15  Jason Merrill  <jason@redhat.com>
1284
1285         PR c++/101095
1286         * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
1287         (cp_tree_size): Remove redundant entries.
1288
1289 2021-07-14  Patrick Palka  <ppalka@redhat.com>
1290
1291         PR c++/88252
1292         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
1293         * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1294         handling.
1295         (redeclare_class_template): Likewise.
1296         (forwarding_reference_p): Define.
1297         (maybe_adjust_types_for_deduction): Use it instead.  Add 'tparms'
1298         parameter.
1299         (unify_one_argument): Pass tparms to
1300         maybe_adjust_types_for_deduction.
1301         (try_one_overload): Likewise.
1302         (unify): Likewise.
1303         (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
1304         handling.
1305
1306 2021-07-14  Jason Merrill  <jason@redhat.com>
1307
1308         * class.c (struct find_final_overrider_data): Use auto_vec.
1309         (find_final_overrider): Remove explicit release.
1310         * coroutines.cc (process_conditional): Use auto_vec.
1311         * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
1312         (cp_genericize_tree): Remove explicit release.
1313         * parser.c (cp_parser_objc_at_property_declaration): Use
1314         auto_delete_vec.
1315         * semantics.c (omp_reduction_lookup): Use auto_vec.
1316
1317 2021-07-14  Marek Polacek  <polacek@redhat.com>
1318
1319         PR c++/101371
1320         * constexpr.c (cxx_eval_array_reference): Create a new .object
1321         and .ctor for the non-aggregate non-scalar case too when
1322         value-initializing.
1323
1324 2021-07-12  Patrick Palka  <ppalka@redhat.com>
1325
1326         PR c++/79501
1327         PR c++/100983
1328         * decl.c (grokfndecl): Don't require that deduction guides are
1329         declared at namespace scope.  Check that class-scope deduction
1330         guides have the same access as the member class template.
1331         (grokdeclarator): Pretend class-scope deduction guides are static.
1332         * search.c (lookup_member): Don't use a BASELINK for (class-scope)
1333         deduction guides.
1334
1335 2021-07-10  Patrick Palka  <ppalka@redhat.com>
1336
1337         PR c++/82110
1338         * init.c (build_aggr_init): Return error_mark_node if
1339         expand_aggr_init_1 returns false.
1340         (expand_default_init): Change return type to bool.  Return false
1341         on error, true on success.
1342         (expand_aggr_init_1): Likewise.
1343
1344 2021-07-09  Jason Merrill  <jason@redhat.com>
1345
1346         PR c++/101098
1347         * decl.c (function_requirements_equivalent_p): Only compare
1348         trailing requirements on a specialization.
1349
1350 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1351
1352         * coroutines.cc (build_actor_fn): Move common code to
1353         act_des_fn.
1354         (build_destroy_fn): Likewise.
1355         (act_des_fn): Build the void return here.  Ensure that the
1356         source location matches the original function.
1357
1358 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
1359
1360         * coroutines.cc
1361         (coro_rewrite_function_body): Connect the replacement
1362         function block to the block nest correctly.
1363
1364 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1365
1366         PR c++/101181
1367         * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
1368         add_extra_args.
1369         * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
1370         * pt.c (build_extra_args): Make a copy of args.
1371         (add_extra_args): Add complain/in_decl parameters.  Enable the
1372         code for handling the case where the extra arguments are
1373         dependent.
1374         (tsubst_pack_expansion): Pass complain/in_decl to
1375         add_extra_args.
1376         (tsubst_template_args): Handle missing template arguments.
1377         (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
1378         add_extra_args.
1379
1380 2021-07-09  Patrick Palka  <ppalka@redhat.com>
1381
1382         PR c++/101247
1383         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
1384         DECL_CONTEXT.
1385
1386 2021-07-08  Martin Sebor  <msebor@redhat.com>
1387
1388         PR bootstrap/101372
1389         * module.cc (identifier): Suppress warning.
1390         (module_state::read_macro_maps): Remove warning suppression.
1391         (module_state::install_macros): Ditto.
1392
1393 2021-07-08  Marek Polacek  <polacek@redhat.com>
1394
1395         PR c++/101087
1396         * cp-tree.h (unevaluated_p): New.
1397         * except.c (check_noexcept_r): Use it.  Don't walk into
1398         unevaluated operands.
1399
1400 2021-07-08  Martin Sebor  <msebor@redhat.com>
1401
1402         PR bootstrap/101374
1403         * module.cc (module_state::read_macro_maps): Temporarily disable
1404         -Warray-bounds.
1405         (module_state::install_macros): Same.
1406
1407 2021-07-06  Martin Sebor  <msebor@redhat.com>
1408
1409         * error.c (cp_printer):  Remove support for %G and %K.
1410
1411 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1412
1413         * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
1414         (struct cp_omp_declare_simd_data): Likewise.
1415         * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
1416         (omp_identifier): Define.
1417         * parser.c (cp_parser_skip_to_pragma_eol): Handle
1418         in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
1419         (cp_parser_require_pragma_eol): Likewise.
1420         (struct cp_omp_attribute_data): New type.
1421         (cp_parser_handle_statement_omp_attributes): New function.
1422         (cp_parser_statement): Handle OpenMP directives in statement's
1423         attribute-specifier-seq.
1424         (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
1425         functions.
1426         (cp_parser_std_attribute): Handle omp::directive and omp::sequence
1427         attributes.
1428         (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
1429         a comma also before the first clause.
1430         (cp_parser_omp_allocate): Likewise.
1431         (cp_parser_omp_atomic): Likewise.
1432         (cp_parser_omp_depobj): Likewise.
1433         (cp_parser_omp_flush): Likewise.
1434         (cp_parser_omp_ordered): Likewise.
1435         (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
1436         into struct cp_omp_declare_simd_data.
1437         (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
1438         argument.  If set, allow a comma also before match clause.
1439         (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
1440         allow a comma also before the first clause.  Adjust
1441         cp_finish_omp_declare_variant caller.
1442         (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
1443         a comma also before the first clause.
1444         (cp_parser_omp_declare_reduction_exprs): Likewise.
1445         (cp_parser_omp_requires): Likewise.
1446         * decl.c (initialize_predefined_identifiers): Initialize
1447         omp_identifier.
1448         * decl2.c (cplus_decl_attributes): Reject omp::directive and
1449         omp::sequence attributes.
1450
1451 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
1452
1453         PR c/101297
1454         * parser.c (cp_parser_omp_atomic): Consume comma only if it
1455         appears before a CPP_NAME.
1456
1457 2021-07-02  Patrick Palka  <ppalka@redhat.com>
1458
1459         PR c++/101247
1460         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
1461         use common_enclosing_class and to not depend on the TREE_TYPE
1462         of outer levels pointing to the corresponding primary template.
1463
1464 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1465
1466         PR c++/101194
1467         * constexpr.c (cxx_eval_array_reference): When the element type
1468         is an empty type and the corresponding element is omitted, just
1469         return an empty CONSTRUCTOR instead of attempting value
1470         initialization.
1471
1472 2021-07-01  Patrick Palka  <ppalka@redhat.com>
1473
1474         PR c++/96204
1475         * pt.c (finish_template_variable): Pass the partially
1476         instantiated template and its args to instantiate_template.
1477         (instantiate_class_template_1): No need to call
1478         push_nested_class and pop_nested_class around the call to
1479         most_specialized_partial_spec.
1480         (instantiate_template_1): Pass the partially instantiated
1481         template to lookup_template_variable.
1482         (most_specialized_partial_spec):  Use push_access_scope_guard
1483         to set the access scope appropriately.  Use
1484         deferring_access_check_sentinel to force access to get checked
1485         immediately.
1486         (instantiate_decl): Just pass the VAR_DECL to
1487         most_specialized_partial_spec.
1488
1489 2021-06-30  Patrick Palka  <ppalka@redhat.com>
1490
1491         * constraint.cc (get_normalized_constraints_from_decl): Use
1492         push_access_scope_guard instead of push_nested_class_guard.
1493         * cp-tree.h (struct push_nested_class_guard): Replace with ...
1494         (struct push_access_scope_guard): ... this.
1495         * pt.c (push_access_scope): When the argument corresponds to
1496         a class type, push the class instead of its context.
1497         (pop_access_scope): Adjust accordingly.
1498
1499 2021-06-30  Marek Polacek  <polacek@redhat.com>
1500
1501         PR c++/100975
1502         DR 2397
1503         * decl.c (create_array_type_for_decl): Allow array of auto.
1504
1505 2021-06-29  Jason Merrill  <jason@redhat.com>
1506
1507         * pt.c (instantiate_decl): Only consider partial specializations of
1508         actual variable templates.
1509
1510 2021-06-26  Patrick Palka  <ppalka@redhat.com>
1511
1512         PR c++/96204
1513         * pt.c (instantiate_class_template_1): Enter the scope of the
1514         type when calling most_specialized_partial_spec.
1515
1516 2021-06-26  Jason Merrill  <jason@redhat.com>
1517
1518         PR c++/101040
1519         PR c++/97566
1520         * class.c (is_empty_field): Handle null argument.
1521         * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
1522         for empty field.
1523
1524 2021-06-26  Marek Polacek  <polacek@redhat.com>
1525
1526         PR c++/100752
1527         * parser.c (cp_parser_declarator): Pass flags down to
1528         cp_parser_declarator.  Also pass static_p/member_p.
1529
1530 2021-06-25  Martin Sebor  <msebor@redhat.com>
1531
1532         * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
1533         with warning_suppressed_p, suppress_warning, and copy_no_warning, or
1534         nothing if not necessary.
1535         (set_up_extended_ref_temp): Same.
1536         * class.c (layout_class_type): Same.
1537         * constraint.cc (constraint_satisfaction_value): Same.
1538         * coroutines.cc (finish_co_await_expr): Same.
1539         (finish_co_yield_expr): Same.
1540         (finish_co_return_stmt): Same.
1541         (build_actor_fn): Same.
1542         (coro_rewrite_function_body): Same.
1543         (morph_fn_to_coro): Same.
1544         * cp-gimplify.c (genericize_eh_spec_block): Same.
1545         (gimplify_expr_stmt): Same.
1546         (cp_genericize_r): Same.
1547         (cp_fold): Same.
1548         * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
1549         * cvt.c (cp_fold_convert): Same.
1550         (convert_to_void): Same.
1551         * decl.c (wrapup_namespace_globals): Same.
1552         (grokdeclarator): Same.
1553         (finish_function): Same.
1554         (require_deduced_type): Same.
1555         * decl2.c (no_linkage_error): Same.
1556         (c_parse_final_cleanups): Same.
1557         * except.c (expand_end_catch_block): Same.
1558         * init.c (build_new_1): Same.
1559         (build_new): Same.
1560         (build_vec_delete_1): Same.
1561         (build_vec_init): Same.
1562         (build_delete): Same.
1563         * method.c (defaultable_fn_check): Same.
1564         * parser.c (cp_parser_fold_expression): Same.
1565         (cp_parser_primary_expression): Same.
1566         * pt.c (push_tinst_level_loc): Same.
1567         (tsubst_copy): Same.
1568         (tsubst_omp_udr): Same.
1569         (tsubst_copy_and_build): Same.
1570         * rtti.c (build_if_nonnull): Same.
1571         * semantics.c (maybe_convert_cond): Same.
1572         (finish_return_stmt): Same.
1573         (finish_parenthesized_expr): Same.
1574         (cp_check_omp_declare_reduction): Same.
1575         * tree.c (build_cplus_array_type): Same.
1576         * typeck.c (build_ptrmemfunc_access_expr): Same.
1577         (cp_build_indirect_ref_1): Same.
1578         (cp_build_function_call_vec): Same.
1579         (warn_for_null_address): Same.
1580         (cp_build_binary_op): Same.
1581         (unary_complex_lvalue): Same.
1582         (cp_build_modify_expr): Same.
1583         (build_x_modify_expr): Same.
1584         (convert_for_assignment): Same.
1585
1586 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1587
1588         PR c++/98832
1589         * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1590
1591 2021-06-24  Patrick Palka  <ppalka@redhat.com>
1592
1593         PR c++/101182
1594         * constraint.cc (evaluate_requires_expr): Adjust function comment.
1595         * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1596         (cp_fold) <case REQUIRES_EXPR>: ... here.
1597
1598 2021-06-24  Jakub Jelinek  <jakub@redhat.com>
1599
1600         * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1601         C_ORT_OMP for clauses on target construct.
1602         (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1603         (cp_parser_omp_target): For non-combined target add
1604         map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION.  Pass
1605         C_ORT_OMP_TARGET to finish_omp_clauses.
1606         * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1607         for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1608         never present on C_ORT_*DECLARE_SIMD.
1609         (handle_omp_array_sections): Likewise.
1610         (finish_omp_clauses): Likewise.  Handle OMP_CLAUSE_IN_REDUCTION
1611         on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1612         corresponding map clauses.
1613         * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1614         clauses on target construct.
1615
1616 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1617
1618         PR c++/101174
1619         * pt.c (push_access_scope): For artificial deduction guides,
1620         set the access scope to that of the constructor.
1621         (pop_access_scope): Likewise.
1622         (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1623
1624 2021-06-23  Patrick Palka  <ppalka@redhat.com>
1625
1626         PR c++/86439
1627         * call.c (print_error_for_call_failure): Constify 'args' parameter.
1628         (perform_dguide_overload_resolution): Define.
1629         * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1630         * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1631         instead of build_new_function_call.  Don't use tf_decltype or
1632         set cp_unevaluated_operand.  Remove unnecessary NULL_TREE tests.
1633
1634 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1635
1636         PR c++/67302
1637         * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1638         sooner, before the NRVO handling.
1639
1640 2021-06-21  Patrick Palka  <ppalka@redhat.com>
1641
1642         PR c++/80431
1643         * tree.c (bot_replace): Use convert_to_base to build the
1644         conversion to the (morally) virtual base.
1645
1646 2021-06-21  Jakub Jelinek  <jakub@redhat.com>
1647
1648         PR inline-asm/100785
1649         * typeck.c (cxx_mark_addressable): Diagnose trying to make
1650         bit-fields addressable.
1651
1652 2021-06-17  Jason Merrill  <jason@redhat.com>
1653
1654         PR c++/101106
1655         * decl.c (duplicate_decls): Make 'deleted after first declaration'
1656         pedwarn on by default.
1657
1658 2021-06-17  Jason Merrill  <jason@redhat.com>
1659
1660         PR c++/101029
1661         * init.c (build_vec_init): Preserve the type of base.
1662
1663 2021-06-16  Jason Merrill  <jason@redhat.com>
1664
1665         PR c++/101078
1666         PR c++/91706
1667         * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1668
1669 2021-06-15  Robin Dapp  <rdapp@linux.ibm.com>
1670
1671         * decl.c (duplicate_decls): Likewise.
1672
1673 2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
1674
1675         PR c/100913
1676         * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1677         var in the error case.
1678
1679 2021-06-13  Trevor Saunders  <tbsaunde@tbsaunde.org>
1680
1681         * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1682         with range based for.
1683         (cxx_eval_store_expression): Likewise.
1684         (cxx_eval_loop_expr): Likewise.
1685         * decl.c (wrapup_namespace_globals): Likewise.
1686         (cp_finish_decl): Likewise.
1687         (cxx_simulate_enum_decl): Likewise.
1688         * parser.c (cp_parser_postfix_expression): Likewise.
1689
1690 2021-06-12  Jason Merrill  <jason@redhat.com>
1691
1692         PR c++/101029
1693         * init.c (build_vec_init): Shortcut [0] case.
1694
1695 2021-06-12  Jason Merrill  <jason@redhat.com>
1696
1697         * pt.c (lookup_template_class_1): Shortcut current_class_type.
1698
1699 2021-06-11  Patrick Palka  <ppalka@redhat.com>
1700
1701         DR 1227
1702         PR c++/96560
1703         * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1704         TYPE_ARG_TYPES in forward order while short circuiting
1705         appropriately.  Adjust formatting.
1706
1707 2021-06-11  Jakub Jelinek  <jakub@redhat.com>
1708
1709         PR c++/100974
1710         * cp-tree.h (struct saved_scope): Add consteval_if_p
1711         member.  Formatting fix for the discarded_stmt comment.
1712         (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1713         * parser.c (cp_parser_lambda_expression): Temporarily disable
1714         in_consteval_if_p when parsing lambda body.
1715         (cp_parser_selection_statement): Parse consteval if.
1716         * decl.c (struct named_label_entry): Add in_consteval_if member.
1717         (level_for_consteval_if): New function.
1718         (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1719         consteval if.
1720         * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1721         why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1722         for !ctx->manifestly_const_eval.
1723         (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1724         condition as if it was __builtin_is_constant_evaluated call.
1725         (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1726         recurse on both branches.
1727         * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1728         as the else branch.
1729         * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1730         Temporarily set in_consteval_if_p when recursing on
1731         IF_STMT_CONSTEVAL_P then branch.
1732         (tsubst_lambda_expr): Temporarily disable
1733         in_consteval_if_p when instantiating lambda body.
1734         * call.c (immediate_invocation_p): Return false when
1735         in_consteval_if_p.
1736
1737 2021-06-11  Marek Polacek  <polacek@redhat.com>
1738
1739         PR c++/100995
1740         * constexpr.c (maybe_constexpr_fn): New.
1741         * cp-tree.h (maybe_constexpr_fn): Declare.
1742         * semantics.c (find_std_constant_evaluated_r): New.
1743         (maybe_warn_for_constant_evaluated): New.
1744         (finish_if_stmt_cond): Call it.
1745
1746 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1747
1748         PR c++/67829
1749         * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1750         the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1751         a template template parameter, adjust to the
1752         TEMPLATE_TEMPLATE_PARAMETER before falling through.
1753
1754 2021-06-10  Patrick Palka  <ppalka@redhat.com>
1755
1756         PR c++/100946
1757         * constraint.cc (normalize_placeholder_type_constraints): When
1758         normalizing a non-templated return-type-requirement, add a dummy
1759         level to initial_parms.
1760
1761 2021-06-08  Marek Polacek  <polacek@redhat.com>
1762
1763         PR c++/100065
1764         * decl.c (grokdeclarator): Store a value-dependent
1765         explicit-specifier even for deduction guides.
1766
1767 2021-06-08  Jason Merrill  <jason@redhat.com>
1768
1769         * parser.c (cp_parser_string_literal): Adjust diagnostic.
1770
1771 2021-06-08  Jason Merrill  <jason@redhat.com>
1772
1773         PR c++/100963
1774         * call.c (perfect_conversion_p): Check check_narrowing.
1775
1776 2021-06-08  Jason Merrill  <jason@redhat.com>
1777
1778         PR c++/91706
1779         * name-lookup.c (get_class_binding): Keep a BASELINK.
1780         (set_inherited_value_binding_p): Adjust.
1781         * lambda.c (is_lambda_ignored_entity): Adjust.
1782         * pt.c (lookup_template_function): Copy a BASELINK before
1783         modifying it.
1784
1785 2021-06-08  Jason Merrill  <jason@redhat.com>
1786
1787         PR c++/91706
1788         * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1789
1790 2021-06-08  Jason Merrill  <jason@redhat.com>
1791
1792         * module.cc (duplicate_hash::hash): Comment out.
1793         (trees_in::tree_value): Adjust loop counter.
1794
1795 2021-06-08  Jason Merrill  <jason@redhat.com>
1796
1797         PR c++/100102
1798         * init.c (build_offset_ref): Return the BASELINK for a static
1799         member function.
1800
1801 2021-06-07  Patrick Palka  <ppalka@redhat.com>
1802
1803         PR c++/100918
1804         * parser.c (cp_parser_lookup_name): Check access of the lookup
1805         result before we potentially adjust an injected-class-name to
1806         its TEMPLATE_DECL.
1807
1808 2021-06-06  Jakub Jelinek  <jakub@redhat.com>
1809
1810         PR c/100902
1811         * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1812         even when target is combined with other constructs.
1813
1814 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1815
1816         PR c++/100893
1817         * pt.c (convert_template_argument): Strip top-level cv-quals
1818         on the substituted type of a non-type template parameter.
1819
1820 2021-06-04  Patrick Palka  <ppalka@redhat.com>
1821
1822         PR c++/100102
1823         * pt.c (tsubst_function_decl): Remove old code for reducing
1824         args when it has excess levels.
1825
1826 2021-06-04  Jakub Jelinek  <jakub@redhat.com>
1827
1828         PR c++/100872
1829         * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1830         ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1831         to the start.
1832
1833 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1834
1835         PR c++/100592
1836         * decl.c (make_typename_type): After calling
1837         lookup_template_class, adjust the result to its TYPE_NAME and
1838         then consider the tf_keep_type_decl flag.
1839
1840 2021-06-03  Patrick Palka  <ppalka@redhat.com>
1841
1842         PR c++/100862
1843         * pt.c (set_current_access_from_decl): Move to ...
1844         * class.c (set_current_access_from_decl): ... here.
1845         (handle_using_decl): Use it to propagate the access of the
1846         using-enum decl to the copy of the imported enumerator.
1847         * cp-tree.h (set_current_access_from_decl): Declare.
1848         * decl.c (build_enumerator): Simplify using make_temp_override
1849         and set_current_access_from_decl.
1850
1851 2021-06-03  Jakub Jelinek  <jakub@redhat.com>
1852
1853         PR c++/100859
1854         * semantics.c (handle_omp_array_sections_1): For
1855         OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1856         finish_non_static_data_member and allow this as base.
1857         (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1858         after depend only cases.  Let this be diagnosed by !lvalue_p
1859         case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1860         assert.
1861         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1862
1863 2021-06-02  Jason Merrill  <jason@redhat.com>
1864
1865         PR c++/100838
1866         * call.c (convert_like_internal): Clear tf_no_cleanup when
1867         recursing.
1868         (build_user_type_conversion_1): Only add ck_rvalue if
1869         LOOKUP_ONLYCONVERTING.
1870
1871 2021-06-01  Patrick Palka  <ppalka@redhat.com>
1872
1873         PR c++/65816
1874         * init.c (expand_aggr_init_1): Check
1875         type_has_non_user_provided_default_constructor instead of
1876         type_has_user_provided_constructor.
1877
1878 2021-06-01  Jason Merrill  <jason@redhat.com>
1879
1880         PR c++/91859
1881         * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1882         for destroying delete.
1883         * init.c (build_delete): Don't clobber before destroying delete.
1884
1885 2021-06-01  Jason Merrill  <jason@redhat.com>
1886
1887         PR c++/94492
1888         * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1889
1890 2021-05-31  Richard Biener  <rguenther@suse.de>
1891
1892         PR c++/88601
1893         * cp-objcp-common.c (names_builtin_p): Handle
1894         RID_BUILTIN_SHUFFLEVECTOR.
1895         * cp-tree.h (build_x_shufflevector): Declare.
1896         * parser.c (cp_parser_postfix_expression): Handle
1897         RID_BUILTIN_SHUFFLEVECTOR.
1898         * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1899         * typeck.c (build_x_shufflevector): Build either a lowered
1900         VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1901         internal function IFN_SHUFFLEVECTOR.
1902
1903 2021-05-28  Jason Merrill  <jason@redhat.com>
1904
1905         * constexpr.c (build_data_member_initialization): Use tsi_range.
1906         (build_constexpr_constructor_member_initializers): Likewise.
1907         (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1908         (potential_constant_expression_1): Likewise.
1909         * coroutines.cc (await_statement_expander): Likewise.
1910         (await_statement_walker): Likewise.
1911         * module.cc (trees_out::core_vals): Likewise.
1912         * pt.c (tsubst_expr): Likewise.
1913         * semantics.c (set_cleanup_locs): Likewise.
1914
1915 2021-05-28  Jason Merrill  <jason@redhat.com>
1916
1917         PR c++/100797
1918         PR c++/95719
1919         * call.c (build_over_call): Adjust base_binfo in
1920         resolves_to_fixed_type_p case.
1921
1922 2021-05-28  Jakub Jelinek  <jakub@redhat.com>
1923
1924         PR middle-end/99928
1925         * semantics.c (handle_omp_array_sections): Copy
1926         OMP_CLAUSE_MAP_IMPLICIT.
1927         (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1928         marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT.  Add
1929         map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1930         maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1931         present too.  For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1932         if present in map_head, map_field_head or map_firstprivate_head
1933         bitmaps.
1934
1935 2021-05-28  Tobias Burnus  <tobias@codesourcery.com>
1936
1937         * parser.c (cp_parser_omp_clause_affinity): New.
1938         (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1939         cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1940         clause.
1941         * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1942         finish_omp_clauses): Likewise.
1943
1944 2021-05-27  Matthias Kretz  <kretz@kde.org>
1945
1946         PR c++/100716
1947         * error.c (dump_template_bindings): Include code to print
1948         "[with" and ']', conditional on whether anything is printed at
1949         all. This is tied to whether a semicolon is needed to separate
1950         multiple template parameters. If the template argument repeats
1951         the template parameter (T = T), then skip the parameter.
1952         (dump_substitution): Moved code to print "[with" and ']' to
1953         dump_template_bindings.
1954         (dump_function_decl): Partial revert of PR50828, which masked
1955         TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1956         TFF_TEMPLATE_NAME is masked for the scope of the function and
1957         only carries through to dump_function_name.
1958         (dump_function_name): Avoid calling dump_template_parms if
1959         TFF_TEMPLATE_NAME is set.
1960
1961 2021-05-27  Matthias Kretz  <kretz@kde.org>
1962
1963         PR c++/100763
1964         * error.c: Call dump_scope when printing a typedef.
1965
1966 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1967
1968         PR c++/99893
1969         * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1970
1971 2021-05-27  Jason Merrill  <jason@redhat.com>
1972
1973         PR c++/86355
1974         * pt.c (use_pack_expansion_extra_args_p): Don't compare
1975         args from the same argument pack.
1976
1977 2021-05-27  Patrick Palka  <ppalka@redhat.com>
1978
1979         DR 1315
1980         PR c++/67593
1981         PR c++/96555
1982         * pt.c (process_partial_specialization): Don't error on a
1983         non-simple non-type template argument that involves template
1984         parameters.
1985         (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1986         MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1987
1988 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1989
1990         PR c++/100502
1991         * typeck.c (finish_class_member_access_expr): Disable ahead
1992         of time access checking during the member lookup.
1993
1994 2021-05-26  Patrick Palka  <ppalka@redhat.com>
1995
1996         PR c++/100368
1997         * tree.c (build_target_expr_with_type): Don't call force_rvalue
1998         on CALL_EXPR initializer.  Simplify now that bot_manip is no
1999         longer a caller.
2000         (bot_manip): Use force_target_expr instead of
2001         build_target_expr_with_type.
2002
2003 2021-05-26  Patrick Palka  <ppalka@redhat.com>
2004
2005         PR c++/97420
2006         * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
2007         (fnptr_conv_p): Don't call non_reference.  Use INDIRECT_TYPE_P
2008         instead of TYPE_PTR_P.
2009         * pt.c (convert_nontype_argument_function): Look through
2010         implicit INDIRECT_REFs before calling strip_fnptr_conv.
2011
2012 2021-05-25  Jakub Jelinek  <jakub@redhat.com>
2013
2014         PR c++/100666
2015         * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
2016         and side-effects, temporarily disable -Wunused-result warning when
2017         building COMPOUND_EXPR.
2018
2019 2021-05-21  Jakub Jelinek  <jakub@redhat.com>
2020
2021         PR middle-end/99928
2022         * semantics.c (finish_omp_clauses): Move firstprivate clauses with
2023         OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't error
2024         if a decl is mentioned both in map clause and in such firstprivate
2025         clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
2026
2027 2021-05-20  Jason Merrill  <jason@redhat.com>
2028
2029         * call.c (reference_binding): Check for designator.
2030         (implicit_conversion_1, build_special_member_call): Likewise.
2031         * decl.c (reshape_init_r): Likewise.
2032         * pt.c (do_class_deduction): Likewise.
2033         * typeck2.c (digest_init_r): Likewise.
2034
2035 2021-05-20  Jason Merrill  <jason@redhat.com>
2036
2037         PR c++/100489
2038         * decl.c (reshape_init_class): Handle designator for
2039         member of anonymous aggregate here.
2040         * typeck2.c (process_init_constructor_record): Not here.
2041
2042 2021-05-20  Jonathan Wakely  <jwakely@redhat.com>
2043
2044         * call.c (maybe_warn_array_conv): Use new warning option.
2045         * decl.c (mark_inline_variable, grokdeclarator): Likewise.
2046         * error.c (maybe_warn_cpp0x): Likewise.
2047         * parser.c (cp_parser_primary_expression)
2048         (cp_parser_unqualified_id)
2049         (cp_parser_pseudo_destructor_name)
2050         (cp_parser_lambda_introducer)
2051         (cp_parser_lambda_declarator_opt)
2052         (cp_parser_selection_statement)
2053         (cp_parser_init_statement)
2054         (cp_parser_decomposition_declaration)
2055         (cp_parser_function_specifier_opt)
2056         (cp_parser_static_assert)
2057         (cp_parser_namespace_definition)
2058         (cp_parser_using_declaration)
2059         (cp_parser_asm_definition)
2060         (cp_parser_ctor_initializer_opt_and_function_body)
2061         (cp_parser_initializer_list)
2062         (cp_parser_type_parameter_key)
2063         (cp_parser_member_declaration)
2064         (cp_parser_try_block)
2065         (cp_parser_std_attribute_spec): Likewise.
2066         * pt.c (check_template_variable): Likewise.
2067
2068 2021-05-20  Jason Merrill  <jason@redhat.com>
2069
2070         PR c++/100634
2071         * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
2072
2073 2021-05-20  Jason Merrill  <jason@redhat.com>
2074
2075         PR c++/100659
2076         * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
2077
2078 2021-05-19  Jason Merrill  <jason@redhat.com>
2079
2080         PR c++/100367
2081         PR c++/96299
2082         * method.c (genericize_spaceship): Use fold_build2 for scalar
2083         operands.
2084
2085 2021-05-19  Jason Merrill  <jason@redhat.com>
2086
2087         * pt.c (build_deduction_guide): Treat the implicit deduction guide
2088         as a member of the class.
2089
2090 2021-05-19  Marek Polacek  <polacek@redhat.com>
2091
2092         PR c++/100596
2093         * cp-tree.h (any_non_type_attribute_p): Remove.
2094         * decl.c (grokdeclarator): Turn an error into a warning and only
2095         warn for standard attributes.
2096         * decl2.c (any_non_type_attribute_p): Remove.
2097         * parser.c (cp_parser_elaborated_type_specifier): Turn an error
2098         into a warning and only warn for standard attributes.
2099         (cp_parser_member_declaration): Likewise.
2100
2101 2021-05-19  Martin Liska  <mliska@suse.cz>
2102
2103         PR testsuite/100658
2104         * mangle.c (write_encoding): Fix typos.
2105
2106 2021-05-19  Jakub Jelinek  <jakub@redhat.com>
2107
2108         PR middle-end/99928
2109         * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
2110         master when combined with taskloop.
2111         (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
2112         parallel master when not combined with taskloop.
2113
2114 2021-05-19  Jason Merrill  <jason@redhat.com>
2115
2116         PR c++/100261
2117         * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
2118
2119 2021-05-19  Jason Merrill  <jason@redhat.com>
2120
2121         PR c++/100372
2122         * tree.c (strip_typedefs): Only look at the pattern of a
2123         TYPE_PACK_EXPANSION if it's a type.
2124
2125 2021-05-18  Marek Polacek  <polacek@redhat.com>
2126
2127         * class.c (classtype_has_non_deleted_copy_ctor): Remove.
2128         * constraint.cc (contains_wildcard_p): Likewise.
2129         (get_template_head_requirements): Likewise.
2130         (check_constrained_friend): Likewise.
2131         (subsumes_constraints): Likewise.
2132         * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
2133         (push_void_library_fn): Likewise.
2134         (get_pattern_parm): Likewise.
2135         (get_template_parms_at_level): Likewise.
2136         (lambda_return_type): Likewise.
2137         (get_template_head_requirements): Likewise.
2138         (check_constrained_friend): Likewise.
2139         (subsumes_constraints): Likewise.
2140         * decl.c (push_void_library_fn): Likewise.
2141         * lambda.c (lambda_return_type): Likewise.
2142         * pt.c (get_template_parms_at_level): Likewise.
2143         (get_pattern_parm): Likewise.
2144
2145 2021-05-18  Jason Merrill  <jason@redhat.com>
2146
2147         PR c++/100644
2148         * call.c (perfect_candidate_p): An implicitly deleted move
2149         is not perfect.
2150
2151 2021-05-18  Andreas Krebbel  <krebbel@linux.ibm.com>
2152
2153         PR c++/100281
2154         * cvt.c (cp_convert_to_pointer): Use the size of the target
2155         pointer type.
2156         * tree.c (cp_build_reference_type): Call
2157         cp_build_reference_type_for_mode with VOIDmode.
2158         (cp_build_reference_type_for_mode): Rename from
2159         cp_build_reference_type.  Add MODE argument and invoke
2160         build_reference_type_for_mode.
2161         (strip_typedefs): Use build_pointer_type_for_mode and
2162         cp_build_reference_type_for_mode for pointers and references.
2163
2164 2021-05-17  Jonathan Wakely  <jwakely@redhat.com>
2165
2166         PR c++/100635
2167         * call.c (convert_like_internal): Print different diagnostic if
2168         the lvalue reference is const.
2169
2170 2021-05-14  Jason Merrill  <jason@redhat.com>
2171
2172         PR c++/95870
2173         * pt.c (enclosing_instantiation_of): Just compare
2174         DECL_SOURCE_LOCATION.
2175         (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
2176
2177 2021-05-14  Marek Polacek  <polacek@redhat.com>
2178             Jason Merrill  <jason@redhat.com>
2179
2180         PR c++/99032
2181         * cp-tree.h (any_non_type_attribute_p): Declare.
2182         * decl.c (grokdeclarator): Diagnose when an attribute appertains to
2183         a friend declaration that is not a definition.
2184         * decl2.c (any_non_type_attribute_p): New.
2185         * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
2186         in the middle of decl-specifiers.
2187         (cp_parser_elaborated_type_specifier): Diagnose when an attribute
2188         appertains to a friend declaration that is not a definition.
2189         (cp_parser_member_declaration): Likewise.
2190
2191 2021-05-12  Marek Polacek  <polacek@redhat.com>
2192
2193         * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
2194         sentinel.
2195
2196 2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>
2197
2198         * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
2199         'close'.
2200
2201 2021-05-11  Jason Merrill  <jason@redhat.com>
2202
2203         PR c++/100517
2204         * typeck.c (build_reinterpret_cast_1): Check intype on
2205         cast to vector.
2206
2207 2021-05-11  Patrick Palka  <ppalka@redhat.com>
2208
2209         PR c++/51577
2210         * name-lookup.c (maybe_save_operator_binding): Unconditionally
2211         enable for all function templates, not just generic lambdas.
2212         Handle compound-assignment operator expressions.
2213         * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
2214         in the type-dependent case.
2215         (build_x_modify_expr): Likewise.  Move declaration of 'op' closer
2216         to its first use.
2217
2218 2021-05-11  Patrick Palka  <ppalka@redhat.com>
2219
2220         PR c++/100138
2221         * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
2222         (satisfy_atom): Set up iloc_sentinel before calling
2223         cxx_constant_value.
2224         * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
2225         expansion, carry over PACK_EXPANSION_LOCAL_P and
2226         PACK_EXPANSION_SIZEOF_P from the original pack expansion.
2227
2228 2021-05-10  Richard Biener  <rguenther@suse.de>
2229
2230         PR middle-end/100464
2231         PR c++/100468
2232         * call.c (set_up_extended_ref_temp): Mark the temporary
2233         addressable if the TARGET_EXPR was.
2234
2235 2021-05-10  Martin Liska  <mliska@suse.cz>
2236
2237         * decl.c (duplicate_decls): Use startswith
2238         function instead of strncmp.
2239         (cxx_builtin_function): Likewise.
2240         (omp_declare_variant_finalize_one): Likewise.
2241         (grokfndecl): Likewise.
2242         * error.c (dump_decl_name): Likewise.
2243         * mangle.c (find_decomp_unqualified_name): Likewise.
2244         (write_guarded_var_name): Likewise.
2245         (decl_tls_wrapper_p): Likewise.
2246         * parser.c (cp_parser_simple_type_specifier): Likewise.
2247         (cp_parser_tx_qualifier_opt): Likewise.
2248         * pt.c (template_parm_object_p): Likewise.
2249         (dguide_name_p): Likewise.
2250
2251 2021-05-10  Martin Liska  <mliska@suse.cz>
2252
2253         PR c++/99616
2254         * decl.c (grokdeclarator): Remove redundant NULL check.
2255
2256 2021-05-07  Jason Merrill  <jason@redhat.com>
2257
2258         * tree.c (rvalue): Assert expr is not a class lvalue.
2259
2260 2021-05-07  Jason Merrill  <jason@redhat.com>
2261
2262         * cp-tree.h (build_stub_object): Declare.
2263         * method.c (build_stub_object): No longer static.
2264         * call.c (can_convert): Use it.
2265         * tree.c (build_dummy_object): Adjust comment.
2266         * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
2267         TARGET_EXPR.
2268
2269 2021-05-07  Jason Merrill  <jason@redhat.com>
2270
2271         * coroutines.cc (build_co_await): Don't call 'rvalue'.
2272         (flatten_await_stmt): Simplify initialization.
2273         (morph_fn_to_coro): Change 'rvalue' to 'move'.  Simplify.
2274
2275 2021-05-04  Tobias Burnus  <tobias@codesourcery.com>
2276
2277         * semantics.c (finish_omp_reduction_clause): Accept float + complex
2278         for || and && reductions.
2279
2280 2021-05-03  Patrick Palka  <ppalka@redhat.com>
2281
2282         PR c++/100362
2283         * parser.c (cp_parser_class_head): Reinstate calls to pushclass
2284         and popclass when parsing the base-clause that were removed in
2285         r11-6815.
2286
2287 2021-05-03  Patrick Palka  <ppalka@redhat.com>
2288
2289         PR c++/68942
2290         PR c++/100344
2291         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
2292         only when the callee is a FUNCTION_DECL.
2293
2294 2021-05-03  Marek Polacek  <polacek@redhat.com>
2295
2296         PR c++/100055
2297         * decl.c (grokfndecl): Check current_template_parms.
2298
2299 2021-05-03  Marek Polacek  <polacek@redhat.com>
2300
2301         DR 1312
2302         * constexpr.c (cxx_eval_constant_expression): Don't check
2303         integer_zerop.
2304
2305 2021-05-01  Jason Merrill  <jason@redhat.com>
2306
2307         * cp-tree.h (class ovl_iterator): Allow copying.  Add op==.
2308         (class ovl_range, class lkp_range): New.
2309         * call.c (build_op_call_1, add_candidates): Use them.
2310         (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
2311         (has_trivial_copy_p): Likewise.
2312         * class.c (handle_using_decl, get_basefndecls): Likewise.
2313         (maybe_warn_about_overly_private_class): Likewise.
2314         (warn_hidden, add_implicitly_declared_members): Likewise.
2315         (check_methods, clone_constructors_and_destructors): Likewise.
2316         (type_has_user_nondefault_constructor): Likewise.
2317
2318 2021-04-29  Jason Merrill  <jason@redhat.com>
2319
2320         * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
2321         don't find a field.
2322
2323 2021-04-29  Jason Merrill  <jason@redhat.com>
2324
2325         PR c++/51344
2326         * decl2.c (grokfield): Call cplus_decl_attributes for friend.
2327         (save_template_attributes): Use chainon.
2328         * friend.c (do_friend): Remove attrlist parm.
2329         * cp-tree.h (do_friend): Adjust.
2330         * class.c (add_implicitly_declared_members): Adjust.
2331         * decl.c (grokdeclarator): Adjust.
2332         * pt.c (apply_late_template_attributes): Optimize.
2333
2334 2021-04-29  Jason Merrill  <jason@redhat.com>
2335
2336         PR c++/97974
2337         * class.c (finish_struct_anon_r): Drop complain parm.
2338         Remove non-field diagnostic.
2339         (finish_struct_anon): Adjust.
2340         * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
2341
2342 2021-04-29  Jason Merrill  <jason@redhat.com>
2343
2344         * cp-tree.h (cp_evaluated): Add reset parm to constructor.
2345         * parser.c (cp_parser_constant_expression): Change
2346         allow_non_constant_p to int.  Use cp_evaluated.
2347         (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
2348         * semantics.c (finish_id_expression_1): Don't mess with
2349         cp_unevaluated_operand here.
2350
2351 2021-04-29  Jason Merrill  <jason@redhat.com>
2352
2353         * cp-tree.h: Clarify comments.
2354         * pt.c (get_template_parm_object): Add assert.
2355         * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
2356         * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
2357         * typeck2.c (store_init_value): Likewise.
2358
2359 2021-04-29  Patrick Palka  <ppalka@redhat.com>
2360
2361         PR c++/68942
2362         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
2363         set tf_conv during the initial substitution into the function.
2364
2365 2021-04-29  Jakub Jelinek  <jakub@redhat.com>
2366
2367         PR c++/100319
2368         * semantics.c (finish_omp_clauses): Fix up check that variable
2369         mentioned in detach clause doesn't appear in data-sharing clauses.
2370
2371 2021-04-28  Jakub Jelinek  <jakub@redhat.com>
2372
2373         * module.cc: Remove #error that triggers if DEV-PHASE is empty.
2374
2375 2021-04-27  Jason Merrill  <jason@redhat.com>
2376
2377         PR c++/92145
2378         * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
2379         of operator=.
2380
2381 2021-04-27  Patrick Palka  <ppalka@redhat.com>
2382
2383         PR c++/88580
2384         * pt.c (tsubst_initializer_list): Correctly handle the case
2385         where an argument inside a base initializer pack expansion is
2386         itself a pack expansion.
2387
2388 2021-04-26  Patrick Palka  <ppalka@redhat.com>
2389
2390         PR c++/100209
2391         * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
2392         object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
2393         with a negative offset into one whose offset is nonnegative
2394         before calling cxx_fold_indirect_ref_1.
2395
2396 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2397
2398         PR c++/89565
2399         PR c++/93383
2400         PR c++/95291
2401         PR c++/99200
2402         PR c++/99683
2403         * pt.c (do_class_deduction): Punt if the initializer is
2404         type-dependent.
2405
2406 2021-04-24  Patrick Palka  <ppalka@redhat.com>
2407
2408         PR c++/87709
2409         * parser.c (cp_parser_type_id_1): If we see a template
2410         placeholder, first try simulating an error before issuing
2411         a real error.
2412
2413 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2414
2415         PR c++/98767
2416         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
2417         Adjust parameter list loop to iterate over 'types' instead of
2418         'args'.  Output the trailing '...' for a variadic function.
2419         Remove PARM_DECL support.
2420         (pp_cxx_requires_expr): Pretty print the parameter list directly
2421         instead of going through pp_cxx_parameter_declaration_clause.
2422
2423 2021-04-23  Patrick Palka  <ppalka@redhat.com>
2424
2425         DR 2374
2426         * decl.c (is_direct_enum_init): Check the implicit
2427         convertibility requirement added by CWG 2374.
2428
2429 2021-04-23  Martin Liska  <mliska@suse.cz>
2430
2431         * cp-tree.h (STATIC_ASSERT): Prefer static assert.
2432         * lex.c (init_operators): Remove run-time check.
2433
2434 2021-04-22  Marek Polacek  <polacek@redhat.com>
2435
2436         PR c++/100161
2437         * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
2438         op1 separately for value- or type-dependence.
2439
2440 2021-04-21  Marek Polacek  <polacek@redhat.com>
2441
2442         PR c++/96380
2443         * parser.c (cp_parser_enum_specifier): Don't allow defining
2444         types in enum-base.
2445
2446 2021-04-21  Martin Liska  <mliska@suse.cz>
2447
2448         Revert:
2449         2021-04-21  Martin Liska  <mliska@suse.cz>
2450
2451         * error.c (dump_decl): Use flags in dump_generic_node call.
2452
2453 2021-04-21  Martin Liska  <mliska@suse.cz>
2454
2455         * error.c (dump_decl): Use flags in dump_generic_node call.
2456
2457 2021-04-21  Martin Liska  <mliska@suse.cz>
2458
2459         * error.c (dump_decl): Support anonymous labels.
2460
2461 2021-04-20  Jason Merrill  <jason@redhat.com>
2462
2463         PR c++/100109
2464         * pt.c (find_parameter_packs_r): Look into enum initializers.
2465
2466 2021-04-19  Marek Polacek  <polacek@redhat.com>
2467
2468         PR c++/97536
2469         * decl.c (grokvardecl): Given an error when a concept is not defined
2470         at namespace scope.
2471
2472 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2473
2474         PR c++/100111
2475         * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
2476         for empty classes into *valp when types don't match even when *valp
2477         is NULL.
2478
2479 2021-04-16  Marek Polacek  <polacek@redhat.com>
2480
2481         PR c++/99803
2482         * decl.c (make_typename_type): Give an error and return when
2483         name is is_overloaded_fn.
2484         * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
2485         before calling make_typename_type.
2486
2487 2021-04-16  Patrick Palka  <ppalka@redhat.com>
2488
2489         PR c++/99700
2490         * constexpr.c (reduced_constant_expression_p): For array
2491         CONSTRUCTORs, use a dedicated loop that additionally verifies
2492         the CONSTRUCTOR spans the entire array.
2493
2494 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2495
2496         PR c++/99850
2497         * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
2498         If lambda_p, return pce_ok instead of pce_maybe_postfix.
2499
2500 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
2501
2502         PR c++/99833
2503         * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
2504         binding, add to data.internal also all corresponding structured
2505         binding decls.
2506
2507 2021-04-16  Jason Merrill  <jason@redhat.com>
2508
2509         PR c++/100079
2510         * cp-tree.h (first_field): Declare.
2511         * mangle.c (range_expr_nelts): New.
2512         (write_expression): Improve class NTTP mangling.
2513         * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
2514         * tree.c (zero_init_expr_p): Improve class NTTP handling.
2515         * decl.c: Adjust comment.
2516
2517 2021-04-15  Jason Merrill  <jason@redhat.com>
2518
2519         PR c++/80456
2520         * call.c (build_new_method_call_1): Check again for side-effects
2521         with a volatile object.
2522
2523 2021-04-15  Jason Merrill  <jason@redhat.com>
2524
2525         PR c++/100101
2526         PR c++/99583
2527         * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
2528         TYPE_RAISES_EXCEPTIONS here.
2529         * tree.c (cp_walk_subtrees): Not here.
2530
2531 2021-04-15  Jason Merrill  <jason@redhat.com>
2532
2533         PR c++/100091
2534         PR c++/99478
2535         * parser.c (cp_parser_default_type_template_argument): Set
2536         parser->local_variables_forbidden_p.
2537
2538 2021-04-15  Richard Sandiford  <richard.sandiford@arm.com>
2539
2540         PR c++/98852
2541         * typeck.c (merge_type_attributes_from): New function.
2542         (cp_common_type): Use it for vector types.
2543
2544 2021-04-14  Jason Merrill  <jason@redhat.com>
2545
2546         PR c++/100078
2547         PR c++/93085
2548         * pt.c (uses_outer_template_parms): Also look at default
2549         template argument.
2550
2551 2021-04-14  Jason Merrill  <jason@redhat.com>
2552
2553         PR c++/93314
2554         * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
2555         for a non-static data member in a constant-expression.
2556
2557 2021-04-14  Patrick Palka  <ppalka@redhat.com>
2558
2559         PR c++/83476
2560         PR c++/99885
2561         * pt.c (deducible_expression): Look through implicit
2562         INDIRECT_REFs as well.
2563
2564 2021-04-14  Jason Merrill  <jason@redhat.com>
2565
2566         PR c++/99478
2567         * parser.c (cp_parser_lambda_expression): Reject lambda
2568         in template parameter type.
2569
2570 2021-04-14  Jason Merrill  <jason@redhat.com>
2571
2572         PR c++/90674
2573         * decl.c (duplicate_decls): Don't propagate
2574         DECL_INITIALIZED_IN_CLASS_P to a specialization.
2575
2576 2021-04-14  Jason Merrill  <jason@redhat.com>
2577
2578         PR c++/88742
2579         PR c++/49951
2580         PR c++/58123
2581         * semantics.c (set_cleanup_locs): New.
2582         (do_poplevel): Call it.
2583         * parser.c (cp_parser_compound_statement): Consume the }
2584         before finish_compound_stmt.
2585
2586 2021-04-13  Jason Merrill  <jason@redhat.com>
2587
2588         PR c++/100032
2589         * pt.c (get_underlying_template): Compare TYPE_QUALS.
2590
2591 2021-04-13  Jason Merrill  <jason@redhat.com>
2592
2593         PR c++/100054
2594         PR c++/90479
2595         * init.c (get_nsdmi): Do more context adjustment for local classes.
2596
2597 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2598
2599         PR c++/99008
2600         * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2601         rather than issuing a pedwarn.
2602         * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2603         for consistent diagnostics.
2604
2605 2021-04-13  Jason Merrill  <jason@redhat.com>
2606
2607         PR c++/91933
2608         * class.c (build_base_path): Shortcut simple non-pointer case.
2609
2610 2021-04-13  Eric Botcazou  <ebotcazou@adacore.com>
2611
2612         * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2613         of the linemap.
2614         (module_state::write_location): Likewise.
2615
2616 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2617
2618         PR c++/97134
2619         * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2620         when checking if the initializer is an equivalent class
2621         placeholder template parameter.
2622
2623 2021-04-13  Patrick Palka  <ppalka@redhat.com>
2624
2625         PR c++/99961
2626         PR c++/99994
2627         * constraint.cc (satisfy_normalized_constraints): Set
2628         cp_unevaluated.
2629         * parser.c (cp_parser_concept_definition): Likewise.
2630         (cp_parser_requires_clause_opt): Likewise.
2631
2632 2021-04-12  Jason Merrill  <jason@redhat.com>
2633
2634         PR c++/93085
2635         * pt.c (uses_outer_template_parms): Handle non-type and template
2636         template parameters specifically.
2637
2638 2021-04-11  Jason Merrill  <jason@redhat.com>
2639
2640         PR c++/97974
2641         * decl.c (fixup_anonymous_aggr): Prune all functions from
2642         CLASSTYPE_MEMBER_VEC.
2643
2644 2021-04-10  Jason Merrill  <jason@redhat.com>
2645
2646         PR c++/98800
2647         PR c++/97399
2648         * parser.c (cp_parser_direct_declarator): Don't
2649         inject_this_parameter if static_p.
2650         (cp_parser_omp_var_list_no_open): Parse 'this' even if
2651         current_class_ptr isn't set for a better diagnostic.
2652
2653 2021-04-10  Jason Merrill  <jason@redhat.com>
2654
2655         PR c++/99180
2656         PR c++/93295
2657         PR c++/93867
2658         PR c++/99118
2659         PR c++/96873
2660         * pt.c (alias_ctad_tweaks): Handle failure better.
2661
2662 2021-04-10  Jason Merrill  <jason@redhat.com>
2663
2664         PR c++/100006
2665         * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2666
2667 2021-04-09  Patrick Palka  <ppalka@redhat.com>
2668
2669         * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2670         (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2671         (LAMBDA_EXPR_REGEN_INFO): ... this.
2672         (tree_lambda_expr::regenerated_from)
2673         (tree_lambda_expr::regenerating_targs): Replace these with ...
2674         (tree_lambda_expr::regen_info): ... this.
2675         * constraint.cc (satisfy_declaration_constraints): Adjust
2676         accordingly.
2677         * lambda.c (build_lambda_expr): Likewise.
2678         * pt.c (regenerated_lambda_fn_p): Likewise.
2679         (most_general_lambda): Likewise.
2680         (tsubst_lambda_expr): Likewise.
2681
2682 2021-04-09  Marek Polacek  <polacek@redhat.com>
2683
2684         PR c++/99806
2685         * parser.c (cp_parser_member_declaration): Call
2686         cp_parser_save_default_args even for function templates.  Use
2687         STRIP_TEMPLATE on the declaration we're passing.
2688
2689 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2690
2691         PR c++/99874
2692         * constraint.cc (get_normalized_constraints_from_decl): Handle
2693         regenerated lambdas.
2694         (satisfy_declaration_constraints): Likewise.  Check for
2695         dependent args later.
2696         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2697         (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2698         (LAMBDA_EXPR_REGENERATING_TARGS): New.
2699         (tree_lambda_expr::regenerated_from): New data member.
2700         (tree_lambda_expr::regenerating_targs): New data member.
2701         (add_to_template_args): Declare.
2702         (regenerated_lambda_fn_p): Likewise.
2703         (most_general_lambda): Likewise.
2704         * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2705         and LAMBDA_EXPR_REGENERATING_TARGS.
2706         * pt.c (add_to_template_args): No longer static.
2707         (tsubst_function_decl): Unconditionally propagate constraints on
2708         the substituted function decl.
2709         (instantiated_lambda_fn_p): Rename to ...
2710         (regenerated_lambda_fn_p): ... this.  Check
2711         LAMBDA_EXPR_REGENERATED_FROM instead of
2712         LAMBDA_EXPR_INSTANTIATED.
2713         (most_general_lambda): Define.
2714         (enclosing_instantiation_of): Adjust after renaming
2715         instantiated_lambda_fn_p.
2716         (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED.  Set
2717         LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2718         Don't substitute or set constraints on the regenerated lambda.
2719
2720 2021-04-08  Patrick Palka  <ppalka@redhat.com>
2721
2722         PR c++/97679
2723         * pt.c (build_deduction_guide): Document OUTER_ARGS.  Substitute
2724         them into the propagated constraints.
2725
2726 2021-04-08  Jason Merrill  <jason@redhat.com>
2727
2728         PR c++/91849
2729         * call.c (convert_like_internal): Improve reference diagnostic.
2730
2731 2021-04-08  Jakub Jelinek  <jakub@redhat.com>
2732
2733         PR c++/99859
2734         * constexpr.c (addr_of_non_const_var): New function.
2735         (cxx_bind_parameters_in_call): Set *non_constant_args to true
2736         even if cp_walk_tree on arg with addr_of_non_const_var callback
2737         returns true.
2738
2739 2021-04-08  Jason Merrill  <jason@redhat.com>
2740
2741         PR c++/94529
2742         * pt.c (determine_specialization): Improve diagnostic.
2743
2744 2021-04-08  Marek Polacek  <polacek@redhat.com>
2745
2746         PR c++/99844
2747         * decl.c (build_explicit_specifier): Call
2748         check_for_bare_parameter_packs.
2749         * except.c (build_noexcept_spec): Likewise.
2750
2751 2021-04-07  Jason Merrill  <jason@redhat.com>
2752
2753         PR c++/41723
2754         * parser.c (cp_parser_class_name): Check dependent_scope_p.
2755
2756 2021-04-07  Jason Merrill  <jason@redhat.com>
2757
2758         PR c++/52625
2759         * pt.c (maybe_process_partial_specialization): Check
2760         DECL_SELF_REFERENCE_P.
2761
2762 2021-04-07  Jason Merrill  <jason@redhat.com>
2763
2764         PR c++/92918
2765         * name-lookup.c (push_class_level_binding_1): Do overload a new
2766         function with a previous using-declaration.
2767
2768 2021-04-06  Jason Merrill  <jason@redhat.com>
2769
2770         PR c++/96673
2771         * init.c (get_nsdmi): Don't defer access checking.
2772
2773 2021-04-06  Jason Merrill  <jason@redhat.com>
2774
2775         PR c++/99901
2776         * decl.c (cp_finish_decl): mark_needed an implicitly inline
2777         static data member with an out-of-class redeclaration.
2778
2779 2021-04-06  Jason Merrill  <jason@redhat.com>
2780
2781         PR c++/91241
2782         * mangle.c (write_compact_number): Add sanity check.
2783         (write_local_name): Use list_length for parm number.
2784
2785 2021-04-06  Patrick Palka  <ppalka@redhat.com>
2786
2787         PR c++/99899
2788         * pt.c (do_auto_deduction): Don't exit early when deducing the
2789         array type of a structured binding.  Also handle adc_decomp_type
2790         during constraint checking.
2791
2792 2021-04-05  Jason Merrill  <jason@redhat.com>
2793
2794         PR c++/96311
2795         * typeck.c (check_return_expr): Call mark_exp_read in dependent
2796         case.
2797
2798 2021-04-05  Jason Merrill  <jason@redhat.com>
2799
2800         PR c++/98440
2801         * typeck.c (build_reinterpret_cast_1): Don't perform
2802         temporary materialization.
2803
2804 2021-04-05  Jason Merrill  <jason@redhat.com>
2805
2806         PR c++/95317
2807         * pt.c (lookup_template_class_1): Do tsubst_enum when
2808         tsubsting a generic lambda.
2809
2810 2021-04-05  Jason Merrill  <jason@redhat.com>
2811
2812         PR c++/95870
2813         * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2814         there is no enclosing non-lambda function.
2815
2816 2021-04-05  Nathan Sidwell  <nathan@acm.org>
2817
2818         PR c++/99380
2819         * module.cc (name_pending_imports): Drop 'atend' parm.  Don't
2820         query export when not needed.
2821         (preprocess_module, preprocessed_module): Adjust.
2822
2823 2021-04-05  Jason Merrill  <jason@redhat.com>
2824
2825         PR c++/99066
2826         * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2827
2828 2021-04-05  Jason Merrill  <jason@redhat.com>
2829
2830         PR c++/99201
2831         * pt.c (class el_data): Add visited field.
2832         (extract_local_specs): Pass it to cp_walk_tree.
2833         (extract_locals_r): Walk into the body of a lambda.
2834
2835 2021-04-05  Jason Merrill  <jason@redhat.com>
2836
2837         * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2838         template result.
2839
2840 2021-04-04  Jason Merrill  <jason@redhat.com>
2841
2842         PR c++/99643
2843         * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2844
2845 2021-04-03  Marek Polacek  <polacek@redhat.com>
2846
2847         PR c++/91416
2848         * parser.c: Create a GC root for attributes in a decl specifier.
2849         (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2850
2851 2021-04-03  Jason Merrill  <jason@redhat.com>
2852
2853         PR c++/91217
2854         * pt.c (tsubst_lambda_expr): Skip the body block from
2855         DECL_SAVED_TREE.
2856
2857 2021-04-03  Jason Merrill  <jason@redhat.com>
2858
2859         PR c++/90664
2860         * cvt.c (can_convert_qual): Check fnptr_conv_p.
2861
2862 2021-04-03  Jason Merrill  <jason@redhat.com>
2863
2864         PR c++/97900
2865         * pt.c (regenerate_decl_from_template): tsubst_decl
2866         the parms.
2867
2868 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2869
2870         PR c++/99869
2871         * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2872         to do_auto_deduction.
2873
2874 2021-04-02  Patrick Palka  <ppalka@redhat.com>
2875
2876         PR c++/99586
2877         * semantics.c (finish_compound_literal): Check
2878         template_placeholder_p instead of type_uses_auto.
2879
2880 2021-04-02  Jason Merrill  <jason@redhat.com>
2881
2882         PR c++/97938
2883         * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2884         * lambda.c (add_capture): Set it.
2885         * pt.c (tsubst_pack_expansion): Handle it.
2886
2887 2021-04-02  Nathan Sidwell  <nathan@acm.org>
2888
2889         * cp-tree.h (lang_decl_base): Correct module flag comment.
2890         * module.cc (trees_in::assert_definition): Break out
2891         not_tmpl var.
2892         (trees_out::lang_decl_bools): Do not write purview for header units.
2893
2894 2021-04-01  Marek Polacek  <polacek@redhat.com>
2895
2896         PR c++/99831
2897         * method.c (defaulted_late_check): ++ and -- function_depth around
2898         the call to synthesize_method.
2899         * pt.c: Remove the saved_trees global.
2900
2901 2021-04-01  Jason Merrill  <jason@redhat.com>
2902
2903         PR c++/99583
2904         PR c++/99584
2905         * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2906         TYPE_RAISES_EXCEPTIONS.
2907
2908 2021-04-01  Iain Sandoe  <iain@sandoe.co.uk>
2909
2910         * mapper-client.cc (INCLUDE_MAP): New; require map to be
2911         included from system.h.
2912         * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2913
2914 2021-04-01  Jason Merrill  <jason@redhat.com>
2915
2916         PR c++/98481
2917         * mangle.c (write_expression): Adjust.
2918         * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2919         (mark_abi_tags_r): Likewise.
2920
2921 2021-04-01  Nathan Sidwell  <nathan@acm.org>
2922
2923         PR c++/99283
2924         * module.cc (trees_out::decl_node): Adjust importedness reference
2925         assert.
2926         (module_state::intercluster_seed): New.  Seed both imports and
2927         inter-cluster references.  Broken out of ...
2928         (module_state::write_cluster): ... here.  Call it.
2929
2930 2021-03-31  Jason Merrill  <jason@redhat.com>
2931
2932         PR c++/99445
2933         * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2934
2935 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2936
2937         PR c++/88115
2938         * mangle.c (write_expression): Adjust the mangling of
2939         __alignof__.
2940
2941 2021-03-31  Patrick Palka  <ppalka@redhat.com>
2942
2943         PR c++/99815
2944         * pt.c (placeholder_type_constraint_dependent_p): Expand
2945         argument packs to separate the first non-pack argument
2946         from the rest.
2947
2948 2021-03-30  Nathan Sidwell  <nathan@acm.org>
2949
2950         PR c++/99283
2951         * module.cc (dumper::operator): Make less brittle.
2952         (trees_out::core_bools): VAR_DECLs always have a context.
2953         (trees_out::key_mergeable): Use same_type_p for asserting.
2954         (trees_in::read_var_def): Propagate
2955         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2956
2957 2021-03-30  Jakub Jelinek  <jakub@redhat.com>
2958
2959         PR c++/99790
2960         * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2961
2962 2021-03-26  Marek Polacek  <polacek@redhat.com>
2963
2964         PR c++/98352
2965         * method.c (implicitly_declare_fn): Pass &raises to
2966         synthesized_method_walk.
2967
2968 2021-03-26  Nathan Sidwell  <nathan@acm.org>
2969
2970         PR c++/99283
2971         * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2972         (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2973         * decl.c (duplicate_decls): Remove template_decl module flag
2974         propagation.
2975         * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2976         (dumper::impl::nested_name): Adjust for template-decl module flag
2977         change.
2978         (trees_in::assert_definition): Likewise.
2979         (trees_in::install_entity): Likewise.
2980         (trees_out::decl_value): Likewise.  Remove alias template
2981         separation of template and type_decl.
2982         (trees_in::decl_value): Likewise.
2983         (trees_out::key_mergeable): Likewise,
2984         (trees_in::key_mergeable): Likewise.
2985         (trees_out::decl_node): Adjust for template-decl module flag
2986         change.
2987         (depset::hash::make_dependency): Likewise.
2988         (get_originating_module, module_may_redeclare): Likewise.
2989         (set_instantiating_module, set_defining_module): Likewise.
2990         * name-lookup.c (name_lookup::search_adl): Likewise.
2991         (do_pushdecl): Likewise.
2992         * pt.c (build_template_decl): Likewise.
2993         (lookup_template_class_1): Remove special alias_template handling
2994         of DECL_TI_TEMPLATE.
2995         (tsubst_template_decl): Likewise.
2996
2997 2021-03-26  Jakub Jelinek  <jakub@redhat.com>
2998
2999         PR c++/99705
3000         * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
3001         in DECL_EXPR or in BIND_EXPR_VARS.
3002
3003 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
3004
3005         PR c++/99672
3006         * parser.c (cp_parser_postfix_expression): For calls, create
3007         combined_loc and temporarily set input_location to it before
3008         calling finish_call_expr.
3009
3010 2021-03-25  Marek Polacek  <polacek@redhat.com>
3011
3012         PR c++/94751
3013         * call.c (build_over_call): Maybe call mark_used in case
3014         deduce_inheriting_ctor fails and return error_mark_node.
3015         * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
3016         * method.c (deduce_inheriting_ctor): Return bool if the deduction
3017         fails.
3018         (implicitly_declare_fn): If raises is error_mark_node, call
3019         synthesized_method_walk with diag being true.
3020
3021 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
3022
3023         PR c++/99745
3024         * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
3025         packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
3026
3027 2021-03-25  Marek Polacek  <polacek@redhat.com>
3028
3029         PR c++/99331
3030         * call.c (build_converted_constant_expr_internal): Don't emit
3031         -Wconversion warnings.
3032
3033 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
3034
3035         PR c++/99565
3036         * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
3037         to operand_equal_p.
3038         * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
3039         or COMPOUND_EXPR.
3040
3041 2021-03-23  Nathan Sidwell  <nathan@acm.org>
3042
3043         PR c++/99283
3044         * name-lookup.c (check_module_override): Set global or partition
3045         DUP on the binding vector.
3046
3047 2021-03-23  Marek Polacek  <polacek@redhat.com>
3048
3049         PR c++/99318
3050         * decl2.c (cp_warn_deprecated_use_scopes): Only call
3051         cp_warn_deprecated_use when decl is a namespace, class, or enum.
3052
3053 2021-03-23  Nathan Sidwell  <nathan@acm.org>
3054
3055         PR c++/99239
3056         * decl.c (duplicate_decls): Remove assert about maybe-imported
3057         artificial decls.
3058
3059 2021-03-23  Jakub Jelinek  <jakub@redhat.com>
3060
3061         PR c++/99650
3062         * decl.c (cp_finish_decomp): Diagnose void initializers when
3063         using tuple_element and get.
3064
3065 2021-03-22  Nathan Sidwell  <nathan@acm.org>
3066
3067         PR c++/99480
3068         * module.cc (depset::hash::make_dependency): Propagate flags for
3069         partial specialization.
3070         (module_may_redeclare): Handle partial specialization.
3071
3072 2021-03-22  Nathan Sidwell  <nathan@acm.org>
3073
3074         PR c++/99425
3075         * cp-tree.h (map_context_from, map_context_to): Delete.
3076         (add_mergeable_specialization): Add is_alias parm.
3077         * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
3078         * module.cc (map_context_from, map_context_to): Delete.
3079         (trees_in::decl_value): Add specializations later, adjust call.
3080         Drop useless alias lookup. Set duplicate fn parm context.
3081         (check_mergeable_decl): Drop context mapping.
3082         (trees_in::is_matching_decl): Likewise.
3083         (trees_in::read_function_def): Drop parameter context adjustment
3084         here.
3085
3086 2021-03-22  Martin Liska  <mliska@suse.cz>
3087
3088         PR c++/99687
3089         * module.cc (fini_modules): Call vec_free instead of delete.
3090
3091 2021-03-20  Jakub Jelinek  <jakub@redhat.com>
3092
3093         PR debug/99230
3094         * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
3095         special code, instead call c_genericize_control_stmt.
3096
3097 2021-03-19  Jakub Jelinek  <jakub@redhat.com>
3098
3099         PR c++/99456
3100         * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
3101         INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
3102         don't diagnose it, set *non_constant_p nor return t.
3103
3104 2021-03-19  Marek Polacek  <polacek@redhat.com>
3105
3106         PR c++/99500
3107         * parser.c (cp_parser_requirement_parameter_list): Handle
3108         error_mark_node.
3109
3110 2021-03-18  Marek Polacek  <polacek@redhat.com>
3111
3112         * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
3113
3114 2021-03-18  Marek Polacek  <polacek@redhat.com>
3115
3116         * pt.c (tsubst_copy_and_build): Add assert.
3117
3118 2021-03-18  Iain Sandoe  <iain@sandoe.co.uk>
3119
3120         PR objc++/49070
3121         * parser.c (cp_debug_parser): Add Objective-C++ message
3122         state flag.
3123         (cp_parser_nested_name_specifier_opt): Allow colon to
3124         terminate an assignment-expression when parsing Objective-
3125         C++ messages.
3126         (cp_parser_objc_message_expression): Set and clear message
3127         parsing state on entry and exit.
3128         * parser.h (struct cp_parser): Add a context flag for
3129         Objective-C++ message state.
3130
3131 2021-03-18  Martin Liska  <mliska@suse.cz>
3132
3133         PR c++/99617
3134         * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
3135         to NULL.
3136
3137 2021-03-17  Marek Polacek  <polacek@redhat.com>
3138
3139         PR c++/97973
3140         * call.c (conv_unsafe_in_template_p): New.
3141         (convert_like): Use it.
3142
3143 2021-03-17  Anthony Sharp  <anthonysharp15@gmail.com>
3144             Jason Merrill  <jason@redhat.com>
3145
3146         * semantics.c (get_class_access_diagnostic_decl): New
3147         function that examines special cases when a parent
3148         class causes a private access failure.
3149         (enforce_access): Slightly modified to call function
3150         above.
3151
3152 2021-03-16  Jason Merrill  <jason@redhat.com>
3153
3154         * tree.c (cp_tree_equal): Use real_identical.
3155
3156 2021-03-16  Jakub Jelinek  <jakub@redhat.com>
3157
3158         PR c++/99613
3159         * decl.c (expand_static_init): For thread guards, call __cxa_atexit
3160         before calling __cxa_guard_release rather than after it.  Formatting
3161         fixes.
3162
3163 2021-03-16  Martin Liska  <mliska@suse.cz>
3164             Jason Merrill  <jason@redhat.com>
3165
3166         PR c++/99108
3167         * call.c (get_function_version_dispatcher): Handle
3168         DECL_LOCAL_DECL_P.
3169         * decl.c (maybe_version_functions): Likewise.
3170         (maybe_mark_function_versioned): New.
3171         * name-lookup.c (push_local_extern_decl_alias): No longer static.
3172         * name-lookup.h (push_local_extern_decl_alias): Adjust.
3173
3174 2021-03-16  Nathan Sidwell  <nathan@acm.org>
3175
3176         PR c++/99496
3177         * module.cc (trees_out::decl_value): Adjust typedef streaming,
3178         indicate whether it is a dependent alias.
3179         (trees_in::decl_value): Likewise.  Set as dependent alias, if it
3180         is one.
3181
3182 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
3183
3184         PR c++/99047
3185         * coroutines.cc (expand_one_await_expression): If the
3186         await_ready() expression is not a boolean then convert it
3187         as required.
3188
3189 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
3190
3191         PR c++/98704
3192         * coroutines.cc (build_actor_fn): Make destroy index 1
3193         correspond to the abnormal unhandled_exception() exit.
3194         Substitute the proxy for the resume index.
3195         (coro_rewrite_function_body): Arrange to reset the resume
3196         index and make done = true for a rethrown exception from
3197         unhandled_exception ().
3198         (morph_fn_to_coro): Adjust calls to build_actor_fn and
3199         coro_rewrite_function_body.
3200
3201 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
3202
3203         PR c++/98480
3204         * coroutines.cc (replace_continue): Rewrite continue into
3205         'goto label'.
3206         (await_statement_walker): Handle await expressions in the
3207         initializer, condition and iteration expressions of for
3208         loops.
3209
3210 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
3211
3212         PR c++/96749
3213         * coroutines.cc (flatten_await_stmt): Allow for the case
3214         where a target expression variable only has uses in the
3215         second part of a compound expression.
3216         (maybe_promote_temps): Avoid emiting empty statements.
3217
3218 2021-03-15  Tobias Burnus  <tobias@codesourcery.com>
3219
3220         PR c++/99509
3221         * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
3222         ensure that the varpool node is marked as offloadable.
3223
3224 2021-03-12  Nathan Sidwell  <nathan@acm.org>
3225
3226         PR c++/99238
3227         * module.cc (depset::hash::add_binding_entity): Assert not
3228         visited.
3229         (depset::add::add_specializations): Likewise.
3230         * name-lookup.c (name_lookup::dedup): New.
3231         (name_lookup::~name_lookup): Assert not deduping.
3232         (name_lookup::restore_state): Likewise.
3233         (name_lookup::add_overload): Replace outlined code with dedup
3234         call.
3235         (name_lookup::add_value): Likewise.
3236         (name_lookup::search_namespace_only): Likewise.
3237         (name_lookup::adl_namespace_fns): Likewise.
3238         (name_lookup::adl_class_fns): Likewise.
3239         (name_lookup::search_adl): Likewise.  Add clearing dedup call.
3240         (name_lookup::search_qualified): Likewise.
3241         (name_lookup::search_unqualified): Likewise.
3242
3243 2021-03-12  Jakub Jelinek  <jakub@redhat.com>
3244
3245         PR c++/99507
3246         * call.c (build_over_call): For immediate evaluation of functions
3247         that return references, undo convert_from_reference effects before
3248         calling cxx_constant_value and call convert_from_reference
3249         afterwards.
3250
3251 2021-03-11  Nathan Sidwell  <nathan@acm.org>
3252
3253         PR c++/99248
3254         * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
3255         when there's a binding vector.
3256         * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
3257
3258 2021-03-11  Nathan Sidwell  <nathan@acm.org>
3259
3260         PR c++/99528
3261         * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
3262         MK_decl_tmpl_spec.
3263         (trees_in::decl_value): Adjust add_mergeable_specialization call.
3264         (trees_out::get_merge_kind): Adjust detecting a partial template
3265         instantiation.
3266         (trees_out::key_mergeable): Adjust handling same.
3267         (trees_in::key_mergeabvle): Likewise.
3268
3269 2021-03-10  Nathan Sidwell  <nathan@acm.org>
3270
3271         PR c++/99423
3272         * module.cc (post_load_processing): Assert not gcable.
3273         (laxy_load_pendings): Extend no-gc region around
3274         post_load_processing.
3275
3276 2021-03-10  Nathan Sidwell  <nathan@acm.org>
3277
3278         PR c++/99508
3279         * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
3280         assembler name to the ns alias.
3281
3282 2021-03-09  Jakub Jelinek  <jakub@redhat.com>
3283
3284         PR c++/99459
3285         * coroutines.cc (build_co_await): Look through NOP_EXPRs in
3286         build_special_member_call return value to find the CALL_EXPR.
3287         Simplify.
3288
3289 2021-03-09  Nathan Sidwell  <nathan@acm.org>
3290
3291         PR c++/99472
3292         * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
3293         that C++20 does not yet imply modules.
3294
3295 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3296
3297         PR c++/99436
3298         * name-lookup.c (get_cxx_dialect_name): Add cxx23.
3299
3300 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3301
3302         * lex.c (module_token_filter::resume): Ignore module-decls inside
3303         header-unit.
3304         * parser.c (cp_parser_module_declaration): Reject in header-unit.
3305
3306 2021-03-08  Nathan Sidwell  <nathan@acm.org>
3307
3308         PR c++/99285
3309         * cp-tree.h (match_mergeable_specialization)
3310         (add_mergeable_specialization): Adjust parms.
3311         * module.cc (trees_in::decl_value): Adjust
3312         add_mergeable_specialization calls.
3313         (trees_out::key_mergeable): Adjust match_mergeable_specialization
3314         calls.
3315         (specialization_add): Likewise.
3316         * pt.c (match_mergeable_specialization): Do not insert.
3317         (add_mergeable_specialization): Add to hash table here.
3318
3319 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3320             Jakub Jelinek  <jakub@redhat.com>
3321
3322         PR c++/99287
3323         * constexpr.c (cxx_eval_increment_expression): Pass lval when
3324         evaluating the MODIFY_EXPR, and update 'mod' with the result of
3325         this evaluation.  Check *non_constant_p afterwards.  For prefix
3326         ops, just return 'mod'.
3327
3328 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3329             Jakub Jelinek  <jakub@redhat.com>
3330
3331         PR c++/96330
3332         * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
3333         variable 'fn' to 'tmpl'.  Handle a variable template-id by
3334         calling lookup_template_variable.
3335
3336 2021-03-06  Patrick Palka  <ppalka@redhat.com>
3337
3338         PR c++/99365
3339         * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
3340         outer_targs to do_auto_deduction.
3341         (placeholder_type_constraint_dependent_p): Define.
3342         (do_auto_deduction): When processing_template_decl != 0
3343         and context is adc_unify and we have constraints, pretend the
3344         constraints are satisfied instead of punting.  Otherwise don't
3345         punt unless placeholder_type_constraint_dependent_p holds.
3346         Add some clarifying sanity checks.  Add a hack to add missing
3347         outermost template levels to outer_args before checking
3348         satisfaction.  Don't substitute outer_targs into type if it's
3349         already been done.
3350
3351 2021-03-05  Marek Polacek  <polacek@redhat.com>
3352
3353         PR c++/99374
3354         * call.c (standard_conversion): When converting pointers to
3355         member, don't return NULL when the bases are equivalent but
3356         incomplete.
3357
3358 2021-03-05  Marek Polacek  <polacek@redhat.com>
3359
3360         PR c++/99120
3361         * name-lookup.c (check_local_shadow): Check if the type of decl
3362         is non-null before checking TYPE_PTR*.
3363
3364 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3365
3366         PR c++/99245
3367         * module.cc (module_state::write_cluster): Relax binding assert.
3368
3369 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3370
3371         PR c++/99377
3372         * pt.c (instantiate_decl): Call set_instantiating_module.
3373
3374 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3375
3376         PR c++/98118
3377         * coroutines.cc (build_co_await): Use type_build_ctor_call()
3378         to determine cases when a CTOR needs to be built.
3379         (flatten_await_stmt): Likewise.
3380         (morph_fn_to_coro): Likewise.
3381
3382 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3383
3384         PR c++/95616
3385         * coroutines.cc (coro_diagnose_throwing_fn): New helper.
3386         (coro_diagnose_throwing_final_aw_expr): New helper.
3387         (build_co_await): Diagnose throwing final await expression
3388         components.
3389         (build_init_or_final_await): Diagnose a throwing promise
3390         final_suspend() call.
3391
3392 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
3393
3394         PR c++/95615
3395         * coroutines.cc (struct param_info): Track parameter copies that need
3396         a DTOR.
3397         (coro_get_frame_dtor): New helper function factored from build_actor().
3398         (build_actor_fn): Use coro_get_frame_dtor().
3399         (morph_fn_to_coro): Track parameters that need DTORs on exception,
3400         likewise the frame promise and the return object.  On exception, run the
3401         DTORs for these, destroy the frame and then rethrow the exception.
3402
3403 2021-03-05  Nathan Sidwell  <nathan@acm.org>
3404
3405         PR c++/99389
3406         * pt.c (instantiate_class_template_1): Set instantiating module
3407         here.
3408
3409 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
3410
3411         PR c/99137
3412         * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
3413
3414 2021-03-04  Jakub Jelinek  <jakub@redhat.com>
3415
3416         PR c++/88146
3417         PR c++/99362
3418         * cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
3419         comment.
3420
3421 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3422
3423         PR c++/99170
3424         * module.cc (class uintset): Delete.
3425         (typedef attached_map_t): A hash map.
3426         (attached_table): Use attached_map_t.  Adjust uses ...
3427         (trees_out::decl_value, trees_in::decl_value): ... here ...
3428         (trees_out::key_mergeable): ... here ...
3429         (trees_in::key_mergeable): ... here ...
3430         (maybe_attach_decl): ... here ...
3431         (direct_import): ... and here.
3432
3433 2021-03-04  Nathan Sidwell  <nathan@acm.org>
3434
3435         PR c++/99170
3436         * cp-tree.h
3437         * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
3438         rename.
3439         * module.cc (class pending_key): New.
3440         (default_hash_traits<pending_key>): New specialization.
3441         (pending_map_t): New typedef.
3442         (pending_table): Replace old table.
3443         (trees_out::lang_decl_bools): Adjust.
3444         (trees_in::lang_decl_bools): Adjust.
3445         (trees_in::install_entity): Drop pending member and specialization
3446         handling.
3447         (find_pending_key): New.
3448         (depset::hash::fiund_dependencies): Use it.
3449         (pendset_lazy_load): Delete.
3450         (module_state::write_cluster): Don't count pendings here.  Bye
3451         Duff's device-like thing.
3452         (module_state::write_pendings): Reimplement.
3453         (module_state::read_pendings): Reimplement.
3454         (lazy_specializations_p): Delete.
3455         (module_state::write): Adjust write_pendings call.
3456         (lazy_load_pendings): New.
3457         (lazy_load_specializations): Delete.
3458         (lazy_load_members): Delete.
3459         (init_modules): Adjust.
3460         * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
3461         not lazy_load_members.
3462         (note_pending_specializations): Delete.
3463         (load_pending_specializations): Delete.
3464         * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
3465         (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
3466         (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
3467         (note_pending_specializations): Delete.
3468         (load_pending_specializations): Delete.
3469         * pt.c (lookup_template_class_1): Call lazy_load_pendings not
3470         lazy_load_specializations.
3471         (instantiate_template_class_1): Likewise.
3472         (instantiate_decl): Call lazy_load_pendings.
3473         * typeck.c (complete_type): Likewise.
3474
3475 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3476
3477         PR c++/99170
3478         * module.cc (post_load_decls): New.
3479         (lazy_snum, recursive_lazy): Move earlier.
3480         (module_state::read_cluster): Push cloning onto post_load_decls.
3481         (post_load_processing): New.  Do the cloning here.
3482         (module_state::read_inits): Call post_load_processing.
3483         (module_state::read_language): Likewise.
3484         (lazy_load_binding, lazy_load_specializations): Likewise
3485         (lazy_load_members): Likewise
3486
3487 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3488
3489         PR c++/99170
3490         * module.cc (trees_out::decl_value): Stream specialization keys
3491         after decl.
3492         (trees_in::decl_value): Stream them back and insert after
3493         completing the decl.
3494         (trees_out::key_mergeable): Drop some streaming here ...
3495         (trees_in::key_mergeable): ... and here.  Don't insert into
3496         specialization tables.
3497
3498 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3499
3500         * constraint.cc (struct sat_info): Document the different
3501         meanings of noisy() and diagnose_unsatisfaction_p() during
3502         satisfaction and requires-expression evaluation.
3503         (tsubst_valid_expression_requirement): Take a sat_info instead
3504         of a subst_info.  Perform the substitution quietly first.  Fold
3505         in error-replaying code from diagnose_valid_expression.
3506         (tsubst_simple_requirement): Take a sat_info instead of a
3507         subst_info.
3508         (tsubst_type_requirement_1): New.  Fold in error-replaying code
3509         from diagnose_valid_type.
3510         (tsubst_type_requirement): Use the above.  Take a sat_info
3511         instead of a subst_info.
3512         (tsubst_compound_requirement): Likewise.  Fold in
3513         error-replaying code from diagnose_compound_requirement.
3514         (tsubst_nested_requirement): Take a sat_info instead of a
3515         subst_info.  Fold in error-replaying code from
3516         diagnose_nested_requirement.
3517         (tsubst_requirement): Take a sat_info instead of a subst_info.
3518         (tsubst_requires_expr): Split into two versions, one that takes
3519         a sat_info argument and another that takes a complain and
3520         in_decl argument.  Remove outdated documentation.  Document the
3521         effects of the sat_info argument.  Don't short-circuit
3522         processing of requirements when diagnosing unsatisfaction,
3523         mirroring diagnose_requires_expr.
3524         (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
3525         assert, and se the three-parameter version of tsubst_requires_expr.
3526         (diagnose_trait_expr): Make static.  Take a template argument
3527         vector instead of a parameter mapping.
3528         (diagnose_valid_expression): Remove.
3529         (diagnose_valid_type): Remove.
3530         (diagnose_simple_requirement): Remove.
3531         (diagnose_compound_requirement): Remove.
3532         (diagnose_type_requirement): Remove.
3533         (diagnose_nested_requirement): Remove.
3534         (diagnose_requirement): Remove.
3535         (diagnose_requires_expr): Remove.
3536         (diagnose_atomic_constraint): Take a sat_info instead of a
3537         subst_info.  Adjust call to diagnose_trait_expr.  Call
3538         tsubst_requires_expr instead of diagnose_requires_expr.
3539         (diagnose_constraints): Remove special casing of REQUIRES_EXPR
3540         and just always call constraint_satisfaction_value.
3541
3542 2021-03-03  Patrick Palka  <ppalka@redhat.com>
3543
3544         * constexpr.c (cxx_eval_call_expression): Adjust call to
3545         evaluate_concept_check.
3546         (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
3547         evaluate_requires_expression instead of
3548         satisfy_constraint_expression.
3549         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3550         * constraint.cc (struct sat_info): Adjust comment about which
3551         satisfaction entrypoints use noisy-unsat.
3552         (normalize_template_requirements): Remove (and adjust callers
3553         appropriately).
3554         (normalize_nontemplate_requirements): Likewise.
3555         (tsubst_nested_requirement): Use constraint_satisfaction_value
3556         instead of satisfy_constraint_expression, which'll do the
3557         noisy replaying of ill-formed quiet satisfaction for us.
3558         (decl_satisfied_cache): Adjust comment.
3559         (satisfy_constraint): Rename to ...
3560         (satisfy_normalized_constraints): ... this.
3561         (satisfy_associated_constraints): Remove (and make its
3562         callers check for dependent arguments).
3563         (satisfy_constraint_expression): Rename to ...
3564         (satisfy_nondeclaration_constraints): ... this.  Assert that
3565         'args' is empty when 't' is a concept-id.  Removing handling
3566         bare constraint-expressions, and handle REQUIRES_EXPRs
3567         specially.  Adjust comment accordingly.
3568         (satisfy_declaration_constraints): Assert in the two-parameter
3569         version that 't' is not a TEMPLATE_DECL.  Adjust following
3570         removal of normalize_(non)?template_requirements and
3571         satisfy_asociated_constraints.
3572         (constraint_satisfaction_value): Combine the two- and
3573         three-parameter versions in the natural way.
3574         (constraints_satisfied_p): Combine the one- and two-parameter
3575         versions in the natural way.  Improve documentation.
3576         (evaluate_requires_expr): Define.
3577         (evaluate_concept_check): Remove 'complain' parameter.  Use
3578         constraint_satisfaction_value instead of
3579         satisfy_constraint_expression.
3580         (diagnose_nested_requirement): Adjust following renaming of
3581         satisfy_constraint_expression.
3582         (diagnose_constraints): Handle REQUIRES_EXPR by going through
3583         diagnose_requires_expr directly instead of treating it as a
3584         constraint-expression.  Improve documentation.
3585         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
3586         to evaluate_concept_check.
3587         <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
3588         constraints_satisfied_p.
3589         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3590         * cp-tree.h (evaluate_requires_expr): Declare.
3591         (evaluate_concept_check): Remove tsubst_flag_t parameter.
3592         (satisfy_constraint_expression): Remove declaration.
3593         (constraints_satisfied_p): Remove one-parameter declaration.
3594         Add a default argument to the two-parameter declaration.
3595         * cvt.c (convert_to_void): Adjust call to
3596         evaluate_concept_check.
3597
3598 2021-03-03  Jakub Jelinek  <jakub@redhat.com>
3599
3600         PR c++/82959
3601         * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3602         and COMPOUND_EXPR.
3603
3604 2021-03-03  Marek Polacek  <polacek@redhat.com>
3605
3606         PR c++/97034
3607         PR c++/99009
3608         * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3609         (maybe_aggr_guide): Use the original template type where needed.  In
3610         a class member template, partially instantiate the result of
3611         collect_ctor_idx_types.
3612         (do_class_deduction): Defer the deduction until the enclosing
3613         scope is non-dependent.
3614
3615 2021-03-03  Jason Merrill  <jason@redhat.com>
3616
3617         PR c++/95675
3618         * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3619         if it didn't get one before.
3620
3621 2021-03-03  Nathan Sidwell  <nathan@acm.org>
3622
3623         PR c++/99344
3624         * module.cc (trees_out::decl_node): Small refactor.
3625         (depset::hash::add_binding_entity): Return true on meeting an
3626         import.  Set namespace's import here.
3627         (module_state:write_namespaces): Inform of purview too.
3628         (module_state:read_namespaces): Adjust.
3629         * name-lookup.c (implicitly_export_namespace): Delete.
3630         (do_pushdecl): Don't call it.
3631         (push_namespace): Likewise, set purview.
3632         (add_imported_namespace): Reorder parms.
3633         * name-lookup.h (add_imported_namespace): Alter param ordering.
3634
3635 2021-03-02  Martin Sebor  <msebor@redhat.com>
3636
3637         PR c++/99251
3638         * class.c (build_base_path): Call build_if_nonnull.
3639         * cp-tree.h (build_if_nonnull): Declare.
3640         * rtti.c (ifnonnull): Rename...
3641         (build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
3642         (build_dynamic_cast_1): Adjust to name change.
3643
3644 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3645
3646         PR c++/96443
3647         PR c++/96960
3648         * constraint.cc (type_deducible_p): Don't substitute into the
3649         constraints, and instead just pass 'args' to do_auto_deduction
3650         as the outer template arguments.
3651         (tsubst_parameter_mapping): Remove confused code for handling
3652         placeholder type arguments.
3653         (normalize_placeholder_type_constraint): Define.
3654         (satisfy_constraint_expression): Use it to handle placeholder
3655         'auto' types.
3656         * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3657         (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3658         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3659         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3660         (make_constrained_placeholder_type): Set
3661         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3662         (do_auto_deduction): Clarify comments about the outer_targs
3663         parameter.  Rework satisfaction of a placeholder type constraint
3664         to pass in the complete set of template arguments directly to
3665         constraints_satisfied_p.
3666         (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3667         instead.  Also rebuild the the constraint info on the new auto.
3668
3669 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3670
3671         * constraint.cc (build_parameter_mapping): Rely on the caller to
3672         determine the in-scope template parameters.
3673         (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3674         to the two-parameter constructor.  In the two-parameter
3675         constructor, fold in the definition of make_context, set
3676         initial_parms appropriately, and don't set the now-removed
3677         orig_decl member.
3678         (norm_info::make_context): Remove, now that its only use is
3679         inlined into the caller.
3680         (norm_info::update_context): Adjust call to
3681         build_parameter_mapping to pass in the relevant set of in-scope
3682         template parameters.
3683         (norm_info::ctx_parms): Define this member function.
3684         (norm_info::context): Initialize to NULL_TREE.
3685         (norm_info::orig_decl): Remove this data member.
3686         (norm_info::initial_parms): Define this data member.
3687         (normalize_atom): Adjust call to build_parameter_mapping to pass
3688         in the relevant set of in-scope template parameters.  Use
3689         info.initial_parms instead of info.orig_decl.
3690         (normalize_constraint_expression): Take a norm_info object
3691         instead of a bool.  Cache the result of normalization.
3692         (tsubst_nested_requirement): Call satisfy_constraint_expression
3693         instead of satisfy_constraint, so that we normalize on demand.
3694         (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3695         Adjust call to normalize_constraint_expression.
3696         (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3697         to current_template_parms.
3698         (diagnose_nested_requirements): Go through
3699         satisfy_constraint_expression, as with tsubst_nested_requirement.
3700
3701 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3702
3703         * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3704         arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3705         started with a TYPE_ARGUMENT_PACK.
3706         (finish_requires_expr): Don't set DECL_CONTEXT and
3707         CONSTRAINT_VAR_P on each of the introduced parameters here.
3708         * parser.c (cp_parser_requirement_parameter_list): Instead set
3709         these fields earlier, here.
3710         * pt.c (do_auto_deduction): Canonicalize the result of
3711         do_auto_deduction.  Pass 'complain' to finish_decltype_type.
3712
3713 2021-03-02  Patrick Palka  <ppalka@redhat.com>
3714
3715         * constraint.cc (tsubst_simple_requirement): Just return
3716         boolean_true_node on success.
3717         (tsubst_type_requirement): Likewise.
3718         (tsubst_compound_requirement): Likewise.
3719         (tsubst_nested_requirement): Likewise.
3720         (tsubst_requirement_body): Remove.
3721         (check_constaint_variables): Rename to ...
3722         (check_constraint_variables): ... this.
3723         (tsubst_constraint_variables): Adjust.
3724         (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3725
3726 2021-03-01  Nathan Sidwell  <nathan@acm.org>
3727
3728         PR c++/99294
3729         * class.c (fixup_type_variants): Propagate mode, precision,
3730         alignment & emptiness.
3731         * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3732         (trees_in::tree_node): Rematerialize alignment here.
3733
3734 2021-02-27  Jason Merrill  <jason@redhat.com>
3735
3736         PR c++/90333
3737         * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3738         between () and ->.
3739
3740 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3741
3742         * parser.c (cp_parser_lambda_declarator_opt): Implement
3743         P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3744         for -std={c,gnu}++2b or with pedwarn in earlier versions.
3745
3746 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
3747
3748         PR c++/95451
3749         * lambda.c (is_lambda_ignored_entity): Before checking for
3750         LAMBDA_FUNCTION_P, use OVL_FIRST.  Drop FUNCTION_DECL check.
3751
3752 2021-02-26  Jason Merrill  <jason@redhat.com>
3753
3754         PR c++/98810
3755         * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3756         to a class non-type template argument that needs it.
3757
3758 2021-02-26  Patrick Palka  <ppalka@redhat.com>
3759
3760         PR c++/98990
3761         * pt.c (splice_late_return_type): Rebuild the entire return type
3762         if we have to adjust the level of an auto within.
3763         (type_uses_auto): Adjust call to find_type_usage.
3764         * type-utils.h (find_type_usage): Revert r10-6571 change that
3765         made this function return a pointer to the auto node.
3766
3767 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3768
3769         PR c++/99213
3770         PR c++/94521
3771         * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3772         TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3773
3774 2021-02-25  Patrick Palka  <ppalka@redhat.com>
3775
3776         PR c++/99103
3777         * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3778         (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3779
3780 2021-02-25  Marek Polacek  <polacek@redhat.com>
3781
3782         DR 1312
3783         PR c++/99176
3784         * constexpr.c (is_std_construct_at): New overload.
3785         (is_std_allocator_allocate): New overload.
3786         (cxx_eval_call_expression): Use the new overloads.
3787         (cxx_eval_constant_expression): Reject casting
3788         from void * as per DR 1312.  Don't check can_convert.
3789
3790 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3791
3792         PR c++/97587
3793         * coroutines.cc (struct param_info): Track rvalue refs.
3794         (morph_fn_to_coro): Track rvalue refs, and call the promise
3795         CTOR with the frame copy of passed parms.
3796
3797 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
3798
3799         PR c++/95822
3800         * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3801         set throwing_cleanup marker.
3802
3803 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3804
3805         PR c++/99166
3806         * module.cc (module_state::inform_cmi_p): Renamed field.
3807         (module_state::do_import): Adjust.
3808         (init_modules, finish_module_processing): Likewise.
3809         (handle_module_option): Likewise.
3810
3811 2021-02-25  Nathan Sidwell  <nathan@acm.org>
3812
3813         PR c++/98318
3814         * mapper-client.cc (module_client::open_module_client): Fix typo
3815         of fd init.
3816
3817 2021-02-24  Nathan Sidwell  <nathan@acm.org>
3818
3819         PR c++/98718
3820         * module.cc (ool): New indirection vector.
3821         (loc_spans::maybe_propagate): Location is not optional.
3822         (loc_spans::open): Likewise.  Assert monotonically advancing.
3823         (module_for_ordinary_loc): Use ool indirection vector.
3824         (module_state::write_prepare_maps): Do not count empty macro
3825         expansions.  Elide empty spans.
3826         (module_state::write_macro_maps): Skip empty expansions.
3827         (ool_cmp): New qsort comparator.
3828         (module_state::write): Create and destroy ool vector.
3829         (name_pending_imports): Fix dump push/pop.
3830         (preprocess_module): Likewise.  Add more dumping.
3831         (preprocessed_module): Likewise.
3832
3833 2021-02-24  Iain Sandoe  <iain@sandoe.co.uk>
3834
3835         PR c++/96251
3836         * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3837         error reporting when instantiating for a constexpr.
3838
3839 2021-02-23  Nathan Sidwell  <nathan@acm.org>
3840
3841         PR c++/99208
3842         * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3843         identity.
3844
3845 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3846
3847         PR c++/95468
3848         * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3849         over from tsubst_copy.
3850
3851 2021-02-23  Patrick Palka  <ppalka@redhat.com>
3852
3853         * pt.c (instantiation_dependent_expression_p): Check
3854         processing_template_decl before calling
3855         potential_constant_expression.
3856
3857 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3858
3859         PR c++/99174
3860         * module.cc (struct module_state): Add visited_p flag.
3861         (name_pending_imports): Use it to avoid duplicate requests.
3862         (preprocess_module): Don't read preprocessor state if we failed to
3863         load a module's config.
3864
3865 2021-02-22  Nathan Sidwell  <nathan@acm.org>
3866
3867         PR c++/99153
3868         * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3869         to common-path.
3870         * module.cc (set_defining_module): Add assert.
3871
3872 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3873
3874         PR c++/98741
3875         * module.cc (pending_imports): New.
3876         (declare_module): Adjust test condition.
3877         (name_pending_imports): New.
3878         (preprocess_module): Reimplement using pending_imports.
3879         (preprocessed_module): Move name-getting to name_pending_imports.
3880         * name-lookup.c (append_imported_binding_slot): Assert module
3881         ordering is increasing.
3882
3883 2021-02-19  Nathan Sidwell  <nathan@acm.org>
3884
3885         * module.cc (note_cmis): New.
3886         (struct module_state): Add inform_read_p bit.
3887         (module_state::do_import): Inform of CMI location, if enabled.
3888         (init_modules): Canonicalize note_cmis entries.
3889         (handle_module_option): Handle -flang-info-module-read=FOO.
3890
3891 2021-02-19  Jason Merrill  <jason@redhat.com>
3892
3893         PR c++/96926
3894         * call.c (perfect_conversion_p): Limit rvalueness
3895         test to reference bindings.
3896
3897 2021-02-19  Jason Merrill  <jason@redhat.com>
3898
3899         PR c++/96926
3900         * call.c (perfect_conversion_p): New.
3901         (perfect_candidate_p): New.
3902         (add_candidates): Ignore templates after a perfect non-template.
3903
3904 2021-02-18  Nathan Sidwell  <nathan@acm.org>
3905
3906         PR c++/99023
3907         * module.cc (canonicalize_header_name): Use
3908         cpp_probe_header_unit.
3909         (maybe_translate_include): Fix note_includes comparison.
3910         (init_modules): Fix note_includes string termination.
3911
3912 2021-02-18  Jakub Jelinek  <jakub@redhat.com>
3913
3914         PR c++/99132
3915         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3916         cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3917         for immediate function calls.
3918
3919 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3920
3921         PR c++/99023
3922         * module.cc (struct macro_export): Add GTY markers.
3923         (macro_exports): Likewise, us a va_gc Vector.
3924
3925 2021-02-17  Jakub Jelinek  <jakub@redhat.com>
3926
3927         PR sanitizer/99106
3928         * init.c (build_zero_init_1): For flexible array members just return
3929         NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3930         ARRAY_TYPE.
3931
3932 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3933
3934         PR c++/99116
3935         * name-lookup.c (do_pushdecl): Don't peek under template_parm
3936         bindings here ...
3937         (set_identifier_type_value_with_scope): ... or here.
3938         (do_pushtag): Only set_identifier_type_value_with_scope at
3939         non-class template parm scope, and use parent scope.
3940
3941 2021-02-17  Nathan Sidwell  <nathan@acm.org>
3942
3943         PR c++/99071
3944         * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3945         pointer.
3946
3947 2021-02-17  Patrick Palka  <ppalka@redhat.com>
3948
3949         PR debug/96997
3950         PR c++/94034
3951         * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3952
3953 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3954
3955         * module.cc (module_state::write_cluster): Check bindings for
3956         imported using-decls.
3957
3958 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3959
3960         PR c++/99040
3961         * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3962         for new namespace-scope entities.
3963         (module_state::read_cluster): Don't call add_module_decl here.
3964         * name-lookup.h (add_module_decl): Rename to ...
3965         (add_module_namespace_decl): ... this.
3966         * name-lookup.c (newbinding_bookkeeping): Move into ...
3967         (do_pushdecl): ... here.  Its only remaining caller.
3968         (add_module_decl): Rename to ...
3969         (add_module_namespace_decl): ... here.  Add checking-assert for
3970         circularity. Don't call newbinding_bookkeeping, just extern_c
3971         checking and incomplete var checking.
3972
3973 2021-02-12  Nathan Sidwell  <nathan@acm.org>
3974
3975         PR c++/99039
3976         PR c++/99040
3977         * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3978         (global_type_node): Delete.
3979         (IDENTIFIER_TYPE_VALUE): Delete.
3980         (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3981         (get_type_value): Delete.
3982         * name-lookup.h (identifier_type_value): Delete.
3983         * name-lookup.c (check_module_override): Don't
3984         SET_IDENTIFIER_TYPE_VALUE here.
3985         (do_pushdecl): Nor here.
3986         (identifier_type_value_1, identifier_type_value): Delete.
3987         (set_identifier_type_value_with_scope): Only
3988         SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3989         (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3990         (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3991         * call.c (check_dtor_name): Use lookup_name.
3992         * decl.c (cxx_init_decl_processing): Drop global_type_node.
3993         * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3994         here.
3995         * init.c (get_type_value): Delete.
3996         * pt.c (instantiate_class_template_1): Don't call pushtag or
3997         SET_IDENTIFIER_TYPE_VALUE here.
3998         (tsubst): Assert never an identifier.
3999         (dependent_type_p): Drop global_type_node assert.
4000         * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
4001         to determine ctorness.
4002
4003 2021-02-12  Jakub Jelinek  <jakub@redhat.com>
4004
4005         PR c++/97742
4006         * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
4007         CPP_EOF.
4008
4009 2021-02-12  Jason Merrill  <jason@redhat.com>
4010
4011         PR c++/97246
4012         PR c++/94546
4013         * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
4014         (register_parameter_specializations): Not here.
4015
4016 2021-02-11  Marek Polacek  <polacek@redhat.com>
4017
4018         PR c++/95888
4019         * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
4020         for the partial instantiation.
4021
4022 2021-02-11  Jakub Jelinek  <jakub@redhat.com>
4023
4024         PR c++/99033
4025         * init.c (build_zero_init_1): Handle zero initialiation of
4026         flexible array members like initialization of [0] arrays.
4027         Use integer_minus_onep instead of comparison to integer_minus_one_node
4028         and integer_zerop instead of comparison against size_zero_node.
4029         Formatting fixes.
4030
4031 2021-02-11  Marek Polacek  <polacek@redhat.com>
4032
4033         PR c++/99063
4034         * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
4035
4036 2021-02-11  Patrick Palka  <ppalka@redhat.com>
4037
4038         PR c++/97582
4039         * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
4040         lookup result by discarding it if the first element is a
4041         class-scope declaration, otherwise return it.
4042         (push_operator_bindings): Handle an ambiguous lookup result by
4043         doing push_local_binding on each element in the list.
4044
4045 2021-02-11  Marek Polacek  <polacek@redhat.com>
4046
4047         * parser.c (cp_parser_selection_statement): Use vec_free.
4048
4049 2021-02-10  Jakub Jelinek  <jakub@redhat.com>
4050
4051         PR c++/98988
4052         PR c++/99031
4053         * constexpr.c: Include cgraph.h.
4054         (cxx_eval_call_expression): Call varpool_node::finalize_decl on
4055         heap artificial vars.
4056         (cxx_eval_outermost_constant_expr): Remove varpool nodes for
4057         heap artificial vars.
4058
4059 2021-02-10  Nathan Sidwell  <nathan@acm.org>
4060
4061         PR c++/99030
4062         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
4063         answer if there's no local specialization.
4064
4065 2021-02-09  Nathan Sidwell  <nathan@acm.org>
4066
4067         PR c++/98944
4068         * module.cc (module_state::is_rooted): Rename to ...
4069         (module_state::has_location): ... here.  Adjust callers.
4070         (module_state::read_partitions): Adjust validity check.
4071         Don't overwrite a known location.
4072
4073 2021-02-09  Jason Merrill  <jason@redhat.com>
4074
4075         PR c++/96905
4076         * pt.c (mark_decl_instantiated): Exit early if consteval.
4077
4078 2021-02-09  Jason Merrill  <jason@redhat.com>
4079
4080         PR c++/98326
4081         PR c++/20408
4082         * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
4083         parm.
4084
4085 2021-02-09  Jason Merrill  <jason@redhat.com>
4086
4087         PR c++/98994
4088         PR c++/97566
4089         * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
4090         RECORD_TYPE.
4091
4092 2021-02-08  Nathan Sidwell  <nathan@acm.org>
4093
4094         * decl.c (start_cleanup_fn): Push function into
4095         namespace.
4096
4097 2021-02-08  Nathan Sidwell  <nathan@acm.org>
4098
4099         PR c++/98531
4100         * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
4101         * decl.c (push_abi_namespace, pop_abi_namespace): Moved
4102         from rtti.c, add default namespace arg.
4103         (check_redeclaration_exception_specification): Allow a lazy
4104         builtin's eh spec to differ from an lready-declared user
4105         declaration.
4106         (declare_global_var): Use push/pop_abi_namespace.
4107         (get_atexit_node): Push the fndecl into a namespace.
4108         * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
4109         decl.c.
4110
4111 2021-02-08  Marek Polacek  <polacek@redhat.com>
4112
4113         * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
4114
4115 2021-02-05  Marek Polacek  <polacek@redhat.com>
4116
4117         PR c++/98947
4118         * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
4119         on arg2/arg3.
4120         * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
4121         issuing the -Wvolatile warning.  Only set TREE_THIS_VOLATILE if
4122         a warning was emitted.
4123
4124 2021-02-05  Marek Polacek  <polacek@redhat.com>
4125
4126         PR c++/96462
4127         * name-lookup.c (lookup_using_decl): Hoist the destructor check.
4128
4129 2021-02-05  Jakub Jelinek  <jakub@redhat.com>
4130
4131         PR c++/97878
4132         * decl.c (check_array_initializer): For structured bindings, require
4133         the array type to be complete.
4134
4135 2021-02-04  Jason Merrill  <jason@redhat.com>
4136
4137         PR c++/98717
4138         * constraint.cc (build_concept_check_arguments): Remove assert.
4139         (build_concept_check): Allow empty args.
4140
4141 2021-02-04  Tom Greenslade (thomgree)  <thomgree@cisco.com>
4142
4143         PR c++/90926
4144         * call.c (can_convert_array): Extend to handle all valid aggregate
4145         initializers of an array; including by string literals, not just by
4146         brace-init-list.
4147         (build_aggr_conv): Call can_convert_array more often, not just in
4148         brace-init-list case.
4149         * typeck2.c (array_string_literal_compatible_p): New function.
4150         (digest_init_r): call array_string_literal_compatible_p
4151         * cp-tree.h: (array_string_literal_compatible_p): Declare.
4152
4153 2021-02-04  Jason Merrill  <jason@redhat.com>
4154
4155         PR c++/98802
4156         * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
4157
4158 2021-02-04  Jason Merrill  <jason@redhat.com>
4159
4160         PR c++/95192
4161         * pt.c (tsubst_attribute): Handle error.
4162         (apply_late_template_attributes): Return false on error.
4163         (tsubst_function_decl): Check its return value.
4164         (tsubst_decl): Likewise.
4165         (push_template_decl): Assert current_template_parms.
4166         (tsubst_template_decl): Set current_template_parms.
4167
4168 2021-02-03  Marek Polacek  <polacek@redhat.com>
4169
4170         PR c++/98951
4171         * call.c (struct z_candidate): Mark rewritten and reversed as const.
4172         (struct NonPublicField): Mark operator() as const.
4173         (struct NonTrivialField): Likewise.
4174
4175 2021-02-03  Jason Merrill  <jason@redhat.com>
4176
4177         PR c++/98926
4178         PR c++/98570
4179         * pt.c (spec_hasher::equal): Set processing_template_decl.
4180         * Make-lang.in (check-g++-strict-gc): Add --param
4181         hash-table-verification-limit=10000.
4182
4183 2021-02-03  Marek Polacek  <polacek@redhat.com>
4184
4185         PR c++/98899
4186         * parser.c (cp_parser_class_specifier_1): Use any possible
4187         DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
4188         (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
4189         * pt.c (tsubst_exception_specification): Stash new_specs into
4190         DEFPARSE_INSTANTIATIONS.
4191         * tree.c (fixup_deferred_exception_variants): Use
4192         UNPARSED_NOEXCEPT_SPEC_P.
4193
4194 2021-02-02  Jason Merrill  <jason@redhat.com>
4195
4196         PR c++/98929
4197         PR c++/96199
4198         * error.c (dump_expr): Ignore dummy object.
4199         * pt.c (tsubst_baselink): Handle dependent scope.
4200
4201 2021-02-01  Patrick Palka  <ppalka@redhat.com>
4202
4203         PR c++/98295
4204         * constexpr.c (cxx_eval_array_reference): Also set
4205         new_ctx.object when setting new_ctx.ctor.
4206
4207 2021-02-01  Marek Polacek  <polacek@redhat.com>
4208
4209         PR c++/98355
4210         * parser.c (cp_parser_has_attribute_expression): Use
4211         uses_template_parms instead of type_dependent_expression_p.
4212
4213 2021-02-01  Jason Merrill  <jason@redhat.com>
4214
4215         PR c++/98570
4216         * cp-tree.h: Declare it.
4217         * pt.c (comparing_dependent_aliases): New flag.
4218         (template_args_equal, spec_hasher::equal): Set it.
4219         (dependent_alias_template_spec_p): Assert that we don't
4220         get non-types other than error_mark_node.
4221         (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
4222         on complex alias specializations.  Set TYPE_DEPENDENT_P here.
4223         (tsubst_decl): Not here.
4224         * module.cc (module_state::read_cluster): Set
4225         comparing_dependent_aliases instead of
4226         comparing_specializations.
4227         * tree.c (cp_tree_equal): Remove comparing_specializations
4228         module handling.
4229         * typeck.c (structural_comptypes): Adjust.
4230         (comptypes): Remove comparing_specializations handling.
4231
4232 2021-01-29  Nathan Sidwell  <nathan@acm.org>
4233
4234         PR c++/98843
4235         * module.cc (module_state_config): Add num_entities field.
4236         (module_state::read_entities): The entity_ary span is
4237         already allocated.
4238         (module_state::write_config): Write num_entities.
4239         (module_state::read_config): Read num_entities.
4240         (module_state::write): Set config's num_entities.
4241         (module_state::read_initial): Allocate the entity ary
4242         span here.
4243         (module_state::read_language): Do not set entity_lwm
4244         here.
4245
4246 2021-01-29  Marek Polacek  <polacek@redhat.com>
4247
4248         PR c++/96137
4249         * parser.c (cp_parser_class_name): If parser->scope is
4250         error_mark_node, return it, otherwise continue.
4251
4252 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
4253
4254         PR c++/98841
4255         * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
4256
4257 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
4258
4259         PR c++/33661
4260         PR c++/98847
4261         * decl.c (cp_finish_decl): For register vars with asmspec in templates
4262         call set_user_assembler_name and set DECL_HARD_REGISTER.
4263         * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
4264         pass asmspec_tree to cp_finish_decl.
4265
4266 2021-01-28  Nathan Sidwell  <nathan@acm.org>
4267
4268         PR c++/98770
4269         * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
4270         check order.
4271         (trees_in::decl_value): Do typedef frobbing only when installing
4272         a new typedef, adjust is_matching_decl call.  Swap is_typedef
4273         & TYPE_NAME check.
4274         (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
4275         names and deal with typedef checking.
4276
4277 2021-01-27  Jason Merrill  <jason@redhat.com>
4278
4279         PR c++/97874
4280         * name-lookup.c (lookup_using_decl): Clean up handling
4281         of dependency and inherited constructors.
4282         (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
4283         * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
4284
4285 2021-01-26  Jason Merrill  <jason@redhat.com>
4286
4287         PR c++/97474
4288         * call.c (type_passed_as): Don't mark invisiref restrict.
4289
4290 2021-01-26  Jason Merrill  <jason@redhat.com>
4291
4292         PR c++/97566
4293         PR c++/98463
4294         * class.c (layout_class_type): An empty field gets size 0.
4295         (is_empty_field): New.
4296         (check_bases): Check it.
4297         * cp-tree.h (is_empty_field): Declare it.
4298         * constexpr.c (cxx_eval_store_expression): Check it.
4299         (cx_check_missing_mem_inits): Likewise.
4300         * init.c (perform_member_init): Likewise.
4301         * typeck2.c (process_init_constructor_record): Likewise.
4302
4303 2021-01-25  Martin Sebor  <msebor@redhat.com>
4304
4305         PR c++/98646
4306         * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
4307
4308 2021-01-25  Jason Merrill  <jason@redhat.com>
4309
4310         PR c++/98463
4311         * constexpr.c (get_or_insert_ctor_field): Add check.
4312         (cxx_eval_store_expression): Handle discontinuity of refs.
4313
4314 2021-01-23  Anthony Sharp  <anthonysharp15@gmail.com>
4315
4316         * call.c (complain_about_access): Altered function.
4317         * cp-tree.h (complain_about_access): Changed parameters of function.
4318         (get_parent_with_private_access): Declared new function.
4319         * search.c (get_parent_with_private_access): Defined new function.
4320         * semantics.c (enforce_access): Modified function.
4321         * typeck.c (complain_about_unrecognized_member): Updated function
4322         arguments in complain_about_access.
4323
4324 2021-01-23  Patrick Palka  <ppalka@redhat.com>
4325
4326         PR c++/97399
4327         * cp-tree.h (shared_member_p): Adjust declaration.
4328         * parser.c (cp_parser_init_declarator): If the storage class
4329         specifier is sc_static, pass true for static_p to
4330         cp_parser_declarator.
4331         (cp_parser_direct_declarator): Don't do inject_this_parm when
4332         the declarator is a friend.
4333         * search.c (shared_member_p): Change return type to bool and
4334         adjust function body accordingly.  Return false for a dependent
4335         USING_DECL instead of aborting.
4336         * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
4337         even when type-dependent.
4338
4339 2021-01-22  Marek Polacek  <polacek@redhat.com>
4340
4341         PR c++/96623
4342         * parser.c (inject_parm_decls): Remove a redundant assignment.
4343         (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
4344         before calling inject_parm_decls.
4345
4346 2021-01-22  Jason Merrill  <jason@redhat.com>
4347
4348         PR c++/98744
4349         * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
4350
4351 2021-01-22  Jakub Jelinek  <jakub@redhat.com>
4352
4353         PR sanitizer/95693
4354         * init.c (build_zero_init_1): Revert the 2018-03-06 change to
4355         return build_zero_cst for reference types.
4356         * typeck2.c (process_init_constructor_record): Instead call
4357         build_zero_cst here during error recovery instead of build_zero_init.
4358
4359 2021-01-22  Marek Polacek  <polacek@redhat.com>
4360
4361         PR c++/98545
4362         * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
4363         warnings regardless of abi_version_at_least.
4364         (write_expression): When the expression is a dependent name
4365         and an operator name, write "on" before writing its name.
4366
4367 2021-01-22  Marek Polacek  <polacek@redhat.com>
4368
4369         PR c++/97966
4370         * pt.c (instantiate_class_template_1): Instantiate members
4371         marked with attribute used only after we're done instantiating
4372         the class.
4373
4374 2021-01-21  Patrick Palka  <ppalka@redhat.com>
4375
4376         PR c++/71879
4377         * semantics.c (finish_decltype_type): Set up a cp_unevaluated
4378         sentinel at the start of the function.  Remove a now-redundant
4379         manual adjustment of cp_unevaluated_operand.
4380
4381 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4382
4383         PR c++/98624
4384         * module.cc (depset::hash::find_dependencies): Add
4385         module arg.
4386         (trees_out::core_vals): Check state before calling
4387         write_location.
4388         (sort_cluster, module_state::write): Adjust
4389         find_dependencies call.
4390
4391 2021-01-21  Jakub Jelinek  <jakub@redhat.com>
4392
4393         PR c++/98672
4394         * constexpr.c (check_for_return_continue_data): Add break_stmt member.
4395         (check_for_return_continue): Also look for BREAK_STMT.  Handle
4396         SWITCH_STMT by ignoring break_stmt from its body.
4397         (potential_constant_expression_1) <case FOR_STMT>,
4398         <case WHILE_STMT>: If the condition isn't constant true, check if
4399         the loop body can contain a return stmt.
4400         <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
4401         <case IF_STMT>: If recursion with tf_none is successful,
4402         merge *jump_target from the branches - returns with highest priority,
4403         breaks or continues lower.  If then branch is potentially constant and
4404         doesn't return, check the else branch if it could return, break or
4405         continue.
4406
4407 2021-01-21  Nathan Sidwell  <nathan@acm.org>
4408
4409         PR c++/98530
4410         * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
4411
4412 2021-01-20  Nathan Sidwell  <nathan@acm.org>
4413
4414         * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
4415         signed type.
4416
4417 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4418
4419         PR c++/95434
4420         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
4421         CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
4422         adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
4423
4424 2021-01-20  Patrick Palka  <ppalka@redhat.com>
4425
4426         PR c++/82613
4427         * parser.c (cp_parser_class_head): Defer access checking when
4428         parsing the base-clause until all bases are seen and attached
4429         to the class type.
4430         * pt.c (instantiate_class_template): Likewise when substituting
4431         into dependent bases.
4432
4433 2021-01-20  Jakub Jelinek  <jakub@redhat.com>
4434
4435         PR c++/98742
4436         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
4437         error_operand_p, remove clause without further checking.  Check
4438         for non-NULL TYPE_NAME.
4439
4440 2021-01-19  Marek Polacek  <polacek@redhat.com>
4441
4442         PR c++/98659
4443         * pt.c (maybe_instantiate_noexcept): Return false if FN is
4444         error_mark_node.
4445
4446 2021-01-19  Marek Polacek  <polacek@redhat.com>
4447
4448         PR c++/98687
4449         * name-lookup.c (push_using_decl_bindings): New, broken out of...
4450         (finish_nonmember_using_decl): ...here.
4451         * name-lookup.h (push_using_decl_bindings): Update declaration.
4452         * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
4453
4454 2021-01-19  Patrick Palka  <ppalka@redhat.com>
4455
4456         PR c++/41437
4457         PR c++/58993
4458         * search.c (friend_accessible_p): If scope is a hidden friend
4459         defined inside a dependent class, consider access from the
4460         class.
4461         * parser.c (cp_parser_late_parsing_for_member): Don't push a
4462         dk_no_check access state.
4463
4464 2021-01-19  Marek Polacek  <polacek@redhat.com>
4465
4466         PR c++/98333
4467         * parser.c (cp_parser_class_specifier_1): Perform late-parsing
4468         of NSDMIs before late-parsing of noexcept-specifiers.
4469
4470 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4471
4472         * module.cc (identifier): Merge overloads.
4473
4474 2021-01-19  Nathan Sidwell  <nathan@acm.org>
4475
4476         PR c++/98624
4477         * module.cc (trees_out::write_location): Make static.
4478
4479 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
4480
4481         * parser.c (cp_parser_omp_clause_detach): New.
4482         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
4483         (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
4484         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4485         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
4486         Prevent use of detach with mergeable and overriding the data sharing
4487         mode of the event handle.
4488
4489 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4490
4491         PR c++/98538
4492         * tree.c (cp_build_qualified_type_real): Propagate an array's
4493         dependentness to the copy, if known.
4494
4495 2021-01-15  Jason Merrill  <jason@redhat.com>
4496
4497         PR c++/98642
4498         * call.c (unsafe_return_slot_p): Return int.
4499         (init_by_return_slot_p): Split out from...
4500         (unsafe_copy_elision_p): ...here.
4501         (unsafe_copy_elision_p_opt): New name for old meaning.
4502         (build_over_call): Adjust.
4503         (make_safe_copy_elision): New.
4504         * typeck2.c (split_nonconstant_init_1): Elide copy from safe
4505         list-initialization.
4506         * cp-tree.h: Adjust.
4507
4508 2021-01-15  Jason Merrill  <jason@redhat.com>
4509
4510         * call.c (base_ctor_for, make_base_init_ok): New.
4511         (build_over_call): Use make_base_init_ok.
4512
4513 2021-01-15  Jason Merrill  <jason@redhat.com>
4514
4515         PR c++/63707
4516         * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
4517         if we got a CONSTRUCTOR.
4518
4519 2021-01-15  Nathan Sidwell  <nathan@acm.org>
4520
4521         PR c++/98591
4522         * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
4523
4524 2021-01-14  Jason Merrill  <jason@redhat.com>
4525
4526         * typeck2.c (process_init_constructor_record): Use fldtype
4527         variable consistently.
4528
4529 2021-01-14  Nathan Sidwell  <nathan@acm.org>
4530
4531         PR c++/98372
4532         * tree.c (cp_tree_equal): Correct map_context logic.
4533
4534 2021-01-13  Marek Polacek  <polacek@redhat.com>
4535
4536         PR c++/98231
4537         * name-lookup.c (push_using_decl_bindings): New.
4538         * name-lookup.h (push_using_decl_bindings): Declare.
4539         * pt.c (tsubst_expr): Call push_using_decl_bindings.
4540
4541 2021-01-13  Nathan Sidwell  <nathan@acm.org>
4542
4543         PR c++/98626
4544         * module.cc (module_add_import_initializers):  Pass a
4545         zero-element argument vector.
4546
4547 2021-01-12  Patrick Palka  <ppalka@redhat.com>
4548
4549         PR c++/98611
4550         * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
4551         the template of a CTAD placeholder.
4552
4553 2021-01-12  Marek Polacek  <polacek@redhat.com>
4554
4555         PR c++/98620
4556         * typeck2.c (process_init_constructor_record): Don't emit
4557         -Wmissing-field-initializers warnings in unevaluated contexts.
4558
4559 2021-01-11  Jakub Jelinek  <jakub@redhat.com>
4560
4561         PR c++/98481
4562         * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
4563         for types.
4564         (mark_abi_tags_r): Likewise.
4565         * decl2.c (min_vis_r): Likewise.
4566         * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
4567         typedefs.
4568
4569 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4570
4571         PR c++/98551
4572         * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
4573         instead of AGGREGATE_TYPE_P before calling replace_result_decl.
4574
4575 2021-01-08  Patrick Palka  <ppalka@redhat.com>
4576
4577         PR c++/98515
4578         * semantics.c (check_accessibility_of_qualified_id): Punt if
4579         we're checking access of a scoped non-static member inside a
4580         class template.
4581
4582 2021-01-07  Jakub Jelinek  <jakub@redhat.com>
4583
4584         PR c++/98329
4585         * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
4586         cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
4587         its location.
4588         (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4589
4590 2021-01-07  Marek Polacek  <polacek@redhat.com>
4591
4592         PR c++/98441
4593         * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4594         !late_return_type block.
4595
4596 2021-01-07  Jason Merrill  <jason@redhat.com>
4597
4598         * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4599         (cxx_eval_store_expression): Add comment.
4600
4601 2021-01-07  Jason Merrill  <jason@redhat.com>
4602
4603         * call.c (has_next): Factor out from...
4604         (next_conversion): ...here.
4605         (strip_standard_conversion): And here.
4606         (is_subseq): And here.
4607         (build_conv): Check it.
4608         (standard_conversion): Don't call build_conv
4609         for ck_identity.
4610
4611 2021-01-06  Martin Sebor  <msebor@redhat.com>
4612
4613         PR c++/95768
4614         * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4615
4616 2021-01-05  Patrick Palka  <ppalka@redhat.com>
4617
4618         * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4619         the type of the NTTP, substitute into the type again.  If the
4620         type is still dependent, don't unify the NTTP.
4621
4622 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4623
4624         * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4625         $(CODYLIB) after $(BACKEND).
4626
4627 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
4628
4629         PR c++/98469
4630         * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4631         Punt if lval is true.
4632         * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4633         the result if it has a class type.
4634
4635 2021-01-05  Marek Polacek  <polacek@redhat.com>
4636
4637         PR c++/82099
4638         * pt.c (resolve_overloaded_unification): Call
4639         maybe_instantiate_noexcept after instantiating the function
4640         decl.
4641
4642 2021-01-05  Nathan Sidwell  <nathan@acm.org>
4643
4644         * parser.c (cp_parser_module_declaration): Alter diagnostic
4645         text to say where is permissable.
4646
4647 2021-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4648
4649         PR c++/98316
4650         * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4651
4652 2021-01-02  Jan Hubicka  <jh@suse.cz>
4653
4654         * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4655         * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4656         * tree.c (cp_tree_c_finish_parsing): New function.
4657
4658 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
4659
4660         * ChangeLog-2020: Rotate ChangeLog.  New file.
4661
4662 \f
4663 Copyright (C) 2021 Free Software Foundation, Inc.
4664
4665 Copying and distribution of this file, with or without modification,
4666 are permitted in any medium without royalty provided the copyright
4667 notice and this notice are preserved.