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