c++: Handle COMPOUND_EXPRs in ocp_convert [PR94339]
[gcc.git] / gcc / cp / ChangeLog
1 2020-03-27 Jakub Jelinek <jakub@redhat.com>
2
3 PR c++/94339
4 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
5 operand and creating a new COMPOUND_EXPR if anything changed.
6
7 2020-03-26 Marek Polacek <polacek@redhat.com>
8
9 PR c++/94336 - template keyword accepted before destructor names.
10 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
11 is followed by a destructor name.
12
13 2020-03-27 Patrick Palka <ppalka@redhat.com>
14
15 * decl.c (compute_array_index_type_loc): Remove redundant
16 type_dependent_expression_p check that is subsumed by
17 value_dependent_expression_p.
18 * decl2.c (is_late_template_attribute): Likewise.
19 * pt.c (uses_template_parms): Likewise.
20 (dependent_template_arg_p): Likewise.
21
22 2020-03-26 Marek Polacek <polacek@redhat.com>
23
24 DR 1710
25 PR c++/94057 - template keyword in a typename-specifier.
26 * parser.c (check_template_keyword_in_nested_name_spec): New.
27 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
28 'template'. Call check_template_keyword_in_nested_name_spec.
29 (cp_parser_simple_type_specifier): Assume that a <
30 following a qualified-id in a typename-specifier begins
31 a template argument list.
32
33 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
34
35 * coroutines.cc (coro_init_identifiers): Initialize an identifier
36 for the cororoutine handle 'address' method name.
37 (struct coro_aw_data): Add fields to cover the continuations.
38 (co_await_expander): Determine the kind of await_suspend in use.
39 If we have the case that returns a continuation handle, then save
40 this and make the target for 'scope exit without cleanup' be the
41 continuation resume label.
42 (expand_co_awaits): Remove.
43 (struct suspend_point_info): Remove fields that kept the returned
44 await_suspend handle type.
45 (transform_await_expr): Remove code tracking continuation handles.
46 (build_actor_fn): Add the continuation handle as an actor-function
47 scope var. Build the symmetric transfer continuation point. Call
48 the tree walk for co_await expansion directly, rather than via a
49 trivial shim function.
50 (register_await_info): Remove fields tracking continuation handles.
51 (get_await_suspend_return_type): Remove.
52 (register_awaits): Remove code tracking continuation handles.
53 (morph_fn_to_coro): Remove code tracking continuation handles.
54
55 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
56
57 * coroutines.cc (co_await_expander): If we are expanding the
58 initial await expression, set a boolean flag to show that we
59 have now reached the initial await_resume() method call.
60 (expand_co_awaits): Handle the 'initial await resume called' flag.
61 (build_actor_fn): Insert the initial await expression into the
62 start of the user-authored function-body. Handle the 'initial await
63 resume called' flag.
64 (morph_fn_to_coro): Initialise the 'initial await resume called'
65 flag. Modify the unhandled exception catch clause to recognise
66 exceptions that occur before the initial await_resume() and re-
67 throw them.
68
69 2020-03-26 Jakub Jelinek <jakub@redhat.com>
70
71 PR c++/81349
72 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
73 true for all TEMPLATE_DECLs.
74
75 PR c++/94272
76 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
77
78 2020-03-25 Patrick Palka <ppalka@redhat.com>
79
80 PR c++/94265
81 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
82 current condition chain when the if-statement has a non-empty
83 init-statement.
84
85 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
86
87 PR c++/94319
88 * coroutines.cc (captures_temporary): Fix a missing dereference.
89
90 2020-03-24 Marek Polacek <polacek@redhat.com>
91
92 PR c++/94190 - wrong no post-decrement operator error in template.
93 * call.c (convert_like_real): Use convert_from_reference on the result.
94
95 2020-03-24 Jason Merrill <jason@redhat.com>
96
97 PR c++/94186
98 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
99 error.
100 (tsubst_nested_requirement): Likewise.
101 (get_constraint_error_location): Allow missing context.
102 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
103 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
104
105 2020-03-24 Jason Merrill <jason@redhat.com>
106
107 * pt.c (any_template_parm_r): Look into the type of a non-type
108 template parm.
109
110 2020-03-24 Jason Merrill <jason@redhat.com>
111
112 * cp-tree.h (cp_expr): When constructing from an expr and a
113 location, call protected_set_expr_location.
114
115 2020-03-23 Patrick Palka <ppalka@redhat.com>
116
117 PR c++/93805
118 * except.c (maybe_noexcept_warning): Add TODO.
119 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
120
121 2020-03-23 nathans <nathan@acm.org>
122
123 PR c++/94044
124 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
125 operand.
126
127 2020-03-21 Patrick Palka <ppalka@redhat.com>
128
129 PR c++/94066
130 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
131 handle unions without an initializer.
132 (cxx_eval_component_reference): Emit a different diagnostic when the
133 constructor element corresponding to a union member is NULL.
134 (cxx_eval_bare_aggregate): When constructing a union, always set the
135 active union member before evaluating the initializer. Relax assertion
136 that verifies the index of the constructor element we're initializing
137 hasn't been changed.
138 (cxx_eval_store_expression): Diagnose changing the active union member
139 while the union is in the process of being initialized. After setting
140 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
141 CONSTRUCTOR.
142 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
143 CONSTRUCTOR returned by lookup_placeholder.
144
145 2020-03-20 Patrick Palka <ppalka@redhat.com>
146
147 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
148 the "[with ]" bits to here from ...
149 (pp_cxx_atomic_constraint): ... here.
150 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
151 * error.c (rebuild_concept_check): Delete.
152 (print_concept_check_info): Print the dependent form of the constraint and the
153 preferably substituted parameter mapping alongside it.
154
155 2020-03-19 Jason Merrill <jason@redhat.com>
156
157 PR c++/94175
158 * cp-gimplify.c (simple_empty_class_p): Look through
159 SIMPLE_TARGET_EXPR_P.
160 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
161 [RETURN_EXPR]: Avoid producing 'return *retval;'.
162 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
163 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
164 is non-null.
165
166 2020-03-19 Jakub Jelinek <jakub@redhat.com>
167
168 PR c++/93931
169 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
170 on outer_automatic_var_p decls.
171 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
172 capture proxy decls.
173
174 2020-03-18 Nathan Sidwell <nathan@acm.org>
175
176 PR c++/94147 - mangling of lambdas assigned to globals
177 * parser.c (cp_parser_init_declarator): Namespace-scope variables
178 provide a lambda scope.
179 * tree.c (no_linkage_check): Lambdas with a variable for extra
180 scope have a linkage from the variable.
181
182 2020-03-18 Jakub Jelinek <jakub@redhat.com>
183
184 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
185 strictly_subsumes): Fix up duplicated word issue in a comment.
186 * coroutines.cc (build_init_or_final_await, captures_temporary):
187 Likewise.
188 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
189 * pt.c (append_type_to_template_for_access_check): Likewise.
190
191 PR c++/91759
192 * decl.c (grokfndecl): Restore old diagnostics about deduction
193 guide declared in different scope if in_namespace is NULL_TREE.
194
195 2020-03-17 Jakub Jelinek <jakub@redhat.com>
196
197 PR c++/90995
198 * parser.c (cp_parser_enum_specifier): Use temp_override for
199 parser->colon_corrects_to_scope_p, replace goto out with return.
200 If scoped enum or enum with underlying type is not followed by
201 { or ;, call cp_parser_commit_to_tentative_parse before calling
202 cp_parser_error and make sure to return error_mark_node instead of
203 NULL_TREE. Formatting fixes.
204
205 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
206
207 PR c++/94197
208 * method.c (assignable_expr): Use cp_unevaluated.
209 (is_xible_helper): Push a non-deferred access check for
210 the stub objects created by assignable_expr and constructible_expr.
211
212 2020-03-17 Jakub Jelinek <jakub@redhat.com>
213
214 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
215 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
216 in a comment.
217 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
218 cp_parser_placeholder_type_specifier,
219 cp_parser_constraint_requires_parens): Likewise.
220 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
221
222 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
223
224 * coroutines.cc (co_await_expander): Fix indentation.
225
226 2020-03-14 Jason Merrill <jason@redhat.com>
227
228 PR c++/92068
229 * pt.c (process_partial_specialization): Error rather than crash on
230 extra pack expansion.
231
232 2020-03-14 Jason Merrill <jason@redhat.com>
233
234 PR c++/92909
235 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
236 DECL_ORIGINAL_TYPE of a typedef.
237
238 2020-03-14 Jason Merrill <jason@redhat.com>
239
240 PR c++/93248
241 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
242 substituting DECL_ARGUMENTS.
243
244 2020-03-14 Jakub Jelinek <jakub@redhat.com>
245
246 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
247 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
248 literal.
249
250 2020-03-13 Patrick Palka <ppalka@redhat.com>
251
252 PR c++/67960
253 * call.c (build_over_call): Use a warning_sentinel to disable
254 warn_deprecated_decl before calling build_addr_func.
255
256 2020-03-12 Jakub Jelinek <jakub@redhat.com>
257
258 PR c++/94124
259 * decl.c (reshape_init_array_1): Don't unshare constructor if there
260 aren't any trailing zero elts, otherwise only unshare the first
261 nelts.
262
263 2020-03-11 Jason Merrill <jason@redhat.com>
264
265 PR c++/93907
266 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
267 argument.
268
269 2020-03-11 Marek Polacek <polacek@redhat.com>
270 Jason Merrill <jason@redhat.com>
271
272 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
273 * constexpr.c (cref_has_const_field): New function.
274 (modifying_const_object_p): Consider a COMPONENT_REF
275 const only if any of its fields are const.
276 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
277 as readonly after its initialization has been done.
278
279 2020-03-10 Marek Polacek <polacek@redhat.com>
280
281 PR c++/94124 - wrong conversion error with non-viable overload.
282 * decl.c (reshape_init_array_1): Unshare a constructor if we
283 stripped trailing zero-initializers.
284
285 2020-03-10 Jason Merrill <jason@redhat.com>
286
287 PR c++/93901
288 * pt.c (maybe_instantiate_noexcept): Always update clones.
289
290 2020-03-10 Jason Merrill <jason@redhat.com>
291
292 PR c++/93596
293 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
294
295 2020-03-10 Jason Merrill <jason@redhat.com>
296
297 PR c++/93922
298 PR c++/94041
299 PR c++/52320
300 PR c++/66139
301 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
302 66139: Don't split_nonconstant_init. Remove pre_p parameter.
303
304 2020-03-09 Marek Polacek <polacek@redhat.com>
305
306 PR c++/92031 - bogus taking address of rvalue error.
307 PR c++/91465 - ICE with template codes in check_narrowing.
308 PR c++/93870 - wrong error when converting template non-type arg.
309 PR c++/94068 - ICE with template codes in check_narrowing.
310 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
311 in a template when not ck_identity and we're dealing with a class.
312 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
313 in a template if we need a temporary.
314 * decl.c (compute_array_index_type_loc): Remove
315 instantiate_non_dependent_expr_sfinae call. Call
316 fold_non_dependent_expr instead of maybe_constant_value.
317 (build_explicit_specifier): Don't instantiate or create a sentinel
318 before converting the expression.
319 * except.c (build_noexcept_spec): Likewise.
320 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
321 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
322 build_converted_constant_expr returned.
323 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
324 of maybe_constant_value.
325
326 2020-03-09 Jakub Jelinek <jakub@redhat.com>
327
328 PR c++/94067
329 Revert
330 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
331
332 * constexpr.c (cxx_eval_constant_expression): Do not handle
333 RROTATE_EXPR and LROTATE_EXPR.
334
335 2020-03-09 Marek Polacek <polacek@redhat.com>
336
337 PR c++/94050 - ABI issue with alignas on armv7hl.
338 * class.c (layout_class_type): Don't replace a class's
339 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
340
341 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
342
343 * coroutines.cc (build_actor_fn): Factor out code inserting the
344 default return_void call to...
345 (morph_fn_to_coro): ...here, also hoist local var declarations.
346
347 2020-03-08 Patrick Palka <ppalka@redhat.com>
348
349 PR c++/93729
350 * call.c (convert_like_real): Check complain before emitting an error
351 about binding a bit-field to a reference.
352
353 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
354 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
355 TYPE_NAME.
356
357 2020-03-06 Nathan Sidwell <nathan@acm.org>
358
359 PR c++/94027
360 * mangle.c (find_substitution): Don't call same_type_p on template
361 args that cannot match.
362
363 2020-03-04 Martin Sebor <msebor@redhat.com>
364
365 PR c++/90938
366 * tree.c (type_initializer_zero_p): Fail for structs initialized
367 with non-structs.
368
369 2020-03-04 Jason Merrill <jason@redhat.com>
370
371 PR c++/90432
372 * init.c (perform_member_init): Don't do aggregate initialization of
373 empty field.
374 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
375 initialization of empty field.
376
377 2020-03-04 Martin Liska <mliska@suse.cz>
378
379 * method.c: Wrap array in ctor with braces in order
380 to silent clang warnings.
381
382 2020-03-03 Jason Merrill <jason@redhat.com>
383 Marek Polacek <polacek@redhat.com>
384
385 PR c++/90505 - mismatch in template argument deduction.
386 * pt.c (tsubst): Don't reduce the template level of template
387 parameters when tf_partial.
388
389 2020-03-03 Jakub Jelinek <jakub@redhat.com>
390
391 PR c++/93998
392 * constexpr.c (cxx_eval_constant_expression)
393 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
394 *non_constant_p is true.
395
396 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
397
398 * coroutines.cc (captures_temporary): Strip component_ref
399 to its base object.
400
401 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
402
403 * coroutines.cc (finish_co_await_expr): Build co_await_expr
404 with unknown_type_node.
405 (finish_co_yield_expr): Ditto.
406 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
407 with unknown type as dependent.
408
409 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
410
411 * coroutines.cc (struct local_var_info): Adjust to remove the
412 reference to the captured var, and just to note that this is a
413 lambda capture proxy.
414 (transform_local_var_uses): Handle lambda captures specially.
415 (struct param_frame_data): Add a visited set.
416 (register_param_uses): Also check for param uses in lambda
417 capture proxies.
418 (struct local_vars_frame_data): Remove captures list.
419 (register_local_var_uses): Handle lambda capture proxies by
420 noting and bypassing them.
421 (morph_fn_to_coro): Update to remove lifetime extension of
422 lambda capture-by-copy vars.
423
424 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
425
426 * coroutines.cc (build_co_await): Do not build frame
427 awaitable proxy vars when the co_await expression is
428 a function parameter or local var.
429 (co_await_expander): Do not initialise a frame var with
430 itself.
431 (transform_await_expr): Only substitute the awaitable
432 frame var if it's needed.
433 (register_awaits): Do not make frame copies for param
434 or local vars that are awaitables.
435
436 2020-02-28 Jason Merrill <jason@redhat.com>
437
438 Implement P2092R0, Disambiguating Nested-Requirements
439 * parser.c (cp_parser_requirement_parameter_list): Pass
440 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
441
442 * call.c (build_user_type_conversion_1): Don't look at the second
443 conversion of a non-viable candidate.
444
445 2020-02-28 Jakub Jelinek <jakub@redhat.com>
446
447 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
448 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
449 functions in unevaluated contexts.
450
451 2020-02-27 Nathan Sidwell <nathan@acm.org>
452
453 PR c++/93933
454 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
455 cp_tree_equal.
456 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
457 * typeck.c (comptypes): Assert we don't get any argument packs.
458
459 * class.c (adjust_clone_args): Correct arg-checking assert.
460 * typeck.c (comptypes): Assert not nulls.
461
462 2020-02-26 Marek Polacek <polacek@redhat.com>
463
464 PR c++/93789 - ICE with invalid array bounds.
465 * decl.c (compute_array_index_type_loc): Don't use the folded
466 size when folding cleared TREE_CONSTANT.
467
468 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
469
470 * class.c (classtype_has_non_deleted_copy_ctor): New.
471 * coroutines.cc (struct param_info): Keep track of params
472 that are references, and cache the original type and whether
473 the DTOR is trivial.
474 (build_actor_fn): Handle param copies always, and adjust the
475 handling for references.
476 (register_param_uses): Only handle uses here.
477 (classtype_has_non_deleted_copy_ctor): New.
478 (morph_fn_to_coro): Adjust param copy handling to match n4849
479 by reordering ahead of the promise CTOR and always making a
480 frame copy, even if the param is unused in the coroutine body.
481 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
482
483 2020-02-26 Patrick Palka <ppalka@redhat.com>
484
485 * constraint.cc (finish_constraint_binary_op): Set expr's location range
486 to the range of its operands.
487 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
488 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
489 instead of the corresponding template arguments ARGS and adjust body
490 accordingly.
491 (diagnose_requires_expr): Likewise.
492 (diagnose_atomic_constraint): Likewise. When printing an atomic
493 constraint expression, print the instantiated parameter mapping
494 alongside it.
495 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
496 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
497 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
498
499 2020-02-26 Marek Polacek <polacek@redhat.com>
500
501 PR c++/93676 - value-init crash in template.
502 * init.c (build_new_1): Don't call build_vec_init in a template.
503
504 2020-02-26 Marek Polacek <polacek@redhat.com>
505
506 PR c++/93862 - ICE with static_cast when converting from int[].
507 * call.c (reference_compatible_p): No longer static.
508 * cp-tree.h (reference_compatible_p): Declare.
509 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
510 of reference_related_p.
511
512 2020-02-26 Marek Polacek <polacek@redhat.com>
513
514 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
515 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
516 field.
517
518 2020-02-24 Martin Sebor <msebor@redhat.com>
519
520 PR c++/93804
521 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
522 in shared C/C++ code in headers.
523 Remove a duplicate hunk of code.
524
525 2020-02-24 Marek Polacek <polacek@redhat.com>
526
527 PR c++/93869 - ICE with -Wmismatched-tags.
528 * parser.c (cp_parser_check_class_key): Check class_key earlier.
529
530 2020-02-24 Marek Polacek <polacek@redhat.com>
531
532 PR c++/93712 - ICE with ill-formed array list-initialization.
533 * call.c (next_conversion): Return NULL for ck_aggr.
534 (build_aggr_conv): Set u.expr instead of u.next.
535 (build_array_conv): Likewise.
536 (build_complex_conv): Likewise.
537 (conv_get_original_expr): Handle ck_aggr.
538
539 2020-02-24 Jakub Jelinek <jakub@redhat.com>
540
541 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
542 * call.c (build_over_call): Don't evaluate immediate functions in
543 unevaluated operands.
544
545 2020-02-24 Jason Merrill <jason@redhat.com>
546
547 P0780R2: Resolve lambda init-capture pack grammar.
548 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
549 ...&x=y.
550
551 2020-02-22 Marek Polacek <polacek@redhat.com>
552
553 PR c++/93882
554 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
555
556 2020-02-21 Martin Sebor <msebor@redhat.com>
557
558 PR gcov-profile/93753
559 * class.c (check_flexarrays): Tighten up a test for potential members
560 of anonymous structs or unions.
561
562 2020-02-20 Martin Sebor <msebor@redhat.com>
563
564 PR c++/93801
565 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
566
567 2020-02-20 Martin Liska <mliska@suse.cz>
568
569 PR translation/93841
570 * config/or1k/or1k.opt: Remove superfluous word.
571 * doc/invoke.texi: Likewise.
572
573 2020-02-20 Martin Liska <mliska@suse.cz>
574
575 PR translation/93838
576 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
577
578 2020-02-19 Marek Polacek <polacek@redhat.com>
579
580 PR c++/93169 - wrong-code with a non-constexpr constructor.
581 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
582 on constant CONSTRUCTORs.
583
584 2020-02-15 Marek Polacek <polacek@redhat.com>
585
586 PR c++/93710 - poor diagnostic for array initializer.
587 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
588 for an error call.
589
590 2020-02-15 Jason Merrill <jason@redhat.com>
591
592 PR c++/92556
593 * pt.c (any_template_parm_r): Look into lambda body.
594
595 PR c++/92583
596 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
597
598 2020-02-14 Jakub Jelinek <jakub@redhat.com>
599
600 PR c++/61414
601 * class.c (enum_min_precision): Change prec type from int to int &.
602
603 PR libstdc++/92906
604 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
605 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
606 (fallback_dfloat32_type, fallback_dfloat64_type,
607 fallback_dfloat128_type): Define.
608 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
609 dfloat*_type_node.
610 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
611 is disabled for compatibility.
612
613 2020-02-13 Jason Merrill <jason@redhat.com>
614
615 PR c++/93713
616 * name-lookup.c (matching_fn_p): A function does not match a
617 template.
618
619 PR c++/93643
620 PR c++/91476
621 * tree.c (decl_linkage): Always lk_none for locals.
622
623 2020-02-12 Jason Merrill <jason@redhat.com>
624
625 PR c++/92583
626 PR c++/92654
627 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
628 * pt.c (find_parameter_packs_r): Not here.
629
630 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
631
632 * coroutines.cc (build_actor_fn): Implement deallocation function
633 selection per n4849, dcl.fct.def.coroutine bullet 12.
634 (morph_fn_to_coro): Implement allocation function selection per
635 n4849, dcl.fct.def.coroutine bullets 9 and 10.
636
637 2020-02-12 Marek Polacek <polacek@redhat.com>
638
639 PR c++/93684 - ICE-on-invalid with broken attribute.
640 * parser.c (cp_parser_std_attribute): Peek a token first before
641 consuming it.
642
643 2020-02-11 Jason Merrill <jason@redhat.com>
644
645 PR c++/93675
646 * class.c (add_implicitly_declared_members): Use do_friend.
647 * method.c (implicitly_declare_fn): Fix friend handling.
648 (decl_remember_implicit_trigger_p): New.
649 (synthesize_method): Use it.
650 * decl2.c (mark_used): Use it.
651
652 2020-02-11 Jason Merrill <jason@redhat.com>
653
654 PR c++/93650
655 PR c++/90691
656 * constexpr.c (maybe_constant_value): Correct earlier change.
657 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
658 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
659
660 2020-02-12 Patrick Palka <ppalka@redhat.com>
661
662 PR c++/69448
663 PR c++/80471
664 * type-utils.h (find_type_usage): Refactor to take a tree * and to
665 return a tree *, and update documentation accordingly.
666 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
667 decltype(auto) node.
668 (make_constrained_decltype_auto): No need to explicitly set
669 AUTO_IS_DECLTYPE anymore.
670 (splice_late_return_type): Use find_type_usage to find and
671 replace a possibly nested auto node instead of using is_auto.
672 Check test for is_auto into an assert when deciding whether
673 to late_return_type.
674 (type_uses_auto): Adjust the call to find_type_usage.
675 * parser.c (cp_parser_decltype): No need to explicitly set
676 AUTO_IS_DECLTYPE anymore.
677
678 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
679 (dump_simple_decl): Handle standard concept definitions as well as
680 variable concept definitions.
681
682 2020-02-10 Jakub Jelinek <jakub@redhat.com>
683
684 PR other/93641
685 * error.c (dump_decl_name): Fix up last argument to strncmp.
686
687 2020-02-10 Jason Merrill <jason@redhat.com>
688
689 PR c++/93618
690 * tree.c (array_of_unknown_bound_p): New.
691 * init.c (perform_member_init): Do nothing for flexible arrays.
692
693 2020-02-09 Jakub Jelinek <jakub@redhat.com>
694
695 PR c++/93633
696 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
697 ARRAY_TYPE, use the element type. Punt if objtype after that is not
698 a class type.
699
700 2020-02-08 Jason Merrill <jason@redhat.com>
701
702 PR c++/90691
703 * expr.c (fold_for_warn): Call maybe_constant_value.
704 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
705 (maybe_constant_value): Add uid_sensitive parm.
706 (get_fundef_copy): Don't copy if it's true.
707 (cxx_eval_call_expression): Don't instantiate if it's true.
708 (cxx_eval_outermost_constant_expr): Likewise.
709
710 PR c++/92852
711 * constexpr.c (maybe_constant_value): Don't unshare if the cached
712 value is the same as the argument.
713
714 * typeck.c (maybe_warn_about_returning_address_of_local): Add
715 location parameter.
716
717 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
718 if appropriate.
719
720 2020-02-08 Jakub Jelinek <jakub@redhat.com>
721
722 PR c++/93549
723 * constexpr.c (find_array_ctor_elt): If last element has no index,
724 for flag_checking verify all elts have no index. If i is within the
725 elts, return it directly, if it is right after the last elt, append
726 if NULL index, otherwise force indexes on all elts.
727 (cxx_eval_store_expression): Allow cep->index to be NULL.
728
729 2020-02-07 Marek Polacek <polacek@redhat.com>
730
731 PR c++/92947 - Paren init of aggregates in unevaluated context.
732 * call.c (build_new_method_call_1): Don't check
733 cp_unevaluated_operand. Check the return value of digest_init.
734
735 2020-02-06 Jason Merrill <jason@redhat.com>
736
737 PR c++/92654
738 * tree.c (cp_walk_subtrees): Walk into type template arguments.
739 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
740 instead of TYPE_ALIAS_P.
741 * pt.c (push_template_decl_real): Likewise.
742 (find_parameter_packs_r): Likewise. Remove dead code.
743 * error.c (find_typenames_r): Remove dead code.
744
745 2020-02-06 Jason Merrill <jason@redhat.com>
746
747 PR c++/92517
748 * parser.c (cp_parser_constraint_primary_expression): Do the main
749 parse non-tentatively.
750
751 2020-02-06 Marek Polacek <polacek@redhat.com>
752
753 PR c++/93597 - ICE with lambda in operator function.
754 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
755
756 2020-02-05 Jason Merrill <jason@redhat.com>
757
758 PR c++/93140
759 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
760 handling of TREE_CHAIN for empty pack.
761
762 2020-02-05 Jakub Jelinek <jakub@redhat.com>
763
764 PR c++/93557
765 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
766 prior to passing it to c_build_vec_convert.
767
768 2020-02-05 Marek Polacek <polacek@redhat.com>
769
770 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
771 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
772 TREE_SIDE_EFFECTS.
773
774 2020-02-05 Jason Merrill <jason@redhat.com>
775
776 PR c++/92593
777 * decl.c (grokdeclarator): Reject field of current class type even
778 in a template.
779
780 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
781
782 * coroutines.cc (maybe_promote_captured_temps): Increase the index
783 number for temporary variables' name.
784
785 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
786
787 * coroutines.cc (build_co_await): Call convert_from_reference
788 to wrap co_await_expr with indirect_ref which avoid
789 reference/non-reference type confusion.
790
791 (co_await_expander): Sink to call_expr if await_resume
792 is wrapped by indirect_ref.
793
794 2020-02-04 Jason Merrill <jason@redhat.com>
795
796 PR c++/93551
797 * constraint.cc (satisfy_declaration_constraints): Check return
798 value of push_tinst_level.
799
800 PR c++/90951
801 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
802 elements instead of value-initializing them.
803
804 PR c++/86917
805 * init.c (perform_member_init): Simplify.
806 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
807 flexarray.
808 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
809
810 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
811
812 * coroutines.cc (find_promise_type): Delete unused forward
813 declaration.
814 (struct coroutine_info): Add a bool for no promise type error.
815 (coro_promise_type_found_p): Only emit the error for a missing
816 promise once in each affected coroutine.
817
818 2020-02-03 Jason Merrill <jason@redhat.com>
819
820 PR c++/66477
821 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
822 defer loading the value of a reference.
823
824 2020-02-03 Jason Merrill <jason@redhat.com>
825
826 PR c++/91953
827 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
828 empty class type.
829 [COMPONENT_REF]: A member function reference doesn't use the object
830 as an rvalue.
831
832 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
833
834 PR c++/93458
835 * coroutines.cc (struct coroutine_info): Add a bool flag to note
836 that we emitted an error for a bad function return type.
837 (get_coroutine_info): Tolerate an unset info table in case of
838 missing traits.
839 (find_coro_traits_template_decl): In case of error or if we didn't
840 find a type template, note we emitted the error and suppress
841 duplicates.
842 (find_coro_handle_template_decl): Likewise.
843 (instantiate_coro_traits): Only check for error_mark_node in the
844 return from lookup_qualified_name.
845 (coro_promise_type_found_p): Reorder initialization so that we check
846 for the traits and their usability before allocation of the info
847 table. Check for a suitable return type and emit a diagnostic for
848 here instead of relying on the lookup machinery. This allows the
849 error to have a better location, and means we can suppress multiple
850 copies.
851 (coro_function_valid_p): Re-check for a valid promise (and thus the
852 traits) before proceeding. Tolerate missing info as a fatal error.
853
854 2020-02-03 Jason Merrill <jason@redhat.com>
855
856 PR c++/88256
857 * cp-gimplify.c (predeclare_vla): New.
858 (cp_genericize_r) [NOP_EXPR]: Call it.
859
860 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
861
862 * coroutines.cc (transform_await_wrapper): Set actor funcion as
863 new context of label_decl.
864 (build_actor_fn): Fill new field of await_xform_data.
865
866 2020-02-02 Marek Polacek <polacek@redhat.com>
867
868 PR c++/93530 - ICE on invalid alignas in a template.
869 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
870 decl_attributes.
871
872 2020-01-31 Jason Merrill <jason@redhat.com>
873
874 PR c++/86216
875 * semantics.c (process_outer_var_ref): Capture VLAs even in
876 unevaluated context.
877
878 PR c++/14179
879 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
880 non-aggregate elements.
881 (reshape_init_array): Add first_initializer_p parm.
882 (reshape_init_r): Change first_initializer_p from bool to tree.
883 (reshape_init): Pass init to it.
884
885 PR c++/14179
886 * parser.c (cp_parser_initializer_list): Suppress location wrappers
887 after 256 elements.
888
889 2020-01-29 Jason Merrill <jason@redhat.com>
890
891 PR c++/82521
892 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
893 the expression was dependent before substitution.
894
895 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
896
897 * coroutines.cc (act_des_fn): New.
898 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
899 Access promise via actor function's frame pointer argument.
900 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
901
902 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
903
904 * coroutines.cc (co_await_expander): Handle type conversion case.
905
906 2020-01-29 Jason Merrill <jason@redhat.com>
907
908 PR c++/90333
909 PR c++/89640
910 PR c++/60503
911 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
912 a trailing return type.
913 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
914 parens.
915
916 2020-01-29 Marek Polacek <polacek@redhat.com>
917
918 PR c++/91754 - Fix template arguments comparison with class NTTP.
919 * pt.c (class_nttp_const_wrapper_p): New.
920 (template_args_equal): See through class_nttp_const_wrapper_p
921 arguments.
922
923 2020-01-29 Marek Polacek <polacek@redhat.com>
924
925 PR c++/92948 - Fix class NTTP with template arguments.
926 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
927 converting a value-dependent expression to a class type.
928 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
929 as the result of the tsubst_copy call.
930
931 2020-01-29 Jakub Jelinek <jakub@redhat.com>
932
933 PR c++/91118
934 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
935 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
936
937 2020-01-28 Jason Merrill <jason@redhat.com>
938
939 PR c++/93442
940 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
941
942 PR c++/93477
943 PR c++/91476
944 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
945
946 PR c++/90546
947 * call.c (build_user_type_conversion_1): Allow a template conversion
948 returning an rvalue reference to bind directly to an lvalue.
949
950 PR c++/90731
951 * decl.c (grokdeclarator): Propagate eh spec from typedef.
952
953 2020-01-28 Martin Liska <mliska@suse.cz>
954
955 PR c++/92440
956 * pt.c (redeclare_class_template): Group couple of
957 errors and inform messages with auto_diagnostic_group.
958
959 2020-01-28 Martin Liska <mliska@suse.cz>
960
961 PR c++/92440
962 * pt.c (redeclare_class_template): Use inform
963 for the second location.
964
965 2020-01-27 Jason Merrill <jason@redhat.com>
966
967 PR c++/90966
968 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
969
970 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
971
972 PR c++/93443
973 * coroutines.cc (morph_fn_to_coro): Check the ramp return
974 value when it is constructed from the 'get return object'.
975
976 2020-01-27 Nathan Sidwell <nathan@acm.org>
977
978 PR c++/91826
979 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
980
981 2020-01-26 Jason Merrill <jason@redhat.com>
982
983 PR c++/90992
984 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
985 temporarily enable -Wsystem-headers. Change second warning to
986 conditional inform.
987
988 PR c++/90997
989 * semantics.c (finish_call_expr): Don't call
990 instantiate_non_dependent_expr before warn_for_memset.
991
992 2020-01-25 Marek Polacek <polacek@redhat.com>
993
994 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
995 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
996 dynamic_cast diagnostic.
997
998 2020-01-24 Jason Merrill <jason@redhat.com>
999
1000 PR c++/93400 - ICE with constrained friend.
1001 * constraint.cc (maybe_substitute_reqs_for): New.
1002 * decl.c (function_requirements_equivalent_p): Call it.
1003 * pt.c (tsubst_friend_function): Only substitute
1004 TEMPLATE_PARMS_CONSTRAINTS.
1005 (tsubst_template_parms): Copy constraints.
1006
1007 2020-01-24 Jason Merrill <jason@redhat.com>
1008
1009 PR c++/93279 - ICE with lambda in member operator.
1010 * name-lookup.c (maybe_save_operator_binding): Don't remember
1011 class-scope bindings.
1012
1013 2020-01-24 Jason Merrill <jason@redhat.com>
1014
1015 PR c++/93377 - ICE with member alias in constraint.
1016 * pt.c (any_template_parm_r): Look at template arguments for all
1017 aliases, not only alias templates.
1018
1019 2020-01-24 Marek Polacek <polacek@redhat.com>
1020
1021 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
1022 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
1023
1024 2020-01-24 Jason Merrill <jason@redhat.com>
1025
1026 PR c++/92852 - ICE with generic lambda and reference var.
1027 * constexpr.c (maybe_constant_value): Likewise.
1028
1029 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
1030
1031 PR c++/92804
1032 * parser.c (cp_parser_nested_name_specifier_opt): Properly
1033 diagnose concept-ids.
1034
1035 2020-01-23 Jason Merrill <jason@redhat.com>
1036
1037 PR c++/93331 - ICE with __builtin_strchr.
1038 * constexpr.c (cxx_eval_builtin_function_call): Use the original
1039 argument if we didn't manage to extract a STRING_CST.
1040
1041 PR c++/93345 - ICE with defaulted dtor and template.
1042 PR c++/33799
1043 * decl.c (cxx_maybe_build_cleanup): Don't try to set
1044 throwing_cleanup in a template.
1045
1046 2020-01-22 Marek Polacek <polacek@redhat.com>
1047
1048 PR c++/92907 - noexcept does not consider "const" in member functions.
1049 * g++.dg/cpp0x/noexcept56.C: New test.
1050
1051 2020-01-22 Marek Polacek <polacek@redhat.com>
1052
1053 PR c++/93324 - ICE with -Wall on constexpr if.
1054 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
1055
1056 2020-01-22 Patrick Palka <ppalka@redhat.com>
1057
1058 * constraint.cc (get_mapped_args): Avoid using auto_vec
1059 as a vector element. Release the vectors inside the lists
1060 vector.
1061 * parser.c (cp_literal_operator_id): Free the buffer.
1062
1063 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
1064
1065 * coroutines.cc (finish_co_await_expr): Add error check on return
1066 value of build_co_await.
1067 (finish_co_yield_expr,): Ditto.
1068
1069 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
1070
1071 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
1072 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
1073 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
1074
1075 2020-01-21 Jason Merrill <jason@redhat.com>
1076
1077 PR c++/60855 - ICE with sizeof VLA capture.
1078 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
1079
1080 PR c++/90732 - ICE with VLA capture and generic lambda.
1081 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
1082
1083 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
1084 Bin Cheng <bin.cheng@linux.alibaba.com>
1085
1086 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
1087 from complete_type_or_else.
1088 (register_param_uses): Likewise.
1089 (build_co_await): Do not try to use complete_type_or_else for void
1090 types, otherwise for incomplete types, check for NULL return from
1091 complete_type_or_else.
1092
1093 2020-01-21 Jason Merrill <jason@redhat.com>
1094
1095 PR c++/91476 - anon-namespace reference temp clash between TUs.
1096 * decl2.c (copy_linkage): Factor out of get_guard.
1097 * call.c (make_temporary_var_for_ref_to_temp): Use it.
1098 * decl.c (cp_finish_decomp): Use it.
1099 (cp_finish_decl): determine_visibility sooner.
1100
1101 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
1102
1103 * coroutines.cc (finish_co_await_expr): Set return value flag.
1104 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
1105
1106 2020-01-19 Jason Merrill <jason@redhat.com>
1107
1108 PR c++/33799 - destroy return value, take 2.
1109 * cp-tree.h (current_retval_sentinel): New macro.
1110 (struct language_function): Add throwing_cleanup bitfield.
1111 * decl.c (cxx_maybe_build_cleanup): Set it.
1112 * except.c (maybe_set_retval_sentinel)
1113 (maybe_splice_retval_cleanup): New functions.
1114 * parser.c (cp_parser_compound_statement): Call
1115 maybe_splice_retval_cleanup.
1116 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
1117
1118 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
1119
1120 2020-01-18 Jakub Jelinek <jakub@redhat.com>
1121
1122 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
1123 but non-NO_DOLLAR_IN_LABEL case build.
1124
1125 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
1126
1127 * Make-lang.in: Add coroutines.o.
1128 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
1129 (DECL_COROUTINE_P): New.
1130 * lex.c (init_reswords): Enable keywords when the coroutine flag
1131 is set,
1132 * operators.def (co_await): New operator.
1133 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
1134 (op_error): Likewise.
1135 (build_new_op_1): Likewise.
1136 (build_new_function_call): Validate coroutine builtin arguments.
1137 * constexpr.c (potential_constant_expression_1): Handle
1138 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
1139 * coroutines.cc: New file.
1140 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
1141 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
1142 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
1143 * cp-tree.h (coro_validate_builtin_call): New.
1144 * decl.c (emit_coro_helper): New.
1145 (finish_function): Handle the case when a function is found to
1146 be a coroutine, perform the outlining and emit the outlined
1147 functions. Set a bit to signal that this is a coroutine component.
1148 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
1149 (cp_parser_unary_expression): Handle co_await.
1150 (cp_parser_assignment_expression): Handle co_yield.
1151 (cp_parser_statement): Handle RID_CO_RETURN.
1152 (cp_parser_jump_statement): Handle co_return.
1153 (cp_parser_operator): Handle co_await operator.
1154 (cp_parser_yield_expression): New.
1155 (cp_parser_required_error): Handle RT_CO_YIELD.
1156 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
1157 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
1158 CO_RETURN_EXPRs.
1159 * tree.c (cp_walk_subtrees): Likewise.
1160
1161 2020-01-17 Jason Merrill <jason@redhat.com>
1162
1163 PR c++/92531 - ICE with noexcept(lambda).
1164 * pt.c (uses_template_parms): Don't try to enumerate all the
1165 expression cases.
1166
1167 2020-01-17 Jakub Jelinek <jakub@redhat.com>
1168
1169 PR c++/93228
1170 * parser.c (cp_parser_template_name): Look up deprecated attribute
1171 in DECL_TEMPLATE_RESULT or its type's attributes.
1172
1173 2020-01-16 Jason Merrill <jason@redhat.com>
1174
1175 PR c++/93286 - ICE with __is_constructible and variadic template.
1176 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
1177 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
1178
1179 PR c++/93280 - ICE with aggregate assignment and DMI.
1180 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
1181 * typeck2.c (digest_nsdmi_init): Not here.
1182
1183 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
1184
1185 PR c++/91073
1186 * cp-tree.h (is_constrained_auto): New.
1187 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
1188 handle concept-check expressions; take a cp_decl_specifier_seq*
1189 instead of a bool.
1190 (cp_parser_condition): Update call.
1191 (cp_parser_simple_declaration): Likewise.
1192 (cp_parser_placeholder_type_specifier): Correctly handle
1193 concept-check expressions.
1194
1195 2020-01-15 Jason Merrill <jason@redhat.com>
1196
1197 Revert
1198 PR c++/33799 - destroy return value if local cleanup throws.
1199 * cp-tree.h (current_retval_sentinel): New macro.
1200 * decl.c (start_preparsed_function): Set up cleanup for retval.
1201 * typeck.c (check_return_expr): Set current_retval_sentinel.
1202
1203 PR c++/93257 - consteval void function.
1204 * constexpr.c (verify_constant): Allow void_node.
1205
1206 PR c++/92871 - bad code with xvalue and GNU ?: extension.
1207 * call.c (prevent_lifetime_extension): New.
1208 (build_conditional_expr_1): Use it.
1209
1210 2020-01-14 Nathan Sidwell <nathan@acm.org>
1211
1212 PR c++/90916
1213 * pt.c (retrieve_specialization): Use get_template_info, not open
1214 coding access.
1215
1216 PR c++/90916
1217 * pt.c (retrieve_specialization): Get the TI from the decl or the
1218 classtype as appropriate.
1219
1220 2020-01-14 David Malcolm <dmalcolm@redhat.com>
1221
1222 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
1223 New static constant.
1224 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
1225 (struct named_label_hash::empty_zero_p): Likewise.
1226 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
1227
1228 2020-01-14 Jason Merrill <jason@redhat.com>
1229
1230 PR c++/92590 - wrong handling of inherited default ctor.
1231 * class.c (add_method): A constrained inherited ctor doesn't hide an
1232 implicit derived ctor.
1233 Revert:
1234 PR c++/92552 - ICE with inherited constrained default ctor.
1235 * pt.c (instantiate_class_template_1): Copy
1236 TYPE_HAS_USER_CONSTRUCTOR.
1237 PR c++/91930 - ICE with constrained inherited default ctor.
1238 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
1239 for inherited constructor.
1240 PR c++/92594 - ICE with inherited trivial default ctor.
1241 * method.c (trivial_fn_p): Treat an inherited default constructor
1242 like a normal default constructor.
1243
1244 PR c++/92594 - ICE with inherited trivial default ctor.
1245 * method.c (trivial_fn_p): Treat an inherited default constructor
1246 like a normal default constructor.
1247
1248 PR c++/92009 - ICE with punning of typeid.
1249 * rtti.c (get_tinfo_desc): Call xref_basetypes.
1250 * constexpr.c (cxx_fold_indirect_ref): Don't strip
1251 REINTERPRET_CAST_P.
1252
1253 2020-01-13 Jason Merrill <jason@redhat.com>
1254
1255 PR c++/92746 - ICE with noexcept of function concept check.
1256 * except.c (check_noexcept_r): Handle concept-check.
1257
1258 PR c++/92582 - ICE with member template as requirement.
1259 * pt.c (struct find_template_parameter_info): Add ctx_parms.
1260 (any_template_parm_r): Handle TEMPLATE_DECL.
1261 (find_template_parameters): Take parms instead of their depth.
1262 * constraint.cc (build_parameter_mapping): Pass them.
1263
1264 PR c++/33799 - destroy return value if local cleanup throws.
1265 * cp-tree.h (current_retval_sentinel): New macro.
1266 * decl.c (start_preparsed_function): Set up cleanup for retval.
1267 * typeck.c (check_return_expr): Set current_retval_sentinel.
1268
1269 PR c++/93238 - short right-shift with enum.
1270 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
1271
1272 2020-01-10 Jason Merrill <jason@redhat.com>
1273
1274 * typeck.c (cp_build_binary_op): Restore short_shift code.
1275
1276 PR c++/93143 - incorrect tree sharing with constexpr.
1277 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
1278 CONSTRUCTORs are already unshared.
1279
1280 PR c++/93173 - incorrect tree sharing.
1281 PR c++/93033
1282 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
1283 copy_if_shared after cp_genericize_tree.
1284 * typeck2.c (split_nonconstant_init): Don't unshare here.
1285
1286 2020-01-08 Jason Merrill <jason@redhat.com>
1287
1288 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
1289 TARGET_EXPR_DIRECT_INIT_P.
1290 * constexpr.c (cxx_eval_constant_expression): Likewise.
1291
1292 2020-01-08 Jason Merrill <jason@redhat.com>
1293
1294 PR c++/91369 - constexpr destructor and member initializer.
1295 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
1296 when not preevaluating.
1297
1298 2020-01-08 Jason Merrill <jason@redhat.com>
1299
1300 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
1301 support.
1302
1303 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
1304
1305 * init.c (build_new): Add location_t parameter and use it throughout.
1306 (build_raw_new_expr): Likewise.
1307 * parser.c (cp_parser_new_expression): Pass the combined_loc.
1308 * pt.c (tsubst_copy_and_build): Adjust call.
1309 * cp-tree.h: Update declarations.
1310
1311 2020-01-07 Jason Merrill <jason@redhat.com>
1312
1313 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
1314 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
1315 explicit class visibility for a template.
1316
1317 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
1318
1319 * mangle.c (mangle_type_attribute_p): New function, split out from...
1320 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
1321 that contain a space.
1322
1323 2020-01-07 Jakub Jelinek <jakub@redhat.com>
1324
1325 PR c++/91369
1326 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
1327 member, initialize it to zero in ctor.
1328 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
1329 a heap object. Don't cache calls to functions which allocate some
1330 heap objects and don't deallocate them or deallocate some heap
1331 objects they didn't allocate.
1332
1333 2020-01-06 Jason Merrill <jason@redhat.com>
1334
1335 PR c++/92552 - ICE with inherited constrained default ctor.
1336 * pt.c (instantiate_class_template_1): Copy
1337 TYPE_HAS_USER_CONSTRUCTOR.
1338 * class.c (one_inherited_ctor): Don't set it here.
1339
1340 2020-01-06 Andrew Sutton <asutton@lock3software.com>
1341
1342 PR c++/92739 - parsing requires clause with attributes.
1343 * parser.c (cp_parser_constraint_requires_parens): Exclude
1344 attributes as postfix expressions.
1345
1346 2020-01-05 Jakub Jelinek <jakub@redhat.com>
1347
1348 PR c++/93138
1349 * parser.c (cp_parser_check_class_key): Disable access checks for the
1350 simple name lookup.
1351 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
1352 !warn_redundant_tags.
1353
1354 2010-01-05 Jakub Jelinek <jakub@redhat.com>
1355
1356 PR c++/93046
1357 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
1358 TARGET_EXPR if it has been gimplified already.
1359
1360 2020-01-03 Jason Merrill <jason@redhat.com>
1361
1362 PR c++/93033 - incorrect tree node sharing with array init.
1363 * typeck2.c (split_nonconstant_init): Unshare non-decl.
1364 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
1365
1366 2020-01-02 Jason Merrill <jason@redhat.com>
1367
1368 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
1369 C++17.
1370
1371 2020-01-02 Jakub Jelinek <jakub@redhat.com>
1372
1373 PR c/90677
1374 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
1375 has not been found, rather than error_mark_node.
1376
1377 2020-01-01 Jakub Jelinek <jakub@redhat.com>
1378
1379 Update copyright years.
1380 \f
1381 Copyright (C) 2020 Free Software Foundation, Inc.
1382
1383 Copying and distribution of this file, with or without modification,
1384 are permitted in any medium without royalty provided the copyright
1385 notice and this notice are preserved.