Daily bump.
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
2
3         * parser.c (cp_parser_member_declaration): Move odsd declaration
4         before cp_parser_using_declaration call to avoid errors with
5         GCC 4.8 to 6.
6
7 2021-08-10  Jakub Jelinek  <jakub@redhat.com>
8
9         * parser.h (struct cp_omp_declare_simd_data): Remove
10         in_omp_attribute_pragma and clauses members, add loc and attribs.
11         (struct cp_oacc_routine_data): Remove loc member, add clauses
12         member.
13         * parser.c (cp_finalize_omp_declare_simd): New function.
14         (cp_parser_handle_statement_omp_attributes): Mention in
15         function comment the function is used also for
16         attribute-declaration.
17         (cp_parser_handle_directive_omp_attributes): New function.
18         (cp_parser_statement): Don't call
19         cp_parser_handle_statement_omp_attributes if statement doesn't
20         have attribute-specifier-seq at the beginning at all or if
21         if those attributes don't appertain to the statement.
22         (cp_parser_simple_declaration): Call
23         cp_parser_handle_directive_omp_attributes and
24         cp_finalize_omp_declare_simd.
25         (cp_parser_explicit_instantiation): Likewise.
26         (cp_parser_init_declarator): Initialize prefix_attributes
27         only after parsing declarators.
28         (cp_parser_direct_declarator): Call
29         cp_parser_handle_directive_omp_attributes and
30         cp_finalize_omp_declare_simd.
31         (cp_parser_member_declaration): Likewise.
32         (cp_parser_single_declaration): Likewise.
33         (cp_parser_omp_declare_simd): Don't initialize
34         data.in_omp_attribute_pragma, instead initialize
35         data.attribs[0] and data.attribs[1].
36         (cp_finish_omp_declare_variant): Remove
37         in_omp_attribute_pragma argument, instead use
38         parser->lexer->in_omp_attribute_pragma.
39         (cp_parser_late_parsing_omp_declare_simd): Adjust
40         cp_finish_omp_declare_variant caller.  Handle attribute-syntax
41         declare simd/variant.
42
43 2021-08-06  Tamar Christina  <tamar.christina@arm.com>
44
45         * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
46         * decl.c (cxx_simulate_enum_decl): Likewise.
47
48 2021-08-04  Jakub Jelinek  <jakub@redhat.com>
49
50         PR c++/101759
51         * parser.c (cp_parser_default_argument): Temporarily override
52         parser->omp_declare_simd and parser->oacc_routine to NULL.
53
54 2021-08-02  Patrick Palka  <ppalka@redhat.com>
55
56         PR c++/100828
57         * logic.cc (formula::formula): Use emplace_back instead of
58         push_back.
59         (formula::branch): Insert a copy of m_current directly after
60         m_current instead of at the end of the list.
61         (formula::erase): Define.
62         (decompose_formula): Remove.
63         (decompose_antecedents): Remove.
64         (decompose_consequents): Remove.
65         (derive_proofs): Remove.
66         (max_problem_size): Remove.
67         (diagnose_constraint_size): Remove.
68         (subsumes_constraints_nonnull): Rewrite directly in terms of
69         decompose_clause and derive_proof, interleaving decomposition
70         with implication checking.  Remove limit on constraint complexity.
71         Use formula::erase to free the current clause before moving on to
72         the next one.
73
74 2021-07-31  Jason Merrill  <jason@redhat.com>
75
76         PR c++/96636
77         * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
78         after error.
79
80 2021-07-31  Jason Merrill  <jason@redhat.com>
81
82         * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
83         PACK_EXPANSION_PATTERN.
84
85 2021-07-31  Jakub Jelinek  <jakub@redhat.com>
86
87         * parser.c (cp_parser_declaration): Handle OpenMP directives
88         in attribute-declaration.
89
90 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
91
92         PR c++/101539
93         * cp-tree.h (enum cp_trait_kind): Add
94         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
95         (enum cp_built_in_function): Add
96         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
97         (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
98         * parser.c (cp_parser_primary_expression): Handle
99         RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
100         (cp_parser_trait_expr): Likewise.
101         * cp-objcp-common.c (names_builtin_p): Likewise.
102         * constraint.cc (diagnose_trait_expr): Handle
103         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
104         * decl.c (cxx_init_decl_processing): Register
105         __builtin_is_pointer_interconvertible_with_class builtin.
106         * constexpr.c (cxx_eval_builtin_function_call): Handle
107         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
108         * semantics.c (pointer_interconvertible_base_of_p,
109         first_nonstatic_data_member_p,
110         fold_builtin_is_pointer_inverconvertible_with_class): New functions.
111         (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
112         (finish_trait_expr): Likewise.  Formatting fix.
113         * cp-gimplify.c (cp_gimplify_expr): Fold
114         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
115         fndecl_built_in_p just once.
116         (cp_fold): Likewise.
117         * tree.c (builtin_valid_in_constant_expr_p): Handle
118         CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.  Call
119         fndecl_built_in_p just once.
120         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
121         CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
122
123 2021-07-30  Jason Merrill  <jason@redhat.com>
124
125         * class.c (finish_struct_anon): Improve comment.
126         * decl.c (fixup_anonymous_aggr): Reject anonymous struct
127         with bases.
128
129 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
130
131         * parser.c (cp_parser_statement): Rollback attributes not just
132         when std_attrs is non-NULL, but whenever
133         cp_parser_std_attribute_spec_seq parsed any tokens.
134
135 2021-07-30  Jakub Jelinek  <jakub@redhat.com>
136
137         PR c++/101582
138         * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
139         declaration.
140         (cp_parser_declaration): Parse empty-declaration and
141         attribute-declaration.
142         (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
143
144 2021-07-28  Martin Sebor  <msebor@redhat.com>
145
146         * init.c: Include new header.
147
148 2021-07-27  Marek Polacek  <polacek@redhat.com>
149
150         DR 1512
151         PR c++/99701
152         * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
153         a switch.
154         * typeck.c (cp_build_binary_op): Reject ordered comparison
155         of two null pointers.
156
157 2021-07-26  Jakub Jelinek  <jakub@redhat.com>
158
159         * parser.h (struct cp_lexer): Add orphan_p member.
160         * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
161         upon restart from CPP_PRAGMA handling.  Fix up condition when a lexer
162         should be destroyed and adjust saved_tokens if it records tokens from
163         the to be destroyed lexer.
164         (cp_parser_omp_section_scan): New function.
165         (cp_parser_omp_scan_loop_body): Use it.  If
166         parser->lexer->in_omp_attribute_pragma, allow optional comma
167         after scan.
168         (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
169
170 2021-07-23  Jakub Jelinek  <jakub@redhat.com>
171
172         * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
173         * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
174         mixing of attribute and pragma syntax directives when seeing
175         omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
176         directives are followed by OpenMP pragma.
177         (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
178         the cp_parser_handle_statement_omp_attributes call.
179         (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
180         if true, set parser->omp_attrs_forbidden_p.
181         (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
182         false as disallow_omp_attrs to cp_parser_omp_structured_block.
183         (cp_parser_omp_parallel, cp_parser_omp_task): Set
184         parser->omp_attrs_forbidden_p.
185
186 2021-07-21  Thomas Schwinge  <thomas@codesourcery.com>
187             Joseph Myers  <joseph@codesourcery.com>
188             Cesar Philippidis  <cesar@codesourcery.com>
189
190         * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
191         (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
192         (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
193         * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
194         * semantics.c (finish_omp_clauses): Likewise.
195
196 2021-07-21  Jakub Jelinek  <jakub@redhat.com>
197
198         PR c++/101516
199         * semantics.c (finish_omp_reduction_clause): Also call
200         complete_type_or_else and return true if it fails.
201
202 2021-07-19  Iain Sandoe  <iain@sandoe.co.uk>
203
204         PR c++/95520
205         * coroutines.cc (struct coroutine_info): Add fields for
206         actor and destroy function decls.
207         (to_ramp): New.
208         (coro_get_ramp_function): New.
209         (coro_get_actor_function): New.
210         (coro_get_destroy_function): New.
211         (act_des_fn): Set up mapping between ramp, actor and
212         destroy functions.
213         (morph_fn_to_coro): Adjust interface to the builder for
214         helper function decls.
215         * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
216         JOIN_STR): New.
217         * mangle.c (write_encoding): Handle coroutine helpers.
218         (write_unqualified_name): Handle lambda coroutine helpers.
219
220 2021-07-16  Patrick Palka  <ppalka@redhat.com>
221
222         PR c++/101233
223         * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
224         substituting DECL_ARGUMENTS.
225
226 2021-07-16  Patrick Palka  <ppalka@redhat.com>
227
228         DR 960
229         PR c++/99664
230         * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
231         when the return types are references.
232
233 2021-07-16  Marek Polacek  <polacek@redhat.com>
234
235         * typeck2.c (check_narrowing): Don't suppress the pedantic error
236         in system headers.
237
238 2021-07-15  Jakub Jelinek  <jakub@redhat.com>
239
240         PR c++/101443
241         * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
242         operands, fold them right away to true or false.
243
244 2021-07-15  Jason Merrill  <jason@redhat.com>
245
246         PR c++/101095
247         * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
248         (cp_tree_size): Remove redundant entries.
249
250 2021-07-14  Patrick Palka  <ppalka@redhat.com>
251
252         PR c++/88252
253         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
254         * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
255         handling.
256         (redeclare_class_template): Likewise.
257         (forwarding_reference_p): Define.
258         (maybe_adjust_types_for_deduction): Use it instead.  Add 'tparms'
259         parameter.
260         (unify_one_argument): Pass tparms to
261         maybe_adjust_types_for_deduction.
262         (try_one_overload): Likewise.
263         (unify): Likewise.
264         (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
265         handling.
266
267 2021-07-14  Jason Merrill  <jason@redhat.com>
268
269         * class.c (struct find_final_overrider_data): Use auto_vec.
270         (find_final_overrider): Remove explicit release.
271         * coroutines.cc (process_conditional): Use auto_vec.
272         * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
273         (cp_genericize_tree): Remove explicit release.
274         * parser.c (cp_parser_objc_at_property_declaration): Use
275         auto_delete_vec.
276         * semantics.c (omp_reduction_lookup): Use auto_vec.
277
278 2021-07-14  Marek Polacek  <polacek@redhat.com>
279
280         PR c++/101371
281         * constexpr.c (cxx_eval_array_reference): Create a new .object
282         and .ctor for the non-aggregate non-scalar case too when
283         value-initializing.
284
285 2021-07-12  Patrick Palka  <ppalka@redhat.com>
286
287         PR c++/79501
288         PR c++/100983
289         * decl.c (grokfndecl): Don't require that deduction guides are
290         declared at namespace scope.  Check that class-scope deduction
291         guides have the same access as the member class template.
292         (grokdeclarator): Pretend class-scope deduction guides are static.
293         * search.c (lookup_member): Don't use a BASELINK for (class-scope)
294         deduction guides.
295
296 2021-07-10  Patrick Palka  <ppalka@redhat.com>
297
298         PR c++/82110
299         * init.c (build_aggr_init): Return error_mark_node if
300         expand_aggr_init_1 returns false.
301         (expand_default_init): Change return type to bool.  Return false
302         on error, true on success.
303         (expand_aggr_init_1): Likewise.
304
305 2021-07-09  Jason Merrill  <jason@redhat.com>
306
307         PR c++/101098
308         * decl.c (function_requirements_equivalent_p): Only compare
309         trailing requirements on a specialization.
310
311 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
312
313         * coroutines.cc (build_actor_fn): Move common code to
314         act_des_fn.
315         (build_destroy_fn): Likewise.
316         (act_des_fn): Build the void return here.  Ensure that the
317         source location matches the original function.
318
319 2021-07-09  Iain Sandoe  <iain@sandoe.co.uk>
320
321         * coroutines.cc
322         (coro_rewrite_function_body): Connect the replacement
323         function block to the block nest correctly.
324
325 2021-07-09  Patrick Palka  <ppalka@redhat.com>
326
327         PR c++/101181
328         * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
329         add_extra_args.
330         * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
331         * pt.c (build_extra_args): Make a copy of args.
332         (add_extra_args): Add complain/in_decl parameters.  Enable the
333         code for handling the case where the extra arguments are
334         dependent.
335         (tsubst_pack_expansion): Pass complain/in_decl to
336         add_extra_args.
337         (tsubst_template_args): Handle missing template arguments.
338         (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
339         add_extra_args.
340
341 2021-07-09  Patrick Palka  <ppalka@redhat.com>
342
343         PR c++/101247
344         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
345         DECL_CONTEXT.
346
347 2021-07-08  Martin Sebor  <msebor@redhat.com>
348
349         PR bootstrap/101372
350         * module.cc (identifier): Suppress warning.
351         (module_state::read_macro_maps): Remove warning suppression.
352         (module_state::install_macros): Ditto.
353
354 2021-07-08  Marek Polacek  <polacek@redhat.com>
355
356         PR c++/101087
357         * cp-tree.h (unevaluated_p): New.
358         * except.c (check_noexcept_r): Use it.  Don't walk into
359         unevaluated operands.
360
361 2021-07-08  Martin Sebor  <msebor@redhat.com>
362
363         PR bootstrap/101374
364         * module.cc (module_state::read_macro_maps): Temporarily disable
365         -Warray-bounds.
366         (module_state::install_macros): Same.
367
368 2021-07-06  Martin Sebor  <msebor@redhat.com>
369
370         * error.c (cp_printer):  Remove support for %G and %K.
371
372 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
373
374         * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
375         (struct cp_omp_declare_simd_data): Likewise.
376         * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
377         (omp_identifier): Define.
378         * parser.c (cp_parser_skip_to_pragma_eol): Handle
379         in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
380         (cp_parser_require_pragma_eol): Likewise.
381         (struct cp_omp_attribute_data): New type.
382         (cp_parser_handle_statement_omp_attributes): New function.
383         (cp_parser_statement): Handle OpenMP directives in statement's
384         attribute-specifier-seq.
385         (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
386         functions.
387         (cp_parser_std_attribute): Handle omp::directive and omp::sequence
388         attributes.
389         (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
390         a comma also before the first clause.
391         (cp_parser_omp_allocate): Likewise.
392         (cp_parser_omp_atomic): Likewise.
393         (cp_parser_omp_depobj): Likewise.
394         (cp_parser_omp_flush): Likewise.
395         (cp_parser_omp_ordered): Likewise.
396         (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
397         into struct cp_omp_declare_simd_data.
398         (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
399         argument.  If set, allow a comma also before match clause.
400         (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
401         allow a comma also before the first clause.  Adjust
402         cp_finish_omp_declare_variant caller.
403         (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
404         a comma also before the first clause.
405         (cp_parser_omp_declare_reduction_exprs): Likewise.
406         (cp_parser_omp_requires): Likewise.
407         * decl.c (initialize_predefined_identifiers): Initialize
408         omp_identifier.
409         * decl2.c (cplus_decl_attributes): Reject omp::directive and
410         omp::sequence attributes.
411
412 2021-07-02  Jakub Jelinek  <jakub@redhat.com>
413
414         PR c/101297
415         * parser.c (cp_parser_omp_atomic): Consume comma only if it
416         appears before a CPP_NAME.
417
418 2021-07-02  Patrick Palka  <ppalka@redhat.com>
419
420         PR c++/101247
421         * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
422         use common_enclosing_class and to not depend on the TREE_TYPE
423         of outer levels pointing to the corresponding primary template.
424
425 2021-07-01  Patrick Palka  <ppalka@redhat.com>
426
427         PR c++/101194
428         * constexpr.c (cxx_eval_array_reference): When the element type
429         is an empty type and the corresponding element is omitted, just
430         return an empty CONSTRUCTOR instead of attempting value
431         initialization.
432
433 2021-07-01  Patrick Palka  <ppalka@redhat.com>
434
435         PR c++/96204
436         * pt.c (finish_template_variable): Pass the partially
437         instantiated template and its args to instantiate_template.
438         (instantiate_class_template_1): No need to call
439         push_nested_class and pop_nested_class around the call to
440         most_specialized_partial_spec.
441         (instantiate_template_1): Pass the partially instantiated
442         template to lookup_template_variable.
443         (most_specialized_partial_spec):  Use push_access_scope_guard
444         to set the access scope appropriately.  Use
445         deferring_access_check_sentinel to force access to get checked
446         immediately.
447         (instantiate_decl): Just pass the VAR_DECL to
448         most_specialized_partial_spec.
449
450 2021-06-30  Patrick Palka  <ppalka@redhat.com>
451
452         * constraint.cc (get_normalized_constraints_from_decl): Use
453         push_access_scope_guard instead of push_nested_class_guard.
454         * cp-tree.h (struct push_nested_class_guard): Replace with ...
455         (struct push_access_scope_guard): ... this.
456         * pt.c (push_access_scope): When the argument corresponds to
457         a class type, push the class instead of its context.
458         (pop_access_scope): Adjust accordingly.
459
460 2021-06-30  Marek Polacek  <polacek@redhat.com>
461
462         PR c++/100975
463         DR 2397
464         * decl.c (create_array_type_for_decl): Allow array of auto.
465
466 2021-06-29  Jason Merrill  <jason@redhat.com>
467
468         * pt.c (instantiate_decl): Only consider partial specializations of
469         actual variable templates.
470
471 2021-06-26  Patrick Palka  <ppalka@redhat.com>
472
473         PR c++/96204
474         * pt.c (instantiate_class_template_1): Enter the scope of the
475         type when calling most_specialized_partial_spec.
476
477 2021-06-26  Jason Merrill  <jason@redhat.com>
478
479         PR c++/101040
480         PR c++/97566
481         * class.c (is_empty_field): Handle null argument.
482         * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
483         for empty field.
484
485 2021-06-26  Marek Polacek  <polacek@redhat.com>
486
487         PR c++/100752
488         * parser.c (cp_parser_declarator): Pass flags down to
489         cp_parser_declarator.  Also pass static_p/member_p.
490
491 2021-06-25  Martin Sebor  <msebor@redhat.com>
492
493         * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
494         with warning_suppressed_p, suppress_warning, and copy_no_warning, or
495         nothing if not necessary.
496         (set_up_extended_ref_temp): Same.
497         * class.c (layout_class_type): Same.
498         * constraint.cc (constraint_satisfaction_value): Same.
499         * coroutines.cc (finish_co_await_expr): Same.
500         (finish_co_yield_expr): Same.
501         (finish_co_return_stmt): Same.
502         (build_actor_fn): Same.
503         (coro_rewrite_function_body): Same.
504         (morph_fn_to_coro): Same.
505         * cp-gimplify.c (genericize_eh_spec_block): Same.
506         (gimplify_expr_stmt): Same.
507         (cp_genericize_r): Same.
508         (cp_fold): Same.
509         * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
510         * cvt.c (cp_fold_convert): Same.
511         (convert_to_void): Same.
512         * decl.c (wrapup_namespace_globals): Same.
513         (grokdeclarator): Same.
514         (finish_function): Same.
515         (require_deduced_type): Same.
516         * decl2.c (no_linkage_error): Same.
517         (c_parse_final_cleanups): Same.
518         * except.c (expand_end_catch_block): Same.
519         * init.c (build_new_1): Same.
520         (build_new): Same.
521         (build_vec_delete_1): Same.
522         (build_vec_init): Same.
523         (build_delete): Same.
524         * method.c (defaultable_fn_check): Same.
525         * parser.c (cp_parser_fold_expression): Same.
526         (cp_parser_primary_expression): Same.
527         * pt.c (push_tinst_level_loc): Same.
528         (tsubst_copy): Same.
529         (tsubst_omp_udr): Same.
530         (tsubst_copy_and_build): Same.
531         * rtti.c (build_if_nonnull): Same.
532         * semantics.c (maybe_convert_cond): Same.
533         (finish_return_stmt): Same.
534         (finish_parenthesized_expr): Same.
535         (cp_check_omp_declare_reduction): Same.
536         * tree.c (build_cplus_array_type): Same.
537         * typeck.c (build_ptrmemfunc_access_expr): Same.
538         (cp_build_indirect_ref_1): Same.
539         (cp_build_function_call_vec): Same.
540         (warn_for_null_address): Same.
541         (cp_build_binary_op): Same.
542         (unary_complex_lvalue): Same.
543         (cp_build_modify_expr): Same.
544         (build_x_modify_expr): Same.
545         (convert_for_assignment): Same.
546
547 2021-06-24  Patrick Palka  <ppalka@redhat.com>
548
549         PR c++/98832
550         * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
551
552 2021-06-24  Patrick Palka  <ppalka@redhat.com>
553
554         PR c++/101182
555         * constraint.cc (evaluate_requires_expr): Adjust function comment.
556         * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
557         (cp_fold) <case REQUIRES_EXPR>: ... here.
558
559 2021-06-24  Jakub Jelinek  <jakub@redhat.com>
560
561         * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
562         C_ORT_OMP for clauses on target construct.
563         (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
564         (cp_parser_omp_target): For non-combined target add
565         map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION.  Pass
566         C_ORT_OMP_TARGET to finish_omp_clauses.
567         * semantics.c (handle_omp_array_sections_1): Adjust ort handling
568         for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
569         never present on C_ORT_*DECLARE_SIMD.
570         (handle_omp_array_sections): Likewise.
571         (finish_omp_clauses): Likewise.  Handle OMP_CLAUSE_IN_REDUCTION
572         on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
573         corresponding map clauses.
574         * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
575         clauses on target construct.
576
577 2021-06-23  Patrick Palka  <ppalka@redhat.com>
578
579         PR c++/101174
580         * pt.c (push_access_scope): For artificial deduction guides,
581         set the access scope to that of the constructor.
582         (pop_access_scope): Likewise.
583         (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
584
585 2021-06-23  Patrick Palka  <ppalka@redhat.com>
586
587         PR c++/86439
588         * call.c (print_error_for_call_failure): Constify 'args' parameter.
589         (perform_dguide_overload_resolution): Define.
590         * cp-tree.h: (perform_dguide_overload_resolution): Declare.
591         * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
592         instead of build_new_function_call.  Don't use tf_decltype or
593         set cp_unevaluated_operand.  Remove unnecessary NULL_TREE tests.
594
595 2021-06-21  Patrick Palka  <ppalka@redhat.com>
596
597         PR c++/67302
598         * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
599         sooner, before the NRVO handling.
600
601 2021-06-21  Patrick Palka  <ppalka@redhat.com>
602
603         PR c++/80431
604         * tree.c (bot_replace): Use convert_to_base to build the
605         conversion to the (morally) virtual base.
606
607 2021-06-21  Jakub Jelinek  <jakub@redhat.com>
608
609         PR inline-asm/100785
610         * typeck.c (cxx_mark_addressable): Diagnose trying to make
611         bit-fields addressable.
612
613 2021-06-17  Jason Merrill  <jason@redhat.com>
614
615         PR c++/101106
616         * decl.c (duplicate_decls): Make 'deleted after first declaration'
617         pedwarn on by default.
618
619 2021-06-17  Jason Merrill  <jason@redhat.com>
620
621         PR c++/101029
622         * init.c (build_vec_init): Preserve the type of base.
623
624 2021-06-16  Jason Merrill  <jason@redhat.com>
625
626         PR c++/101078
627         PR c++/91706
628         * pt.c (tsubst_baselink): Update binfos in non-dependent case.
629
630 2021-06-15  Robin Dapp  <rdapp@linux.ibm.com>
631
632         * decl.c (duplicate_decls): Likewise.
633
634 2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
635
636         PR c/100913
637         * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
638         var in the error case.
639
640 2021-06-13  Trevor Saunders  <tbsaunde@tbsaunde.org>
641
642         * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
643         with range based for.
644         (cxx_eval_store_expression): Likewise.
645         (cxx_eval_loop_expr): Likewise.
646         * decl.c (wrapup_namespace_globals): Likewise.
647         (cp_finish_decl): Likewise.
648         (cxx_simulate_enum_decl): Likewise.
649         * parser.c (cp_parser_postfix_expression): Likewise.
650
651 2021-06-12  Jason Merrill  <jason@redhat.com>
652
653         PR c++/101029
654         * init.c (build_vec_init): Shortcut [0] case.
655
656 2021-06-12  Jason Merrill  <jason@redhat.com>
657
658         * pt.c (lookup_template_class_1): Shortcut current_class_type.
659
660 2021-06-11  Patrick Palka  <ppalka@redhat.com>
661
662         DR 1227
663         PR c++/96560
664         * pt.c (tsubst_arg_types): Rearrange so that we substitute into
665         TYPE_ARG_TYPES in forward order while short circuiting
666         appropriately.  Adjust formatting.
667
668 2021-06-11  Jakub Jelinek  <jakub@redhat.com>
669
670         PR c++/100974
671         * cp-tree.h (struct saved_scope): Add consteval_if_p
672         member.  Formatting fix for the discarded_stmt comment.
673         (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
674         * parser.c (cp_parser_lambda_expression): Temporarily disable
675         in_consteval_if_p when parsing lambda body.
676         (cp_parser_selection_statement): Parse consteval if.
677         * decl.c (struct named_label_entry): Add in_consteval_if member.
678         (level_for_consteval_if): New function.
679         (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
680         consteval if.
681         * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
682         why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
683         for !ctx->manifestly_const_eval.
684         (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
685         condition as if it was __builtin_is_constant_evaluated call.
686         (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
687         recurse on both branches.
688         * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
689         as the else branch.
690         * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
691         Temporarily set in_consteval_if_p when recursing on
692         IF_STMT_CONSTEVAL_P then branch.
693         (tsubst_lambda_expr): Temporarily disable
694         in_consteval_if_p when instantiating lambda body.
695         * call.c (immediate_invocation_p): Return false when
696         in_consteval_if_p.
697
698 2021-06-11  Marek Polacek  <polacek@redhat.com>
699
700         PR c++/100995
701         * constexpr.c (maybe_constexpr_fn): New.
702         * cp-tree.h (maybe_constexpr_fn): Declare.
703         * semantics.c (find_std_constant_evaluated_r): New.
704         (maybe_warn_for_constant_evaluated): New.
705         (finish_if_stmt_cond): Call it.
706
707 2021-06-10  Patrick Palka  <ppalka@redhat.com>
708
709         PR c++/67829
710         * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
711         the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
712         a template template parameter, adjust to the
713         TEMPLATE_TEMPLATE_PARAMETER before falling through.
714
715 2021-06-10  Patrick Palka  <ppalka@redhat.com>
716
717         PR c++/100946
718         * constraint.cc (normalize_placeholder_type_constraints): When
719         normalizing a non-templated return-type-requirement, add a dummy
720         level to initial_parms.
721
722 2021-06-08  Marek Polacek  <polacek@redhat.com>
723
724         PR c++/100065
725         * decl.c (grokdeclarator): Store a value-dependent
726         explicit-specifier even for deduction guides.
727
728 2021-06-08  Jason Merrill  <jason@redhat.com>
729
730         * parser.c (cp_parser_string_literal): Adjust diagnostic.
731
732 2021-06-08  Jason Merrill  <jason@redhat.com>
733
734         PR c++/100963
735         * call.c (perfect_conversion_p): Check check_narrowing.
736
737 2021-06-08  Jason Merrill  <jason@redhat.com>
738
739         PR c++/91706
740         * name-lookup.c (get_class_binding): Keep a BASELINK.
741         (set_inherited_value_binding_p): Adjust.
742         * lambda.c (is_lambda_ignored_entity): Adjust.
743         * pt.c (lookup_template_function): Copy a BASELINK before
744         modifying it.
745
746 2021-06-08  Jason Merrill  <jason@redhat.com>
747
748         PR c++/91706
749         * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
750
751 2021-06-08  Jason Merrill  <jason@redhat.com>
752
753         * module.cc (duplicate_hash::hash): Comment out.
754         (trees_in::tree_value): Adjust loop counter.
755
756 2021-06-08  Jason Merrill  <jason@redhat.com>
757
758         PR c++/100102
759         * init.c (build_offset_ref): Return the BASELINK for a static
760         member function.
761
762 2021-06-07  Patrick Palka  <ppalka@redhat.com>
763
764         PR c++/100918
765         * parser.c (cp_parser_lookup_name): Check access of the lookup
766         result before we potentially adjust an injected-class-name to
767         its TEMPLATE_DECL.
768
769 2021-06-06  Jakub Jelinek  <jakub@redhat.com>
770
771         PR c/100902
772         * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
773         even when target is combined with other constructs.
774
775 2021-06-04  Patrick Palka  <ppalka@redhat.com>
776
777         PR c++/100893
778         * pt.c (convert_template_argument): Strip top-level cv-quals
779         on the substituted type of a non-type template parameter.
780
781 2021-06-04  Patrick Palka  <ppalka@redhat.com>
782
783         PR c++/100102
784         * pt.c (tsubst_function_decl): Remove old code for reducing
785         args when it has excess levels.
786
787 2021-06-04  Jakub Jelinek  <jakub@redhat.com>
788
789         PR c++/100872
790         * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
791         ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
792         to the start.
793
794 2021-06-03  Patrick Palka  <ppalka@redhat.com>
795
796         PR c++/100592
797         * decl.c (make_typename_type): After calling
798         lookup_template_class, adjust the result to its TYPE_NAME and
799         then consider the tf_keep_type_decl flag.
800
801 2021-06-03  Patrick Palka  <ppalka@redhat.com>
802
803         PR c++/100862
804         * pt.c (set_current_access_from_decl): Move to ...
805         * class.c (set_current_access_from_decl): ... here.
806         (handle_using_decl): Use it to propagate the access of the
807         using-enum decl to the copy of the imported enumerator.
808         * cp-tree.h (set_current_access_from_decl): Declare.
809         * decl.c (build_enumerator): Simplify using make_temp_override
810         and set_current_access_from_decl.
811
812 2021-06-03  Jakub Jelinek  <jakub@redhat.com>
813
814         PR c++/100859
815         * semantics.c (handle_omp_array_sections_1): For
816         OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
817         finish_non_static_data_member and allow this as base.
818         (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
819         after depend only cases.  Let this be diagnosed by !lvalue_p
820         case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
821         assert.
822         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
823
824 2021-06-02  Jason Merrill  <jason@redhat.com>
825
826         PR c++/100838
827         * call.c (convert_like_internal): Clear tf_no_cleanup when
828         recursing.
829         (build_user_type_conversion_1): Only add ck_rvalue if
830         LOOKUP_ONLYCONVERTING.
831
832 2021-06-01  Patrick Palka  <ppalka@redhat.com>
833
834         PR c++/65816
835         * init.c (expand_aggr_init_1): Check
836         type_has_non_user_provided_default_constructor instead of
837         type_has_user_provided_constructor.
838
839 2021-06-01  Jason Merrill  <jason@redhat.com>
840
841         PR c++/91859
842         * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
843         for destroying delete.
844         * init.c (build_delete): Don't clobber before destroying delete.
845
846 2021-06-01  Jason Merrill  <jason@redhat.com>
847
848         PR c++/94492
849         * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
850
851 2021-05-31  Richard Biener  <rguenther@suse.de>
852
853         PR c++/88601
854         * cp-objcp-common.c (names_builtin_p): Handle
855         RID_BUILTIN_SHUFFLEVECTOR.
856         * cp-tree.h (build_x_shufflevector): Declare.
857         * parser.c (cp_parser_postfix_expression): Handle
858         RID_BUILTIN_SHUFFLEVECTOR.
859         * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
860         * typeck.c (build_x_shufflevector): Build either a lowered
861         VEC_PERM_EXPR or an unlowered shufflevector via a temporary
862         internal function IFN_SHUFFLEVECTOR.
863
864 2021-05-28  Jason Merrill  <jason@redhat.com>
865
866         * constexpr.c (build_data_member_initialization): Use tsi_range.
867         (build_constexpr_constructor_member_initializers): Likewise.
868         (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
869         (potential_constant_expression_1): Likewise.
870         * coroutines.cc (await_statement_expander): Likewise.
871         (await_statement_walker): Likewise.
872         * module.cc (trees_out::core_vals): Likewise.
873         * pt.c (tsubst_expr): Likewise.
874         * semantics.c (set_cleanup_locs): Likewise.
875
876 2021-05-28  Jason Merrill  <jason@redhat.com>
877
878         PR c++/100797
879         PR c++/95719
880         * call.c (build_over_call): Adjust base_binfo in
881         resolves_to_fixed_type_p case.
882
883 2021-05-28  Jakub Jelinek  <jakub@redhat.com>
884
885         PR middle-end/99928
886         * semantics.c (handle_omp_array_sections): Copy
887         OMP_CLAUSE_MAP_IMPLICIT.
888         (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
889         marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT.  Add
890         map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
891         maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
892         present too.  For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
893         if present in map_head, map_field_head or map_firstprivate_head
894         bitmaps.
895
896 2021-05-28  Tobias Burnus  <tobias@codesourcery.com>
897
898         * parser.c (cp_parser_omp_clause_affinity): New.
899         (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
900         cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
901         clause.
902         * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
903         finish_omp_clauses): Likewise.
904
905 2021-05-27  Matthias Kretz  <kretz@kde.org>
906
907         PR c++/100716
908         * error.c (dump_template_bindings): Include code to print
909         "[with" and ']', conditional on whether anything is printed at
910         all. This is tied to whether a semicolon is needed to separate
911         multiple template parameters. If the template argument repeats
912         the template parameter (T = T), then skip the parameter.
913         (dump_substitution): Moved code to print "[with" and ']' to
914         dump_template_bindings.
915         (dump_function_decl): Partial revert of PR50828, which masked
916         TFF_TEMPLATE_NAME for all of dump_function_decl. Now
917         TFF_TEMPLATE_NAME is masked for the scope of the function and
918         only carries through to dump_function_name.
919         (dump_function_name): Avoid calling dump_template_parms if
920         TFF_TEMPLATE_NAME is set.
921
922 2021-05-27  Matthias Kretz  <kretz@kde.org>
923
924         PR c++/100763
925         * error.c: Call dump_scope when printing a typedef.
926
927 2021-05-27  Patrick Palka  <ppalka@redhat.com>
928
929         PR c++/99893
930         * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
931
932 2021-05-27  Jason Merrill  <jason@redhat.com>
933
934         PR c++/86355
935         * pt.c (use_pack_expansion_extra_args_p): Don't compare
936         args from the same argument pack.
937
938 2021-05-27  Patrick Palka  <ppalka@redhat.com>
939
940         DR 1315
941         PR c++/67593
942         PR c++/96555
943         * pt.c (process_partial_specialization): Don't error on a
944         non-simple non-type template argument that involves template
945         parameters.
946         (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
947         MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
948
949 2021-05-26  Patrick Palka  <ppalka@redhat.com>
950
951         PR c++/100502
952         * typeck.c (finish_class_member_access_expr): Disable ahead
953         of time access checking during the member lookup.
954
955 2021-05-26  Patrick Palka  <ppalka@redhat.com>
956
957         PR c++/100368
958         * tree.c (build_target_expr_with_type): Don't call force_rvalue
959         on CALL_EXPR initializer.  Simplify now that bot_manip is no
960         longer a caller.
961         (bot_manip): Use force_target_expr instead of
962         build_target_expr_with_type.
963
964 2021-05-26  Patrick Palka  <ppalka@redhat.com>
965
966         PR c++/97420
967         * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
968         (fnptr_conv_p): Don't call non_reference.  Use INDIRECT_TYPE_P
969         instead of TYPE_PTR_P.
970         * pt.c (convert_nontype_argument_function): Look through
971         implicit INDIRECT_REFs before calling strip_fnptr_conv.
972
973 2021-05-25  Jakub Jelinek  <jakub@redhat.com>
974
975         PR c++/100666
976         * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
977         and side-effects, temporarily disable -Wunused-result warning when
978         building COMPOUND_EXPR.
979
980 2021-05-21  Jakub Jelinek  <jakub@redhat.com>
981
982         PR middle-end/99928
983         * semantics.c (finish_omp_clauses): Move firstprivate clauses with
984         OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain.  Don't error
985         if a decl is mentioned both in map clause and in such firstprivate
986         clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
987
988 2021-05-20  Jason Merrill  <jason@redhat.com>
989
990         * call.c (reference_binding): Check for designator.
991         (implicit_conversion_1, build_special_member_call): Likewise.
992         * decl.c (reshape_init_r): Likewise.
993         * pt.c (do_class_deduction): Likewise.
994         * typeck2.c (digest_init_r): Likewise.
995
996 2021-05-20  Jason Merrill  <jason@redhat.com>
997
998         PR c++/100489
999         * decl.c (reshape_init_class): Handle designator for
1000         member of anonymous aggregate here.
1001         * typeck2.c (process_init_constructor_record): Not here.
1002
1003 2021-05-20  Jonathan Wakely  <jwakely@redhat.com>
1004
1005         * call.c (maybe_warn_array_conv): Use new warning option.
1006         * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1007         * error.c (maybe_warn_cpp0x): Likewise.
1008         * parser.c (cp_parser_primary_expression)
1009         (cp_parser_unqualified_id)
1010         (cp_parser_pseudo_destructor_name)
1011         (cp_parser_lambda_introducer)
1012         (cp_parser_lambda_declarator_opt)
1013         (cp_parser_selection_statement)
1014         (cp_parser_init_statement)
1015         (cp_parser_decomposition_declaration)
1016         (cp_parser_function_specifier_opt)
1017         (cp_parser_static_assert)
1018         (cp_parser_namespace_definition)
1019         (cp_parser_using_declaration)
1020         (cp_parser_asm_definition)
1021         (cp_parser_ctor_initializer_opt_and_function_body)
1022         (cp_parser_initializer_list)
1023         (cp_parser_type_parameter_key)
1024         (cp_parser_member_declaration)
1025         (cp_parser_try_block)
1026         (cp_parser_std_attribute_spec): Likewise.
1027         * pt.c (check_template_variable): Likewise.
1028
1029 2021-05-20  Jason Merrill  <jason@redhat.com>
1030
1031         PR c++/100634
1032         * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1033
1034 2021-05-20  Jason Merrill  <jason@redhat.com>
1035
1036         PR c++/100659
1037         * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1038
1039 2021-05-19  Jason Merrill  <jason@redhat.com>
1040
1041         PR c++/100367
1042         PR c++/96299
1043         * method.c (genericize_spaceship): Use fold_build2 for scalar
1044         operands.
1045
1046 2021-05-19  Jason Merrill  <jason@redhat.com>
1047
1048         * pt.c (build_deduction_guide): Treat the implicit deduction guide
1049         as a member of the class.
1050
1051 2021-05-19  Marek Polacek  <polacek@redhat.com>
1052
1053         PR c++/100596
1054         * cp-tree.h (any_non_type_attribute_p): Remove.
1055         * decl.c (grokdeclarator): Turn an error into a warning and only
1056         warn for standard attributes.
1057         * decl2.c (any_non_type_attribute_p): Remove.
1058         * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1059         into a warning and only warn for standard attributes.
1060         (cp_parser_member_declaration): Likewise.
1061
1062 2021-05-19  Martin Liska  <mliska@suse.cz>
1063
1064         PR testsuite/100658
1065         * mangle.c (write_encoding): Fix typos.
1066
1067 2021-05-19  Jakub Jelinek  <jakub@redhat.com>
1068
1069         PR middle-end/99928
1070         * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1071         master when combined with taskloop.
1072         (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1073         parallel master when not combined with taskloop.
1074
1075 2021-05-19  Jason Merrill  <jason@redhat.com>
1076
1077         PR c++/100261
1078         * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1079
1080 2021-05-19  Jason Merrill  <jason@redhat.com>
1081
1082         PR c++/100372
1083         * tree.c (strip_typedefs): Only look at the pattern of a
1084         TYPE_PACK_EXPANSION if it's a type.
1085
1086 2021-05-18  Marek Polacek  <polacek@redhat.com>
1087
1088         * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1089         * constraint.cc (contains_wildcard_p): Likewise.
1090         (get_template_head_requirements): Likewise.
1091         (check_constrained_friend): Likewise.
1092         (subsumes_constraints): Likewise.
1093         * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1094         (push_void_library_fn): Likewise.
1095         (get_pattern_parm): Likewise.
1096         (get_template_parms_at_level): Likewise.
1097         (lambda_return_type): Likewise.
1098         (get_template_head_requirements): Likewise.
1099         (check_constrained_friend): Likewise.
1100         (subsumes_constraints): Likewise.
1101         * decl.c (push_void_library_fn): Likewise.
1102         * lambda.c (lambda_return_type): Likewise.
1103         * pt.c (get_template_parms_at_level): Likewise.
1104         (get_pattern_parm): Likewise.
1105
1106 2021-05-18  Jason Merrill  <jason@redhat.com>
1107
1108         PR c++/100644
1109         * call.c (perfect_candidate_p): An implicitly deleted move
1110         is not perfect.
1111
1112 2021-05-18  Andreas Krebbel  <krebbel@linux.ibm.com>
1113
1114         PR c++/100281
1115         * cvt.c (cp_convert_to_pointer): Use the size of the target
1116         pointer type.
1117         * tree.c (cp_build_reference_type): Call
1118         cp_build_reference_type_for_mode with VOIDmode.
1119         (cp_build_reference_type_for_mode): Rename from
1120         cp_build_reference_type.  Add MODE argument and invoke
1121         build_reference_type_for_mode.
1122         (strip_typedefs): Use build_pointer_type_for_mode and
1123         cp_build_reference_type_for_mode for pointers and references.
1124
1125 2021-05-17  Jonathan Wakely  <jwakely@redhat.com>
1126
1127         PR c++/100635
1128         * call.c (convert_like_internal): Print different diagnostic if
1129         the lvalue reference is const.
1130
1131 2021-05-14  Jason Merrill  <jason@redhat.com>
1132
1133         PR c++/95870
1134         * pt.c (enclosing_instantiation_of): Just compare
1135         DECL_SOURCE_LOCATION.
1136         (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1137
1138 2021-05-14  Marek Polacek  <polacek@redhat.com>
1139             Jason Merrill  <jason@redhat.com>
1140
1141         PR c++/99032
1142         * cp-tree.h (any_non_type_attribute_p): Declare.
1143         * decl.c (grokdeclarator): Diagnose when an attribute appertains to
1144         a friend declaration that is not a definition.
1145         * decl2.c (any_non_type_attribute_p): New.
1146         * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
1147         in the middle of decl-specifiers.
1148         (cp_parser_elaborated_type_specifier): Diagnose when an attribute
1149         appertains to a friend declaration that is not a definition.
1150         (cp_parser_member_declaration): Likewise.
1151
1152 2021-05-12  Marek Polacek  <polacek@redhat.com>
1153
1154         * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1155         sentinel.
1156
1157 2021-05-12  Marcel Vollweiler  <marcel@codesourcery.com>
1158
1159         * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1160         'close'.
1161
1162 2021-05-11  Jason Merrill  <jason@redhat.com>
1163
1164         PR c++/100517
1165         * typeck.c (build_reinterpret_cast_1): Check intype on
1166         cast to vector.
1167
1168 2021-05-11  Patrick Palka  <ppalka@redhat.com>
1169
1170         PR c++/51577
1171         * name-lookup.c (maybe_save_operator_binding): Unconditionally
1172         enable for all function templates, not just generic lambdas.
1173         Handle compound-assignment operator expressions.
1174         * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
1175         in the type-dependent case.
1176         (build_x_modify_expr): Likewise.  Move declaration of 'op' closer
1177         to its first use.
1178
1179 2021-05-11  Patrick Palka  <ppalka@redhat.com>
1180
1181         PR c++/100138
1182         * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1183         (satisfy_atom): Set up iloc_sentinel before calling
1184         cxx_constant_value.
1185         * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
1186         expansion, carry over PACK_EXPANSION_LOCAL_P and
1187         PACK_EXPANSION_SIZEOF_P from the original pack expansion.
1188
1189 2021-05-10  Richard Biener  <rguenther@suse.de>
1190
1191         PR middle-end/100464
1192         PR c++/100468
1193         * call.c (set_up_extended_ref_temp): Mark the temporary
1194         addressable if the TARGET_EXPR was.
1195
1196 2021-05-10  Martin Liska  <mliska@suse.cz>
1197
1198         * decl.c (duplicate_decls): Use startswith
1199         function instead of strncmp.
1200         (cxx_builtin_function): Likewise.
1201         (omp_declare_variant_finalize_one): Likewise.
1202         (grokfndecl): Likewise.
1203         * error.c (dump_decl_name): Likewise.
1204         * mangle.c (find_decomp_unqualified_name): Likewise.
1205         (write_guarded_var_name): Likewise.
1206         (decl_tls_wrapper_p): Likewise.
1207         * parser.c (cp_parser_simple_type_specifier): Likewise.
1208         (cp_parser_tx_qualifier_opt): Likewise.
1209         * pt.c (template_parm_object_p): Likewise.
1210         (dguide_name_p): Likewise.
1211
1212 2021-05-10  Martin Liska  <mliska@suse.cz>
1213
1214         PR c++/99616
1215         * decl.c (grokdeclarator): Remove redundant NULL check.
1216
1217 2021-05-07  Jason Merrill  <jason@redhat.com>
1218
1219         * tree.c (rvalue): Assert expr is not a class lvalue.
1220
1221 2021-05-07  Jason Merrill  <jason@redhat.com>
1222
1223         * cp-tree.h (build_stub_object): Declare.
1224         * method.c (build_stub_object): No longer static.
1225         * call.c (can_convert): Use it.
1226         * tree.c (build_dummy_object): Adjust comment.
1227         * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
1228         TARGET_EXPR.
1229
1230 2021-05-07  Jason Merrill  <jason@redhat.com>
1231
1232         * coroutines.cc (build_co_await): Don't call 'rvalue'.
1233         (flatten_await_stmt): Simplify initialization.
1234         (morph_fn_to_coro): Change 'rvalue' to 'move'.  Simplify.
1235
1236 2021-05-04  Tobias Burnus  <tobias@codesourcery.com>
1237
1238         * semantics.c (finish_omp_reduction_clause): Accept float + complex
1239         for || and && reductions.
1240
1241 2021-05-03  Patrick Palka  <ppalka@redhat.com>
1242
1243         PR c++/100362
1244         * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1245         and popclass when parsing the base-clause that were removed in
1246         r11-6815.
1247
1248 2021-05-03  Patrick Palka  <ppalka@redhat.com>
1249
1250         PR c++/68942
1251         PR c++/100344
1252         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1253         only when the callee is a FUNCTION_DECL.
1254
1255 2021-05-03  Marek Polacek  <polacek@redhat.com>
1256
1257         PR c++/100055
1258         * decl.c (grokfndecl): Check current_template_parms.
1259
1260 2021-05-03  Marek Polacek  <polacek@redhat.com>
1261
1262         DR 1312
1263         * constexpr.c (cxx_eval_constant_expression): Don't check
1264         integer_zerop.
1265
1266 2021-05-01  Jason Merrill  <jason@redhat.com>
1267
1268         * cp-tree.h (class ovl_iterator): Allow copying.  Add op==.
1269         (class ovl_range, class lkp_range): New.
1270         * call.c (build_op_call_1, add_candidates): Use them.
1271         (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
1272         (has_trivial_copy_p): Likewise.
1273         * class.c (handle_using_decl, get_basefndecls): Likewise.
1274         (maybe_warn_about_overly_private_class): Likewise.
1275         (warn_hidden, add_implicitly_declared_members): Likewise.
1276         (check_methods, clone_constructors_and_destructors): Likewise.
1277         (type_has_user_nondefault_constructor): Likewise.
1278
1279 2021-04-29  Jason Merrill  <jason@redhat.com>
1280
1281         * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
1282         don't find a field.
1283
1284 2021-04-29  Jason Merrill  <jason@redhat.com>
1285
1286         PR c++/51344
1287         * decl2.c (grokfield): Call cplus_decl_attributes for friend.
1288         (save_template_attributes): Use chainon.
1289         * friend.c (do_friend): Remove attrlist parm.
1290         * cp-tree.h (do_friend): Adjust.
1291         * class.c (add_implicitly_declared_members): Adjust.
1292         * decl.c (grokdeclarator): Adjust.
1293         * pt.c (apply_late_template_attributes): Optimize.
1294
1295 2021-04-29  Jason Merrill  <jason@redhat.com>
1296
1297         PR c++/97974
1298         * class.c (finish_struct_anon_r): Drop complain parm.
1299         Remove non-field diagnostic.
1300         (finish_struct_anon): Adjust.
1301         * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
1302
1303 2021-04-29  Jason Merrill  <jason@redhat.com>
1304
1305         * cp-tree.h (cp_evaluated): Add reset parm to constructor.
1306         * parser.c (cp_parser_constant_expression): Change
1307         allow_non_constant_p to int.  Use cp_evaluated.
1308         (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
1309         * semantics.c (finish_id_expression_1): Don't mess with
1310         cp_unevaluated_operand here.
1311
1312 2021-04-29  Jason Merrill  <jason@redhat.com>
1313
1314         * cp-tree.h: Clarify comments.
1315         * pt.c (get_template_parm_object): Add assert.
1316         * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
1317         * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
1318         * typeck2.c (store_init_value): Likewise.
1319
1320 2021-04-29  Patrick Palka  <ppalka@redhat.com>
1321
1322         PR c++/68942
1323         * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
1324         set tf_conv during the initial substitution into the function.
1325
1326 2021-04-29  Jakub Jelinek  <jakub@redhat.com>
1327
1328         PR c++/100319
1329         * semantics.c (finish_omp_clauses): Fix up check that variable
1330         mentioned in detach clause doesn't appear in data-sharing clauses.
1331
1332 2021-04-28  Jakub Jelinek  <jakub@redhat.com>
1333
1334         * module.cc: Remove #error that triggers if DEV-PHASE is empty.
1335
1336 2021-04-27  Jason Merrill  <jason@redhat.com>
1337
1338         PR c++/92145
1339         * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
1340         of operator=.
1341
1342 2021-04-27  Patrick Palka  <ppalka@redhat.com>
1343
1344         PR c++/88580
1345         * pt.c (tsubst_initializer_list): Correctly handle the case
1346         where an argument inside a base initializer pack expansion is
1347         itself a pack expansion.
1348
1349 2021-04-26  Patrick Palka  <ppalka@redhat.com>
1350
1351         PR c++/100209
1352         * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
1353         object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
1354         with a negative offset into one whose offset is nonnegative
1355         before calling cxx_fold_indirect_ref_1.
1356
1357 2021-04-24  Patrick Palka  <ppalka@redhat.com>
1358
1359         PR c++/89565
1360         PR c++/93383
1361         PR c++/95291
1362         PR c++/99200
1363         PR c++/99683
1364         * pt.c (do_class_deduction): Punt if the initializer is
1365         type-dependent.
1366
1367 2021-04-24  Patrick Palka  <ppalka@redhat.com>
1368
1369         PR c++/87709
1370         * parser.c (cp_parser_type_id_1): If we see a template
1371         placeholder, first try simulating an error before issuing
1372         a real error.
1373
1374 2021-04-23  Patrick Palka  <ppalka@redhat.com>
1375
1376         PR c++/98767
1377         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
1378         Adjust parameter list loop to iterate over 'types' instead of
1379         'args'.  Output the trailing '...' for a variadic function.
1380         Remove PARM_DECL support.
1381         (pp_cxx_requires_expr): Pretty print the parameter list directly
1382         instead of going through pp_cxx_parameter_declaration_clause.
1383
1384 2021-04-23  Patrick Palka  <ppalka@redhat.com>
1385
1386         DR 2374
1387         * decl.c (is_direct_enum_init): Check the implicit
1388         convertibility requirement added by CWG 2374.
1389
1390 2021-04-23  Martin Liska  <mliska@suse.cz>
1391
1392         * cp-tree.h (STATIC_ASSERT): Prefer static assert.
1393         * lex.c (init_operators): Remove run-time check.
1394
1395 2021-04-22  Marek Polacek  <polacek@redhat.com>
1396
1397         PR c++/100161
1398         * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
1399         op1 separately for value- or type-dependence.
1400
1401 2021-04-21  Marek Polacek  <polacek@redhat.com>
1402
1403         PR c++/96380
1404         * parser.c (cp_parser_enum_specifier): Don't allow defining
1405         types in enum-base.
1406
1407 2021-04-21  Martin Liska  <mliska@suse.cz>
1408
1409         Revert:
1410         2021-04-21  Martin Liska  <mliska@suse.cz>
1411
1412         * error.c (dump_decl): Use flags in dump_generic_node call.
1413
1414 2021-04-21  Martin Liska  <mliska@suse.cz>
1415
1416         * error.c (dump_decl): Use flags in dump_generic_node call.
1417
1418 2021-04-21  Martin Liska  <mliska@suse.cz>
1419
1420         * error.c (dump_decl): Support anonymous labels.
1421
1422 2021-04-20  Jason Merrill  <jason@redhat.com>
1423
1424         PR c++/100109
1425         * pt.c (find_parameter_packs_r): Look into enum initializers.
1426
1427 2021-04-19  Marek Polacek  <polacek@redhat.com>
1428
1429         PR c++/97536
1430         * decl.c (grokvardecl): Given an error when a concept is not defined
1431         at namespace scope.
1432
1433 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
1434
1435         PR c++/100111
1436         * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
1437         for empty classes into *valp when types don't match even when *valp
1438         is NULL.
1439
1440 2021-04-16  Marek Polacek  <polacek@redhat.com>
1441
1442         PR c++/99803
1443         * decl.c (make_typename_type): Give an error and return when
1444         name is is_overloaded_fn.
1445         * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
1446         before calling make_typename_type.
1447
1448 2021-04-16  Patrick Palka  <ppalka@redhat.com>
1449
1450         PR c++/99700
1451         * constexpr.c (reduced_constant_expression_p): For array
1452         CONSTRUCTORs, use a dedicated loop that additionally verifies
1453         the CONSTRUCTOR spans the entire array.
1454
1455 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
1456
1457         PR c++/99850
1458         * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
1459         If lambda_p, return pce_ok instead of pce_maybe_postfix.
1460
1461 2021-04-16  Jakub Jelinek  <jakub@redhat.com>
1462
1463         PR c++/99833
1464         * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
1465         binding, add to data.internal also all corresponding structured
1466         binding decls.
1467
1468 2021-04-16  Jason Merrill  <jason@redhat.com>
1469
1470         PR c++/100079
1471         * cp-tree.h (first_field): Declare.
1472         * mangle.c (range_expr_nelts): New.
1473         (write_expression): Improve class NTTP mangling.
1474         * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
1475         * tree.c (zero_init_expr_p): Improve class NTTP handling.
1476         * decl.c: Adjust comment.
1477
1478 2021-04-15  Jason Merrill  <jason@redhat.com>
1479
1480         PR c++/80456
1481         * call.c (build_new_method_call_1): Check again for side-effects
1482         with a volatile object.
1483
1484 2021-04-15  Jason Merrill  <jason@redhat.com>
1485
1486         PR c++/100101
1487         PR c++/99583
1488         * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
1489         TYPE_RAISES_EXCEPTIONS here.
1490         * tree.c (cp_walk_subtrees): Not here.
1491
1492 2021-04-15  Jason Merrill  <jason@redhat.com>
1493
1494         PR c++/100091
1495         PR c++/99478
1496         * parser.c (cp_parser_default_type_template_argument): Set
1497         parser->local_variables_forbidden_p.
1498
1499 2021-04-15  Richard Sandiford  <richard.sandiford@arm.com>
1500
1501         PR c++/98852
1502         * typeck.c (merge_type_attributes_from): New function.
1503         (cp_common_type): Use it for vector types.
1504
1505 2021-04-14  Jason Merrill  <jason@redhat.com>
1506
1507         PR c++/100078
1508         PR c++/93085
1509         * pt.c (uses_outer_template_parms): Also look at default
1510         template argument.
1511
1512 2021-04-14  Jason Merrill  <jason@redhat.com>
1513
1514         PR c++/93314
1515         * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
1516         for a non-static data member in a constant-expression.
1517
1518 2021-04-14  Patrick Palka  <ppalka@redhat.com>
1519
1520         PR c++/83476
1521         PR c++/99885
1522         * pt.c (deducible_expression): Look through implicit
1523         INDIRECT_REFs as well.
1524
1525 2021-04-14  Jason Merrill  <jason@redhat.com>
1526
1527         PR c++/99478
1528         * parser.c (cp_parser_lambda_expression): Reject lambda
1529         in template parameter type.
1530
1531 2021-04-14  Jason Merrill  <jason@redhat.com>
1532
1533         PR c++/90674
1534         * decl.c (duplicate_decls): Don't propagate
1535         DECL_INITIALIZED_IN_CLASS_P to a specialization.
1536
1537 2021-04-14  Jason Merrill  <jason@redhat.com>
1538
1539         PR c++/88742
1540         PR c++/49951
1541         PR c++/58123
1542         * semantics.c (set_cleanup_locs): New.
1543         (do_poplevel): Call it.
1544         * parser.c (cp_parser_compound_statement): Consume the }
1545         before finish_compound_stmt.
1546
1547 2021-04-13  Jason Merrill  <jason@redhat.com>
1548
1549         PR c++/100032
1550         * pt.c (get_underlying_template): Compare TYPE_QUALS.
1551
1552 2021-04-13  Jason Merrill  <jason@redhat.com>
1553
1554         PR c++/100054
1555         PR c++/90479
1556         * init.c (get_nsdmi): Do more context adjustment for local classes.
1557
1558 2021-04-13  Patrick Palka  <ppalka@redhat.com>
1559
1560         PR c++/99008
1561         * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
1562         rather than issuing a pedwarn.
1563         * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
1564         for consistent diagnostics.
1565
1566 2021-04-13  Jason Merrill  <jason@redhat.com>
1567
1568         PR c++/91933
1569         * class.c (build_base_path): Shortcut simple non-pointer case.
1570
1571 2021-04-13  Eric Botcazou  <ebotcazou@adacore.com>
1572
1573         * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
1574         of the linemap.
1575         (module_state::write_location): Likewise.
1576
1577 2021-04-13  Patrick Palka  <ppalka@redhat.com>
1578
1579         PR c++/97134
1580         * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
1581         when checking if the initializer is an equivalent class
1582         placeholder template parameter.
1583
1584 2021-04-13  Patrick Palka  <ppalka@redhat.com>
1585
1586         PR c++/99961
1587         PR c++/99994
1588         * constraint.cc (satisfy_normalized_constraints): Set
1589         cp_unevaluated.
1590         * parser.c (cp_parser_concept_definition): Likewise.
1591         (cp_parser_requires_clause_opt): Likewise.
1592
1593 2021-04-12  Jason Merrill  <jason@redhat.com>
1594
1595         PR c++/93085
1596         * pt.c (uses_outer_template_parms): Handle non-type and template
1597         template parameters specifically.
1598
1599 2021-04-11  Jason Merrill  <jason@redhat.com>
1600
1601         PR c++/97974
1602         * decl.c (fixup_anonymous_aggr): Prune all functions from
1603         CLASSTYPE_MEMBER_VEC.
1604
1605 2021-04-10  Jason Merrill  <jason@redhat.com>
1606
1607         PR c++/98800
1608         PR c++/97399
1609         * parser.c (cp_parser_direct_declarator): Don't
1610         inject_this_parameter if static_p.
1611         (cp_parser_omp_var_list_no_open): Parse 'this' even if
1612         current_class_ptr isn't set for a better diagnostic.
1613
1614 2021-04-10  Jason Merrill  <jason@redhat.com>
1615
1616         PR c++/99180
1617         PR c++/93295
1618         PR c++/93867
1619         PR c++/99118
1620         PR c++/96873
1621         * pt.c (alias_ctad_tweaks): Handle failure better.
1622
1623 2021-04-10  Jason Merrill  <jason@redhat.com>
1624
1625         PR c++/100006
1626         * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
1627
1628 2021-04-09  Patrick Palka  <ppalka@redhat.com>
1629
1630         * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
1631         (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
1632         (LAMBDA_EXPR_REGEN_INFO): ... this.
1633         (tree_lambda_expr::regenerated_from)
1634         (tree_lambda_expr::regenerating_targs): Replace these with ...
1635         (tree_lambda_expr::regen_info): ... this.
1636         * constraint.cc (satisfy_declaration_constraints): Adjust
1637         accordingly.
1638         * lambda.c (build_lambda_expr): Likewise.
1639         * pt.c (regenerated_lambda_fn_p): Likewise.
1640         (most_general_lambda): Likewise.
1641         (tsubst_lambda_expr): Likewise.
1642
1643 2021-04-09  Marek Polacek  <polacek@redhat.com>
1644
1645         PR c++/99806
1646         * parser.c (cp_parser_member_declaration): Call
1647         cp_parser_save_default_args even for function templates.  Use
1648         STRIP_TEMPLATE on the declaration we're passing.
1649
1650 2021-04-08  Patrick Palka  <ppalka@redhat.com>
1651
1652         PR c++/99874
1653         * constraint.cc (get_normalized_constraints_from_decl): Handle
1654         regenerated lambdas.
1655         (satisfy_declaration_constraints): Likewise.  Check for
1656         dependent args later.
1657         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
1658         (LAMBDA_EXPR_REGENERATED_FROM): ... this.
1659         (LAMBDA_EXPR_REGENERATING_TARGS): New.
1660         (tree_lambda_expr::regenerated_from): New data member.
1661         (tree_lambda_expr::regenerating_targs): New data member.
1662         (add_to_template_args): Declare.
1663         (regenerated_lambda_fn_p): Likewise.
1664         (most_general_lambda): Likewise.
1665         * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
1666         and LAMBDA_EXPR_REGENERATING_TARGS.
1667         * pt.c (add_to_template_args): No longer static.
1668         (tsubst_function_decl): Unconditionally propagate constraints on
1669         the substituted function decl.
1670         (instantiated_lambda_fn_p): Rename to ...
1671         (regenerated_lambda_fn_p): ... this.  Check
1672         LAMBDA_EXPR_REGENERATED_FROM instead of
1673         LAMBDA_EXPR_INSTANTIATED.
1674         (most_general_lambda): Define.
1675         (enclosing_instantiation_of): Adjust after renaming
1676         instantiated_lambda_fn_p.
1677         (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED.  Set
1678         LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
1679         Don't substitute or set constraints on the regenerated lambda.
1680
1681 2021-04-08  Patrick Palka  <ppalka@redhat.com>
1682
1683         PR c++/97679
1684         * pt.c (build_deduction_guide): Document OUTER_ARGS.  Substitute
1685         them into the propagated constraints.
1686
1687 2021-04-08  Jason Merrill  <jason@redhat.com>
1688
1689         PR c++/91849
1690         * call.c (convert_like_internal): Improve reference diagnostic.
1691
1692 2021-04-08  Jakub Jelinek  <jakub@redhat.com>
1693
1694         PR c++/99859
1695         * constexpr.c (addr_of_non_const_var): New function.
1696         (cxx_bind_parameters_in_call): Set *non_constant_args to true
1697         even if cp_walk_tree on arg with addr_of_non_const_var callback
1698         returns true.
1699
1700 2021-04-08  Jason Merrill  <jason@redhat.com>
1701
1702         PR c++/94529
1703         * pt.c (determine_specialization): Improve diagnostic.
1704
1705 2021-04-08  Marek Polacek  <polacek@redhat.com>
1706
1707         PR c++/99844
1708         * decl.c (build_explicit_specifier): Call
1709         check_for_bare_parameter_packs.
1710         * except.c (build_noexcept_spec): Likewise.
1711
1712 2021-04-07  Jason Merrill  <jason@redhat.com>
1713
1714         PR c++/41723
1715         * parser.c (cp_parser_class_name): Check dependent_scope_p.
1716
1717 2021-04-07  Jason Merrill  <jason@redhat.com>
1718
1719         PR c++/52625
1720         * pt.c (maybe_process_partial_specialization): Check
1721         DECL_SELF_REFERENCE_P.
1722
1723 2021-04-07  Jason Merrill  <jason@redhat.com>
1724
1725         PR c++/92918
1726         * name-lookup.c (push_class_level_binding_1): Do overload a new
1727         function with a previous using-declaration.
1728
1729 2021-04-06  Jason Merrill  <jason@redhat.com>
1730
1731         PR c++/96673
1732         * init.c (get_nsdmi): Don't defer access checking.
1733
1734 2021-04-06  Jason Merrill  <jason@redhat.com>
1735
1736         PR c++/99901
1737         * decl.c (cp_finish_decl): mark_needed an implicitly inline
1738         static data member with an out-of-class redeclaration.
1739
1740 2021-04-06  Jason Merrill  <jason@redhat.com>
1741
1742         PR c++/91241
1743         * mangle.c (write_compact_number): Add sanity check.
1744         (write_local_name): Use list_length for parm number.
1745
1746 2021-04-06  Patrick Palka  <ppalka@redhat.com>
1747
1748         PR c++/99899
1749         * pt.c (do_auto_deduction): Don't exit early when deducing the
1750         array type of a structured binding.  Also handle adc_decomp_type
1751         during constraint checking.
1752
1753 2021-04-05  Jason Merrill  <jason@redhat.com>
1754
1755         PR c++/96311
1756         * typeck.c (check_return_expr): Call mark_exp_read in dependent
1757         case.
1758
1759 2021-04-05  Jason Merrill  <jason@redhat.com>
1760
1761         PR c++/98440
1762         * typeck.c (build_reinterpret_cast_1): Don't perform
1763         temporary materialization.
1764
1765 2021-04-05  Jason Merrill  <jason@redhat.com>
1766
1767         PR c++/95317
1768         * pt.c (lookup_template_class_1): Do tsubst_enum when
1769         tsubsting a generic lambda.
1770
1771 2021-04-05  Jason Merrill  <jason@redhat.com>
1772
1773         PR c++/95870
1774         * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
1775         there is no enclosing non-lambda function.
1776
1777 2021-04-05  Nathan Sidwell  <nathan@acm.org>
1778
1779         PR c++/99380
1780         * module.cc (name_pending_imports): Drop 'atend' parm.  Don't
1781         query export when not needed.
1782         (preprocess_module, preprocessed_module): Adjust.
1783
1784 2021-04-05  Jason Merrill  <jason@redhat.com>
1785
1786         PR c++/99066
1787         * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
1788
1789 2021-04-05  Jason Merrill  <jason@redhat.com>
1790
1791         PR c++/99201
1792         * pt.c (class el_data): Add visited field.
1793         (extract_local_specs): Pass it to cp_walk_tree.
1794         (extract_locals_r): Walk into the body of a lambda.
1795
1796 2021-04-05  Jason Merrill  <jason@redhat.com>
1797
1798         * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
1799         template result.
1800
1801 2021-04-04  Jason Merrill  <jason@redhat.com>
1802
1803         PR c++/99643
1804         * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
1805
1806 2021-04-03  Marek Polacek  <polacek@redhat.com>
1807
1808         PR c++/91416
1809         * parser.c: Create a GC root for attributes in a decl specifier.
1810         (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
1811
1812 2021-04-03  Jason Merrill  <jason@redhat.com>
1813
1814         PR c++/91217
1815         * pt.c (tsubst_lambda_expr): Skip the body block from
1816         DECL_SAVED_TREE.
1817
1818 2021-04-03  Jason Merrill  <jason@redhat.com>
1819
1820         PR c++/90664
1821         * cvt.c (can_convert_qual): Check fnptr_conv_p.
1822
1823 2021-04-03  Jason Merrill  <jason@redhat.com>
1824
1825         PR c++/97900
1826         * pt.c (regenerate_decl_from_template): tsubst_decl
1827         the parms.
1828
1829 2021-04-02  Patrick Palka  <ppalka@redhat.com>
1830
1831         PR c++/99869
1832         * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
1833         to do_auto_deduction.
1834
1835 2021-04-02  Patrick Palka  <ppalka@redhat.com>
1836
1837         PR c++/99586
1838         * semantics.c (finish_compound_literal): Check
1839         template_placeholder_p instead of type_uses_auto.
1840
1841 2021-04-02  Jason Merrill  <jason@redhat.com>
1842
1843         PR c++/97938
1844         * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
1845         * lambda.c (add_capture): Set it.
1846         * pt.c (tsubst_pack_expansion): Handle it.
1847
1848 2021-04-02  Nathan Sidwell  <nathan@acm.org>
1849
1850         * cp-tree.h (lang_decl_base): Correct module flag comment.
1851         * module.cc (trees_in::assert_definition): Break out
1852         not_tmpl var.
1853         (trees_out::lang_decl_bools): Do not write purview for header units.
1854
1855 2021-04-01  Marek Polacek  <polacek@redhat.com>
1856
1857         PR c++/99831
1858         * method.c (defaulted_late_check): ++ and -- function_depth around
1859         the call to synthesize_method.
1860         * pt.c: Remove the saved_trees global.
1861
1862 2021-04-01  Jason Merrill  <jason@redhat.com>
1863
1864         PR c++/99583
1865         PR c++/99584
1866         * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
1867         TYPE_RAISES_EXCEPTIONS.
1868
1869 2021-04-01  Iain Sandoe  <iain@sandoe.co.uk>
1870
1871         * mapper-client.cc (INCLUDE_MAP): New; require map to be
1872         included from system.h.
1873         * mapper-resolver.cc (INCLUDE_MAP): Likewise.
1874
1875 2021-04-01  Jason Merrill  <jason@redhat.com>
1876
1877         PR c++/98481
1878         * mangle.c (write_expression): Adjust.
1879         * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
1880         (mark_abi_tags_r): Likewise.
1881
1882 2021-04-01  Nathan Sidwell  <nathan@acm.org>
1883
1884         PR c++/99283
1885         * module.cc (trees_out::decl_node): Adjust importedness reference
1886         assert.
1887         (module_state::intercluster_seed): New.  Seed both imports and
1888         inter-cluster references.  Broken out of ...
1889         (module_state::write_cluster): ... here.  Call it.
1890
1891 2021-03-31  Jason Merrill  <jason@redhat.com>
1892
1893         PR c++/99445
1894         * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
1895
1896 2021-03-31  Patrick Palka  <ppalka@redhat.com>
1897
1898         PR c++/88115
1899         * mangle.c (write_expression): Adjust the mangling of
1900         __alignof__.
1901
1902 2021-03-31  Patrick Palka  <ppalka@redhat.com>
1903
1904         PR c++/99815
1905         * pt.c (placeholder_type_constraint_dependent_p): Expand
1906         argument packs to separate the first non-pack argument
1907         from the rest.
1908
1909 2021-03-30  Nathan Sidwell  <nathan@acm.org>
1910
1911         PR c++/99283
1912         * module.cc (dumper::operator): Make less brittle.
1913         (trees_out::core_bools): VAR_DECLs always have a context.
1914         (trees_out::key_mergeable): Use same_type_p for asserting.
1915         (trees_in::read_var_def): Propagate
1916         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1917
1918 2021-03-30  Jakub Jelinek  <jakub@redhat.com>
1919
1920         PR c++/99790
1921         * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
1922
1923 2021-03-26  Marek Polacek  <polacek@redhat.com>
1924
1925         PR c++/98352
1926         * method.c (implicitly_declare_fn): Pass &raises to
1927         synthesized_method_walk.
1928
1929 2021-03-26  Nathan Sidwell  <nathan@acm.org>
1930
1931         PR c++/99283
1932         * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
1933         (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
1934         * decl.c (duplicate_decls): Remove template_decl module flag
1935         propagation.
1936         * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
1937         (dumper::impl::nested_name): Adjust for template-decl module flag
1938         change.
1939         (trees_in::assert_definition): Likewise.
1940         (trees_in::install_entity): Likewise.
1941         (trees_out::decl_value): Likewise.  Remove alias template
1942         separation of template and type_decl.
1943         (trees_in::decl_value): Likewise.
1944         (trees_out::key_mergeable): Likewise,
1945         (trees_in::key_mergeable): Likewise.
1946         (trees_out::decl_node): Adjust for template-decl module flag
1947         change.
1948         (depset::hash::make_dependency): Likewise.
1949         (get_originating_module, module_may_redeclare): Likewise.
1950         (set_instantiating_module, set_defining_module): Likewise.
1951         * name-lookup.c (name_lookup::search_adl): Likewise.
1952         (do_pushdecl): Likewise.
1953         * pt.c (build_template_decl): Likewise.
1954         (lookup_template_class_1): Remove special alias_template handling
1955         of DECL_TI_TEMPLATE.
1956         (tsubst_template_decl): Likewise.
1957
1958 2021-03-26  Jakub Jelinek  <jakub@redhat.com>
1959
1960         PR c++/99705
1961         * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
1962         in DECL_EXPR or in BIND_EXPR_VARS.
1963
1964 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
1965
1966         PR c++/99672
1967         * parser.c (cp_parser_postfix_expression): For calls, create
1968         combined_loc and temporarily set input_location to it before
1969         calling finish_call_expr.
1970
1971 2021-03-25  Marek Polacek  <polacek@redhat.com>
1972
1973         PR c++/94751
1974         * call.c (build_over_call): Maybe call mark_used in case
1975         deduce_inheriting_ctor fails and return error_mark_node.
1976         * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
1977         * method.c (deduce_inheriting_ctor): Return bool if the deduction
1978         fails.
1979         (implicitly_declare_fn): If raises is error_mark_node, call
1980         synthesized_method_walk with diag being true.
1981
1982 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
1983
1984         PR c++/99745
1985         * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
1986         packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
1987
1988 2021-03-25  Marek Polacek  <polacek@redhat.com>
1989
1990         PR c++/99331
1991         * call.c (build_converted_constant_expr_internal): Don't emit
1992         -Wconversion warnings.
1993
1994 2021-03-25  Jakub Jelinek  <jakub@redhat.com>
1995
1996         PR c++/99565
1997         * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
1998         to operand_equal_p.
1999         * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2000         or COMPOUND_EXPR.
2001
2002 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2003
2004         PR c++/99283
2005         * name-lookup.c (check_module_override): Set global or partition
2006         DUP on the binding vector.
2007
2008 2021-03-23  Marek Polacek  <polacek@redhat.com>
2009
2010         PR c++/99318
2011         * decl2.c (cp_warn_deprecated_use_scopes): Only call
2012         cp_warn_deprecated_use when decl is a namespace, class, or enum.
2013
2014 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2015
2016         PR c++/99239
2017         * decl.c (duplicate_decls): Remove assert about maybe-imported
2018         artificial decls.
2019
2020 2021-03-23  Jakub Jelinek  <jakub@redhat.com>
2021
2022         PR c++/99650
2023         * decl.c (cp_finish_decomp): Diagnose void initializers when
2024         using tuple_element and get.
2025
2026 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2027
2028         PR c++/99480
2029         * module.cc (depset::hash::make_dependency): Propagate flags for
2030         partial specialization.
2031         (module_may_redeclare): Handle partial specialization.
2032
2033 2021-03-22  Nathan Sidwell  <nathan@acm.org>
2034
2035         PR c++/99425
2036         * cp-tree.h (map_context_from, map_context_to): Delete.
2037         (add_mergeable_specialization): Add is_alias parm.
2038         * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2039         * module.cc (map_context_from, map_context_to): Delete.
2040         (trees_in::decl_value): Add specializations later, adjust call.
2041         Drop useless alias lookup. Set duplicate fn parm context.
2042         (check_mergeable_decl): Drop context mapping.
2043         (trees_in::is_matching_decl): Likewise.
2044         (trees_in::read_function_def): Drop parameter context adjustment
2045         here.
2046
2047 2021-03-22  Martin Liska  <mliska@suse.cz>
2048
2049         PR c++/99687
2050         * module.cc (fini_modules): Call vec_free instead of delete.
2051
2052 2021-03-20  Jakub Jelinek  <jakub@redhat.com>
2053
2054         PR debug/99230
2055         * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2056         special code, instead call c_genericize_control_stmt.
2057
2058 2021-03-19  Jakub Jelinek  <jakub@redhat.com>
2059
2060         PR c++/99456
2061         * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2062         INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2063         don't diagnose it, set *non_constant_p nor return t.
2064
2065 2021-03-19  Marek Polacek  <polacek@redhat.com>
2066
2067         PR c++/99500
2068         * parser.c (cp_parser_requirement_parameter_list): Handle
2069         error_mark_node.
2070
2071 2021-03-18  Marek Polacek  <polacek@redhat.com>
2072
2073         * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2074
2075 2021-03-18  Marek Polacek  <polacek@redhat.com>
2076
2077         * pt.c (tsubst_copy_and_build): Add assert.
2078
2079 2021-03-18  Iain Sandoe  <iain@sandoe.co.uk>
2080
2081         PR objc++/49070
2082         * parser.c (cp_debug_parser): Add Objective-C++ message
2083         state flag.
2084         (cp_parser_nested_name_specifier_opt): Allow colon to
2085         terminate an assignment-expression when parsing Objective-
2086         C++ messages.
2087         (cp_parser_objc_message_expression): Set and clear message
2088         parsing state on entry and exit.
2089         * parser.h (struct cp_parser): Add a context flag for
2090         Objective-C++ message state.
2091
2092 2021-03-18  Martin Liska  <mliska@suse.cz>
2093
2094         PR c++/99617
2095         * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2096         to NULL.
2097
2098 2021-03-17  Marek Polacek  <polacek@redhat.com>
2099
2100         PR c++/97973
2101         * call.c (conv_unsafe_in_template_p): New.
2102         (convert_like): Use it.
2103
2104 2021-03-17  Anthony Sharp  <anthonysharp15@gmail.com>
2105             Jason Merrill  <jason@redhat.com>
2106
2107         * semantics.c (get_class_access_diagnostic_decl): New
2108         function that examines special cases when a parent
2109         class causes a private access failure.
2110         (enforce_access): Slightly modified to call function
2111         above.
2112
2113 2021-03-16  Jason Merrill  <jason@redhat.com>
2114
2115         * tree.c (cp_tree_equal): Use real_identical.
2116
2117 2021-03-16  Jakub Jelinek  <jakub@redhat.com>
2118
2119         PR c++/99613
2120         * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2121         before calling __cxa_guard_release rather than after it.  Formatting
2122         fixes.
2123
2124 2021-03-16  Martin Liska  <mliska@suse.cz>
2125             Jason Merrill  <jason@redhat.com>
2126
2127         PR c++/99108
2128         * call.c (get_function_version_dispatcher): Handle
2129         DECL_LOCAL_DECL_P.
2130         * decl.c (maybe_version_functions): Likewise.
2131         (maybe_mark_function_versioned): New.
2132         * name-lookup.c (push_local_extern_decl_alias): No longer static.
2133         * name-lookup.h (push_local_extern_decl_alias): Adjust.
2134
2135 2021-03-16  Nathan Sidwell  <nathan@acm.org>
2136
2137         PR c++/99496
2138         * module.cc (trees_out::decl_value): Adjust typedef streaming,
2139         indicate whether it is a dependent alias.
2140         (trees_in::decl_value): Likewise.  Set as dependent alias, if it
2141         is one.
2142
2143 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2144
2145         PR c++/99047
2146         * coroutines.cc (expand_one_await_expression): If the
2147         await_ready() expression is not a boolean then convert it
2148         as required.
2149
2150 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2151
2152         PR c++/98704
2153         * coroutines.cc (build_actor_fn): Make destroy index 1
2154         correspond to the abnormal unhandled_exception() exit.
2155         Substitute the proxy for the resume index.
2156         (coro_rewrite_function_body): Arrange to reset the resume
2157         index and make done = true for a rethrown exception from
2158         unhandled_exception ().
2159         (morph_fn_to_coro): Adjust calls to build_actor_fn and
2160         coro_rewrite_function_body.
2161
2162 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2163
2164         PR c++/98480
2165         * coroutines.cc (replace_continue): Rewrite continue into
2166         'goto label'.
2167         (await_statement_walker): Handle await expressions in the
2168         initializer, condition and iteration expressions of for
2169         loops.
2170
2171 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
2172
2173         PR c++/96749
2174         * coroutines.cc (flatten_await_stmt): Allow for the case
2175         where a target expression variable only has uses in the
2176         second part of a compound expression.
2177         (maybe_promote_temps): Avoid emiting empty statements.
2178
2179 2021-03-15  Tobias Burnus  <tobias@codesourcery.com>
2180
2181         PR c++/99509
2182         * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2183         ensure that the varpool node is marked as offloadable.
2184
2185 2021-03-12  Nathan Sidwell  <nathan@acm.org>
2186
2187         PR c++/99238
2188         * module.cc (depset::hash::add_binding_entity): Assert not
2189         visited.
2190         (depset::add::add_specializations): Likewise.
2191         * name-lookup.c (name_lookup::dedup): New.
2192         (name_lookup::~name_lookup): Assert not deduping.
2193         (name_lookup::restore_state): Likewise.
2194         (name_lookup::add_overload): Replace outlined code with dedup
2195         call.
2196         (name_lookup::add_value): Likewise.
2197         (name_lookup::search_namespace_only): Likewise.
2198         (name_lookup::adl_namespace_fns): Likewise.
2199         (name_lookup::adl_class_fns): Likewise.
2200         (name_lookup::search_adl): Likewise.  Add clearing dedup call.
2201         (name_lookup::search_qualified): Likewise.
2202         (name_lookup::search_unqualified): Likewise.
2203
2204 2021-03-12  Jakub Jelinek  <jakub@redhat.com>
2205
2206         PR c++/99507
2207         * call.c (build_over_call): For immediate evaluation of functions
2208         that return references, undo convert_from_reference effects before
2209         calling cxx_constant_value and call convert_from_reference
2210         afterwards.
2211
2212 2021-03-11  Nathan Sidwell  <nathan@acm.org>
2213
2214         PR c++/99248
2215         * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
2216         when there's a binding vector.
2217         * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
2218
2219 2021-03-11  Nathan Sidwell  <nathan@acm.org>
2220
2221         PR c++/99528
2222         * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2223         MK_decl_tmpl_spec.
2224         (trees_in::decl_value): Adjust add_mergeable_specialization call.
2225         (trees_out::get_merge_kind): Adjust detecting a partial template
2226         instantiation.
2227         (trees_out::key_mergeable): Adjust handling same.
2228         (trees_in::key_mergeabvle): Likewise.
2229
2230 2021-03-10  Nathan Sidwell  <nathan@acm.org>
2231
2232         PR c++/99423
2233         * module.cc (post_load_processing): Assert not gcable.
2234         (laxy_load_pendings): Extend no-gc region around
2235         post_load_processing.
2236
2237 2021-03-10  Nathan Sidwell  <nathan@acm.org>
2238
2239         PR c++/99508
2240         * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2241         assembler name to the ns alias.
2242
2243 2021-03-09  Jakub Jelinek  <jakub@redhat.com>
2244
2245         PR c++/99459
2246         * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2247         build_special_member_call return value to find the CALL_EXPR.
2248         Simplify.
2249
2250 2021-03-09  Nathan Sidwell  <nathan@acm.org>
2251
2252         PR c++/99472
2253         * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2254         that C++20 does not yet imply modules.
2255
2256 2021-03-08  Nathan Sidwell  <nathan@acm.org>
2257
2258         PR c++/99436
2259         * name-lookup.c (get_cxx_dialect_name): Add cxx23.
2260
2261 2021-03-08  Nathan Sidwell  <nathan@acm.org>
2262
2263         * lex.c (module_token_filter::resume): Ignore module-decls inside
2264         header-unit.
2265         * parser.c (cp_parser_module_declaration): Reject in header-unit.
2266
2267 2021-03-08  Nathan Sidwell  <nathan@acm.org>
2268
2269         PR c++/99285
2270         * cp-tree.h (match_mergeable_specialization)
2271         (add_mergeable_specialization): Adjust parms.
2272         * module.cc (trees_in::decl_value): Adjust
2273         add_mergeable_specialization calls.
2274         (trees_out::key_mergeable): Adjust match_mergeable_specialization
2275         calls.
2276         (specialization_add): Likewise.
2277         * pt.c (match_mergeable_specialization): Do not insert.
2278         (add_mergeable_specialization): Add to hash table here.
2279
2280 2021-03-06  Patrick Palka  <ppalka@redhat.com>
2281             Jakub Jelinek  <jakub@redhat.com>
2282
2283         PR c++/99287
2284         * constexpr.c (cxx_eval_increment_expression): Pass lval when
2285         evaluating the MODIFY_EXPR, and update 'mod' with the result of
2286         this evaluation.  Check *non_constant_p afterwards.  For prefix
2287         ops, just return 'mod'.
2288
2289 2021-03-06  Patrick Palka  <ppalka@redhat.com>
2290             Jakub Jelinek  <jakub@redhat.com>
2291
2292         PR c++/96330
2293         * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
2294         variable 'fn' to 'tmpl'.  Handle a variable template-id by
2295         calling lookup_template_variable.
2296
2297 2021-03-06  Patrick Palka  <ppalka@redhat.com>
2298
2299         PR c++/99365
2300         * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
2301         outer_targs to do_auto_deduction.
2302         (placeholder_type_constraint_dependent_p): Define.
2303         (do_auto_deduction): When processing_template_decl != 0
2304         and context is adc_unify and we have constraints, pretend the
2305         constraints are satisfied instead of punting.  Otherwise don't
2306         punt unless placeholder_type_constraint_dependent_p holds.
2307         Add some clarifying sanity checks.  Add a hack to add missing
2308         outermost template levels to outer_args before checking
2309         satisfaction.  Don't substitute outer_targs into type if it's
2310         already been done.
2311
2312 2021-03-05  Marek Polacek  <polacek@redhat.com>
2313
2314         PR c++/99374
2315         * call.c (standard_conversion): When converting pointers to
2316         member, don't return NULL when the bases are equivalent but
2317         incomplete.
2318
2319 2021-03-05  Marek Polacek  <polacek@redhat.com>
2320
2321         PR c++/99120
2322         * name-lookup.c (check_local_shadow): Check if the type of decl
2323         is non-null before checking TYPE_PTR*.
2324
2325 2021-03-05  Nathan Sidwell  <nathan@acm.org>
2326
2327         PR c++/99245
2328         * module.cc (module_state::write_cluster): Relax binding assert.
2329
2330 2021-03-05  Nathan Sidwell  <nathan@acm.org>
2331
2332         PR c++/99377
2333         * pt.c (instantiate_decl): Call set_instantiating_module.
2334
2335 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
2336
2337         PR c++/98118
2338         * coroutines.cc (build_co_await): Use type_build_ctor_call()
2339         to determine cases when a CTOR needs to be built.
2340         (flatten_await_stmt): Likewise.
2341         (morph_fn_to_coro): Likewise.
2342
2343 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
2344
2345         PR c++/95616
2346         * coroutines.cc (coro_diagnose_throwing_fn): New helper.
2347         (coro_diagnose_throwing_final_aw_expr): New helper.
2348         (build_co_await): Diagnose throwing final await expression
2349         components.
2350         (build_init_or_final_await): Diagnose a throwing promise
2351         final_suspend() call.
2352
2353 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
2354
2355         PR c++/95615
2356         * coroutines.cc (struct param_info): Track parameter copies that need
2357         a DTOR.
2358         (coro_get_frame_dtor): New helper function factored from build_actor().
2359         (build_actor_fn): Use coro_get_frame_dtor().
2360         (morph_fn_to_coro): Track parameters that need DTORs on exception,
2361         likewise the frame promise and the return object.  On exception, run the
2362         DTORs for these, destroy the frame and then rethrow the exception.
2363
2364 2021-03-05  Nathan Sidwell  <nathan@acm.org>
2365
2366         PR c++/99389
2367         * pt.c (instantiate_class_template_1): Set instantiating module
2368         here.
2369
2370 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
2371
2372         PR c/99137
2373         * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
2374
2375 2021-03-04  Jakub Jelinek  <jakub@redhat.com>
2376
2377         PR c++/88146
2378         PR c++/99362
2379         * cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
2380         comment.
2381
2382 2021-03-04  Nathan Sidwell  <nathan@acm.org>
2383
2384         PR c++/99170
2385         * module.cc (class uintset): Delete.
2386         (typedef attached_map_t): A hash map.
2387         (attached_table): Use attached_map_t.  Adjust uses ...
2388         (trees_out::decl_value, trees_in::decl_value): ... here ...
2389         (trees_out::key_mergeable): ... here ...
2390         (trees_in::key_mergeable): ... here ...
2391         (maybe_attach_decl): ... here ...
2392         (direct_import): ... and here.
2393
2394 2021-03-04  Nathan Sidwell  <nathan@acm.org>
2395
2396         PR c++/99170
2397         * cp-tree.h
2398         * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
2399         rename.
2400         * module.cc (class pending_key): New.
2401         (default_hash_traits<pending_key>): New specialization.
2402         (pending_map_t): New typedef.
2403         (pending_table): Replace old table.
2404         (trees_out::lang_decl_bools): Adjust.
2405         (trees_in::lang_decl_bools): Adjust.
2406         (trees_in::install_entity): Drop pending member and specialization
2407         handling.
2408         (find_pending_key): New.
2409         (depset::hash::fiund_dependencies): Use it.
2410         (pendset_lazy_load): Delete.
2411         (module_state::write_cluster): Don't count pendings here.  Bye
2412         Duff's device-like thing.
2413         (module_state::write_pendings): Reimplement.
2414         (module_state::read_pendings): Reimplement.
2415         (lazy_specializations_p): Delete.
2416         (module_state::write): Adjust write_pendings call.
2417         (lazy_load_pendings): New.
2418         (lazy_load_specializations): Delete.
2419         (lazy_load_members): Delete.
2420         (init_modules): Adjust.
2421         * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
2422         not lazy_load_members.
2423         (note_pending_specializations): Delete.
2424         (load_pending_specializations): Delete.
2425         * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
2426         (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
2427         (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
2428         (note_pending_specializations): Delete.
2429         (load_pending_specializations): Delete.
2430         * pt.c (lookup_template_class_1): Call lazy_load_pendings not
2431         lazy_load_specializations.
2432         (instantiate_template_class_1): Likewise.
2433         (instantiate_decl): Call lazy_load_pendings.
2434         * typeck.c (complete_type): Likewise.
2435
2436 2021-03-03  Nathan Sidwell  <nathan@acm.org>
2437
2438         PR c++/99170
2439         * module.cc (post_load_decls): New.
2440         (lazy_snum, recursive_lazy): Move earlier.
2441         (module_state::read_cluster): Push cloning onto post_load_decls.
2442         (post_load_processing): New.  Do the cloning here.
2443         (module_state::read_inits): Call post_load_processing.
2444         (module_state::read_language): Likewise.
2445         (lazy_load_binding, lazy_load_specializations): Likewise
2446         (lazy_load_members): Likewise
2447
2448 2021-03-03  Nathan Sidwell  <nathan@acm.org>
2449
2450         PR c++/99170
2451         * module.cc (trees_out::decl_value): Stream specialization keys
2452         after decl.
2453         (trees_in::decl_value): Stream them back and insert after
2454         completing the decl.
2455         (trees_out::key_mergeable): Drop some streaming here ...
2456         (trees_in::key_mergeable): ... and here.  Don't insert into
2457         specialization tables.
2458
2459 2021-03-03  Patrick Palka  <ppalka@redhat.com>
2460
2461         * constraint.cc (struct sat_info): Document the different
2462         meanings of noisy() and diagnose_unsatisfaction_p() during
2463         satisfaction and requires-expression evaluation.
2464         (tsubst_valid_expression_requirement): Take a sat_info instead
2465         of a subst_info.  Perform the substitution quietly first.  Fold
2466         in error-replaying code from diagnose_valid_expression.
2467         (tsubst_simple_requirement): Take a sat_info instead of a
2468         subst_info.
2469         (tsubst_type_requirement_1): New.  Fold in error-replaying code
2470         from diagnose_valid_type.
2471         (tsubst_type_requirement): Use the above.  Take a sat_info
2472         instead of a subst_info.
2473         (tsubst_compound_requirement): Likewise.  Fold in
2474         error-replaying code from diagnose_compound_requirement.
2475         (tsubst_nested_requirement): Take a sat_info instead of a
2476         subst_info.  Fold in error-replaying code from
2477         diagnose_nested_requirement.
2478         (tsubst_requirement): Take a sat_info instead of a subst_info.
2479         (tsubst_requires_expr): Split into two versions, one that takes
2480         a sat_info argument and another that takes a complain and
2481         in_decl argument.  Remove outdated documentation.  Document the
2482         effects of the sat_info argument.  Don't short-circuit
2483         processing of requirements when diagnosing unsatisfaction,
2484         mirroring diagnose_requires_expr.
2485         (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
2486         assert, and se the three-parameter version of tsubst_requires_expr.
2487         (diagnose_trait_expr): Make static.  Take a template argument
2488         vector instead of a parameter mapping.
2489         (diagnose_valid_expression): Remove.
2490         (diagnose_valid_type): Remove.
2491         (diagnose_simple_requirement): Remove.
2492         (diagnose_compound_requirement): Remove.
2493         (diagnose_type_requirement): Remove.
2494         (diagnose_nested_requirement): Remove.
2495         (diagnose_requirement): Remove.
2496         (diagnose_requires_expr): Remove.
2497         (diagnose_atomic_constraint): Take a sat_info instead of a
2498         subst_info.  Adjust call to diagnose_trait_expr.  Call
2499         tsubst_requires_expr instead of diagnose_requires_expr.
2500         (diagnose_constraints): Remove special casing of REQUIRES_EXPR
2501         and just always call constraint_satisfaction_value.
2502
2503 2021-03-03  Patrick Palka  <ppalka@redhat.com>
2504
2505         * constexpr.c (cxx_eval_call_expression): Adjust call to
2506         evaluate_concept_check.
2507         (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
2508         evaluate_requires_expression instead of
2509         satisfy_constraint_expression.
2510         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2511         * constraint.cc (struct sat_info): Adjust comment about which
2512         satisfaction entrypoints use noisy-unsat.
2513         (normalize_template_requirements): Remove (and adjust callers
2514         appropriately).
2515         (normalize_nontemplate_requirements): Likewise.
2516         (tsubst_nested_requirement): Use constraint_satisfaction_value
2517         instead of satisfy_constraint_expression, which'll do the
2518         noisy replaying of ill-formed quiet satisfaction for us.
2519         (decl_satisfied_cache): Adjust comment.
2520         (satisfy_constraint): Rename to ...
2521         (satisfy_normalized_constraints): ... this.
2522         (satisfy_associated_constraints): Remove (and make its
2523         callers check for dependent arguments).
2524         (satisfy_constraint_expression): Rename to ...
2525         (satisfy_nondeclaration_constraints): ... this.  Assert that
2526         'args' is empty when 't' is a concept-id.  Removing handling
2527         bare constraint-expressions, and handle REQUIRES_EXPRs
2528         specially.  Adjust comment accordingly.
2529         (satisfy_declaration_constraints): Assert in the two-parameter
2530         version that 't' is not a TEMPLATE_DECL.  Adjust following
2531         removal of normalize_(non)?template_requirements and
2532         satisfy_asociated_constraints.
2533         (constraint_satisfaction_value): Combine the two- and
2534         three-parameter versions in the natural way.
2535         (constraints_satisfied_p): Combine the one- and two-parameter
2536         versions in the natural way.  Improve documentation.
2537         (evaluate_requires_expr): Define.
2538         (evaluate_concept_check): Remove 'complain' parameter.  Use
2539         constraint_satisfaction_value instead of
2540         satisfy_constraint_expression.
2541         (diagnose_nested_requirement): Adjust following renaming of
2542         satisfy_constraint_expression.
2543         (diagnose_constraints): Handle REQUIRES_EXPR by going through
2544         diagnose_requires_expr directly instead of treating it as a
2545         constraint-expression.  Improve documentation.
2546         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
2547         to evaluate_concept_check.
2548         <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
2549         constraints_satisfied_p.
2550         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2551         * cp-tree.h (evaluate_requires_expr): Declare.
2552         (evaluate_concept_check): Remove tsubst_flag_t parameter.
2553         (satisfy_constraint_expression): Remove declaration.
2554         (constraints_satisfied_p): Remove one-parameter declaration.
2555         Add a default argument to the two-parameter declaration.
2556         * cvt.c (convert_to_void): Adjust call to
2557         evaluate_concept_check.
2558
2559 2021-03-03  Jakub Jelinek  <jakub@redhat.com>
2560
2561         PR c++/82959
2562         * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
2563         and COMPOUND_EXPR.
2564
2565 2021-03-03  Marek Polacek  <polacek@redhat.com>
2566
2567         PR c++/97034
2568         PR c++/99009
2569         * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
2570         (maybe_aggr_guide): Use the original template type where needed.  In
2571         a class member template, partially instantiate the result of
2572         collect_ctor_idx_types.
2573         (do_class_deduction): Defer the deduction until the enclosing
2574         scope is non-dependent.
2575
2576 2021-03-03  Jason Merrill  <jason@redhat.com>
2577
2578         PR c++/95675
2579         * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
2580         if it didn't get one before.
2581
2582 2021-03-03  Nathan Sidwell  <nathan@acm.org>
2583
2584         PR c++/99344
2585         * module.cc (trees_out::decl_node): Small refactor.
2586         (depset::hash::add_binding_entity): Return true on meeting an
2587         import.  Set namespace's import here.
2588         (module_state:write_namespaces): Inform of purview too.
2589         (module_state:read_namespaces): Adjust.
2590         * name-lookup.c (implicitly_export_namespace): Delete.
2591         (do_pushdecl): Don't call it.
2592         (push_namespace): Likewise, set purview.
2593         (add_imported_namespace): Reorder parms.
2594         * name-lookup.h (add_imported_namespace): Alter param ordering.
2595
2596 2021-03-02  Martin Sebor  <msebor@redhat.com>
2597
2598         PR c++/99251
2599         * class.c (build_base_path): Call build_if_nonnull.
2600         * cp-tree.h (build_if_nonnull): Declare.
2601         * rtti.c (ifnonnull): Rename...
2602         (build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
2603         (build_dynamic_cast_1): Adjust to name change.
2604
2605 2021-03-02  Patrick Palka  <ppalka@redhat.com>
2606
2607         PR c++/96443
2608         PR c++/96960
2609         * constraint.cc (type_deducible_p): Don't substitute into the
2610         constraints, and instead just pass 'args' to do_auto_deduction
2611         as the outer template arguments.
2612         (tsubst_parameter_mapping): Remove confused code for handling
2613         placeholder type arguments.
2614         (normalize_placeholder_type_constraint): Define.
2615         (satisfy_constraint_expression): Use it to handle placeholder
2616         'auto' types.
2617         * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
2618         (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
2619         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
2620         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
2621         (make_constrained_placeholder_type): Set
2622         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
2623         (do_auto_deduction): Clarify comments about the outer_targs
2624         parameter.  Rework satisfaction of a placeholder type constraint
2625         to pass in the complete set of template arguments directly to
2626         constraints_satisfied_p.
2627         (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
2628         instead.  Also rebuild the the constraint info on the new auto.
2629
2630 2021-03-02  Patrick Palka  <ppalka@redhat.com>
2631
2632         * constraint.cc (build_parameter_mapping): Rely on the caller to
2633         determine the in-scope template parameters.
2634         (norm_info::norm_info): Delegate the tsubst_flags_t constructor
2635         to the two-parameter constructor.  In the two-parameter
2636         constructor, fold in the definition of make_context, set
2637         initial_parms appropriately, and don't set the now-removed
2638         orig_decl member.
2639         (norm_info::make_context): Remove, now that its only use is
2640         inlined into the caller.
2641         (norm_info::update_context): Adjust call to
2642         build_parameter_mapping to pass in the relevant set of in-scope
2643         template parameters.
2644         (norm_info::ctx_parms): Define this member function.
2645         (norm_info::context): Initialize to NULL_TREE.
2646         (norm_info::orig_decl): Remove this data member.
2647         (norm_info::initial_parms): Define this data member.
2648         (normalize_atom): Adjust call to build_parameter_mapping to pass
2649         in the relevant set of in-scope template parameters.  Use
2650         info.initial_parms instead of info.orig_decl.
2651         (normalize_constraint_expression): Take a norm_info object
2652         instead of a bool.  Cache the result of normalization.
2653         (tsubst_nested_requirement): Call satisfy_constraint_expression
2654         instead of satisfy_constraint, so that we normalize on demand.
2655         (satisfy_constraint_expression): Handle a NESTED_REQ argument.
2656         Adjust call to normalize_constraint_expression.
2657         (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
2658         to current_template_parms.
2659         (diagnose_nested_requirements): Go through
2660         satisfy_constraint_expression, as with tsubst_nested_requirement.
2661
2662 2021-03-02  Patrick Palka  <ppalka@redhat.com>
2663
2664         * constraint.cc (tsubst_parameter_mapping): Canonicalize the
2665         arguments of a substituted TYPE_ARGUMENT_PACK even if we've
2666         started with a TYPE_ARGUMENT_PACK.
2667         (finish_requires_expr): Don't set DECL_CONTEXT and
2668         CONSTRAINT_VAR_P on each of the introduced parameters here.
2669         * parser.c (cp_parser_requirement_parameter_list): Instead set
2670         these fields earlier, here.
2671         * pt.c (do_auto_deduction): Canonicalize the result of
2672         do_auto_deduction.  Pass 'complain' to finish_decltype_type.
2673
2674 2021-03-02  Patrick Palka  <ppalka@redhat.com>
2675
2676         * constraint.cc (tsubst_simple_requirement): Just return
2677         boolean_true_node on success.
2678         (tsubst_type_requirement): Likewise.
2679         (tsubst_compound_requirement): Likewise.
2680         (tsubst_nested_requirement): Likewise.
2681         (tsubst_requirement_body): Remove.
2682         (check_constaint_variables): Rename to ...
2683         (check_constraint_variables): ... this.
2684         (tsubst_constraint_variables): Adjust.
2685         (tsubst_requires_expr): Fold tsubst_requirement_body into here.
2686
2687 2021-03-01  Nathan Sidwell  <nathan@acm.org>
2688
2689         PR c++/99294
2690         * class.c (fixup_type_variants): Propagate mode, precision,
2691         alignment & emptiness.
2692         * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
2693         (trees_in::tree_node): Rematerialize alignment here.
2694
2695 2021-02-27  Jason Merrill  <jason@redhat.com>
2696
2697         PR c++/90333
2698         * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
2699         between () and ->.
2700
2701 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
2702
2703         * parser.c (cp_parser_lambda_declarator_opt): Implement
2704         P1102R2 - Down with ()! Make ()s optional before lambda specifiers
2705         for -std={c,gnu}++2b or with pedwarn in earlier versions.
2706
2707 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
2708
2709         PR c++/95451
2710         * lambda.c (is_lambda_ignored_entity): Before checking for
2711         LAMBDA_FUNCTION_P, use OVL_FIRST.  Drop FUNCTION_DECL check.
2712
2713 2021-02-26  Jason Merrill  <jason@redhat.com>
2714
2715         PR c++/98810
2716         * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
2717         to a class non-type template argument that needs it.
2718
2719 2021-02-26  Patrick Palka  <ppalka@redhat.com>
2720
2721         PR c++/98990
2722         * pt.c (splice_late_return_type): Rebuild the entire return type
2723         if we have to adjust the level of an auto within.
2724         (type_uses_auto): Adjust call to find_type_usage.
2725         * type-utils.h (find_type_usage): Revert r10-6571 change that
2726         made this function return a pointer to the auto node.
2727
2728 2021-02-25  Patrick Palka  <ppalka@redhat.com>
2729
2730         PR c++/99213
2731         PR c++/94521
2732         * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
2733         TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
2734
2735 2021-02-25  Patrick Palka  <ppalka@redhat.com>
2736
2737         PR c++/99103
2738         * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
2739         (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
2740
2741 2021-02-25  Marek Polacek  <polacek@redhat.com>
2742
2743         DR 1312
2744         PR c++/99176
2745         * constexpr.c (is_std_construct_at): New overload.
2746         (is_std_allocator_allocate): New overload.
2747         (cxx_eval_call_expression): Use the new overloads.
2748         (cxx_eval_constant_expression): Reject casting
2749         from void * as per DR 1312.  Don't check can_convert.
2750
2751 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
2752
2753         PR c++/97587
2754         * coroutines.cc (struct param_info): Track rvalue refs.
2755         (morph_fn_to_coro): Track rvalue refs, and call the promise
2756         CTOR with the frame copy of passed parms.
2757
2758 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
2759
2760         PR c++/95822
2761         * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
2762         set throwing_cleanup marker.
2763
2764 2021-02-25  Nathan Sidwell  <nathan@acm.org>
2765
2766         PR c++/99166
2767         * module.cc (module_state::inform_cmi_p): Renamed field.
2768         (module_state::do_import): Adjust.
2769         (init_modules, finish_module_processing): Likewise.
2770         (handle_module_option): Likewise.
2771
2772 2021-02-25  Nathan Sidwell  <nathan@acm.org>
2773
2774         PR c++/98318
2775         * mapper-client.cc (module_client::open_module_client): Fix typo
2776         of fd init.
2777
2778 2021-02-24  Nathan Sidwell  <nathan@acm.org>
2779
2780         PR c++/98718
2781         * module.cc (ool): New indirection vector.
2782         (loc_spans::maybe_propagate): Location is not optional.
2783         (loc_spans::open): Likewise.  Assert monotonically advancing.
2784         (module_for_ordinary_loc): Use ool indirection vector.
2785         (module_state::write_prepare_maps): Do not count empty macro
2786         expansions.  Elide empty spans.
2787         (module_state::write_macro_maps): Skip empty expansions.
2788         (ool_cmp): New qsort comparator.
2789         (module_state::write): Create and destroy ool vector.
2790         (name_pending_imports): Fix dump push/pop.
2791         (preprocess_module): Likewise.  Add more dumping.
2792         (preprocessed_module): Likewise.
2793
2794 2021-02-24  Iain Sandoe  <iain@sandoe.co.uk>
2795
2796         PR c++/96251
2797         * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
2798         error reporting when instantiating for a constexpr.
2799
2800 2021-02-23  Nathan Sidwell  <nathan@acm.org>
2801
2802         PR c++/99208
2803         * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
2804         identity.
2805
2806 2021-02-23  Patrick Palka  <ppalka@redhat.com>
2807
2808         PR c++/95468
2809         * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
2810         over from tsubst_copy.
2811
2812 2021-02-23  Patrick Palka  <ppalka@redhat.com>
2813
2814         * pt.c (instantiation_dependent_expression_p): Check
2815         processing_template_decl before calling
2816         potential_constant_expression.
2817
2818 2021-02-22  Nathan Sidwell  <nathan@acm.org>
2819
2820         PR c++/99174
2821         * module.cc (struct module_state): Add visited_p flag.
2822         (name_pending_imports): Use it to avoid duplicate requests.
2823         (preprocess_module): Don't read preprocessor state if we failed to
2824         load a module's config.
2825
2826 2021-02-22  Nathan Sidwell  <nathan@acm.org>
2827
2828         PR c++/99153
2829         * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
2830         to common-path.
2831         * module.cc (set_defining_module): Add assert.
2832
2833 2021-02-19  Nathan Sidwell  <nathan@acm.org>
2834
2835         PR c++/98741
2836         * module.cc (pending_imports): New.
2837         (declare_module): Adjust test condition.
2838         (name_pending_imports): New.
2839         (preprocess_module): Reimplement using pending_imports.
2840         (preprocessed_module): Move name-getting to name_pending_imports.
2841         * name-lookup.c (append_imported_binding_slot): Assert module
2842         ordering is increasing.
2843
2844 2021-02-19  Nathan Sidwell  <nathan@acm.org>
2845
2846         * module.cc (note_cmis): New.
2847         (struct module_state): Add inform_read_p bit.
2848         (module_state::do_import): Inform of CMI location, if enabled.
2849         (init_modules): Canonicalize note_cmis entries.
2850         (handle_module_option): Handle -flang-info-module-read=FOO.
2851
2852 2021-02-19  Jason Merrill  <jason@redhat.com>
2853
2854         PR c++/96926
2855         * call.c (perfect_conversion_p): Limit rvalueness
2856         test to reference bindings.
2857
2858 2021-02-19  Jason Merrill  <jason@redhat.com>
2859
2860         PR c++/96926
2861         * call.c (perfect_conversion_p): New.
2862         (perfect_candidate_p): New.
2863         (add_candidates): Ignore templates after a perfect non-template.
2864
2865 2021-02-18  Nathan Sidwell  <nathan@acm.org>
2866
2867         PR c++/99023
2868         * module.cc (canonicalize_header_name): Use
2869         cpp_probe_header_unit.
2870         (maybe_translate_include): Fix note_includes comparison.
2871         (init_modules): Fix note_includes string termination.
2872
2873 2021-02-18  Jakub Jelinek  <jakub@redhat.com>
2874
2875         PR c++/99132
2876         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
2877         cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
2878         for immediate function calls.
2879
2880 2021-02-17  Nathan Sidwell  <nathan@acm.org>
2881
2882         PR c++/99023
2883         * module.cc (struct macro_export): Add GTY markers.
2884         (macro_exports): Likewise, us a va_gc Vector.
2885
2886 2021-02-17  Jakub Jelinek  <jakub@redhat.com>
2887
2888         PR sanitizer/99106
2889         * init.c (build_zero_init_1): For flexible array members just return
2890         NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
2891         ARRAY_TYPE.
2892
2893 2021-02-17  Nathan Sidwell  <nathan@acm.org>
2894
2895         PR c++/99116
2896         * name-lookup.c (do_pushdecl): Don't peek under template_parm
2897         bindings here ...
2898         (set_identifier_type_value_with_scope): ... or here.
2899         (do_pushtag): Only set_identifier_type_value_with_scope at
2900         non-class template parm scope, and use parent scope.
2901
2902 2021-02-17  Nathan Sidwell  <nathan@acm.org>
2903
2904         PR c++/99071
2905         * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
2906         pointer.
2907
2908 2021-02-17  Patrick Palka  <ppalka@redhat.com>
2909
2910         PR debug/96997
2911         PR c++/94034
2912         * tree.c (build_aggr_init_expr): Revert r10-7718 change.
2913
2914 2021-02-12  Nathan Sidwell  <nathan@acm.org>
2915
2916         * module.cc (module_state::write_cluster): Check bindings for
2917         imported using-decls.
2918
2919 2021-02-12  Nathan Sidwell  <nathan@acm.org>
2920
2921         PR c++/99040
2922         * module.cc (trees_in::decl_value): Call add_module_namespace_decl
2923         for new namespace-scope entities.
2924         (module_state::read_cluster): Don't call add_module_decl here.
2925         * name-lookup.h (add_module_decl): Rename to ...
2926         (add_module_namespace_decl): ... this.
2927         * name-lookup.c (newbinding_bookkeeping): Move into ...
2928         (do_pushdecl): ... here.  Its only remaining caller.
2929         (add_module_decl): Rename to ...
2930         (add_module_namespace_decl): ... here.  Add checking-assert for
2931         circularity. Don't call newbinding_bookkeeping, just extern_c
2932         checking and incomplete var checking.
2933
2934 2021-02-12  Nathan Sidwell  <nathan@acm.org>
2935
2936         PR c++/99039
2937         PR c++/99040
2938         * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
2939         (global_type_node): Delete.
2940         (IDENTIFIER_TYPE_VALUE): Delete.
2941         (IDENTIFIER_HAS_TYPE_VALUE): Delete.
2942         (get_type_value): Delete.
2943         * name-lookup.h (identifier_type_value): Delete.
2944         * name-lookup.c (check_module_override): Don't
2945         SET_IDENTIFIER_TYPE_VALUE here.
2946         (do_pushdecl): Nor here.
2947         (identifier_type_value_1, identifier_type_value): Delete.
2948         (set_identifier_type_value_with_scope): Only
2949         SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
2950         (pushdecl_nanmespace_level): Remove shadow stack nadgering.
2951         (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
2952         * call.c (check_dtor_name): Use lookup_name.
2953         * decl.c (cxx_init_decl_processing): Drop global_type_node.
2954         * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
2955         here.
2956         * init.c (get_type_value): Delete.
2957         * pt.c (instantiate_class_template_1): Don't call pushtag or
2958         SET_IDENTIFIER_TYPE_VALUE here.
2959         (tsubst): Assert never an identifier.
2960         (dependent_type_p): Drop global_type_node assert.
2961         * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
2962         to determine ctorness.
2963
2964 2021-02-12  Jakub Jelinek  <jakub@redhat.com>
2965
2966         PR c++/97742
2967         * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
2968         CPP_EOF.
2969
2970 2021-02-12  Jason Merrill  <jason@redhat.com>
2971
2972         PR c++/97246
2973         PR c++/94546
2974         * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
2975         (register_parameter_specializations): Not here.
2976
2977 2021-02-11  Marek Polacek  <polacek@redhat.com>
2978
2979         PR c++/95888
2980         * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
2981         for the partial instantiation.
2982
2983 2021-02-11  Jakub Jelinek  <jakub@redhat.com>
2984
2985         PR c++/99033
2986         * init.c (build_zero_init_1): Handle zero initialiation of
2987         flexible array members like initialization of [0] arrays.
2988         Use integer_minus_onep instead of comparison to integer_minus_one_node
2989         and integer_zerop instead of comparison against size_zero_node.
2990         Formatting fixes.
2991
2992 2021-02-11  Marek Polacek  <polacek@redhat.com>
2993
2994         PR c++/99063
2995         * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
2996
2997 2021-02-11  Patrick Palka  <ppalka@redhat.com>
2998
2999         PR c++/97582
3000         * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3001         lookup result by discarding it if the first element is a
3002         class-scope declaration, otherwise return it.
3003         (push_operator_bindings): Handle an ambiguous lookup result by
3004         doing push_local_binding on each element in the list.
3005
3006 2021-02-11  Marek Polacek  <polacek@redhat.com>
3007
3008         * parser.c (cp_parser_selection_statement): Use vec_free.
3009
3010 2021-02-10  Jakub Jelinek  <jakub@redhat.com>
3011
3012         PR c++/98988
3013         PR c++/99031
3014         * constexpr.c: Include cgraph.h.
3015         (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3016         heap artificial vars.
3017         (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3018         heap artificial vars.
3019
3020 2021-02-10  Nathan Sidwell  <nathan@acm.org>
3021
3022         PR c++/99030
3023         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3024         answer if there's no local specialization.
3025
3026 2021-02-09  Nathan Sidwell  <nathan@acm.org>
3027
3028         PR c++/98944
3029         * module.cc (module_state::is_rooted): Rename to ...
3030         (module_state::has_location): ... here.  Adjust callers.
3031         (module_state::read_partitions): Adjust validity check.
3032         Don't overwrite a known location.
3033
3034 2021-02-09  Jason Merrill  <jason@redhat.com>
3035
3036         PR c++/96905
3037         * pt.c (mark_decl_instantiated): Exit early if consteval.
3038
3039 2021-02-09  Jason Merrill  <jason@redhat.com>
3040
3041         PR c++/98326
3042         PR c++/20408
3043         * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3044         parm.
3045
3046 2021-02-09  Jason Merrill  <jason@redhat.com>
3047
3048         PR c++/98994
3049         PR c++/97566
3050         * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3051         RECORD_TYPE.
3052
3053 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3054
3055         * decl.c (start_cleanup_fn): Push function into
3056         namespace.
3057
3058 2021-02-08  Nathan Sidwell  <nathan@acm.org>
3059
3060         PR c++/98531
3061         * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3062         * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3063         from rtti.c, add default namespace arg.
3064         (check_redeclaration_exception_specification): Allow a lazy
3065         builtin's eh spec to differ from an lready-declared user
3066         declaration.
3067         (declare_global_var): Use push/pop_abi_namespace.
3068         (get_atexit_node): Push the fndecl into a namespace.
3069         * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3070         decl.c.
3071
3072 2021-02-08  Marek Polacek  <polacek@redhat.com>
3073
3074         * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3075
3076 2021-02-05  Marek Polacek  <polacek@redhat.com>
3077
3078         PR c++/98947
3079         * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3080         on arg2/arg3.
3081         * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3082         issuing the -Wvolatile warning.  Only set TREE_THIS_VOLATILE if
3083         a warning was emitted.
3084
3085 2021-02-05  Marek Polacek  <polacek@redhat.com>
3086
3087         PR c++/96462
3088         * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3089
3090 2021-02-05  Jakub Jelinek  <jakub@redhat.com>
3091
3092         PR c++/97878
3093         * decl.c (check_array_initializer): For structured bindings, require
3094         the array type to be complete.
3095
3096 2021-02-04  Jason Merrill  <jason@redhat.com>
3097
3098         PR c++/98717
3099         * constraint.cc (build_concept_check_arguments): Remove assert.
3100         (build_concept_check): Allow empty args.
3101
3102 2021-02-04  Tom Greenslade (thomgree)  <thomgree@cisco.com>
3103
3104         PR c++/90926
3105         * call.c (can_convert_array): Extend to handle all valid aggregate
3106         initializers of an array; including by string literals, not just by
3107         brace-init-list.
3108         (build_aggr_conv): Call can_convert_array more often, not just in
3109         brace-init-list case.
3110         * typeck2.c (array_string_literal_compatible_p): New function.
3111         (digest_init_r): call array_string_literal_compatible_p
3112         * cp-tree.h: (array_string_literal_compatible_p): Declare.
3113
3114 2021-02-04  Jason Merrill  <jason@redhat.com>
3115
3116         PR c++/98802
3117         * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3118
3119 2021-02-04  Jason Merrill  <jason@redhat.com>
3120
3121         PR c++/95192
3122         * pt.c (tsubst_attribute): Handle error.
3123         (apply_late_template_attributes): Return false on error.
3124         (tsubst_function_decl): Check its return value.
3125         (tsubst_decl): Likewise.
3126         (push_template_decl): Assert current_template_parms.
3127         (tsubst_template_decl): Set current_template_parms.
3128
3129 2021-02-03  Marek Polacek  <polacek@redhat.com>
3130
3131         PR c++/98951
3132         * call.c (struct z_candidate): Mark rewritten and reversed as const.
3133         (struct NonPublicField): Mark operator() as const.
3134         (struct NonTrivialField): Likewise.
3135
3136 2021-02-03  Jason Merrill  <jason@redhat.com>
3137
3138         PR c++/98926
3139         PR c++/98570
3140         * pt.c (spec_hasher::equal): Set processing_template_decl.
3141         * Make-lang.in (check-g++-strict-gc): Add --param
3142         hash-table-verification-limit=10000.
3143
3144 2021-02-03  Marek Polacek  <polacek@redhat.com>
3145
3146         PR c++/98899
3147         * parser.c (cp_parser_class_specifier_1): Use any possible
3148         DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
3149         (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
3150         * pt.c (tsubst_exception_specification): Stash new_specs into
3151         DEFPARSE_INSTANTIATIONS.
3152         * tree.c (fixup_deferred_exception_variants): Use
3153         UNPARSED_NOEXCEPT_SPEC_P.
3154
3155 2021-02-02  Jason Merrill  <jason@redhat.com>
3156
3157         PR c++/98929
3158         PR c++/96199
3159         * error.c (dump_expr): Ignore dummy object.
3160         * pt.c (tsubst_baselink): Handle dependent scope.
3161
3162 2021-02-01  Patrick Palka  <ppalka@redhat.com>
3163
3164         PR c++/98295
3165         * constexpr.c (cxx_eval_array_reference): Also set
3166         new_ctx.object when setting new_ctx.ctor.
3167
3168 2021-02-01  Marek Polacek  <polacek@redhat.com>
3169
3170         PR c++/98355
3171         * parser.c (cp_parser_has_attribute_expression): Use
3172         uses_template_parms instead of type_dependent_expression_p.
3173
3174 2021-02-01  Jason Merrill  <jason@redhat.com>
3175
3176         PR c++/98570
3177         * cp-tree.h: Declare it.
3178         * pt.c (comparing_dependent_aliases): New flag.
3179         (template_args_equal, spec_hasher::equal): Set it.
3180         (dependent_alias_template_spec_p): Assert that we don't
3181         get non-types other than error_mark_node.
3182         (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
3183         on complex alias specializations.  Set TYPE_DEPENDENT_P here.
3184         (tsubst_decl): Not here.
3185         * module.cc (module_state::read_cluster): Set
3186         comparing_dependent_aliases instead of
3187         comparing_specializations.
3188         * tree.c (cp_tree_equal): Remove comparing_specializations
3189         module handling.
3190         * typeck.c (structural_comptypes): Adjust.
3191         (comptypes): Remove comparing_specializations handling.
3192
3193 2021-01-29  Nathan Sidwell  <nathan@acm.org>
3194
3195         PR c++/98843
3196         * module.cc (module_state_config): Add num_entities field.
3197         (module_state::read_entities): The entity_ary span is
3198         already allocated.
3199         (module_state::write_config): Write num_entities.
3200         (module_state::read_config): Read num_entities.
3201         (module_state::write): Set config's num_entities.
3202         (module_state::read_initial): Allocate the entity ary
3203         span here.
3204         (module_state::read_language): Do not set entity_lwm
3205         here.
3206
3207 2021-01-29  Marek Polacek  <polacek@redhat.com>
3208
3209         PR c++/96137
3210         * parser.c (cp_parser_class_name): If parser->scope is
3211         error_mark_node, return it, otherwise continue.
3212
3213 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
3214
3215         PR c++/98841
3216         * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
3217
3218 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
3219
3220         PR c++/33661
3221         PR c++/98847
3222         * decl.c (cp_finish_decl): For register vars with asmspec in templates
3223         call set_user_assembler_name and set DECL_HARD_REGISTER.
3224         * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
3225         pass asmspec_tree to cp_finish_decl.
3226
3227 2021-01-28  Nathan Sidwell  <nathan@acm.org>
3228
3229         PR c++/98770
3230         * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3231         check order.
3232         (trees_in::decl_value): Do typedef frobbing only when installing
3233         a new typedef, adjust is_matching_decl call.  Swap is_typedef
3234         & TYPE_NAME check.
3235         (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3236         names and deal with typedef checking.
3237
3238 2021-01-27  Jason Merrill  <jason@redhat.com>
3239
3240         PR c++/97874
3241         * name-lookup.c (lookup_using_decl): Clean up handling
3242         of dependency and inherited constructors.
3243         (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
3244         * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
3245
3246 2021-01-26  Jason Merrill  <jason@redhat.com>
3247
3248         PR c++/97474
3249         * call.c (type_passed_as): Don't mark invisiref restrict.
3250
3251 2021-01-26  Jason Merrill  <jason@redhat.com>
3252
3253         PR c++/97566
3254         PR c++/98463
3255         * class.c (layout_class_type): An empty field gets size 0.
3256         (is_empty_field): New.
3257         (check_bases): Check it.
3258         * cp-tree.h (is_empty_field): Declare it.
3259         * constexpr.c (cxx_eval_store_expression): Check it.
3260         (cx_check_missing_mem_inits): Likewise.
3261         * init.c (perform_member_init): Likewise.
3262         * typeck2.c (process_init_constructor_record): Likewise.
3263
3264 2021-01-25  Martin Sebor  <msebor@redhat.com>
3265
3266         PR c++/98646
3267         * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
3268
3269 2021-01-25  Jason Merrill  <jason@redhat.com>
3270
3271         PR c++/98463
3272         * constexpr.c (get_or_insert_ctor_field): Add check.
3273         (cxx_eval_store_expression): Handle discontinuity of refs.
3274
3275 2021-01-23  Anthony Sharp  <anthonysharp15@gmail.com>
3276
3277         * call.c (complain_about_access): Altered function.
3278         * cp-tree.h (complain_about_access): Changed parameters of function.
3279         (get_parent_with_private_access): Declared new function.
3280         * search.c (get_parent_with_private_access): Defined new function.
3281         * semantics.c (enforce_access): Modified function.
3282         * typeck.c (complain_about_unrecognized_member): Updated function
3283         arguments in complain_about_access.
3284
3285 2021-01-23  Patrick Palka  <ppalka@redhat.com>
3286
3287         PR c++/97399
3288         * cp-tree.h (shared_member_p): Adjust declaration.
3289         * parser.c (cp_parser_init_declarator): If the storage class
3290         specifier is sc_static, pass true for static_p to
3291         cp_parser_declarator.
3292         (cp_parser_direct_declarator): Don't do inject_this_parm when
3293         the declarator is a friend.
3294         * search.c (shared_member_p): Change return type to bool and
3295         adjust function body accordingly.  Return false for a dependent
3296         USING_DECL instead of aborting.
3297         * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
3298         even when type-dependent.
3299
3300 2021-01-22  Marek Polacek  <polacek@redhat.com>
3301
3302         PR c++/96623
3303         * parser.c (inject_parm_decls): Remove a redundant assignment.
3304         (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
3305         before calling inject_parm_decls.
3306
3307 2021-01-22  Jason Merrill  <jason@redhat.com>
3308
3309         PR c++/98744
3310         * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
3311
3312 2021-01-22  Jakub Jelinek  <jakub@redhat.com>
3313
3314         PR sanitizer/95693
3315         * init.c (build_zero_init_1): Revert the 2018-03-06 change to
3316         return build_zero_cst for reference types.
3317         * typeck2.c (process_init_constructor_record): Instead call
3318         build_zero_cst here during error recovery instead of build_zero_init.
3319
3320 2021-01-22  Marek Polacek  <polacek@redhat.com>
3321
3322         PR c++/98545
3323         * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
3324         warnings regardless of abi_version_at_least.
3325         (write_expression): When the expression is a dependent name
3326         and an operator name, write "on" before writing its name.
3327
3328 2021-01-22  Marek Polacek  <polacek@redhat.com>
3329
3330         PR c++/97966
3331         * pt.c (instantiate_class_template_1): Instantiate members
3332         marked with attribute used only after we're done instantiating
3333         the class.
3334
3335 2021-01-21  Patrick Palka  <ppalka@redhat.com>
3336
3337         PR c++/71879
3338         * semantics.c (finish_decltype_type): Set up a cp_unevaluated
3339         sentinel at the start of the function.  Remove a now-redundant
3340         manual adjustment of cp_unevaluated_operand.
3341
3342 2021-01-21  Nathan Sidwell  <nathan@acm.org>
3343
3344         PR c++/98624
3345         * module.cc (depset::hash::find_dependencies): Add
3346         module arg.
3347         (trees_out::core_vals): Check state before calling
3348         write_location.
3349         (sort_cluster, module_state::write): Adjust
3350         find_dependencies call.
3351
3352 2021-01-21  Jakub Jelinek  <jakub@redhat.com>
3353
3354         PR c++/98672
3355         * constexpr.c (check_for_return_continue_data): Add break_stmt member.
3356         (check_for_return_continue): Also look for BREAK_STMT.  Handle
3357         SWITCH_STMT by ignoring break_stmt from its body.
3358         (potential_constant_expression_1) <case FOR_STMT>,
3359         <case WHILE_STMT>: If the condition isn't constant true, check if
3360         the loop body can contain a return stmt.
3361         <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
3362         <case IF_STMT>: If recursion with tf_none is successful,
3363         merge *jump_target from the branches - returns with highest priority,
3364         breaks or continues lower.  If then branch is potentially constant and
3365         doesn't return, check the else branch if it could return, break or
3366         continue.
3367
3368 2021-01-21  Nathan Sidwell  <nathan@acm.org>
3369
3370         PR c++/98530
3371         * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
3372
3373 2021-01-20  Nathan Sidwell  <nathan@acm.org>
3374
3375         * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
3376         signed type.
3377
3378 2021-01-20  Patrick Palka  <ppalka@redhat.com>
3379
3380         PR c++/95434
3381         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
3382         CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
3383         adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
3384
3385 2021-01-20  Patrick Palka  <ppalka@redhat.com>
3386
3387         PR c++/82613
3388         * parser.c (cp_parser_class_head): Defer access checking when
3389         parsing the base-clause until all bases are seen and attached
3390         to the class type.
3391         * pt.c (instantiate_class_template): Likewise when substituting
3392         into dependent bases.
3393
3394 2021-01-20  Jakub Jelinek  <jakub@redhat.com>
3395
3396         PR c++/98742
3397         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
3398         error_operand_p, remove clause without further checking.  Check
3399         for non-NULL TYPE_NAME.
3400
3401 2021-01-19  Marek Polacek  <polacek@redhat.com>
3402
3403         PR c++/98659
3404         * pt.c (maybe_instantiate_noexcept): Return false if FN is
3405         error_mark_node.
3406
3407 2021-01-19  Marek Polacek  <polacek@redhat.com>
3408
3409         PR c++/98687
3410         * name-lookup.c (push_using_decl_bindings): New, broken out of...
3411         (finish_nonmember_using_decl): ...here.
3412         * name-lookup.h (push_using_decl_bindings): Update declaration.
3413         * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
3414
3415 2021-01-19  Patrick Palka  <ppalka@redhat.com>
3416
3417         PR c++/41437
3418         PR c++/58993
3419         * search.c (friend_accessible_p): If scope is a hidden friend
3420         defined inside a dependent class, consider access from the
3421         class.
3422         * parser.c (cp_parser_late_parsing_for_member): Don't push a
3423         dk_no_check access state.
3424
3425 2021-01-19  Marek Polacek  <polacek@redhat.com>
3426
3427         PR c++/98333
3428         * parser.c (cp_parser_class_specifier_1): Perform late-parsing
3429         of NSDMIs before late-parsing of noexcept-specifiers.
3430
3431 2021-01-19  Nathan Sidwell  <nathan@acm.org>
3432
3433         * module.cc (identifier): Merge overloads.
3434
3435 2021-01-19  Nathan Sidwell  <nathan@acm.org>
3436
3437         PR c++/98624
3438         * module.cc (trees_out::write_location): Make static.
3439
3440 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
3441
3442         * parser.c (cp_parser_omp_clause_detach): New.
3443         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
3444         (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
3445         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3446         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3447         Prevent use of detach with mergeable and overriding the data sharing
3448         mode of the event handle.
3449
3450 2021-01-15  Nathan Sidwell  <nathan@acm.org>
3451
3452         PR c++/98538
3453         * tree.c (cp_build_qualified_type_real): Propagate an array's
3454         dependentness to the copy, if known.
3455
3456 2021-01-15  Jason Merrill  <jason@redhat.com>
3457
3458         PR c++/98642
3459         * call.c (unsafe_return_slot_p): Return int.
3460         (init_by_return_slot_p): Split out from...
3461         (unsafe_copy_elision_p): ...here.
3462         (unsafe_copy_elision_p_opt): New name for old meaning.
3463         (build_over_call): Adjust.
3464         (make_safe_copy_elision): New.
3465         * typeck2.c (split_nonconstant_init_1): Elide copy from safe
3466         list-initialization.
3467         * cp-tree.h: Adjust.
3468
3469 2021-01-15  Jason Merrill  <jason@redhat.com>
3470
3471         * call.c (base_ctor_for, make_base_init_ok): New.
3472         (build_over_call): Use make_base_init_ok.
3473
3474 2021-01-15  Jason Merrill  <jason@redhat.com>
3475
3476         PR c++/63707
3477         * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
3478         if we got a CONSTRUCTOR.
3479
3480 2021-01-15  Nathan Sidwell  <nathan@acm.org>
3481
3482         PR c++/98591
3483         * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
3484
3485 2021-01-14  Jason Merrill  <jason@redhat.com>
3486
3487         * typeck2.c (process_init_constructor_record): Use fldtype
3488         variable consistently.
3489
3490 2021-01-14  Nathan Sidwell  <nathan@acm.org>
3491
3492         PR c++/98372
3493         * tree.c (cp_tree_equal): Correct map_context logic.
3494
3495 2021-01-13  Marek Polacek  <polacek@redhat.com>
3496
3497         PR c++/98231
3498         * name-lookup.c (push_using_decl_bindings): New.
3499         * name-lookup.h (push_using_decl_bindings): Declare.
3500         * pt.c (tsubst_expr): Call push_using_decl_bindings.
3501
3502 2021-01-13  Nathan Sidwell  <nathan@acm.org>
3503
3504         PR c++/98626
3505         * module.cc (module_add_import_initializers):  Pass a
3506         zero-element argument vector.
3507
3508 2021-01-12  Patrick Palka  <ppalka@redhat.com>
3509
3510         PR c++/98611
3511         * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
3512         the template of a CTAD placeholder.
3513
3514 2021-01-12  Marek Polacek  <polacek@redhat.com>
3515
3516         PR c++/98620
3517         * typeck2.c (process_init_constructor_record): Don't emit
3518         -Wmissing-field-initializers warnings in unevaluated contexts.
3519
3520 2021-01-11  Jakub Jelinek  <jakub@redhat.com>
3521
3522         PR c++/98481
3523         * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
3524         for types.
3525         (mark_abi_tags_r): Likewise.
3526         * decl2.c (min_vis_r): Likewise.
3527         * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
3528         typedefs.
3529
3530 2021-01-08  Patrick Palka  <ppalka@redhat.com>
3531
3532         PR c++/98551
3533         * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
3534         instead of AGGREGATE_TYPE_P before calling replace_result_decl.
3535
3536 2021-01-08  Patrick Palka  <ppalka@redhat.com>
3537
3538         PR c++/98515
3539         * semantics.c (check_accessibility_of_qualified_id): Punt if
3540         we're checking access of a scoped non-static member inside a
3541         class template.
3542
3543 2021-01-07  Jakub Jelinek  <jakub@redhat.com>
3544
3545         PR c++/98329
3546         * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
3547         cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
3548         its location.
3549         (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
3550
3551 2021-01-07  Marek Polacek  <polacek@redhat.com>
3552
3553         PR c++/98441
3554         * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
3555         !late_return_type block.
3556
3557 2021-01-07  Jason Merrill  <jason@redhat.com>
3558
3559         * constexpr.c (cxx_bind_parameters_in_call): Add comment.
3560         (cxx_eval_store_expression): Add comment.
3561
3562 2021-01-07  Jason Merrill  <jason@redhat.com>
3563
3564         * call.c (has_next): Factor out from...
3565         (next_conversion): ...here.
3566         (strip_standard_conversion): And here.
3567         (is_subseq): And here.
3568         (build_conv): Check it.
3569         (standard_conversion): Don't call build_conv
3570         for ck_identity.
3571
3572 2021-01-06  Martin Sebor  <msebor@redhat.com>
3573
3574         PR c++/95768
3575         * error.c (dump_expr): Call c_pretty_printer::unary_expression.
3576
3577 2021-01-05  Patrick Palka  <ppalka@redhat.com>
3578
3579         * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
3580         the type of the NTTP, substitute into the type again.  If the
3581         type is still dependent, don't unify the NTTP.
3582
3583 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
3584
3585         * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
3586         $(CODYLIB) after $(BACKEND).
3587
3588 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
3589
3590         PR c++/98469
3591         * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
3592         Punt if lval is true.
3593         * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
3594         the result if it has a class type.
3595
3596 2021-01-05  Marek Polacek  <polacek@redhat.com>
3597
3598         PR c++/82099
3599         * pt.c (resolve_overloaded_unification): Call
3600         maybe_instantiate_noexcept after instantiating the function
3601         decl.
3602
3603 2021-01-05  Nathan Sidwell  <nathan@acm.org>
3604
3605         * parser.c (cp_parser_module_declaration): Alter diagnostic
3606         text to say where is permissable.
3607
3608 2021-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
3609
3610         PR c++/98316
3611         * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
3612
3613 2021-01-02  Jan Hubicka  <jh@suse.cz>
3614
3615         * cp-tree.h (cp_tree_c_finish_parsing): Declare.
3616         * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
3617         * tree.c (cp_tree_c_finish_parsing): New function.
3618
3619 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
3620
3621         * ChangeLog-2020: Rotate ChangeLog.  New file.
3622
3623 \f
3624 Copyright (C) 2021 Free Software Foundation, Inc.
3625
3626 Copying and distribution of this file, with or without modification,
3627 are permitted in any medium without royalty provided the copyright
3628 notice and this notice are preserved.