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