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