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