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