32bb9f5dfa81289603542333485faceb5d8d9306
[gcc.git] / gcc / cp / ChangeLog
1 2020-05-06 Jakub Jelinek <jakub@redhat.com>
2
3 PR c++/94907
4 * method.c (defaulted_late_check): Don't call synthesize_method
5 on constexpr sfk_comparison if it has been called on it already.
6
7 2020-05-06 Nathan Sidwell <nathan@acm.org>
8
9 PR c++/94946
10 * decl.c (grokdeclarator): Don't splice template attributes in
11 parm context -- they can apply to the parm.
12
13 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
14
15 * coroutines.cc: Remove references to n4849 throughout.
16
17 2020-05-05 Jason Merrill <jason@redhat.com>
18
19 CWG 2235
20 * pt.c (more_specialized_fn): Do consider parms with no deducible
21 template parameters.
22
23 2020-05-05 Jason Merrill <jason@redhat.com>
24
25 PR c++/90212
26 * constexpr.c (potential_constant_expression_1): In a lambda
27 function, consider a captured variable directly.
28
29 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
30
31 * coroutines.cc (transform_await_wrapper): Check that we have
32 no unlowered co_yields.
33 (captures_temporary): Likewise.
34 (register_awaits): Likewise.
35
36 2020-05-05 Nathan Sidwell <nathan@acm.org>
37
38 PR c++/94807
39 * coroutines.cc (morph_fn_to_coro): Just check for
40 closure_identifier.
41 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
42
43 2020-05-05 Marek Polacek <polacek@redhat.com>
44 Jason Merrill <jason@redhat.com>
45
46 PR c++/94799
47 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
48 a type-dependent object of class type, stash it to
49 parser->context->object_type. If the postfix expression doesn't have
50 a type, use typeof.
51 (cp_parser_class_name): Consider object scope too.
52 (cp_parser_lookup_name): Remove code dealing with the case when
53 object_type is unknown_type_node.
54
55 2020-05-04 Patrick Palka <ppalka@redhat.com>
56
57 PR c++/94038
58 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
59 declarations closer to their uses. Copy the CALL_EXPR only
60 when one of its arguments has changed.
61 <case TREE_VEC>: Instead of first collecting the folded
62 arguments into a releasing_vec, just make a copy of the TREE_VEC
63 as soon as folding changes one of its arguments.
64
65 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
66
67 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
68 as artificial and ignored.
69
70 2020-05-04 Nathan Sidwell <nathan@acm.org>
71
72 pt.c (process_template_parm): Don't walk the template list twice,
73 remember the final node instead.
74 (end_template_parm_list): Refactor. Comment on why we do a pop
75 and a push.
76
77 PR c++/94827 -- don't save parms in nested requirement
78 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
79 notmalized requirement.
80 (finish_nested_requirement): Don't stash current tpl parms into
81 the requirement.
82 (diagnose_nested_requirement): TYPE directly holds notmalized
83 requirement.
84
85 2020-05-01 Patrick Palka <ppalka@redhat.com>
86
87 PR c++/90880
88 * cp-tree.h (check_accessibility_of_qualified_id): Add
89 tsubst_flags_t parameter and change return type to bool.
90 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
91 check_accessibility_of_qualified_id.
92 * pt.c (tsubst_qualified_id): Return error_mark_node if
93 check_accessibility_of_qualified_id returns false.
94 * semantics.c (check_accessibility_of_qualified_id): Add
95 complain parameter. Pass complain instead of
96 tf_warning_or_error to perform_or_defer_access_check. Return
97 true unless perform_or_defer_access_check returns false.
98
99 2020-05-01 Marek Polacek <polacek@redhat.com>
100
101 PR c++/94885
102 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
103 if an initializer element was erroneous.
104
105 2020-05-01 Jason Merrill <jason@redhat.com>
106
107 PR c++/90479
108 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
109
110 2020-05-01 Jason Merrill <jason@redhat.com>
111
112 PR c++/91529
113 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
114 -fmerge-all-constants.
115
116 2020-05-01 Jason Merrill <jason@redhat.com>
117
118 PR c++/93822
119 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
120 the same type as the variable.
121
122 2020-04-30 Jason Merrill <jason@redhat.com>
123 Nathan Sidwell <nathan@acm.org>
124
125 PR c++/94827
126 * constraint.cc (map_arguments): If ARGS is null, it's a
127 self-mapping of parms.
128 (finish_nested_requirement): Do not pass argified
129 current_template_parms to normalization.
130 (tsubst_nested_requirement): Don't assert no template parms.
131
132 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
133
134 PR c++/94886
135 * coroutines.cc (transform_local_var_uses): Defer walking
136 the DECL_INITIALs of BIND_EXPR vars until all the frame
137 allocations have been made.
138
139 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
140
141 PR c++/94883
142 * coroutines.cc (register_awaits): Update target
143 expressions for awaitable and suspend handle
144 initializers.
145
146 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
147
148 PR c++/94879
149 * coroutines.cc (build_co_await): Account for variables
150 with DECL_VALUE_EXPRs.
151 (captures_temporary): Likewise.
152 (register_awaits): Likewise.
153
154 2020-04-29 Patrick Palka <ppalka@redhat.com>
155
156 PR c++/94830
157 * pt.c (find_template_parameter_info::parm_list): New field.
158 (keep_template_parm): Use the new field to build up the
159 parameter list here instead of ...
160 (find_template_parameters): ... here. Return ftpi.parm_list.
161
162 2020-04-29 Jakub Jelinek <jakub@redhat.com>
163
164 PR target/94707
165 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
166 base artificial FIELD_DECLs.
167 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
168 field_poverlapping_p FIELD_DECLs.
169
170 2020-04-29 Patrick Palka <ppalka@redhat.com>
171
172 PR c++/94819
173 * constraint.cc (satisfy_declaration_constraints): Use saved_t
174 instead of t as the key to decl_satisfied_cache.
175
176 PR c++/94808
177 * error.c (print_requires_expression_info): Print the dependent
178 form of the parameter list with its template parameter mapping,
179 rather than printing the substituted form.
180
181 2020-04-28 Jason Merrill <jason@redhat.com>
182
183 PR c++/94583
184 * decl.c (use_eh_spec_block): Check nothrow type after
185 DECL_DEFAULTED_FN.
186 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
187 DECL_MAYBE_DELETED fns here.
188 * decl2.c (mark_used): Not here.
189 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
190
191 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
192
193 PR c++/94760
194 * coroutines.cc (instantiate_coro_traits): Pass a reference to
195 object type rather than a pointer type for 'this', for method
196 coroutines.
197 (struct param_info): Add a field to hold that the parm is a lambda
198 closure pointer.
199 (morph_fn_to_coro): Check for lambda closure pointers in the
200 args. Use a reference to *this when building the args list for the
201 promise allocator lookup.
202
203 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
204
205 PR c++/94759
206 * coroutines.cc (coro_promise_type_found_p): Do not
207 exclude non-classes here (this needs to be handled in the
208 coroutine header).
209 (morph_fn_to_coro): Allow for the case where the coroutine
210 returns void.
211
212 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
213
214 PR c++/94701
215 * coroutines.cc (struct local_var_info): Add fields for static
216 variables and those with DECL_VALUE_EXPR redirection.
217 (transform_local_var_uses): Skip past typedefs and static vars
218 and then account for redirected variables.
219 (register_local_var_uses): Likewise.
220
221 2020-04-27 Jason Merrill <jason@redhat.com>
222
223 PR c++/90750
224 PR c++/79585
225 * decl.c (grokdeclarator): Move dependent attribute to decl.
226 * decl2.c (splice_template_attributes): No longer static.
227
228 2020-04-27 Patrick Palka <ppalka@redhat.com>
229
230 PR c++/94772
231 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
232 evaluating the target constructor of a delegating constructor.
233 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
234 INIT_EXPR is '*this'.
235
236 2020-04-26 Marek Polacek <polacek@redhat.com>
237
238 PR c++/90320
239 * call.c (struct conversion): Add copy_init_p.
240 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
241 if FLAGS demands LOOKUP_ONLYCONVERTING.
242 (convert_like_real) <case ck_base>: If copy_init_p is set, or
243 LOOKUP_ONLYCONVERTING into FLAGS.
244
245 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
246
247 PR c++/94752
248 * coroutines.cc (morph_fn_to_coro): Ensure that
249 unnamed function params have a usable and distinct
250 frame field name.
251
252 2020-04-24 Jason Merrill <jason@redhat.com>
253
254 PR c++/94583
255 * decl.c (redeclaration_error_message): Reject defaulted comparison
256 operator that has been previously declared.
257
258 2020-04-25 Patrick Palka <ppalka@redhat.com>
259
260 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
261 concepts if the invalid identifier is 'requires'.
262
263 2020-04-25 Jakub Jelinek <jakub@redhat.com>
264
265 PR c++/94742
266 * semantics.c (finish_call_expr): When looking if all overloads
267 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
268
269 2020-04-24 Martin Liska <mliska@suse.cz>
270
271 * coroutines.cc: Fix compilation error for release checking
272 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
273
274 2020-04-23 Patrick Palka <ppalka@redhat.com>
275
276 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
277 dependent_type_p.
278
279 PR c++/94645
280 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
281 friend declaration rather than into its CP_DECL_CONTEXT.
282
283 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
284
285 PR c++/94288
286 * coroutines.cc (await_statement_expander): Simplify cases.
287 (struct susp_frame_data): Add fields for truth and/or if
288 cases, rename one field.
289 (analyze_expression_awaits): New.
290 (expand_one_truth_if): New.
291 (add_var_to_bind): New helper.
292 (coro_build_add_if_not_cond_break): New helper.
293 (await_statement_walker): Handle conditional expressions,
294 handle expansion of truth-and/or-if cases.
295 (bind_expr_find_in_subtree): New, checking-only.
296 (coro_body_contains_bind_expr_p): New, checking-only.
297 (morph_fn_to_coro): Ensure that we have a top level bind
298 expression.
299
300 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
301
302 PR translation/94698
303 * class.c (check_field_decls): Change "define" to "declare" in
304 -Weffc++ diagnostics.
305
306 2020-04-22 Patrick Palka <ppalka@redhat.com>
307
308 PR c++/94719
309 PR c++/94549
310 * constraint.cc (satisfy_declaration_constraints): If the inherited
311 constructor points to an instantiation of a constructor template,
312 remember and use its attached template arguments.
313
314 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
315
316 PR translation/94698
317 * class.c (check_field_decls): Change "override" to "define" in
318 -Weffc++ diagnostics.
319
320 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
321
322 PR c++/94682
323 * coroutines.cc (struct param_info): Add a field to note that
324 the param is 'this'.
325 (morph_fn_to_coro): Convert this to a reference before using it
326 in the promise parameter preview.
327
328 2020-04-22 Jason Merrill <jason@redhat.com>
329
330 PR c++/94546
331 * pt.c (register_parameter_specializations): If the instantiation is
332 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
333 (tsubst_pack_expansion, tsubst_expr): Adjust.
334
335 2020-04-22 Martin Sebor <msebor@redhat.com>
336 Jason Merrill <jason@redhat.com>
337
338 PR c++/94510
339 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
340 zero initializers...
341 * mangle.c (write_expression): ...and handle them here even for
342 pointers to members by calling zero_init_expr_p.
343 * cp-tree.h (zero_init_expr_p): Declare.
344 * tree.c (zero_init_expr_p): Define.
345 (type_initializer_zero_p): Remove.
346 * pt.c (tparm_obj_values): New hash_map.
347 (get_template_parm_object): Store to it.
348 (tparm_object_argument): New.
349
350 2020-04-22 Patrick Palka <ppalka@redhat.com>
351
352 PR c++/67825
353 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
354 as well as in tsubst_valid_expression_requirement.
355
356 2020-04-21 Patrick Palka <ppalka@redhat.com>
357
358 PR c++/94549
359 * constraint.cc (satisfy_declaration_constraints): Don't strip the
360 inherited constructor if it already has template information.
361
362 PR c++/94597
363 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
364 is a conversion operator, visit its TREE_TYPE.
365
366 2020-04-21 Nathan Sidwell <nathan@acm.org>
367
368 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
369 error_mark_node.
370
371 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
372
373 PR c++/94661
374 * coroutines.cc (morph_fn_to_coro): Simplify return
375 value computation.
376
377 2020-04-17 Marek Polacek <polacek@redhat.com>
378
379 PR c++/94592
380 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
381 a BRACE_ENCLOSED_INITIALIZER_P.
382 (is_nondependent_constant_expression): Don't check
383 BRACE_ENCLOSED_INITIALIZER_P.
384 (is_nondependent_static_init_expression): Likewise.
385
386 2020-04-20 Patrick Palka <ppalka@redhat.com>
387
388 PR c++/94628
389 * cp-tree.h (lss_policy::lss_nop): New enumerator.
390 * pt.c (local_specialization_stack::local_specialization_stack): Handle
391 an lss_nop policy.
392 (local_specialization_stack::~local_specialization_stack): Likewise.
393 (tsubst_pack_expansion): Use a local_specialization_stack instead of
394 manually saving and restoring local_specializations. Conditionally
395 replace local_specializations sooner, before the handling of the
396 unsubstituted_packs case.
397
398 2020-04-20 Marek Polacek <polacek@redhat.com>
399
400 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
401 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
402 before calling build_x_binary_op.
403
404 2020-04-20 Marek Polacek <polacek@redhat.com>
405
406 * coroutines.cc (captures_temporary): Don't assign the result of
407 STRIP_NOPS to the same variable.
408
409 2020-04-20 Nathan Sidwell <nathan@acm.org>
410
411 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
412 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
413 (process_template_parm): tpl-tpl-parms are structural.
414 (rewrite_template_parm): Propagate structuralness.
415
416 PR c++/94454 - Expr pack expansion equality
417 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
418 [EXPR_PACK_EXPANSION]: Add.
419
420 PR c++/94454 Template Argument Hashing
421 * pt.c (iterative_hash_template_arg): Strip nodes as
422 template_args_equal does.
423 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
424 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
425 [node_class:default]: Refactor.
426
427 2020-04-18 Patrick Palka <ppalka@redhat.com>
428
429 PR c++/94632
430 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
431 comparing_specializations if the parameters' contexts are identical.
432
433 PR c++/92187
434 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
435 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
436
437 2020-04-17 Patrick Palka <ppalka@redhat.com>
438
439 PR c++/94483
440 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
441 the explicit initializer has parameter packs.
442
443 PR c++/88754
444 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
445 error, first try simulating an error instead.
446
447 2020-04-17 Jakub Jelinek <jakub@redhat.com>
448
449 PR other/94629
450 * call.c (build_conditional_expr_1): Remove redundant assignment to
451 arg2.
452
453 2020-04-16 Patrick Palka <ppalka@redhat.com>
454
455 PR c++/94475
456 * cvt.c (ocp_convert): If the result of scalar_constant_value is
457 erroneous, ignore it and use the original expression.
458
459 2020-04-16 Jakub Jelinek <jakub@redhat.com>
460
461 PR c++/94571
462 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
463 diagnostics.
464
465 2020-04-15 Jakub Jelinek <jakub@redhat.com>
466
467 PR c/94593
468 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
469 requires directive when not at file or namespace scope.
470
471 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
472
473 PR c++/94359
474 * coroutines.cc (build_actor_fn): Check that the target can
475 support the resume tailcall before mandating it.
476
477 2020-04-14 Patrick Palka <ppalka@redhat.com>
478
479 PR c++/85278
480 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
481 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
482 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
483 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
484 New no-op case.
485
486 PR c++/94034
487 * constexpr.c (replace_result_decl_data): New struct.
488 (replace_result_decl_data_r): New function.
489 (replace_result_decl): New function.
490 (cxx_eval_call_expression): Use it.
491 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
492 to that of its initializer.
493
494 2020-04-13 Marek Polacek <polacek@redhat.com>
495
496 PR c++/94588
497 * name-lookup.c (check_local_shadow): Add an inform call.
498
499 2020-04-13 Patrick Palka <ppalka@redhat.com>
500
501 PR c++/94521
502 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
503 dump_function_decl when printing a function template instantiation as a
504 scope.
505
506 PR c++/94470
507 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
508 'pos_hint' to -1.
509 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
510 assuming the the next index belongs at the end of the new CONSTRUCTOR.
511 (cxx_eval_store_expression): Revert PR c++/78572 fix.
512
513 2020-04-13 Nathan Sidwell <nathan@acm.org>
514
515 PR c++/94426 lambdas with internal linkage are different to no-linkage
516 * decl2.c (determine_visibility): A lambda's visibility is
517 affected by its extra scope.
518 * pt.c (instantiate_decl): Determine var's visibility before
519 instantiating its initializer.
520 * tree.c (no_linkage_check): Revert code looking at visibility of
521 lambda's extra scope.
522 `
523 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
524
525 PR c++/94528
526 * coroutines.cc (co_await_expander): Remove.
527 (expand_one_await_expression): New.
528 (process_one_statement): New.
529 (await_statement_expander): New.
530 (build_actor_fn): Revise to use per-statement expander.
531 (struct susp_frame_data): Reorder and comment.
532 (register_awaits): Factor code.
533 (replace_statement_captures): New, factored from...
534 (maybe_promote_captured_temps):.. here.
535 (await_statement_walker): Revise to process per statement.
536 (morph_fn_to_coro): Use revised susp_frame_data layout.
537
538 2020-04-10 Marek Polacek <polacek@redhat.com>
539
540 PR c++/94149
541 * method.c (constructible_expr): In C++20, try using parenthesized
542 initialization of aggregates to determine the result of
543 __is_constructible.
544
545 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
546
547 * coroutines.cc (co_await_expander): Simplify.
548
549 2020-04-09 Jason Merrill <jason@redhat.com>
550
551 PR c++/94523
552 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
553 ctx->object and ctx->global->values first.
554
555 2020-04-09 Marek Polacek <polacek@redhat.com>
556
557 PR c++/93790
558 * call.c (initialize_reference): If the reference binding failed, maybe
559 try initializing from { }.
560 * decl.c (grok_reference_init): For T& t(e), set
561 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
562
563 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
564 Jun Ma <JunMa@linux.alibaba.com>
565
566 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
567 expression, if needed, to any call from which we promoted
568 temporaries captured by reference.
569
570 2020-04-08 Marek Polacek <polacek@redhat.com>
571
572 PR c++/94507 - ICE-on-invalid with lambda template.
573 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
574 tsubst_function_decl returns error_mark_node.
575
576 2020-04-08 Martin Liska <mliska@suse.cz>
577
578 PR c++/94314
579 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
580 (cxx_init_decl_processing): Mark replaceable all implicitly defined
581 operators.
582
583 2020-04-08 Patrick Palka <ppalka@redhat.com>
584
585 Core issues 1001 and 1322
586 PR c++/92010
587 * pt.c (rebuild_function_or_method_type): Split function out from ...
588 (tsubst_function_type): ... here.
589 (maybe_rebuild_function_decl_type): New function.
590 (tsubst_function_decl): Use it.
591
592 2020-04-08 Jakub Jelinek <jakub@redhat.com>
593
594 PR c++/94325
595 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
596 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
597 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
598 BINFO_VIRTUAL_P, and so on.
599
600 2020-04-08 Marek Polacek <polacek@redhat.com>
601
602 PR c++/94478 - ICE with defaulted comparison operator
603 * method.c (early_check_defaulted_comparison): Give an error when the
604 context is null.
605
606 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
607
608 PR middle-end/94120
609 * paser.c (cp_parser_oacc_declare): Add check that variables
610 are declared in the same scope as the directive.
611
612 2020-04-07 Jason Merrill <jason@redhat.com>
613
614 PR c++/94480
615 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
616
617 PR c++/94481
618 * parser.c (cp_parser_placeholder_type_specifier): Use
619 matching_parens.
620
621 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
622
623 * coroutines.cc (maybe_promote_captured_temps): Ensure that
624 reference capture placeholder vars are properly declared.
625
626 2020-04-07 Patrick Palka <ppalka@redhat.com>
627
628 PR c++/90996
629 * tree.c (replace_placeholders): Look through all handled components,
630 not just COMPONENT_REFs.
631 * typeck2.c (process_init_constructor_array): Propagate
632 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
633 the array initializer.
634
635 2020-04-07 Jakub Jelinek <jakub@redhat.com>
636
637 PR c++/94512
638 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
639 if cp_parser_omp_master succeeded.
640
641 2020-04-06 Jason Merrill <jason@redhat.com>
642
643 PR c++/94462
644 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
645
646 2020-04-04 Marek Polacek <polacek@redhat.com>
647 Jason Merrill <jason@redhat.com>
648
649 PR c++/94155 - crash in gimplifier with paren init of aggregates.
650 * init.c (build_vec_init): Fill in indexes.
651
652 2020-04-04 Jason Merrill <jason@redhat.com>
653
654 PR c++/91377
655 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
656
657 2020-04-04 Patrick Palka <ppalka@redhat.com>
658
659 PR c++/94205
660 PR c++/79937
661 * constexpr.c (struct constexpr_ctx): New field 'parent'.
662 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
663 flag from the original constructor to the reduced constructor.
664 (lookup_placeholder): Prefer to return the outermost matching object
665 by recursively calling lookup_placeholder on the 'parent' context,
666 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
667 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
668 context via 'new_ctx.parent' when being expanded without an explicit
669 target. Don't call replace_placeholders.
670 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
671
672 PR c++/94219
673 PR c++/94205
674 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
675 support for VECTOR_TYPEs, and optimizations for the common case)
676 from ...
677 (cxx_eval_store_expression): ... here. Rename local variable
678 'changed_active_union_member_p' to 'activated_union_member_p'. Record
679 the sequence of indexes into 'indexes' that yields the subobject we're
680 assigning to. Record the integer offsets of the constructor indexes
681 we're assigning through into 'index_pos_hints'. After evaluating the
682 initializer of the store expression, recompute 'valp' using 'indexes'
683 and using 'index_pos_hints' as hints.
684 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
685 to recompute the constructor_elt pointer we're assigning through after
686 evaluating each initializer.
687
688 2020-04-04 Jason Merrill <jason@redhat.com>
689
690 PR c++/67825
691 * constraint.cc (tsubst_valid_expression_requirement): Call
692 convert_to_void.
693
694 2020-04-04 Jason Merrill <jason@redhat.com>
695
696 PR c++/94453
697 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
698 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
699 NON_LVALUE_EXPR.
700
701 2020-04-04 Jakub Jelinek <jakub@redhat.com>
702
703 PR debug/94441
704 * parser.c (cp_parser_omp_for_loop): Use
705 protected_set_expr_location_if_unset.
706 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
707
708 PR c++/94477
709 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
710 omp_parallel_combined_clauses.
711
712 2020-04-03 Jason Merrill <jason@redhat.com>
713
714 PR c++/91966
715 * pt.c (complex_pack_expansion_r): New.
716 (complex_alias_template_p): Use it.
717
718 2020-03-31 Jason Merrill <jason@redhat.com>
719
720 PR c++/94205
721 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
722 replace_placeholders.
723 * typeck2.c (store_init_value): Fix arguments to
724 fold_non_dependent_expr.
725
726 2020-03-31 Jason Merrill <jason@redhat.com>
727
728 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
729 local variables.
730
731 2020-03-30 Jason Merrill <jason@redhat.com>
732
733 PR c++/90711
734 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
735 (called_fns_equal): Check DECL_CONTEXT.
736
737 2020-03-30 Jakub Jelinek <jakub@redhat.com>
738
739 PR c++/94385
740 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
741 STATEMENT_CODE_P code.
742
743 2020-03-28 Patrick Palka <ppalka@redhat.com>
744
745 PR c++/94306
746 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
747 "requires {" when "requires requires {" was probably intended.
748
749 PR c++/94252
750 * constraint.cc (tsubst_compound_requirement): Always suppress errors
751 from type_deducible_p and expression_convertible_p, as they're not
752 substitution errors.
753 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
754 that we diagnose INTEGER_CST expressions of non-bool type via the
755 default case.
756 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
757 * parser.c (cp_parser_requires_expression): Always parse the requirement
758 body as if we're processing a template, by temporarily incrementing
759 processing_template_decl. Afterwards, if we're not actually in a
760 template context, perform semantic processing to diagnose any invalid
761 types and expressions.
762 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
763 * semantics.c (finish_static_assert): Explain an assertion failure
764 when the condition is a REQUIRES_EXPR like we do when it is a concept
765 check.
766
767 * constraint.cc (diagnose_compound_requirement): When diagnosing a
768 compound requirement, maybe replay the satisfaction failure, subject to
769 the current diagnosis depth.
770
771 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
772 as well as its range, because build_x_binary_op doesn't always do so.
773 (current_constraint_diagnosis_depth): New.
774 (concepts_diagnostics_max_depth_exceeded_p): New.
775 (collect_operands_of_disjunction): New.
776 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
777 replay each branch of the disjunction, subject to the current diagnosis
778 depth.
779 (diagnose_valid_expression): When diagnosing a satisfaction failure,
780 maybe replay the substitution error, subject to the current diagnosis
781 recursion.
782 (diagnose_valid_type): Likewise.
783 (diagnose_nested_requiremnet): Likewise.
784 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
785 current_constraint_diagnosis_depth when diagnosing.
786 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
787 current_constraint_diagnosis_depth when diagnosing.
788 (diagnosing_failed_constraint::replay_errors_p): New static member
789 function.
790 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
791 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
792 the limit was exceeded.
793 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
794
795 2020-03-27 Nathan Sidwell <nathan@acm.org>
796
797 PR c++/84733
798 * name-lookup.c (do_pushdecl): Look through cleanp levels.
799
800 2020-03-27 Martin Sebor <msebor@redhat.com>
801
802 PR c++/94078
803 PR c++/93824
804 PR c++/93810
805 * cp-tree.h (most_specialized_partial_spec): Declare.
806 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
807 from declarations.
808 (specialization_of): New function.
809 (cp_parser_check_class_key): Move code...
810 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
811 -Wredundant-tags on first-time declarations in other declarators.
812 Correct handling of template specializations.
813 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
814 when -Wredundant-tags is enabled. Use primary template or partial
815 specialization as the guide for uses of implicit instantiations.
816 * pt.c (most_specialized_partial_spec): Declare extern.
817
818 2020-03-27 Nathan Sidwell <nathan@acm.org>
819
820 PR c++/94257
821 * name-lookup.c (push_namespace): Triage ambiguous lookups that
822 contain namespaces.
823
824 2020-03-27 Jakub Jelinek <jakub@redhat.com>
825
826 PR c++/94326
827 * call.c (set_flags_from_callee): Don't update
828 cp_function_chain->can_throw or current_function_returns_abnormally
829 if cp_unevaluated_operand.
830
831 PR c++/94339
832 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
833 operand and creating a new COMPOUND_EXPR if anything changed.
834
835 2020-03-26 Marek Polacek <polacek@redhat.com>
836
837 PR c++/94336 - template keyword accepted before destructor names.
838 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
839 is followed by a destructor name.
840
841 2020-03-27 Patrick Palka <ppalka@redhat.com>
842
843 * decl.c (compute_array_index_type_loc): Remove redundant
844 type_dependent_expression_p check that is subsumed by
845 value_dependent_expression_p.
846 * decl2.c (is_late_template_attribute): Likewise.
847 * pt.c (uses_template_parms): Likewise.
848 (dependent_template_arg_p): Likewise.
849
850 2020-03-26 Marek Polacek <polacek@redhat.com>
851
852 DR 1710
853 PR c++/94057 - template keyword in a typename-specifier.
854 * parser.c (check_template_keyword_in_nested_name_spec): New.
855 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
856 'template'. Call check_template_keyword_in_nested_name_spec.
857 (cp_parser_simple_type_specifier): Assume that a <
858 following a qualified-id in a typename-specifier begins
859 a template argument list.
860
861 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
862
863 * coroutines.cc (coro_init_identifiers): Initialize an identifier
864 for the cororoutine handle 'address' method name.
865 (struct coro_aw_data): Add fields to cover the continuations.
866 (co_await_expander): Determine the kind of await_suspend in use.
867 If we have the case that returns a continuation handle, then save
868 this and make the target for 'scope exit without cleanup' be the
869 continuation resume label.
870 (expand_co_awaits): Remove.
871 (struct suspend_point_info): Remove fields that kept the returned
872 await_suspend handle type.
873 (transform_await_expr): Remove code tracking continuation handles.
874 (build_actor_fn): Add the continuation handle as an actor-function
875 scope var. Build the symmetric transfer continuation point. Call
876 the tree walk for co_await expansion directly, rather than via a
877 trivial shim function.
878 (register_await_info): Remove fields tracking continuation handles.
879 (get_await_suspend_return_type): Remove.
880 (register_awaits): Remove code tracking continuation handles.
881 (morph_fn_to_coro): Remove code tracking continuation handles.
882
883 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
884
885 * coroutines.cc (co_await_expander): If we are expanding the
886 initial await expression, set a boolean flag to show that we
887 have now reached the initial await_resume() method call.
888 (expand_co_awaits): Handle the 'initial await resume called' flag.
889 (build_actor_fn): Insert the initial await expression into the
890 start of the user-authored function-body. Handle the 'initial await
891 resume called' flag.
892 (morph_fn_to_coro): Initialise the 'initial await resume called'
893 flag. Modify the unhandled exception catch clause to recognise
894 exceptions that occur before the initial await_resume() and re-
895 throw them.
896
897 2020-03-26 Jakub Jelinek <jakub@redhat.com>
898
899 PR c++/81349
900 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
901 true for all TEMPLATE_DECLs.
902
903 PR c++/94272
904 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
905
906 2020-03-25 Patrick Palka <ppalka@redhat.com>
907
908 PR c++/94265
909 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
910 current condition chain when the if-statement has a non-empty
911 init-statement.
912
913 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
914
915 PR c++/94319
916 * coroutines.cc (captures_temporary): Fix a missing dereference.
917
918 2020-03-24 Marek Polacek <polacek@redhat.com>
919
920 PR c++/94190 - wrong no post-decrement operator error in template.
921 * call.c (convert_like_real): Use convert_from_reference on the result.
922
923 2020-03-24 Jason Merrill <jason@redhat.com>
924
925 PR c++/94186
926 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
927 error.
928 (tsubst_nested_requirement): Likewise.
929 (get_constraint_error_location): Allow missing context.
930 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
931 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
932
933 2020-03-24 Jason Merrill <jason@redhat.com>
934
935 * pt.c (any_template_parm_r): Look into the type of a non-type
936 template parm.
937
938 2020-03-24 Jason Merrill <jason@redhat.com>
939
940 * cp-tree.h (cp_expr): When constructing from an expr and a
941 location, call protected_set_expr_location.
942
943 2020-03-23 Patrick Palka <ppalka@redhat.com>
944
945 PR c++/93805
946 * except.c (maybe_noexcept_warning): Add TODO.
947 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
948
949 2020-03-23 nathans <nathan@acm.org>
950
951 PR c++/94044
952 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
953 operand.
954
955 2020-03-21 Patrick Palka <ppalka@redhat.com>
956
957 PR c++/94066
958 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
959 handle unions without an initializer.
960 (cxx_eval_component_reference): Emit a different diagnostic when the
961 constructor element corresponding to a union member is NULL.
962 (cxx_eval_bare_aggregate): When constructing a union, always set the
963 active union member before evaluating the initializer. Relax assertion
964 that verifies the index of the constructor element we're initializing
965 hasn't been changed.
966 (cxx_eval_store_expression): Diagnose changing the active union member
967 while the union is in the process of being initialized. After setting
968 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
969 CONSTRUCTOR.
970 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
971 CONSTRUCTOR returned by lookup_placeholder.
972
973 2020-03-20 Patrick Palka <ppalka@redhat.com>
974
975 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
976 the "[with ]" bits to here from ...
977 (pp_cxx_atomic_constraint): ... here.
978 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
979 * error.c (rebuild_concept_check): Delete.
980 (print_concept_check_info): Print the dependent form of the constraint and the
981 preferably substituted parameter mapping alongside it.
982
983 2020-03-19 Jason Merrill <jason@redhat.com>
984
985 PR c++/94175
986 * cp-gimplify.c (simple_empty_class_p): Look through
987 SIMPLE_TARGET_EXPR_P.
988 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
989 [RETURN_EXPR]: Avoid producing 'return *retval;'.
990 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
991 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
992 is non-null.
993
994 2020-03-19 Jakub Jelinek <jakub@redhat.com>
995
996 PR c++/93931
997 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
998 on outer_automatic_var_p decls.
999 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
1000 capture proxy decls.
1001
1002 2020-03-18 Nathan Sidwell <nathan@acm.org>
1003
1004 PR c++/94147 - mangling of lambdas assigned to globals
1005 * parser.c (cp_parser_init_declarator): Namespace-scope variables
1006 provide a lambda scope.
1007 * tree.c (no_linkage_check): Lambdas with a variable for extra
1008 scope have a linkage from the variable.
1009
1010 2020-03-18 Jakub Jelinek <jakub@redhat.com>
1011
1012 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
1013 strictly_subsumes): Fix up duplicated word issue in a comment.
1014 * coroutines.cc (build_init_or_final_await, captures_temporary):
1015 Likewise.
1016 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
1017 * pt.c (append_type_to_template_for_access_check): Likewise.
1018
1019 PR c++/91759
1020 * decl.c (grokfndecl): Restore old diagnostics about deduction
1021 guide declared in different scope if in_namespace is NULL_TREE.
1022
1023 2020-03-17 Jakub Jelinek <jakub@redhat.com>
1024
1025 PR c++/90995
1026 * parser.c (cp_parser_enum_specifier): Use temp_override for
1027 parser->colon_corrects_to_scope_p, replace goto out with return.
1028 If scoped enum or enum with underlying type is not followed by
1029 { or ;, call cp_parser_commit_to_tentative_parse before calling
1030 cp_parser_error and make sure to return error_mark_node instead of
1031 NULL_TREE. Formatting fixes.
1032
1033 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
1034
1035 PR c++/94197
1036 * method.c (assignable_expr): Use cp_unevaluated.
1037 (is_xible_helper): Push a non-deferred access check for
1038 the stub objects created by assignable_expr and constructible_expr.
1039
1040 2020-03-17 Jakub Jelinek <jakub@redhat.com>
1041
1042 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
1043 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
1044 in a comment.
1045 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
1046 cp_parser_placeholder_type_specifier,
1047 cp_parser_constraint_requires_parens): Likewise.
1048 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
1049
1050 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
1051
1052 * coroutines.cc (co_await_expander): Fix indentation.
1053
1054 2020-03-14 Jason Merrill <jason@redhat.com>
1055
1056 PR c++/92068
1057 * pt.c (process_partial_specialization): Error rather than crash on
1058 extra pack expansion.
1059
1060 2020-03-14 Jason Merrill <jason@redhat.com>
1061
1062 PR c++/92909
1063 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
1064 DECL_ORIGINAL_TYPE of a typedef.
1065
1066 2020-03-14 Jason Merrill <jason@redhat.com>
1067
1068 PR c++/93248
1069 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
1070 substituting DECL_ARGUMENTS.
1071
1072 2020-03-14 Jakub Jelinek <jakub@redhat.com>
1073
1074 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
1075 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
1076 literal.
1077
1078 2020-03-13 Patrick Palka <ppalka@redhat.com>
1079
1080 PR c++/67960
1081 * call.c (build_over_call): Use a warning_sentinel to disable
1082 warn_deprecated_decl before calling build_addr_func.
1083
1084 2020-03-12 Jakub Jelinek <jakub@redhat.com>
1085
1086 PR c++/94124
1087 * decl.c (reshape_init_array_1): Don't unshare constructor if there
1088 aren't any trailing zero elts, otherwise only unshare the first
1089 nelts.
1090
1091 2020-03-11 Jason Merrill <jason@redhat.com>
1092
1093 PR c++/93907
1094 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
1095 argument.
1096
1097 2020-03-11 Marek Polacek <polacek@redhat.com>
1098 Jason Merrill <jason@redhat.com>
1099
1100 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
1101 * constexpr.c (cref_has_const_field): New function.
1102 (modifying_const_object_p): Consider a COMPONENT_REF
1103 const only if any of its fields are const.
1104 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
1105 as readonly after its initialization has been done.
1106
1107 2020-03-10 Marek Polacek <polacek@redhat.com>
1108
1109 PR c++/94124 - wrong conversion error with non-viable overload.
1110 * decl.c (reshape_init_array_1): Unshare a constructor if we
1111 stripped trailing zero-initializers.
1112
1113 2020-03-10 Jason Merrill <jason@redhat.com>
1114
1115 PR c++/93901
1116 * pt.c (maybe_instantiate_noexcept): Always update clones.
1117
1118 2020-03-10 Jason Merrill <jason@redhat.com>
1119
1120 PR c++/93596
1121 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
1122
1123 2020-03-10 Jason Merrill <jason@redhat.com>
1124
1125 PR c++/93922
1126 PR c++/94041
1127 PR c++/52320
1128 PR c++/66139
1129 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
1130 66139: Don't split_nonconstant_init. Remove pre_p parameter.
1131
1132 2020-03-09 Marek Polacek <polacek@redhat.com>
1133
1134 PR c++/92031 - bogus taking address of rvalue error.
1135 PR c++/91465 - ICE with template codes in check_narrowing.
1136 PR c++/93870 - wrong error when converting template non-type arg.
1137 PR c++/94068 - ICE with template codes in check_narrowing.
1138 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
1139 in a template when not ck_identity and we're dealing with a class.
1140 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
1141 in a template if we need a temporary.
1142 * decl.c (compute_array_index_type_loc): Remove
1143 instantiate_non_dependent_expr_sfinae call. Call
1144 fold_non_dependent_expr instead of maybe_constant_value.
1145 (build_explicit_specifier): Don't instantiate or create a sentinel
1146 before converting the expression.
1147 * except.c (build_noexcept_spec): Likewise.
1148 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
1149 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
1150 build_converted_constant_expr returned.
1151 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
1152 of maybe_constant_value.
1153
1154 2020-03-09 Jakub Jelinek <jakub@redhat.com>
1155
1156 PR c++/94067
1157 Revert
1158 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
1159
1160 * constexpr.c (cxx_eval_constant_expression): Do not handle
1161 RROTATE_EXPR and LROTATE_EXPR.
1162
1163 2020-03-09 Marek Polacek <polacek@redhat.com>
1164
1165 PR c++/94050 - ABI issue with alignas on armv7hl.
1166 * class.c (layout_class_type): Don't replace a class's
1167 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
1168
1169 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
1170
1171 * coroutines.cc (build_actor_fn): Factor out code inserting the
1172 default return_void call to...
1173 (morph_fn_to_coro): ...here, also hoist local var declarations.
1174
1175 2020-03-08 Patrick Palka <ppalka@redhat.com>
1176
1177 PR c++/93729
1178 * call.c (convert_like_real): Check complain before emitting an error
1179 about binding a bit-field to a reference.
1180
1181 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
1182 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
1183 TYPE_NAME.
1184
1185 2020-03-06 Nathan Sidwell <nathan@acm.org>
1186
1187 PR c++/94027
1188 * mangle.c (find_substitution): Don't call same_type_p on template
1189 args that cannot match.
1190
1191 2020-03-04 Martin Sebor <msebor@redhat.com>
1192
1193 PR c++/90938
1194 * tree.c (type_initializer_zero_p): Fail for structs initialized
1195 with non-structs.
1196
1197 2020-03-04 Jason Merrill <jason@redhat.com>
1198
1199 PR c++/90432
1200 * init.c (perform_member_init): Don't do aggregate initialization of
1201 empty field.
1202 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
1203 initialization of empty field.
1204
1205 2020-03-04 Martin Liska <mliska@suse.cz>
1206
1207 * method.c: Wrap array in ctor with braces in order
1208 to silent clang warnings.
1209
1210 2020-03-03 Jason Merrill <jason@redhat.com>
1211 Marek Polacek <polacek@redhat.com>
1212
1213 PR c++/90505 - mismatch in template argument deduction.
1214 * pt.c (tsubst): Don't reduce the template level of template
1215 parameters when tf_partial.
1216
1217 2020-03-03 Jakub Jelinek <jakub@redhat.com>
1218
1219 PR c++/93998
1220 * constexpr.c (cxx_eval_constant_expression)
1221 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
1222 *non_constant_p is true.
1223
1224 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
1225
1226 * coroutines.cc (captures_temporary): Strip component_ref
1227 to its base object.
1228
1229 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
1230
1231 * coroutines.cc (finish_co_await_expr): Build co_await_expr
1232 with unknown_type_node.
1233 (finish_co_yield_expr): Ditto.
1234 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
1235 with unknown type as dependent.
1236
1237 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
1238
1239 * coroutines.cc (struct local_var_info): Adjust to remove the
1240 reference to the captured var, and just to note that this is a
1241 lambda capture proxy.
1242 (transform_local_var_uses): Handle lambda captures specially.
1243 (struct param_frame_data): Add a visited set.
1244 (register_param_uses): Also check for param uses in lambda
1245 capture proxies.
1246 (struct local_vars_frame_data): Remove captures list.
1247 (register_local_var_uses): Handle lambda capture proxies by
1248 noting and bypassing them.
1249 (morph_fn_to_coro): Update to remove lifetime extension of
1250 lambda capture-by-copy vars.
1251
1252 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
1253
1254 * coroutines.cc (build_co_await): Do not build frame
1255 awaitable proxy vars when the co_await expression is
1256 a function parameter or local var.
1257 (co_await_expander): Do not initialise a frame var with
1258 itself.
1259 (transform_await_expr): Only substitute the awaitable
1260 frame var if it's needed.
1261 (register_awaits): Do not make frame copies for param
1262 or local vars that are awaitables.
1263
1264 2020-02-28 Jason Merrill <jason@redhat.com>
1265
1266 Implement P2092R0, Disambiguating Nested-Requirements
1267 * parser.c (cp_parser_requirement_parameter_list): Pass
1268 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
1269
1270 * call.c (build_user_type_conversion_1): Don't look at the second
1271 conversion of a non-viable candidate.
1272
1273 2020-02-28 Jakub Jelinek <jakub@redhat.com>
1274
1275 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
1276 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
1277 functions in unevaluated contexts.
1278
1279 2020-02-27 Nathan Sidwell <nathan@acm.org>
1280
1281 PR c++/93933
1282 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
1283 cp_tree_equal.
1284 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
1285 * typeck.c (comptypes): Assert we don't get any argument packs.
1286
1287 * class.c (adjust_clone_args): Correct arg-checking assert.
1288 * typeck.c (comptypes): Assert not nulls.
1289
1290 2020-02-26 Marek Polacek <polacek@redhat.com>
1291
1292 PR c++/93789 - ICE with invalid array bounds.
1293 * decl.c (compute_array_index_type_loc): Don't use the folded
1294 size when folding cleared TREE_CONSTANT.
1295
1296 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
1297
1298 * class.c (classtype_has_non_deleted_copy_ctor): New.
1299 * coroutines.cc (struct param_info): Keep track of params
1300 that are references, and cache the original type and whether
1301 the DTOR is trivial.
1302 (build_actor_fn): Handle param copies always, and adjust the
1303 handling for references.
1304 (register_param_uses): Only handle uses here.
1305 (classtype_has_non_deleted_copy_ctor): New.
1306 (morph_fn_to_coro): Adjust param copy handling to match n4849
1307 by reordering ahead of the promise CTOR and always making a
1308 frame copy, even if the param is unused in the coroutine body.
1309 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
1310
1311 2020-02-26 Patrick Palka <ppalka@redhat.com>
1312
1313 * constraint.cc (finish_constraint_binary_op): Set expr's location range
1314 to the range of its operands.
1315 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
1316 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
1317 instead of the corresponding template arguments ARGS and adjust body
1318 accordingly.
1319 (diagnose_requires_expr): Likewise.
1320 (diagnose_atomic_constraint): Likewise. When printing an atomic
1321 constraint expression, print the instantiated parameter mapping
1322 alongside it.
1323 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
1324 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
1325 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
1326
1327 2020-02-26 Marek Polacek <polacek@redhat.com>
1328
1329 PR c++/93676 - value-init crash in template.
1330 * init.c (build_new_1): Don't call build_vec_init in a template.
1331
1332 2020-02-26 Marek Polacek <polacek@redhat.com>
1333
1334 PR c++/93862 - ICE with static_cast when converting from int[].
1335 * call.c (reference_compatible_p): No longer static.
1336 * cp-tree.h (reference_compatible_p): Declare.
1337 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
1338 of reference_related_p.
1339
1340 2020-02-26 Marek Polacek <polacek@redhat.com>
1341
1342 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
1343 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
1344 field.
1345
1346 2020-02-24 Martin Sebor <msebor@redhat.com>
1347
1348 PR c++/93804
1349 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
1350 in shared C/C++ code in headers.
1351 Remove a duplicate hunk of code.
1352
1353 2020-02-24 Marek Polacek <polacek@redhat.com>
1354
1355 PR c++/93869 - ICE with -Wmismatched-tags.
1356 * parser.c (cp_parser_check_class_key): Check class_key earlier.
1357
1358 2020-02-24 Marek Polacek <polacek@redhat.com>
1359
1360 PR c++/93712 - ICE with ill-formed array list-initialization.
1361 * call.c (next_conversion): Return NULL for ck_aggr.
1362 (build_aggr_conv): Set u.expr instead of u.next.
1363 (build_array_conv): Likewise.
1364 (build_complex_conv): Likewise.
1365 (conv_get_original_expr): Handle ck_aggr.
1366
1367 2020-02-24 Jakub Jelinek <jakub@redhat.com>
1368
1369 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
1370 * call.c (build_over_call): Don't evaluate immediate functions in
1371 unevaluated operands.
1372
1373 2020-02-24 Jason Merrill <jason@redhat.com>
1374
1375 P0780R2: Resolve lambda init-capture pack grammar.
1376 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
1377 ...&x=y.
1378
1379 2020-02-22 Marek Polacek <polacek@redhat.com>
1380
1381 PR c++/93882
1382 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
1383
1384 2020-02-21 Martin Sebor <msebor@redhat.com>
1385
1386 PR gcov-profile/93753
1387 * class.c (check_flexarrays): Tighten up a test for potential members
1388 of anonymous structs or unions.
1389
1390 2020-02-20 Martin Sebor <msebor@redhat.com>
1391
1392 PR c++/93801
1393 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
1394
1395 2020-02-20 Martin Liska <mliska@suse.cz>
1396
1397 PR translation/93841
1398 * config/or1k/or1k.opt: Remove superfluous word.
1399 * doc/invoke.texi: Likewise.
1400
1401 2020-02-20 Martin Liska <mliska@suse.cz>
1402
1403 PR translation/93838
1404 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
1405
1406 2020-02-19 Marek Polacek <polacek@redhat.com>
1407
1408 PR c++/93169 - wrong-code with a non-constexpr constructor.
1409 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
1410 on constant CONSTRUCTORs.
1411
1412 2020-02-15 Marek Polacek <polacek@redhat.com>
1413
1414 PR c++/93710 - poor diagnostic for array initializer.
1415 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
1416 for an error call.
1417
1418 2020-02-15 Jason Merrill <jason@redhat.com>
1419
1420 PR c++/92556
1421 * pt.c (any_template_parm_r): Look into lambda body.
1422
1423 PR c++/92583
1424 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
1425
1426 2020-02-14 Jakub Jelinek <jakub@redhat.com>
1427
1428 PR c++/61414
1429 * class.c (enum_min_precision): Change prec type from int to int &.
1430
1431 PR libstdc++/92906
1432 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
1433 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
1434 (fallback_dfloat32_type, fallback_dfloat64_type,
1435 fallback_dfloat128_type): Define.
1436 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
1437 dfloat*_type_node.
1438 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
1439 is disabled for compatibility.
1440
1441 2020-02-13 Jason Merrill <jason@redhat.com>
1442
1443 PR c++/93713
1444 * name-lookup.c (matching_fn_p): A function does not match a
1445 template.
1446
1447 PR c++/93643
1448 PR c++/91476
1449 * tree.c (decl_linkage): Always lk_none for locals.
1450
1451 2020-02-12 Jason Merrill <jason@redhat.com>
1452
1453 PR c++/92583
1454 PR c++/92654
1455 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
1456 * pt.c (find_parameter_packs_r): Not here.
1457
1458 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
1459
1460 * coroutines.cc (build_actor_fn): Implement deallocation function
1461 selection per n4849, dcl.fct.def.coroutine bullet 12.
1462 (morph_fn_to_coro): Implement allocation function selection per
1463 n4849, dcl.fct.def.coroutine bullets 9 and 10.
1464
1465 2020-02-12 Marek Polacek <polacek@redhat.com>
1466
1467 PR c++/93684 - ICE-on-invalid with broken attribute.
1468 * parser.c (cp_parser_std_attribute): Peek a token first before
1469 consuming it.
1470
1471 2020-02-11 Jason Merrill <jason@redhat.com>
1472
1473 PR c++/93675
1474 * class.c (add_implicitly_declared_members): Use do_friend.
1475 * method.c (implicitly_declare_fn): Fix friend handling.
1476 (decl_remember_implicit_trigger_p): New.
1477 (synthesize_method): Use it.
1478 * decl2.c (mark_used): Use it.
1479
1480 2020-02-11 Jason Merrill <jason@redhat.com>
1481
1482 PR c++/93650
1483 PR c++/90691
1484 * constexpr.c (maybe_constant_value): Correct earlier change.
1485 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
1486 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
1487
1488 2020-02-12 Patrick Palka <ppalka@redhat.com>
1489
1490 PR c++/69448
1491 PR c++/80471
1492 * type-utils.h (find_type_usage): Refactor to take a tree * and to
1493 return a tree *, and update documentation accordingly.
1494 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
1495 decltype(auto) node.
1496 (make_constrained_decltype_auto): No need to explicitly set
1497 AUTO_IS_DECLTYPE anymore.
1498 (splice_late_return_type): Use find_type_usage to find and
1499 replace a possibly nested auto node instead of using is_auto.
1500 Check test for is_auto into an assert when deciding whether
1501 to late_return_type.
1502 (type_uses_auto): Adjust the call to find_type_usage.
1503 * parser.c (cp_parser_decltype): No need to explicitly set
1504 AUTO_IS_DECLTYPE anymore.
1505
1506 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
1507 (dump_simple_decl): Handle standard concept definitions as well as
1508 variable concept definitions.
1509
1510 2020-02-10 Jakub Jelinek <jakub@redhat.com>
1511
1512 PR other/93641
1513 * error.c (dump_decl_name): Fix up last argument to strncmp.
1514
1515 2020-02-10 Jason Merrill <jason@redhat.com>
1516
1517 PR c++/93618
1518 * tree.c (array_of_unknown_bound_p): New.
1519 * init.c (perform_member_init): Do nothing for flexible arrays.
1520
1521 2020-02-09 Jakub Jelinek <jakub@redhat.com>
1522
1523 PR c++/93633
1524 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
1525 ARRAY_TYPE, use the element type. Punt if objtype after that is not
1526 a class type.
1527
1528 2020-02-08 Jason Merrill <jason@redhat.com>
1529
1530 PR c++/90691
1531 * expr.c (fold_for_warn): Call maybe_constant_value.
1532 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
1533 (maybe_constant_value): Add uid_sensitive parm.
1534 (get_fundef_copy): Don't copy if it's true.
1535 (cxx_eval_call_expression): Don't instantiate if it's true.
1536 (cxx_eval_outermost_constant_expr): Likewise.
1537
1538 PR c++/92852
1539 * constexpr.c (maybe_constant_value): Don't unshare if the cached
1540 value is the same as the argument.
1541
1542 * typeck.c (maybe_warn_about_returning_address_of_local): Add
1543 location parameter.
1544
1545 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
1546 if appropriate.
1547
1548 2020-02-08 Jakub Jelinek <jakub@redhat.com>
1549
1550 PR c++/93549
1551 * constexpr.c (find_array_ctor_elt): If last element has no index,
1552 for flag_checking verify all elts have no index. If i is within the
1553 elts, return it directly, if it is right after the last elt, append
1554 if NULL index, otherwise force indexes on all elts.
1555 (cxx_eval_store_expression): Allow cep->index to be NULL.
1556
1557 2020-02-07 Marek Polacek <polacek@redhat.com>
1558
1559 PR c++/92947 - Paren init of aggregates in unevaluated context.
1560 * call.c (build_new_method_call_1): Don't check
1561 cp_unevaluated_operand. Check the return value of digest_init.
1562
1563 2020-02-06 Jason Merrill <jason@redhat.com>
1564
1565 PR c++/92654
1566 * tree.c (cp_walk_subtrees): Walk into type template arguments.
1567 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
1568 instead of TYPE_ALIAS_P.
1569 * pt.c (push_template_decl_real): Likewise.
1570 (find_parameter_packs_r): Likewise. Remove dead code.
1571 * error.c (find_typenames_r): Remove dead code.
1572
1573 2020-02-06 Jason Merrill <jason@redhat.com>
1574
1575 PR c++/92517
1576 * parser.c (cp_parser_constraint_primary_expression): Do the main
1577 parse non-tentatively.
1578
1579 2020-02-06 Marek Polacek <polacek@redhat.com>
1580
1581 PR c++/93597 - ICE with lambda in operator function.
1582 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
1583
1584 2020-02-05 Jason Merrill <jason@redhat.com>
1585
1586 PR c++/93140
1587 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
1588 handling of TREE_CHAIN for empty pack.
1589
1590 2020-02-05 Jakub Jelinek <jakub@redhat.com>
1591
1592 PR c++/93557
1593 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
1594 prior to passing it to c_build_vec_convert.
1595
1596 2020-02-05 Marek Polacek <polacek@redhat.com>
1597
1598 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
1599 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
1600 TREE_SIDE_EFFECTS.
1601
1602 2020-02-05 Jason Merrill <jason@redhat.com>
1603
1604 PR c++/92593
1605 * decl.c (grokdeclarator): Reject field of current class type even
1606 in a template.
1607
1608 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
1609
1610 * coroutines.cc (maybe_promote_captured_temps): Increase the index
1611 number for temporary variables' name.
1612
1613 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
1614
1615 * coroutines.cc (build_co_await): Call convert_from_reference
1616 to wrap co_await_expr with indirect_ref which avoid
1617 reference/non-reference type confusion.
1618
1619 (co_await_expander): Sink to call_expr if await_resume
1620 is wrapped by indirect_ref.
1621
1622 2020-02-04 Jason Merrill <jason@redhat.com>
1623
1624 PR c++/93551
1625 * constraint.cc (satisfy_declaration_constraints): Check return
1626 value of push_tinst_level.
1627
1628 PR c++/90951
1629 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
1630 elements instead of value-initializing them.
1631
1632 PR c++/86917
1633 * init.c (perform_member_init): Simplify.
1634 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
1635 flexarray.
1636 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
1637
1638 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
1639
1640 * coroutines.cc (find_promise_type): Delete unused forward
1641 declaration.
1642 (struct coroutine_info): Add a bool for no promise type error.
1643 (coro_promise_type_found_p): Only emit the error for a missing
1644 promise once in each affected coroutine.
1645
1646 2020-02-03 Jason Merrill <jason@redhat.com>
1647
1648 PR c++/66477
1649 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
1650 defer loading the value of a reference.
1651
1652 2020-02-03 Jason Merrill <jason@redhat.com>
1653
1654 PR c++/91953
1655 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
1656 empty class type.
1657 [COMPONENT_REF]: A member function reference doesn't use the object
1658 as an rvalue.
1659
1660 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
1661
1662 PR c++/93458
1663 * coroutines.cc (struct coroutine_info): Add a bool flag to note
1664 that we emitted an error for a bad function return type.
1665 (get_coroutine_info): Tolerate an unset info table in case of
1666 missing traits.
1667 (find_coro_traits_template_decl): In case of error or if we didn't
1668 find a type template, note we emitted the error and suppress
1669 duplicates.
1670 (find_coro_handle_template_decl): Likewise.
1671 (instantiate_coro_traits): Only check for error_mark_node in the
1672 return from lookup_qualified_name.
1673 (coro_promise_type_found_p): Reorder initialization so that we check
1674 for the traits and their usability before allocation of the info
1675 table. Check for a suitable return type and emit a diagnostic for
1676 here instead of relying on the lookup machinery. This allows the
1677 error to have a better location, and means we can suppress multiple
1678 copies.
1679 (coro_function_valid_p): Re-check for a valid promise (and thus the
1680 traits) before proceeding. Tolerate missing info as a fatal error.
1681
1682 2020-02-03 Jason Merrill <jason@redhat.com>
1683
1684 PR c++/88256
1685 * cp-gimplify.c (predeclare_vla): New.
1686 (cp_genericize_r) [NOP_EXPR]: Call it.
1687
1688 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
1689
1690 * coroutines.cc (transform_await_wrapper): Set actor funcion as
1691 new context of label_decl.
1692 (build_actor_fn): Fill new field of await_xform_data.
1693
1694 2020-02-02 Marek Polacek <polacek@redhat.com>
1695
1696 PR c++/93530 - ICE on invalid alignas in a template.
1697 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
1698 decl_attributes.
1699
1700 2020-01-31 Jason Merrill <jason@redhat.com>
1701
1702 PR c++/86216
1703 * semantics.c (process_outer_var_ref): Capture VLAs even in
1704 unevaluated context.
1705
1706 PR c++/14179
1707 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
1708 non-aggregate elements.
1709 (reshape_init_array): Add first_initializer_p parm.
1710 (reshape_init_r): Change first_initializer_p from bool to tree.
1711 (reshape_init): Pass init to it.
1712
1713 PR c++/14179
1714 * parser.c (cp_parser_initializer_list): Suppress location wrappers
1715 after 256 elements.
1716
1717 2020-01-29 Jason Merrill <jason@redhat.com>
1718
1719 PR c++/82521
1720 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
1721 the expression was dependent before substitution.
1722
1723 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
1724
1725 * coroutines.cc (act_des_fn): New.
1726 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
1727 Access promise via actor function's frame pointer argument.
1728 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
1729
1730 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
1731
1732 * coroutines.cc (co_await_expander): Handle type conversion case.
1733
1734 2020-01-29 Jason Merrill <jason@redhat.com>
1735
1736 PR c++/90333
1737 PR c++/89640
1738 PR c++/60503
1739 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
1740 a trailing return type.
1741 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
1742 parens.
1743
1744 2020-01-29 Marek Polacek <polacek@redhat.com>
1745
1746 PR c++/91754 - Fix template arguments comparison with class NTTP.
1747 * pt.c (class_nttp_const_wrapper_p): New.
1748 (template_args_equal): See through class_nttp_const_wrapper_p
1749 arguments.
1750
1751 2020-01-29 Marek Polacek <polacek@redhat.com>
1752
1753 PR c++/92948 - Fix class NTTP with template arguments.
1754 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
1755 converting a value-dependent expression to a class type.
1756 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
1757 as the result of the tsubst_copy call.
1758
1759 2020-01-29 Jakub Jelinek <jakub@redhat.com>
1760
1761 PR c++/91118
1762 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
1763 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
1764
1765 2020-01-28 Jason Merrill <jason@redhat.com>
1766
1767 PR c++/93442
1768 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
1769
1770 PR c++/93477
1771 PR c++/91476
1772 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
1773
1774 PR c++/90546
1775 * call.c (build_user_type_conversion_1): Allow a template conversion
1776 returning an rvalue reference to bind directly to an lvalue.
1777
1778 PR c++/90731
1779 * decl.c (grokdeclarator): Propagate eh spec from typedef.
1780
1781 2020-01-28 Martin Liska <mliska@suse.cz>
1782
1783 PR c++/92440
1784 * pt.c (redeclare_class_template): Group couple of
1785 errors and inform messages with auto_diagnostic_group.
1786
1787 2020-01-28 Martin Liska <mliska@suse.cz>
1788
1789 PR c++/92440
1790 * pt.c (redeclare_class_template): Use inform
1791 for the second location.
1792
1793 2020-01-27 Jason Merrill <jason@redhat.com>
1794
1795 PR c++/90966
1796 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
1797
1798 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
1799
1800 PR c++/93443
1801 * coroutines.cc (morph_fn_to_coro): Check the ramp return
1802 value when it is constructed from the 'get return object'.
1803
1804 2020-01-27 Nathan Sidwell <nathan@acm.org>
1805
1806 PR c++/91826
1807 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
1808
1809 2020-01-26 Jason Merrill <jason@redhat.com>
1810
1811 PR c++/90992
1812 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
1813 temporarily enable -Wsystem-headers. Change second warning to
1814 conditional inform.
1815
1816 PR c++/90997
1817 * semantics.c (finish_call_expr): Don't call
1818 instantiate_non_dependent_expr before warn_for_memset.
1819
1820 2020-01-25 Marek Polacek <polacek@redhat.com>
1821
1822 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
1823 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
1824 dynamic_cast diagnostic.
1825
1826 2020-01-24 Jason Merrill <jason@redhat.com>
1827
1828 PR c++/93400 - ICE with constrained friend.
1829 * constraint.cc (maybe_substitute_reqs_for): New.
1830 * decl.c (function_requirements_equivalent_p): Call it.
1831 * pt.c (tsubst_friend_function): Only substitute
1832 TEMPLATE_PARMS_CONSTRAINTS.
1833 (tsubst_template_parms): Copy constraints.
1834
1835 2020-01-24 Jason Merrill <jason@redhat.com>
1836
1837 PR c++/93279 - ICE with lambda in member operator.
1838 * name-lookup.c (maybe_save_operator_binding): Don't remember
1839 class-scope bindings.
1840
1841 2020-01-24 Jason Merrill <jason@redhat.com>
1842
1843 PR c++/93377 - ICE with member alias in constraint.
1844 * pt.c (any_template_parm_r): Look at template arguments for all
1845 aliases, not only alias templates.
1846
1847 2020-01-24 Marek Polacek <polacek@redhat.com>
1848
1849 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
1850 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
1851
1852 2020-01-24 Jason Merrill <jason@redhat.com>
1853
1854 PR c++/92852 - ICE with generic lambda and reference var.
1855 * constexpr.c (maybe_constant_value): Likewise.
1856
1857 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
1858
1859 PR c++/92804
1860 * parser.c (cp_parser_nested_name_specifier_opt): Properly
1861 diagnose concept-ids.
1862
1863 2020-01-23 Jason Merrill <jason@redhat.com>
1864
1865 PR c++/93331 - ICE with __builtin_strchr.
1866 * constexpr.c (cxx_eval_builtin_function_call): Use the original
1867 argument if we didn't manage to extract a STRING_CST.
1868
1869 PR c++/93345 - ICE with defaulted dtor and template.
1870 PR c++/33799
1871 * decl.c (cxx_maybe_build_cleanup): Don't try to set
1872 throwing_cleanup in a template.
1873
1874 2020-01-22 Marek Polacek <polacek@redhat.com>
1875
1876 PR c++/92907 - noexcept does not consider "const" in member functions.
1877 * g++.dg/cpp0x/noexcept56.C: New test.
1878
1879 2020-01-22 Marek Polacek <polacek@redhat.com>
1880
1881 PR c++/93324 - ICE with -Wall on constexpr if.
1882 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
1883
1884 2020-01-22 Patrick Palka <ppalka@redhat.com>
1885
1886 * constraint.cc (get_mapped_args): Avoid using auto_vec
1887 as a vector element. Release the vectors inside the lists
1888 vector.
1889 * parser.c (cp_literal_operator_id): Free the buffer.
1890
1891 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
1892
1893 * coroutines.cc (finish_co_await_expr): Add error check on return
1894 value of build_co_await.
1895 (finish_co_yield_expr,): Ditto.
1896
1897 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
1898
1899 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
1900 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
1901 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
1902
1903 2020-01-21 Jason Merrill <jason@redhat.com>
1904
1905 PR c++/60855 - ICE with sizeof VLA capture.
1906 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
1907
1908 PR c++/90732 - ICE with VLA capture and generic lambda.
1909 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
1910
1911 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
1912 Bin Cheng <bin.cheng@linux.alibaba.com>
1913
1914 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
1915 from complete_type_or_else.
1916 (register_param_uses): Likewise.
1917 (build_co_await): Do not try to use complete_type_or_else for void
1918 types, otherwise for incomplete types, check for NULL return from
1919 complete_type_or_else.
1920
1921 2020-01-21 Jason Merrill <jason@redhat.com>
1922
1923 PR c++/91476 - anon-namespace reference temp clash between TUs.
1924 * decl2.c (copy_linkage): Factor out of get_guard.
1925 * call.c (make_temporary_var_for_ref_to_temp): Use it.
1926 * decl.c (cp_finish_decomp): Use it.
1927 (cp_finish_decl): determine_visibility sooner.
1928
1929 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
1930
1931 * coroutines.cc (finish_co_await_expr): Set return value flag.
1932 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
1933
1934 2020-01-19 Jason Merrill <jason@redhat.com>
1935
1936 PR c++/33799 - destroy return value, take 2.
1937 * cp-tree.h (current_retval_sentinel): New macro.
1938 (struct language_function): Add throwing_cleanup bitfield.
1939 * decl.c (cxx_maybe_build_cleanup): Set it.
1940 * except.c (maybe_set_retval_sentinel)
1941 (maybe_splice_retval_cleanup): New functions.
1942 * parser.c (cp_parser_compound_statement): Call
1943 maybe_splice_retval_cleanup.
1944 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
1945
1946 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
1947
1948 2020-01-18 Jakub Jelinek <jakub@redhat.com>
1949
1950 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
1951 but non-NO_DOLLAR_IN_LABEL case build.
1952
1953 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
1954
1955 * Make-lang.in: Add coroutines.o.
1956 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
1957 (DECL_COROUTINE_P): New.
1958 * lex.c (init_reswords): Enable keywords when the coroutine flag
1959 is set,
1960 * operators.def (co_await): New operator.
1961 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
1962 (op_error): Likewise.
1963 (build_new_op_1): Likewise.
1964 (build_new_function_call): Validate coroutine builtin arguments.
1965 * constexpr.c (potential_constant_expression_1): Handle
1966 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
1967 * coroutines.cc: New file.
1968 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
1969 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
1970 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
1971 * cp-tree.h (coro_validate_builtin_call): New.
1972 * decl.c (emit_coro_helper): New.
1973 (finish_function): Handle the case when a function is found to
1974 be a coroutine, perform the outlining and emit the outlined
1975 functions. Set a bit to signal that this is a coroutine component.
1976 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
1977 (cp_parser_unary_expression): Handle co_await.
1978 (cp_parser_assignment_expression): Handle co_yield.
1979 (cp_parser_statement): Handle RID_CO_RETURN.
1980 (cp_parser_jump_statement): Handle co_return.
1981 (cp_parser_operator): Handle co_await operator.
1982 (cp_parser_yield_expression): New.
1983 (cp_parser_required_error): Handle RT_CO_YIELD.
1984 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
1985 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
1986 CO_RETURN_EXPRs.
1987 * tree.c (cp_walk_subtrees): Likewise.
1988
1989 2020-01-17 Jason Merrill <jason@redhat.com>
1990
1991 PR c++/92531 - ICE with noexcept(lambda).
1992 * pt.c (uses_template_parms): Don't try to enumerate all the
1993 expression cases.
1994
1995 2020-01-17 Jakub Jelinek <jakub@redhat.com>
1996
1997 PR c++/93228
1998 * parser.c (cp_parser_template_name): Look up deprecated attribute
1999 in DECL_TEMPLATE_RESULT or its type's attributes.
2000
2001 2020-01-16 Jason Merrill <jason@redhat.com>
2002
2003 PR c++/93286 - ICE with __is_constructible and variadic template.
2004 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
2005 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
2006
2007 PR c++/93280 - ICE with aggregate assignment and DMI.
2008 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
2009 * typeck2.c (digest_nsdmi_init): Not here.
2010
2011 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
2012
2013 PR c++/91073
2014 * cp-tree.h (is_constrained_auto): New.
2015 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
2016 handle concept-check expressions; take a cp_decl_specifier_seq*
2017 instead of a bool.
2018 (cp_parser_condition): Update call.
2019 (cp_parser_simple_declaration): Likewise.
2020 (cp_parser_placeholder_type_specifier): Correctly handle
2021 concept-check expressions.
2022
2023 2020-01-15 Jason Merrill <jason@redhat.com>
2024
2025 Revert
2026 PR c++/33799 - destroy return value if local cleanup throws.
2027 * cp-tree.h (current_retval_sentinel): New macro.
2028 * decl.c (start_preparsed_function): Set up cleanup for retval.
2029 * typeck.c (check_return_expr): Set current_retval_sentinel.
2030
2031 PR c++/93257 - consteval void function.
2032 * constexpr.c (verify_constant): Allow void_node.
2033
2034 PR c++/92871 - bad code with xvalue and GNU ?: extension.
2035 * call.c (prevent_lifetime_extension): New.
2036 (build_conditional_expr_1): Use it.
2037
2038 2020-01-14 Nathan Sidwell <nathan@acm.org>
2039
2040 PR c++/90916
2041 * pt.c (retrieve_specialization): Use get_template_info, not open
2042 coding access.
2043
2044 PR c++/90916
2045 * pt.c (retrieve_specialization): Get the TI from the decl or the
2046 classtype as appropriate.
2047
2048 2020-01-14 David Malcolm <dmalcolm@redhat.com>
2049
2050 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
2051 New static constant.
2052 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
2053 (struct named_label_hash::empty_zero_p): Likewise.
2054 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
2055
2056 2020-01-14 Jason Merrill <jason@redhat.com>
2057
2058 PR c++/92590 - wrong handling of inherited default ctor.
2059 * class.c (add_method): A constrained inherited ctor doesn't hide an
2060 implicit derived ctor.
2061 Revert:
2062 PR c++/92552 - ICE with inherited constrained default ctor.
2063 * pt.c (instantiate_class_template_1): Copy
2064 TYPE_HAS_USER_CONSTRUCTOR.
2065 PR c++/91930 - ICE with constrained inherited default ctor.
2066 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
2067 for inherited constructor.
2068 PR c++/92594 - ICE with inherited trivial default ctor.
2069 * method.c (trivial_fn_p): Treat an inherited default constructor
2070 like a normal default constructor.
2071
2072 PR c++/92594 - ICE with inherited trivial default ctor.
2073 * method.c (trivial_fn_p): Treat an inherited default constructor
2074 like a normal default constructor.
2075
2076 PR c++/92009 - ICE with punning of typeid.
2077 * rtti.c (get_tinfo_desc): Call xref_basetypes.
2078 * constexpr.c (cxx_fold_indirect_ref): Don't strip
2079 REINTERPRET_CAST_P.
2080
2081 2020-01-13 Jason Merrill <jason@redhat.com>
2082
2083 PR c++/92746 - ICE with noexcept of function concept check.
2084 * except.c (check_noexcept_r): Handle concept-check.
2085
2086 PR c++/92582 - ICE with member template as requirement.
2087 * pt.c (struct find_template_parameter_info): Add ctx_parms.
2088 (any_template_parm_r): Handle TEMPLATE_DECL.
2089 (find_template_parameters): Take parms instead of their depth.
2090 * constraint.cc (build_parameter_mapping): Pass them.
2091
2092 PR c++/33799 - destroy return value if local cleanup throws.
2093 * cp-tree.h (current_retval_sentinel): New macro.
2094 * decl.c (start_preparsed_function): Set up cleanup for retval.
2095 * typeck.c (check_return_expr): Set current_retval_sentinel.
2096
2097 PR c++/93238 - short right-shift with enum.
2098 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
2099
2100 2020-01-10 Jason Merrill <jason@redhat.com>
2101
2102 * typeck.c (cp_build_binary_op): Restore short_shift code.
2103
2104 PR c++/93143 - incorrect tree sharing with constexpr.
2105 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
2106 CONSTRUCTORs are already unshared.
2107
2108 PR c++/93173 - incorrect tree sharing.
2109 PR c++/93033
2110 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
2111 copy_if_shared after cp_genericize_tree.
2112 * typeck2.c (split_nonconstant_init): Don't unshare here.
2113
2114 2020-01-08 Jason Merrill <jason@redhat.com>
2115
2116 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
2117 TARGET_EXPR_DIRECT_INIT_P.
2118 * constexpr.c (cxx_eval_constant_expression): Likewise.
2119
2120 2020-01-08 Jason Merrill <jason@redhat.com>
2121
2122 PR c++/91369 - constexpr destructor and member initializer.
2123 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
2124 when not preevaluating.
2125
2126 2020-01-08 Jason Merrill <jason@redhat.com>
2127
2128 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
2129 support.
2130
2131 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
2132
2133 * init.c (build_new): Add location_t parameter and use it throughout.
2134 (build_raw_new_expr): Likewise.
2135 * parser.c (cp_parser_new_expression): Pass the combined_loc.
2136 * pt.c (tsubst_copy_and_build): Adjust call.
2137 * cp-tree.h: Update declarations.
2138
2139 2020-01-07 Jason Merrill <jason@redhat.com>
2140
2141 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
2142 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
2143 explicit class visibility for a template.
2144
2145 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
2146
2147 * mangle.c (mangle_type_attribute_p): New function, split out from...
2148 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
2149 that contain a space.
2150
2151 2020-01-07 Jakub Jelinek <jakub@redhat.com>
2152
2153 PR c++/91369
2154 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
2155 member, initialize it to zero in ctor.
2156 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
2157 a heap object. Don't cache calls to functions which allocate some
2158 heap objects and don't deallocate them or deallocate some heap
2159 objects they didn't allocate.
2160
2161 2020-01-06 Jason Merrill <jason@redhat.com>
2162
2163 PR c++/92552 - ICE with inherited constrained default ctor.
2164 * pt.c (instantiate_class_template_1): Copy
2165 TYPE_HAS_USER_CONSTRUCTOR.
2166 * class.c (one_inherited_ctor): Don't set it here.
2167
2168 2020-01-06 Andrew Sutton <asutton@lock3software.com>
2169
2170 PR c++/92739 - parsing requires clause with attributes.
2171 * parser.c (cp_parser_constraint_requires_parens): Exclude
2172 attributes as postfix expressions.
2173
2174 2020-01-05 Jakub Jelinek <jakub@redhat.com>
2175
2176 PR c++/93138
2177 * parser.c (cp_parser_check_class_key): Disable access checks for the
2178 simple name lookup.
2179 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
2180 !warn_redundant_tags.
2181
2182 2010-01-05 Jakub Jelinek <jakub@redhat.com>
2183
2184 PR c++/93046
2185 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
2186 TARGET_EXPR if it has been gimplified already.
2187
2188 2020-01-03 Jason Merrill <jason@redhat.com>
2189
2190 PR c++/93033 - incorrect tree node sharing with array init.
2191 * typeck2.c (split_nonconstant_init): Unshare non-decl.
2192 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
2193
2194 2020-01-02 Jason Merrill <jason@redhat.com>
2195
2196 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
2197 C++17.
2198
2199 2020-01-02 Jakub Jelinek <jakub@redhat.com>
2200
2201 PR c/90677
2202 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
2203 has not been found, rather than error_mark_node.
2204
2205 2020-01-01 Jakub Jelinek <jakub@redhat.com>
2206
2207 Update copyright years.
2208 \f
2209 Copyright (C) 2020 Free Software Foundation, Inc.
2210
2211 Copying and distribution of this file, with or without modification,
2212 are permitted in any medium without royalty provided the copyright
2213 notice and this notice are preserved.