c++: P0847R7 (deducing this) - xobj lambdas. [PR102609]
[official-gcc.git] / gcc / cp / ChangeLog-2021
blobc577b820f30ab979abc5006e8d595230a888c82a
1 2021-12-20  Patrick Palka  <ppalka@redhat.com>
3         * call.c (build_new_method_call): Set
4         BASELINK_FUNCTIONS_MAYBE_INCOMPLETE_P on the pruned baselink.
5         * cp-tree.h (BASELINK_FUNCTIONS_MAYBE_INCOMPLETE_P): Define.
6         * pt.c (filter_memfn_lookup): New subroutine of tsubst_baselink.
7         (tsubst_baselink): Use filter_memfn_lookup on the new lookup
8         result when BASELINK_FUNCTIONS_MAYBE_INCOMPLETE_P is set on the
9         old baselink.  Remove redundant BASELINK_P check.
10         * search.c (build_baselink): Set
11         BASELINK_FUNCTIONS_MAYBE_INCOMPLETE_P appropriately.
13 2021-12-20  Patrick Palka  <ppalka@redhat.com>
15         * call.c (build_new_method_call): For a non-dependent call
16         expression inside a template, returning a templated tree
17         whose overload set contains just the selected function.
18         * semantics.c (finish_call_expr): Likewise.
20 2021-12-19  Matthias Kretz  <m.kretz@gsi.de>
22         * module.cc (trees_out::get_merge_kind): NAMESPACE_DECLs also
23         cannot have a DECL_TEMPLATE_INFO.
25 2021-12-19  Patrick Palka  <ppalka@redhat.com>
27         PR c++/94376
28         * lambda.c (lambda_capture_field_type): Strip location wrappers
29         before checking for a capture proxy.
30         (is_capture_proxy): Assert that we don't see a location wrapper.
31         (mark_const_cap_r): Don't call is_constant_capture_proxy on a
32         location wrapper.
34 2021-12-19  Patrick Palka  <ppalka@redhat.com>
36         PR c++/103714
37         * constraint.cc (satisfy_declaration_constraints): Do
38         push_to_top_level and pop_from_top_level around the call to
39         satisfy_normalized_constraints.
41 2021-12-17  Marek Polacek  <polacek@redhat.com>
43         PR c/103649
44         * parser.c (cp_parser_declaration): Don't warn for attribute_ignored_p.
45         (cp_parser_std_attribute): Skip parsing of the attribute
46         arguments when the attribute is ignored.
48 2021-12-17  Marek Polacek  <polacek@redhat.com>
50         PR c++/103749
51         * decl.c (lookup_and_check_tag): Give an error when a class was
52         declared as template but no template header has been provided.
53         * pt.c (do_class_deduction): Don't deduce CLASSTYPE_ERRONEOUS
54         types.
56 2021-12-17  Iain Sandoe  <iain@sandoe.co.uk>
58         PR c++/100127
59         * coroutines.cc (coro_rewrite_function_body): Handle initial
60         await expressions that try to produce a reference value.
62 2021-12-17  Iain Sandoe  <iain@sandoe.co.uk>
64         PR c++/100772
65         * coroutines.cc (morph_fn_to_coro): Convert function parms
66         from reference before constructing any operator-new args
67         list.
69 2021-12-17  Jason Merrill  <jason@redhat.com>
71         * constraint.cc (deduce_concept_introduction): Adjust comment.
73 2021-12-17  Jason Merrill  <jason@redhat.com>
75         PR c++/103681
76         * cp-tree.h (struct lang_type): Add non_pod_aggregate.
77         (CLASSTYPE_NON_POD_AGGREGATE): New.
78         * class.c (check_field_decls): Set it.
79         (check_bases_and_members): Check it.
80         (check_non_pod_aggregate): New.
81         (enum eoc_mode): New.
82         (end_of_class): Always include non-empty fields.
83         Add eoc_nv_or_dsize mode.
84         (include_empty_classes, layout_class_type): Adjust.
86 2021-12-16  Marek Polacek  <polacek@redhat.com>
88         PR c++/99980
89         * parser.c (cp_parser_single_declaration): Maybe pass
90         CP_PARSER_FLAGS_DELAY_NOEXCEPT down to cp_parser_init_declarator.
92 2021-12-16  Martin Sebor  <msebor@redhat.com>
94         PR c++/103703
95         * parser.c (class_decl_loc_t::diag_mismatched_tags): Check for class
96         type before assuming a type is one.
98 2021-12-16  Patrick Palka  <ppalka@redhat.com>
100         PR c++/51577
101         PR c++/83035
102         PR c++/100465
103         * call.c (add_operator_candidates): Add lookups parameter.
104         Use it to avoid performing a second unqualified lookup when
105         instantiating a dependent operator expression.
106         (build_new_op): Add lookups parameter and pass it appropriately.
107         * constraint.cc (finish_constraint_binary_op): Use
108         build_min_nt_loc instead of build_x_binary_op.
109         * coroutines.cc (build_co_await): Adjust call to build_new_op.
110         * cp-objcp-common.c (cp_common_init_ts): Mark
111         DEPENDENT_OPERATOR_TYPE appropriately.
112         * cp-tree.def (DEPENDENT_OPERATOR_TYPE): Define.
113         * cp-tree.h (WILDCARD_TYPE_P): Accept DEPENDENT_OPERATOR_TYPE.
114         (FOLD_EXPR_OP_RAW): New, renamed from ...
115         (FOLD_EXPR_OP): ... this.  Change this to return the tree_code directly.
116         (DEPENDENT_OPERATOR_TYPE_SAVED_LOOKUPS): Define.
117         (templated_operator_saved_lookups): Define.
118         (build_new_op): Add lookups parameter.
119         (build_dependent_operator_type): Declare.
120         (build_x_indirect_ref): Add lookups parameter.
121         (build_x_binary_op): Likewise.
122         (build_x_unary_op): Likewise.
123         (build_x_compound_expr): Likewise.
124         (build_x_modify_expr): Likewise.
125         * cxx-pretty-print.c (get_fold_operator): Adjust after
126         FOLD_EXPR_OP change.
127         * decl.c (start_preparsed_function): Don't call
128         push_operator_bindings.
129         * decl2.c (grok_array_decl): Adjust calls to build_new_op.
130         * method.c (do_one_comp): Likewise.
131         (build_comparison_op): Likewise.
132         * module.cc (trees_out::type_node): Handle DEPENDENT_OPERATOR_TYPE.
133         (trees_in::tree_node): Likewise.
134         * name-lookup.c (lookup_name): Revert r11-2876 change.
135         (op_unqualified_lookup): Remove.
136         (maybe_save_operator_binding): Remove.
137         (discard_operator_bindings): Remove.
138         (push_operator_bindings): Remove.
139         * name-lookup.h (maybe_save_operator_binding): Remove.
140         (push_operator_bindings): Remove.
141         (discard_operator_bindings): Remove.
142         * parser.c (cp_parser_unary_expression): Adjust calls to build_x_*.
143         (cp_parser_binary_expression): Likewise.
144         (cp_parser_assignment_expression): Likewise.
145         (cp_parser_expression): Likewise.
146         (do_range_for_auto_deduction): Likewise.
147         (cp_convert_range_for): Likewise.
148         (cp_parser_perform_range_for_lookup): Likewise.
149         (cp_parser_template_argument): Likewise.
150         (cp_parser_omp_for_cond): Likewise.
151         (cp_parser_omp_for_incr): Likewise.
152         (cp_parser_omp_for_loop_init): Likewise.
153         (cp_convert_omp_range_for): Likewise.
154         (cp_finish_omp_range_for): Likewise.
155         * pt.c (fold_expression): Adjust after FOLD_EXPR_OP change. Pass
156         templated_operator_saved_lookups to build_x_*.
157         (tsubst_omp_for_iterator): Adjust call to build_x_modify_expr.
158         (tsubst_expr) <case COMPOUND_EXPR>: Pass
159         templated_operator_saved_lookups to build_x_*.
160         (tsubst_copy_and_build) <case INDIRECT_REF>: Likewise.
161         <case tcc_unary>: Likewise.
162         <case tcc_binary>: Likewise.
163         <case MODOP_EXPR>: Likewise.
164         <case COMPOUND_EXPR>: Likewise.
165         (dependent_type_p_r): Return true for DEPENDENT_OPERATOR_TYPE.
166         * ptree.c (cxx_print_type): Handle DEPENDENT_OPERATOR_TYPE.
167         * semantics.c (finish_increment_expr): Adjust call to
168         build_x_unary_op.
169         (finish_unary_op_expr): Likewise.
170         (handle_omp_for_class_iterator): Adjust calls to build_x_*.
171         (finish_omp_cancel): Likewise.
172         (finish_unary_fold_expr): Use build_dependent_operator_type.
173         (finish_binary_fold_expr): Likewise.
174         * tree.c (cp_free_lang_data): Don't call discard_operator_bindings.
175         * typeck.c (rationalize_conditional_expr): Adjust call to
176         build_x_binary_op.
177         (op_unqualified_lookup): Define.
178         (build_dependent_operator_type): Define.
179         (build_x_indirect_ref): Add lookups parameter and use
180         build_dependent_operator_type.
181         (build_x_binary_op): Likewise.
182         (build_x_array_ref): Likewise.
183         (build_x_unary_op): Likewise.
184         (build_x_compound_expr_from_list): Adjust call to
185         build_x_compound_expr.
186         (build_x_compound_expr_from_vec): Likewise.
187         (build_x_compound_expr): Add lookups parameter and use
188         build_dependent_operator_type.
189         (cp_build_modify_expr): Adjust call to build_new_op.
190         (build_x_modify_expr): Add lookups parameter and use
191         build_dependent_operator_type.
192         * typeck2.c (build_x_arrow): Adjust call to build_new_op.
194 2021-12-15  Marek Polacek  <polacek@redhat.com>
196         PR c++/102229
197         * decl.c (check_decltype_auto): New.
198         (grokdeclarator): Call it.
199         * pt.c (do_auto_deduction): Don't check decltype(auto) here.
201 2021-12-15  Martin Liska  <mliska@suse.cz>
203         PR c++/103713
204         * tree.c (maybe_warn_parm_abi): Fix warning word splitting.
206 2021-12-15  Jakub Jelinek  <jakub@redhat.com>
208         PR c++/103704
209         * semantics.c (finish_omp_target_clauses_r): For OMP_CLAUSEs
210         just walk subtrees.
212 2021-12-14  Patrick Palka  <ppalka@redhat.com>
214         PR c++/103408
215         * constraint.cc (type_deducible_p): Remove workaround for
216         non-templated requires-expressions.
217         (normalize_placeholder_type_constraints): Likewise.
218         * cp-tree.h (current_template_depth): Define.
219         (PROCESSING_REAL_TEMPLATE_DECL): Inspect current_template_depth
220         instead of the magnitude of processing_template_decl.
221         * decl.c (start_decl): Likewise.
222         (grokfndecl): Likewise.
223         (grokvardecl): Likewise.
224         (grokdeclarator): Likewise.
225         * friend.c (make_friend_class): Likewise.  Calculate
226         friend_depth differently when called at instantiation time
227         instead of parse time.
228         (do_friend): Likewise.
229         * parser.c (cp_parser_requires_clause_expression): Remove
230         workaround for lambdas inside constraints.
231         (cp_parser_constraint_expression): Likewise.
232         (cp_parser_requires_expression): Likewise.
233         (synthesize_implicit_template_parm): Add to current_template_parms
234         before calling process_template_parm.
235         * pt.c (inline_needs_template_parms): Inspect
236         current_template_depth instead of the magnitude of
237         processing_template_decl.
238         (push_inline_template_parms_recursive): Likewise.
239         (maybe_begin_member_template_processing): Likewise.
240         (begin_template_parm_list): Likewise.
241         (process_template_parm): Likewise.
242         (end_template_parm_list): Likewise.
243         (push_template_decl): Likewise.
244         (add_inherited_template_parms): Likewise.
245         (instantiate_class_template_1): Don't adjust
246         processing_template_decl around the call to make_friend_class.
247         adjust_processing_template_decl to adjust_template_depth.  Set
248         current_template_parms instead of processing_template_decl when
249         adjust_template_depth.
250         (make_auto_1): Inspect current_template_depth instead of the
251         magnitude of processing_template_decl.
252         (splice_late_return_type): Likewise.
253         * semantics.c (fixup_template_type): Likewise.
255 2021-12-14  Patrick Palka  <ppalka@redhat.com>
257         * call.c (build_new_op): Use releasing_vec for arglist.  Declare
258         conv in the scope it's used.
260 2021-12-14  Patrick Palka  <ppalka@redhat.com>
262         * cp-tree.h (COMPOUND_EXPR_OVERLOADED): Remove.
263         * pt.c (build_non_dependent_expr): Don't inspect the flag.
264         * tree.c (build_min_non_dep): Don't set the flag.
266 2021-12-12  Jonathan Wakely  <jwakely@redhat.com>
268         * error.c: Define INCLUDE_MEMORY instead of
269         INCLUDE_UNIQUE_PTR.
270         * lex.c: Likewise.
271         * name-lookup.c: Likewise.
272         (class namespace_limit_reached): Use std::unique_ptr instead of
273         gnu::unique_ptr.
274         (suggest_alternatives_for): Use std::move instead of gnu::move.
275         (suggest_alternatives_in_other_namespaces): Likewise.
276         * parser.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR.
278 2021-12-09  Marek Polacek  <polacek@redhat.com>
280         PR c++/103401
281         * parser.c (cp_parser_decltype): Clear
282         auto_is_implicit_function_template_parm_p.
283         (cp_parser_type_id_1): Give errors only when !cp_parser_simulate_error.
284         (cp_parser_parameter_declaration): Clear
285         auto_is_implicit_function_template_parm_p after parsing the
286         decl-specifier-seq.
287         (cp_parser_sizeof_operand): Clear
288         auto_is_implicit_function_template_parm_p.
290 2021-12-09  Jakub Jelinek  <jakub@redhat.com>
292         PR pch/71934
293         * module.cc (nop): Add another void * argument.
294         * name-lookup.c (resort_member_name_cmp): Pass the same pointer twice
295         to resort_data.new_value.
297 2021-12-08  Chung-Lin Tang  <cltang@codesourcery.com>
299         * parser.c (struct omp_dim): New struct type for use inside
300         cp_parser_omp_var_list_no_open.
301         (cp_parser_omp_var_list_no_open): Allow multiple levels of array and
302         component accesses in array section base-pointer expression.
303         (cp_parser_omp_all_clauses): Set 'allow_deref' to true in call to
304         cp_parser_omp_var_list for to/from clauses.
305         * semantics.c (handle_omp_array_sections_1): Extend allowed range
306         of base-pointer expressions involving INDIRECT/MEM/ARRAY_REF and
307         POINTER_PLUS_EXPR.
308         (handle_omp_array_sections): Adjust pointer map generation of
309         references.
310         (finish_omp_clauses): Extend allowed ranged of expressions
311         involving INDIRECT/MEM/ARRAY_REF and POINTER_PLUS_EXPR.
313 2021-12-08  Chung-Lin Tang  <cltang@codesourcery.com>
315         PR middle-end/92120
316         * cp-tree.h (finish_omp_target): New declaration.
317         (finish_omp_target_clauses): Likewise.
318         * parser.c (cp_parser_omp_clause_map): Adjust call to
319         cp_parser_omp_var_list_no_open to set 'allow_deref' argument to true.
320         (cp_parser_omp_target): Factor out code, adjust into calls to new
321         function finish_omp_target.
322         * pt.c (tsubst_expr): Add call to finish_omp_target_clauses for
323         OMP_TARGET case.
324         * semantics.c (handle_omp_array_sections_1): Add handling to create
325         'this->member' from 'member' FIELD_DECL. Remove case of rejecting
326         'this' when not in declare simd.
327         (handle_omp_array_sections): Likewise.
328         (finish_omp_clauses): Likewise. Adjust to allow 'this[]' in OpenMP
329         map clauses. Handle 'A->member' case in map clauses. Remove case of
330         rejecting 'this' when not in declare simd.
331         (struct omp_target_walk_data): New struct for walking over
332         target-directive tree body.
333         (finish_omp_target_clauses_r): New function for tree walk.
334         (finish_omp_target_clauses): New function.
335         (finish_omp_target): New function.
337 2021-12-07  Marek Polacek  <polacek@redhat.com>
339         PR c++/95009
340         * typeck.c (is_bitfield_expr_with_lowered_type) <case MODIFY_EXPR>:
341         Handle UNARY_PLUS_EXPR, NEGATE_EXPR, NON_LVALUE_EXPR, BIT_NOT_EXPR,
342         P*CREMENT_EXPR too.
344 2021-12-04  Jakub Jelinek  <jakub@redhat.com>
346         * cp-tree.h (is_byte_access_type_not_plain_char): Declare.
347         * tree.c (is_byte_access_type_not_plain_char): New function.
348         * constexpr.c (clear_uchar_or_std_byte_in_mask): New function.
349         (cxx_eval_bit_cast): Don't error about padding bits if target
350         type is unsigned char or std::byte, instead return no clearing
351         ctor.  Use clear_uchar_or_std_byte_in_mask.
353 2021-12-03  Jason Merrill  <jason@redhat.com>
355         * error.c (current_dump_scope): New variable.
356         (dump_scope): Check it.
357         (dump_function_decl): Set it.
359 2021-12-03  Marek Polacek  <polacek@redhat.com>
361         PR c++/103403
362         * cp-gimplify.c (cp_fold): Don't recurse if maybe_undo_parenthesized_ref
363         doesn't change its argument.
364         * pt.c (do_auto_deduction): Don't strip REFERENCE_REF_P trees if they
365         are REF_PARENTHESIZED_P.  Use stripped_init when checking for
366         id-expression.
367         * semantics.c (force_paren_expr): Set REF_PARENTHESIZED_P on
368         REFERENCE_REF_P trees too.
369         (maybe_undo_parenthesized_ref): Remove dead code.
371 2021-12-02  Marek Polacek  <polacek@redhat.com>
373         PR c++/94490
374         * pt.c (expand_integer_pack): Call
375         instantiate_non_dependent_expr_sfinae.
377 2021-12-02  Marek Polacek  <polacek@redhat.com>
379         PR c++/103408
380         * cxx-pretty-print.c (pp_cxx_parameter_mapping): Print "<unnamed>"
381         rather than crash on an unnamed template parameter.
383 2021-12-01  Jason Merrill  <jason@redhat.com>
385         PR c++/103310
386         * constexpr.c (cxx_eval_binary_expression): Use
387         fold_binary_initializer_loc if manifestly cxeval.
389 2021-11-30  Jason Merrill  <jason@redhat.com>
391         * cp-gimplify.c (genericize_if_stmt): Always build a COND_EXPR.
393 2021-11-30  Richard Biener  <rguenther@suse.de>
395         * logic.cc (cnf_size_r): Remove unreachable and inconsistently
396         placed gcc_unreachable ()s.
397         * pt.c (iterative_hash_template_arg): Remove unreachable
398         gcc_unreachable and return.
400 2021-11-30  Thomas Schwinge  <thomas@codesourcery.com>
402         * semantics.c (finish_omp_clauses): Remove "gang reduction on an
403         orphan loop" checking.
405 2021-11-30  Cesar Philippidis  <cesar@codesourcery.com>
406             Thomas Schwinge  <thomas@codesourcery.com>
408         * semantics.c (finish_omp_clauses): Emit an error on orphan
409         OpenACC gang reductions.
411 2021-11-30  Jakub Jelinek  <jakub@redhat.com>
413         * cp-gimplify.c (cp_fold_r): Perform folding of
414         std::source_location::current() calls here...
415         (cp_fold): ... rather than here.
417 2021-11-30  Richard Biener  <rguenther@suse.de>
419         * parser.c (cp_parser_postfix_expression): Remove
420         unreachable code.
421         * pt.c (tsubst_expr): Remove unreachable breaks.
423 2021-11-29  Eric Gallager  <egallager@gcc.gnu.org>
425         PR other/103021
426         * Make-lang.in: Use ETAGS variable in TAGS target.
428 2021-11-29  Patrick Palka  <ppalka@redhat.com>
430         PR c++/100493
431         * parser.c (cp_parser_lambda_introducer): In C++17, don't
432         diagnose a redundant 'this' capture alongside a by-copy
433         capture default unless -pedantic.  Move the diagnostic into
434         -Wc++20-extensions and adjust wording accordingly.
436 2021-11-26  Jakub Jelinek  <jakub@redhat.com>
438         PR c++/102753
439         * cp-tree.h (struct ptrmem_cst): Add locus member.
440         (PTRMEM_CST_LOCATION): Define.
441         * tree.c (make_ptrmem_cst): Set PTRMEM_CST_LOCATION to input_location.
442         (cp_expr_location): Return PTRMEM_CST_LOCATION for PTRMEM_CST.
443         * typeck.c (build_x_unary_op): Overwrite PTRMEM_CST_LOCATION for
444         PTRMEM_CST instead of calling maybe_wrap_with_location.
445         (cp_build_addr_expr_1): Don't diagnose taking address of
446         immediate functions here.  Instead when taking their address make
447         sure the returned ADDR_EXPR has EXPR_LOCATION set.
448         (expand_ptrmemfunc_cst): Copy over PTRMEM_CST_LOCATION to ADDR_EXPR's
449         EXPR_LOCATION.
450         (convert_for_assignment): Use cp_expr_loc_or_input_loc instead of
451         EXPR_LOC_OR_LOC.
452         * pt.c (tsubst_copy): Use build1_loc instead of build1.  Ensure
453         ADDR_EXPR of immediate function has EXPR_LOCATION set.
454         * cp-gimplify.c (cp_fold_r): Diagnose taking address of immediate
455         functions here.  For consteval if don't walk THEN_CLAUSE.
456         (cp_genericize_r): Move evaluation of calls to
457         std::source_location::current from here to...
458         (cp_fold): ... here.  Don't assert calls to immediate functions must
459         be source_location_current_p, instead only constant evaluate
460         calls to source_location_current_p.
462 2021-11-25  Jakub Jelinek  <jakub@redhat.com>
464         PR c++/101180
465         * pt.c (apply_late_template_attributes): Return early if there are no
466         dependent attributes.
468 2021-11-25  Jakub Jelinek  <jakub@redhat.com>
470         PR c++/102611
471         * cp-tree.h (build_op_subscript): Implement P2128R6
472         - Multidimensional subscript operator.  Declare.
473         (class releasing_vec): Add release method.
474         (grok_array_decl): Remove bool argument, add vec<tree, va_gc> **
475         and tsubst_flags_t arguments.
476         (build_min_non_dep_op_overload): Declare another overload.
477         * parser.c (cp_parser_parenthesized_expression_list_elt): New function.
478         (cp_parser_postfix_open_square_expression): Mention C++23 syntax in
479         function comment.  For C++23 parse zero or more than one initializer
480         clauses in expression list, adjust grok_array_decl caller.
481         (cp_parser_parenthesized_expression_list): Use
482         cp_parser_parenthesized_expression_list_elt.
483         (cp_parser_builtin_offsetof): Adjust grok_array_decl caller.
484         * decl.c (grok_op_properties): For C++23 don't check number
485         of arguments of operator[].
486         * decl2.c (grok_array_decl): Remove decltype_p argument, add
487         index_exp_list and complain arguments.  If index_exp is NULL,
488         handle *index_exp_list as the subscript expression list.
489         * tree.c (build_min_non_dep_op_overload): New overload.
490         * call.c (add_operator_candidates, build_over_call): Adjust comments
491         for removal of build_new_op_1.
492         (build_op_subscript): New function.
493         * pt.c (tsubst_copy_and_build_call_args): New function.
494         (tsubst_copy_and_build) <case ARRAY_REF>: If second
495         operand is magic CALL_EXPR with ovl_op_identifier (ARRAY_REF)
496         as CALL_EXPR_FN, tsubst CALL_EXPR arguments including expanding
497         pack expressions in it and call grok_array_decl instead of
498         build_x_array_ref.
499         <case CALL_EXPR>: Use tsubst_copy_and_build_call_args.
500         * semantics.c (handle_omp_array_sections_1): Adjust grok_array_decl
501         caller.
503 2021-11-24  Marek Polacek  <polacek@redhat.com>
505         PR c++/103347
506         * cp-tree.h (struct cp_declarator): Add a location_t member.
507         (maybe_warn_cpp0x): Add a location_t parameter with a default argument.
508         (loc_or_input_loc): New.
509         * decl.c (grokdeclarator): Use loc_or_input_loc.  Pass init_loc down
510         to maybe_warn_cpp0x.
511         * error.c (maybe_warn_cpp0x): Add a location_t parameter.  Use it.
512         * parser.c (make_declarator): Initialize init_loc.
513         (cp_parser_member_declaration): Set init_loc.
514         (cp_parser_condition): Likewise.
515         (cp_parser_init_declarator): Likewise.
516         (cp_parser_parameter_declaration): Likewise.
518 2021-11-24  Jason Merrill  <jason@redhat.com>
520         * call.c
521         * decl.c
522         * name-lookup.c:
523         Use auto_cond_timevar instead of timevar_cond_start/stop.
524         Remove wrapper functions.
526 2021-11-23  Martin Sebor  <msebor@redhat.com>
528         PR c++/96507
529         * typeck.c (warn_for_null_address): Handle reference members.
531 2021-11-23  Marek Polacek  <polacek@redhat.com>
533         PR c++/19808
534         * init.c (emit_mem_initializers): Don't add is_really_empty_class
535         members into uninitialized.
537 2021-11-23  Jakub Jelinek  <jakub@redhat.com>
539         * semantics.c (clone_omp_udr): Don't initialize
540         id.transform_lang_insert_block.
541         * optimize.c (clone_body): Likewise.
543 2021-11-22  Jason Merrill  <jason@redhat.com>
545         * typeck.c (build_x_unary_op): Set address location.
546         (convert_member_func_to_ptr): Handle location wrapper.
547         * pt.c (convert_nontype_argument): Likewise.
549 2021-11-22  Jason Merrill  <jason@redhat.com>
551         * typeck.c (check_return_expr): Only strip location wrapper during
552         NRV handling.
554 2021-11-22  Jakub Jelinek  <jakub@redhat.com>
556         PR c++/101731
557         * parser.c (cp_parser_late_parsing_oacc_routine): Set
558         parser->oacc_routine->fndecl_seen here, rather than ...
559         (cp_finalize_oacc_routine): ... here.  Don't error if
560         parser->oacc_routine->fndecl_seen is set for FUNCTION_DECLs.
562 2021-11-22  Jakub Jelinek  <jakub@redhat.com>
564         PR c++/103349
565         * constexpr.c (potential_constant_expression_1): Punt on OMP_MASKED.
567 2021-11-19  Jakub Jelinek  <jakub@redhat.com>
569         PR c++/101180
570         * pt.c (apply_late_template_attributes): Temporarily override
571         current_optimize_pragma, optimization_current_node,
572         current_target_pragma and scope_chain->omp_declare_target_attribute,
573         so that cplus_decl_attributes doesn't add implicit attributes.
575 2021-11-19  Martin Sebor  <msebor@redhat.com>
577         PR c++/33925
578         PR c/102867
579         * typeck.c (warn_for_null_address): Suppress warnings for code
580         resulting from macro expansion.
582 2021-11-19  Martin Liska  <mliska@suse.cz>
584         Revert:
585         2021-11-19  Martin Liska  <mliska@suse.cz>
587         * parser.c (add_debug_begin_stmt): Use option directly.
589 2021-11-19  Patrick Palka  <ppalka@redhat.com>
591         * tree.c (cp_walk_subtrees) <case *_CAST_EXPR>: Don't explicitly
592         walk the operands.
594 2021-11-19  Patrick Palka  <ppalka@redhat.com>
596         PR c++/94376
597         * lambda.c (lambda_capture_field_type): Simplify by handling the
598         is_this case first.  When capturing by-value a capture proxy,
599         consider the type of the corresponding field instead.
601 2021-11-19  Richard Biener  <rguenther@suse.de>
603         PR c++/103326
604         * pt.c (tsubst_copy): Handle VECTOR_CST.
606 2021-11-19  Jakub Jelinek  <jakub@redhat.com>
608         PR c++/70796
609         * cp-gimplify.c (cp_gimplify_arg): New function.
610         (cp_gimplify_expr): Use cp_gimplify_arg instead of gimplify_arg,
611         pass true as last argument to it if there are any following
612         arguments in strong evaluation order with side-effects.
614 2021-11-19  Marek Polacek  <polacek@redhat.com>
616         PR c++/19808
617         PR c++/96121
618         * init.c (perform_member_init): Remove a forward declaration.
619         Walk the initializer using find_uninit_fields_r.  New parameter
620         to track uninitialized fields.  If a member is initialized,
621         remove it from the hash set.
622         (perform_target_ctor): Return the initializer.
623         (struct find_uninit_data): New class.
624         (find_uninit_fields_r): New function.
625         (find_uninit_fields): New function.
626         (emit_mem_initializers): Keep and initialize a set holding fields
627         that are not initialized.  When handling delegating constructors,
628         walk the constructor tree using find_uninit_fields_r.  Also when
629         initializing base clases.  Pass uninitialized down to
630         perform_member_init.
632 2021-11-19  Patrick Palka  <ppalka@redhat.com>
634         PR c++/103198
635         * pt.c (any_template_parm_r): Walk the TREE_TYPE of a dummy
636         object.
638 2021-11-18  Marek Polacek  <polacek@redhat.com>
640         PR c++/103049
641         * semantics.c (finish_compound_literal): Accept C++23 auto{x}.
642         * typeck2.c (build_functional_cast_1): Accept C++23 auto(x).
644 2021-11-18  Patrick Palka  <ppalka@redhat.com>
646         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Disable the
647         -fpermissive fallback for C++20 template-id ADL, but keep the
648         diagnostic.
650 2021-11-18  Jan Hubicka  <hubicka@ucw.cz>
652         * decl.c (finish_function): Update use of decl_replaceable_p.
654 2021-11-18  Patrick Palka  <ppalka@redhat.com>
656         PR c++/99911
657         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Don't diagnose
658         name lookup failure if the arguments to an unresolved template
659         name are still dependent.
661 2021-11-18  Patrick Palka  <ppalka@redhat.com>
663         PR c++/102670
664         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When looking
665         for an identifier callee in the koenig_p case, also look through
666         TEMPLATE_ID_EXPR.  Use tsubst_copy to substitute through the
667         template arguments of the template-id.
669 2021-11-18  Matthias Kretz  <m.kretz@gsi.de>
671         * constexpr.c (cxx_eval_constant_expression): Handle PAREN_EXPR
672         via cxx_eval_constant_expression.
673         * cp-objcp-common.c (names_builtin_p): Handle
674         RID_BUILTIN_ASSOC_BARRIER.
675         * cp-tree.h: Adjust TREE_LANG_FLAG documentation to include
676         PAREN_EXPR in REF_PARENTHESIZED_P.
677         (REF_PARENTHESIZED_P): Add PAREN_EXPR.
678         * parser.c (cp_parser_postfix_expression): Handle
679         RID_BUILTIN_ASSOC_BARRIER.
680         * pt.c (tsubst_copy_and_build): If the PAREN_EXPR is not a
681         parenthesized initializer, build a new PAREN_EXPR.
682         * semantics.c (force_paren_expr): Simplify conditionals. Set
683         REF_PARENTHESIZED_P on PAREN_EXPR.
684         (maybe_undo_parenthesized_ref): Test PAREN_EXPR for
685         REF_PARENTHESIZED_P.
687 2021-11-18  Martin Liska  <mliska@suse.cz>
689         * parser.c (add_debug_begin_stmt): Use option directly.
691 2021-11-16  Jason Merrill  <jason@redhat.com>
693         * ptree.c (cxx_print_xnode): Handle PTRMEM_CST.
695 2021-11-15  Jason Merrill  <jason@redhat.com>
697         * cp-tree.h (struct lang_decl_fn): Add implicit_constexpr.
698         (decl_implicit_constexpr_p): New.
699         * class.c (type_maybe_constexpr_destructor): Use
700         TYPE_HAS_TRIVIAL_DESTRUCTOR and maybe_constexpr_fn.
701         (finalize_literal_type_property): Simplify.
702         * constexpr.c (is_valid_constexpr_fn): Check for dtor.
703         (maybe_save_constexpr_fundef): Try to set DECL_DECLARED_CONSTEXPR_P
704         on inlines.
705         (cxx_eval_call_expression): Use maybe_constexpr_fn.
706         (maybe_constexpr_fn): Handle flag_implicit_constexpr.
707         (var_in_maybe_constexpr_fn): Use maybe_constexpr_fn.
708         (potential_constant_expression_1): Likewise.
709         (decl_implicit_constexpr_p): New.
710         * decl.c (validate_constexpr_redeclaration): Allow change with
711         -fimplicit-constexpr.
712         (grok_special_member_properties): Use maybe_constexpr_fn.
713         * error.c (dump_function_decl): Don't print 'constexpr'
714         if it's implicit.
715         * Make-lang.in (check-c++-all): Update.
717 2021-11-15  Jason Merrill  <jason@redhat.com>
719         * typeck2.c (split_nonconstant_init_1): Handle flexarrays better.
721 2021-11-15  Jakub Jelinek  <jakub@redhat.com>
723         * parser.c (OMP_TARGET_CLAUSE_MASK): Add
724         PRAGMA_OMP_CLAUSE_THREAD_LIMIT.
726 2021-11-15  Jason Merrill  <jason@redhat.com>
728         * call.c (perform_implicit_conversion_flags): Use the location of
729         the argument.
730         * lambda.c (build_lambda_object): Set location on the TARGET_EXPR.
732 2021-11-15  Jason Merrill  <jason@redhat.com>
734         * constexpr.c (maybe_save_constexpr_fundef): Also check whether the
735         body of a constructor is potentially constant.
737 2021-11-15  Jason Merrill  <jason@redhat.com>
739         * semantics.c (is_this_parameter): Check DECL_HAS_VALUE_EXPR_P
740         instead of is_capture_proxy.
742 2021-11-15  Jason Merrill  <jason@redhat.com>
744         PR c++/70690
745         * init.c (build_vec_init): Check default_init_uninitialized_part in
746         C++20.
748 2021-11-15  Jason Merrill  <jason@redhat.com>
750         * constexpr.c (maybe_constant_value): Don't evaluate
751         in an unevaluated operand unless manifestly const-evaluated.
752         (fold_non_dependent_expr_template): Likewise.
753         * decl.c (compute_array_index_type_loc): This context is
754         manifestly constant-evaluated.
756 2021-11-15  Jason Merrill  <jason@redhat.com>
758         * constexpr.c (cxx_eval_thunk_call): Error instead of ICE
759         on vbase thunk to constexpr function.
761 2021-11-11  Patrick Palka  <ppalka@redhat.com>
763         * parser.c (cp_parser_template_argument_list): Use auto_vec
764         instead of manual memory management.
766 2021-11-11  Jakub Jelinek  <jakub@redhat.com>
768         * parser.c (cp_parser_omp_clause_num_teams): Parse optional
769         lower-bound and store it into OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR.
770         Use OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR instead of
771         OMP_CLAUSE_NUM_TEAMS_EXPR.
772         (cp_parser_omp_target): For OMP_CLAUSE_NUM_TEAMS evaluate before
773         combined target teams even lower-bound expression.
774         * semantics.c (finish_omp_clauses): Handle
775         OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR of OMP_CLAUSE_NUM_TEAMS clause.
776         * pt.c (tsubst_omp_clauses): Likewise.
777         (tsubst_expr): For OMP_CLAUSE_NUM_TEAMS evaluate before
778         combined target teams even lower-bound expression.
780 2021-11-09  Marek Polacek  <polacek@redhat.com>
782         * class.c (default_init_uninitialized_part): Use
783         next_initializable_field.
784         * method.c (walk_field_subobs): Skip unnamed bit-fields.
786 2021-11-09  Jakub Jelinek  <jakub@redhat.com>
788         PR c++/103114
789         * parser.c (cp_parser_userdef_numeric_literal): Use fold_build2
790         with COMPLEX_EXPR arg instead of build_complex, use build_zero_cst
791         instead of fold_convert from integer_zero_node.
793 2021-11-09  Patrick Palka  <ppalka@redhat.com>
795         PR c++/98394
796         PR c++/85846
797         * parser.c (cp_parser_placeholder_type_specifier): Declare
798         static.  Don't override tentative to false when tmpl is a
799         concept-id with empty argument list.  Don't emit a "does not
800         constrain a type" error when tentative.
802 2021-11-09  Patrick Palka  <ppalka@redhat.com>
804         PR c++/100652
805         * pt.c (push_template_decl): Check for bare parameter packs in
806         the argument list of a variable template partial specialization.
808 2021-11-09  Aldy Hernandez  <aldyh@redhat.com>
810         * ptree.c (cxx_print_xnode): Add more space to pfx array.
812 2021-11-04  Jason Merrill  <jason@redhat.com>
814         * call.c (build_array_conv): Use range-for.
815         (build_complex_conv): Likewise.
816         * constexpr.c (clear_no_implicit_zero)
817         (reduced_constant_expression_p): Likewise.
818         * decl.c (cp_complete_array_type): Likewise.
819         * decl2.c (mark_vtable_entries): Likewise.
820         * pt.c (iterative_hash_template_arg):
821         (invalid_tparm_referent_p, unify)
822         (type_dependent_expression_p): Likewise.
823         * typeck.c (build_ptrmemfunc_access_expr): Likewise.
825 2021-11-03  Joseph Myers  <joseph@codesourcery.com>
827         PR c/103031
828         * cvt.c (convert_init): New function.
830 2021-11-02  Richard Sandiford  <richard.sandiford@arm.com>
832         * decl.c: Include langhooks-def.h.
833         (cxx_simulate_record_decl): New function.
834         * cp-objcp-common.h (cxx_simulate_record_decl): Declare.
835         (LANG_HOOKS_SIMULATE_RECORD_DECL): Override.
837 2021-10-29  Jakub Jelinek  <jakub@redhat.com>
839         PR c++/102820
840         * semantics.c (maybe_zero_constructor_nelts): New function.
841         (finish_compound_literal): Implement DR2351 - void{}.
842         If type is cv void and compound_literal has no elements, return
843         void_node.  If type is cv void and compound_literal might have no
844         elements after expansion, handle it like other dependent compound
845         literals.
847 2021-10-28  Patrick Palka  <ppalka@redhat.com>
849         PR c++/102933
850         * parser.c (cp_parser_simple_type_specifier): Adjust diagnostic
851         for using auto in parameter declaration.
852         * pt.c (extract_autos_r): Ignore CTAD placeholders.
853         (extract_autos): Use range-based for.
854         (do_auto_deduction): Use extract_autos only for the concepts TS
855         and not also for standard concepts.
856         (type_uses_auto): Likewise with for_each_template_parm.
857         (check_auto_in_tmpl_args): Just return false outside of the
858         concepts TS.  Simplify.
860 2021-10-28  Patrick Palka  <ppalka@redhat.com>
862         PR c++/102780
863         * constexpr.c (potential_constant_expression_1) <case TRUTH_*_EXPR>:
864         When tf_error isn't set, preemptively check potentiality of the
865         second operand before performing trial evaluation of the first
866         operand.
867         (potential_constant_expression_1): When tf_error is set, first check
868         potentiality quietly and return true if successful, otherwise
869         proceed noisily to give errors.
871 2021-10-27  Jakub Jelinek  <jakub@redhat.com>
873         PR c++/102854
874         * semantics.c (handle_omp_for_class_iterator,
875         finish_omp_for): Adjust c_omp_check_loop_iv_exprs caller.
877 2021-10-27  Jakub Jelinek  <jakub@redhat.com>
879         PR c++/102753
880         * constexpr.c (cxx_eval_outermost_constant_expr): Perform
881         find_immediate_fndecl discovery if is_consteval or
882         in_immediate_context () rather than if is_consteval, t != r
883         and not in immediate function's body.
885 2021-10-27  Jakub Jelinek  <jakub@redhat.com>
887         PR c++/102753
888         * cp-tree.h (saved_scope): Document that consteval_if_p member
889         is also set while processing immediate invocation.
890         (in_immediate_context): Declare.
891         * call.c (in_immediate_context): New function.
892         (immediate_invocation_p): Use it.
893         (struct in_consteval_if_p_temp_override): New class.
894         (build_over_call): Temporarily set in_consteval_if_p for processing
895         immediate invocation arguments.
896         * typeck.c (cp_build_addr_expr_1): Diagnose taking address of
897         an immediate method.  Use t instead of TREE_OPERAND (arg, 1).
898         Use in_immediate_context function.
899         * constexpr.c (find_immediate_fndecl): Handle PTRMEM_CST
900         which refers to immediate function decl.
902 2021-10-26  Marek Polacek  <polacek@redhat.com>
904         PR c++/102617
905         * parser.c (cp_parser_for): Maybe call cp_parser_init_statement
906         twice.  Warn about range-based for loops with initializer here.
907         (cp_parser_init_statement): Don't duplicate code.  Allow
908         alias-declaration in init-statement.
910 2021-10-22  Eric Gallager  <egallager@gcc.gnu.org>
912         PR other/102663
913         * Make-lang.in: Add dummy c++.install-dvi target.
915 2021-10-20  Jason Merrill  <jason@redhat.com>
917         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
918         Pass true for declarator_p.
919         (cp_parser_nested_name_specifier_opt): Only look through
920         TYPENAME_TYPE if check_dependency_p is false.
922 2021-10-20  Jakub Jelinek  <jakub@redhat.com>
924         PR c++/102642
925         * name-lookup.c (push_local_extern_decl_alias): Don't call
926         set_decl_tls_model on error_mark_node.
927         * decl.c (make_rtl_for_nonlocal_decl): Don't call
928         set_user_assembler_name on error_mark_node.
929         * parser.c (cp_parser_oacc_declare): Ignore DECL_LOCAL_DECL_ALIAS
930         if it is error_mark_node.
931         (cp_parser_omp_declare_target): Likewise.
933 2021-10-19  Jakub Jelinek  <jakub@redhat.com>
935         PR c++/102786
936         * constexpr.c (cxx_eval_constant_expression): Don't reject
937         INTEGER_CSTs with type POINTER_TYPE to METHOD_TYPE.
939 2021-10-15  Jason Merrill  <jason@redhat.com>
941         PR c++/51851
942         PR c++/101402
943         PR c++/102033
944         PR c++/102034
945         PR c++/102039
946         PR c++/102044
947         * pt.c (determine_specialization): Remove redundant code.
948         (fn_type_unification): Check for mismatched length.
949         (type_unification_real): Ignore terminal void.
950         (get_bindings): Don't stop at void_list_node.
951         * class.c (resolve_address_of_overloaded_function): Likewise.
953 2021-10-15  Jason Merrill  <jason@redhat.com>
955         * constexpr.c (cxx_bind_parameters_in_call): Replace
956         new_call parameter with fun.
957         (cxx_eval_call_expression): Call it before instantiation.
958         (cxx_eval_outermost_constant_expr): Only instantiate fns
959         when manifestly_const_eval.
960         * typeck2.c (check_narrowing): This context is manifestly
961         constant-evaluated.
963 2021-10-14  Kwok Cheung Yeung  <kcy@codesourcery.com>
965         * decl.c (omp_declare_variant_finalize_one): Change call from
966         c_omp_mark_declare_variant to omp_mark_declare_variant.
967         * parser.c (cp_finish_omp_declare_variant): Change call from
968         c_omp_check_context_selector to omp_check_context_selector.
970 2021-10-09  Jakub Jelinek  <jakub@redhat.com>
972         * parser.c (cp_parser_omp_structured_block): Remove disallow_omp_attrs
973         argument.
974         (cp_parser_omp_structured_block_sequence): New function.
975         (cp_parser_omp_scan_loop_body): Use it.
976         (cp_parser_omp_sections_scope): Likewise.
978 2021-10-08  Martin Liska  <mliska@suse.cz>
980         * constexpr.c (maybe_warn_about_constant_value): Use new macro
981         OPTION_SET_P.
982         * decl.c (redeclaration_error_message): Likewise.
983         (cxx_init_decl_processing): Likewise.
985 2021-10-08  Jakub Jelinek  <jakub@redhat.com>
987         PR c++/102640
988         * parser.c (handle_omp_declare_target_clause): New function.
989         (cp_parser_omp_declare_target): Use it.
991 2021-10-07  Patrick Palka  <ppalka@redhat.com>
993         PR c++/61355
994         * pt.c (convert_template_argument): Perform array/function to
995         pointer conversion on the substituted type of an NTTP.
997 2021-10-07  Patrick Palka  <ppalka@redhat.com>
999         PR c++/99904
1000         * pt.c (is_compatible_template_arg): Set processing_template_decl
1001         around tsubst_constraint_info.
1003 2021-10-07  Jonathan Wakely  <jwakely@redhat.com>
1005         PR c++/102482
1006         * init.c (maybe_warn_list_ctor): Do not warn for a reference to
1007         a non-const std::initializer_list.
1009 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
1011         PR c++/102612
1012         * parser.c (cp_parser_jump_statement): Implement C++23 P2242R3.
1013         Allow goto expressions in constexpr function bodies for C++23.
1014         Adjust error message for older standards to mention it.
1015         * decl.c (start_decl): Allow static and thread_local declarations
1016         in constexpr function bodies for C++23.  Adjust error message for
1017         older standards to mention it.
1018         * constexpr.c (ensure_literal_type_for_constexpr_object): Allow
1019         declarations of variables with non-literal type in constexpr function
1020         bodies for C++23.  Adjust error message for older standards to mention
1021         it.
1022         (cxx_eval_constant_expression) <case DECL_EXPR>: Diagnose declarations
1023         of initialization of static or thread_local vars.
1024         (cxx_eval_constant_expression) <case GOTO_EXPR>: Diagnose goto
1025         statements for C++23.
1026         (potential_constant_expression_1) <case DECL_EXPR>: Swap the
1027         CP_DECL_THREAD_LOCAL_P and TREE_STATIC checks.
1028         (potential_constant_expression_1) <case LABEL_EXPR>: Allow labels for
1029         C++23.  Adjust error message for older standards to mention it.
1031 2021-10-06  Jakub Jelinek  <jakub@redhat.com>
1032             Jason Merrill  <jason@redhat.com>
1034         PR c++/98712
1035         PR c++/102490
1036         * cp-tree.h (maybe_synthesize_method): Declare.
1037         * method.c (genericize_spaceship): Use
1038         LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
1039         LOOKUP_NORMAL for flags.
1040         (comp_info): Remove defining member.  Add complain, code, retcat.
1041         (comp_info::comp_info): Adjust.
1042         (do_one_comp): Split out from build_comparison_op.   Use
1043         LOOKUP_NORMAL | LOOKUP_NONVIRTUAL | LOOKUP_DEFAULTED instead of
1044         LOOKUP_NORMAL for flags.
1045         (build_comparison_op): Add defining argument. Adjust comp_info
1046         construction.  Use defining instead of info.defining.  Assert that
1047         if defining, ctype is a complete type.  Walk base binfos.
1048         (synthesize_method, maybe_explain_implicit_delete,
1049         explain_implicit_non_constexpr): Adjust build_comparison_op callers.
1050         (maybe_synthesize_method): New function.
1051         * class.c (check_bases_and_members): Don't call defaulted_late_check
1052         for sfk_comparison.
1053         (finish_struct_1): Call it here instead after class has been
1054         completed.
1055         * pt.c (maybe_instantiate_noexcept): Call maybe_synthesize_method
1056         instead of synthesize_method.
1058 2021-10-05  Jakub Jelinek  <jakub@redhat.com>
1060         PR c++/102548
1061         * tree.c (apply_identity_attributes): Fix handling of the
1062         case where an attribute in the list doesn't affect type
1063         identity but some attribute before it does.
1065 2021-10-05  Patrick Palka  <ppalka@redhat.com>
1067         PR c++/102547
1068         * constexpr.c (potential_constant_expression_1): Handle
1069         NONTYPE_ARGUMENT_PACK.
1071 2021-10-05  Patrick Palka  <ppalka@redhat.com>
1073         PR c++/98930
1074         * pt.c (has_value_dependent_address): Return true for a static
1075         local variable from a function template.
1077 2021-10-04  Marek Polacek  <polacek@redhat.com>
1079         PR c++/97573
1080         * typeck.c (cp_build_binary_op): Call do_warn_array_compare.
1082 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
1084         PR c++/101765
1085         * coroutines.cc (register_local_var_uses): Emit a sorry if
1086         we encounter a VLA in the coroutine local variables.
1088 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
1090         PR c++/99710
1091         * coroutines.cc (await_statement_walker): Report an error if
1092         an await expression is found in a handler body.
1094 2021-10-03  John Eivind Helset  <jehelset@gmail.com>
1096         PR c++/100673
1097         * coroutines.cc (build_co_await): Guard against NULL
1098         await_suspend types.
1100 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
1102         PR c++/101133
1103         * coroutines.cc (build_co_await): Mark co_await_expr trees
1104         with TREE_SIDE_EFFECTS, also mark any containing expression.
1105         (finish_co_await_expr): Mark type-dependent co_await_expr
1106         trees with TREE_SIDE_EFFECTS.
1108 2021-10-03  Iain Sandoe  <iain@sandoe.co.uk>
1110         PR c++/99575
1111         * coroutines.cc (build_co_await): Strip NOPs from
1112         candidate awaiter expressions before testing to see
1113         if they need a temporary.
1115 2021-10-01  Martin Sebor  <msebor@redhat.com>
1117         PR c/102103
1118         * typeck.c (warn_for_null_address): Enhance.
1119         (cp_build_binary_op): Call it also for member pointers.
1121 2021-10-01  qingzhe huang  <nickhuang99@hotmail.com>
1123         PR c++/101783
1124         * tree.c (cp_build_qualified_type_real): Exclude typedef from
1125         error.
1127 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
1128             Richard Biener  <rguenther@suse.de>
1130         PR sanitizer/102515
1131         * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
1132         for division even for SANITIZE_SI_OVERFLOW.
1134 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
1136         * parser.c (cp_parser_omp_clause_order): Set
1137         OMP_CLAUSE_ORDER_REPRODUCIBLE for explicit reproducible: modifier.
1139 2021-10-01  Jakub Jelinek  <jakub@redhat.com>
1141         PR c++/102496
1142         * name-lookup.c (push_local_extern_decl_alias): Return early even for
1143         tls vars with non-dependent type when processing_template_decl.  For
1144         CP_DECL_THREAD_LOCAL_P vars call set_decl_tls_model on alias.
1146 2021-09-30  Patrick Palka  <ppalka@redhat.com>
1148         PR c++/102535
1149         * method.c (is_xible_helper): Don't exit early for multi-arg
1150         ctors in C++20.
1152 2021-09-30  Patrick Palka  <ppalka@redhat.com>
1154         * parser.c (cp_parser_trait_expr): Call nreverse on the reversed
1155         list of trailing arguments.
1157 2021-09-30  Patrick Palka  <ppalka@redhat.com>
1159         PR c++/95567
1160         * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields.
1162 2021-09-28  Patrick Palka  <ppalka@redhat.com>
1164         PR c++/99909
1165         * pt.c (coerce_template_template_parms): Keep
1166         processing_template_decl set around the call to unify as well.
1168 2021-09-28  Iain Sandoe  <iain@sandoe.co.uk>
1170         PR c++/102454
1171         * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
1172         unnamed function params.
1173         (morph_fn_to_coro): Do not try to set a guard variable for param
1174         DTORs in the ramp, unless we have exceptions active.
1176 2021-09-27  Patrick Palka  <ppalka@redhat.com>
1178         PR c++/102479
1179         * pt.c (rewrite_template_parm): Handle single-level tsubst_args.
1180         Avoid a tree cycle when assigning the DECL_TEMPLATE_PARMS for a
1181         rewritten ttp.
1182         (alias_ctad_tweaks): Set current_template_parms accordingly.
1184 2021-09-23  Michel Morin  <mimomorin@gmail.com>
1186         * parser.c (cp_keyword_starts_decl_specifier_p): Do not
1187         handle RID_ATTRIBUTE.
1188         (cp_parser_constructor_declarator_p): Remove now-redundant
1189         checks.
1190         (cp_parser_lambda_declarator_opt): Likewise.
1192 2021-09-23  Michel Morin  <mimomorin@gmail.com>
1194         PR c++/77565
1195         * parser.c (cp_keyword_starts_decl_specifier_p): Handle more
1196         decl-specifiers (typedef/inline/cv/explicit/virtual/friend).
1198 2021-09-23  Patrick Palka  <ppalka@redhat.com>
1200         * ptree.c (cxx_print_decl): Dump the DECL_TEMPLATE_RESULT of
1201         a TEMPLATE_DECL.  Dump the DECL_TEMPLATE_INFO rather than just
1202         printing its pointer value.
1204 2021-09-23  Jakub Jelinek  <jakub@redhat.com>
1206         PR c++/102413
1207         * parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
1208         is not followed by a balanced token sequence starting with open paren.
1210 2021-09-22  Patrick Palka  <ppalka@redhat.com>
1212         DR 2446
1213         PR c++/102412
1214         * constexpr.c (cxx_eval_constant_expression)
1215         <case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
1216         instead of processing_template_decl.
1217         * pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
1218         Return true only if any_dependent_template_arguments_p.
1219         (instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
1220         <case TEMPLATE_ID_EXPR>: Likewise.
1222 2021-09-22  Jakub Jelinek  <jakub@redhat.com>
1224         * parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
1225         modifiers.
1226         * semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
1227         semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
1228         * pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
1229         also OMP_CLAUSE_ALLOCATE_ALIGN.
1231 2021-09-22  Barrett Adair  <barrettellisadair@gmail.com>
1233         * pt.c (find_parm_usage_r): New walk_tree callback to find func
1234         parms.
1235         (any_template_arguments_need_structural_equality_p): New special
1236         case.
1238 2021-09-21  wangpc  <pc.wang@linux.alibaba.com>
1240         * decl.c (start_decl_1): Move verify_type_context to ...
1241         (cp_finish_decl): ... to here.
1243 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
1245         * parser.c (cp_parser_omp_clause_order): Parse unconstrained
1246         and reproducible modifiers.
1247         (OMP_DISTRIBUTE_CLAUSE_MASK): Add order clause.
1249 2021-09-18  Jakub Jelinek  <jakub@redhat.com>
1251         * parser.c (cp_parser_omp_clause_default): Handle private and
1252         firstprivate arguments, adjust diagnostics on unknown argument.
1253         * cp-gimplify.c (cxx_omp_finish_clause): Handle OMP_CLAUSE_PRIVATE.
1255 2021-09-18  Jason Merrill  <jason@redhat.com>
1257         * cp-tree.h (dependentish_scope_p): Declare.
1258         * pt.c (dependentish_scope_p): New.
1259         * parser.c (cp_parser_lookup_name): Return a TYPENAME_TYPE
1260         for lookup of a type in a dependent object.
1261         (cp_parser_template_id): Handle TYPENAME_TYPE.
1262         (cp_parser_template_name): If we're looking for a type,
1263         a name followed by < names a template.
1265 2021-09-18  Jason Merrill  <jason@redhat.com>
1267         * cp-tree.h: Fix typo in LANG_FLAG list.
1269 2021-09-17  Jakub Jelinek  <jakub@redhat.com>
1271         * cp-tree.h (finish_omp_atomic): Add r and weak arguments.
1272         * parser.c (cp_parser_omp_atomic): Update function comment for
1273         OpenMP 5.1 atomics, parse OpenMP 5.1 atomics and fail, compare and
1274         weak clauses.
1275         * semantics.c (finish_omp_atomic): Add r and weak arguments, handle
1276         them, handle COND_EXPRs.
1277         * pt.c (tsubst_expr): Adjust for COND_EXPR forms that
1278         finish_omp_atomic can now produce.
1280 2021-09-16  Patrick Palka  <ppalka@redhat.com>
1282         PR c++/98486
1283         * constraint.cc (get_normalized_constraints_from_decl): Always
1284         look up constraints using the most general template.
1285         * decl.c (grokdeclarator): Set constraints on a static data
1286         member template.
1287         * pt.c (determine_specialization): Check constraints on a
1288         variable template.
1290 2021-09-16  Iain Sandoe  <iain@sandoe.co.uk>
1292         * coroutines.cc (await_statement_walker): Code cleanups.
1294 2021-09-16  Jason Merrill  <jason@redhat.com>
1296         * constexpr.c (cxx_eval_outermost_constant_expr): Use
1297         protected_set_expr_location.
1299 2021-09-15  Patrick Palka  <ppalka@redhat.com>
1301         PR c++/101904
1302         * call.c (build_user_type_conversion_1): Add tf_conv to complain.
1303         (add_candidates): When in a SFINAE context, instead of adding a
1304         candidate to bad_fns just mark it unviable.
1306 2021-09-15  Jason Merrill  <jason@redhat.com>
1308         * cp-tree.h (parsing_function_declarator): Declare.
1309         * name-lookup.c (set_decl_context_in_fn): Use it.
1310         * parser.c (cp_parser_direct_declarator): Use it.
1311         (parsing_function_declarator): New.
1313 2021-09-15  Jakub Jelinek  <jakub@redhat.com>
1315         PR c++/88578
1316         PR c++/102295
1317         * typeck2.c (split_nonconstant_init_1): Don't throw away empty
1318         initializers of flexible array members if they have non-zero type
1319         size.
1321 2021-09-15  Patrick Palka  <ppalka@redhat.com>
1323         PR c++/102050
1324         * decl.c (grok_special_member_properties): Set
1325         TYPE_HAS_COPY_CTOR, TYPE_HAS_DEFAULT_CONSTRUCTOR
1326         and TYPE_HAS_LIST_CTOR independently from each other.
1328 2021-09-15  Jason Merrill  <jason@redhat.com>
1330         * decl.c (cxx_init_decl_processing): Only warn about odd
1331         interference sizes if they were specified with --param.
1333 2021-09-15  Jason Merrill  <jason@redhat.com>
1335         PR c++/48396
1336         * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
1337         (type_info_ptr_type): Remove.
1338         * rtti.c (init_rtti_processing): Don't predeclare std::type_info.
1339         (typeid_ok_p): Check for null const_type_info_type_node.
1340         (type_info_ptr_type, get_void_tinfo_ptr): New fns.
1341         (get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
1342         (ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
1343         (get_tinfo_desc): Use const_ptr_type_node.
1345 2021-09-15  Jason Merrill  <jason@redhat.com>
1347         * parser.c (cp_parser_template_name): Move object type.
1348         (cp_parser_pre_parsed_nested_name_specifier): Likewise.
1350 2021-09-15  Jason Merrill  <jason@redhat.com>
1352         * parser.c (cp_parser_unqualified_id): Only complain about ~A<T> in
1353         a declarator.
1355 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
1357         * coroutines.cc (struct param_info): Add copy_var.
1358         (build_actor_fn): Use simplified param references.
1359         (register_param_uses): Likewise.
1360         (rewrite_param_uses): Likewise.
1361         (analyze_fn_parms): New function.
1362         (coro_rewrite_function_body): Add proxies for the fn
1363         parameters to the outer bind scope of the rewritten code.
1364         (morph_fn_to_coro): Use simplified version of param ref.
1366 2021-09-14  Iain Sandoe  <iain@sandoe.co.uk>
1368         * coroutines.cc (coro_resume_fn_id, coro_destroy_fn_id,
1369         coro_promise_id, coro_frame_needs_free_id, coro_resume_index_id,
1370         coro_self_handle_id, coro_actor_continue_id,
1371         coro_frame_i_a_r_c_id): New.
1372         (coro_init_identifiers): Initialize new name identifiers.
1373         (coro_promise_type_found_p): Use pre-built identifiers.
1374         (struct await_xform_data): Remove unused fields.
1375         (transform_await_expr): Delete code that is now unused.
1376         (build_actor_fn): Simplify interface, use pre-built identifiers and
1377         remove transforms that are no longer needed.
1378         (build_destroy_fn): Use revised field names.
1379         (register_local_var_uses): Use pre-built identifiers.
1380         (coro_rewrite_function_body): Simplify interface, use pre-built
1381         identifiers.  Generate proxy vars in the outer bind expr scope for the
1382         implementation state that we wish to expose.
1383         (morph_fn_to_coro): Adjust comments for new variable names, use pre-
1384         built identifiers.  Remove unused code to generate frame entries for
1385         the implementation state.  Adjust call for build_actor_fn.
1387 2021-09-14  Patrick Palka  <ppalka@redhat.com>
1389         PR c++/102163
1390         * constexpr.c (cxx_eval_call_expression): After evaluating a
1391         subobject constructor call for an empty union member, produce a
1392         side effect that makes sure the member gets activated.
1394 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
1396         PR c++/102295
1397         * decl.c (layout_var_decl): For aggregates ending with a flexible
1398         array member, add the size of the initializer for that member to
1399         DECL_SIZE and DECL_SIZE_UNIT.
1401 2021-09-14  Jakub Jelinek  <jakub@redhat.com>
1403         PR c++/102305
1404         * method.c (is_xible_helper): Call complete_type on to.
1406 2021-09-14  Jason Merrill  <jason@redhat.com>
1408         * decl.c (cxx_init_decl_processing): Don't warn if L1 cache line
1409         size is smaller than maxalign.
1411 2021-09-13  Jason Merrill  <jason@redhat.com>
1413         * constexpr.c (maybe_warn_about_constant_value):
1414         Complain about std::hardware_destructive_interference_size.
1415         (cxx_eval_constant_expression): Call it.
1416         * decl.c (cxx_init_decl_processing): Check
1417         --param *-interference-size values.
1419 2021-09-13  Patrick Palka  <ppalka@redhat.com>
1421         PR c++/101764
1422         * cp-tree.h (PACK_EXPANSION_FORCE_EXTRA_ARGS_P): New accessor
1423         macro.
1424         * pt.c (has_extra_args_mechanism_p): New function.
1425         (find_parameter_pack_data::found_extra_args_tree_p): New data
1426         member.
1427         (find_parameter_packs_r): Set ppd->found_extra_args_tree_p
1428         appropriately.
1429         (make_pack_expansion): Set PACK_EXPANSION_FORCE_EXTRA_ARGS_P if
1430         ppd.found_extra_args_tree_p.
1431         (use_pack_expansion_extra_args_p): Return true if there were
1432         unsubstituted packs and PACK_EXPANSION_FORCE_EXTRA_ARGS_P.
1433         (tsubst_pack_expansion): Pass the pack expansion to
1434         use_pack_expansion_extra_args_p.
1436 2021-09-10  Jakub Jelinek  <jakub@redhat.com>
1438         * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
1439         and acq_rel/acquire clauses on update.
1440         * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
1442 2021-09-08  Richard Biener  <rguenther@suse.de>
1444         PR c++/102228
1445         * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
1446         * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
1447         place on invalid code.
1448         * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
1449         access.
1450         * module.cc (trees_in::read_class_def): Likewise.  Reconstruct
1451         ANON_AGGR_TYPE_FIELD.
1452         * semantics.c (finish_member_declaration): Populate
1453         ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
1454         * typeck.c (lookup_anon_field): Remove DFS search and return
1455         ANON_AGGR_TYPE_FIELD directly.
1457 2021-09-07  Jakub Jelinek  <jakub@redhat.com>
1459         PR c++/100495
1460         * constexpr.c (maybe_save_constexpr_fundef): Save body even for
1461         constexpr deleting dtors.
1462         (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
1463         deleting dtors.
1465 2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>
1467         * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
1468         directive.
1469         * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
1471 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
1473         * coroutines.cc (register_local_var_uses): Do not mangle
1474         frame entries for the outermost scope.  Record the outer
1475         scope as nesting depth 0.
1477 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
1479         * coroutines.cc (coro_build_artificial_var): New.
1480         (build_actor_fn): Use var builder, rename vars to use
1481         implementation namespace.
1482         (coro_rewrite_function_body): Likewise.
1483         (morph_fn_to_coro): Likewise.
1485 2021-09-03  Iain Sandoe  <iain@sandoe.co.uk>
1487         * coroutines.cc (transform_local_var_uses): Record
1488         frame offset expressions as DECL_VALUE_EXPRs instead of
1489         rewriting them.
1491 2021-09-03  Patrick Palka  <ppalka@redhat.com>
1493         PR c++/101904
1494         * call.c (build_this_conversion): New function, split out from
1495         add_function_candidate.
1496         (add_function_candidate): New parameter shortcut_bad_convs.
1497         Document it.  Use build_this_conversion.  Stop at the first bad
1498         argument conversion when shortcut_bad_convs is true.
1499         (add_template_candidate_real): New parameter shortcut_bad_convs.
1500         Use build_this_conversion to check the 'this' conversion before
1501         attempting deduction.  When the rejection reason code is
1502         rr_bad_arg_conversion, pass -1 instead of 0 as the viable
1503         parameter to add_candidate.  Pass 'convs' to add_candidate.
1504         (add_template_candidate): New parameter shortcut_bad_convs.
1505         (add_template_conv_candidate): Pass false as shortcut_bad_convs
1506         to add_template_candidate_real.
1507         (add_candidates): Prefer to shortcut bad conversions during
1508         overload resolution under the assumption that we'll eventually
1509         see a strictly viable candidate.  If this assumption turns out
1510         to be false, re-process the non-strictly viable candidates
1511         without shortcutting those bad conversions.
1513 2021-09-03  Jason Merrill  <jason@redhat.com>
1515         * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
1516         we decide not to instantiate.
1518 2021-09-03  Jakub Jelinek  <jakub@redhat.com>
1520         PR target/102024
1521         * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
1522         instead of writing to DECL_FIELD_ABI_IGNORED.
1523         (layout_class_type): Likewise.  In the place where zero-width
1524         bitfields used to be removed, use
1525         SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
1527 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
1529         * call.c (build_over_call): Handle unavailable state in addition to
1530         deprecation.
1531         * class.c (type_build_ctor_call): Likewise.
1532         (type_build_dtor_call): Likewise.
1533         * cp-tree.h: Rename cp_warn_deprecated_use to
1534         cp_handle_deprecated_or_unavailable.
1535         * decl.c (duplicate_decls): Merge unavailability.
1536         (grokdeclarator): Handle unavailability in addition to deprecation.
1537         (type_is_unavailable): New.
1538         (grokparms): Handle unavailability in addition to deprecation.
1539         * decl.h (enum deprecated_states): Add
1540         UNAVAILABLE_DEPRECATED_SUPPRESS.
1541         * decl2.c (cplus_decl_attributes): Propagate unavailability to
1542         templates.
1543         (cp_warn_deprecated_use): Rename to ...
1544         (cp_handle_deprecated_or_unavailable): ... this and amend to handle
1545         the unavailable case. It remains a warning in the case of deprecation
1546         but becomes an error in the case of unavailability.
1547         (cp_warn_deprecated_use_scopes): Handle unavailability.
1548         (mark_used): Likewise.
1549         * parser.c (cp_parser_template_name): Likewise.
1550         (cp_parser_template_argument): Likewise.
1551         (cp_parser_parameter_declaration_list): Likewise.
1552         * typeck.c (build_class_member_access_expr): Likewise.
1553         (finish_class_member_access_expr): Likewise.
1554         * typeck2.c (build_functional_cast_1): Likewise.
1556 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
1558         * coroutines.cc (build_actor_fn): Add begin/finish clauses
1559         to the initial test in the actor function.
1561 2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>
1563         * coroutines.cc (await_statement_walker): Use build_stmt and
1564         add_stmt instead of build1 and finish_expr_stmt.
1566 2021-08-31  Jason Merrill  <jason@redhat.com>
1568         * coroutines.cc (flatten_await_stmt): Fix copyo.
1569         * decl.c (reshape_init_class): Simplify.
1570         * module.cc (module_state::read_language): Add null check.
1571         * parser.c (build_range_temp): Avoid type_uses_auto.
1572         (cp_parser_class_specifier_1): Add null check.
1574 2021-08-31  Patrick Palka  <ppalka@redhat.com>
1576         PR c++/12672
1577         * call.c (rejection_reason::call_varargs_p): Rename this
1578         previously unused member to ...
1579         (rejection_reason::least_p): ... this.
1580         (arity_rejection): Add least_p parameter.
1581         (add_template_candidate_real): When there are explicit
1582         template arguments, check that the arity of the call agrees with
1583         the arity of the function before attempting deduction.
1584         (print_arity_information): Add least_p parameter.
1585         (print_z_candidate): Adjust call to print_arity_information.
1587 2021-08-31  Martin Sebor  <msebor@redhat.com>
1589         * parser.c (cp_parser_selection_statement): Use direct initialization
1590         instead of copy.
1592 2021-08-31  Jason Merrill  <jason@redhat.com>
1594         * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
1596 2021-08-31  Jason Merrill  <jason@redhat.com>
1598         PR c++/92193
1599         * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
1600         * constexpr.c (cxx_eval_call_expression): Set it.
1601         * pt.c (neglectable_inst_p): Check it.
1603 2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>
1605         * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
1606         and 'ancestor' in 'target device' clauses.
1607         * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
1608         evaluate to '1' if 'ancestor' is used.
1610 2021-08-30  Jason Merrill  <jason@redhat.com>
1612         PR c++/96286
1613         * cp-tree.h (struct lang_type): Add erroneous bit-field.
1614         (CLASSTYPE_ERRONEOUS): New.
1615         * pt.c (limit_bad_template_recursion): Check it.
1616         (instantiate_class_template_1): Set it.
1618 2021-08-30  Jason Merrill  <jason@redhat.com>
1620         * constexpr.c (cxx_eval_outermost_constant_expr): Copy
1621         expr location to result.
1623 2021-08-30  Jason Merrill  <jason@redhat.com>
1625         PR c++/101460
1626         * cp-tree.h (cxx_constant_value_sfinae): Declare.
1627         * constexpr.c (cxx_constant_value_sfinae): New.
1628         * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
1629         (tsubst_copy_and_build) [CALL_EXPR]: Call
1630         maybe_fold_fn_template_args.
1632 2021-08-30  Jason Merrill  <jason@redhat.com>
1634         * parser.c (cp_parser_simple_requirement): Warn about missing
1635         requires.
1637 2021-08-27  Jason Merrill  <jason@redhat.com>
1639         * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
1640         a dependent pointer.
1642 2021-08-25  Andrew Pinski  <apinski@marvell.com>
1644         PR c++/66590
1645         * cp-objcp-common.c (cxx_block_may_fallthru): Handle
1646         CLEANUP_STMT for the case which will be try/finally.
1648 2021-08-25  Jakub Jelinek  <jakub@redhat.com>
1650         PR c++/102019
1651         * init.c (build_value_init_noctor): Ignore unnamed zero-width
1652         bitfields.
1654 2021-08-23  Jakub Jelinek  <jakub@redhat.com>
1656         * parser.c (cp_parser_omp_clause_num_tasks,
1657         cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
1659 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
1661         * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
1662         PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
1663         (cp_parser_omp_error): New function.
1664         (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
1666 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
1668         * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
1669         comma at the end of list.  Don't parse closing paren here...
1670         (cp_parser_omp_clause_depend): ... but here instead.
1672 2021-08-19  Patrick Palka  <ppalka@redhat.com>
1674         PR c++/101803
1675         * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
1677 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
1679         * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
1680         and optionally consume token if current token is CPP_EOF,
1681         CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
1683 2021-08-19  Jakub Jelinek  <jakub@redhat.com>
1685         * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
1686         instead of cp_parser_skip_to_pragma_eol.
1688 2021-08-18  Patrick Palka  <ppalka@redhat.com>
1690         PR c++/101344
1691         PR c++/101803
1692         * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
1693         * decl.c (reshape_init_r): Set it.
1694         * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
1695         iff CONSTRUCTOR_BRACES_ELIDED_P.
1697 2021-08-18  Patrick Palka  <ppalka@redhat.com>
1699         PR c++/101883
1700         * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
1701         do_auto_deduction.
1703 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
1705         * parser.c (cp_parser_omp_nothing): New function.
1706         (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
1708 2021-08-18  Jakub Jelinek  <jakub@redhat.com>
1710         * parser.c (cp_parser_omp_ordered): Return true instead of
1711         false after emitting errors that the directive is not allowed in
1712         pragma_stmt context.
1713         (cp_parser_omp_target_update): Likewise.
1714         (cp_parser_omp_cancellation_point): Change return type from void to
1715         bool, return false if the directive should be ignored in pragma_stmt
1716         contexts.
1717         (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
1718         Change return type from tree to bool, return false if the
1719         directive should be ignored in pragma_stmt contexts.
1720         (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
1721         return their result directly.
1722         (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
1723         cp_parser_omp_cancellation_point returned.  Return true instead of
1724         false after emitting errors that the directive is not allowed in
1725         pragma_stmt context.
1727 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
1729         PR c++/101539
1730         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
1731         (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
1732         (fold_builtin_is_corresponding_member, next_common_initial_seqence,
1733         layout_compatible_type_p): Declare.
1734         * parser.c (cp_parser_primary_expression): Handle
1735         RID_IS_LAYOUT_COMPATIBLE.
1736         (cp_parser_trait_expr): Likewise.
1737         * cp-objcp-common.c (names_builtin_p): Likewise.
1738         * constraint.cc (diagnose_trait_expr): Handle
1739         CPTK_IS_LAYOUT_COMPATIBLE.
1740         * decl.c (cxx_init_decl_processing): Register
1741         __builtin_is_corresponding_member builtin.
1742         * constexpr.c (cxx_eval_builtin_function_call): Handle
1743         CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
1744         * semantics.c (is_corresponding_member_union,
1745         is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
1746         New functions.
1747         (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
1748         (finish_trait_expr): Likewise.
1749         * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
1750         New functions.
1751         * cp-gimplify.c (cp_gimplify_expr): Fold
1752         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
1753         (cp_fold): Likewise.
1754         * tree.c (builtin_valid_in_constant_expr_p): Handle
1755         CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
1756         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1757         CPTK_IS_LAYOUT_COMPATIBLE.
1758         * class.c (remove_zero_width_bit_fields): Remove.
1759         (layout_class_type): Don't call it.
1761 2021-08-17  Jakub Jelinek  <jakub@redhat.com>
1763         * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
1764         (cp_parser_omp_scope): New function.
1765         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
1766         * pt.c (tsubst_expr): Handle OMP_SCOPE.
1768 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
1770         * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
1771         (cp_parser_omp_clause_filter): New function.
1772         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
1773         (OMP_MASKED_CLAUSE_MASK): Define.
1774         (cp_parser_omp_masked): New function.
1775         (cp_parser_omp_parallel): Handle parallel masked.
1776         (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
1777         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
1778         * pt.c (tsubst_omp_clauses): Likewise.
1779         (tsubst_expr): Handle OMP_MASKED.
1781 2021-08-12  Sergei Trofimovich  <siarheit@google.com>
1783         PR c++/101219
1784         * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
1785         to construct ptrmemfunc expression instantiation.
1787 2021-08-12  Tobias Burnus  <tobias@codesourcery.com>
1789         * parser.c (cp_parser_omp_clause_proc_bind): Accept
1790         'primary' as alias for 'master'.
1792 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
1794         * cp-tree.h (omp_declare_target_attr): New type.
1795         (struct saved_scope): Change type of omp_declare_target_attribute
1796         from int to vec<omp_declare_target_attr, va_gc> * and move it.
1797         * parser.c (cp_parser_omp_declare_target): Instead of
1798         incrementing scope_chain->omp_declare_target_attribute, push
1799         a struct containing parser->lexer->in_omp_attribute_pragma to
1800         the vector.
1801         (cp_parser_omp_end_declare_target): Instead of decrementing
1802         scope_chain->omp_declare_target_attribute, pop a structure
1803         from it.  Diagnose mismatching declare target vs.
1804         end declare target syntax.
1805         * semantics.c (finish_translation_unit): Use vec_safe_length
1806         and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
1807         * decl2.c (cplus_decl_attributes): Use vec_safe_length
1808         on scope_chain->omp_declare_target_attributes.
1810 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
1812         * parser.c (cp_parser_lambda_body): Add temp overrides
1813         for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
1814         (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
1815         cp_parser_declaration_statement.
1816         (cp_parser_default_argument): Add temp override for
1817         parser->omp_attrs_forbidden_p.
1818         (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
1819         or declare variant in attribute syntax on a declaration immediately
1820         following an OpenMP construct in pragma syntax.
1822 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
1824         PR c++/94162
1825         * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
1826         or for classes not in std namespace.
1828 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
1830         * name-lookup.c (finish_using_directive): Diagnose omp::directive
1831         or omp::sequence attributes on using-directive.
1833 2021-08-12  Jakub Jelinek  <jakub@redhat.com>
1835         * parser.c (cp_parser_block_declaration): Call
1836         cp_parser_using_directive for C++11 attributes followed by
1837         using namespace tokens.
1838         (cp_parser_using_directive): Parse C++11 attributes at the start
1839         of the directive rather than at the end, only parse GNU attributes
1840         at the end.
1842 2021-08-12  Patrick Palka  <ppalka@redhat.com>
1844         PR c++/101663
1845         * constexpr.c (cxx_eval_store_expression): Handle the lval=true
1846         case in the early exit code path for empty stores with mismatched
1847         types.
1849 2021-08-11  Patrick Palka  <ppalka@redhat.com>
1851         PR c++/101725
1852         DR 2082
1853         * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
1854         * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
1855         operands.
1856         * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
1857         reject uses of local variables in unevaluated contexts.
1858         * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
1859         cp_unevaluated_operand.  Use cp_walk_tree directly instead of
1860         WALK_SUBTREE to avoid the goto.  Use REQUIRES_EXPR_REQS instead
1861         of TREE_OPERAND directly.
1863 2021-08-11  Jakub Jelinek  <jakub@redhat.com>
1865         PR c++/101786
1866         * decl2.c (var_defined_without_dynamic_init): Return true for
1867         DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
1869 2021-08-11  Patrick Palka  <ppalka@redhat.com>
1871         PR c++/79501
1872         * parser.c (maybe_adjust_declarator_for_dguide): New, split
1873         out from ...
1874         (cp_parser_init_declarator): ... here.
1875         (cp_parser_member_declaration): Use it.
1877 2021-08-11  Patrick Palka  <ppalka@redhat.com>
1879         PR c++/89062
1880         * parser.c (cp_parser_parameter_declaration_list): Don't call
1881         grokdeclarator if cp_parser_error_occurred.
1882         (cp_parser_parameter_declaration): Simulate an error if we see
1883         the beginning of a CTAD form, i.e. if we see an opening brace
1884         after the decl-specifier-seq and the type is a CTAD placeholder.
1886 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
1888         * parser.c (cp_parser_member_declaration): Move odsd declaration
1889         before cp_parser_using_declaration call to avoid errors with
1890         GCC 4.8 to 6.
1892 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
1894         * parser.h (struct cp_omp_declare_simd_data): Remove
1895         in_omp_attribute_pragma and clauses members, add loc and attribs.
1896         (struct cp_oacc_routine_data): Remove loc member, add clauses
1897         member.
1898         * parser.c (cp_finalize_omp_declare_simd): New function.
1899         (cp_parser_handle_statement_omp_attributes): Mention in
1900         function comment the function is used also for
1901         attribute-declaration.
1902         (cp_parser_handle_directive_omp_attributes): New function.
1903         (cp_parser_statement): Don't call
1904         cp_parser_handle_statement_omp_attributes if statement doesn't
1905         have attribute-specifier-seq at the beginning at all or if
1906         if those attributes don't appertain to the statement.
1907         (cp_parser_simple_declaration): Call
1908         cp_parser_handle_directive_omp_attributes and
1909         cp_finalize_omp_declare_simd.
1910         (cp_parser_explicit_instantiation): Likewise.
1911         (cp_parser_init_declarator): Initialize prefix_attributes
1912         only after parsing declarators.
1913         (cp_parser_direct_declarator): Call
1914         cp_parser_handle_directive_omp_attributes and
1915         cp_finalize_omp_declare_simd.
1916         (cp_parser_member_declaration): Likewise.
1917         (cp_parser_single_declaration): Likewise.
1918         (cp_parser_omp_declare_simd): Don't initialize
1919         data.in_omp_attribute_pragma, instead initialize
1920         data.attribs[0] and data.attribs[1].
1921         (cp_finish_omp_declare_variant): Remove
1922         in_omp_attribute_pragma argument, instead use
1923         parser->lexer->in_omp_attribute_pragma.
1924         (cp_parser_late_parsing_omp_declare_simd): Adjust
1925         cp_finish_omp_declare_variant caller.  Handle attribute-syntax
1926         declare simd/variant.
1928 2021-08-06  Tamar Christina  <tamar.christina@arm.com>
1930         * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
1931         * decl.c (cxx_simulate_enum_decl): Likewise.
1933 2021-08-04  Jakub Jelinek  <jakub@redhat.com>
1935         PR c++/101759
1936         * parser.c (cp_parser_default_argument): Temporarily override
1937         parser->omp_declare_simd and parser->oacc_routine to NULL.
1939 2021-08-02  Patrick Palka  <ppalka@redhat.com>
1941         PR c++/100828
1942         * logic.cc (formula::formula): Use emplace_back instead of
1943         push_back.
1944         (formula::branch): Insert a copy of m_current directly after
1945         m_current instead of at the end of the list.
1946         (formula::erase): Define.
1947         (decompose_formula): Remove.
1948         (decompose_antecedents): Remove.
1949         (decompose_consequents): Remove.
1950         (derive_proofs): Remove.
1951         (max_problem_size): Remove.
1952         (diagnose_constraint_size): Remove.
1953         (subsumes_constraints_nonnull): Rewrite directly in terms of
1954         decompose_clause and derive_proof, interleaving decomposition
1955         with implication checking.  Remove limit on constraint complexity.
1956         Use formula::erase to free the current clause before moving on to
1957         the next one.
1959 2021-07-31  Jason Merrill  <jason@redhat.com>
1961         PR c++/96636
1962         * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
1963         after error.
1965 2021-07-31  Jason Merrill  <jason@redhat.com>
1967         * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
1968         PACK_EXPANSION_PATTERN.
1970 2021-07-31  Jakub Jelinek  <jakub@redhat.com>
1972         * parser.c (cp_parser_declaration): Handle OpenMP directives
1973         in attribute-declaration.
1975 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
1977         PR c++/101539
1978         * cp-tree.h (enum cp_trait_kind): Add
1979         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1980         (enum cp_built_in_function): Add
1981         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
1982         (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
1983         * parser.c (cp_parser_primary_expression): Handle
1984         RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1985         (cp_parser_trait_expr): Likewise.
1986         * cp-objcp-common.c (names_builtin_p): Likewise.
1987         * constraint.cc (diagnose_trait_expr): Handle
1988         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1989         * decl.c (cxx_init_decl_processing): Register
1990         __builtin_is_pointer_interconvertible_with_class builtin.
1991         * constexpr.c (cxx_eval_builtin_function_call): Handle
1992         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
1993         * semantics.c (pointer_interconvertible_base_of_p,
1994         first_nonstatic_data_member_p,
1995         fold_builtin_is_pointer_inverconvertible_with_class): New functions.
1996         (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
1997         (finish_trait_expr): Likewise.  Formatting fix.
1998         * cp-gimplify.c (cp_gimplify_expr): Fold
1999         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
2000         fndecl_built_in_p just once.
2001         (cp_fold): Likewise.
2002         * tree.c (builtin_valid_in_constant_expr_p): Handle
2003         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
2004         fndecl_built_in_p just once.
2005         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2006         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
2008 2021-07-30  Jason Merrill  <jason@redhat.com>
2010         * class.c (finish_struct_anon): Improve comment.
2011         * decl.c (fixup_anonymous_aggr): Reject anonymous struct
2012         with bases.
2014 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
2016         * parser.c (cp_parser_statement): Rollback attributes not just
2017         when std_attrs is non-NULL, but whenever
2018         cp_parser_std_attribute_spec_seq parsed any tokens.
2020 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
2022         PR c++/101582
2023         * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
2024         declaration.
2025         (cp_parser_declaration): Parse empty-declaration and
2026         attribute-declaration.
2027         (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
2029 2021-07-28  Martin Sebor  <msebor@redhat.com>
2031         * init.c: Include new header.
2033 2021-07-27  Marek Polacek  <polacek@redhat.com>
2035         DR 1512
2036         PR c++/99701
2037         * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
2038         a switch.
2039         * typeck.c (cp_build_binary_op): Reject ordered comparison
2040         of two null pointers.
2042 2021-07-26  Jakub Jelinek  <jakub@redhat.com>
2044         * parser.h (struct cp_lexer): Add orphan_p member.
2045         * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
2046         upon restart from CPP_PRAGMA handling.  Fix up condition when a lexer
2047         should be destroyed and adjust saved_tokens if it records tokens from
2048         the to be destroyed lexer.
2049         (cp_parser_omp_section_scan): New function.
2050         (cp_parser_omp_scan_loop_body): Use it.  If
2051         parser->lexer->in_omp_attribute_pragma, allow optional comma
2052         after scan.
2053         (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
2055 2021-07-23  Jakub Jelinek  <jakub@redhat.com>
2057         * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
2058         * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
2059         mixing of attribute and pragma syntax directives when seeing
2060         omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
2061         directives are followed by OpenMP pragma.
2062         (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
2063         the cp_parser_handle_statement_omp_attributes call.
2064         (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
2065         if true, set parser->omp_attrs_forbidden_p.
2066         (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
2067         false as disallow_omp_attrs to cp_parser_omp_structured_block.
2068         (cp_parser_omp_parallel, cp_parser_omp_task): Set
2069         parser->omp_attrs_forbidden_p.
2071 2021-07-21  Thomas Schwinge  <thomas@codesourcery.com>
2072             Joseph Myers  <joseph@codesourcery.com>
2073             Cesar Philippidis  <cesar@codesourcery.com>
2075         * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
2076         (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
2077         (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
2078         * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
2079         * semantics.c (finish_omp_clauses): Likewise.
2081 2021-07-21  Jakub Jelinek  <jakub@redhat.com>
2083         PR c++/101516
2084         * semantics.c (finish_omp_reduction_clause): Also call
2085         complete_type_or_else and return true if it fails.
2087 2021-07-19  Iain Sandoe  <iain@sandoe.co.uk>
2089         PR c++/95520
2090         * coroutines.cc (struct coroutine_info): Add fields for
2091         actor and destroy function decls.
2092         (to_ramp): New.
2093         (coro_get_ramp_function): New.
2094         (coro_get_actor_function): New.
2095         (coro_get_destroy_function): New.
2096         (act_des_fn): Set up mapping between ramp, actor and
2097         destroy functions.
2098         (morph_fn_to_coro): Adjust interface to the builder for
2099         helper function decls.
2100         * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
2101         JOIN_STR): New.
2102         * mangle.c (write_encoding): Handle coroutine helpers.
2103         (write_unqualified_name): Handle lambda coroutine helpers.
2105 2021-07-16  Patrick Palka  <ppalka@redhat.com>
2107         PR c++/101233
2108         * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
2109         substituting DECL_ARGUMENTS.
2111 2021-07-16  Patrick Palka  <ppalka@redhat.com>
2113         DR 960
2114         PR c++/99664
2115         * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
2116         when the return types are references.
2118 2021-07-16  Marek Polacek  <polacek@redhat.com>
2120         * typeck2.c (check_narrowing): Don't suppress the pedantic error
2121         in system headers.
2123 2021-07-15  Jakub Jelinek  <jakub@redhat.com>
2125         PR c++/101443
2126         * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
2127         operands, fold them right away to true or false.
2129 2021-07-15  Jason Merrill  <jason@redhat.com>
2131         PR c++/101095
2132         * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
2133         (cp_tree_size): Remove redundant entries.
2135 2021-07-14  Patrick Palka  <ppalka@redhat.com>
2137         PR c++/88252
2138         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
2139         * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
2140         handling.
2141         (redeclare_class_template): Likewise.
2142         (forwarding_reference_p): Define.
2143         (maybe_adjust_types_for_deduction): Use it instead.  Add 'tparms'
2144         parameter.
2145         (unify_one_argument): Pass tparms to
2146         maybe_adjust_types_for_deduction.
2147         (try_one_overload): Likewise.
2148         (unify): Likewise.
2149         (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
2150         handling.
2152 2021-07-14  Jason Merrill  <jason@redhat.com>
2154         * class.c (struct find_final_overrider_data): Use auto_vec.
2155         (find_final_overrider): Remove explicit release.
2156         * coroutines.cc (process_conditional): Use auto_vec.
2157         * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
2158         (cp_genericize_tree): Remove explicit release.
2159         * parser.c (cp_parser_objc_at_property_declaration): Use
2160         auto_delete_vec.
2161         * semantics.c (omp_reduction_lookup): Use auto_vec.
2163 2021-07-14  Marek Polacek  <polacek@redhat.com>
2165         PR c++/101371
2166         * constexpr.c (cxx_eval_array_reference): Create a new .object
2167         and .ctor for the non-aggregate non-scalar case too when
2168         value-initializing.
2170 2021-07-12  Patrick Palka  <ppalka@redhat.com>
2172         PR c++/79501
2173         PR c++/100983
2174         * decl.c (grokfndecl): Don't require that deduction guides are
2175         declared at namespace scope.  Check that class-scope deduction
2176         guides have the same access as the member class template.
2177         (grokdeclarator): Pretend class-scope deduction guides are static.
2178         * search.c (lookup_member): Don't use a BASELINK for (class-scope)
2179         deduction guides.
2181 2021-07-10  Patrick Palka  <ppalka@redhat.com>
2183         PR c++/82110
2184         * init.c (build_aggr_init): Return error_mark_node if
2185         expand_aggr_init_1 returns false.
2186         (expand_default_init): Change return type to bool.  Return false
2187         on error, true on success.
2188         (expand_aggr_init_1): Likewise.
2190 2021-07-09  Jason Merrill  <jason@redhat.com>
2192         PR c++/101098
2193         * decl.c (function_requirements_equivalent_p): Only compare
2194         trailing requirements on a specialization.
2196 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
2198         * coroutines.cc (build_actor_fn): Move common code to
2199         act_des_fn.
2200         (build_destroy_fn): Likewise.
2201         (act_des_fn): Build the void return here.  Ensure that the
2202         source location matches the original function.
2204 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
2206         * coroutines.cc
2207         (coro_rewrite_function_body): Connect the replacement
2208         function block to the block nest correctly.
2210 2021-07-09  Patrick Palka  <ppalka@redhat.com>
2212         PR c++/101181
2213         * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
2214         add_extra_args.
2215         * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
2216         * pt.c (build_extra_args): Make a copy of args.
2217         (add_extra_args): Add complain/in_decl parameters.  Enable the
2218         code for handling the case where the extra arguments are
2219         dependent.
2220         (tsubst_pack_expansion): Pass complain/in_decl to
2221         add_extra_args.
2222         (tsubst_template_args): Handle missing template arguments.
2223         (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
2224         add_extra_args.
2226 2021-07-09  Patrick Palka  <ppalka@redhat.com>
2228         PR c++/101247
2229         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
2230         DECL_CONTEXT.
2232 2021-07-08  Martin Sebor  <msebor@redhat.com>
2234         PR bootstrap/101372
2235         * module.cc (identifier): Suppress warning.
2236         (module_state::read_macro_maps): Remove warning suppression.
2237         (module_state::install_macros): Ditto.
2239 2021-07-08  Marek Polacek  <polacek@redhat.com>
2241         PR c++/101087
2242         * cp-tree.h (unevaluated_p): New.
2243         * except.c (check_noexcept_r): Use it.  Don't walk into
2244         unevaluated operands.
2246 2021-07-08  Martin Sebor  <msebor@redhat.com>
2248         PR bootstrap/101374
2249         * module.cc (module_state::read_macro_maps): Temporarily disable
2250         -Warray-bounds.
2251         (module_state::install_macros): Same.
2253 2021-07-06  Martin Sebor  <msebor@redhat.com>
2255         * error.c (cp_printer):  Remove support for %G and %K.
2257 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
2259         * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
2260         (struct cp_omp_declare_simd_data): Likewise.
2261         * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
2262         (omp_identifier): Define.
2263         * parser.c (cp_parser_skip_to_pragma_eol): Handle
2264         in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
2265         (cp_parser_require_pragma_eol): Likewise.
2266         (struct cp_omp_attribute_data): New type.
2267         (cp_parser_handle_statement_omp_attributes): New function.
2268         (cp_parser_statement): Handle OpenMP directives in statement's
2269         attribute-specifier-seq.
2270         (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
2271         functions.
2272         (cp_parser_std_attribute): Handle omp::directive and omp::sequence
2273         attributes.
2274         (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
2275         a comma also before the first clause.
2276         (cp_parser_omp_allocate): Likewise.
2277         (cp_parser_omp_atomic): Likewise.
2278         (cp_parser_omp_depobj): Likewise.
2279         (cp_parser_omp_flush): Likewise.
2280         (cp_parser_omp_ordered): Likewise.
2281         (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
2282         into struct cp_omp_declare_simd_data.
2283         (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
2284         argument.  If set, allow a comma also before match clause.
2285         (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
2286         allow a comma also before the first clause.  Adjust
2287         cp_finish_omp_declare_variant caller.
2288         (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
2289         a comma also before the first clause.
2290         (cp_parser_omp_declare_reduction_exprs): Likewise.
2291         (cp_parser_omp_requires): Likewise.
2292         * decl.c (initialize_predefined_identifiers): Initialize
2293         omp_identifier.
2294         * decl2.c (cplus_decl_attributes): Reject omp::directive and
2295         omp::sequence attributes.
2297 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
2299         PR c/101297
2300         * parser.c (cp_parser_omp_atomic): Consume comma only if it
2301         appears before a CPP_NAME.
2303 2021-07-02  Patrick Palka  <ppalka@redhat.com>
2305         PR c++/101247
2306         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
2307         use common_enclosing_class and to not depend on the TREE_TYPE
2308         of outer levels pointing to the corresponding primary template.
2310 2021-07-01  Patrick Palka  <ppalka@redhat.com>
2312         PR c++/101194
2313         * constexpr.c (cxx_eval_array_reference): When the element type
2314         is an empty type and the corresponding element is omitted, just
2315         return an empty CONSTRUCTOR instead of attempting value
2316         initialization.
2318 2021-07-01  Patrick Palka  <ppalka@redhat.com>
2320         PR c++/96204
2321         * pt.c (finish_template_variable): Pass the partially
2322         instantiated template and its args to instantiate_template.
2323         (instantiate_class_template_1): No need to call
2324         push_nested_class and pop_nested_class around the call to
2325         most_specialized_partial_spec.
2326         (instantiate_template_1): Pass the partially instantiated
2327         template to lookup_template_variable.
2328         (most_specialized_partial_spec):  Use push_access_scope_guard
2329         to set the access scope appropriately.  Use
2330         deferring_access_check_sentinel to force access to get checked
2331         immediately.
2332         (instantiate_decl): Just pass the VAR_DECL to
2333         most_specialized_partial_spec.
2335 2021-06-30  Patrick Palka  <ppalka@redhat.com>
2337         * constraint.cc (get_normalized_constraints_from_decl): Use
2338         push_access_scope_guard instead of push_nested_class_guard.
2339         * cp-tree.h (struct push_nested_class_guard): Replace with ...
2340         (struct push_access_scope_guard): ... this.
2341         * pt.c (push_access_scope): When the argument corresponds to
2342         a class type, push the class instead of its context.
2343         (pop_access_scope): Adjust accordingly.
2345 2021-06-30  Marek Polacek  <polacek@redhat.com>
2347         PR c++/100975
2348         DR 2397
2349         * decl.c (create_array_type_for_decl): Allow array of auto.
2351 2021-06-29  Jason Merrill  <jason@redhat.com>
2353         * pt.c (instantiate_decl): Only consider partial specializations of
2354         actual variable templates.
2356 2021-06-26  Patrick Palka  <ppalka@redhat.com>
2358         PR c++/96204
2359         * pt.c (instantiate_class_template_1): Enter the scope of the
2360         type when calling most_specialized_partial_spec.
2362 2021-06-26  Jason Merrill  <jason@redhat.com>
2364         PR c++/101040
2365         PR c++/97566
2366         * class.c (is_empty_field): Handle null argument.
2367         * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
2368         for empty field.
2370 2021-06-26  Marek Polacek  <polacek@redhat.com>
2372         PR c++/100752
2373         * parser.c (cp_parser_declarator): Pass flags down to
2374         cp_parser_declarator.  Also pass static_p/member_p.
2376 2021-06-25  Martin Sebor  <msebor@redhat.com>
2378         * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
2379         with warning_suppressed_p, suppress_warning, and copy_no_warning, or
2380         nothing if not necessary.
2381         (set_up_extended_ref_temp): Same.
2382         * class.c (layout_class_type): Same.
2383         * constraint.cc (constraint_satisfaction_value): Same.
2384         * coroutines.cc (finish_co_await_expr): Same.
2385         (finish_co_yield_expr): Same.
2386         (finish_co_return_stmt): Same.
2387         (build_actor_fn): Same.
2388         (coro_rewrite_function_body): Same.
2389         (morph_fn_to_coro): Same.
2390         * cp-gimplify.c (genericize_eh_spec_block): Same.
2391         (gimplify_expr_stmt): Same.
2392         (cp_genericize_r): Same.
2393         (cp_fold): Same.
2394         * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
2395         * cvt.c (cp_fold_convert): Same.
2396         (convert_to_void): Same.
2397         * decl.c (wrapup_namespace_globals): Same.
2398         (grokdeclarator): Same.
2399         (finish_function): Same.
2400         (require_deduced_type): Same.
2401         * decl2.c (no_linkage_error): Same.
2402         (c_parse_final_cleanups): Same.
2403         * except.c (expand_end_catch_block): Same.
2404         * init.c (build_new_1): Same.
2405         (build_new): Same.
2406         (build_vec_delete_1): Same.
2407         (build_vec_init): Same.
2408         (build_delete): Same.
2409         * method.c (defaultable_fn_check): Same.
2410         * parser.c (cp_parser_fold_expression): Same.
2411         (cp_parser_primary_expression): Same.
2412         * pt.c (push_tinst_level_loc): Same.
2413         (tsubst_copy): Same.
2414         (tsubst_omp_udr): Same.
2415         (tsubst_copy_and_build): Same.
2416         * rtti.c (build_if_nonnull): Same.
2417         * semantics.c (maybe_convert_cond): Same.
2418         (finish_return_stmt): Same.
2419         (finish_parenthesized_expr): Same.
2420         (cp_check_omp_declare_reduction): Same.
2421         * tree.c (build_cplus_array_type): Same.
2422         * typeck.c (build_ptrmemfunc_access_expr): Same.
2423         (cp_build_indirect_ref_1): Same.
2424         (cp_build_function_call_vec): Same.
2425         (warn_for_null_address): Same.
2426         (cp_build_binary_op): Same.
2427         (unary_complex_lvalue): Same.
2428         (cp_build_modify_expr): Same.
2429         (build_x_modify_expr): Same.
2430         (convert_for_assignment): Same.
2432 2021-06-24  Patrick Palka  <ppalka@redhat.com>
2434         PR c++/98832
2435         * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
2437 2021-06-24  Patrick Palka  <ppalka@redhat.com>
2439         PR c++/101182
2440         * constraint.cc (evaluate_requires_expr): Adjust function comment.
2441         * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
2442         (cp_fold) <case REQUIRES_EXPR>: ... here.
2444 2021-06-24  Jakub Jelinek  <jakub@redhat.com>
2446         * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
2447         C_ORT_OMP for clauses on target construct.
2448         (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
2449         (cp_parser_omp_target): For non-combined target add
2450         map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION.  Pass
2451         C_ORT_OMP_TARGET to finish_omp_clauses.
2452         * semantics.c (handle_omp_array_sections_1): Adjust ort handling
2453         for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
2454         never present on C_ORT_*DECLARE_SIMD.
2455         (handle_omp_array_sections): Likewise.
2456         (finish_omp_clauses): Likewise.  Handle OMP_CLAUSE_IN_REDUCTION
2457         on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
2458         corresponding map clauses.
2459         * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
2460         clauses on target construct.
2462 2021-06-23  Patrick Palka  <ppalka@redhat.com>
2464         PR c++/101174
2465         * pt.c (push_access_scope): For artificial deduction guides,
2466         set the access scope to that of the constructor.
2467         (pop_access_scope): Likewise.
2468         (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
2470 2021-06-23  Patrick Palka  <ppalka@redhat.com>
2472         PR c++/86439
2473         * call.c (print_error_for_call_failure): Constify 'args' parameter.
2474         (perform_dguide_overload_resolution): Define.
2475         * cp-tree.h: (perform_dguide_overload_resolution): Declare.
2476         * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
2477         instead of build_new_function_call.  Don't use tf_decltype or
2478         set cp_unevaluated_operand.  Remove unnecessary NULL_TREE tests.
2480 2021-06-21  Patrick Palka  <ppalka@redhat.com>
2482         PR c++/67302
2483         * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
2484         sooner, before the NRVO handling.
2486 2021-06-21  Patrick Palka  <ppalka@redhat.com>
2488         PR c++/80431
2489         * tree.c (bot_replace): Use convert_to_base to build the
2490         conversion to the (morally) virtual base.
2492 2021-06-21  Jakub Jelinek  <jakub@redhat.com>
2494         PR inline-asm/100785
2495         * typeck.c (cxx_mark_addressable): Diagnose trying to make
2496         bit-fields addressable.
2498 2021-06-17  Jason Merrill  <jason@redhat.com>
2500         PR c++/101106
2501         * decl.c (duplicate_decls): Make 'deleted after first declaration'
2502         pedwarn on by default.
2504 2021-06-17  Jason Merrill  <jason@redhat.com>
2506         PR c++/101029
2507         * init.c (build_vec_init): Preserve the type of base.
2509 2021-06-16  Jason Merrill  <jason@redhat.com>
2511         PR c++/101078
2512         PR c++/91706
2513         * pt.c (tsubst_baselink): Update binfos in non-dependent case.
2515 2021-06-15  Robin Dapp  <rdapp@linux.ibm.com>
2517         * decl.c (duplicate_decls): Likewise.
2519 2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
2521         PR c/100913
2522         * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
2523         var in the error case.
2525 2021-06-13  Trevor Saunders  <tbsaunde@tbsaunde.org>
2527         * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
2528         with range based for.
2529         (cxx_eval_store_expression): Likewise.
2530         (cxx_eval_loop_expr): Likewise.
2531         * decl.c (wrapup_namespace_globals): Likewise.
2532         (cp_finish_decl): Likewise.
2533         (cxx_simulate_enum_decl): Likewise.
2534         * parser.c (cp_parser_postfix_expression): Likewise.
2536 2021-06-12  Jason Merrill  <jason@redhat.com>
2538         PR c++/101029
2539         * init.c (build_vec_init): Shortcut [0] case.
2541 2021-06-12  Jason Merrill  <jason@redhat.com>
2543         * pt.c (lookup_template_class_1): Shortcut current_class_type.
2545 2021-06-11  Patrick Palka  <ppalka@redhat.com>
2547         DR 1227
2548         PR c++/96560
2549         * pt.c (tsubst_arg_types): Rearrange so that we substitute into
2550         TYPE_ARG_TYPES in forward order while short circuiting
2551         appropriately.  Adjust formatting.
2553 2021-06-11  Jakub Jelinek  <jakub@redhat.com>
2555         PR c++/100974
2556         * cp-tree.h (struct saved_scope): Add consteval_if_p
2557         member.  Formatting fix for the discarded_stmt comment.
2558         (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
2559         * parser.c (cp_parser_lambda_expression): Temporarily disable
2560         in_consteval_if_p when parsing lambda body.
2561         (cp_parser_selection_statement): Parse consteval if.
2562         * decl.c (struct named_label_entry): Add in_consteval_if member.
2563         (level_for_consteval_if): New function.
2564         (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
2565         consteval if.
2566         * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
2567         why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
2568         for !ctx->manifestly_const_eval.
2569         (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
2570         condition as if it was __builtin_is_constant_evaluated call.
2571         (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
2572         recurse on both branches.
2573         * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
2574         as the else branch.
2575         * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
2576         Temporarily set in_consteval_if_p when recursing on
2577         IF_STMT_CONSTEVAL_P then branch.
2578         (tsubst_lambda_expr): Temporarily disable
2579         in_consteval_if_p when instantiating lambda body.
2580         * call.c (immediate_invocation_p): Return false when
2581         in_consteval_if_p.
2583 2021-06-11  Marek Polacek  <polacek@redhat.com>
2585         PR c++/100995
2586         * constexpr.c (maybe_constexpr_fn): New.
2587         * cp-tree.h (maybe_constexpr_fn): Declare.
2588         * semantics.c (find_std_constant_evaluated_r): New.
2589         (maybe_warn_for_constant_evaluated): New.
2590         (finish_if_stmt_cond): Call it.
2592 2021-06-10  Patrick Palka  <ppalka@redhat.com>
2594         PR c++/67829
2595         * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
2596         the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
2597         a template template parameter, adjust to the
2598         TEMPLATE_TEMPLATE_PARAMETER before falling through.
2600 2021-06-10  Patrick Palka  <ppalka@redhat.com>
2602         PR c++/100946
2603         * constraint.cc (normalize_placeholder_type_constraints): When
2604         normalizing a non-templated return-type-requirement, add a dummy
2605         level to initial_parms.
2607 2021-06-08  Marek Polacek  <polacek@redhat.com>
2609         PR c++/100065
2610         * decl.c (grokdeclarator): Store a value-dependent
2611         explicit-specifier even for deduction guides.
2613 2021-06-08  Jason Merrill  <jason@redhat.com>
2615         * parser.c (cp_parser_string_literal): Adjust diagnostic.
2617 2021-06-08  Jason Merrill  <jason@redhat.com>
2619         PR c++/100963
2620         * call.c (perfect_conversion_p): Check check_narrowing.
2622 2021-06-08  Jason Merrill  <jason@redhat.com>
2624         PR c++/91706
2625         * name-lookup.c (get_class_binding): Keep a BASELINK.
2626         (set_inherited_value_binding_p): Adjust.
2627         * lambda.c (is_lambda_ignored_entity): Adjust.
2628         * pt.c (lookup_template_function): Copy a BASELINK before
2629         modifying it.
2631 2021-06-08  Jason Merrill  <jason@redhat.com>
2633         PR c++/91706
2634         * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
2636 2021-06-08  Jason Merrill  <jason@redhat.com>
2638         * module.cc (duplicate_hash::hash): Comment out.
2639         (trees_in::tree_value): Adjust loop counter.
2641 2021-06-08  Jason Merrill  <jason@redhat.com>
2643         PR c++/100102
2644         * init.c (build_offset_ref): Return the BASELINK for a static
2645         member function.
2647 2021-06-07  Patrick Palka  <ppalka@redhat.com>
2649         PR c++/100918
2650         * parser.c (cp_parser_lookup_name): Check access of the lookup
2651         result before we potentially adjust an injected-class-name to
2652         its TEMPLATE_DECL.
2654 2021-06-06  Jakub Jelinek  <jakub@redhat.com>
2656         PR c/100902
2657         * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
2658         even when target is combined with other constructs.
2660 2021-06-04  Patrick Palka  <ppalka@redhat.com>
2662         PR c++/100893
2663         * pt.c (convert_template_argument): Strip top-level cv-quals
2664         on the substituted type of a non-type template parameter.
2666 2021-06-04  Patrick Palka  <ppalka@redhat.com>
2668         PR c++/100102
2669         * pt.c (tsubst_function_decl): Remove old code for reducing
2670         args when it has excess levels.
2672 2021-06-04  Jakub Jelinek  <jakub@redhat.com>
2674         PR c++/100872
2675         * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
2676         ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
2677         to the start.
2679 2021-06-03  Patrick Palka  <ppalka@redhat.com>
2681         PR c++/100592
2682         * decl.c (make_typename_type): After calling
2683         lookup_template_class, adjust the result to its TYPE_NAME and
2684         then consider the tf_keep_type_decl flag.
2686 2021-06-03  Patrick Palka  <ppalka@redhat.com>
2688         PR c++/100862
2689         * pt.c (set_current_access_from_decl): Move to ...
2690         * class.c (set_current_access_from_decl): ... here.
2691         (handle_using_decl): Use it to propagate the access of the
2692         using-enum decl to the copy of the imported enumerator.
2693         * cp-tree.h (set_current_access_from_decl): Declare.
2694         * decl.c (build_enumerator): Simplify using make_temp_override
2695         and set_current_access_from_decl.
2697 2021-06-03  Jakub Jelinek  <jakub@redhat.com>
2699         PR c++/100859
2700         * semantics.c (handle_omp_array_sections_1): For
2701         OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
2702         finish_non_static_data_member and allow this as base.
2703         (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
2704         after depend only cases.  Let this be diagnosed by !lvalue_p
2705         case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
2706         assert.
2707         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
2709 2021-06-02  Jason Merrill  <jason@redhat.com>
2711         PR c++/100838
2712         * call.c (convert_like_internal): Clear tf_no_cleanup when
2713         recursing.
2714         (build_user_type_conversion_1): Only add ck_rvalue if
2715         LOOKUP_ONLYCONVERTING.
2717 2021-06-01  Patrick Palka  <ppalka@redhat.com>
2719         PR c++/65816
2720         * init.c (expand_aggr_init_1): Check
2721         type_has_non_user_provided_default_constructor instead of
2722         type_has_user_provided_constructor.
2724 2021-06-01  Jason Merrill  <jason@redhat.com>
2726         PR c++/91859
2727         * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
2728         for destroying delete.
2729         * init.c (build_delete): Don't clobber before destroying delete.
2731 2021-06-01  Jason Merrill  <jason@redhat.com>
2733         PR c++/94492
2734         * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
2736 2021-05-31  Richard Biener  <rguenther@suse.de>
2738         PR c++/88601
2739         * cp-objcp-common.c (names_builtin_p): Handle
2740         RID_BUILTIN_SHUFFLEVECTOR.
2741         * cp-tree.h (build_x_shufflevector): Declare.
2742         * parser.c (cp_parser_postfix_expression): Handle
2743         RID_BUILTIN_SHUFFLEVECTOR.
2744         * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
2745         * typeck.c (build_x_shufflevector): Build either a lowered
2746         VEC_PERM_EXPR or an unlowered shufflevector via a temporary
2747         internal function IFN_SHUFFLEVECTOR.
2749 2021-05-28  Jason Merrill  <jason@redhat.com>
2751         * constexpr.c (build_data_member_initialization): Use tsi_range.
2752         (build_constexpr_constructor_member_initializers): Likewise.
2753         (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
2754         (potential_constant_expression_1): Likewise.
2755         * coroutines.cc (await_statement_expander): Likewise.
2756         (await_statement_walker): Likewise.
2757         * module.cc (trees_out::core_vals): Likewise.
2758         * pt.c (tsubst_expr): Likewise.
2759         * semantics.c (set_cleanup_locs): Likewise.
2761 2021-05-28  Jason Merrill  <jason@redhat.com>
2763         PR c++/100797
2764         PR c++/95719
2765         * call.c (build_over_call): Adjust base_binfo in
2766         resolves_to_fixed_type_p case.
2768 2021-05-28  Jakub Jelinek  <jakub@redhat.com>
2770         PR middle-end/99928
2771         * semantics.c (handle_omp_array_sections): Copy
2772         OMP_CLAUSE_MAP_IMPLICIT.
2773         (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
2774         marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT.  Add
2775         map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
2776         maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
2777         present too.  For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
2778         if present in map_head, map_field_head or map_firstprivate_head
2779         bitmaps.
2781 2021-05-28  Tobias Burnus  <tobias@codesourcery.com>
2783         * parser.c (cp_parser_omp_clause_affinity): New.
2784         (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
2785         cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
2786         clause.
2787         * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
2788         finish_omp_clauses): Likewise.
2790 2021-05-27  Matthias Kretz  <kretz@kde.org>
2792         PR c++/100716
2793         * error.c (dump_template_bindings): Include code to print
2794         "[with" and ']', conditional on whether anything is printed at
2795         all. This is tied to whether a semicolon is needed to separate
2796         multiple template parameters. If the template argument repeats
2797         the template parameter (T = T), then skip the parameter.
2798         (dump_substitution): Moved code to print "[with" and ']' to
2799         dump_template_bindings.
2800         (dump_function_decl): Partial revert of PR50828, which masked
2801         TFF_TEMPLATE_NAME for all of dump_function_decl. Now
2802         TFF_TEMPLATE_NAME is masked for the scope of the function and
2803         only carries through to dump_function_name.
2804         (dump_function_name): Avoid calling dump_template_parms if
2805         TFF_TEMPLATE_NAME is set.
2807 2021-05-27  Matthias Kretz  <kretz@kde.org>
2809         PR c++/100763
2810         * error.c: Call dump_scope when printing a typedef.
2812 2021-05-27  Patrick Palka  <ppalka@redhat.com>
2814         PR c++/99893
2815         * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
2817 2021-05-27  Jason Merrill  <jason@redhat.com>
2819         PR c++/86355
2820         * pt.c (use_pack_expansion_extra_args_p): Don't compare
2821         args from the same argument pack.
2823 2021-05-27  Patrick Palka  <ppalka@redhat.com>
2825         DR 1315
2826         PR c++/67593
2827         PR c++/96555
2828         * pt.c (process_partial_specialization): Don't error on a
2829         non-simple non-type template argument that involves template
2830         parameters.
2831         (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
2832         MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
2834 2021-05-26  Patrick Palka  <ppalka@redhat.com>
2836         PR c++/100502
2837         * typeck.c (finish_class_member_access_expr): Disable ahead
2838         of time access checking during the member lookup.
2840 2021-05-26  Patrick Palka  <ppalka@redhat.com>
2842         PR c++/100368
2843         * tree.c (build_target_expr_with_type): Don't call force_rvalue
2844         on CALL_EXPR initializer.  Simplify now that bot_manip is no
2845         longer a caller.
2846         (bot_manip): Use force_target_expr instead of
2847         build_target_expr_with_type.
2849 2021-05-26  Patrick Palka  <ppalka@redhat.com>
2851         PR c++/97420
2852         * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
2853         (fnptr_conv_p): Don't call non_reference.  Use INDIRECT_TYPE_P
2854         instead of TYPE_PTR_P.
2855         * pt.c (convert_nontype_argument_function): Look through
2856         implicit INDIRECT_REFs before calling strip_fnptr_conv.
2858 2021-05-25  Jakub Jelinek  <jakub@redhat.com>
2860         PR c++/100666
2861         * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
2862         and side-effects, temporarily disable -Wunused-result warning when
2863         building COMPOUND_EXPR.
2865 2021-05-21  Jakub Jelinek  <jakub@redhat.com>
2867         PR middle-end/99928
2868         * semantics.c (finish_omp_clauses): Move firstprivate clauses with
2869         OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't error
2870         if a decl is mentioned both in map clause and in such firstprivate
2871         clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
2873 2021-05-20  Jason Merrill  <jason@redhat.com>
2875         * call.c (reference_binding): Check for designator.
2876         (implicit_conversion_1, build_special_member_call): Likewise.
2877         * decl.c (reshape_init_r): Likewise.
2878         * pt.c (do_class_deduction): Likewise.
2879         * typeck2.c (digest_init_r): Likewise.
2881 2021-05-20  Jason Merrill  <jason@redhat.com>
2883         PR c++/100489
2884         * decl.c (reshape_init_class): Handle designator for
2885         member of anonymous aggregate here.
2886         * typeck2.c (process_init_constructor_record): Not here.
2888 2021-05-20  Jonathan Wakely  <jwakely@redhat.com>
2890         * call.c (maybe_warn_array_conv): Use new warning option.
2891         * decl.c (mark_inline_variable, grokdeclarator): Likewise.
2892         * error.c (maybe_warn_cpp0x): Likewise.
2893         * parser.c (cp_parser_primary_expression)
2894         (cp_parser_unqualified_id)
2895         (cp_parser_pseudo_destructor_name)
2896         (cp_parser_lambda_introducer)
2897         (cp_parser_lambda_declarator_opt)
2898         (cp_parser_selection_statement)
2899         (cp_parser_init_statement)
2900         (cp_parser_decomposition_declaration)
2901         (cp_parser_function_specifier_opt)
2902         (cp_parser_static_assert)
2903         (cp_parser_namespace_definition)
2904         (cp_parser_using_declaration)
2905         (cp_parser_asm_definition)
2906         (cp_parser_ctor_initializer_opt_and_function_body)
2907         (cp_parser_initializer_list)
2908         (cp_parser_type_parameter_key)
2909         (cp_parser_member_declaration)
2910         (cp_parser_try_block)
2911         (cp_parser_std_attribute_spec): Likewise.
2912         * pt.c (check_template_variable): Likewise.
2914 2021-05-20  Jason Merrill  <jason@redhat.com>
2916         PR c++/100634
2917         * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
2919 2021-05-20  Jason Merrill  <jason@redhat.com>
2921         PR c++/100659
2922         * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
2924 2021-05-19  Jason Merrill  <jason@redhat.com>
2926         PR c++/100367
2927         PR c++/96299
2928         * method.c (genericize_spaceship): Use fold_build2 for scalar
2929         operands.
2931 2021-05-19  Jason Merrill  <jason@redhat.com>
2933         * pt.c (build_deduction_guide): Treat the implicit deduction guide
2934         as a member of the class.
2936 2021-05-19  Marek Polacek  <polacek@redhat.com>
2938         PR c++/100596
2939         * cp-tree.h (any_non_type_attribute_p): Remove.
2940         * decl.c (grokdeclarator): Turn an error into a warning and only
2941         warn for standard attributes.
2942         * decl2.c (any_non_type_attribute_p): Remove.
2943         * parser.c (cp_parser_elaborated_type_specifier): Turn an error
2944         into a warning and only warn for standard attributes.
2945         (cp_parser_member_declaration): Likewise.
2947 2021-05-19  Martin Liska  <mliska@suse.cz>
2949         PR testsuite/100658
2950         * mangle.c (write_encoding): Fix typos.
2952 2021-05-19  Jakub Jelinek  <jakub@redhat.com>
2954         PR middle-end/99928
2955         * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
2956         master when combined with taskloop.
2957         (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
2958         parallel master when not combined with taskloop.
2960 2021-05-19  Jason Merrill  <jason@redhat.com>
2962         PR c++/100261
2963         * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
2965 2021-05-19  Jason Merrill  <jason@redhat.com>
2967         PR c++/100372
2968         * tree.c (strip_typedefs): Only look at the pattern of a
2969         TYPE_PACK_EXPANSION if it's a type.
2971 2021-05-18  Marek Polacek  <polacek@redhat.com>
2973         * class.c (classtype_has_non_deleted_copy_ctor): Remove.
2974         * constraint.cc (contains_wildcard_p): Likewise.
2975         (get_template_head_requirements): Likewise.
2976         (check_constrained_friend): Likewise.
2977         (subsumes_constraints): Likewise.
2978         * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
2979         (push_void_library_fn): Likewise.
2980         (get_pattern_parm): Likewise.
2981         (get_template_parms_at_level): Likewise.
2982         (lambda_return_type): Likewise.
2983         (get_template_head_requirements): Likewise.
2984         (check_constrained_friend): Likewise.
2985         (subsumes_constraints): Likewise.
2986         * decl.c (push_void_library_fn): Likewise.
2987         * lambda.c (lambda_return_type): Likewise.
2988         * pt.c (get_template_parms_at_level): Likewise.
2989         (get_pattern_parm): Likewise.
2991 2021-05-18  Jason Merrill  <jason@redhat.com>
2993         PR c++/100644
2994         * call.c (perfect_candidate_p): An implicitly deleted move
2995         is not perfect.
2997 2021-05-18  Andreas Krebbel  <krebbel@linux.ibm.com>
2999         PR c++/100281
3000         * cvt.c (cp_convert_to_pointer): Use the size of the target
3001         pointer type.
3002         * tree.c (cp_build_reference_type): Call
3003         cp_build_reference_type_for_mode with VOIDmode.
3004         (cp_build_reference_type_for_mode): Rename from
3005         cp_build_reference_type.  Add MODE argument and invoke
3006         build_reference_type_for_mode.
3007         (strip_typedefs): Use build_pointer_type_for_mode and
3008         cp_build_reference_type_for_mode for pointers and references.
3010 2021-05-17  Jonathan Wakely  <jwakely@redhat.com>
3012         PR c++/100635
3013         * call.c (convert_like_internal): Print different diagnostic if
3014         the lvalue reference is const.
3016 2021-05-14  Jason Merrill  <jason@redhat.com>
3018         PR c++/95870
3019         * pt.c (enclosing_instantiation_of): Just compare
3020         DECL_SOURCE_LOCATION.
3021         (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
3023 2021-05-14  Marek Polacek  <polacek@redhat.com>
3024             Jason Merrill  <jason@redhat.com>
3026         PR c++/99032
3027         * cp-tree.h (any_non_type_attribute_p): Declare.
3028         * decl.c (grokdeclarator): Diagnose when an attribute appertains to
3029         a friend declaration that is not a definition.
3030         * decl2.c (any_non_type_attribute_p): New.
3031         * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
3032         in the middle of decl-specifiers.
3033         (cp_parser_elaborated_type_specifier): Diagnose when an attribute
3034         appertains to a friend declaration that is not a definition.
3035         (cp_parser_member_declaration): Likewise.
3037 2021-05-12  Marek Polacek  <polacek@redhat.com>
3039         * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
3040         sentinel.
3042 2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>
3044         * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
3045         'close'.
3047 2021-05-11  Jason Merrill  <jason@redhat.com>
3049         PR c++/100517
3050         * typeck.c (build_reinterpret_cast_1): Check intype on
3051         cast to vector.
3053 2021-05-11  Patrick Palka  <ppalka@redhat.com>
3055         PR c++/51577
3056         * name-lookup.c (maybe_save_operator_binding): Unconditionally
3057         enable for all function templates, not just generic lambdas.
3058         Handle compound-assignment operator expressions.
3059         * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
3060         in the type-dependent case.
3061         (build_x_modify_expr): Likewise.  Move declaration of 'op' closer
3062         to its first use.
3064 2021-05-11  Patrick Palka  <ppalka@redhat.com>
3066         PR c++/100138
3067         * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
3068         (satisfy_atom): Set up iloc_sentinel before calling
3069         cxx_constant_value.
3070         * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
3071         expansion, carry over PACK_EXPANSION_LOCAL_P and
3072         PACK_EXPANSION_SIZEOF_P from the original pack expansion.
3074 2021-05-10  Richard Biener  <rguenther@suse.de>
3076         PR middle-end/100464
3077         PR c++/100468
3078         * call.c (set_up_extended_ref_temp): Mark the temporary
3079         addressable if the TARGET_EXPR was.
3081 2021-05-10  Martin Liska  <mliska@suse.cz>
3083         * decl.c (duplicate_decls): Use startswith
3084         function instead of strncmp.
3085         (cxx_builtin_function): Likewise.
3086         (omp_declare_variant_finalize_one): Likewise.
3087         (grokfndecl): Likewise.
3088         * error.c (dump_decl_name): Likewise.
3089         * mangle.c (find_decomp_unqualified_name): Likewise.
3090         (write_guarded_var_name): Likewise.
3091         (decl_tls_wrapper_p): Likewise.
3092         * parser.c (cp_parser_simple_type_specifier): Likewise.
3093         (cp_parser_tx_qualifier_opt): Likewise.
3094         * pt.c (template_parm_object_p): Likewise.
3095         (dguide_name_p): Likewise.
3097 2021-05-10  Martin Liska  <mliska@suse.cz>
3099         PR c++/99616
3100         * decl.c (grokdeclarator): Remove redundant NULL check.
3102 2021-05-07  Jason Merrill  <jason@redhat.com>
3104         * tree.c (rvalue): Assert expr is not a class lvalue.
3106 2021-05-07  Jason Merrill  <jason@redhat.com>
3108         * cp-tree.h (build_stub_object): Declare.
3109         * method.c (build_stub_object): No longer static.
3110         * call.c (can_convert): Use it.
3111         * tree.c (build_dummy_object): Adjust comment.
3112         * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
3113         TARGET_EXPR.
3115 2021-05-07  Jason Merrill  <jason@redhat.com>
3117         * coroutines.cc (build_co_await): Don't call 'rvalue'.
3118         (flatten_await_stmt): Simplify initialization.
3119         (morph_fn_to_coro): Change 'rvalue' to 'move'.  Simplify.
3121 2021-05-04  Tobias Burnus  <tobias@codesourcery.com>
3123         * semantics.c (finish_omp_reduction_clause): Accept float + complex
3124         for || and && reductions.
3126 2021-05-03  Patrick Palka  <ppalka@redhat.com>
3128         PR c++/100362
3129         * parser.c (cp_parser_class_head): Reinstate calls to pushclass
3130         and popclass when parsing the base-clause that were removed in
3131         r11-6815.
3133 2021-05-03  Patrick Palka  <ppalka@redhat.com>
3135         PR c++/68942
3136         PR c++/100344
3137         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
3138         only when the callee is a FUNCTION_DECL.
3140 2021-05-03  Marek Polacek  <polacek@redhat.com>
3142         PR c++/100055
3143         * decl.c (grokfndecl): Check current_template_parms.
3145 2021-05-03  Marek Polacek  <polacek@redhat.com>
3147         DR 1312
3148         * constexpr.c (cxx_eval_constant_expression): Don't check
3149         integer_zerop.
3151 2021-05-01  Jason Merrill  <jason@redhat.com>
3153         * cp-tree.h (class ovl_iterator): Allow copying.  Add op==.
3154         (class ovl_range, class lkp_range): New.
3155         * call.c (build_op_call_1, add_candidates): Use them.
3156         (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
3157         (has_trivial_copy_p): Likewise.
3158         * class.c (handle_using_decl, get_basefndecls): Likewise.
3159         (maybe_warn_about_overly_private_class): Likewise.
3160         (warn_hidden, add_implicitly_declared_members): Likewise.
3161         (check_methods, clone_constructors_and_destructors): Likewise.
3162         (type_has_user_nondefault_constructor): Likewise.
3164 2021-04-29  Jason Merrill  <jason@redhat.com>
3166         * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
3167         don't find a field.
3169 2021-04-29  Jason Merrill  <jason@redhat.com>
3171         PR c++/51344
3172         * decl2.c (grokfield): Call cplus_decl_attributes for friend.
3173         (save_template_attributes): Use chainon.
3174         * friend.c (do_friend): Remove attrlist parm.
3175         * cp-tree.h (do_friend): Adjust.
3176         * class.c (add_implicitly_declared_members): Adjust.
3177         * decl.c (grokdeclarator): Adjust.
3178         * pt.c (apply_late_template_attributes): Optimize.
3180 2021-04-29  Jason Merrill  <jason@redhat.com>
3182         PR c++/97974
3183         * class.c (finish_struct_anon_r): Drop complain parm.
3184         Remove non-field diagnostic.
3185         (finish_struct_anon): Adjust.
3186         * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
3188 2021-04-29  Jason Merrill  <jason@redhat.com>
3190         * cp-tree.h (cp_evaluated): Add reset parm to constructor.
3191         * parser.c (cp_parser_constant_expression): Change
3192         allow_non_constant_p to int.  Use cp_evaluated.
3193         (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
3194         * semantics.c (finish_id_expression_1): Don't mess with
3195         cp_unevaluated_operand here.
3197 2021-04-29  Jason Merrill  <jason@redhat.com>
3199         * cp-tree.h: Clarify comments.
3200         * pt.c (get_template_parm_object): Add assert.
3201         * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
3202         * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
3203         * typeck2.c (store_init_value): Likewise.
3205 2021-04-29  Patrick Palka  <ppalka@redhat.com>
3207         PR c++/68942
3208         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
3209         set tf_conv during the initial substitution into the function.
3211 2021-04-29  Jakub Jelinek  <jakub@redhat.com>
3213         PR c++/100319
3214         * semantics.c (finish_omp_clauses): Fix up check that variable
3215         mentioned in detach clause doesn't appear in data-sharing clauses.
3217 2021-04-28  Jakub Jelinek  <jakub@redhat.com>
3219         * module.cc: Remove #error that triggers if DEV-PHASE is empty.
3221 2021-04-27  Jason Merrill  <jason@redhat.com>
3223         PR c++/92145
3224         * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
3225         of operator=.
3227 2021-04-27  Patrick Palka  <ppalka@redhat.com>
3229         PR c++/88580
3230         * pt.c (tsubst_initializer_list): Correctly handle the case
3231         where an argument inside a base initializer pack expansion is
3232         itself a pack expansion.
3234 2021-04-26  Patrick Palka  <ppalka@redhat.com>
3236         PR c++/100209
3237         * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
3238         object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
3239         with a negative offset into one whose offset is nonnegative
3240         before calling cxx_fold_indirect_ref_1.
3242 2021-04-24  Patrick Palka  <ppalka@redhat.com>
3244         PR c++/89565
3245         PR c++/93383
3246         PR c++/95291
3247         PR c++/99200
3248         PR c++/99683
3249         * pt.c (do_class_deduction): Punt if the initializer is
3250         type-dependent.
3252 2021-04-24  Patrick Palka  <ppalka@redhat.com>
3254         PR c++/87709
3255         * parser.c (cp_parser_type_id_1): If we see a template
3256         placeholder, first try simulating an error before issuing
3257         a real error.
3259 2021-04-23  Patrick Palka  <ppalka@redhat.com>
3261         PR c++/98767
3262         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
3263         Adjust parameter list loop to iterate over 'types' instead of
3264         'args'.  Output the trailing '...' for a variadic function.
3265         Remove PARM_DECL support.
3266         (pp_cxx_requires_expr): Pretty print the parameter list directly
3267         instead of going through pp_cxx_parameter_declaration_clause.
3269 2021-04-23  Patrick Palka  <ppalka@redhat.com>
3271         DR 2374
3272         * decl.c (is_direct_enum_init): Check the implicit
3273         convertibility requirement added by CWG 2374.
3275 2021-04-23  Martin Liska  <mliska@suse.cz>
3277         * cp-tree.h (STATIC_ASSERT): Prefer static assert.
3278         * lex.c (init_operators): Remove run-time check.
3280 2021-04-22  Marek Polacek  <polacek@redhat.com>
3282         PR c++/100161
3283         * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
3284         op1 separately for value- or type-dependence.
3286 2021-04-21  Marek Polacek  <polacek@redhat.com>
3288         PR c++/96380
3289         * parser.c (cp_parser_enum_specifier): Don't allow defining
3290         types in enum-base.
3292 2021-04-21  Martin Liska  <mliska@suse.cz>
3294         Revert:
3295         2021-04-21  Martin Liska  <mliska@suse.cz>
3297         * error.c (dump_decl): Use flags in dump_generic_node call.
3299 2021-04-21  Martin Liska  <mliska@suse.cz>
3301         * error.c (dump_decl): Use flags in dump_generic_node call.
3303 2021-04-21  Martin Liska  <mliska@suse.cz>
3305         * error.c (dump_decl): Support anonymous labels.
3307 2021-04-20  Jason Merrill  <jason@redhat.com>
3309         PR c++/100109
3310         * pt.c (find_parameter_packs_r): Look into enum initializers.
3312 2021-04-19  Marek Polacek  <polacek@redhat.com>
3314         PR c++/97536
3315         * decl.c (grokvardecl): Given an error when a concept is not defined
3316         at namespace scope.
3318 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
3320         PR c++/100111
3321         * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
3322         for empty classes into *valp when types don't match even when *valp
3323         is NULL.
3325 2021-04-16  Marek Polacek  <polacek@redhat.com>
3327         PR c++/99803
3328         * decl.c (make_typename_type): Give an error and return when
3329         name is is_overloaded_fn.
3330         * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
3331         before calling make_typename_type.
3333 2021-04-16  Patrick Palka  <ppalka@redhat.com>
3335         PR c++/99700
3336         * constexpr.c (reduced_constant_expression_p): For array
3337         CONSTRUCTORs, use a dedicated loop that additionally verifies
3338         the CONSTRUCTOR spans the entire array.
3340 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
3342         PR c++/99850
3343         * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
3344         If lambda_p, return pce_ok instead of pce_maybe_postfix.
3346 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
3348         PR c++/99833
3349         * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
3350         binding, add to data.internal also all corresponding structured
3351         binding decls.
3353 2021-04-16  Jason Merrill  <jason@redhat.com>
3355         PR c++/100079
3356         * cp-tree.h (first_field): Declare.
3357         * mangle.c (range_expr_nelts): New.
3358         (write_expression): Improve class NTTP mangling.
3359         * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
3360         * tree.c (zero_init_expr_p): Improve class NTTP handling.
3361         * decl.c: Adjust comment.
3363 2021-04-15  Jason Merrill  <jason@redhat.com>
3365         PR c++/80456
3366         * call.c (build_new_method_call_1): Check again for side-effects
3367         with a volatile object.
3369 2021-04-15  Jason Merrill  <jason@redhat.com>
3371         PR c++/100101
3372         PR c++/99583
3373         * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
3374         TYPE_RAISES_EXCEPTIONS here.
3375         * tree.c (cp_walk_subtrees): Not here.
3377 2021-04-15  Jason Merrill  <jason@redhat.com>
3379         PR c++/100091
3380         PR c++/99478
3381         * parser.c (cp_parser_default_type_template_argument): Set
3382         parser->local_variables_forbidden_p.
3384 2021-04-15  Richard Sandiford  <richard.sandiford@arm.com>
3386         PR c++/98852
3387         * typeck.c (merge_type_attributes_from): New function.
3388         (cp_common_type): Use it for vector types.
3390 2021-04-14  Jason Merrill  <jason@redhat.com>
3392         PR c++/100078
3393         PR c++/93085
3394         * pt.c (uses_outer_template_parms): Also look at default
3395         template argument.
3397 2021-04-14  Jason Merrill  <jason@redhat.com>
3399         PR c++/93314
3400         * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
3401         for a non-static data member in a constant-expression.
3403 2021-04-14  Patrick Palka  <ppalka@redhat.com>
3405         PR c++/83476
3406         PR c++/99885
3407         * pt.c (deducible_expression): Look through implicit
3408         INDIRECT_REFs as well.
3410 2021-04-14  Jason Merrill  <jason@redhat.com>
3412         PR c++/99478
3413         * parser.c (cp_parser_lambda_expression): Reject lambda
3414         in template parameter type.
3416 2021-04-14  Jason Merrill  <jason@redhat.com>
3418         PR c++/90674
3419         * decl.c (duplicate_decls): Don't propagate
3420         DECL_INITIALIZED_IN_CLASS_P to a specialization.
3422 2021-04-14  Jason Merrill  <jason@redhat.com>
3424         PR c++/88742
3425         PR c++/49951
3426         PR c++/58123
3427         * semantics.c (set_cleanup_locs): New.
3428         (do_poplevel): Call it.
3429         * parser.c (cp_parser_compound_statement): Consume the }
3430         before finish_compound_stmt.
3432 2021-04-13  Jason Merrill  <jason@redhat.com>
3434         PR c++/100032
3435         * pt.c (get_underlying_template): Compare TYPE_QUALS.
3437 2021-04-13  Jason Merrill  <jason@redhat.com>
3439         PR c++/100054
3440         PR c++/90479
3441         * init.c (get_nsdmi): Do more context adjustment for local classes.
3443 2021-04-13  Patrick Palka  <ppalka@redhat.com>
3445         PR c++/99008
3446         * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
3447         rather than issuing a pedwarn.
3448         * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
3449         for consistent diagnostics.
3451 2021-04-13  Jason Merrill  <jason@redhat.com>
3453         PR c++/91933
3454         * class.c (build_base_path): Shortcut simple non-pointer case.
3456 2021-04-13  Eric Botcazou  <ebotcazou@adacore.com>
3458         * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
3459         of the linemap.
3460         (module_state::write_location): Likewise.
3462 2021-04-13  Patrick Palka  <ppalka@redhat.com>
3464         PR c++/97134
3465         * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
3466         when checking if the initializer is an equivalent class
3467         placeholder template parameter.
3469 2021-04-13  Patrick Palka  <ppalka@redhat.com>
3471         PR c++/99961
3472         PR c++/99994
3473         * constraint.cc (satisfy_normalized_constraints): Set
3474         cp_unevaluated.
3475         * parser.c (cp_parser_concept_definition): Likewise.
3476         (cp_parser_requires_clause_opt): Likewise.
3478 2021-04-12  Jason Merrill  <jason@redhat.com>
3480         PR c++/93085
3481         * pt.c (uses_outer_template_parms): Handle non-type and template
3482         template parameters specifically.
3484 2021-04-11  Jason Merrill  <jason@redhat.com>
3486         PR c++/97974
3487         * decl.c (fixup_anonymous_aggr): Prune all functions from
3488         CLASSTYPE_MEMBER_VEC.
3490 2021-04-10  Jason Merrill  <jason@redhat.com>
3492         PR c++/98800
3493         PR c++/97399
3494         * parser.c (cp_parser_direct_declarator): Don't
3495         inject_this_parameter if static_p.
3496         (cp_parser_omp_var_list_no_open): Parse 'this' even if
3497         current_class_ptr isn't set for a better diagnostic.
3499 2021-04-10  Jason Merrill  <jason@redhat.com>
3501         PR c++/99180
3502         PR c++/93295
3503         PR c++/93867
3504         PR c++/99118
3505         PR c++/96873
3506         * pt.c (alias_ctad_tweaks): Handle failure better.
3508 2021-04-10  Jason Merrill  <jason@redhat.com>
3510         PR c++/100006
3511         * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
3513 2021-04-09  Patrick Palka  <ppalka@redhat.com>
3515         * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
3516         (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
3517         (LAMBDA_EXPR_REGEN_INFO): ... this.
3518         (tree_lambda_expr::regenerated_from)
3519         (tree_lambda_expr::regenerating_targs): Replace these with ...
3520         (tree_lambda_expr::regen_info): ... this.
3521         * constraint.cc (satisfy_declaration_constraints): Adjust
3522         accordingly.
3523         * lambda.c (build_lambda_expr): Likewise.
3524         * pt.c (regenerated_lambda_fn_p): Likewise.
3525         (most_general_lambda): Likewise.
3526         (tsubst_lambda_expr): Likewise.
3528 2021-04-09  Marek Polacek  <polacek@redhat.com>
3530         PR c++/99806
3531         * parser.c (cp_parser_member_declaration): Call
3532         cp_parser_save_default_args even for function templates.  Use
3533         STRIP_TEMPLATE on the declaration we're passing.
3535 2021-04-08  Patrick Palka  <ppalka@redhat.com>
3537         PR c++/99874
3538         * constraint.cc (get_normalized_constraints_from_decl): Handle
3539         regenerated lambdas.
3540         (satisfy_declaration_constraints): Likewise.  Check for
3541         dependent args later.
3542         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
3543         (LAMBDA_EXPR_REGENERATED_FROM): ... this.
3544         (LAMBDA_EXPR_REGENERATING_TARGS): New.
3545         (tree_lambda_expr::regenerated_from): New data member.
3546         (tree_lambda_expr::regenerating_targs): New data member.
3547         (add_to_template_args): Declare.
3548         (regenerated_lambda_fn_p): Likewise.
3549         (most_general_lambda): Likewise.
3550         * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
3551         and LAMBDA_EXPR_REGENERATING_TARGS.
3552         * pt.c (add_to_template_args): No longer static.
3553         (tsubst_function_decl): Unconditionally propagate constraints on
3554         the substituted function decl.
3555         (instantiated_lambda_fn_p): Rename to ...
3556         (regenerated_lambda_fn_p): ... this.  Check
3557         LAMBDA_EXPR_REGENERATED_FROM instead of
3558         LAMBDA_EXPR_INSTANTIATED.
3559         (most_general_lambda): Define.
3560         (enclosing_instantiation_of): Adjust after renaming
3561         instantiated_lambda_fn_p.
3562         (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED.  Set
3563         LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
3564         Don't substitute or set constraints on the regenerated lambda.
3566 2021-04-08  Patrick Palka  <ppalka@redhat.com>
3568         PR c++/97679
3569         * pt.c (build_deduction_guide): Document OUTER_ARGS.  Substitute
3570         them into the propagated constraints.
3572 2021-04-08  Jason Merrill  <jason@redhat.com>
3574         PR c++/91849
3575         * call.c (convert_like_internal): Improve reference diagnostic.
3577 2021-04-08  Jakub Jelinek  <jakub@redhat.com>
3579         PR c++/99859
3580         * constexpr.c (addr_of_non_const_var): New function.
3581         (cxx_bind_parameters_in_call): Set *non_constant_args to true
3582         even if cp_walk_tree on arg with addr_of_non_const_var callback
3583         returns true.
3585 2021-04-08  Jason Merrill  <jason@redhat.com>
3587         PR c++/94529
3588         * pt.c (determine_specialization): Improve diagnostic.
3590 2021-04-08  Marek Polacek  <polacek@redhat.com>
3592         PR c++/99844
3593         * decl.c (build_explicit_specifier): Call
3594         check_for_bare_parameter_packs.
3595         * except.c (build_noexcept_spec): Likewise.
3597 2021-04-07  Jason Merrill  <jason@redhat.com>
3599         PR c++/41723
3600         * parser.c (cp_parser_class_name): Check dependent_scope_p.
3602 2021-04-07  Jason Merrill  <jason@redhat.com>
3604         PR c++/52625
3605         * pt.c (maybe_process_partial_specialization): Check
3606         DECL_SELF_REFERENCE_P.
3608 2021-04-07  Jason Merrill  <jason@redhat.com>
3610         PR c++/92918
3611         * name-lookup.c (push_class_level_binding_1): Do overload a new
3612         function with a previous using-declaration.
3614 2021-04-06  Jason Merrill  <jason@redhat.com>
3616         PR c++/96673
3617         * init.c (get_nsdmi): Don't defer access checking.
3619 2021-04-06  Jason Merrill  <jason@redhat.com>
3621         PR c++/99901
3622         * decl.c (cp_finish_decl): mark_needed an implicitly inline
3623         static data member with an out-of-class redeclaration.
3625 2021-04-06  Jason Merrill  <jason@redhat.com>
3627         PR c++/91241
3628         * mangle.c (write_compact_number): Add sanity check.
3629         (write_local_name): Use list_length for parm number.
3631 2021-04-06  Patrick Palka  <ppalka@redhat.com>
3633         PR c++/99899
3634         * pt.c (do_auto_deduction): Don't exit early when deducing the
3635         array type of a structured binding.  Also handle adc_decomp_type
3636         during constraint checking.
3638 2021-04-05  Jason Merrill  <jason@redhat.com>
3640         PR c++/96311
3641         * typeck.c (check_return_expr): Call mark_exp_read in dependent
3642         case.
3644 2021-04-05  Jason Merrill  <jason@redhat.com>
3646         PR c++/98440
3647         * typeck.c (build_reinterpret_cast_1): Don't perform
3648         temporary materialization.
3650 2021-04-05  Jason Merrill  <jason@redhat.com>
3652         PR c++/95317
3653         * pt.c (lookup_template_class_1): Do tsubst_enum when
3654         tsubsting a generic lambda.
3656 2021-04-05  Jason Merrill  <jason@redhat.com>
3658         PR c++/95870
3659         * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
3660         there is no enclosing non-lambda function.
3662 2021-04-05  Nathan Sidwell  <nathan@acm.org>
3664         PR c++/99380
3665         * module.cc (name_pending_imports): Drop 'atend' parm.  Don't
3666         query export when not needed.
3667         (preprocess_module, preprocessed_module): Adjust.
3669 2021-04-05  Jason Merrill  <jason@redhat.com>
3671         PR c++/99066
3672         * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
3674 2021-04-05  Jason Merrill  <jason@redhat.com>
3676         PR c++/99201
3677         * pt.c (class el_data): Add visited field.
3678         (extract_local_specs): Pass it to cp_walk_tree.
3679         (extract_locals_r): Walk into the body of a lambda.
3681 2021-04-05  Jason Merrill  <jason@redhat.com>
3683         * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
3684         template result.
3686 2021-04-04  Jason Merrill  <jason@redhat.com>
3688         PR c++/99643
3689         * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
3691 2021-04-03  Marek Polacek  <polacek@redhat.com>
3693         PR c++/91416
3694         * parser.c: Create a GC root for attributes in a decl specifier.
3695         (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
3697 2021-04-03  Jason Merrill  <jason@redhat.com>
3699         PR c++/91217
3700         * pt.c (tsubst_lambda_expr): Skip the body block from
3701         DECL_SAVED_TREE.
3703 2021-04-03  Jason Merrill  <jason@redhat.com>
3705         PR c++/90664
3706         * cvt.c (can_convert_qual): Check fnptr_conv_p.
3708 2021-04-03  Jason Merrill  <jason@redhat.com>
3710         PR c++/97900
3711         * pt.c (regenerate_decl_from_template): tsubst_decl
3712         the parms.
3714 2021-04-02  Patrick Palka  <ppalka@redhat.com>
3716         PR c++/99869
3717         * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
3718         to do_auto_deduction.
3720 2021-04-02  Patrick Palka  <ppalka@redhat.com>
3722         PR c++/99586
3723         * semantics.c (finish_compound_literal): Check
3724         template_placeholder_p instead of type_uses_auto.
3726 2021-04-02  Jason Merrill  <jason@redhat.com>
3728         PR c++/97938
3729         * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
3730         * lambda.c (add_capture): Set it.
3731         * pt.c (tsubst_pack_expansion): Handle it.
3733 2021-04-02  Nathan Sidwell  <nathan@acm.org>
3735         * cp-tree.h (lang_decl_base): Correct module flag comment.
3736         * module.cc (trees_in::assert_definition): Break out
3737         not_tmpl var.
3738         (trees_out::lang_decl_bools): Do not write purview for header units.
3740 2021-04-01  Marek Polacek  <polacek@redhat.com>
3742         PR c++/99831
3743         * method.c (defaulted_late_check): ++ and -- function_depth around
3744         the call to synthesize_method.
3745         * pt.c: Remove the saved_trees global.
3747 2021-04-01  Jason Merrill  <jason@redhat.com>
3749         PR c++/99583
3750         PR c++/99584
3751         * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
3752         TYPE_RAISES_EXCEPTIONS.
3754 2021-04-01  Iain Sandoe  <iain@sandoe.co.uk>
3756         * mapper-client.cc (INCLUDE_MAP): New; require map to be
3757         included from system.h.
3758         * mapper-resolver.cc (INCLUDE_MAP): Likewise.
3760 2021-04-01  Jason Merrill  <jason@redhat.com>
3762         PR c++/98481
3763         * mangle.c (write_expression): Adjust.
3764         * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
3765         (mark_abi_tags_r): Likewise.
3767 2021-04-01  Nathan Sidwell  <nathan@acm.org>
3769         PR c++/99283
3770         * module.cc (trees_out::decl_node): Adjust importedness reference
3771         assert.
3772         (module_state::intercluster_seed): New.  Seed both imports and
3773         inter-cluster references.  Broken out of ...
3774         (module_state::write_cluster): ... here.  Call it.
3776 2021-03-31  Jason Merrill  <jason@redhat.com>
3778         PR c++/99445
3779         * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
3781 2021-03-31  Patrick Palka  <ppalka@redhat.com>
3783         PR c++/88115
3784         * mangle.c (write_expression): Adjust the mangling of
3785         __alignof__.
3787 2021-03-31  Patrick Palka  <ppalka@redhat.com>
3789         PR c++/99815
3790         * pt.c (placeholder_type_constraint_dependent_p): Expand
3791         argument packs to separate the first non-pack argument
3792         from the rest.
3794 2021-03-30  Nathan Sidwell  <nathan@acm.org>
3796         PR c++/99283
3797         * module.cc (dumper::operator): Make less brittle.
3798         (trees_out::core_bools): VAR_DECLs always have a context.
3799         (trees_out::key_mergeable): Use same_type_p for asserting.
3800         (trees_in::read_var_def): Propagate
3801         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3803 2021-03-30  Jakub Jelinek  <jakub@redhat.com>
3805         PR c++/99790
3806         * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
3808 2021-03-26  Marek Polacek  <polacek@redhat.com>
3810         PR c++/98352
3811         * method.c (implicitly_declare_fn): Pass &raises to
3812         synthesized_method_walk.
3814 2021-03-26  Nathan Sidwell  <nathan@acm.org>
3816         PR c++/99283
3817         * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
3818         (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
3819         * decl.c (duplicate_decls): Remove template_decl module flag
3820         propagation.
3821         * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
3822         (dumper::impl::nested_name): Adjust for template-decl module flag
3823         change.
3824         (trees_in::assert_definition): Likewise.
3825         (trees_in::install_entity): Likewise.
3826         (trees_out::decl_value): Likewise.  Remove alias template
3827         separation of template and type_decl.
3828         (trees_in::decl_value): Likewise.
3829         (trees_out::key_mergeable): Likewise,
3830         (trees_in::key_mergeable): Likewise.
3831         (trees_out::decl_node): Adjust for template-decl module flag
3832         change.
3833         (depset::hash::make_dependency): Likewise.
3834         (get_originating_module, module_may_redeclare): Likewise.
3835         (set_instantiating_module, set_defining_module): Likewise.
3836         * name-lookup.c (name_lookup::search_adl): Likewise.
3837         (do_pushdecl): Likewise.
3838         * pt.c (build_template_decl): Likewise.
3839         (lookup_template_class_1): Remove special alias_template handling
3840         of DECL_TI_TEMPLATE.
3841         (tsubst_template_decl): Likewise.
3843 2021-03-26  Jakub Jelinek  <jakub@redhat.com>
3845         PR c++/99705
3846         * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
3847         in DECL_EXPR or in BIND_EXPR_VARS.
3849 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
3851         PR c++/99672
3852         * parser.c (cp_parser_postfix_expression): For calls, create
3853         combined_loc and temporarily set input_location to it before
3854         calling finish_call_expr.
3856 2021-03-25  Marek Polacek  <polacek@redhat.com>
3858         PR c++/94751
3859         * call.c (build_over_call): Maybe call mark_used in case
3860         deduce_inheriting_ctor fails and return error_mark_node.
3861         * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
3862         * method.c (deduce_inheriting_ctor): Return bool if the deduction
3863         fails.
3864         (implicitly_declare_fn): If raises is error_mark_node, call
3865         synthesized_method_walk with diag being true.
3867 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
3869         PR c++/99745
3870         * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
3871         packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
3873 2021-03-25  Marek Polacek  <polacek@redhat.com>
3875         PR c++/99331
3876         * call.c (build_converted_constant_expr_internal): Don't emit
3877         -Wconversion warnings.
3879 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
3881         PR c++/99565
3882         * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
3883         to operand_equal_p.
3884         * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
3885         or COMPOUND_EXPR.
3887 2021-03-23  Nathan Sidwell  <nathan@acm.org>
3889         PR c++/99283
3890         * name-lookup.c (check_module_override): Set global or partition
3891         DUP on the binding vector.
3893 2021-03-23  Marek Polacek  <polacek@redhat.com>
3895         PR c++/99318
3896         * decl2.c (cp_warn_deprecated_use_scopes): Only call
3897         cp_warn_deprecated_use when decl is a namespace, class, or enum.
3899 2021-03-23  Nathan Sidwell  <nathan@acm.org>
3901         PR c++/99239
3902         * decl.c (duplicate_decls): Remove assert about maybe-imported
3903         artificial decls.
3905 2021-03-23  Jakub Jelinek  <jakub@redhat.com>
3907         PR c++/99650
3908         * decl.c (cp_finish_decomp): Diagnose void initializers when
3909         using tuple_element and get.
3911 2021-03-22  Nathan Sidwell  <nathan@acm.org>
3913         PR c++/99480
3914         * module.cc (depset::hash::make_dependency): Propagate flags for
3915         partial specialization.
3916         (module_may_redeclare): Handle partial specialization.
3918 2021-03-22  Nathan Sidwell  <nathan@acm.org>
3920         PR c++/99425
3921         * cp-tree.h (map_context_from, map_context_to): Delete.
3922         (add_mergeable_specialization): Add is_alias parm.
3923         * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
3924         * module.cc (map_context_from, map_context_to): Delete.
3925         (trees_in::decl_value): Add specializations later, adjust call.
3926         Drop useless alias lookup. Set duplicate fn parm context.
3927         (check_mergeable_decl): Drop context mapping.
3928         (trees_in::is_matching_decl): Likewise.
3929         (trees_in::read_function_def): Drop parameter context adjustment
3930         here.
3932 2021-03-22  Martin Liska  <mliska@suse.cz>
3934         PR c++/99687
3935         * module.cc (fini_modules): Call vec_free instead of delete.
3937 2021-03-20  Jakub Jelinek  <jakub@redhat.com>
3939         PR debug/99230
3940         * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
3941         special code, instead call c_genericize_control_stmt.
3943 2021-03-19  Jakub Jelinek  <jakub@redhat.com>
3945         PR c++/99456
3946         * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
3947         INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
3948         don't diagnose it, set *non_constant_p nor return t.
3950 2021-03-19  Marek Polacek  <polacek@redhat.com>
3952         PR c++/99500
3953         * parser.c (cp_parser_requirement_parameter_list): Handle
3954         error_mark_node.
3956 2021-03-18  Marek Polacek  <polacek@redhat.com>
3958         * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
3960 2021-03-18  Marek Polacek  <polacek@redhat.com>
3962         * pt.c (tsubst_copy_and_build): Add assert.
3964 2021-03-18  Iain Sandoe  <iain@sandoe.co.uk>
3966         PR objc++/49070
3967         * parser.c (cp_debug_parser): Add Objective-C++ message
3968         state flag.
3969         (cp_parser_nested_name_specifier_opt): Allow colon to
3970         terminate an assignment-expression when parsing Objective-
3971         C++ messages.
3972         (cp_parser_objc_message_expression): Set and clear message
3973         parsing state on entry and exit.
3974         * parser.h (struct cp_parser): Add a context flag for
3975         Objective-C++ message state.
3977 2021-03-18  Martin Liska  <mliska@suse.cz>
3979         PR c++/99617
3980         * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
3981         to NULL.
3983 2021-03-17  Marek Polacek  <polacek@redhat.com>
3985         PR c++/97973
3986         * call.c (conv_unsafe_in_template_p): New.
3987         (convert_like): Use it.
3989 2021-03-17  Anthony Sharp  <anthonysharp15@gmail.com>
3990             Jason Merrill  <jason@redhat.com>
3992         * semantics.c (get_class_access_diagnostic_decl): New
3993         function that examines special cases when a parent
3994         class causes a private access failure.
3995         (enforce_access): Slightly modified to call function
3996         above.
3998 2021-03-16  Jason Merrill  <jason@redhat.com>
4000         * tree.c (cp_tree_equal): Use real_identical.
4002 2021-03-16  Jakub Jelinek  <jakub@redhat.com>
4004         PR c++/99613
4005         * decl.c (expand_static_init): For thread guards, call __cxa_atexit
4006         before calling __cxa_guard_release rather than after it.  Formatting
4007         fixes.
4009 2021-03-16  Martin Liska  <mliska@suse.cz>
4010             Jason Merrill  <jason@redhat.com>
4012         PR c++/99108
4013         * call.c (get_function_version_dispatcher): Handle
4014         DECL_LOCAL_DECL_P.
4015         * decl.c (maybe_version_functions): Likewise.
4016         (maybe_mark_function_versioned): New.
4017         * name-lookup.c (push_local_extern_decl_alias): No longer static.
4018         * name-lookup.h (push_local_extern_decl_alias): Adjust.
4020 2021-03-16  Nathan Sidwell  <nathan@acm.org>
4022         PR c++/99496
4023         * module.cc (trees_out::decl_value): Adjust typedef streaming,
4024         indicate whether it is a dependent alias.
4025         (trees_in::decl_value): Likewise.  Set as dependent alias, if it
4026         is one.
4028 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
4030         PR c++/99047
4031         * coroutines.cc (expand_one_await_expression): If the
4032         await_ready() expression is not a boolean then convert it
4033         as required.
4035 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
4037         PR c++/98704
4038         * coroutines.cc (build_actor_fn): Make destroy index 1
4039         correspond to the abnormal unhandled_exception() exit.
4040         Substitute the proxy for the resume index.
4041         (coro_rewrite_function_body): Arrange to reset the resume
4042         index and make done = true for a rethrown exception from
4043         unhandled_exception ().
4044         (morph_fn_to_coro): Adjust calls to build_actor_fn and
4045         coro_rewrite_function_body.
4047 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
4049         PR c++/98480
4050         * coroutines.cc (replace_continue): Rewrite continue into
4051         'goto label'.
4052         (await_statement_walker): Handle await expressions in the
4053         initializer, condition and iteration expressions of for
4054         loops.
4056 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
4058         PR c++/96749
4059         * coroutines.cc (flatten_await_stmt): Allow for the case
4060         where a target expression variable only has uses in the
4061         second part of a compound expression.
4062         (maybe_promote_temps): Avoid emiting empty statements.
4064 2021-03-15  Tobias Burnus  <tobias@codesourcery.com>
4066         PR c++/99509
4067         * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
4068         ensure that the varpool node is marked as offloadable.
4070 2021-03-12  Nathan Sidwell  <nathan@acm.org>
4072         PR c++/99238
4073         * module.cc (depset::hash::add_binding_entity): Assert not
4074         visited.
4075         (depset::add::add_specializations): Likewise.
4076         * name-lookup.c (name_lookup::dedup): New.
4077         (name_lookup::~name_lookup): Assert not deduping.
4078         (name_lookup::restore_state): Likewise.
4079         (name_lookup::add_overload): Replace outlined code with dedup
4080         call.
4081         (name_lookup::add_value): Likewise.
4082         (name_lookup::search_namespace_only): Likewise.
4083         (name_lookup::adl_namespace_fns): Likewise.
4084         (name_lookup::adl_class_fns): Likewise.
4085         (name_lookup::search_adl): Likewise.  Add clearing dedup call.
4086         (name_lookup::search_qualified): Likewise.
4087         (name_lookup::search_unqualified): Likewise.
4089 2021-03-12  Jakub Jelinek  <jakub@redhat.com>
4091         PR c++/99507
4092         * call.c (build_over_call): For immediate evaluation of functions
4093         that return references, undo convert_from_reference effects before
4094         calling cxx_constant_value and call convert_from_reference
4095         afterwards.
4097 2021-03-11  Nathan Sidwell  <nathan@acm.org>
4099         PR c++/99248
4100         * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
4101         when there's a binding vector.
4102         * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
4104 2021-03-11  Nathan Sidwell  <nathan@acm.org>
4106         PR c++/99528
4107         * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
4108         MK_decl_tmpl_spec.
4109         (trees_in::decl_value): Adjust add_mergeable_specialization call.
4110         (trees_out::get_merge_kind): Adjust detecting a partial template
4111         instantiation.
4112         (trees_out::key_mergeable): Adjust handling same.
4113         (trees_in::key_mergeabvle): Likewise.
4115 2021-03-10  Nathan Sidwell  <nathan@acm.org>
4117         PR c++/99423
4118         * module.cc (post_load_processing): Assert not gcable.
4119         (laxy_load_pendings): Extend no-gc region around
4120         post_load_processing.
4122 2021-03-10  Nathan Sidwell  <nathan@acm.org>
4124         PR c++/99508
4125         * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
4126         assembler name to the ns alias.
4128 2021-03-09  Jakub Jelinek  <jakub@redhat.com>
4130         PR c++/99459
4131         * coroutines.cc (build_co_await): Look through NOP_EXPRs in
4132         build_special_member_call return value to find the CALL_EXPR.
4133         Simplify.
4135 2021-03-09  Nathan Sidwell  <nathan@acm.org>
4137         PR c++/99472
4138         * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
4139         that C++20 does not yet imply modules.
4141 2021-03-08  Nathan Sidwell  <nathan@acm.org>
4143         PR c++/99436
4144         * name-lookup.c (get_cxx_dialect_name): Add cxx23.
4146 2021-03-08  Nathan Sidwell  <nathan@acm.org>
4148         * lex.c (module_token_filter::resume): Ignore module-decls inside
4149         header-unit.
4150         * parser.c (cp_parser_module_declaration): Reject in header-unit.
4152 2021-03-08  Nathan Sidwell  <nathan@acm.org>
4154         PR c++/99285
4155         * cp-tree.h (match_mergeable_specialization)
4156         (add_mergeable_specialization): Adjust parms.
4157         * module.cc (trees_in::decl_value): Adjust
4158         add_mergeable_specialization calls.
4159         (trees_out::key_mergeable): Adjust match_mergeable_specialization
4160         calls.
4161         (specialization_add): Likewise.
4162         * pt.c (match_mergeable_specialization): Do not insert.
4163         (add_mergeable_specialization): Add to hash table here.
4165 2021-03-06  Patrick Palka  <ppalka@redhat.com>
4166             Jakub Jelinek  <jakub@redhat.com>
4168         PR c++/99287
4169         * constexpr.c (cxx_eval_increment_expression): Pass lval when
4170         evaluating the MODIFY_EXPR, and update 'mod' with the result of
4171         this evaluation.  Check *non_constant_p afterwards.  For prefix
4172         ops, just return 'mod'.
4174 2021-03-06  Patrick Palka  <ppalka@redhat.com>
4175             Jakub Jelinek  <jakub@redhat.com>
4177         PR c++/96330
4178         * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
4179         variable 'fn' to 'tmpl'.  Handle a variable template-id by
4180         calling lookup_template_variable.
4182 2021-03-06  Patrick Palka  <ppalka@redhat.com>
4184         PR c++/99365
4185         * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
4186         outer_targs to do_auto_deduction.
4187         (placeholder_type_constraint_dependent_p): Define.
4188         (do_auto_deduction): When processing_template_decl != 0
4189         and context is adc_unify and we have constraints, pretend the
4190         constraints are satisfied instead of punting.  Otherwise don't
4191         punt unless placeholder_type_constraint_dependent_p holds.
4192         Add some clarifying sanity checks.  Add a hack to add missing
4193         outermost template levels to outer_args before checking
4194         satisfaction.  Don't substitute outer_targs into type if it's
4195         already been done.
4197 2021-03-05  Marek Polacek  <polacek@redhat.com>
4199         PR c++/99374
4200         * call.c (standard_conversion): When converting pointers to
4201         member, don't return NULL when the bases are equivalent but
4202         incomplete.
4204 2021-03-05  Marek Polacek  <polacek@redhat.com>
4206         PR c++/99120
4207         * name-lookup.c (check_local_shadow): Check if the type of decl
4208         is non-null before checking TYPE_PTR*.
4210 2021-03-05  Nathan Sidwell  <nathan@acm.org>
4212         PR c++/99245
4213         * module.cc (module_state::write_cluster): Relax binding assert.
4215 2021-03-05  Nathan Sidwell  <nathan@acm.org>
4217         PR c++/99377
4218         * pt.c (instantiate_decl): Call set_instantiating_module.
4220 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
4222         PR c++/98118
4223         * coroutines.cc (build_co_await): Use type_build_ctor_call()
4224         to determine cases when a CTOR needs to be built.
4225         (flatten_await_stmt): Likewise.
4226         (morph_fn_to_coro): Likewise.
4228 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
4230         PR c++/95616
4231         * coroutines.cc (coro_diagnose_throwing_fn): New helper.
4232         (coro_diagnose_throwing_final_aw_expr): New helper.
4233         (build_co_await): Diagnose throwing final await expression
4234         components.
4235         (build_init_or_final_await): Diagnose a throwing promise
4236         final_suspend() call.
4238 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
4240         PR c++/95615
4241         * coroutines.cc (struct param_info): Track parameter copies that need
4242         a DTOR.
4243         (coro_get_frame_dtor): New helper function factored from build_actor().
4244         (build_actor_fn): Use coro_get_frame_dtor().
4245         (morph_fn_to_coro): Track parameters that need DTORs on exception,
4246         likewise the frame promise and the return object.  On exception, run the
4247         DTORs for these, destroy the frame and then rethrow the exception.
4249 2021-03-05  Nathan Sidwell  <nathan@acm.org>
4251         PR c++/99389
4252         * pt.c (instantiate_class_template_1): Set instantiating module
4253         here.
4255 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
4257         PR c/99137
4258         * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
4260 2021-03-04  Jakub Jelinek  <jakub@redhat.com>
4262         PR c++/88146
4263         PR c++/99362
4264         * cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
4265         comment.
4267 2021-03-04  Nathan Sidwell  <nathan@acm.org>
4269         PR c++/99170
4270         * module.cc (class uintset): Delete.
4271         (typedef attached_map_t): A hash map.
4272         (attached_table): Use attached_map_t.  Adjust uses ...
4273         (trees_out::decl_value, trees_in::decl_value): ... here ...
4274         (trees_out::key_mergeable): ... here ...
4275         (trees_in::key_mergeable): ... here ...
4276         (maybe_attach_decl): ... here ...
4277         (direct_import): ... and here.
4279 2021-03-04  Nathan Sidwell  <nathan@acm.org>
4281         PR c++/99170
4282         * cp-tree.h
4283         * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
4284         rename.
4285         * module.cc (class pending_key): New.
4286         (default_hash_traits<pending_key>): New specialization.
4287         (pending_map_t): New typedef.
4288         (pending_table): Replace old table.
4289         (trees_out::lang_decl_bools): Adjust.
4290         (trees_in::lang_decl_bools): Adjust.
4291         (trees_in::install_entity): Drop pending member and specialization
4292         handling.
4293         (find_pending_key): New.
4294         (depset::hash::fiund_dependencies): Use it.
4295         (pendset_lazy_load): Delete.
4296         (module_state::write_cluster): Don't count pendings here.  Bye
4297         Duff's device-like thing.
4298         (module_state::write_pendings): Reimplement.
4299         (module_state::read_pendings): Reimplement.
4300         (lazy_specializations_p): Delete.
4301         (module_state::write): Adjust write_pendings call.
4302         (lazy_load_pendings): New.
4303         (lazy_load_specializations): Delete.
4304         (lazy_load_members): Delete.
4305         (init_modules): Adjust.
4306         * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
4307         not lazy_load_members.
4308         (note_pending_specializations): Delete.
4309         (load_pending_specializations): Delete.
4310         * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
4311         (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
4312         (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
4313         (note_pending_specializations): Delete.
4314         (load_pending_specializations): Delete.
4315         * pt.c (lookup_template_class_1): Call lazy_load_pendings not
4316         lazy_load_specializations.
4317         (instantiate_template_class_1): Likewise.
4318         (instantiate_decl): Call lazy_load_pendings.
4319         * typeck.c (complete_type): Likewise.
4321 2021-03-03  Nathan Sidwell  <nathan@acm.org>
4323         PR c++/99170
4324         * module.cc (post_load_decls): New.
4325         (lazy_snum, recursive_lazy): Move earlier.
4326         (module_state::read_cluster): Push cloning onto post_load_decls.
4327         (post_load_processing): New.  Do the cloning here.
4328         (module_state::read_inits): Call post_load_processing.
4329         (module_state::read_language): Likewise.
4330         (lazy_load_binding, lazy_load_specializations): Likewise
4331         (lazy_load_members): Likewise
4333 2021-03-03  Nathan Sidwell  <nathan@acm.org>
4335         PR c++/99170
4336         * module.cc (trees_out::decl_value): Stream specialization keys
4337         after decl.
4338         (trees_in::decl_value): Stream them back and insert after
4339         completing the decl.
4340         (trees_out::key_mergeable): Drop some streaming here ...
4341         (trees_in::key_mergeable): ... and here.  Don't insert into
4342         specialization tables.
4344 2021-03-03  Patrick Palka  <ppalka@redhat.com>
4346         * constraint.cc (struct sat_info): Document the different
4347         meanings of noisy() and diagnose_unsatisfaction_p() during
4348         satisfaction and requires-expression evaluation.
4349         (tsubst_valid_expression_requirement): Take a sat_info instead
4350         of a subst_info.  Perform the substitution quietly first.  Fold
4351         in error-replaying code from diagnose_valid_expression.
4352         (tsubst_simple_requirement): Take a sat_info instead of a
4353         subst_info.
4354         (tsubst_type_requirement_1): New.  Fold in error-replaying code
4355         from diagnose_valid_type.
4356         (tsubst_type_requirement): Use the above.  Take a sat_info
4357         instead of a subst_info.
4358         (tsubst_compound_requirement): Likewise.  Fold in
4359         error-replaying code from diagnose_compound_requirement.
4360         (tsubst_nested_requirement): Take a sat_info instead of a
4361         subst_info.  Fold in error-replaying code from
4362         diagnose_nested_requirement.
4363         (tsubst_requirement): Take a sat_info instead of a subst_info.
4364         (tsubst_requires_expr): Split into two versions, one that takes
4365         a sat_info argument and another that takes a complain and
4366         in_decl argument.  Remove outdated documentation.  Document the
4367         effects of the sat_info argument.  Don't short-circuit
4368         processing of requirements when diagnosing unsatisfaction,
4369         mirroring diagnose_requires_expr.
4370         (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
4371         assert, and se the three-parameter version of tsubst_requires_expr.
4372         (diagnose_trait_expr): Make static.  Take a template argument
4373         vector instead of a parameter mapping.
4374         (diagnose_valid_expression): Remove.
4375         (diagnose_valid_type): Remove.
4376         (diagnose_simple_requirement): Remove.
4377         (diagnose_compound_requirement): Remove.
4378         (diagnose_type_requirement): Remove.
4379         (diagnose_nested_requirement): Remove.
4380         (diagnose_requirement): Remove.
4381         (diagnose_requires_expr): Remove.
4382         (diagnose_atomic_constraint): Take a sat_info instead of a
4383         subst_info.  Adjust call to diagnose_trait_expr.  Call
4384         tsubst_requires_expr instead of diagnose_requires_expr.
4385         (diagnose_constraints): Remove special casing of REQUIRES_EXPR
4386         and just always call constraint_satisfaction_value.
4388 2021-03-03  Patrick Palka  <ppalka@redhat.com>
4390         * constexpr.c (cxx_eval_call_expression): Adjust call to
4391         evaluate_concept_check.
4392         (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
4393         evaluate_requires_expression instead of
4394         satisfy_constraint_expression.
4395         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
4396         * constraint.cc (struct sat_info): Adjust comment about which
4397         satisfaction entrypoints use noisy-unsat.
4398         (normalize_template_requirements): Remove (and adjust callers
4399         appropriately).
4400         (normalize_nontemplate_requirements): Likewise.
4401         (tsubst_nested_requirement): Use constraint_satisfaction_value
4402         instead of satisfy_constraint_expression, which'll do the
4403         noisy replaying of ill-formed quiet satisfaction for us.
4404         (decl_satisfied_cache): Adjust comment.
4405         (satisfy_constraint): Rename to ...
4406         (satisfy_normalized_constraints): ... this.
4407         (satisfy_associated_constraints): Remove (and make its
4408         callers check for dependent arguments).
4409         (satisfy_constraint_expression): Rename to ...
4410         (satisfy_nondeclaration_constraints): ... this.  Assert that
4411         'args' is empty when 't' is a concept-id.  Removing handling
4412         bare constraint-expressions, and handle REQUIRES_EXPRs
4413         specially.  Adjust comment accordingly.
4414         (satisfy_declaration_constraints): Assert in the two-parameter
4415         version that 't' is not a TEMPLATE_DECL.  Adjust following
4416         removal of normalize_(non)?template_requirements and
4417         satisfy_asociated_constraints.
4418         (constraint_satisfaction_value): Combine the two- and
4419         three-parameter versions in the natural way.
4420         (constraints_satisfied_p): Combine the one- and two-parameter
4421         versions in the natural way.  Improve documentation.
4422         (evaluate_requires_expr): Define.
4423         (evaluate_concept_check): Remove 'complain' parameter.  Use
4424         constraint_satisfaction_value instead of
4425         satisfy_constraint_expression.
4426         (diagnose_nested_requirement): Adjust following renaming of
4427         satisfy_constraint_expression.
4428         (diagnose_constraints): Handle REQUIRES_EXPR by going through
4429         diagnose_requires_expr directly instead of treating it as a
4430         constraint-expression.  Improve documentation.
4431         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
4432         to evaluate_concept_check.
4433         <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
4434         constraints_satisfied_p.
4435         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
4436         * cp-tree.h (evaluate_requires_expr): Declare.
4437         (evaluate_concept_check): Remove tsubst_flag_t parameter.
4438         (satisfy_constraint_expression): Remove declaration.
4439         (constraints_satisfied_p): Remove one-parameter declaration.
4440         Add a default argument to the two-parameter declaration.
4441         * cvt.c (convert_to_void): Adjust call to
4442         evaluate_concept_check.
4444 2021-03-03  Jakub Jelinek  <jakub@redhat.com>
4446         PR c++/82959
4447         * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
4448         and COMPOUND_EXPR.
4450 2021-03-03  Marek Polacek  <polacek@redhat.com>
4452         PR c++/97034
4453         PR c++/99009
4454         * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
4455         (maybe_aggr_guide): Use the original template type where needed.  In
4456         a class member template, partially instantiate the result of
4457         collect_ctor_idx_types.
4458         (do_class_deduction): Defer the deduction until the enclosing
4459         scope is non-dependent.
4461 2021-03-03  Jason Merrill  <jason@redhat.com>
4463         PR c++/95675
4464         * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
4465         if it didn't get one before.
4467 2021-03-03  Nathan Sidwell  <nathan@acm.org>
4469         PR c++/99344
4470         * module.cc (trees_out::decl_node): Small refactor.
4471         (depset::hash::add_binding_entity): Return true on meeting an
4472         import.  Set namespace's import here.
4473         (module_state:write_namespaces): Inform of purview too.
4474         (module_state:read_namespaces): Adjust.
4475         * name-lookup.c (implicitly_export_namespace): Delete.
4476         (do_pushdecl): Don't call it.
4477         (push_namespace): Likewise, set purview.
4478         (add_imported_namespace): Reorder parms.
4479         * name-lookup.h (add_imported_namespace): Alter param ordering.
4481 2021-03-02  Martin Sebor  <msebor@redhat.com>
4483         PR c++/99251
4484         * class.c (build_base_path): Call build_if_nonnull.
4485         * cp-tree.h (build_if_nonnull): Declare.
4486         * rtti.c (ifnonnull): Rename...
4487         (build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
4488         (build_dynamic_cast_1): Adjust to name change.
4490 2021-03-02  Patrick Palka  <ppalka@redhat.com>
4492         PR c++/96443
4493         PR c++/96960
4494         * constraint.cc (type_deducible_p): Don't substitute into the
4495         constraints, and instead just pass 'args' to do_auto_deduction
4496         as the outer template arguments.
4497         (tsubst_parameter_mapping): Remove confused code for handling
4498         placeholder type arguments.
4499         (normalize_placeholder_type_constraint): Define.
4500         (satisfy_constraint_expression): Use it to handle placeholder
4501         'auto' types.
4502         * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
4503         (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
4504         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
4505         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
4506         (make_constrained_placeholder_type): Set
4507         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
4508         (do_auto_deduction): Clarify comments about the outer_targs
4509         parameter.  Rework satisfaction of a placeholder type constraint
4510         to pass in the complete set of template arguments directly to
4511         constraints_satisfied_p.
4512         (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
4513         instead.  Also rebuild the the constraint info on the new auto.
4515 2021-03-02  Patrick Palka  <ppalka@redhat.com>
4517         * constraint.cc (build_parameter_mapping): Rely on the caller to
4518         determine the in-scope template parameters.
4519         (norm_info::norm_info): Delegate the tsubst_flags_t constructor
4520         to the two-parameter constructor.  In the two-parameter
4521         constructor, fold in the definition of make_context, set
4522         initial_parms appropriately, and don't set the now-removed
4523         orig_decl member.
4524         (norm_info::make_context): Remove, now that its only use is
4525         inlined into the caller.
4526         (norm_info::update_context): Adjust call to
4527         build_parameter_mapping to pass in the relevant set of in-scope
4528         template parameters.
4529         (norm_info::ctx_parms): Define this member function.
4530         (norm_info::context): Initialize to NULL_TREE.
4531         (norm_info::orig_decl): Remove this data member.
4532         (norm_info::initial_parms): Define this data member.
4533         (normalize_atom): Adjust call to build_parameter_mapping to pass
4534         in the relevant set of in-scope template parameters.  Use
4535         info.initial_parms instead of info.orig_decl.
4536         (normalize_constraint_expression): Take a norm_info object
4537         instead of a bool.  Cache the result of normalization.
4538         (tsubst_nested_requirement): Call satisfy_constraint_expression
4539         instead of satisfy_constraint, so that we normalize on demand.
4540         (satisfy_constraint_expression): Handle a NESTED_REQ argument.
4541         Adjust call to normalize_constraint_expression.
4542         (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
4543         to current_template_parms.
4544         (diagnose_nested_requirements): Go through
4545         satisfy_constraint_expression, as with tsubst_nested_requirement.
4547 2021-03-02  Patrick Palka  <ppalka@redhat.com>
4549         * constraint.cc (tsubst_parameter_mapping): Canonicalize the
4550         arguments of a substituted TYPE_ARGUMENT_PACK even if we've
4551         started with a TYPE_ARGUMENT_PACK.
4552         (finish_requires_expr): Don't set DECL_CONTEXT and
4553         CONSTRAINT_VAR_P on each of the introduced parameters here.
4554         * parser.c (cp_parser_requirement_parameter_list): Instead set
4555         these fields earlier, here.
4556         * pt.c (do_auto_deduction): Canonicalize the result of
4557         do_auto_deduction.  Pass 'complain' to finish_decltype_type.
4559 2021-03-02  Patrick Palka  <ppalka@redhat.com>
4561         * constraint.cc (tsubst_simple_requirement): Just return
4562         boolean_true_node on success.
4563         (tsubst_type_requirement): Likewise.
4564         (tsubst_compound_requirement): Likewise.
4565         (tsubst_nested_requirement): Likewise.
4566         (tsubst_requirement_body): Remove.
4567         (check_constaint_variables): Rename to ...
4568         (check_constraint_variables): ... this.
4569         (tsubst_constraint_variables): Adjust.
4570         (tsubst_requires_expr): Fold tsubst_requirement_body into here.
4572 2021-03-01  Nathan Sidwell  <nathan@acm.org>
4574         PR c++/99294
4575         * class.c (fixup_type_variants): Propagate mode, precision,
4576         alignment & emptiness.
4577         * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
4578         (trees_in::tree_node): Rematerialize alignment here.
4580 2021-02-27  Jason Merrill  <jason@redhat.com>
4582         PR c++/90333
4583         * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
4584         between () and ->.
4586 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
4588         * parser.c (cp_parser_lambda_declarator_opt): Implement
4589         P1102R2 - Down with ()! Make ()s optional before lambda specifiers
4590         for -std={c,gnu}++2b or with pedwarn in earlier versions.
4592 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
4594         PR c++/95451
4595         * lambda.c (is_lambda_ignored_entity): Before checking for
4596         LAMBDA_FUNCTION_P, use OVL_FIRST.  Drop FUNCTION_DECL check.
4598 2021-02-26  Jason Merrill  <jason@redhat.com>
4600         PR c++/98810
4601         * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
4602         to a class non-type template argument that needs it.
4604 2021-02-26  Patrick Palka  <ppalka@redhat.com>
4606         PR c++/98990
4607         * pt.c (splice_late_return_type): Rebuild the entire return type
4608         if we have to adjust the level of an auto within.
4609         (type_uses_auto): Adjust call to find_type_usage.
4610         * type-utils.h (find_type_usage): Revert r10-6571 change that
4611         made this function return a pointer to the auto node.
4613 2021-02-25  Patrick Palka  <ppalka@redhat.com>
4615         PR c++/99213
4616         PR c++/94521
4617         * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
4618         TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
4620 2021-02-25  Patrick Palka  <ppalka@redhat.com>
4622         PR c++/99103
4623         * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
4624         (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
4626 2021-02-25  Marek Polacek  <polacek@redhat.com>
4628         DR 1312
4629         PR c++/99176
4630         * constexpr.c (is_std_construct_at): New overload.
4631         (is_std_allocator_allocate): New overload.
4632         (cxx_eval_call_expression): Use the new overloads.
4633         (cxx_eval_constant_expression): Reject casting
4634         from void * as per DR 1312.  Don't check can_convert.
4636 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
4638         PR c++/97587
4639         * coroutines.cc (struct param_info): Track rvalue refs.
4640         (morph_fn_to_coro): Track rvalue refs, and call the promise
4641         CTOR with the frame copy of passed parms.
4643 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
4645         PR c++/95822
4646         * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
4647         set throwing_cleanup marker.
4649 2021-02-25  Nathan Sidwell  <nathan@acm.org>
4651         PR c++/99166
4652         * module.cc (module_state::inform_cmi_p): Renamed field.
4653         (module_state::do_import): Adjust.
4654         (init_modules, finish_module_processing): Likewise.
4655         (handle_module_option): Likewise.
4657 2021-02-25  Nathan Sidwell  <nathan@acm.org>
4659         PR c++/98318
4660         * mapper-client.cc (module_client::open_module_client): Fix typo
4661         of fd init.
4663 2021-02-24  Nathan Sidwell  <nathan@acm.org>
4665         PR c++/98718
4666         * module.cc (ool): New indirection vector.
4667         (loc_spans::maybe_propagate): Location is not optional.
4668         (loc_spans::open): Likewise.  Assert monotonically advancing.
4669         (module_for_ordinary_loc): Use ool indirection vector.
4670         (module_state::write_prepare_maps): Do not count empty macro
4671         expansions.  Elide empty spans.
4672         (module_state::write_macro_maps): Skip empty expansions.
4673         (ool_cmp): New qsort comparator.
4674         (module_state::write): Create and destroy ool vector.
4675         (name_pending_imports): Fix dump push/pop.
4676         (preprocess_module): Likewise.  Add more dumping.
4677         (preprocessed_module): Likewise.
4679 2021-02-24  Iain Sandoe  <iain@sandoe.co.uk>
4681         PR c++/96251
4682         * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
4683         error reporting when instantiating for a constexpr.
4685 2021-02-23  Nathan Sidwell  <nathan@acm.org>
4687         PR c++/99208
4688         * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
4689         identity.
4691 2021-02-23  Patrick Palka  <ppalka@redhat.com>
4693         PR c++/95468
4694         * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
4695         over from tsubst_copy.
4697 2021-02-23  Patrick Palka  <ppalka@redhat.com>
4699         * pt.c (instantiation_dependent_expression_p): Check
4700         processing_template_decl before calling
4701         potential_constant_expression.
4703 2021-02-22  Nathan Sidwell  <nathan@acm.org>
4705         PR c++/99174
4706         * module.cc (struct module_state): Add visited_p flag.
4707         (name_pending_imports): Use it to avoid duplicate requests.
4708         (preprocess_module): Don't read preprocessor state if we failed to
4709         load a module's config.
4711 2021-02-22  Nathan Sidwell  <nathan@acm.org>
4713         PR c++/99153
4714         * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
4715         to common-path.
4716         * module.cc (set_defining_module): Add assert.
4718 2021-02-19  Nathan Sidwell  <nathan@acm.org>
4720         PR c++/98741
4721         * module.cc (pending_imports): New.
4722         (declare_module): Adjust test condition.
4723         (name_pending_imports): New.
4724         (preprocess_module): Reimplement using pending_imports.
4725         (preprocessed_module): Move name-getting to name_pending_imports.
4726         * name-lookup.c (append_imported_binding_slot): Assert module
4727         ordering is increasing.
4729 2021-02-19  Nathan Sidwell  <nathan@acm.org>
4731         * module.cc (note_cmis): New.
4732         (struct module_state): Add inform_read_p bit.
4733         (module_state::do_import): Inform of CMI location, if enabled.
4734         (init_modules): Canonicalize note_cmis entries.
4735         (handle_module_option): Handle -flang-info-module-read=FOO.
4737 2021-02-19  Jason Merrill  <jason@redhat.com>
4739         PR c++/96926
4740         * call.c (perfect_conversion_p): Limit rvalueness
4741         test to reference bindings.
4743 2021-02-19  Jason Merrill  <jason@redhat.com>
4745         PR c++/96926
4746         * call.c (perfect_conversion_p): New.
4747         (perfect_candidate_p): New.
4748         (add_candidates): Ignore templates after a perfect non-template.
4750 2021-02-18  Nathan Sidwell  <nathan@acm.org>
4752         PR c++/99023
4753         * module.cc (canonicalize_header_name): Use
4754         cpp_probe_header_unit.
4755         (maybe_translate_include): Fix note_includes comparison.
4756         (init_modules): Fix note_includes string termination.
4758 2021-02-18  Jakub Jelinek  <jakub@redhat.com>
4760         PR c++/99132
4761         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
4762         cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
4763         for immediate function calls.
4765 2021-02-17  Nathan Sidwell  <nathan@acm.org>
4767         PR c++/99023
4768         * module.cc (struct macro_export): Add GTY markers.
4769         (macro_exports): Likewise, us a va_gc Vector.
4771 2021-02-17  Jakub Jelinek  <jakub@redhat.com>
4773         PR sanitizer/99106
4774         * init.c (build_zero_init_1): For flexible array members just return
4775         NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
4776         ARRAY_TYPE.
4778 2021-02-17  Nathan Sidwell  <nathan@acm.org>
4780         PR c++/99116
4781         * name-lookup.c (do_pushdecl): Don't peek under template_parm
4782         bindings here ...
4783         (set_identifier_type_value_with_scope): ... or here.
4784         (do_pushtag): Only set_identifier_type_value_with_scope at
4785         non-class template parm scope, and use parent scope.
4787 2021-02-17  Nathan Sidwell  <nathan@acm.org>
4789         PR c++/99071
4790         * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
4791         pointer.
4793 2021-02-17  Patrick Palka  <ppalka@redhat.com>
4795         PR debug/96997
4796         PR c++/94034
4797         * tree.c (build_aggr_init_expr): Revert r10-7718 change.
4799 2021-02-12  Nathan Sidwell  <nathan@acm.org>
4801         * module.cc (module_state::write_cluster): Check bindings for
4802         imported using-decls.
4804 2021-02-12  Nathan Sidwell  <nathan@acm.org>
4806         PR c++/99040
4807         * module.cc (trees_in::decl_value): Call add_module_namespace_decl
4808         for new namespace-scope entities.
4809         (module_state::read_cluster): Don't call add_module_decl here.
4810         * name-lookup.h (add_module_decl): Rename to ...
4811         (add_module_namespace_decl): ... this.
4812         * name-lookup.c (newbinding_bookkeeping): Move into ...
4813         (do_pushdecl): ... here.  Its only remaining caller.
4814         (add_module_decl): Rename to ...
4815         (add_module_namespace_decl): ... here.  Add checking-assert for
4816         circularity. Don't call newbinding_bookkeeping, just extern_c
4817         checking and incomplete var checking.
4819 2021-02-12  Nathan Sidwell  <nathan@acm.org>
4821         PR c++/99039
4822         PR c++/99040
4823         * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
4824         (global_type_node): Delete.
4825         (IDENTIFIER_TYPE_VALUE): Delete.
4826         (IDENTIFIER_HAS_TYPE_VALUE): Delete.
4827         (get_type_value): Delete.
4828         * name-lookup.h (identifier_type_value): Delete.
4829         * name-lookup.c (check_module_override): Don't
4830         SET_IDENTIFIER_TYPE_VALUE here.
4831         (do_pushdecl): Nor here.
4832         (identifier_type_value_1, identifier_type_value): Delete.
4833         (set_identifier_type_value_with_scope): Only
4834         SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
4835         (pushdecl_nanmespace_level): Remove shadow stack nadgering.
4836         (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
4837         * call.c (check_dtor_name): Use lookup_name.
4838         * decl.c (cxx_init_decl_processing): Drop global_type_node.
4839         * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
4840         here.
4841         * init.c (get_type_value): Delete.
4842         * pt.c (instantiate_class_template_1): Don't call pushtag or
4843         SET_IDENTIFIER_TYPE_VALUE here.
4844         (tsubst): Assert never an identifier.
4845         (dependent_type_p): Drop global_type_node assert.
4846         * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
4847         to determine ctorness.
4849 2021-02-12  Jakub Jelinek  <jakub@redhat.com>
4851         PR c++/97742
4852         * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
4853         CPP_EOF.
4855 2021-02-12  Jason Merrill  <jason@redhat.com>
4857         PR c++/97246
4858         PR c++/94546
4859         * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
4860         (register_parameter_specializations): Not here.
4862 2021-02-11  Marek Polacek  <polacek@redhat.com>
4864         PR c++/95888
4865         * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
4866         for the partial instantiation.
4868 2021-02-11  Jakub Jelinek  <jakub@redhat.com>
4870         PR c++/99033
4871         * init.c (build_zero_init_1): Handle zero initialiation of
4872         flexible array members like initialization of [0] arrays.
4873         Use integer_minus_onep instead of comparison to integer_minus_one_node
4874         and integer_zerop instead of comparison against size_zero_node.
4875         Formatting fixes.
4877 2021-02-11  Marek Polacek  <polacek@redhat.com>
4879         PR c++/99063
4880         * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
4882 2021-02-11  Patrick Palka  <ppalka@redhat.com>
4884         PR c++/97582
4885         * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
4886         lookup result by discarding it if the first element is a
4887         class-scope declaration, otherwise return it.
4888         (push_operator_bindings): Handle an ambiguous lookup result by
4889         doing push_local_binding on each element in the list.
4891 2021-02-11  Marek Polacek  <polacek@redhat.com>
4893         * parser.c (cp_parser_selection_statement): Use vec_free.
4895 2021-02-10  Jakub Jelinek  <jakub@redhat.com>
4897         PR c++/98988
4898         PR c++/99031
4899         * constexpr.c: Include cgraph.h.
4900         (cxx_eval_call_expression): Call varpool_node::finalize_decl on
4901         heap artificial vars.
4902         (cxx_eval_outermost_constant_expr): Remove varpool nodes for
4903         heap artificial vars.
4905 2021-02-10  Nathan Sidwell  <nathan@acm.org>
4907         PR c++/99030
4908         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
4909         answer if there's no local specialization.
4911 2021-02-09  Nathan Sidwell  <nathan@acm.org>
4913         PR c++/98944
4914         * module.cc (module_state::is_rooted): Rename to ...
4915         (module_state::has_location): ... here.  Adjust callers.
4916         (module_state::read_partitions): Adjust validity check.
4917         Don't overwrite a known location.
4919 2021-02-09  Jason Merrill  <jason@redhat.com>
4921         PR c++/96905
4922         * pt.c (mark_decl_instantiated): Exit early if consteval.
4924 2021-02-09  Jason Merrill  <jason@redhat.com>
4926         PR c++/98326
4927         PR c++/20408
4928         * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
4929         parm.
4931 2021-02-09  Jason Merrill  <jason@redhat.com>
4933         PR c++/98994
4934         PR c++/97566
4935         * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
4936         RECORD_TYPE.
4938 2021-02-08  Nathan Sidwell  <nathan@acm.org>
4940         * decl.c (start_cleanup_fn): Push function into
4941         namespace.
4943 2021-02-08  Nathan Sidwell  <nathan@acm.org>
4945         PR c++/98531
4946         * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
4947         * decl.c (push_abi_namespace, pop_abi_namespace): Moved
4948         from rtti.c, add default namespace arg.
4949         (check_redeclaration_exception_specification): Allow a lazy
4950         builtin's eh spec to differ from an lready-declared user
4951         declaration.
4952         (declare_global_var): Use push/pop_abi_namespace.
4953         (get_atexit_node): Push the fndecl into a namespace.
4954         * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
4955         decl.c.
4957 2021-02-08  Marek Polacek  <polacek@redhat.com>
4959         * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
4961 2021-02-05  Marek Polacek  <polacek@redhat.com>
4963         PR c++/98947
4964         * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
4965         on arg2/arg3.
4966         * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
4967         issuing the -Wvolatile warning.  Only set TREE_THIS_VOLATILE if
4968         a warning was emitted.
4970 2021-02-05  Marek Polacek  <polacek@redhat.com>
4972         PR c++/96462
4973         * name-lookup.c (lookup_using_decl): Hoist the destructor check.
4975 2021-02-05  Jakub Jelinek  <jakub@redhat.com>
4977         PR c++/97878
4978         * decl.c (check_array_initializer): For structured bindings, require
4979         the array type to be complete.
4981 2021-02-04  Jason Merrill  <jason@redhat.com>
4983         PR c++/98717
4984         * constraint.cc (build_concept_check_arguments): Remove assert.
4985         (build_concept_check): Allow empty args.
4987 2021-02-04  Tom Greenslade (thomgree)  <thomgree@cisco.com>
4989         PR c++/90926
4990         * call.c (can_convert_array): Extend to handle all valid aggregate
4991         initializers of an array; including by string literals, not just by
4992         brace-init-list.
4993         (build_aggr_conv): Call can_convert_array more often, not just in
4994         brace-init-list case.
4995         * typeck2.c (array_string_literal_compatible_p): New function.
4996         (digest_init_r): call array_string_literal_compatible_p
4997         * cp-tree.h: (array_string_literal_compatible_p): Declare.
4999 2021-02-04  Jason Merrill  <jason@redhat.com>
5001         PR c++/98802
5002         * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
5004 2021-02-04  Jason Merrill  <jason@redhat.com>
5006         PR c++/95192
5007         * pt.c (tsubst_attribute): Handle error.
5008         (apply_late_template_attributes): Return false on error.
5009         (tsubst_function_decl): Check its return value.
5010         (tsubst_decl): Likewise.
5011         (push_template_decl): Assert current_template_parms.
5012         (tsubst_template_decl): Set current_template_parms.
5014 2021-02-03  Marek Polacek  <polacek@redhat.com>
5016         PR c++/98951
5017         * call.c (struct z_candidate): Mark rewritten and reversed as const.
5018         (struct NonPublicField): Mark operator() as const.
5019         (struct NonTrivialField): Likewise.
5021 2021-02-03  Jason Merrill  <jason@redhat.com>
5023         PR c++/98926
5024         PR c++/98570
5025         * pt.c (spec_hasher::equal): Set processing_template_decl.
5026         * Make-lang.in (check-g++-strict-gc): Add --param
5027         hash-table-verification-limit=10000.
5029 2021-02-03  Marek Polacek  <polacek@redhat.com>
5031         PR c++/98899
5032         * parser.c (cp_parser_class_specifier_1): Use any possible
5033         DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
5034         (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
5035         * pt.c (tsubst_exception_specification): Stash new_specs into
5036         DEFPARSE_INSTANTIATIONS.
5037         * tree.c (fixup_deferred_exception_variants): Use
5038         UNPARSED_NOEXCEPT_SPEC_P.
5040 2021-02-02  Jason Merrill  <jason@redhat.com>
5042         PR c++/98929
5043         PR c++/96199
5044         * error.c (dump_expr): Ignore dummy object.
5045         * pt.c (tsubst_baselink): Handle dependent scope.
5047 2021-02-01  Patrick Palka  <ppalka@redhat.com>
5049         PR c++/98295
5050         * constexpr.c (cxx_eval_array_reference): Also set
5051         new_ctx.object when setting new_ctx.ctor.
5053 2021-02-01  Marek Polacek  <polacek@redhat.com>
5055         PR c++/98355
5056         * parser.c (cp_parser_has_attribute_expression): Use
5057         uses_template_parms instead of type_dependent_expression_p.
5059 2021-02-01  Jason Merrill  <jason@redhat.com>
5061         PR c++/98570
5062         * cp-tree.h: Declare it.
5063         * pt.c (comparing_dependent_aliases): New flag.
5064         (template_args_equal, spec_hasher::equal): Set it.
5065         (dependent_alias_template_spec_p): Assert that we don't
5066         get non-types other than error_mark_node.
5067         (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
5068         on complex alias specializations.  Set TYPE_DEPENDENT_P here.
5069         (tsubst_decl): Not here.
5070         * module.cc (module_state::read_cluster): Set
5071         comparing_dependent_aliases instead of
5072         comparing_specializations.
5073         * tree.c (cp_tree_equal): Remove comparing_specializations
5074         module handling.
5075         * typeck.c (structural_comptypes): Adjust.
5076         (comptypes): Remove comparing_specializations handling.
5078 2021-01-29  Nathan Sidwell  <nathan@acm.org>
5080         PR c++/98843
5081         * module.cc (module_state_config): Add num_entities field.
5082         (module_state::read_entities): The entity_ary span is
5083         already allocated.
5084         (module_state::write_config): Write num_entities.
5085         (module_state::read_config): Read num_entities.
5086         (module_state::write): Set config's num_entities.
5087         (module_state::read_initial): Allocate the entity ary
5088         span here.
5089         (module_state::read_language): Do not set entity_lwm
5090         here.
5092 2021-01-29  Marek Polacek  <polacek@redhat.com>
5094         PR c++/96137
5095         * parser.c (cp_parser_class_name): If parser->scope is
5096         error_mark_node, return it, otherwise continue.
5098 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
5100         PR c++/98841
5101         * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
5103 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
5105         PR c++/33661
5106         PR c++/98847
5107         * decl.c (cp_finish_decl): For register vars with asmspec in templates
5108         call set_user_assembler_name and set DECL_HARD_REGISTER.
5109         * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
5110         pass asmspec_tree to cp_finish_decl.
5112 2021-01-28  Nathan Sidwell  <nathan@acm.org>
5114         PR c++/98770
5115         * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
5116         check order.
5117         (trees_in::decl_value): Do typedef frobbing only when installing
5118         a new typedef, adjust is_matching_decl call.  Swap is_typedef
5119         & TYPE_NAME check.
5120         (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
5121         names and deal with typedef checking.
5123 2021-01-27  Jason Merrill  <jason@redhat.com>
5125         PR c++/97874
5126         * name-lookup.c (lookup_using_decl): Clean up handling
5127         of dependency and inherited constructors.
5128         (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
5129         * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
5131 2021-01-26  Jason Merrill  <jason@redhat.com>
5133         PR c++/97474
5134         * call.c (type_passed_as): Don't mark invisiref restrict.
5136 2021-01-26  Jason Merrill  <jason@redhat.com>
5138         PR c++/97566
5139         PR c++/98463
5140         * class.c (layout_class_type): An empty field gets size 0.
5141         (is_empty_field): New.
5142         (check_bases): Check it.
5143         * cp-tree.h (is_empty_field): Declare it.
5144         * constexpr.c (cxx_eval_store_expression): Check it.
5145         (cx_check_missing_mem_inits): Likewise.
5146         * init.c (perform_member_init): Likewise.
5147         * typeck2.c (process_init_constructor_record): Likewise.
5149 2021-01-25  Martin Sebor  <msebor@redhat.com>
5151         PR c++/98646
5152         * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
5154 2021-01-25  Jason Merrill  <jason@redhat.com>
5156         PR c++/98463
5157         * constexpr.c (get_or_insert_ctor_field): Add check.
5158         (cxx_eval_store_expression): Handle discontinuity of refs.
5160 2021-01-23  Anthony Sharp  <anthonysharp15@gmail.com>
5162         * call.c (complain_about_access): Altered function.
5163         * cp-tree.h (complain_about_access): Changed parameters of function.
5164         (get_parent_with_private_access): Declared new function.
5165         * search.c (get_parent_with_private_access): Defined new function.
5166         * semantics.c (enforce_access): Modified function.
5167         * typeck.c (complain_about_unrecognized_member): Updated function
5168         arguments in complain_about_access.
5170 2021-01-23  Patrick Palka  <ppalka@redhat.com>
5172         PR c++/97399
5173         * cp-tree.h (shared_member_p): Adjust declaration.
5174         * parser.c (cp_parser_init_declarator): If the storage class
5175         specifier is sc_static, pass true for static_p to
5176         cp_parser_declarator.
5177         (cp_parser_direct_declarator): Don't do inject_this_parm when
5178         the declarator is a friend.
5179         * search.c (shared_member_p): Change return type to bool and
5180         adjust function body accordingly.  Return false for a dependent
5181         USING_DECL instead of aborting.
5182         * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
5183         even when type-dependent.
5185 2021-01-22  Marek Polacek  <polacek@redhat.com>
5187         PR c++/96623
5188         * parser.c (inject_parm_decls): Remove a redundant assignment.
5189         (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
5190         before calling inject_parm_decls.
5192 2021-01-22  Jason Merrill  <jason@redhat.com>
5194         PR c++/98744
5195         * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
5197 2021-01-22  Jakub Jelinek  <jakub@redhat.com>
5199         PR sanitizer/95693
5200         * init.c (build_zero_init_1): Revert the 2018-03-06 change to
5201         return build_zero_cst for reference types.
5202         * typeck2.c (process_init_constructor_record): Instead call
5203         build_zero_cst here during error recovery instead of build_zero_init.
5205 2021-01-22  Marek Polacek  <polacek@redhat.com>
5207         PR c++/98545
5208         * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
5209         warnings regardless of abi_version_at_least.
5210         (write_expression): When the expression is a dependent name
5211         and an operator name, write "on" before writing its name.
5213 2021-01-22  Marek Polacek  <polacek@redhat.com>
5215         PR c++/97966
5216         * pt.c (instantiate_class_template_1): Instantiate members
5217         marked with attribute used only after we're done instantiating
5218         the class.
5220 2021-01-21  Patrick Palka  <ppalka@redhat.com>
5222         PR c++/71879
5223         * semantics.c (finish_decltype_type): Set up a cp_unevaluated
5224         sentinel at the start of the function.  Remove a now-redundant
5225         manual adjustment of cp_unevaluated_operand.
5227 2021-01-21  Nathan Sidwell  <nathan@acm.org>
5229         PR c++/98624
5230         * module.cc (depset::hash::find_dependencies): Add
5231         module arg.
5232         (trees_out::core_vals): Check state before calling
5233         write_location.
5234         (sort_cluster, module_state::write): Adjust
5235         find_dependencies call.
5237 2021-01-21  Jakub Jelinek  <jakub@redhat.com>
5239         PR c++/98672
5240         * constexpr.c (check_for_return_continue_data): Add break_stmt member.
5241         (check_for_return_continue): Also look for BREAK_STMT.  Handle
5242         SWITCH_STMT by ignoring break_stmt from its body.
5243         (potential_constant_expression_1) <case FOR_STMT>,
5244         <case WHILE_STMT>: If the condition isn't constant true, check if
5245         the loop body can contain a return stmt.
5246         <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
5247         <case IF_STMT>: If recursion with tf_none is successful,
5248         merge *jump_target from the branches - returns with highest priority,
5249         breaks or continues lower.  If then branch is potentially constant and
5250         doesn't return, check the else branch if it could return, break or
5251         continue.
5253 2021-01-21  Nathan Sidwell  <nathan@acm.org>
5255         PR c++/98530
5256         * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
5258 2021-01-20  Nathan Sidwell  <nathan@acm.org>
5260         * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
5261         signed type.
5263 2021-01-20  Patrick Palka  <ppalka@redhat.com>
5265         PR c++/95434
5266         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
5267         CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
5268         adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
5270 2021-01-20  Patrick Palka  <ppalka@redhat.com>
5272         PR c++/82613
5273         * parser.c (cp_parser_class_head): Defer access checking when
5274         parsing the base-clause until all bases are seen and attached
5275         to the class type.
5276         * pt.c (instantiate_class_template): Likewise when substituting
5277         into dependent bases.
5279 2021-01-20  Jakub Jelinek  <jakub@redhat.com>
5281         PR c++/98742
5282         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
5283         error_operand_p, remove clause without further checking.  Check
5284         for non-NULL TYPE_NAME.
5286 2021-01-19  Marek Polacek  <polacek@redhat.com>
5288         PR c++/98659
5289         * pt.c (maybe_instantiate_noexcept): Return false if FN is
5290         error_mark_node.
5292 2021-01-19  Marek Polacek  <polacek@redhat.com>
5294         PR c++/98687
5295         * name-lookup.c (push_using_decl_bindings): New, broken out of...
5296         (finish_nonmember_using_decl): ...here.
5297         * name-lookup.h (push_using_decl_bindings): Update declaration.
5298         * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
5300 2021-01-19  Patrick Palka  <ppalka@redhat.com>
5302         PR c++/41437
5303         PR c++/58993
5304         * search.c (friend_accessible_p): If scope is a hidden friend
5305         defined inside a dependent class, consider access from the
5306         class.
5307         * parser.c (cp_parser_late_parsing_for_member): Don't push a
5308         dk_no_check access state.
5310 2021-01-19  Marek Polacek  <polacek@redhat.com>
5312         PR c++/98333
5313         * parser.c (cp_parser_class_specifier_1): Perform late-parsing
5314         of NSDMIs before late-parsing of noexcept-specifiers.
5316 2021-01-19  Nathan Sidwell  <nathan@acm.org>
5318         * module.cc (identifier): Merge overloads.
5320 2021-01-19  Nathan Sidwell  <nathan@acm.org>
5322         PR c++/98624
5323         * module.cc (trees_out::write_location): Make static.
5325 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
5327         * parser.c (cp_parser_omp_clause_detach): New.
5328         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
5329         (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
5330         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
5331         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
5332         Prevent use of detach with mergeable and overriding the data sharing
5333         mode of the event handle.
5335 2021-01-15  Nathan Sidwell  <nathan@acm.org>
5337         PR c++/98538
5338         * tree.c (cp_build_qualified_type_real): Propagate an array's
5339         dependentness to the copy, if known.
5341 2021-01-15  Jason Merrill  <jason@redhat.com>
5343         PR c++/98642
5344         * call.c (unsafe_return_slot_p): Return int.
5345         (init_by_return_slot_p): Split out from...
5346         (unsafe_copy_elision_p): ...here.
5347         (unsafe_copy_elision_p_opt): New name for old meaning.
5348         (build_over_call): Adjust.
5349         (make_safe_copy_elision): New.
5350         * typeck2.c (split_nonconstant_init_1): Elide copy from safe
5351         list-initialization.
5352         * cp-tree.h: Adjust.
5354 2021-01-15  Jason Merrill  <jason@redhat.com>
5356         * call.c (base_ctor_for, make_base_init_ok): New.
5357         (build_over_call): Use make_base_init_ok.
5359 2021-01-15  Jason Merrill  <jason@redhat.com>
5361         PR c++/63707
5362         * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
5363         if we got a CONSTRUCTOR.
5365 2021-01-15  Nathan Sidwell  <nathan@acm.org>
5367         PR c++/98591
5368         * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
5370 2021-01-14  Jason Merrill  <jason@redhat.com>
5372         * typeck2.c (process_init_constructor_record): Use fldtype
5373         variable consistently.
5375 2021-01-14  Nathan Sidwell  <nathan@acm.org>
5377         PR c++/98372
5378         * tree.c (cp_tree_equal): Correct map_context logic.
5380 2021-01-13  Marek Polacek  <polacek@redhat.com>
5382         PR c++/98231
5383         * name-lookup.c (push_using_decl_bindings): New.
5384         * name-lookup.h (push_using_decl_bindings): Declare.
5385         * pt.c (tsubst_expr): Call push_using_decl_bindings.
5387 2021-01-13  Nathan Sidwell  <nathan@acm.org>
5389         PR c++/98626
5390         * module.cc (module_add_import_initializers):  Pass a
5391         zero-element argument vector.
5393 2021-01-12  Patrick Palka  <ppalka@redhat.com>
5395         PR c++/98611
5396         * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
5397         the template of a CTAD placeholder.
5399 2021-01-12  Marek Polacek  <polacek@redhat.com>
5401         PR c++/98620
5402         * typeck2.c (process_init_constructor_record): Don't emit
5403         -Wmissing-field-initializers warnings in unevaluated contexts.
5405 2021-01-11  Jakub Jelinek  <jakub@redhat.com>
5407         PR c++/98481
5408         * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
5409         for types.
5410         (mark_abi_tags_r): Likewise.
5411         * decl2.c (min_vis_r): Likewise.
5412         * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
5413         typedefs.
5415 2021-01-08  Patrick Palka  <ppalka@redhat.com>
5417         PR c++/98551
5418         * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
5419         instead of AGGREGATE_TYPE_P before calling replace_result_decl.
5421 2021-01-08  Patrick Palka  <ppalka@redhat.com>
5423         PR c++/98515
5424         * semantics.c (check_accessibility_of_qualified_id): Punt if
5425         we're checking access of a scoped non-static member inside a
5426         class template.
5428 2021-01-07  Jakub Jelinek  <jakub@redhat.com>
5430         PR c++/98329
5431         * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
5432         cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
5433         its location.
5434         (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
5436 2021-01-07  Marek Polacek  <polacek@redhat.com>
5438         PR c++/98441
5439         * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
5440         !late_return_type block.
5442 2021-01-07  Jason Merrill  <jason@redhat.com>
5444         * constexpr.c (cxx_bind_parameters_in_call): Add comment.
5445         (cxx_eval_store_expression): Add comment.
5447 2021-01-07  Jason Merrill  <jason@redhat.com>
5449         * call.c (has_next): Factor out from...
5450         (next_conversion): ...here.
5451         (strip_standard_conversion): And here.
5452         (is_subseq): And here.
5453         (build_conv): Check it.
5454         (standard_conversion): Don't call build_conv
5455         for ck_identity.
5457 2021-01-06  Martin Sebor  <msebor@redhat.com>
5459         PR c++/95768
5460         * error.c (dump_expr): Call c_pretty_printer::unary_expression.
5462 2021-01-05  Patrick Palka  <ppalka@redhat.com>
5464         * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
5465         the type of the NTTP, substitute into the type again.  If the
5466         type is still dependent, don't unify the NTTP.
5468 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
5470         * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
5471         $(CODYLIB) after $(BACKEND).
5473 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
5475         PR c++/98469
5476         * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
5477         Punt if lval is true.
5478         * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
5479         the result if it has a class type.
5481 2021-01-05  Marek Polacek  <polacek@redhat.com>
5483         PR c++/82099
5484         * pt.c (resolve_overloaded_unification): Call
5485         maybe_instantiate_noexcept after instantiating the function
5486         decl.
5488 2021-01-05  Nathan Sidwell  <nathan@acm.org>
5490         * parser.c (cp_parser_module_declaration): Alter diagnostic
5491         text to say where is permissable.
5493 2021-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
5495         PR c++/98316
5496         * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
5498 2021-01-02  Jan Hubicka  <jh@suse.cz>
5500         * cp-tree.h (cp_tree_c_finish_parsing): Declare.
5501         * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
5502         * tree.c (cp_tree_c_finish_parsing): New function.
5504 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
5506         * ChangeLog-2020: Rotate ChangeLog.  New file.
5508 Copyright (C) 2021 Free Software Foundation, Inc.
5510 Copying and distribution of this file, with or without modification,
5511 are permitted in any medium without royalty provided the copyright
5512 notice and this notice are preserved.