Daily bump.
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2021-03-23  Nathan Sidwell  <nathan@acm.org>
2
3         PR c++/99283
4         * name-lookup.c (check_module_override): Set global or partition
5         DUP on the binding vector.
6
7 2021-03-23  Marek Polacek  <polacek@redhat.com>
8
9         PR c++/99318
10         * decl2.c (cp_warn_deprecated_use_scopes): Only call
11         cp_warn_deprecated_use when decl is a namespace, class, or enum.
12
13 2021-03-23  Nathan Sidwell  <nathan@acm.org>
14
15         PR c++/99239
16         * decl.c (duplicate_decls): Remove assert about maybe-imported
17         artificial decls.
18
19 2021-03-23  Jakub Jelinek  <jakub@redhat.com>
20
21         PR c++/99650
22         * decl.c (cp_finish_decomp): Diagnose void initializers when
23         using tuple_element and get.
24
25 2021-03-22  Nathan Sidwell  <nathan@acm.org>
26
27         PR c++/99480
28         * module.cc (depset::hash::make_dependency): Propagate flags for
29         partial specialization.
30         (module_may_redeclare): Handle partial specialization.
31
32 2021-03-22  Nathan Sidwell  <nathan@acm.org>
33
34         PR c++/99425
35         * cp-tree.h (map_context_from, map_context_to): Delete.
36         (add_mergeable_specialization): Add is_alias parm.
37         * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
38         * module.cc (map_context_from, map_context_to): Delete.
39         (trees_in::decl_value): Add specializations later, adjust call.
40         Drop useless alias lookup. Set duplicate fn parm context.
41         (check_mergeable_decl): Drop context mapping.
42         (trees_in::is_matching_decl): Likewise.
43         (trees_in::read_function_def): Drop parameter context adjustment
44         here.
45
46 2021-03-22  Martin Liska  <mliska@suse.cz>
47
48         PR c++/99687
49         * module.cc (fini_modules): Call vec_free instead of delete.
50
51 2021-03-20  Jakub Jelinek  <jakub@redhat.com>
52
53         PR debug/99230
54         * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
55         special code, instead call c_genericize_control_stmt.
56
57 2021-03-19  Jakub Jelinek  <jakub@redhat.com>
58
59         PR c++/99456
60         * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
61         INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
62         don't diagnose it, set *non_constant_p nor return t.
63
64 2021-03-19  Marek Polacek  <polacek@redhat.com>
65
66         PR c++/99500
67         * parser.c (cp_parser_requirement_parameter_list): Handle
68         error_mark_node.
69
70 2021-03-18  Marek Polacek  <polacek@redhat.com>
71
72         * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
73
74 2021-03-18  Marek Polacek  <polacek@redhat.com>
75
76         * pt.c (tsubst_copy_and_build): Add assert.
77
78 2021-03-18  Iain Sandoe  <iain@sandoe.co.uk>
79
80         PR objc++/49070
81         * parser.c (cp_debug_parser): Add Objective-C++ message
82         state flag.
83         (cp_parser_nested_name_specifier_opt): Allow colon to
84         terminate an assignment-expression when parsing Objective-
85         C++ messages.
86         (cp_parser_objc_message_expression): Set and clear message
87         parsing state on entry and exit.
88         * parser.h (struct cp_parser): Add a context flag for
89         Objective-C++ message state.
90
91 2021-03-18  Martin Liska  <mliska@suse.cz>
92
93         PR c++/99617
94         * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
95         to NULL.
96
97 2021-03-17  Marek Polacek  <polacek@redhat.com>
98
99         PR c++/97973
100         * call.c (conv_unsafe_in_template_p): New.
101         (convert_like): Use it.
102
103 2021-03-17  Anthony Sharp  <anthonysharp15@gmail.com>
104             Jason Merrill  <jason@redhat.com>
105
106         * semantics.c (get_class_access_diagnostic_decl): New
107         function that examines special cases when a parent
108         class causes a private access failure.
109         (enforce_access): Slightly modified to call function
110         above.
111
112 2021-03-16  Jason Merrill  <jason@redhat.com>
113
114         * tree.c (cp_tree_equal): Use real_identical.
115
116 2021-03-16  Jakub Jelinek  <jakub@redhat.com>
117
118         PR c++/99613
119         * decl.c (expand_static_init): For thread guards, call __cxa_atexit
120         before calling __cxa_guard_release rather than after it.  Formatting
121         fixes.
122
123 2021-03-16  Martin Liska  <mliska@suse.cz>
124             Jason Merrill  <jason@redhat.com>
125
126         PR c++/99108
127         * call.c (get_function_version_dispatcher): Handle
128         DECL_LOCAL_DECL_P.
129         * decl.c (maybe_version_functions): Likewise.
130         (maybe_mark_function_versioned): New.
131         * name-lookup.c (push_local_extern_decl_alias): No longer static.
132         * name-lookup.h (push_local_extern_decl_alias): Adjust.
133
134 2021-03-16  Nathan Sidwell  <nathan@acm.org>
135
136         PR c++/99496
137         * module.cc (trees_out::decl_value): Adjust typedef streaming,
138         indicate whether it is a dependent alias.
139         (trees_in::decl_value): Likewise.  Set as dependent alias, if it
140         is one.
141
142 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
143
144         PR c++/99047
145         * coroutines.cc (expand_one_await_expression): If the
146         await_ready() expression is not a boolean then convert it
147         as required.
148
149 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
150
151         PR c++/98704
152         * coroutines.cc (build_actor_fn): Make destroy index 1
153         correspond to the abnormal unhandled_exception() exit.
154         Substitute the proxy for the resume index.
155         (coro_rewrite_function_body): Arrange to reset the resume
156         index and make done = true for a rethrown exception from
157         unhandled_exception ().
158         (morph_fn_to_coro): Adjust calls to build_actor_fn and
159         coro_rewrite_function_body.
160
161 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
162
163         PR c++/98480
164         * coroutines.cc (replace_continue): Rewrite continue into
165         'goto label'.
166         (await_statement_walker): Handle await expressions in the
167         initializer, condition and iteration expressions of for
168         loops.
169
170 2021-03-15  Iain Sandoe  <iain@sandoe.co.uk>
171
172         PR c++/96749
173         * coroutines.cc (flatten_await_stmt): Allow for the case
174         where a target expression variable only has uses in the
175         second part of a compound expression.
176         (maybe_promote_temps): Avoid emiting empty statements.
177
178 2021-03-15  Tobias Burnus  <tobias@codesourcery.com>
179
180         PR c++/99509
181         * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
182         ensure that the varpool node is marked as offloadable.
183
184 2021-03-12  Nathan Sidwell  <nathan@acm.org>
185
186         PR c++/99238
187         * module.cc (depset::hash::add_binding_entity): Assert not
188         visited.
189         (depset::add::add_specializations): Likewise.
190         * name-lookup.c (name_lookup::dedup): New.
191         (name_lookup::~name_lookup): Assert not deduping.
192         (name_lookup::restore_state): Likewise.
193         (name_lookup::add_overload): Replace outlined code with dedup
194         call.
195         (name_lookup::add_value): Likewise.
196         (name_lookup::search_namespace_only): Likewise.
197         (name_lookup::adl_namespace_fns): Likewise.
198         (name_lookup::adl_class_fns): Likewise.
199         (name_lookup::search_adl): Likewise.  Add clearing dedup call.
200         (name_lookup::search_qualified): Likewise.
201         (name_lookup::search_unqualified): Likewise.
202
203 2021-03-12  Jakub Jelinek  <jakub@redhat.com>
204
205         PR c++/99507
206         * call.c (build_over_call): For immediate evaluation of functions
207         that return references, undo convert_from_reference effects before
208         calling cxx_constant_value and call convert_from_reference
209         afterwards.
210
211 2021-03-11  Nathan Sidwell  <nathan@acm.org>
212
213         PR c++/99248
214         * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
215         when there's a binding vector.
216         * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
217
218 2021-03-11  Nathan Sidwell  <nathan@acm.org>
219
220         PR c++/99528
221         * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
222         MK_decl_tmpl_spec.
223         (trees_in::decl_value): Adjust add_mergeable_specialization call.
224         (trees_out::get_merge_kind): Adjust detecting a partial template
225         instantiation.
226         (trees_out::key_mergeable): Adjust handling same.
227         (trees_in::key_mergeabvle): Likewise.
228
229 2021-03-10  Nathan Sidwell  <nathan@acm.org>
230
231         PR c++/99423
232         * module.cc (post_load_processing): Assert not gcable.
233         (laxy_load_pendings): Extend no-gc region around
234         post_load_processing.
235
236 2021-03-10  Nathan Sidwell  <nathan@acm.org>
237
238         PR c++/99508
239         * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
240         assembler name to the ns alias.
241
242 2021-03-09  Jakub Jelinek  <jakub@redhat.com>
243
244         PR c++/99459
245         * coroutines.cc (build_co_await): Look through NOP_EXPRs in
246         build_special_member_call return value to find the CALL_EXPR.
247         Simplify.
248
249 2021-03-09  Nathan Sidwell  <nathan@acm.org>
250
251         PR c++/99472
252         * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
253         that C++20 does not yet imply modules.
254
255 2021-03-08  Nathan Sidwell  <nathan@acm.org>
256
257         PR c++/99436
258         * name-lookup.c (get_cxx_dialect_name): Add cxx23.
259
260 2021-03-08  Nathan Sidwell  <nathan@acm.org>
261
262         * lex.c (module_token_filter::resume): Ignore module-decls inside
263         header-unit.
264         * parser.c (cp_parser_module_declaration): Reject in header-unit.
265
266 2021-03-08  Nathan Sidwell  <nathan@acm.org>
267
268         PR c++/99285
269         * cp-tree.h (match_mergeable_specialization)
270         (add_mergeable_specialization): Adjust parms.
271         * module.cc (trees_in::decl_value): Adjust
272         add_mergeable_specialization calls.
273         (trees_out::key_mergeable): Adjust match_mergeable_specialization
274         calls.
275         (specialization_add): Likewise.
276         * pt.c (match_mergeable_specialization): Do not insert.
277         (add_mergeable_specialization): Add to hash table here.
278
279 2021-03-06  Patrick Palka  <ppalka@redhat.com>
280             Jakub Jelinek  <jakub@redhat.com>
281
282         PR c++/99287
283         * constexpr.c (cxx_eval_increment_expression): Pass lval when
284         evaluating the MODIFY_EXPR, and update 'mod' with the result of
285         this evaluation.  Check *non_constant_p afterwards.  For prefix
286         ops, just return 'mod'.
287
288 2021-03-06  Patrick Palka  <ppalka@redhat.com>
289             Jakub Jelinek  <jakub@redhat.com>
290
291         PR c++/96330
292         * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
293         variable 'fn' to 'tmpl'.  Handle a variable template-id by
294         calling lookup_template_variable.
295
296 2021-03-06  Patrick Palka  <ppalka@redhat.com>
297
298         PR c++/99365
299         * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
300         outer_targs to do_auto_deduction.
301         (placeholder_type_constraint_dependent_p): Define.
302         (do_auto_deduction): When processing_template_decl != 0
303         and context is adc_unify and we have constraints, pretend the
304         constraints are satisfied instead of punting.  Otherwise don't
305         punt unless placeholder_type_constraint_dependent_p holds.
306         Add some clarifying sanity checks.  Add a hack to add missing
307         outermost template levels to outer_args before checking
308         satisfaction.  Don't substitute outer_targs into type if it's
309         already been done.
310
311 2021-03-05  Marek Polacek  <polacek@redhat.com>
312
313         PR c++/99374
314         * call.c (standard_conversion): When converting pointers to
315         member, don't return NULL when the bases are equivalent but
316         incomplete.
317
318 2021-03-05  Marek Polacek  <polacek@redhat.com>
319
320         PR c++/99120
321         * name-lookup.c (check_local_shadow): Check if the type of decl
322         is non-null before checking TYPE_PTR*.
323
324 2021-03-05  Nathan Sidwell  <nathan@acm.org>
325
326         PR c++/99245
327         * module.cc (module_state::write_cluster): Relax binding assert.
328
329 2021-03-05  Nathan Sidwell  <nathan@acm.org>
330
331         PR c++/99377
332         * pt.c (instantiate_decl): Call set_instantiating_module.
333
334 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
335
336         PR c++/98118
337         * coroutines.cc (build_co_await): Use type_build_ctor_call()
338         to determine cases when a CTOR needs to be built.
339         (flatten_await_stmt): Likewise.
340         (morph_fn_to_coro): Likewise.
341
342 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
343
344         PR c++/95616
345         * coroutines.cc (coro_diagnose_throwing_fn): New helper.
346         (coro_diagnose_throwing_final_aw_expr): New helper.
347         (build_co_await): Diagnose throwing final await expression
348         components.
349         (build_init_or_final_await): Diagnose a throwing promise
350         final_suspend() call.
351
352 2021-03-05  Iain Sandoe  <iain@sandoe.co.uk>
353
354         PR c++/95615
355         * coroutines.cc (struct param_info): Track parameter copies that need
356         a DTOR.
357         (coro_get_frame_dtor): New helper function factored from build_actor().
358         (build_actor_fn): Use coro_get_frame_dtor().
359         (morph_fn_to_coro): Track parameters that need DTORs on exception,
360         likewise the frame promise and the return object.  On exception, run the
361         DTORs for these, destroy the frame and then rethrow the exception.
362
363 2021-03-05  Nathan Sidwell  <nathan@acm.org>
364
365         PR c++/99389
366         * pt.c (instantiate_class_template_1): Set instantiating module
367         here.
368
369 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
370
371         PR c/99137
372         * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
373
374 2021-03-04  Jakub Jelinek  <jakub@redhat.com>
375
376         PR c++/88146
377         PR c++/99362
378         * cvt.c (convert_to_void): Revert 2019-10-17 changes.  Clarify
379         comment.
380
381 2021-03-04  Nathan Sidwell  <nathan@acm.org>
382
383         PR c++/99170
384         * module.cc (class uintset): Delete.
385         (typedef attached_map_t): A hash map.
386         (attached_table): Use attached_map_t.  Adjust uses ...
387         (trees_out::decl_value, trees_in::decl_value): ... here ...
388         (trees_out::key_mergeable): ... here ...
389         (trees_in::key_mergeable): ... here ...
390         (maybe_attach_decl): ... here ...
391         (direct_import): ... and here.
392
393 2021-03-04  Nathan Sidwell  <nathan@acm.org>
394
395         PR c++/99170
396         * cp-tree.h
397         * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
398         rename.
399         * module.cc (class pending_key): New.
400         (default_hash_traits<pending_key>): New specialization.
401         (pending_map_t): New typedef.
402         (pending_table): Replace old table.
403         (trees_out::lang_decl_bools): Adjust.
404         (trees_in::lang_decl_bools): Adjust.
405         (trees_in::install_entity): Drop pending member and specialization
406         handling.
407         (find_pending_key): New.
408         (depset::hash::fiund_dependencies): Use it.
409         (pendset_lazy_load): Delete.
410         (module_state::write_cluster): Don't count pendings here.  Bye
411         Duff's device-like thing.
412         (module_state::write_pendings): Reimplement.
413         (module_state::read_pendings): Reimplement.
414         (lazy_specializations_p): Delete.
415         (module_state::write): Adjust write_pendings call.
416         (lazy_load_pendings): New.
417         (lazy_load_specializations): Delete.
418         (lazy_load_members): Delete.
419         (init_modules): Adjust.
420         * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
421         not lazy_load_members.
422         (note_pending_specializations): Delete.
423         (load_pending_specializations): Delete.
424         * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
425         (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
426         (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
427         (note_pending_specializations): Delete.
428         (load_pending_specializations): Delete.
429         * pt.c (lookup_template_class_1): Call lazy_load_pendings not
430         lazy_load_specializations.
431         (instantiate_template_class_1): Likewise.
432         (instantiate_decl): Call lazy_load_pendings.
433         * typeck.c (complete_type): Likewise.
434
435 2021-03-03  Nathan Sidwell  <nathan@acm.org>
436
437         PR c++/99170
438         * module.cc (post_load_decls): New.
439         (lazy_snum, recursive_lazy): Move earlier.
440         (module_state::read_cluster): Push cloning onto post_load_decls.
441         (post_load_processing): New.  Do the cloning here.
442         (module_state::read_inits): Call post_load_processing.
443         (module_state::read_language): Likewise.
444         (lazy_load_binding, lazy_load_specializations): Likewise
445         (lazy_load_members): Likewise
446
447 2021-03-03  Nathan Sidwell  <nathan@acm.org>
448
449         PR c++/99170
450         * module.cc (trees_out::decl_value): Stream specialization keys
451         after decl.
452         (trees_in::decl_value): Stream them back and insert after
453         completing the decl.
454         (trees_out::key_mergeable): Drop some streaming here ...
455         (trees_in::key_mergeable): ... and here.  Don't insert into
456         specialization tables.
457
458 2021-03-03  Patrick Palka  <ppalka@redhat.com>
459
460         * constraint.cc (struct sat_info): Document the different
461         meanings of noisy() and diagnose_unsatisfaction_p() during
462         satisfaction and requires-expression evaluation.
463         (tsubst_valid_expression_requirement): Take a sat_info instead
464         of a subst_info.  Perform the substitution quietly first.  Fold
465         in error-replaying code from diagnose_valid_expression.
466         (tsubst_simple_requirement): Take a sat_info instead of a
467         subst_info.
468         (tsubst_type_requirement_1): New.  Fold in error-replaying code
469         from diagnose_valid_type.
470         (tsubst_type_requirement): Use the above.  Take a sat_info
471         instead of a subst_info.
472         (tsubst_compound_requirement): Likewise.  Fold in
473         error-replaying code from diagnose_compound_requirement.
474         (tsubst_nested_requirement): Take a sat_info instead of a
475         subst_info.  Fold in error-replaying code from
476         diagnose_nested_requirement.
477         (tsubst_requirement): Take a sat_info instead of a subst_info.
478         (tsubst_requires_expr): Split into two versions, one that takes
479         a sat_info argument and another that takes a complain and
480         in_decl argument.  Remove outdated documentation.  Document the
481         effects of the sat_info argument.  Don't short-circuit
482         processing of requirements when diagnosing unsatisfaction,
483         mirroring diagnose_requires_expr.
484         (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
485         assert, and se the three-parameter version of tsubst_requires_expr.
486         (diagnose_trait_expr): Make static.  Take a template argument
487         vector instead of a parameter mapping.
488         (diagnose_valid_expression): Remove.
489         (diagnose_valid_type): Remove.
490         (diagnose_simple_requirement): Remove.
491         (diagnose_compound_requirement): Remove.
492         (diagnose_type_requirement): Remove.
493         (diagnose_nested_requirement): Remove.
494         (diagnose_requirement): Remove.
495         (diagnose_requires_expr): Remove.
496         (diagnose_atomic_constraint): Take a sat_info instead of a
497         subst_info.  Adjust call to diagnose_trait_expr.  Call
498         tsubst_requires_expr instead of diagnose_requires_expr.
499         (diagnose_constraints): Remove special casing of REQUIRES_EXPR
500         and just always call constraint_satisfaction_value.
501
502 2021-03-03  Patrick Palka  <ppalka@redhat.com>
503
504         * constexpr.c (cxx_eval_call_expression): Adjust call to
505         evaluate_concept_check.
506         (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
507         evaluate_requires_expression instead of
508         satisfy_constraint_expression.
509         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
510         * constraint.cc (struct sat_info): Adjust comment about which
511         satisfaction entrypoints use noisy-unsat.
512         (normalize_template_requirements): Remove (and adjust callers
513         appropriately).
514         (normalize_nontemplate_requirements): Likewise.
515         (tsubst_nested_requirement): Use constraint_satisfaction_value
516         instead of satisfy_constraint_expression, which'll do the
517         noisy replaying of ill-formed quiet satisfaction for us.
518         (decl_satisfied_cache): Adjust comment.
519         (satisfy_constraint): Rename to ...
520         (satisfy_normalized_constraints): ... this.
521         (satisfy_associated_constraints): Remove (and make its
522         callers check for dependent arguments).
523         (satisfy_constraint_expression): Rename to ...
524         (satisfy_nondeclaration_constraints): ... this.  Assert that
525         'args' is empty when 't' is a concept-id.  Removing handling
526         bare constraint-expressions, and handle REQUIRES_EXPRs
527         specially.  Adjust comment accordingly.
528         (satisfy_declaration_constraints): Assert in the two-parameter
529         version that 't' is not a TEMPLATE_DECL.  Adjust following
530         removal of normalize_(non)?template_requirements and
531         satisfy_asociated_constraints.
532         (constraint_satisfaction_value): Combine the two- and
533         three-parameter versions in the natural way.
534         (constraints_satisfied_p): Combine the one- and two-parameter
535         versions in the natural way.  Improve documentation.
536         (evaluate_requires_expr): Define.
537         (evaluate_concept_check): Remove 'complain' parameter.  Use
538         constraint_satisfaction_value instead of
539         satisfy_constraint_expression.
540         (diagnose_nested_requirement): Adjust following renaming of
541         satisfy_constraint_expression.
542         (diagnose_constraints): Handle REQUIRES_EXPR by going through
543         diagnose_requires_expr directly instead of treating it as a
544         constraint-expression.  Improve documentation.
545         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
546         to evaluate_concept_check.
547         <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
548         constraints_satisfied_p.
549         <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
550         * cp-tree.h (evaluate_requires_expr): Declare.
551         (evaluate_concept_check): Remove tsubst_flag_t parameter.
552         (satisfy_constraint_expression): Remove declaration.
553         (constraints_satisfied_p): Remove one-parameter declaration.
554         Add a default argument to the two-parameter declaration.
555         * cvt.c (convert_to_void): Adjust call to
556         evaluate_concept_check.
557
558 2021-03-03  Jakub Jelinek  <jakub@redhat.com>
559
560         PR c++/82959
561         * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
562         and COMPOUND_EXPR.
563
564 2021-03-03  Marek Polacek  <polacek@redhat.com>
565
566         PR c++/97034
567         PR c++/99009
568         * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
569         (maybe_aggr_guide): Use the original template type where needed.  In
570         a class member template, partially instantiate the result of
571         collect_ctor_idx_types.
572         (do_class_deduction): Defer the deduction until the enclosing
573         scope is non-dependent.
574
575 2021-03-03  Jason Merrill  <jason@redhat.com>
576
577         PR c++/95675
578         * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
579         if it didn't get one before.
580
581 2021-03-03  Nathan Sidwell  <nathan@acm.org>
582
583         PR c++/99344
584         * module.cc (trees_out::decl_node): Small refactor.
585         (depset::hash::add_binding_entity): Return true on meeting an
586         import.  Set namespace's import here.
587         (module_state:write_namespaces): Inform of purview too.
588         (module_state:read_namespaces): Adjust.
589         * name-lookup.c (implicitly_export_namespace): Delete.
590         (do_pushdecl): Don't call it.
591         (push_namespace): Likewise, set purview.
592         (add_imported_namespace): Reorder parms.
593         * name-lookup.h (add_imported_namespace): Alter param ordering.
594
595 2021-03-02  Martin Sebor  <msebor@redhat.com>
596
597         PR c++/99251
598         * class.c (build_base_path): Call build_if_nonnull.
599         * cp-tree.h (build_if_nonnull): Declare.
600         * rtti.c (ifnonnull): Rename...
601         (build_if_nonnull): ...to this.  Set no-warning bit on COND_EXPR.
602         (build_dynamic_cast_1): Adjust to name change.
603
604 2021-03-02  Patrick Palka  <ppalka@redhat.com>
605
606         PR c++/96443
607         PR c++/96960
608         * constraint.cc (type_deducible_p): Don't substitute into the
609         constraints, and instead just pass 'args' to do_auto_deduction
610         as the outer template arguments.
611         (tsubst_parameter_mapping): Remove confused code for handling
612         placeholder type arguments.
613         (normalize_placeholder_type_constraint): Define.
614         (satisfy_constraint_expression): Use it to handle placeholder
615         'auto' types.
616         * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
617         (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
618         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
619         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
620         (make_constrained_placeholder_type): Set
621         PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
622         (do_auto_deduction): Clarify comments about the outer_targs
623         parameter.  Rework satisfaction of a placeholder type constraint
624         to pass in the complete set of template arguments directly to
625         constraints_satisfied_p.
626         (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
627         instead.  Also rebuild the the constraint info on the new auto.
628
629 2021-03-02  Patrick Palka  <ppalka@redhat.com>
630
631         * constraint.cc (build_parameter_mapping): Rely on the caller to
632         determine the in-scope template parameters.
633         (norm_info::norm_info): Delegate the tsubst_flags_t constructor
634         to the two-parameter constructor.  In the two-parameter
635         constructor, fold in the definition of make_context, set
636         initial_parms appropriately, and don't set the now-removed
637         orig_decl member.
638         (norm_info::make_context): Remove, now that its only use is
639         inlined into the caller.
640         (norm_info::update_context): Adjust call to
641         build_parameter_mapping to pass in the relevant set of in-scope
642         template parameters.
643         (norm_info::ctx_parms): Define this member function.
644         (norm_info::context): Initialize to NULL_TREE.
645         (norm_info::orig_decl): Remove this data member.
646         (norm_info::initial_parms): Define this data member.
647         (normalize_atom): Adjust call to build_parameter_mapping to pass
648         in the relevant set of in-scope template parameters.  Use
649         info.initial_parms instead of info.orig_decl.
650         (normalize_constraint_expression): Take a norm_info object
651         instead of a bool.  Cache the result of normalization.
652         (tsubst_nested_requirement): Call satisfy_constraint_expression
653         instead of satisfy_constraint, so that we normalize on demand.
654         (satisfy_constraint_expression): Handle a NESTED_REQ argument.
655         Adjust call to normalize_constraint_expression.
656         (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
657         to current_template_parms.
658         (diagnose_nested_requirements): Go through
659         satisfy_constraint_expression, as with tsubst_nested_requirement.
660
661 2021-03-02  Patrick Palka  <ppalka@redhat.com>
662
663         * constraint.cc (tsubst_parameter_mapping): Canonicalize the
664         arguments of a substituted TYPE_ARGUMENT_PACK even if we've
665         started with a TYPE_ARGUMENT_PACK.
666         (finish_requires_expr): Don't set DECL_CONTEXT and
667         CONSTRAINT_VAR_P on each of the introduced parameters here.
668         * parser.c (cp_parser_requirement_parameter_list): Instead set
669         these fields earlier, here.
670         * pt.c (do_auto_deduction): Canonicalize the result of
671         do_auto_deduction.  Pass 'complain' to finish_decltype_type.
672
673 2021-03-02  Patrick Palka  <ppalka@redhat.com>
674
675         * constraint.cc (tsubst_simple_requirement): Just return
676         boolean_true_node on success.
677         (tsubst_type_requirement): Likewise.
678         (tsubst_compound_requirement): Likewise.
679         (tsubst_nested_requirement): Likewise.
680         (tsubst_requirement_body): Remove.
681         (check_constaint_variables): Rename to ...
682         (check_constraint_variables): ... this.
683         (tsubst_constraint_variables): Adjust.
684         (tsubst_requires_expr): Fold tsubst_requirement_body into here.
685
686 2021-03-01  Nathan Sidwell  <nathan@acm.org>
687
688         PR c++/99294
689         * class.c (fixup_type_variants): Propagate mode, precision,
690         alignment & emptiness.
691         * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
692         (trees_in::tree_node): Rematerialize alignment here.
693
694 2021-02-27  Jason Merrill  <jason@redhat.com>
695
696         PR c++/90333
697         * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
698         between () and ->.
699
700 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
701
702         * parser.c (cp_parser_lambda_declarator_opt): Implement
703         P1102R2 - Down with ()! Make ()s optional before lambda specifiers
704         for -std={c,gnu}++2b or with pedwarn in earlier versions.
705
706 2021-02-26  Jakub Jelinek  <jakub@redhat.com>
707
708         PR c++/95451
709         * lambda.c (is_lambda_ignored_entity): Before checking for
710         LAMBDA_FUNCTION_P, use OVL_FIRST.  Drop FUNCTION_DECL check.
711
712 2021-02-26  Jason Merrill  <jason@redhat.com>
713
714         PR c++/98810
715         * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
716         to a class non-type template argument that needs it.
717
718 2021-02-26  Patrick Palka  <ppalka@redhat.com>
719
720         PR c++/98990
721         * pt.c (splice_late_return_type): Rebuild the entire return type
722         if we have to adjust the level of an auto within.
723         (type_uses_auto): Adjust call to find_type_usage.
724         * type-utils.h (find_type_usage): Revert r10-6571 change that
725         made this function return a pointer to the auto node.
726
727 2021-02-25  Patrick Palka  <ppalka@redhat.com>
728
729         PR c++/99213
730         PR c++/94521
731         * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
732         TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
733
734 2021-02-25  Patrick Palka  <ppalka@redhat.com>
735
736         PR c++/99103
737         * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
738         (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
739
740 2021-02-25  Marek Polacek  <polacek@redhat.com>
741
742         DR 1312
743         PR c++/99176
744         * constexpr.c (is_std_construct_at): New overload.
745         (is_std_allocator_allocate): New overload.
746         (cxx_eval_call_expression): Use the new overloads.
747         (cxx_eval_constant_expression): Reject casting
748         from void * as per DR 1312.  Don't check can_convert.
749
750 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
751
752         PR c++/97587
753         * coroutines.cc (struct param_info): Track rvalue refs.
754         (morph_fn_to_coro): Track rvalue refs, and call the promise
755         CTOR with the frame copy of passed parms.
756
757 2021-02-25  Iain Sandoe  <iain@sandoe.co.uk>
758
759         PR c++/95822
760         * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
761         set throwing_cleanup marker.
762
763 2021-02-25  Nathan Sidwell  <nathan@acm.org>
764
765         PR c++/99166
766         * module.cc (module_state::inform_cmi_p): Renamed field.
767         (module_state::do_import): Adjust.
768         (init_modules, finish_module_processing): Likewise.
769         (handle_module_option): Likewise.
770
771 2021-02-25  Nathan Sidwell  <nathan@acm.org>
772
773         PR c++/98318
774         * mapper-client.cc (module_client::open_module_client): Fix typo
775         of fd init.
776
777 2021-02-24  Nathan Sidwell  <nathan@acm.org>
778
779         PR c++/98718
780         * module.cc (ool): New indirection vector.
781         (loc_spans::maybe_propagate): Location is not optional.
782         (loc_spans::open): Likewise.  Assert monotonically advancing.
783         (module_for_ordinary_loc): Use ool indirection vector.
784         (module_state::write_prepare_maps): Do not count empty macro
785         expansions.  Elide empty spans.
786         (module_state::write_macro_maps): Skip empty expansions.
787         (ool_cmp): New qsort comparator.
788         (module_state::write): Create and destroy ool vector.
789         (name_pending_imports): Fix dump push/pop.
790         (preprocess_module): Likewise.  Add more dumping.
791         (preprocessed_module): Likewise.
792
793 2021-02-24  Iain Sandoe  <iain@sandoe.co.uk>
794
795         PR c++/96251
796         * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
797         error reporting when instantiating for a constexpr.
798
799 2021-02-23  Nathan Sidwell  <nathan@acm.org>
800
801         PR c++/99208
802         * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
803         identity.
804
805 2021-02-23  Patrick Palka  <ppalka@redhat.com>
806
807         PR c++/95468
808         * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
809         over from tsubst_copy.
810
811 2021-02-23  Patrick Palka  <ppalka@redhat.com>
812
813         * pt.c (instantiation_dependent_expression_p): Check
814         processing_template_decl before calling
815         potential_constant_expression.
816
817 2021-02-22  Nathan Sidwell  <nathan@acm.org>
818
819         PR c++/99174
820         * module.cc (struct module_state): Add visited_p flag.
821         (name_pending_imports): Use it to avoid duplicate requests.
822         (preprocess_module): Don't read preprocessor state if we failed to
823         load a module's config.
824
825 2021-02-22  Nathan Sidwell  <nathan@acm.org>
826
827         PR c++/99153
828         * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
829         to common-path.
830         * module.cc (set_defining_module): Add assert.
831
832 2021-02-19  Nathan Sidwell  <nathan@acm.org>
833
834         PR c++/98741
835         * module.cc (pending_imports): New.
836         (declare_module): Adjust test condition.
837         (name_pending_imports): New.
838         (preprocess_module): Reimplement using pending_imports.
839         (preprocessed_module): Move name-getting to name_pending_imports.
840         * name-lookup.c (append_imported_binding_slot): Assert module
841         ordering is increasing.
842
843 2021-02-19  Nathan Sidwell  <nathan@acm.org>
844
845         * module.cc (note_cmis): New.
846         (struct module_state): Add inform_read_p bit.
847         (module_state::do_import): Inform of CMI location, if enabled.
848         (init_modules): Canonicalize note_cmis entries.
849         (handle_module_option): Handle -flang-info-module-read=FOO.
850
851 2021-02-19  Jason Merrill  <jason@redhat.com>
852
853         PR c++/96926
854         * call.c (perfect_conversion_p): Limit rvalueness
855         test to reference bindings.
856
857 2021-02-19  Jason Merrill  <jason@redhat.com>
858
859         PR c++/96926
860         * call.c (perfect_conversion_p): New.
861         (perfect_candidate_p): New.
862         (add_candidates): Ignore templates after a perfect non-template.
863
864 2021-02-18  Nathan Sidwell  <nathan@acm.org>
865
866         PR c++/99023
867         * module.cc (canonicalize_header_name): Use
868         cpp_probe_header_unit.
869         (maybe_translate_include): Fix note_includes comparison.
870         (init_modules): Fix note_includes string termination.
871
872 2021-02-18  Jakub Jelinek  <jakub@redhat.com>
873
874         PR c++/99132
875         * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
876         cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
877         for immediate function calls.
878
879 2021-02-17  Nathan Sidwell  <nathan@acm.org>
880
881         PR c++/99023
882         * module.cc (struct macro_export): Add GTY markers.
883         (macro_exports): Likewise, us a va_gc Vector.
884
885 2021-02-17  Jakub Jelinek  <jakub@redhat.com>
886
887         PR sanitizer/99106
888         * init.c (build_zero_init_1): For flexible array members just return
889         NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
890         ARRAY_TYPE.
891
892 2021-02-17  Nathan Sidwell  <nathan@acm.org>
893
894         PR c++/99116
895         * name-lookup.c (do_pushdecl): Don't peek under template_parm
896         bindings here ...
897         (set_identifier_type_value_with_scope): ... or here.
898         (do_pushtag): Only set_identifier_type_value_with_scope at
899         non-class template parm scope, and use parent scope.
900
901 2021-02-17  Nathan Sidwell  <nathan@acm.org>
902
903         PR c++/99071
904         * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
905         pointer.
906
907 2021-02-17  Patrick Palka  <ppalka@redhat.com>
908
909         PR debug/96997
910         PR c++/94034
911         * tree.c (build_aggr_init_expr): Revert r10-7718 change.
912
913 2021-02-12  Nathan Sidwell  <nathan@acm.org>
914
915         * module.cc (module_state::write_cluster): Check bindings for
916         imported using-decls.
917
918 2021-02-12  Nathan Sidwell  <nathan@acm.org>
919
920         PR c++/99040
921         * module.cc (trees_in::decl_value): Call add_module_namespace_decl
922         for new namespace-scope entities.
923         (module_state::read_cluster): Don't call add_module_decl here.
924         * name-lookup.h (add_module_decl): Rename to ...
925         (add_module_namespace_decl): ... this.
926         * name-lookup.c (newbinding_bookkeeping): Move into ...
927         (do_pushdecl): ... here.  Its only remaining caller.
928         (add_module_decl): Rename to ...
929         (add_module_namespace_decl): ... here.  Add checking-assert for
930         circularity. Don't call newbinding_bookkeeping, just extern_c
931         checking and incomplete var checking.
932
933 2021-02-12  Nathan Sidwell  <nathan@acm.org>
934
935         PR c++/99039
936         PR c++/99040
937         * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
938         (global_type_node): Delete.
939         (IDENTIFIER_TYPE_VALUE): Delete.
940         (IDENTIFIER_HAS_TYPE_VALUE): Delete.
941         (get_type_value): Delete.
942         * name-lookup.h (identifier_type_value): Delete.
943         * name-lookup.c (check_module_override): Don't
944         SET_IDENTIFIER_TYPE_VALUE here.
945         (do_pushdecl): Nor here.
946         (identifier_type_value_1, identifier_type_value): Delete.
947         (set_identifier_type_value_with_scope): Only
948         SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
949         (pushdecl_nanmespace_level): Remove shadow stack nadgering.
950         (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
951         * call.c (check_dtor_name): Use lookup_name.
952         * decl.c (cxx_init_decl_processing): Drop global_type_node.
953         * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
954         here.
955         * init.c (get_type_value): Delete.
956         * pt.c (instantiate_class_template_1): Don't call pushtag or
957         SET_IDENTIFIER_TYPE_VALUE here.
958         (tsubst): Assert never an identifier.
959         (dependent_type_p): Drop global_type_node assert.
960         * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
961         to determine ctorness.
962
963 2021-02-12  Jakub Jelinek  <jakub@redhat.com>
964
965         PR c++/97742
966         * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
967         CPP_EOF.
968
969 2021-02-12  Jason Merrill  <jason@redhat.com>
970
971         PR c++/97246
972         PR c++/94546
973         * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
974         (register_parameter_specializations): Not here.
975
976 2021-02-11  Marek Polacek  <polacek@redhat.com>
977
978         PR c++/95888
979         * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
980         for the partial instantiation.
981
982 2021-02-11  Jakub Jelinek  <jakub@redhat.com>
983
984         PR c++/99033
985         * init.c (build_zero_init_1): Handle zero initialiation of
986         flexible array members like initialization of [0] arrays.
987         Use integer_minus_onep instead of comparison to integer_minus_one_node
988         and integer_zerop instead of comparison against size_zero_node.
989         Formatting fixes.
990
991 2021-02-11  Marek Polacek  <polacek@redhat.com>
992
993         PR c++/99063
994         * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
995
996 2021-02-11  Patrick Palka  <ppalka@redhat.com>
997
998         PR c++/97582
999         * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
1000         lookup result by discarding it if the first element is a
1001         class-scope declaration, otherwise return it.
1002         (push_operator_bindings): Handle an ambiguous lookup result by
1003         doing push_local_binding on each element in the list.
1004
1005 2021-02-11  Marek Polacek  <polacek@redhat.com>
1006
1007         * parser.c (cp_parser_selection_statement): Use vec_free.
1008
1009 2021-02-10  Jakub Jelinek  <jakub@redhat.com>
1010
1011         PR c++/98988
1012         PR c++/99031
1013         * constexpr.c: Include cgraph.h.
1014         (cxx_eval_call_expression): Call varpool_node::finalize_decl on
1015         heap artificial vars.
1016         (cxx_eval_outermost_constant_expr): Remove varpool nodes for
1017         heap artificial vars.
1018
1019 2021-02-10  Nathan Sidwell  <nathan@acm.org>
1020
1021         PR c++/99030
1022         * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
1023         answer if there's no local specialization.
1024
1025 2021-02-09  Nathan Sidwell  <nathan@acm.org>
1026
1027         PR c++/98944
1028         * module.cc (module_state::is_rooted): Rename to ...
1029         (module_state::has_location): ... here.  Adjust callers.
1030         (module_state::read_partitions): Adjust validity check.
1031         Don't overwrite a known location.
1032
1033 2021-02-09  Jason Merrill  <jason@redhat.com>
1034
1035         PR c++/96905
1036         * pt.c (mark_decl_instantiated): Exit early if consteval.
1037
1038 2021-02-09  Jason Merrill  <jason@redhat.com>
1039
1040         PR c++/98326
1041         PR c++/20408
1042         * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
1043         parm.
1044
1045 2021-02-09  Jason Merrill  <jason@redhat.com>
1046
1047         PR c++/98994
1048         PR c++/97566
1049         * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
1050         RECORD_TYPE.
1051
1052 2021-02-08  Nathan Sidwell  <nathan@acm.org>
1053
1054         * decl.c (start_cleanup_fn): Push function into
1055         namespace.
1056
1057 2021-02-08  Nathan Sidwell  <nathan@acm.org>
1058
1059         PR c++/98531
1060         * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
1061         * decl.c (push_abi_namespace, pop_abi_namespace): Moved
1062         from rtti.c, add default namespace arg.
1063         (check_redeclaration_exception_specification): Allow a lazy
1064         builtin's eh spec to differ from an lready-declared user
1065         declaration.
1066         (declare_global_var): Use push/pop_abi_namespace.
1067         (get_atexit_node): Push the fndecl into a namespace.
1068         * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
1069         decl.c.
1070
1071 2021-02-08  Marek Polacek  <polacek@redhat.com>
1072
1073         * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
1074
1075 2021-02-05  Marek Polacek  <polacek@redhat.com>
1076
1077         PR c++/98947
1078         * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
1079         on arg2/arg3.
1080         * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
1081         issuing the -Wvolatile warning.  Only set TREE_THIS_VOLATILE if
1082         a warning was emitted.
1083
1084 2021-02-05  Marek Polacek  <polacek@redhat.com>
1085
1086         PR c++/96462
1087         * name-lookup.c (lookup_using_decl): Hoist the destructor check.
1088
1089 2021-02-05  Jakub Jelinek  <jakub@redhat.com>
1090
1091         PR c++/97878
1092         * decl.c (check_array_initializer): For structured bindings, require
1093         the array type to be complete.
1094
1095 2021-02-04  Jason Merrill  <jason@redhat.com>
1096
1097         PR c++/98717
1098         * constraint.cc (build_concept_check_arguments): Remove assert.
1099         (build_concept_check): Allow empty args.
1100
1101 2021-02-04  Tom Greenslade (thomgree)  <thomgree@cisco.com>
1102
1103         PR c++/90926
1104         * call.c (can_convert_array): Extend to handle all valid aggregate
1105         initializers of an array; including by string literals, not just by
1106         brace-init-list.
1107         (build_aggr_conv): Call can_convert_array more often, not just in
1108         brace-init-list case.
1109         * typeck2.c (array_string_literal_compatible_p): New function.
1110         (digest_init_r): call array_string_literal_compatible_p
1111         * cp-tree.h: (array_string_literal_compatible_p): Declare.
1112
1113 2021-02-04  Jason Merrill  <jason@redhat.com>
1114
1115         PR c++/98802
1116         * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
1117
1118 2021-02-04  Jason Merrill  <jason@redhat.com>
1119
1120         PR c++/95192
1121         * pt.c (tsubst_attribute): Handle error.
1122         (apply_late_template_attributes): Return false on error.
1123         (tsubst_function_decl): Check its return value.
1124         (tsubst_decl): Likewise.
1125         (push_template_decl): Assert current_template_parms.
1126         (tsubst_template_decl): Set current_template_parms.
1127
1128 2021-02-03  Marek Polacek  <polacek@redhat.com>
1129
1130         PR c++/98951
1131         * call.c (struct z_candidate): Mark rewritten and reversed as const.
1132         (struct NonPublicField): Mark operator() as const.
1133         (struct NonTrivialField): Likewise.
1134
1135 2021-02-03  Jason Merrill  <jason@redhat.com>
1136
1137         PR c++/98926
1138         PR c++/98570
1139         * pt.c (spec_hasher::equal): Set processing_template_decl.
1140         * Make-lang.in (check-g++-strict-gc): Add --param
1141         hash-table-verification-limit=10000.
1142
1143 2021-02-03  Marek Polacek  <polacek@redhat.com>
1144
1145         PR c++/98899
1146         * parser.c (cp_parser_class_specifier_1): Use any possible
1147         DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
1148         (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
1149         * pt.c (tsubst_exception_specification): Stash new_specs into
1150         DEFPARSE_INSTANTIATIONS.
1151         * tree.c (fixup_deferred_exception_variants): Use
1152         UNPARSED_NOEXCEPT_SPEC_P.
1153
1154 2021-02-02  Jason Merrill  <jason@redhat.com>
1155
1156         PR c++/98929
1157         PR c++/96199
1158         * error.c (dump_expr): Ignore dummy object.
1159         * pt.c (tsubst_baselink): Handle dependent scope.
1160
1161 2021-02-01  Patrick Palka  <ppalka@redhat.com>
1162
1163         PR c++/98295
1164         * constexpr.c (cxx_eval_array_reference): Also set
1165         new_ctx.object when setting new_ctx.ctor.
1166
1167 2021-02-01  Marek Polacek  <polacek@redhat.com>
1168
1169         PR c++/98355
1170         * parser.c (cp_parser_has_attribute_expression): Use
1171         uses_template_parms instead of type_dependent_expression_p.
1172
1173 2021-02-01  Jason Merrill  <jason@redhat.com>
1174
1175         PR c++/98570
1176         * cp-tree.h: Declare it.
1177         * pt.c (comparing_dependent_aliases): New flag.
1178         (template_args_equal, spec_hasher::equal): Set it.
1179         (dependent_alias_template_spec_p): Assert that we don't
1180         get non-types other than error_mark_node.
1181         (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
1182         on complex alias specializations.  Set TYPE_DEPENDENT_P here.
1183         (tsubst_decl): Not here.
1184         * module.cc (module_state::read_cluster): Set
1185         comparing_dependent_aliases instead of
1186         comparing_specializations.
1187         * tree.c (cp_tree_equal): Remove comparing_specializations
1188         module handling.
1189         * typeck.c (structural_comptypes): Adjust.
1190         (comptypes): Remove comparing_specializations handling.
1191
1192 2021-01-29  Nathan Sidwell  <nathan@acm.org>
1193
1194         PR c++/98843
1195         * module.cc (module_state_config): Add num_entities field.
1196         (module_state::read_entities): The entity_ary span is
1197         already allocated.
1198         (module_state::write_config): Write num_entities.
1199         (module_state::read_config): Read num_entities.
1200         (module_state::write): Set config's num_entities.
1201         (module_state::read_initial): Allocate the entity ary
1202         span here.
1203         (module_state::read_language): Do not set entity_lwm
1204         here.
1205
1206 2021-01-29  Marek Polacek  <polacek@redhat.com>
1207
1208         PR c++/96137
1209         * parser.c (cp_parser_class_name): If parser->scope is
1210         error_mark_node, return it, otherwise continue.
1211
1212 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
1213
1214         PR c++/98841
1215         * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
1216
1217 2021-01-28  Jakub Jelinek  <jakub@redhat.com>
1218
1219         PR c++/33661
1220         PR c++/98847
1221         * decl.c (cp_finish_decl): For register vars with asmspec in templates
1222         call set_user_assembler_name and set DECL_HARD_REGISTER.
1223         * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
1224         pass asmspec_tree to cp_finish_decl.
1225
1226 2021-01-28  Nathan Sidwell  <nathan@acm.org>
1227
1228         PR c++/98770
1229         * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
1230         check order.
1231         (trees_in::decl_value): Do typedef frobbing only when installing
1232         a new typedef, adjust is_matching_decl call.  Swap is_typedef
1233         & TYPE_NAME check.
1234         (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
1235         names and deal with typedef checking.
1236
1237 2021-01-27  Jason Merrill  <jason@redhat.com>
1238
1239         PR c++/97874
1240         * name-lookup.c (lookup_using_decl): Clean up handling
1241         of dependency and inherited constructors.
1242         (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
1243         * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
1244
1245 2021-01-26  Jason Merrill  <jason@redhat.com>
1246
1247         PR c++/97474
1248         * call.c (type_passed_as): Don't mark invisiref restrict.
1249
1250 2021-01-26  Jason Merrill  <jason@redhat.com>
1251
1252         PR c++/97566
1253         PR c++/98463
1254         * class.c (layout_class_type): An empty field gets size 0.
1255         (is_empty_field): New.
1256         (check_bases): Check it.
1257         * cp-tree.h (is_empty_field): Declare it.
1258         * constexpr.c (cxx_eval_store_expression): Check it.
1259         (cx_check_missing_mem_inits): Likewise.
1260         * init.c (perform_member_init): Likewise.
1261         * typeck2.c (process_init_constructor_record): Likewise.
1262
1263 2021-01-25  Martin Sebor  <msebor@redhat.com>
1264
1265         PR c++/98646
1266         * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
1267
1268 2021-01-25  Jason Merrill  <jason@redhat.com>
1269
1270         PR c++/98463
1271         * constexpr.c (get_or_insert_ctor_field): Add check.
1272         (cxx_eval_store_expression): Handle discontinuity of refs.
1273
1274 2021-01-23  Anthony Sharp  <anthonysharp15@gmail.com>
1275
1276         * call.c (complain_about_access): Altered function.
1277         * cp-tree.h (complain_about_access): Changed parameters of function.
1278         (get_parent_with_private_access): Declared new function.
1279         * search.c (get_parent_with_private_access): Defined new function.
1280         * semantics.c (enforce_access): Modified function.
1281         * typeck.c (complain_about_unrecognized_member): Updated function
1282         arguments in complain_about_access.
1283
1284 2021-01-23  Patrick Palka  <ppalka@redhat.com>
1285
1286         PR c++/97399
1287         * cp-tree.h (shared_member_p): Adjust declaration.
1288         * parser.c (cp_parser_init_declarator): If the storage class
1289         specifier is sc_static, pass true for static_p to
1290         cp_parser_declarator.
1291         (cp_parser_direct_declarator): Don't do inject_this_parm when
1292         the declarator is a friend.
1293         * search.c (shared_member_p): Change return type to bool and
1294         adjust function body accordingly.  Return false for a dependent
1295         USING_DECL instead of aborting.
1296         * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
1297         even when type-dependent.
1298
1299 2021-01-22  Marek Polacek  <polacek@redhat.com>
1300
1301         PR c++/96623
1302         * parser.c (inject_parm_decls): Remove a redundant assignment.
1303         (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
1304         before calling inject_parm_decls.
1305
1306 2021-01-22  Jason Merrill  <jason@redhat.com>
1307
1308         PR c++/98744
1309         * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
1310
1311 2021-01-22  Jakub Jelinek  <jakub@redhat.com>
1312
1313         PR sanitizer/95693
1314         * init.c (build_zero_init_1): Revert the 2018-03-06 change to
1315         return build_zero_cst for reference types.
1316         * typeck2.c (process_init_constructor_record): Instead call
1317         build_zero_cst here during error recovery instead of build_zero_init.
1318
1319 2021-01-22  Marek Polacek  <polacek@redhat.com>
1320
1321         PR c++/98545
1322         * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
1323         warnings regardless of abi_version_at_least.
1324         (write_expression): When the expression is a dependent name
1325         and an operator name, write "on" before writing its name.
1326
1327 2021-01-22  Marek Polacek  <polacek@redhat.com>
1328
1329         PR c++/97966
1330         * pt.c (instantiate_class_template_1): Instantiate members
1331         marked with attribute used only after we're done instantiating
1332         the class.
1333
1334 2021-01-21  Patrick Palka  <ppalka@redhat.com>
1335
1336         PR c++/71879
1337         * semantics.c (finish_decltype_type): Set up a cp_unevaluated
1338         sentinel at the start of the function.  Remove a now-redundant
1339         manual adjustment of cp_unevaluated_operand.
1340
1341 2021-01-21  Nathan Sidwell  <nathan@acm.org>
1342
1343         PR c++/98624
1344         * module.cc (depset::hash::find_dependencies): Add
1345         module arg.
1346         (trees_out::core_vals): Check state before calling
1347         write_location.
1348         (sort_cluster, module_state::write): Adjust
1349         find_dependencies call.
1350
1351 2021-01-21  Jakub Jelinek  <jakub@redhat.com>
1352
1353         PR c++/98672
1354         * constexpr.c (check_for_return_continue_data): Add break_stmt member.
1355         (check_for_return_continue): Also look for BREAK_STMT.  Handle
1356         SWITCH_STMT by ignoring break_stmt from its body.
1357         (potential_constant_expression_1) <case FOR_STMT>,
1358         <case WHILE_STMT>: If the condition isn't constant true, check if
1359         the loop body can contain a return stmt.
1360         <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
1361         <case IF_STMT>: If recursion with tf_none is successful,
1362         merge *jump_target from the branches - returns with highest priority,
1363         breaks or continues lower.  If then branch is potentially constant and
1364         doesn't return, check the else branch if it could return, break or
1365         continue.
1366
1367 2021-01-21  Nathan Sidwell  <nathan@acm.org>
1368
1369         PR c++/98530
1370         * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
1371
1372 2021-01-20  Nathan Sidwell  <nathan@acm.org>
1373
1374         * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
1375         signed type.
1376
1377 2021-01-20  Patrick Palka  <ppalka@redhat.com>
1378
1379         PR c++/95434
1380         * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
1381         CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
1382         adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
1383
1384 2021-01-20  Patrick Palka  <ppalka@redhat.com>
1385
1386         PR c++/82613
1387         * parser.c (cp_parser_class_head): Defer access checking when
1388         parsing the base-clause until all bases are seen and attached
1389         to the class type.
1390         * pt.c (instantiate_class_template): Likewise when substituting
1391         into dependent bases.
1392
1393 2021-01-20  Jakub Jelinek  <jakub@redhat.com>
1394
1395         PR c++/98742
1396         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
1397         error_operand_p, remove clause without further checking.  Check
1398         for non-NULL TYPE_NAME.
1399
1400 2021-01-19  Marek Polacek  <polacek@redhat.com>
1401
1402         PR c++/98659
1403         * pt.c (maybe_instantiate_noexcept): Return false if FN is
1404         error_mark_node.
1405
1406 2021-01-19  Marek Polacek  <polacek@redhat.com>
1407
1408         PR c++/98687
1409         * name-lookup.c (push_using_decl_bindings): New, broken out of...
1410         (finish_nonmember_using_decl): ...here.
1411         * name-lookup.h (push_using_decl_bindings): Update declaration.
1412         * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
1413
1414 2021-01-19  Patrick Palka  <ppalka@redhat.com>
1415
1416         PR c++/41437
1417         PR c++/58993
1418         * search.c (friend_accessible_p): If scope is a hidden friend
1419         defined inside a dependent class, consider access from the
1420         class.
1421         * parser.c (cp_parser_late_parsing_for_member): Don't push a
1422         dk_no_check access state.
1423
1424 2021-01-19  Marek Polacek  <polacek@redhat.com>
1425
1426         PR c++/98333
1427         * parser.c (cp_parser_class_specifier_1): Perform late-parsing
1428         of NSDMIs before late-parsing of noexcept-specifiers.
1429
1430 2021-01-19  Nathan Sidwell  <nathan@acm.org>
1431
1432         * module.cc (identifier): Merge overloads.
1433
1434 2021-01-19  Nathan Sidwell  <nathan@acm.org>
1435
1436         PR c++/98624
1437         * module.cc (trees_out::write_location): Make static.
1438
1439 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
1440
1441         * parser.c (cp_parser_omp_clause_detach): New.
1442         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
1443         (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
1444         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
1445         * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
1446         Prevent use of detach with mergeable and overriding the data sharing
1447         mode of the event handle.
1448
1449 2021-01-15  Nathan Sidwell  <nathan@acm.org>
1450
1451         PR c++/98538
1452         * tree.c (cp_build_qualified_type_real): Propagate an array's
1453         dependentness to the copy, if known.
1454
1455 2021-01-15  Jason Merrill  <jason@redhat.com>
1456
1457         PR c++/98642
1458         * call.c (unsafe_return_slot_p): Return int.
1459         (init_by_return_slot_p): Split out from...
1460         (unsafe_copy_elision_p): ...here.
1461         (unsafe_copy_elision_p_opt): New name for old meaning.
1462         (build_over_call): Adjust.
1463         (make_safe_copy_elision): New.
1464         * typeck2.c (split_nonconstant_init_1): Elide copy from safe
1465         list-initialization.
1466         * cp-tree.h: Adjust.
1467
1468 2021-01-15  Jason Merrill  <jason@redhat.com>
1469
1470         * call.c (base_ctor_for, make_base_init_ok): New.
1471         (build_over_call): Use make_base_init_ok.
1472
1473 2021-01-15  Jason Merrill  <jason@redhat.com>
1474
1475         PR c++/63707
1476         * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
1477         if we got a CONSTRUCTOR.
1478
1479 2021-01-15  Nathan Sidwell  <nathan@acm.org>
1480
1481         PR c++/98591
1482         * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
1483
1484 2021-01-14  Jason Merrill  <jason@redhat.com>
1485
1486         * typeck2.c (process_init_constructor_record): Use fldtype
1487         variable consistently.
1488
1489 2021-01-14  Nathan Sidwell  <nathan@acm.org>
1490
1491         PR c++/98372
1492         * tree.c (cp_tree_equal): Correct map_context logic.
1493
1494 2021-01-13  Marek Polacek  <polacek@redhat.com>
1495
1496         PR c++/98231
1497         * name-lookup.c (push_using_decl_bindings): New.
1498         * name-lookup.h (push_using_decl_bindings): Declare.
1499         * pt.c (tsubst_expr): Call push_using_decl_bindings.
1500
1501 2021-01-13  Nathan Sidwell  <nathan@acm.org>
1502
1503         PR c++/98626
1504         * module.cc (module_add_import_initializers):  Pass a
1505         zero-element argument vector.
1506
1507 2021-01-12  Patrick Palka  <ppalka@redhat.com>
1508
1509         PR c++/98611
1510         * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
1511         the template of a CTAD placeholder.
1512
1513 2021-01-12  Marek Polacek  <polacek@redhat.com>
1514
1515         PR c++/98620
1516         * typeck2.c (process_init_constructor_record): Don't emit
1517         -Wmissing-field-initializers warnings in unevaluated contexts.
1518
1519 2021-01-11  Jakub Jelinek  <jakub@redhat.com>
1520
1521         PR c++/98481
1522         * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
1523         for types.
1524         (mark_abi_tags_r): Likewise.
1525         * decl2.c (min_vis_r): Likewise.
1526         * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
1527         typedefs.
1528
1529 2021-01-08  Patrick Palka  <ppalka@redhat.com>
1530
1531         PR c++/98551
1532         * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
1533         instead of AGGREGATE_TYPE_P before calling replace_result_decl.
1534
1535 2021-01-08  Patrick Palka  <ppalka@redhat.com>
1536
1537         PR c++/98515
1538         * semantics.c (check_accessibility_of_qualified_id): Punt if
1539         we're checking access of a scoped non-static member inside a
1540         class template.
1541
1542 2021-01-07  Jakub Jelinek  <jakub@redhat.com>
1543
1544         PR c++/98329
1545         * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
1546         cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
1547         its location.
1548         (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
1549
1550 2021-01-07  Marek Polacek  <polacek@redhat.com>
1551
1552         PR c++/98441
1553         * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
1554         !late_return_type block.
1555
1556 2021-01-07  Jason Merrill  <jason@redhat.com>
1557
1558         * constexpr.c (cxx_bind_parameters_in_call): Add comment.
1559         (cxx_eval_store_expression): Add comment.
1560
1561 2021-01-07  Jason Merrill  <jason@redhat.com>
1562
1563         * call.c (has_next): Factor out from...
1564         (next_conversion): ...here.
1565         (strip_standard_conversion): And here.
1566         (is_subseq): And here.
1567         (build_conv): Check it.
1568         (standard_conversion): Don't call build_conv
1569         for ck_identity.
1570
1571 2021-01-06  Martin Sebor  <msebor@redhat.com>
1572
1573         PR c++/95768
1574         * error.c (dump_expr): Call c_pretty_printer::unary_expression.
1575
1576 2021-01-05  Patrick Palka  <ppalka@redhat.com>
1577
1578         * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
1579         the type of the NTTP, substitute into the type again.  If the
1580         type is still dependent, don't unify the NTTP.
1581
1582 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
1583
1584         * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
1585         $(CODYLIB) after $(BACKEND).
1586
1587 2021-01-05  Jakub Jelinek  <jakub@redhat.com>
1588
1589         PR c++/98469
1590         * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
1591         Punt if lval is true.
1592         * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
1593         the result if it has a class type.
1594
1595 2021-01-05  Marek Polacek  <polacek@redhat.com>
1596
1597         PR c++/82099
1598         * pt.c (resolve_overloaded_unification): Call
1599         maybe_instantiate_noexcept after instantiating the function
1600         decl.
1601
1602 2021-01-05  Nathan Sidwell  <nathan@acm.org>
1603
1604         * parser.c (cp_parser_module_declaration): Alter diagnostic
1605         text to say where is permissable.
1606
1607 2021-01-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1608
1609         PR c++/98316
1610         * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
1611
1612 2021-01-02  Jan Hubicka  <jh@suse.cz>
1613
1614         * cp-tree.h (cp_tree_c_finish_parsing): Declare.
1615         * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
1616         * tree.c (cp_tree_c_finish_parsing): New function.
1617
1618 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
1619
1620         * ChangeLog-2020: Rotate ChangeLog.  New file.
1621
1622 \f
1623 Copyright (C) 2021 Free Software Foundation, Inc.
1624
1625 Copying and distribution of this file, with or without modification,
1626 are permitted in any medium without royalty provided the copyright
1627 notice and this notice are preserved.