1 2020-03-27 Jakub Jelinek <jakub@redhat.com>
4 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
5 operand and creating a new COMPOUND_EXPR if anything changed.
7 2020-03-26 Marek Polacek <polacek@redhat.com>
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.
13 2020-03-27 Patrick Palka <ppalka@redhat.com>
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.
22 2020-03-26 Marek Polacek <polacek@redhat.com>
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.
33 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
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.
55 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
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
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-
69 2020-03-26 Jakub Jelinek <jakub@redhat.com>
72 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
73 true for all TEMPLATE_DECLs.
76 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
78 2020-03-25 Patrick Palka <ppalka@redhat.com>
81 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
82 current condition chain when the if-statement has a non-empty
85 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
88 * coroutines.cc (captures_temporary): Fix a missing dereference.
90 2020-03-24 Marek Polacek <polacek@redhat.com>
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.
95 2020-03-24 Jason Merrill <jason@redhat.com>
98 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
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.
105 2020-03-24 Jason Merrill <jason@redhat.com>
107 * pt.c (any_template_parm_r): Look into the type of a non-type
110 2020-03-24 Jason Merrill <jason@redhat.com>
112 * cp-tree.h (cp_expr): When constructing from an expr and a
113 location, call protected_set_expr_location.
115 2020-03-23 Patrick Palka <ppalka@redhat.com>
118 * except.c (maybe_noexcept_warning): Add TODO.
119 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
121 2020-03-23 nathans <nathan@acm.org>
124 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
127 2020-03-21 Patrick Palka <ppalka@redhat.com>
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
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
142 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
143 CONSTRUCTOR returned by lookup_placeholder.
145 2020-03-20 Patrick Palka <ppalka@redhat.com>
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.
155 2020-03-19 Jason Merrill <jason@redhat.com>
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
166 2020-03-19 Jakub Jelinek <jakub@redhat.com>
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
174 2020-03-18 Nathan Sidwell <nathan@acm.org>
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.
182 2020-03-18 Jakub Jelinek <jakub@redhat.com>
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):
188 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
189 * pt.c (append_type_to_template_for_access_check): Likewise.
192 * decl.c (grokfndecl): Restore old diagnostics about deduction
193 guide declared in different scope if in_namespace is NULL_TREE.
195 2020-03-17 Jakub Jelinek <jakub@redhat.com>
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.
205 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
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.
212 2020-03-17 Jakub Jelinek <jakub@redhat.com>
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
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.
222 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
224 * coroutines.cc (co_await_expander): Fix indentation.
226 2020-03-14 Jason Merrill <jason@redhat.com>
229 * pt.c (process_partial_specialization): Error rather than crash on
230 extra pack expansion.
232 2020-03-14 Jason Merrill <jason@redhat.com>
235 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
236 DECL_ORIGINAL_TYPE of a typedef.
238 2020-03-14 Jason Merrill <jason@redhat.com>
241 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
242 substituting DECL_ARGUMENTS.
244 2020-03-14 Jakub Jelinek <jakub@redhat.com>
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
250 2020-03-13 Patrick Palka <ppalka@redhat.com>
253 * call.c (build_over_call): Use a warning_sentinel to disable
254 warn_deprecated_decl before calling build_addr_func.
256 2020-03-12 Jakub Jelinek <jakub@redhat.com>
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
263 2020-03-11 Jason Merrill <jason@redhat.com>
266 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
269 2020-03-11 Marek Polacek <polacek@redhat.com>
270 Jason Merrill <jason@redhat.com>
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.
279 2020-03-10 Marek Polacek <polacek@redhat.com>
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.
285 2020-03-10 Jason Merrill <jason@redhat.com>
288 * pt.c (maybe_instantiate_noexcept): Always update clones.
290 2020-03-10 Jason Merrill <jason@redhat.com>
293 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
295 2020-03-10 Jason Merrill <jason@redhat.com>
301 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
302 66139: Don't split_nonconstant_init. Remove pre_p parameter.
304 2020-03-09 Marek Polacek <polacek@redhat.com>
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.
326 2020-03-09 Jakub Jelinek <jakub@redhat.com>
330 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
332 * constexpr.c (cxx_eval_constant_expression): Do not handle
333 RROTATE_EXPR and LROTATE_EXPR.
335 2020-03-09 Marek Polacek <polacek@redhat.com>
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.
341 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
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.
347 2020-03-08 Patrick Palka <ppalka@redhat.com>
350 * call.c (convert_like_real): Check complain before emitting an error
351 about binding a bit-field to a reference.
353 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
354 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
357 2020-03-06 Nathan Sidwell <nathan@acm.org>
360 * mangle.c (find_substitution): Don't call same_type_p on template
361 args that cannot match.
363 2020-03-04 Martin Sebor <msebor@redhat.com>
366 * tree.c (type_initializer_zero_p): Fail for structs initialized
369 2020-03-04 Jason Merrill <jason@redhat.com>
372 * init.c (perform_member_init): Don't do aggregate initialization of
374 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
375 initialization of empty field.
377 2020-03-04 Martin Liska <mliska@suse.cz>
379 * method.c: Wrap array in ctor with braces in order
380 to silent clang warnings.
382 2020-03-03 Jason Merrill <jason@redhat.com>
383 Marek Polacek <polacek@redhat.com>
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.
389 2020-03-03 Jakub Jelinek <jakub@redhat.com>
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.
396 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
398 * coroutines.cc (captures_temporary): Strip component_ref
401 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
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.
409 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
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
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.
424 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
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
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.
436 2020-02-28 Jason Merrill <jason@redhat.com>
438 Implement P2092R0, Disambiguating Nested-Requirements
439 * parser.c (cp_parser_requirement_parameter_list): Pass
440 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
442 * call.c (build_user_type_conversion_1): Don't look at the second
443 conversion of a non-viable candidate.
445 2020-02-28 Jakub Jelinek <jakub@redhat.com>
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.
451 2020-02-27 Nathan Sidwell <nathan@acm.org>
454 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
456 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
457 * typeck.c (comptypes): Assert we don't get any argument packs.
459 * class.c (adjust_clone_args): Correct arg-checking assert.
460 * typeck.c (comptypes): Assert not nulls.
462 2020-02-26 Marek Polacek <polacek@redhat.com>
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.
468 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
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
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.
483 2020-02-26 Patrick Palka <ppalka@redhat.com>
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
491 (diagnose_requires_expr): Likewise.
492 (diagnose_atomic_constraint): Likewise. When printing an atomic
493 constraint expression, print the instantiated parameter mapping
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.
499 2020-02-26 Marek Polacek <polacek@redhat.com>
501 PR c++/93676 - value-init crash in template.
502 * init.c (build_new_1): Don't call build_vec_init in a template.
504 2020-02-26 Marek Polacek <polacek@redhat.com>
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.
512 2020-02-26 Marek Polacek <polacek@redhat.com>
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
518 2020-02-24 Martin Sebor <msebor@redhat.com>
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.
525 2020-02-24 Marek Polacek <polacek@redhat.com>
527 PR c++/93869 - ICE with -Wmismatched-tags.
528 * parser.c (cp_parser_check_class_key): Check class_key earlier.
530 2020-02-24 Marek Polacek <polacek@redhat.com>
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.
539 2020-02-24 Jakub Jelinek <jakub@redhat.com>
541 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
542 * call.c (build_over_call): Don't evaluate immediate functions in
543 unevaluated operands.
545 2020-02-24 Jason Merrill <jason@redhat.com>
547 P0780R2: Resolve lambda init-capture pack grammar.
548 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
551 2020-02-22 Marek Polacek <polacek@redhat.com>
554 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
556 2020-02-21 Martin Sebor <msebor@redhat.com>
558 PR gcov-profile/93753
559 * class.c (check_flexarrays): Tighten up a test for potential members
560 of anonymous structs or unions.
562 2020-02-20 Martin Sebor <msebor@redhat.com>
565 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
567 2020-02-20 Martin Liska <mliska@suse.cz>
570 * config/or1k/or1k.opt: Remove superfluous word.
571 * doc/invoke.texi: Likewise.
573 2020-02-20 Martin Liska <mliska@suse.cz>
576 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
578 2020-02-19 Marek Polacek <polacek@redhat.com>
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.
584 2020-02-15 Marek Polacek <polacek@redhat.com>
586 PR c++/93710 - poor diagnostic for array initializer.
587 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
590 2020-02-15 Jason Merrill <jason@redhat.com>
593 * pt.c (any_template_parm_r): Look into lambda body.
596 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
598 2020-02-14 Jakub Jelinek <jakub@redhat.com>
601 * class.c (enum_min_precision): Change prec type from int to int &.
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
610 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
611 is disabled for compatibility.
613 2020-02-13 Jason Merrill <jason@redhat.com>
616 * name-lookup.c (matching_fn_p): A function does not match a
621 * tree.c (decl_linkage): Always lk_none for locals.
623 2020-02-12 Jason Merrill <jason@redhat.com>
627 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
628 * pt.c (find_parameter_packs_r): Not here.
630 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
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.
637 2020-02-12 Marek Polacek <polacek@redhat.com>
639 PR c++/93684 - ICE-on-invalid with broken attribute.
640 * parser.c (cp_parser_std_attribute): Peek a token first before
643 2020-02-11 Jason Merrill <jason@redhat.com>
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.
652 2020-02-11 Jason Merrill <jason@redhat.com>
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.
660 2020-02-12 Patrick Palka <ppalka@redhat.com>
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
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
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.
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.
682 2020-02-10 Jakub Jelinek <jakub@redhat.com>
685 * error.c (dump_decl_name): Fix up last argument to strncmp.
687 2020-02-10 Jason Merrill <jason@redhat.com>
690 * tree.c (array_of_unknown_bound_p): New.
691 * init.c (perform_member_init): Do nothing for flexible arrays.
693 2020-02-09 Jakub Jelinek <jakub@redhat.com>
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
700 2020-02-08 Jason Merrill <jason@redhat.com>
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.
711 * constexpr.c (maybe_constant_value): Don't unshare if the cached
712 value is the same as the argument.
714 * typeck.c (maybe_warn_about_returning_address_of_local): Add
717 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
720 2020-02-08 Jakub Jelinek <jakub@redhat.com>
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.
729 2020-02-07 Marek Polacek <polacek@redhat.com>
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.
735 2020-02-06 Jason Merrill <jason@redhat.com>
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.
745 2020-02-06 Jason Merrill <jason@redhat.com>
748 * parser.c (cp_parser_constraint_primary_expression): Do the main
749 parse non-tentatively.
751 2020-02-06 Marek Polacek <polacek@redhat.com>
753 PR c++/93597 - ICE with lambda in operator function.
754 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
756 2020-02-05 Jason Merrill <jason@redhat.com>
759 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
760 handling of TREE_CHAIN for empty pack.
762 2020-02-05 Jakub Jelinek <jakub@redhat.com>
765 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
766 prior to passing it to c_build_vec_convert.
768 2020-02-05 Marek Polacek <polacek@redhat.com>
770 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
771 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
774 2020-02-05 Jason Merrill <jason@redhat.com>
777 * decl.c (grokdeclarator): Reject field of current class type even
780 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
782 * coroutines.cc (maybe_promote_captured_temps): Increase the index
783 number for temporary variables' name.
785 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
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.
791 (co_await_expander): Sink to call_expr if await_resume
792 is wrapped by indirect_ref.
794 2020-02-04 Jason Merrill <jason@redhat.com>
797 * constraint.cc (satisfy_declaration_constraints): Check return
798 value of push_tinst_level.
801 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
802 elements instead of value-initializing them.
805 * init.c (perform_member_init): Simplify.
806 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
808 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
810 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
812 * coroutines.cc (find_promise_type): Delete unused forward
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.
818 2020-02-03 Jason Merrill <jason@redhat.com>
821 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
822 defer loading the value of a reference.
824 2020-02-03 Jason Merrill <jason@redhat.com>
827 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
829 [COMPONENT_REF]: A member function reference doesn't use the object
832 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
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
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
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
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.
854 2020-02-03 Jason Merrill <jason@redhat.com>
857 * cp-gimplify.c (predeclare_vla): New.
858 (cp_genericize_r) [NOP_EXPR]: Call it.
860 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
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.
866 2020-02-02 Marek Polacek <polacek@redhat.com>
868 PR c++/93530 - ICE on invalid alignas in a template.
869 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
872 2020-01-31 Jason Merrill <jason@redhat.com>
875 * semantics.c (process_outer_var_ref): Capture VLAs even in
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.
886 * parser.c (cp_parser_initializer_list): Suppress location wrappers
889 2020-01-29 Jason Merrill <jason@redhat.com>
892 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
893 the expression was dependent before substitution.
895 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
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.
902 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
904 * coroutines.cc (co_await_expander): Handle type conversion case.
906 2020-01-29 Jason Merrill <jason@redhat.com>
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
916 2020-01-29 Marek Polacek <polacek@redhat.com>
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
923 2020-01-29 Marek Polacek <polacek@redhat.com>
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.
931 2020-01-29 Jakub Jelinek <jakub@redhat.com>
934 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
935 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
937 2020-01-28 Jason Merrill <jason@redhat.com>
940 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
944 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
947 * call.c (build_user_type_conversion_1): Allow a template conversion
948 returning an rvalue reference to bind directly to an lvalue.
951 * decl.c (grokdeclarator): Propagate eh spec from typedef.
953 2020-01-28 Martin Liska <mliska@suse.cz>
956 * pt.c (redeclare_class_template): Group couple of
957 errors and inform messages with auto_diagnostic_group.
959 2020-01-28 Martin Liska <mliska@suse.cz>
962 * pt.c (redeclare_class_template): Use inform
963 for the second location.
965 2020-01-27 Jason Merrill <jason@redhat.com>
968 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
970 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
973 * coroutines.cc (morph_fn_to_coro): Check the ramp return
974 value when it is constructed from the 'get return object'.
976 2020-01-27 Nathan Sidwell <nathan@acm.org>
979 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
981 2020-01-26 Jason Merrill <jason@redhat.com>
984 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
985 temporarily enable -Wsystem-headers. Change second warning to
989 * semantics.c (finish_call_expr): Don't call
990 instantiate_non_dependent_expr before warn_for_memset.
992 2020-01-25 Marek Polacek <polacek@redhat.com>
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.
998 2020-01-24 Jason Merrill <jason@redhat.com>
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.
1007 2020-01-24 Jason Merrill <jason@redhat.com>
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.
1013 2020-01-24 Jason Merrill <jason@redhat.com>
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.
1019 2020-01-24 Marek Polacek <polacek@redhat.com>
1021 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
1022 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
1024 2020-01-24 Jason Merrill <jason@redhat.com>
1026 PR c++/92852 - ICE with generic lambda and reference var.
1027 * constexpr.c (maybe_constant_value): Likewise.
1029 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
1032 * parser.c (cp_parser_nested_name_specifier_opt): Properly
1033 diagnose concept-ids.
1035 2020-01-23 Jason Merrill <jason@redhat.com>
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.
1041 PR c++/93345 - ICE with defaulted dtor and template.
1043 * decl.c (cxx_maybe_build_cleanup): Don't try to set
1044 throwing_cleanup in a template.
1046 2020-01-22 Marek Polacek <polacek@redhat.com>
1048 PR c++/92907 - noexcept does not consider "const" in member functions.
1049 * g++.dg/cpp0x/noexcept56.C: New test.
1051 2020-01-22 Marek Polacek <polacek@redhat.com>
1053 PR c++/93324 - ICE with -Wall on constexpr if.
1054 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
1056 2020-01-22 Patrick Palka <ppalka@redhat.com>
1058 * constraint.cc (get_mapped_args): Avoid using auto_vec
1059 as a vector element. Release the vectors inside the lists
1061 * parser.c (cp_literal_operator_id): Free the buffer.
1063 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
1065 * coroutines.cc (finish_co_await_expr): Add error check on return
1066 value of build_co_await.
1067 (finish_co_yield_expr,): Ditto.
1069 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
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.
1075 2020-01-21 Jason Merrill <jason@redhat.com>
1077 PR c++/60855 - ICE with sizeof VLA capture.
1078 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
1080 PR c++/90732 - ICE with VLA capture and generic lambda.
1081 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
1083 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
1084 Bin Cheng <bin.cheng@linux.alibaba.com>
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.
1093 2020-01-21 Jason Merrill <jason@redhat.com>
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.
1101 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
1103 * coroutines.cc (finish_co_await_expr): Set return value flag.
1104 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
1106 2020-01-19 Jason Merrill <jason@redhat.com>
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.
1118 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
1120 2020-01-18 Jakub Jelinek <jakub@redhat.com>
1122 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
1123 but non-NO_DOLLAR_IN_LABEL case build.
1125 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
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
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
1159 * tree.c (cp_walk_subtrees): Likewise.
1161 2020-01-17 Jason Merrill <jason@redhat.com>
1163 PR c++/92531 - ICE with noexcept(lambda).
1164 * pt.c (uses_template_parms): Don't try to enumerate all the
1167 2020-01-17 Jakub Jelinek <jakub@redhat.com>
1170 * parser.c (cp_parser_template_name): Look up deprecated attribute
1171 in DECL_TEMPLATE_RESULT or its type's attributes.
1173 2020-01-16 Jason Merrill <jason@redhat.com>
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.
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.
1183 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
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*
1190 (cp_parser_condition): Update call.
1191 (cp_parser_simple_declaration): Likewise.
1192 (cp_parser_placeholder_type_specifier): Correctly handle
1193 concept-check expressions.
1195 2020-01-15 Jason Merrill <jason@redhat.com>
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.
1203 PR c++/93257 - consteval void function.
1204 * constexpr.c (verify_constant): Allow void_node.
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.
1210 2020-01-14 Nathan Sidwell <nathan@acm.org>
1213 * pt.c (retrieve_specialization): Use get_template_info, not open
1217 * pt.c (retrieve_specialization): Get the TI from the decl or the
1218 classtype as appropriate.
1220 2020-01-14 David Malcolm <dmalcolm@redhat.com>
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.
1228 2020-01-14 Jason Merrill <jason@redhat.com>
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.
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.
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.
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
1253 2020-01-13 Jason Merrill <jason@redhat.com>
1255 PR c++/92746 - ICE with noexcept of function concept check.
1256 * except.c (check_noexcept_r): Handle concept-check.
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.
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.
1269 PR c++/93238 - short right-shift with enum.
1270 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
1272 2020-01-10 Jason Merrill <jason@redhat.com>
1274 * typeck.c (cp_build_binary_op): Restore short_shift code.
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.
1280 PR c++/93173 - incorrect tree sharing.
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.
1286 2020-01-08 Jason Merrill <jason@redhat.com>
1288 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
1289 TARGET_EXPR_DIRECT_INIT_P.
1290 * constexpr.c (cxx_eval_constant_expression): Likewise.
1292 2020-01-08 Jason Merrill <jason@redhat.com>
1294 PR c++/91369 - constexpr destructor and member initializer.
1295 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
1296 when not preevaluating.
1298 2020-01-08 Jason Merrill <jason@redhat.com>
1300 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
1303 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
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.
1311 2020-01-07 Jason Merrill <jason@redhat.com>
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.
1317 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
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.
1323 2020-01-07 Jakub Jelinek <jakub@redhat.com>
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.
1333 2020-01-06 Jason Merrill <jason@redhat.com>
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.
1340 2020-01-06 Andrew Sutton <asutton@lock3software.com>
1342 PR c++/92739 - parsing requires clause with attributes.
1343 * parser.c (cp_parser_constraint_requires_parens): Exclude
1344 attributes as postfix expressions.
1346 2020-01-05 Jakub Jelinek <jakub@redhat.com>
1349 * parser.c (cp_parser_check_class_key): Disable access checks for the
1351 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
1352 !warn_redundant_tags.
1354 2010-01-05 Jakub Jelinek <jakub@redhat.com>
1357 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
1358 TARGET_EXPR if it has been gimplified already.
1360 2020-01-03 Jason Merrill <jason@redhat.com>
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.
1366 2020-01-02 Jason Merrill <jason@redhat.com>
1368 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
1371 2020-01-02 Jakub Jelinek <jakub@redhat.com>
1374 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
1375 has not been found, rather than error_mark_node.
1377 2020-01-01 Jakub Jelinek <jakub@redhat.com>
1379 Update copyright years.
1381 Copyright (C) 2020 Free Software Foundation, Inc.
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.