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