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