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