1 2020-06-23 Jason Merrill <jason@redhat.com>
4 Implement C++20 P2082R1, Fixing CTAD for aggregates.
5 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
6 (DECL_PRIMARY_TEMPLATE): ...here.
7 (builtin_guide_p): Declare.
8 * decl.c (reshape_init_class): Handle bases of a template.
9 (reshape_init_r): An array with dependent bound takes a single
11 * pt.c (tsubst_default_argument): Shortcut {}.
12 (unify_pack_expansion): Allow omitted arguments to trailing pack.
13 (builtin_guide_p): New.
14 (collect_ctor_idx_types): Give a trailing pack a {} default
15 argument. Handle arrays better.
17 2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
20 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
21 the get return object when the DTOR is non-trivial.
23 2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
26 * coroutines.cc (morph_fn_to_coro): Update handling of
27 get-return-object-on-allocation-fail and diagnose missing
30 2020-06-20 Jason Merrill <jason@redhat.com>
32 * call.c (joust): Only compare constraints for non-template
33 candidates with matching parameters.
34 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
36 (more_specialized_fn): Only compare constraints for candidates with
39 2020-06-19 Jason Merrill <jason@redhat.com>
41 * method.c (early_check_defaulted_comparison): Allow defaulting
42 comparison outside class. Complain if non-member operator isn't a
45 2020-06-18 Jason Merrill <jason@redhat.com>
47 * method.c (early_check_defaulted_comparison): Check for &&.
48 (build_comparison_op): Allow empty union. Diagnose non-category
50 (common_comparison_type): Remove handling for non-category type.
52 2020-06-18 Marek Polacek <polacek@redhat.com>
55 * pt.c (finish_template_variable): Return if
56 coerce_innermost_template_parms return error_mark_node.
58 2020-06-18 Marek Polacek <polacek@redhat.com>
61 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
62 if placement is erroneous.
64 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
67 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
68 unless in a declaration.
70 2020-06-17 Jason Merrill <jason@redhat.com>
72 * cp-tree.h (copy_fndecl_with_name): Declare.
73 * class.c (copy_fndecl_with_name): Split out from...
74 (build_clone): ...here.
75 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
76 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
78 2020-06-17 Jason Merrill <jason@redhat.com>
80 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
81 calling a consteval function.
83 2020-06-17 Jason Merrill <jason@redhat.com>
85 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
86 * decl.c (duplicate_decls): Reduce error for delete
87 after earlier declaration to pedwarn.
89 2020-06-17 Marek Polacek <polacek@redhat.com>
92 * constexpr.c (maybe_fold_non_dependent_expr): New.
93 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
94 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
95 instead of maybe_constant_value.
97 2020-06-16 Marek Polacek <polacek@redhat.com>
100 * call.c (add_list_candidates): Return if a designated initializer
101 is used with a non-aggregate.
102 (implicit_conversion_error): Give an error for the case above.
104 2020-06-16 Marek Polacek <polacek@redhat.com>
107 * name-lookup.c (check_local_shadow): Check if types are
108 non-null before calling same_type_p.
110 2020-06-16 Jakub Jelinek <jakub@redhat.com>
112 * semantics.c (handle_omp_for_class_iterator): Adjust
113 c_omp_check_loop_iv_exprs caller.
114 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
115 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
117 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
119 2020-06-16 Jakub Jelinek <jakub@redhat.com>
121 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
122 from kind by comma rather than colon.
124 2020-06-16 Patrick Palka <ppalka@redhat.com>
126 * pt.c (perform_instantiation_time_access_checks): No need to
128 * semantics.c (enforce_access): Verify that decl is not
131 2020-06-16 Patrick Palka <ppalka@redhat.com>
135 * cp-tree.h (qualified_typedef_usage_s): Delete.
136 (qualified_typedef_usage_t): Delete.
137 (deferred_access_check): Move up in file.
138 (tree_template_info::typedefs_needing_access_checking): Delete.
139 (tree_template_info::deferred_access_checks): New field.
140 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
141 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
142 * pt.c (perform_typedefs_access_check): Rename to ...
143 (perform_instantiation_time_access_checks): ... this, and adjust
144 accordingly. Remove unnecessary tree tests.
145 (instantiate_class_template_1): Adjust accordingly.
146 (instantiate_decl): Likewise.
147 * semantics.c (enforce_access): Likewise.
149 2020-06-16 Patrick Palka <ppalka@redhat.com>
153 * call.c (enforce_access): Move to semantics.c.
154 * cp-tree.h (enforce_access): Delete.
155 (get_types_needing_access_check): Delete.
156 (add_typedef_to_current_template_for_access_check): Delete.
157 * decl.c (make_typename_type): Adjust accordingly. Use
158 check_accessibility_of_qualified_id instead of directly using
159 perform_or_defer_access_check.
160 * parser.c (cp_parser_template_declaration_after_parameters):
161 Don't push a dk_no_check access state when parsing a template.
162 * pt.c (get_types_needing_access_check): Delete.
163 (append_type_to_template_for_access_check_1): Delete.
164 (perform_typedefs_access_check): Adjust. If type_decl is a
165 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
166 tsubst_copy instead of tsubst to substitute into type_decl so
167 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
168 (append_type_to_template_for_access_check): Delete.
169 * search.c (accessible_p): Remove the processing_template_decl
171 * semantics.c (enforce_access): Moved from call.c. If we're
172 parsing a template and the access check failed, add the check to
173 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
174 (perform_or_defer_access_check): Adjust comment.
175 (add_typedef_to_current_template_for_access_check): Delete.
176 (check_accessibility_of_qualified_id): Adjust accordingly.
177 Exit early if the scope is dependent.
179 2020-06-11 Patrick Palka <ppalka@redhat.com>
182 * constraint.cc (associate_classtype_constraints): If there is a
183 discrepancy between the current template depth and the template
184 depth of the original declaration, then adjust the template
185 parameter depth within the current constraints appropriately.
186 * pt.c (tsubst_friend_class): Substitute into and set the
187 constraints on the injected declaration.
189 2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
191 * coroutines.cc (instantiate_coro_traits): Pass a reference
192 to lambda closure objects to traits instantiation.
193 (morph_fn_to_coro): Likewise for promise parameter
194 preview and allocator lookup.
196 2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
199 * call.c (add_candidates): Use vec_safe_length() for
200 testing the arguments list.
201 (build_new_method_call_1): Use vec_safe_is_empty() when
202 checking for an empty args list.
204 2020-06-10 Marek Polacek <polacek@redhat.com>
207 * parser.c (cp_parser_direct_declarator): Clear
208 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
211 2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
214 * coroutines.cc (expand_one_await_expression): Build separate
215 DTOR trees for the awaitable object on the destroy and resume
218 2020-06-09 Jason Merrill <jason@redhat.com>
221 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
222 wrapped in a pointer type.
224 2020-06-05 Marek Polacek <polacek@redhat.com>
227 * call.c (build_converted_constant_expr_internal): Allow
230 2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
232 * cp-tree.def (CO_RETURN_EXPR): Correct the class
233 to use tcc_statement.
235 2020-06-05 Jason Merrill <jason@redhat.com>
237 * error.c (dump_binary_op): Handle negative operand to
240 2020-06-04 Jason Merrill <jason@redhat.com>
243 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
244 Evaluate OBJ_TYPE_REF_EXPR.
246 2020-06-04 Jason Merrill <jason@redhat.com>
249 * class.c (lookup_vfn_in_binfo): New.
250 * call.c (build_over_call): Use it.
251 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
252 (lookup_vfn_in_binfo): Declare.
254 2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
257 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
258 return-object is constructed correctly; When it is not the
259 final return value, pass it to the CTOR of the return type
260 as an rvalue, per the standard comment.
262 2020-06-04 Jakub Jelinek <jakub@redhat.com>
266 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
267 conversions from pointer types to arithmetic types here...
268 (cxx_eval_outermost_constant_expr): ... instead of here.
270 2020-06-03 Mark Wielaard <mark@klomp.org>
272 * parser.c (cp_lexer_safe_previous_token): New function.
273 (cp_parser_error_1): Add name_hint if the previous token is
274 a string literal and next token is a CPP_NAME and we have a
275 missing header suggestion for the name.
277 2020-06-03 Patrick Palka <ppalka@redhat.com>
279 * pt.c (process_partial_specialization): Pass the full set of
280 generic template arguments to strictly_subsumes.
282 2020-06-03 Patrick Palka <ppalka@redhat.com>
285 * pt.c (most_specialized_partial_spec): Reorganize the loop over
286 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
287 the original template declaration, not on the tsubsted one.
289 2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
292 * coroutines.cc (finish_co_await_expr): Revise to allow for
294 (finish_co_yield_expr): Likewise.
296 2020-06-03 Jason Merrill <jason@redhat.com>
299 * cp-tree.h (predeclare_vla): Declare.
300 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
301 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
303 2020-06-03 Tobias Burnus <tobias@codesourcery.com>
305 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
306 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
307 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
309 2020-06-02 Jason Merrill <jason@redhat.com>
312 * pt.c (tsubst_decl): Relax assert.
314 2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
317 * coroutines.cc (build_co_await): Wrap the co_await expression
318 in a TARGET_EXPR, where needed.
319 (finish_co_yield_expr): Likewise.
321 2020-06-02 Patrick Palka <ppalka@redhat.com>
325 * pt.c (tsubst_function_decl): Don't do set_constraints when
326 regenerating a lambda.
327 (tsubst_lambda_expr): Substitute into the lambda's constraints
328 and do set_constraints here.
330 2020-06-01 Jason Merrill <jason@redhat.com>
335 * class.c (build_vfn_ref): Revert 95311 change.
336 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
339 2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
342 * coroutines.cc (struct param_info): Remove rv_ref field.
343 (build_actor_fn): Remove specifial rvalue ref handling.
344 (morph_fn_to_coro): Likewise.
346 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
349 * coroutines.cc (morph_fn_to_coro): If we see an
350 early fatal error, drop the erroneous function body.
352 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
354 * coroutines.cc (build_co_await): Remove unused
356 (finish_co_await_expr): Likewise.
357 (finish_co_yield_expr): Likewise; revise comment.
359 2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
361 * coroutines.cc (morph_fn_to_coro): Revise initialization
362 of the frame pointer to avoid an unused value.
364 2020-05-30 Patrick Palka <ppalka@redhat.com>
367 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
370 2020-05-29 Patrick Palka <ppalka@redhat.com>
371 Jason Merrill <jason@redhat.com>
374 * class.c (add_method): Let special member function templates
375 coexist if they are not equivalently constrained, or in a class
378 2020-05-29 Jason Merrill <jason@redhat.com>
381 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
382 on the DECL_TEMPLATE_RESULT.
384 2020-05-29 Marek Polacek <polacek@redhat.com>
387 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
388 TREE_THIS_VOLATILE here.
389 (cp_fold): Set it here along with TREE_NO_WARNING.
391 2020-05-29 Jason Merrill <jason@redhat.com>
395 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
397 2020-05-29 Patrick Palka <ppalka@redhat.com>
402 * parser.c (cp_parser_requires_clause_expression): Temporarily
403 increment processing_template_decl only if it is 0.
404 (cp_parser_constraint_expression): Likewise.
405 (cp_parser_requires_expression): Likewise.
407 2020-05-29 Patrick Palka <ppalka@redhat.com>
410 * constexpr.c (get_or_insert_ctor_field): Add limited support
411 for RANGE_EXPR index lookups.
413 2020-05-28 Jakub Jelinek <jakub@redhat.com>
416 * decl.c (cp_finish_decomp): Call complete_type before checking
419 2020-05-28 Jason Merrill <jason@redhat.com>
422 * decl.c (cp_finish_decl): Revert r9-297 change.
423 (check_static_variable_definition): Likewise.
424 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
425 * pt.c (instantiate_decl): Return early on type error.
427 2020-05-27 Jason Merrill <jason@redhat.com>
430 * decl.c (reshape_init_array_1): Don't reuse in overload context.
432 2020-05-27 Jason Merrill <jason@redhat.com>
435 * call.c (build_new_op_1): Suppress
436 warn_zero_as_null_pointer_constant across comparison of <=> result
439 2020-05-27 Jason Merrill <jason@redhat.com>
442 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
445 2020-05-27 Nathan Sidwell <nathan@acm.org>
448 * pt.c (lookup_template_class_1): Restore alias template mutation.
450 2020-05-26 Jakub Jelinek <jakub@redhat.com>
453 * cp-gimplify.c: Include omp-general.h.
454 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
455 variables in composite distribute parallel for, instantiate copy
458 2020-05-23 Patrick Palka <ppalka@redhat.com>
461 * constexpr.c (cxx_eval_constant_expression)
462 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
463 constexpr evaluation is uid-sensitive.
465 2020-05-22 Jason Merrill <jason@redhat.com>
467 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
468 the function address if the call used operator syntax.
470 2020-05-21 Jason Merrill <jason@redhat.com>
473 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
474 call, instrument the OBJ_TYPE_REF.
476 * decl.c (compute_array_index_type_loc): Diagnose expressions
477 in a template that can't be constant.
478 * parser.c (cp_parser_direct_declarator): Don't check
479 non-constant array bounds here.
481 * cp-tree.h (is_rvalue_constant_expression): Declare.
482 * constexpr.c (is_rvalue_constant_expression): New.
483 * parser.c (cp_parser_constant_expression): Use it.
484 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
485 template as constant.
487 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
489 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
491 2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
493 * coroutines.cc (finish_co_return_stmt): Revert change to use
496 2020-05-21 Patrick Palka <ppalka@redhat.com>
499 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
500 (uid_sensitive_constexpr_evaluation_value): Define.
501 (uid_sensitive_constexpr_evaluation_true_counter): Define.
502 (uid_sensitive_constexpr_evaluation_p): Define.
503 (uid_sensitive_constexpr_evaluation_sentinel): Define its
505 (uid_sensitive_constexpr_evaluation_checker): Define its
506 constructor and its evaluation_restricted_p method.
507 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
508 instead of constexpr_ctx::uid_sensitive.
509 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
510 last. Adjust call to get_fundef_copy.
511 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
512 counter if necessary.
513 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
514 parameter. Adjust function body accordingly.
515 (maybe_constant_value): Remove 'uid_sensitive' parameter and
516 adjust function body accordingly. Set up a
517 uid_sensitive_constexpr_evaluation_checker, and use it to
518 conditionally update the cv_cache.
519 * cp-gimplify.c (cp_fold): Set up a
520 uid_sensitive_constexpr_evaluation_checker, and use it to
521 conditionally update the fold_cache.
522 * cp-tree.h (maybe_constant_value): Update declaration.
523 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
524 (struct sensitive_constexpr_evaluation_checker): Define.
525 * expr.c (fold_for_warn): Set up a
526 uid_sensitive_constexpr_evaluation_sentinel before calling
527 the folding subroutines. Drop all but the first argument to
528 maybe_constant_value.
530 2020-05-20 Marek Polacek <polacek@redhat.com>
533 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
534 the declarator-id of a destructor.
535 (cp_parser_constructor_declarator_p): Reject simple-template-id as
536 the declarator-id of a constructor.
538 2020-05-20 Marek Polacek <polacek@redhat.com>
542 * cp-tree.h (SD_DECOMPOSITION): New flag.
543 * decl.c (duplicate_decls): Make sure a structured binding is unique
544 in its declarative region.
545 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
546 fit_decomposition_lang_decl.
547 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
548 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
551 2020-05-20 Patrick Palka <ppalka@redhat.com>
554 * typeck.c (structural_comptypes): Don't perform
555 context-dependent resolution of TYPENAME_TYPEs when
556 comparing_specializations.
558 2020-05-19 Nathan Sidwell <nathan@acm.org>
560 * pt.c (lookup_template_class_1): Do not reinit template_info of an
563 2020-05-18 Martin Sebor <msebor@redhat.com>
566 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
567 * cp-tree.h (is_dummy_object): Return bool.
568 (is_byte_access_type): Declare new function.
569 * tree.c (is_dummy_object): Return bool.
570 (is_byte_access_type): Define new function.
572 2020-05-19 Patrick Palka <ppalka@redhat.com>
575 * pt.c (init_template_processing): Enable sanitization for
576 decl_specializations and type_specializations.
579 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
580 the 'in_decl' parameter to coerce_template_parms.
582 2020-05-18 Marek Polacek <polacek@redhat.com>
585 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
588 2020-05-18 Marek Polacek <polacek@redhat.com>
591 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
592 type is not INDIRECT_TYPE_P.
593 * decl.c (omp_declare_variant_finalize_one): Call
594 cp_get_callee_fndecl_nofold instead of looking for the function decl
597 2020-05-18 Marek Polacek <polacek@redhat.com>
600 * parser.c (cp_parser_has_attribute_expression): Sorry on a
601 type-dependent argument.
603 2020-05-18 Marek Polacek <polacek@redhat.com>
607 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
608 operator functions when type is std::nullptr_t for ==/!=.
609 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
610 to maybe add "const" to the pointer type.
611 (composite_pointer_type): Update the call to composite_pointer_type_r.
612 (cp_build_binary_op): Turn two warning_at into error_at. Print the
615 2020-05-18 Jason Merrill <jason@redhat.com>
617 * call.c (build_over_call): Remove unnecessary
618 cp_stabilize_reference.
620 2020-05-18 Marek Polacek <polacek@redhat.com>
622 * call.c (add_builtin_candidate): Don't create a builtin overload
623 candidate for ++ when type is bool in C++17.
625 2020-05-18 Marek Polacek <polacek@redhat.com>
627 * cfns.h: Regenerated.
629 2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
631 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
633 2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
635 * coroutines.cc (finish_co_return_stmt): Implement rules
636 from [class.copy.elision] /3.
638 2020-05-16 Patrick Palka <ppalka@redhat.com>
641 * semantics.c (finish_decltype_type): Call
642 instantiate_non_dependent_expr_sfinae on the expression.
644 2020-05-15 Patrick Palka <ppalka@redhat.com>
648 2020-04-07 Patrick Palka <ppalka@redhat.com>
651 * typeck2.c (process_init_constructor_array): Propagate
652 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
653 the array initializer.
655 2020-05-15 Jason Merrill <jason@redhat.com>
657 PR c++/93286 - ICE with __is_constructible and variadic template.
658 * pt.c (tsubst_tree_list): New.
659 (tsubst, tsubst_copy_and_build): Use it.
660 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
662 2020-05-15 Nathan Sidwell <nathan@acm.org>
664 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
666 2020-05-14 Jason Merrill <jason@redhat.com>
669 * pt.c (maybe_instantiate_noexcept): Change clone handling.
671 2020-05-14 Patrick Palka <ppalka@redhat.com>
674 * call.c (build_op_call): Pass complain to lookup_fnfields.
675 (build_special_member_call): Likewise.
676 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
678 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
679 * except.c (build_throw): Pass tf_warning_or_error to
681 * init.c (build_new_1): Pass complain to lookup_fnfields.
682 * method.c (locate_fn_flags): Likewise.
683 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
685 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
686 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
689 2020-05-14 Nathan Sidwell <nathan@acm.org>
691 * parser.c (cp_parser_diagnose_invalid_typename): Mention
692 std=c++20 not 2a, reformat dependent binfo inform loops.
694 * pt.c (tsubst_template_decl): Reorder and commonize some control
697 * pt.c (tsubst_friend_function): Simplify control flow.
699 * pt.c (lookup_template_class_1): Remove unnecessary else by
700 simply grabbing TYPE_NAME earlier.
702 * pt.c (push_template_decl_real): Adjust friend pushing logic.
703 Reinit template type.
705 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
707 (process_partial_specialization): ... not here ...
708 (push_template_decl_real, add_inherited_template_parms)
709 (build_deduction_guide): ... or here.
711 2020-05-14 Jakub Jelinek <jakub@redhat.com>
713 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
715 2020-05-13 Patrick Palka <ppalka@redhat.com>
718 * init.c (build_vec_delete_1): Just return error_mark_node if
719 deallocate_expr is error_mark_node.
720 (build_delete): Just return error_mark_node if do_delete is
723 2020-05-13 Patrick Palka <ppalka@redhat.com>
726 * constraint.cc (tsubst_requires_expr): Produce a new
727 requires-expression when processing_template_decl, even if
728 template arguments are not dependent.
730 2020-05-13 Marek Polacek <polacek@redhat.com>
733 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
735 2020-05-13 Nathan Sidwell <nathan@acm.org>
737 * pt.c (template_args_equal): Reorder category checking for
740 * pt.c (perform_typedefs_access_check): Cache expensively
741 calculated object references.
742 (check_auto_in_tmpl_args): Just assert we do not get unexpected
743 nodes, rather than silently do nothing.
744 (append_type_to_template_for_access): Likewise, cache expensie
747 * pt.c (canonical_type_parameter): Simplify.
749 Formatting fixups & some simplifications.
750 * pt.c (spec_hash_table): New typedef.
751 (decl_specializations, type_specializations): Use it.
752 (retrieve_specialization): Likewise.
753 (register_specialization): Remove unnecessary casts.
754 (push_template_decl_real): Reformat.
755 (instantiate_class_template_1): Use more RAII.
756 (make_argument_pack): Simplify.
757 (instantiate_template_1): Use gcc_checking_assert for expensive
759 (instantiate_decl): Likewise.
760 (resolve_typename_type): Reformat comment.
761 * semantics.c (struct deferred_access): Remove unnecessary GTY on
763 (begin_class_definition): Fix formatting.
765 2020-05-13 Jason Merrill <jason@redhat.com>
767 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
768 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
769 typeck2.c: Change cxx2a to cxx20.
771 2020-05-12 Marek Polacek <polacek@redhat.com>
774 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
775 looking for a block-scope function declaration, look through the whole
776 set, not just the first function in the overload set.
778 2020-05-12 Jakub Jelinek <jakub@redhat.com>
781 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
784 2020-05-11 Jason Merrill <jason@redhat.com>
786 Resolve C++20 NB comment CA104
787 * pt.c (determine_specialization): Compare constraints for
788 specialization of member template of class instantiation.
790 2020-05-11 Jason Merrill <jason@redhat.com>
794 * tree.c (cp_walk_subtrees): Stop at typedefs.
795 Handle TYPENAME_TYPE here.
796 * pt.c (find_parameter_packs_r): Not here.
797 (for_each_template_parm_r): Clear *walk_subtrees.
798 * decl2.c (min_vis_r): Look through typedefs.
800 2020-05-11 Jason Merrill <jason@redhat.com>
802 * call.c (implicit_conversion_error): Split out from...
803 (perform_implicit_conversion_flags): ...here.
804 (build_converted_constant_expr_internal): Use it.
806 2020-05-11 Jason Merrill <jason@redhat.com>
809 * parser.c (inject_parm_decls): Set current_class_ptr here.
810 (cp_parser_direct_declarator): And here.
811 (cp_parser_late_return_type_opt): Not here.
812 (cp_parser_noexcept_specification_opt): Nor here.
813 (cp_parser_exception_specification_opt)
814 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
816 2020-05-11 Jason Merrill <jason@redhat.com>
818 * decl.c (cxx_init_decl_processing): Call declare_weak for
821 2020-05-11 Jason Merrill <jason@redhat.com>
823 * pt.c (instantiate_class_template_1): Call tsubst_expr for
824 STATIC_ASSERT member.
825 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
827 2020-05-11 Jason Merrill <jason@redhat.com>
829 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
830 walking of capture list.
832 2020-05-11 Jason Merrill <jason@redhat.com>
834 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
835 * call.c (build_new_function_call): Don't set it.
836 (build_new_method_call_1): Likewise.
837 (build_over_call): Check cand->explicit_targs instead.
839 2020-05-11 Jason Merrill <jason@redhat.com>
841 * decl.c (compute_array_index_type_loc): Stabilize before building
844 2020-05-11 Jason Merrill <jason@redhat.com>
846 * decl.c (grokdeclarator): Adjust deprecated_state here.
847 (start_decl): Not here.
849 2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
852 * coroutines.cc (build_actor_fn): Ensure that bind scopes
853 are marked as having side-effects where necessary.
854 (replace_statement_captures): Likewise.
855 (morph_fn_to_coro): Likewise.
857 2020-05-08 Nathan Sidwell <nathan@acm.org>
859 * NEWS: Delete, it is so stale.
861 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
864 2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
868 * coroutines.cc (morph_fn_to_coro): Set unformed outline
869 functions to error_mark_node. For early error returns suppress
870 warnings about missing ramp return values. Fix reinstatement
871 of the function body on pre-existing initial error.
872 * decl.c (finish_function): Use the normal error path for fails
873 in the ramp function, do not try to compile the helpers if the
876 2020-05-07 Marek Polacek <polacek@redhat.com>
878 PR c++/94590 - Detect long double -> double narrowing.
879 * typeck2.c (check_narrowing): Detect long double -> double
880 narrowing even when double and long double have the same
881 precision. Make it handle conversions to float too.
883 2020-05-07 Marek Polacek <polacek@redhat.com>
886 * parser.c (cp_parser_class_specifier_1): Check that the scope is
887 nested inside current scope before pushing it.
889 2020-05-07 Marek Polacek <polacek@redhat.com>
892 * typeck2.c (check_narrowing): Consider T* to bool narrowing
895 2020-05-07 Marek Polacek <polacek@redhat.com>
897 * decl.c (grok_op_properties): Fix spelling of non-static.
898 * typeck.c (build_class_member_access_expr): Likewise.
900 2020-05-07 Richard Biener <rguenther@suse.de>
903 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
905 2020-05-06 Marek Polacek <polacek@redhat.com>
908 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
909 instead of uses_template_parms. Move the warning_sentinels after the
912 2020-05-06 Jakub Jelinek <jakub@redhat.com>
915 * typeck.c (cp_strict_aliasing_warning): New function.
916 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
917 it instead of strict_aliasing_warning.
920 * method.c (defaulted_late_check): Don't call synthesize_method
921 on constexpr sfk_comparison if it has been called on it already.
923 2020-05-06 Nathan Sidwell <nathan@acm.org>
926 * decl.c (grokdeclarator): Don't splice template attributes in
927 parm context -- they can apply to the parm.
929 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
931 * coroutines.cc: Remove references to n4849 throughout.
933 2020-05-05 Jason Merrill <jason@redhat.com>
936 * pt.c (more_specialized_fn): Do consider parms with no deducible
939 2020-05-05 Jason Merrill <jason@redhat.com>
942 * constexpr.c (potential_constant_expression_1): In a lambda
943 function, consider a captured variable directly.
945 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
947 * coroutines.cc (transform_await_wrapper): Check that we have
948 no unlowered co_yields.
949 (captures_temporary): Likewise.
950 (register_awaits): Likewise.
952 2020-05-05 Nathan Sidwell <nathan@acm.org>
955 * coroutines.cc (morph_fn_to_coro): Just check for
957 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
959 2020-05-05 Marek Polacek <polacek@redhat.com>
960 Jason Merrill <jason@redhat.com>
963 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
964 a type-dependent object of class type, stash it to
965 parser->context->object_type. If the postfix expression doesn't have
967 (cp_parser_class_name): Consider object scope too.
968 (cp_parser_lookup_name): Remove code dealing with the case when
969 object_type is unknown_type_node.
971 2020-05-04 Patrick Palka <ppalka@redhat.com>
974 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
975 declarations closer to their uses. Copy the CALL_EXPR only
976 when one of its arguments has changed.
977 <case TREE_VEC>: Instead of first collecting the folded
978 arguments into a releasing_vec, just make a copy of the TREE_VEC
979 as soon as folding changes one of its arguments.
981 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
983 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
984 as artificial and ignored.
986 2020-05-04 Nathan Sidwell <nathan@acm.org>
988 pt.c (process_template_parm): Don't walk the template list twice,
989 remember the final node instead.
990 (end_template_parm_list): Refactor. Comment on why we do a pop
993 PR c++/94827 -- don't save parms in nested requirement
994 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
995 notmalized requirement.
996 (finish_nested_requirement): Don't stash current tpl parms into
998 (diagnose_nested_requirement): TYPE directly holds notmalized
1001 2020-05-01 Patrick Palka <ppalka@redhat.com>
1004 * cp-tree.h (check_accessibility_of_qualified_id): Add
1005 tsubst_flags_t parameter and change return type to bool.
1006 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
1007 check_accessibility_of_qualified_id.
1008 * pt.c (tsubst_qualified_id): Return error_mark_node if
1009 check_accessibility_of_qualified_id returns false.
1010 * semantics.c (check_accessibility_of_qualified_id): Add
1011 complain parameter. Pass complain instead of
1012 tf_warning_or_error to perform_or_defer_access_check. Return
1013 true unless perform_or_defer_access_check returns false.
1015 2020-05-01 Marek Polacek <polacek@redhat.com>
1018 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
1019 if an initializer element was erroneous.
1021 2020-05-01 Jason Merrill <jason@redhat.com>
1024 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
1026 2020-05-01 Jason Merrill <jason@redhat.com>
1029 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
1030 -fmerge-all-constants.
1032 2020-05-01 Jason Merrill <jason@redhat.com>
1035 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
1036 the same type as the variable.
1038 2020-04-30 Jason Merrill <jason@redhat.com>
1039 Nathan Sidwell <nathan@acm.org>
1042 * constraint.cc (map_arguments): If ARGS is null, it's a
1043 self-mapping of parms.
1044 (finish_nested_requirement): Do not pass argified
1045 current_template_parms to normalization.
1046 (tsubst_nested_requirement): Don't assert no template parms.
1048 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1051 * coroutines.cc (transform_local_var_uses): Defer walking
1052 the DECL_INITIALs of BIND_EXPR vars until all the frame
1053 allocations have been made.
1055 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1058 * coroutines.cc (register_awaits): Update target
1059 expressions for awaitable and suspend handle
1062 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1065 * coroutines.cc (build_co_await): Account for variables
1066 with DECL_VALUE_EXPRs.
1067 (captures_temporary): Likewise.
1068 (register_awaits): Likewise.
1070 2020-04-29 Patrick Palka <ppalka@redhat.com>
1073 * pt.c (find_template_parameter_info::parm_list): New field.
1074 (keep_template_parm): Use the new field to build up the
1075 parameter list here instead of ...
1076 (find_template_parameters): ... here. Return ftpi.parm_list.
1078 2020-04-29 Jakub Jelinek <jakub@redhat.com>
1081 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
1082 base artificial FIELD_DECLs.
1083 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
1084 field_poverlapping_p FIELD_DECLs.
1086 2020-04-29 Patrick Palka <ppalka@redhat.com>
1089 * constraint.cc (satisfy_declaration_constraints): Use saved_t
1090 instead of t as the key to decl_satisfied_cache.
1093 * error.c (print_requires_expression_info): Print the dependent
1094 form of the parameter list with its template parameter mapping,
1095 rather than printing the substituted form.
1097 2020-04-28 Jason Merrill <jason@redhat.com>
1100 * decl.c (use_eh_spec_block): Check nothrow type after
1102 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
1103 DECL_MAYBE_DELETED fns here.
1104 * decl2.c (mark_used): Not here.
1105 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
1107 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
1110 * coroutines.cc (instantiate_coro_traits): Pass a reference to
1111 object type rather than a pointer type for 'this', for method
1113 (struct param_info): Add a field to hold that the parm is a lambda
1115 (morph_fn_to_coro): Check for lambda closure pointers in the
1116 args. Use a reference to *this when building the args list for the
1117 promise allocator lookup.
1119 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
1122 * coroutines.cc (coro_promise_type_found_p): Do not
1123 exclude non-classes here (this needs to be handled in the
1125 (morph_fn_to_coro): Allow for the case where the coroutine
1128 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
1131 * coroutines.cc (struct local_var_info): Add fields for static
1132 variables and those with DECL_VALUE_EXPR redirection.
1133 (transform_local_var_uses): Skip past typedefs and static vars
1134 and then account for redirected variables.
1135 (register_local_var_uses): Likewise.
1137 2020-04-27 Jason Merrill <jason@redhat.com>
1141 * decl.c (grokdeclarator): Move dependent attribute to decl.
1142 * decl2.c (splice_template_attributes): No longer static.
1144 2020-04-27 Patrick Palka <ppalka@redhat.com>
1147 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
1148 evaluating the target constructor of a delegating constructor.
1149 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
1150 INIT_EXPR is '*this'.
1152 2020-04-26 Marek Polacek <polacek@redhat.com>
1155 * call.c (struct conversion): Add copy_init_p.
1156 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
1157 if FLAGS demands LOOKUP_ONLYCONVERTING.
1158 (convert_like_real) <case ck_base>: If copy_init_p is set, or
1159 LOOKUP_ONLYCONVERTING into FLAGS.
1161 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
1164 * coroutines.cc (morph_fn_to_coro): Ensure that
1165 unnamed function params have a usable and distinct
1168 2020-04-24 Jason Merrill <jason@redhat.com>
1171 * decl.c (redeclaration_error_message): Reject defaulted comparison
1172 operator that has been previously declared.
1174 2020-04-25 Patrick Palka <ppalka@redhat.com>
1176 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
1177 concepts if the invalid identifier is 'requires'.
1179 2020-04-25 Jakub Jelinek <jakub@redhat.com>
1182 * semantics.c (finish_call_expr): When looking if all overloads
1183 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
1185 2020-04-24 Martin Liska <mliska@suse.cz>
1187 * coroutines.cc: Fix compilation error for release checking
1188 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
1190 2020-04-23 Patrick Palka <ppalka@redhat.com>
1192 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
1196 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
1197 friend declaration rather than into its CP_DECL_CONTEXT.
1199 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
1202 * coroutines.cc (await_statement_expander): Simplify cases.
1203 (struct susp_frame_data): Add fields for truth and/or if
1204 cases, rename one field.
1205 (analyze_expression_awaits): New.
1206 (expand_one_truth_if): New.
1207 (add_var_to_bind): New helper.
1208 (coro_build_add_if_not_cond_break): New helper.
1209 (await_statement_walker): Handle conditional expressions,
1210 handle expansion of truth-and/or-if cases.
1211 (bind_expr_find_in_subtree): New, checking-only.
1212 (coro_body_contains_bind_expr_p): New, checking-only.
1213 (morph_fn_to_coro): Ensure that we have a top level bind
1216 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
1218 PR translation/94698
1219 * class.c (check_field_decls): Change "define" to "declare" in
1220 -Weffc++ diagnostics.
1222 2020-04-22 Patrick Palka <ppalka@redhat.com>
1226 * constraint.cc (satisfy_declaration_constraints): If the inherited
1227 constructor points to an instantiation of a constructor template,
1228 remember and use its attached template arguments.
1230 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
1232 PR translation/94698
1233 * class.c (check_field_decls): Change "override" to "define" in
1234 -Weffc++ diagnostics.
1236 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
1239 * coroutines.cc (struct param_info): Add a field to note that
1240 the param is 'this'.
1241 (morph_fn_to_coro): Convert this to a reference before using it
1242 in the promise parameter preview.
1244 2020-04-22 Jason Merrill <jason@redhat.com>
1247 * pt.c (register_parameter_specializations): If the instantiation is
1248 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
1249 (tsubst_pack_expansion, tsubst_expr): Adjust.
1251 2020-04-22 Martin Sebor <msebor@redhat.com>
1252 Jason Merrill <jason@redhat.com>
1255 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
1256 zero initializers...
1257 * mangle.c (write_expression): ...and handle them here even for
1258 pointers to members by calling zero_init_expr_p.
1259 * cp-tree.h (zero_init_expr_p): Declare.
1260 * tree.c (zero_init_expr_p): Define.
1261 (type_initializer_zero_p): Remove.
1262 * pt.c (tparm_obj_values): New hash_map.
1263 (get_template_parm_object): Store to it.
1264 (tparm_object_argument): New.
1266 2020-04-22 Patrick Palka <ppalka@redhat.com>
1269 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
1270 as well as in tsubst_valid_expression_requirement.
1272 2020-04-21 Patrick Palka <ppalka@redhat.com>
1275 * constraint.cc (satisfy_declaration_constraints): Don't strip the
1276 inherited constructor if it already has template information.
1279 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
1280 is a conversion operator, visit its TREE_TYPE.
1282 2020-04-21 Nathan Sidwell <nathan@acm.org>
1284 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
1287 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
1290 * coroutines.cc (morph_fn_to_coro): Simplify return
1293 2020-04-17 Marek Polacek <polacek@redhat.com>
1296 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
1297 a BRACE_ENCLOSED_INITIALIZER_P.
1298 (is_nondependent_constant_expression): Don't check
1299 BRACE_ENCLOSED_INITIALIZER_P.
1300 (is_nondependent_static_init_expression): Likewise.
1302 2020-04-20 Patrick Palka <ppalka@redhat.com>
1305 * cp-tree.h (lss_policy::lss_nop): New enumerator.
1306 * pt.c (local_specialization_stack::local_specialization_stack): Handle
1308 (local_specialization_stack::~local_specialization_stack): Likewise.
1309 (tsubst_pack_expansion): Use a local_specialization_stack instead of
1310 manually saving and restoring local_specializations. Conditionally
1311 replace local_specializations sooner, before the handling of the
1312 unsubstituted_packs case.
1314 2020-04-20 Marek Polacek <polacek@redhat.com>
1316 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
1317 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
1318 before calling build_x_binary_op.
1320 2020-04-20 Marek Polacek <polacek@redhat.com>
1322 * coroutines.cc (captures_temporary): Don't assign the result of
1323 STRIP_NOPS to the same variable.
1325 2020-04-20 Nathan Sidwell <nathan@acm.org>
1327 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
1328 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
1329 (process_template_parm): tpl-tpl-parms are structural.
1330 (rewrite_template_parm): Propagate structuralness.
1332 PR c++/94454 - Expr pack expansion equality
1333 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
1334 [EXPR_PACK_EXPANSION]: Add.
1336 PR c++/94454 Template Argument Hashing
1337 * pt.c (iterative_hash_template_arg): Strip nodes as
1338 template_args_equal does.
1339 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
1340 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
1341 [node_class:default]: Refactor.
1343 2020-04-18 Patrick Palka <ppalka@redhat.com>
1346 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
1347 comparing_specializations if the parameters' contexts are identical.
1350 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
1351 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
1353 2020-04-17 Patrick Palka <ppalka@redhat.com>
1356 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
1357 the explicit initializer has parameter packs.
1360 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
1361 error, first try simulating an error instead.
1363 2020-04-17 Jakub Jelinek <jakub@redhat.com>
1366 * call.c (build_conditional_expr_1): Remove redundant assignment to
1369 2020-04-16 Patrick Palka <ppalka@redhat.com>
1372 * cvt.c (ocp_convert): If the result of scalar_constant_value is
1373 erroneous, ignore it and use the original expression.
1375 2020-04-16 Jakub Jelinek <jakub@redhat.com>
1378 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
1381 2020-04-15 Jakub Jelinek <jakub@redhat.com>
1384 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
1385 requires directive when not at file or namespace scope.
1387 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
1390 * coroutines.cc (build_actor_fn): Check that the target can
1391 support the resume tailcall before mandating it.
1393 2020-04-14 Patrick Palka <ppalka@redhat.com>
1396 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
1397 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
1398 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
1399 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
1403 * constexpr.c (replace_result_decl_data): New struct.
1404 (replace_result_decl_data_r): New function.
1405 (replace_result_decl): New function.
1406 (cxx_eval_call_expression): Use it.
1407 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
1408 to that of its initializer.
1410 2020-04-13 Marek Polacek <polacek@redhat.com>
1413 * name-lookup.c (check_local_shadow): Add an inform call.
1415 2020-04-13 Patrick Palka <ppalka@redhat.com>
1418 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
1419 dump_function_decl when printing a function template instantiation as a
1423 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
1425 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
1426 assuming the the next index belongs at the end of the new CONSTRUCTOR.
1427 (cxx_eval_store_expression): Revert PR c++/78572 fix.
1429 2020-04-13 Nathan Sidwell <nathan@acm.org>
1431 PR c++/94426 lambdas with internal linkage are different to no-linkage
1432 * decl2.c (determine_visibility): A lambda's visibility is
1433 affected by its extra scope.
1434 * pt.c (instantiate_decl): Determine var's visibility before
1435 instantiating its initializer.
1436 * tree.c (no_linkage_check): Revert code looking at visibility of
1437 lambda's extra scope.
1439 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
1442 * coroutines.cc (co_await_expander): Remove.
1443 (expand_one_await_expression): New.
1444 (process_one_statement): New.
1445 (await_statement_expander): New.
1446 (build_actor_fn): Revise to use per-statement expander.
1447 (struct susp_frame_data): Reorder and comment.
1448 (register_awaits): Factor code.
1449 (replace_statement_captures): New, factored from...
1450 (maybe_promote_captured_temps):.. here.
1451 (await_statement_walker): Revise to process per statement.
1452 (morph_fn_to_coro): Use revised susp_frame_data layout.
1454 2020-04-10 Marek Polacek <polacek@redhat.com>
1457 * method.c (constructible_expr): In C++20, try using parenthesized
1458 initialization of aggregates to determine the result of
1461 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
1463 * coroutines.cc (co_await_expander): Simplify.
1465 2020-04-09 Jason Merrill <jason@redhat.com>
1468 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
1469 ctx->object and ctx->global->values first.
1471 2020-04-09 Marek Polacek <polacek@redhat.com>
1474 * call.c (initialize_reference): If the reference binding failed, maybe
1475 try initializing from { }.
1476 * decl.c (grok_reference_init): For T& t(e), set
1477 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
1479 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
1480 Jun Ma <JunMa@linux.alibaba.com>
1482 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
1483 expression, if needed, to any call from which we promoted
1484 temporaries captured by reference.
1486 2020-04-08 Marek Polacek <polacek@redhat.com>
1488 PR c++/94507 - ICE-on-invalid with lambda template.
1489 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
1490 tsubst_function_decl returns error_mark_node.
1492 2020-04-08 Martin Liska <mliska@suse.cz>
1495 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
1496 (cxx_init_decl_processing): Mark replaceable all implicitly defined
1499 2020-04-08 Patrick Palka <ppalka@redhat.com>
1501 Core issues 1001 and 1322
1503 * pt.c (rebuild_function_or_method_type): Split function out from ...
1504 (tsubst_function_type): ... here.
1505 (maybe_rebuild_function_decl_type): New function.
1506 (tsubst_function_decl): Use it.
1508 2020-04-08 Jakub Jelinek <jakub@redhat.com>
1511 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
1512 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
1513 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
1514 BINFO_VIRTUAL_P, and so on.
1516 2020-04-08 Marek Polacek <polacek@redhat.com>
1518 PR c++/94478 - ICE with defaulted comparison operator
1519 * method.c (early_check_defaulted_comparison): Give an error when the
1522 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
1525 * paser.c (cp_parser_oacc_declare): Add check that variables
1526 are declared in the same scope as the directive.
1528 2020-04-07 Jason Merrill <jason@redhat.com>
1531 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
1534 * parser.c (cp_parser_placeholder_type_specifier): Use
1537 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
1539 * coroutines.cc (maybe_promote_captured_temps): Ensure that
1540 reference capture placeholder vars are properly declared.
1542 2020-04-07 Patrick Palka <ppalka@redhat.com>
1545 * tree.c (replace_placeholders): Look through all handled components,
1546 not just COMPONENT_REFs.
1547 * typeck2.c (process_init_constructor_array): Propagate
1548 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
1549 the array initializer.
1551 2020-04-07 Jakub Jelinek <jakub@redhat.com>
1554 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
1555 if cp_parser_omp_master succeeded.
1557 2020-04-06 Jason Merrill <jason@redhat.com>
1560 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
1562 2020-04-04 Marek Polacek <polacek@redhat.com>
1563 Jason Merrill <jason@redhat.com>
1565 PR c++/94155 - crash in gimplifier with paren init of aggregates.
1566 * init.c (build_vec_init): Fill in indexes.
1568 2020-04-04 Jason Merrill <jason@redhat.com>
1571 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
1573 2020-04-04 Patrick Palka <ppalka@redhat.com>
1577 * constexpr.c (struct constexpr_ctx): New field 'parent'.
1578 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
1579 flag from the original constructor to the reduced constructor.
1580 (lookup_placeholder): Prefer to return the outermost matching object
1581 by recursively calling lookup_placeholder on the 'parent' context,
1582 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
1583 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
1584 context via 'new_ctx.parent' when being expanded without an explicit
1585 target. Don't call replace_placeholders.
1586 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
1590 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
1591 support for VECTOR_TYPEs, and optimizations for the common case)
1593 (cxx_eval_store_expression): ... here. Rename local variable
1594 'changed_active_union_member_p' to 'activated_union_member_p'. Record
1595 the sequence of indexes into 'indexes' that yields the subobject we're
1596 assigning to. Record the integer offsets of the constructor indexes
1597 we're assigning through into 'index_pos_hints'. After evaluating the
1598 initializer of the store expression, recompute 'valp' using 'indexes'
1599 and using 'index_pos_hints' as hints.
1600 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
1601 to recompute the constructor_elt pointer we're assigning through after
1602 evaluating each initializer.
1604 2020-04-04 Jason Merrill <jason@redhat.com>
1607 * constraint.cc (tsubst_valid_expression_requirement): Call
1610 2020-04-04 Jason Merrill <jason@redhat.com>
1613 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
1614 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
1617 2020-04-04 Jakub Jelinek <jakub@redhat.com>
1620 * parser.c (cp_parser_omp_for_loop): Use
1621 protected_set_expr_location_if_unset.
1622 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
1625 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
1626 omp_parallel_combined_clauses.
1628 2020-04-03 Jason Merrill <jason@redhat.com>
1631 * pt.c (complex_pack_expansion_r): New.
1632 (complex_alias_template_p): Use it.
1634 2020-03-31 Jason Merrill <jason@redhat.com>
1637 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
1638 replace_placeholders.
1639 * typeck2.c (store_init_value): Fix arguments to
1640 fold_non_dependent_expr.
1642 2020-03-31 Jason Merrill <jason@redhat.com>
1644 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
1647 2020-03-30 Jason Merrill <jason@redhat.com>
1650 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
1651 (called_fns_equal): Check DECL_CONTEXT.
1653 2020-03-30 Jakub Jelinek <jakub@redhat.com>
1656 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
1657 STATEMENT_CODE_P code.
1659 2020-03-28 Patrick Palka <ppalka@redhat.com>
1662 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
1663 "requires {" when "requires requires {" was probably intended.
1666 * constraint.cc (tsubst_compound_requirement): Always suppress errors
1667 from type_deducible_p and expression_convertible_p, as they're not
1668 substitution errors.
1669 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
1670 that we diagnose INTEGER_CST expressions of non-bool type via the
1672 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
1673 * parser.c (cp_parser_requires_expression): Always parse the requirement
1674 body as if we're processing a template, by temporarily incrementing
1675 processing_template_decl. Afterwards, if we're not actually in a
1676 template context, perform semantic processing to diagnose any invalid
1677 types and expressions.
1678 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
1679 * semantics.c (finish_static_assert): Explain an assertion failure
1680 when the condition is a REQUIRES_EXPR like we do when it is a concept
1683 * constraint.cc (diagnose_compound_requirement): When diagnosing a
1684 compound requirement, maybe replay the satisfaction failure, subject to
1685 the current diagnosis depth.
1687 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
1688 as well as its range, because build_x_binary_op doesn't always do so.
1689 (current_constraint_diagnosis_depth): New.
1690 (concepts_diagnostics_max_depth_exceeded_p): New.
1691 (collect_operands_of_disjunction): New.
1692 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
1693 replay each branch of the disjunction, subject to the current diagnosis
1695 (diagnose_valid_expression): When diagnosing a satisfaction failure,
1696 maybe replay the substitution error, subject to the current diagnosis
1698 (diagnose_valid_type): Likewise.
1699 (diagnose_nested_requiremnet): Likewise.
1700 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
1701 current_constraint_diagnosis_depth when diagnosing.
1702 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
1703 current_constraint_diagnosis_depth when diagnosing.
1704 (diagnosing_failed_constraint::replay_errors_p): New static member
1706 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
1707 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
1708 the limit was exceeded.
1709 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
1711 2020-03-27 Nathan Sidwell <nathan@acm.org>
1714 * name-lookup.c (do_pushdecl): Look through cleanp levels.
1716 2020-03-27 Martin Sebor <msebor@redhat.com>
1721 * cp-tree.h (most_specialized_partial_spec): Declare.
1722 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
1724 (specialization_of): New function.
1725 (cp_parser_check_class_key): Move code...
1726 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
1727 -Wredundant-tags on first-time declarations in other declarators.
1728 Correct handling of template specializations.
1729 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
1730 when -Wredundant-tags is enabled. Use primary template or partial
1731 specialization as the guide for uses of implicit instantiations.
1732 * pt.c (most_specialized_partial_spec): Declare extern.
1734 2020-03-27 Nathan Sidwell <nathan@acm.org>
1737 * name-lookup.c (push_namespace): Triage ambiguous lookups that
1740 2020-03-27 Jakub Jelinek <jakub@redhat.com>
1743 * call.c (set_flags_from_callee): Don't update
1744 cp_function_chain->can_throw or current_function_returns_abnormally
1745 if cp_unevaluated_operand.
1748 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
1749 operand and creating a new COMPOUND_EXPR if anything changed.
1751 2020-03-26 Marek Polacek <polacek@redhat.com>
1753 PR c++/94336 - template keyword accepted before destructor names.
1754 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
1755 is followed by a destructor name.
1757 2020-03-27 Patrick Palka <ppalka@redhat.com>
1759 * decl.c (compute_array_index_type_loc): Remove redundant
1760 type_dependent_expression_p check that is subsumed by
1761 value_dependent_expression_p.
1762 * decl2.c (is_late_template_attribute): Likewise.
1763 * pt.c (uses_template_parms): Likewise.
1764 (dependent_template_arg_p): Likewise.
1766 2020-03-26 Marek Polacek <polacek@redhat.com>
1769 PR c++/94057 - template keyword in a typename-specifier.
1770 * parser.c (check_template_keyword_in_nested_name_spec): New.
1771 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
1772 'template'. Call check_template_keyword_in_nested_name_spec.
1773 (cp_parser_simple_type_specifier): Assume that a <
1774 following a qualified-id in a typename-specifier begins
1775 a template argument list.
1777 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
1779 * coroutines.cc (coro_init_identifiers): Initialize an identifier
1780 for the cororoutine handle 'address' method name.
1781 (struct coro_aw_data): Add fields to cover the continuations.
1782 (co_await_expander): Determine the kind of await_suspend in use.
1783 If we have the case that returns a continuation handle, then save
1784 this and make the target for 'scope exit without cleanup' be the
1785 continuation resume label.
1786 (expand_co_awaits): Remove.
1787 (struct suspend_point_info): Remove fields that kept the returned
1788 await_suspend handle type.
1789 (transform_await_expr): Remove code tracking continuation handles.
1790 (build_actor_fn): Add the continuation handle as an actor-function
1791 scope var. Build the symmetric transfer continuation point. Call
1792 the tree walk for co_await expansion directly, rather than via a
1793 trivial shim function.
1794 (register_await_info): Remove fields tracking continuation handles.
1795 (get_await_suspend_return_type): Remove.
1796 (register_awaits): Remove code tracking continuation handles.
1797 (morph_fn_to_coro): Remove code tracking continuation handles.
1799 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
1801 * coroutines.cc (co_await_expander): If we are expanding the
1802 initial await expression, set a boolean flag to show that we
1803 have now reached the initial await_resume() method call.
1804 (expand_co_awaits): Handle the 'initial await resume called' flag.
1805 (build_actor_fn): Insert the initial await expression into the
1806 start of the user-authored function-body. Handle the 'initial await
1807 resume called' flag.
1808 (morph_fn_to_coro): Initialise the 'initial await resume called'
1809 flag. Modify the unhandled exception catch clause to recognise
1810 exceptions that occur before the initial await_resume() and re-
1813 2020-03-26 Jakub Jelinek <jakub@redhat.com>
1816 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
1817 true for all TEMPLATE_DECLs.
1820 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
1822 2020-03-25 Patrick Palka <ppalka@redhat.com>
1825 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
1826 current condition chain when the if-statement has a non-empty
1829 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
1832 * coroutines.cc (captures_temporary): Fix a missing dereference.
1834 2020-03-24 Marek Polacek <polacek@redhat.com>
1836 PR c++/94190 - wrong no post-decrement operator error in template.
1837 * call.c (convert_like_real): Use convert_from_reference on the result.
1839 2020-03-24 Jason Merrill <jason@redhat.com>
1842 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
1844 (tsubst_nested_requirement): Likewise.
1845 (get_constraint_error_location): Allow missing context.
1846 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
1847 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
1849 2020-03-24 Jason Merrill <jason@redhat.com>
1851 * pt.c (any_template_parm_r): Look into the type of a non-type
1854 2020-03-24 Jason Merrill <jason@redhat.com>
1856 * cp-tree.h (cp_expr): When constructing from an expr and a
1857 location, call protected_set_expr_location.
1859 2020-03-23 Patrick Palka <ppalka@redhat.com>
1862 * except.c (maybe_noexcept_warning): Add TODO.
1863 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
1865 2020-03-23 nathans <nathan@acm.org>
1868 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
1871 2020-03-21 Patrick Palka <ppalka@redhat.com>
1874 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
1875 handle unions without an initializer.
1876 (cxx_eval_component_reference): Emit a different diagnostic when the
1877 constructor element corresponding to a union member is NULL.
1878 (cxx_eval_bare_aggregate): When constructing a union, always set the
1879 active union member before evaluating the initializer. Relax assertion
1880 that verifies the index of the constructor element we're initializing
1881 hasn't been changed.
1882 (cxx_eval_store_expression): Diagnose changing the active union member
1883 while the union is in the process of being initialized. After setting
1884 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
1886 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
1887 CONSTRUCTOR returned by lookup_placeholder.
1889 2020-03-20 Patrick Palka <ppalka@redhat.com>
1891 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
1892 the "[with ]" bits to here from ...
1893 (pp_cxx_atomic_constraint): ... here.
1894 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
1895 * error.c (rebuild_concept_check): Delete.
1896 (print_concept_check_info): Print the dependent form of the constraint and the
1897 preferably substituted parameter mapping alongside it.
1899 2020-03-19 Jason Merrill <jason@redhat.com>
1902 * cp-gimplify.c (simple_empty_class_p): Look through
1903 SIMPLE_TARGET_EXPR_P.
1904 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
1905 [RETURN_EXPR]: Avoid producing 'return *retval;'.
1906 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
1907 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
1910 2020-03-19 Jakub Jelinek <jakub@redhat.com>
1913 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
1914 on outer_automatic_var_p decls.
1915 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
1916 capture proxy decls.
1918 2020-03-18 Nathan Sidwell <nathan@acm.org>
1920 PR c++/94147 - mangling of lambdas assigned to globals
1921 * parser.c (cp_parser_init_declarator): Namespace-scope variables
1922 provide a lambda scope.
1923 * tree.c (no_linkage_check): Lambdas with a variable for extra
1924 scope have a linkage from the variable.
1926 2020-03-18 Jakub Jelinek <jakub@redhat.com>
1928 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
1929 strictly_subsumes): Fix up duplicated word issue in a comment.
1930 * coroutines.cc (build_init_or_final_await, captures_temporary):
1932 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
1933 * pt.c (append_type_to_template_for_access_check): Likewise.
1936 * decl.c (grokfndecl): Restore old diagnostics about deduction
1937 guide declared in different scope if in_namespace is NULL_TREE.
1939 2020-03-17 Jakub Jelinek <jakub@redhat.com>
1942 * parser.c (cp_parser_enum_specifier): Use temp_override for
1943 parser->colon_corrects_to_scope_p, replace goto out with return.
1944 If scoped enum or enum with underlying type is not followed by
1945 { or ;, call cp_parser_commit_to_tentative_parse before calling
1946 cp_parser_error and make sure to return error_mark_node instead of
1947 NULL_TREE. Formatting fixes.
1949 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
1952 * method.c (assignable_expr): Use cp_unevaluated.
1953 (is_xible_helper): Push a non-deferred access check for
1954 the stub objects created by assignable_expr and constructible_expr.
1956 2020-03-17 Jakub Jelinek <jakub@redhat.com>
1958 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
1959 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
1961 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
1962 cp_parser_placeholder_type_specifier,
1963 cp_parser_constraint_requires_parens): Likewise.
1964 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
1966 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
1968 * coroutines.cc (co_await_expander): Fix indentation.
1970 2020-03-14 Jason Merrill <jason@redhat.com>
1973 * pt.c (process_partial_specialization): Error rather than crash on
1974 extra pack expansion.
1976 2020-03-14 Jason Merrill <jason@redhat.com>
1979 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
1980 DECL_ORIGINAL_TYPE of a typedef.
1982 2020-03-14 Jason Merrill <jason@redhat.com>
1985 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
1986 substituting DECL_ARGUMENTS.
1988 2020-03-14 Jakub Jelinek <jakub@redhat.com>
1990 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
1991 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
1994 2020-03-13 Patrick Palka <ppalka@redhat.com>
1997 * call.c (build_over_call): Use a warning_sentinel to disable
1998 warn_deprecated_decl before calling build_addr_func.
2000 2020-03-12 Jakub Jelinek <jakub@redhat.com>
2003 * decl.c (reshape_init_array_1): Don't unshare constructor if there
2004 aren't any trailing zero elts, otherwise only unshare the first
2007 2020-03-11 Jason Merrill <jason@redhat.com>
2010 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
2013 2020-03-11 Marek Polacek <polacek@redhat.com>
2014 Jason Merrill <jason@redhat.com>
2016 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
2017 * constexpr.c (cref_has_const_field): New function.
2018 (modifying_const_object_p): Consider a COMPONENT_REF
2019 const only if any of its fields are const.
2020 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
2021 as readonly after its initialization has been done.
2023 2020-03-10 Marek Polacek <polacek@redhat.com>
2025 PR c++/94124 - wrong conversion error with non-viable overload.
2026 * decl.c (reshape_init_array_1): Unshare a constructor if we
2027 stripped trailing zero-initializers.
2029 2020-03-10 Jason Merrill <jason@redhat.com>
2032 * pt.c (maybe_instantiate_noexcept): Always update clones.
2034 2020-03-10 Jason Merrill <jason@redhat.com>
2037 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
2039 2020-03-10 Jason Merrill <jason@redhat.com>
2045 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
2046 66139: Don't split_nonconstant_init. Remove pre_p parameter.
2048 2020-03-09 Marek Polacek <polacek@redhat.com>
2050 PR c++/92031 - bogus taking address of rvalue error.
2051 PR c++/91465 - ICE with template codes in check_narrowing.
2052 PR c++/93870 - wrong error when converting template non-type arg.
2053 PR c++/94068 - ICE with template codes in check_narrowing.
2054 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
2055 in a template when not ck_identity and we're dealing with a class.
2056 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
2057 in a template if we need a temporary.
2058 * decl.c (compute_array_index_type_loc): Remove
2059 instantiate_non_dependent_expr_sfinae call. Call
2060 fold_non_dependent_expr instead of maybe_constant_value.
2061 (build_explicit_specifier): Don't instantiate or create a sentinel
2062 before converting the expression.
2063 * except.c (build_noexcept_spec): Likewise.
2064 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
2065 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
2066 build_converted_constant_expr returned.
2067 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
2068 of maybe_constant_value.
2070 2020-03-09 Jakub Jelinek <jakub@redhat.com>
2074 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
2076 * constexpr.c (cxx_eval_constant_expression): Do not handle
2077 RROTATE_EXPR and LROTATE_EXPR.
2079 2020-03-09 Marek Polacek <polacek@redhat.com>
2081 PR c++/94050 - ABI issue with alignas on armv7hl.
2082 * class.c (layout_class_type): Don't replace a class's
2083 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
2085 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
2087 * coroutines.cc (build_actor_fn): Factor out code inserting the
2088 default return_void call to...
2089 (morph_fn_to_coro): ...here, also hoist local var declarations.
2091 2020-03-08 Patrick Palka <ppalka@redhat.com>
2094 * call.c (convert_like_real): Check complain before emitting an error
2095 about binding a bit-field to a reference.
2097 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
2098 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
2101 2020-03-06 Nathan Sidwell <nathan@acm.org>
2104 * mangle.c (find_substitution): Don't call same_type_p on template
2105 args that cannot match.
2107 2020-03-04 Martin Sebor <msebor@redhat.com>
2110 * tree.c (type_initializer_zero_p): Fail for structs initialized
2113 2020-03-04 Jason Merrill <jason@redhat.com>
2116 * init.c (perform_member_init): Don't do aggregate initialization of
2118 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
2119 initialization of empty field.
2121 2020-03-04 Martin Liska <mliska@suse.cz>
2123 * method.c: Wrap array in ctor with braces in order
2124 to silent clang warnings.
2126 2020-03-03 Jason Merrill <jason@redhat.com>
2127 Marek Polacek <polacek@redhat.com>
2129 PR c++/90505 - mismatch in template argument deduction.
2130 * pt.c (tsubst): Don't reduce the template level of template
2131 parameters when tf_partial.
2133 2020-03-03 Jakub Jelinek <jakub@redhat.com>
2136 * constexpr.c (cxx_eval_constant_expression)
2137 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
2138 *non_constant_p is true.
2140 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
2142 * coroutines.cc (captures_temporary): Strip component_ref
2145 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
2147 * coroutines.cc (finish_co_await_expr): Build co_await_expr
2148 with unknown_type_node.
2149 (finish_co_yield_expr): Ditto.
2150 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
2151 with unknown type as dependent.
2153 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
2155 * coroutines.cc (struct local_var_info): Adjust to remove the
2156 reference to the captured var, and just to note that this is a
2157 lambda capture proxy.
2158 (transform_local_var_uses): Handle lambda captures specially.
2159 (struct param_frame_data): Add a visited set.
2160 (register_param_uses): Also check for param uses in lambda
2162 (struct local_vars_frame_data): Remove captures list.
2163 (register_local_var_uses): Handle lambda capture proxies by
2164 noting and bypassing them.
2165 (morph_fn_to_coro): Update to remove lifetime extension of
2166 lambda capture-by-copy vars.
2168 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
2170 * coroutines.cc (build_co_await): Do not build frame
2171 awaitable proxy vars when the co_await expression is
2172 a function parameter or local var.
2173 (co_await_expander): Do not initialise a frame var with
2175 (transform_await_expr): Only substitute the awaitable
2176 frame var if it's needed.
2177 (register_awaits): Do not make frame copies for param
2178 or local vars that are awaitables.
2180 2020-02-28 Jason Merrill <jason@redhat.com>
2182 Implement P2092R0, Disambiguating Nested-Requirements
2183 * parser.c (cp_parser_requirement_parameter_list): Pass
2184 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
2186 * call.c (build_user_type_conversion_1): Don't look at the second
2187 conversion of a non-viable candidate.
2189 2020-02-28 Jakub Jelinek <jakub@redhat.com>
2191 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
2192 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
2193 functions in unevaluated contexts.
2195 2020-02-27 Nathan Sidwell <nathan@acm.org>
2198 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
2200 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
2201 * typeck.c (comptypes): Assert we don't get any argument packs.
2203 * class.c (adjust_clone_args): Correct arg-checking assert.
2204 * typeck.c (comptypes): Assert not nulls.
2206 2020-02-26 Marek Polacek <polacek@redhat.com>
2208 PR c++/93789 - ICE with invalid array bounds.
2209 * decl.c (compute_array_index_type_loc): Don't use the folded
2210 size when folding cleared TREE_CONSTANT.
2212 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
2214 * class.c (classtype_has_non_deleted_copy_ctor): New.
2215 * coroutines.cc (struct param_info): Keep track of params
2216 that are references, and cache the original type and whether
2217 the DTOR is trivial.
2218 (build_actor_fn): Handle param copies always, and adjust the
2219 handling for references.
2220 (register_param_uses): Only handle uses here.
2221 (classtype_has_non_deleted_copy_ctor): New.
2222 (morph_fn_to_coro): Adjust param copy handling to match n4849
2223 by reordering ahead of the promise CTOR and always making a
2224 frame copy, even if the param is unused in the coroutine body.
2225 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
2227 2020-02-26 Patrick Palka <ppalka@redhat.com>
2229 * constraint.cc (finish_constraint_binary_op): Set expr's location range
2230 to the range of its operands.
2231 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
2232 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
2233 instead of the corresponding template arguments ARGS and adjust body
2235 (diagnose_requires_expr): Likewise.
2236 (diagnose_atomic_constraint): Likewise. When printing an atomic
2237 constraint expression, print the instantiated parameter mapping
2239 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
2240 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
2241 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
2243 2020-02-26 Marek Polacek <polacek@redhat.com>
2245 PR c++/93676 - value-init crash in template.
2246 * init.c (build_new_1): Don't call build_vec_init in a template.
2248 2020-02-26 Marek Polacek <polacek@redhat.com>
2250 PR c++/93862 - ICE with static_cast when converting from int[].
2251 * call.c (reference_compatible_p): No longer static.
2252 * cp-tree.h (reference_compatible_p): Declare.
2253 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
2254 of reference_related_p.
2256 2020-02-26 Marek Polacek <polacek@redhat.com>
2258 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
2259 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
2262 2020-02-24 Martin Sebor <msebor@redhat.com>
2265 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
2266 in shared C/C++ code in headers.
2267 Remove a duplicate hunk of code.
2269 2020-02-24 Marek Polacek <polacek@redhat.com>
2271 PR c++/93869 - ICE with -Wmismatched-tags.
2272 * parser.c (cp_parser_check_class_key): Check class_key earlier.
2274 2020-02-24 Marek Polacek <polacek@redhat.com>
2276 PR c++/93712 - ICE with ill-formed array list-initialization.
2277 * call.c (next_conversion): Return NULL for ck_aggr.
2278 (build_aggr_conv): Set u.expr instead of u.next.
2279 (build_array_conv): Likewise.
2280 (build_complex_conv): Likewise.
2281 (conv_get_original_expr): Handle ck_aggr.
2283 2020-02-24 Jakub Jelinek <jakub@redhat.com>
2285 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
2286 * call.c (build_over_call): Don't evaluate immediate functions in
2287 unevaluated operands.
2289 2020-02-24 Jason Merrill <jason@redhat.com>
2291 P0780R2: Resolve lambda init-capture pack grammar.
2292 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
2295 2020-02-22 Marek Polacek <polacek@redhat.com>
2298 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
2300 2020-02-21 Martin Sebor <msebor@redhat.com>
2302 PR gcov-profile/93753
2303 * class.c (check_flexarrays): Tighten up a test for potential members
2304 of anonymous structs or unions.
2306 2020-02-20 Martin Sebor <msebor@redhat.com>
2309 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
2311 2020-02-20 Martin Liska <mliska@suse.cz>
2313 PR translation/93841
2314 * config/or1k/or1k.opt: Remove superfluous word.
2315 * doc/invoke.texi: Likewise.
2317 2020-02-20 Martin Liska <mliska@suse.cz>
2319 PR translation/93838
2320 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
2322 2020-02-19 Marek Polacek <polacek@redhat.com>
2324 PR c++/93169 - wrong-code with a non-constexpr constructor.
2325 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
2326 on constant CONSTRUCTORs.
2328 2020-02-15 Marek Polacek <polacek@redhat.com>
2330 PR c++/93710 - poor diagnostic for array initializer.
2331 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
2334 2020-02-15 Jason Merrill <jason@redhat.com>
2337 * pt.c (any_template_parm_r): Look into lambda body.
2340 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
2342 2020-02-14 Jakub Jelinek <jakub@redhat.com>
2345 * class.c (enum_min_precision): Change prec type from int to int &.
2348 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
2349 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
2350 (fallback_dfloat32_type, fallback_dfloat64_type,
2351 fallback_dfloat128_type): Define.
2352 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
2354 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
2355 is disabled for compatibility.
2357 2020-02-13 Jason Merrill <jason@redhat.com>
2360 * name-lookup.c (matching_fn_p): A function does not match a
2365 * tree.c (decl_linkage): Always lk_none for locals.
2367 2020-02-12 Jason Merrill <jason@redhat.com>
2371 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
2372 * pt.c (find_parameter_packs_r): Not here.
2374 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
2376 * coroutines.cc (build_actor_fn): Implement deallocation function
2377 selection per n4849, dcl.fct.def.coroutine bullet 12.
2378 (morph_fn_to_coro): Implement allocation function selection per
2379 n4849, dcl.fct.def.coroutine bullets 9 and 10.
2381 2020-02-12 Marek Polacek <polacek@redhat.com>
2383 PR c++/93684 - ICE-on-invalid with broken attribute.
2384 * parser.c (cp_parser_std_attribute): Peek a token first before
2387 2020-02-11 Jason Merrill <jason@redhat.com>
2390 * class.c (add_implicitly_declared_members): Use do_friend.
2391 * method.c (implicitly_declare_fn): Fix friend handling.
2392 (decl_remember_implicit_trigger_p): New.
2393 (synthesize_method): Use it.
2394 * decl2.c (mark_used): Use it.
2396 2020-02-11 Jason Merrill <jason@redhat.com>
2400 * constexpr.c (maybe_constant_value): Correct earlier change.
2401 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
2402 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
2404 2020-02-12 Patrick Palka <ppalka@redhat.com>
2408 * type-utils.h (find_type_usage): Refactor to take a tree * and to
2409 return a tree *, and update documentation accordingly.
2410 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
2411 decltype(auto) node.
2412 (make_constrained_decltype_auto): No need to explicitly set
2413 AUTO_IS_DECLTYPE anymore.
2414 (splice_late_return_type): Use find_type_usage to find and
2415 replace a possibly nested auto node instead of using is_auto.
2416 Check test for is_auto into an assert when deciding whether
2417 to late_return_type.
2418 (type_uses_auto): Adjust the call to find_type_usage.
2419 * parser.c (cp_parser_decltype): No need to explicitly set
2420 AUTO_IS_DECLTYPE anymore.
2422 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
2423 (dump_simple_decl): Handle standard concept definitions as well as
2424 variable concept definitions.
2426 2020-02-10 Jakub Jelinek <jakub@redhat.com>
2429 * error.c (dump_decl_name): Fix up last argument to strncmp.
2431 2020-02-10 Jason Merrill <jason@redhat.com>
2434 * tree.c (array_of_unknown_bound_p): New.
2435 * init.c (perform_member_init): Do nothing for flexible arrays.
2437 2020-02-09 Jakub Jelinek <jakub@redhat.com>
2440 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
2441 ARRAY_TYPE, use the element type. Punt if objtype after that is not
2444 2020-02-08 Jason Merrill <jason@redhat.com>
2447 * expr.c (fold_for_warn): Call maybe_constant_value.
2448 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
2449 (maybe_constant_value): Add uid_sensitive parm.
2450 (get_fundef_copy): Don't copy if it's true.
2451 (cxx_eval_call_expression): Don't instantiate if it's true.
2452 (cxx_eval_outermost_constant_expr): Likewise.
2455 * constexpr.c (maybe_constant_value): Don't unshare if the cached
2456 value is the same as the argument.
2458 * typeck.c (maybe_warn_about_returning_address_of_local): Add
2461 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
2464 2020-02-08 Jakub Jelinek <jakub@redhat.com>
2467 * constexpr.c (find_array_ctor_elt): If last element has no index,
2468 for flag_checking verify all elts have no index. If i is within the
2469 elts, return it directly, if it is right after the last elt, append
2470 if NULL index, otherwise force indexes on all elts.
2471 (cxx_eval_store_expression): Allow cep->index to be NULL.
2473 2020-02-07 Marek Polacek <polacek@redhat.com>
2475 PR c++/92947 - Paren init of aggregates in unevaluated context.
2476 * call.c (build_new_method_call_1): Don't check
2477 cp_unevaluated_operand. Check the return value of digest_init.
2479 2020-02-06 Jason Merrill <jason@redhat.com>
2482 * tree.c (cp_walk_subtrees): Walk into type template arguments.
2483 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
2484 instead of TYPE_ALIAS_P.
2485 * pt.c (push_template_decl_real): Likewise.
2486 (find_parameter_packs_r): Likewise. Remove dead code.
2487 * error.c (find_typenames_r): Remove dead code.
2489 2020-02-06 Jason Merrill <jason@redhat.com>
2492 * parser.c (cp_parser_constraint_primary_expression): Do the main
2493 parse non-tentatively.
2495 2020-02-06 Marek Polacek <polacek@redhat.com>
2497 PR c++/93597 - ICE with lambda in operator function.
2498 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
2500 2020-02-05 Jason Merrill <jason@redhat.com>
2503 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
2504 handling of TREE_CHAIN for empty pack.
2506 2020-02-05 Jakub Jelinek <jakub@redhat.com>
2509 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
2510 prior to passing it to c_build_vec_convert.
2512 2020-02-05 Marek Polacek <polacek@redhat.com>
2514 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
2515 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
2518 2020-02-05 Jason Merrill <jason@redhat.com>
2521 * decl.c (grokdeclarator): Reject field of current class type even
2524 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
2526 * coroutines.cc (maybe_promote_captured_temps): Increase the index
2527 number for temporary variables' name.
2529 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
2531 * coroutines.cc (build_co_await): Call convert_from_reference
2532 to wrap co_await_expr with indirect_ref which avoid
2533 reference/non-reference type confusion.
2535 (co_await_expander): Sink to call_expr if await_resume
2536 is wrapped by indirect_ref.
2538 2020-02-04 Jason Merrill <jason@redhat.com>
2541 * constraint.cc (satisfy_declaration_constraints): Check return
2542 value of push_tinst_level.
2545 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
2546 elements instead of value-initializing them.
2549 * init.c (perform_member_init): Simplify.
2550 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
2552 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
2554 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
2556 * coroutines.cc (find_promise_type): Delete unused forward
2558 (struct coroutine_info): Add a bool for no promise type error.
2559 (coro_promise_type_found_p): Only emit the error for a missing
2560 promise once in each affected coroutine.
2562 2020-02-03 Jason Merrill <jason@redhat.com>
2565 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
2566 defer loading the value of a reference.
2568 2020-02-03 Jason Merrill <jason@redhat.com>
2571 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
2573 [COMPONENT_REF]: A member function reference doesn't use the object
2576 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
2579 * coroutines.cc (struct coroutine_info): Add a bool flag to note
2580 that we emitted an error for a bad function return type.
2581 (get_coroutine_info): Tolerate an unset info table in case of
2583 (find_coro_traits_template_decl): In case of error or if we didn't
2584 find a type template, note we emitted the error and suppress
2586 (find_coro_handle_template_decl): Likewise.
2587 (instantiate_coro_traits): Only check for error_mark_node in the
2588 return from lookup_qualified_name.
2589 (coro_promise_type_found_p): Reorder initialization so that we check
2590 for the traits and their usability before allocation of the info
2591 table. Check for a suitable return type and emit a diagnostic for
2592 here instead of relying on the lookup machinery. This allows the
2593 error to have a better location, and means we can suppress multiple
2595 (coro_function_valid_p): Re-check for a valid promise (and thus the
2596 traits) before proceeding. Tolerate missing info as a fatal error.
2598 2020-02-03 Jason Merrill <jason@redhat.com>
2601 * cp-gimplify.c (predeclare_vla): New.
2602 (cp_genericize_r) [NOP_EXPR]: Call it.
2604 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
2606 * coroutines.cc (transform_await_wrapper): Set actor funcion as
2607 new context of label_decl.
2608 (build_actor_fn): Fill new field of await_xform_data.
2610 2020-02-02 Marek Polacek <polacek@redhat.com>
2612 PR c++/93530 - ICE on invalid alignas in a template.
2613 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
2616 2020-01-31 Jason Merrill <jason@redhat.com>
2619 * semantics.c (process_outer_var_ref): Capture VLAs even in
2620 unevaluated context.
2623 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
2624 non-aggregate elements.
2625 (reshape_init_array): Add first_initializer_p parm.
2626 (reshape_init_r): Change first_initializer_p from bool to tree.
2627 (reshape_init): Pass init to it.
2630 * parser.c (cp_parser_initializer_list): Suppress location wrappers
2633 2020-01-29 Jason Merrill <jason@redhat.com>
2636 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
2637 the expression was dependent before substitution.
2639 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
2641 * coroutines.cc (act_des_fn): New.
2642 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
2643 Access promise via actor function's frame pointer argument.
2644 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
2646 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
2648 * coroutines.cc (co_await_expander): Handle type conversion case.
2650 2020-01-29 Jason Merrill <jason@redhat.com>
2655 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
2656 a trailing return type.
2657 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
2660 2020-01-29 Marek Polacek <polacek@redhat.com>
2662 PR c++/91754 - Fix template arguments comparison with class NTTP.
2663 * pt.c (class_nttp_const_wrapper_p): New.
2664 (template_args_equal): See through class_nttp_const_wrapper_p
2667 2020-01-29 Marek Polacek <polacek@redhat.com>
2669 PR c++/92948 - Fix class NTTP with template arguments.
2670 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
2671 converting a value-dependent expression to a class type.
2672 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
2673 as the result of the tsubst_copy call.
2675 2020-01-29 Jakub Jelinek <jakub@redhat.com>
2678 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
2679 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
2681 2020-01-28 Jason Merrill <jason@redhat.com>
2684 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
2688 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
2691 * call.c (build_user_type_conversion_1): Allow a template conversion
2692 returning an rvalue reference to bind directly to an lvalue.
2695 * decl.c (grokdeclarator): Propagate eh spec from typedef.
2697 2020-01-28 Martin Liska <mliska@suse.cz>
2700 * pt.c (redeclare_class_template): Group couple of
2701 errors and inform messages with auto_diagnostic_group.
2703 2020-01-28 Martin Liska <mliska@suse.cz>
2706 * pt.c (redeclare_class_template): Use inform
2707 for the second location.
2709 2020-01-27 Jason Merrill <jason@redhat.com>
2712 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
2714 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
2717 * coroutines.cc (morph_fn_to_coro): Check the ramp return
2718 value when it is constructed from the 'get return object'.
2720 2020-01-27 Nathan Sidwell <nathan@acm.org>
2723 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
2725 2020-01-26 Jason Merrill <jason@redhat.com>
2728 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
2729 temporarily enable -Wsystem-headers. Change second warning to
2733 * semantics.c (finish_call_expr): Don't call
2734 instantiate_non_dependent_expr before warn_for_memset.
2736 2020-01-25 Marek Polacek <polacek@redhat.com>
2738 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
2739 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
2740 dynamic_cast diagnostic.
2742 2020-01-24 Jason Merrill <jason@redhat.com>
2744 PR c++/93400 - ICE with constrained friend.
2745 * constraint.cc (maybe_substitute_reqs_for): New.
2746 * decl.c (function_requirements_equivalent_p): Call it.
2747 * pt.c (tsubst_friend_function): Only substitute
2748 TEMPLATE_PARMS_CONSTRAINTS.
2749 (tsubst_template_parms): Copy constraints.
2751 2020-01-24 Jason Merrill <jason@redhat.com>
2753 PR c++/93279 - ICE with lambda in member operator.
2754 * name-lookup.c (maybe_save_operator_binding): Don't remember
2755 class-scope bindings.
2757 2020-01-24 Jason Merrill <jason@redhat.com>
2759 PR c++/93377 - ICE with member alias in constraint.
2760 * pt.c (any_template_parm_r): Look at template arguments for all
2761 aliases, not only alias templates.
2763 2020-01-24 Marek Polacek <polacek@redhat.com>
2765 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
2766 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
2768 2020-01-24 Jason Merrill <jason@redhat.com>
2770 PR c++/92852 - ICE with generic lambda and reference var.
2771 * constexpr.c (maybe_constant_value): Likewise.
2773 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
2776 * parser.c (cp_parser_nested_name_specifier_opt): Properly
2777 diagnose concept-ids.
2779 2020-01-23 Jason Merrill <jason@redhat.com>
2781 PR c++/93331 - ICE with __builtin_strchr.
2782 * constexpr.c (cxx_eval_builtin_function_call): Use the original
2783 argument if we didn't manage to extract a STRING_CST.
2785 PR c++/93345 - ICE with defaulted dtor and template.
2787 * decl.c (cxx_maybe_build_cleanup): Don't try to set
2788 throwing_cleanup in a template.
2790 2020-01-22 Marek Polacek <polacek@redhat.com>
2792 PR c++/92907 - noexcept does not consider "const" in member functions.
2793 * g++.dg/cpp0x/noexcept56.C: New test.
2795 2020-01-22 Marek Polacek <polacek@redhat.com>
2797 PR c++/93324 - ICE with -Wall on constexpr if.
2798 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
2800 2020-01-22 Patrick Palka <ppalka@redhat.com>
2802 * constraint.cc (get_mapped_args): Avoid using auto_vec
2803 as a vector element. Release the vectors inside the lists
2805 * parser.c (cp_literal_operator_id): Free the buffer.
2807 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
2809 * coroutines.cc (finish_co_await_expr): Add error check on return
2810 value of build_co_await.
2811 (finish_co_yield_expr,): Ditto.
2813 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
2815 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
2816 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
2817 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
2819 2020-01-21 Jason Merrill <jason@redhat.com>
2821 PR c++/60855 - ICE with sizeof VLA capture.
2822 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
2824 PR c++/90732 - ICE with VLA capture and generic lambda.
2825 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
2827 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
2828 Bin Cheng <bin.cheng@linux.alibaba.com>
2830 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
2831 from complete_type_or_else.
2832 (register_param_uses): Likewise.
2833 (build_co_await): Do not try to use complete_type_or_else for void
2834 types, otherwise for incomplete types, check for NULL return from
2835 complete_type_or_else.
2837 2020-01-21 Jason Merrill <jason@redhat.com>
2839 PR c++/91476 - anon-namespace reference temp clash between TUs.
2840 * decl2.c (copy_linkage): Factor out of get_guard.
2841 * call.c (make_temporary_var_for_ref_to_temp): Use it.
2842 * decl.c (cp_finish_decomp): Use it.
2843 (cp_finish_decl): determine_visibility sooner.
2845 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
2847 * coroutines.cc (finish_co_await_expr): Set return value flag.
2848 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
2850 2020-01-19 Jason Merrill <jason@redhat.com>
2852 PR c++/33799 - destroy return value, take 2.
2853 * cp-tree.h (current_retval_sentinel): New macro.
2854 (struct language_function): Add throwing_cleanup bitfield.
2855 * decl.c (cxx_maybe_build_cleanup): Set it.
2856 * except.c (maybe_set_retval_sentinel)
2857 (maybe_splice_retval_cleanup): New functions.
2858 * parser.c (cp_parser_compound_statement): Call
2859 maybe_splice_retval_cleanup.
2860 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
2862 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
2864 2020-01-18 Jakub Jelinek <jakub@redhat.com>
2866 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
2867 but non-NO_DOLLAR_IN_LABEL case build.
2869 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
2871 * Make-lang.in: Add coroutines.o.
2872 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
2873 (DECL_COROUTINE_P): New.
2874 * lex.c (init_reswords): Enable keywords when the coroutine flag
2876 * operators.def (co_await): New operator.
2877 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
2878 (op_error): Likewise.
2879 (build_new_op_1): Likewise.
2880 (build_new_function_call): Validate coroutine builtin arguments.
2881 * constexpr.c (potential_constant_expression_1): Handle
2882 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
2883 * coroutines.cc: New file.
2884 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
2885 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
2886 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
2887 * cp-tree.h (coro_validate_builtin_call): New.
2888 * decl.c (emit_coro_helper): New.
2889 (finish_function): Handle the case when a function is found to
2890 be a coroutine, perform the outlining and emit the outlined
2891 functions. Set a bit to signal that this is a coroutine component.
2892 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
2893 (cp_parser_unary_expression): Handle co_await.
2894 (cp_parser_assignment_expression): Handle co_yield.
2895 (cp_parser_statement): Handle RID_CO_RETURN.
2896 (cp_parser_jump_statement): Handle co_return.
2897 (cp_parser_operator): Handle co_await operator.
2898 (cp_parser_yield_expression): New.
2899 (cp_parser_required_error): Handle RT_CO_YIELD.
2900 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
2901 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
2903 * tree.c (cp_walk_subtrees): Likewise.
2905 2020-01-17 Jason Merrill <jason@redhat.com>
2907 PR c++/92531 - ICE with noexcept(lambda).
2908 * pt.c (uses_template_parms): Don't try to enumerate all the
2911 2020-01-17 Jakub Jelinek <jakub@redhat.com>
2914 * parser.c (cp_parser_template_name): Look up deprecated attribute
2915 in DECL_TEMPLATE_RESULT or its type's attributes.
2917 2020-01-16 Jason Merrill <jason@redhat.com>
2919 PR c++/93286 - ICE with __is_constructible and variadic template.
2920 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
2921 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
2923 PR c++/93280 - ICE with aggregate assignment and DMI.
2924 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
2925 * typeck2.c (digest_nsdmi_init): Not here.
2927 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
2930 * cp-tree.h (is_constrained_auto): New.
2931 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
2932 handle concept-check expressions; take a cp_decl_specifier_seq*
2934 (cp_parser_condition): Update call.
2935 (cp_parser_simple_declaration): Likewise.
2936 (cp_parser_placeholder_type_specifier): Correctly handle
2937 concept-check expressions.
2939 2020-01-15 Jason Merrill <jason@redhat.com>
2942 PR c++/33799 - destroy return value if local cleanup throws.
2943 * cp-tree.h (current_retval_sentinel): New macro.
2944 * decl.c (start_preparsed_function): Set up cleanup for retval.
2945 * typeck.c (check_return_expr): Set current_retval_sentinel.
2947 PR c++/93257 - consteval void function.
2948 * constexpr.c (verify_constant): Allow void_node.
2950 PR c++/92871 - bad code with xvalue and GNU ?: extension.
2951 * call.c (prevent_lifetime_extension): New.
2952 (build_conditional_expr_1): Use it.
2954 2020-01-14 Nathan Sidwell <nathan@acm.org>
2957 * pt.c (retrieve_specialization): Use get_template_info, not open
2961 * pt.c (retrieve_specialization): Get the TI from the decl or the
2962 classtype as appropriate.
2964 2020-01-14 David Malcolm <dmalcolm@redhat.com>
2966 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
2967 New static constant.
2968 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
2969 (struct named_label_hash::empty_zero_p): Likewise.
2970 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
2972 2020-01-14 Jason Merrill <jason@redhat.com>
2974 PR c++/92590 - wrong handling of inherited default ctor.
2975 * class.c (add_method): A constrained inherited ctor doesn't hide an
2976 implicit derived ctor.
2978 PR c++/92552 - ICE with inherited constrained default ctor.
2979 * pt.c (instantiate_class_template_1): Copy
2980 TYPE_HAS_USER_CONSTRUCTOR.
2981 PR c++/91930 - ICE with constrained inherited default ctor.
2982 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
2983 for inherited constructor.
2984 PR c++/92594 - ICE with inherited trivial default ctor.
2985 * method.c (trivial_fn_p): Treat an inherited default constructor
2986 like a normal default constructor.
2988 PR c++/92594 - ICE with inherited trivial default ctor.
2989 * method.c (trivial_fn_p): Treat an inherited default constructor
2990 like a normal default constructor.
2992 PR c++/92009 - ICE with punning of typeid.
2993 * rtti.c (get_tinfo_desc): Call xref_basetypes.
2994 * constexpr.c (cxx_fold_indirect_ref): Don't strip
2997 2020-01-13 Jason Merrill <jason@redhat.com>
2999 PR c++/92746 - ICE with noexcept of function concept check.
3000 * except.c (check_noexcept_r): Handle concept-check.
3002 PR c++/92582 - ICE with member template as requirement.
3003 * pt.c (struct find_template_parameter_info): Add ctx_parms.
3004 (any_template_parm_r): Handle TEMPLATE_DECL.
3005 (find_template_parameters): Take parms instead of their depth.
3006 * constraint.cc (build_parameter_mapping): Pass them.
3008 PR c++/33799 - destroy return value if local cleanup throws.
3009 * cp-tree.h (current_retval_sentinel): New macro.
3010 * decl.c (start_preparsed_function): Set up cleanup for retval.
3011 * typeck.c (check_return_expr): Set current_retval_sentinel.
3013 PR c++/93238 - short right-shift with enum.
3014 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
3016 2020-01-10 Jason Merrill <jason@redhat.com>
3018 * typeck.c (cp_build_binary_op): Restore short_shift code.
3020 PR c++/93143 - incorrect tree sharing with constexpr.
3021 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
3022 CONSTRUCTORs are already unshared.
3024 PR c++/93173 - incorrect tree sharing.
3026 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
3027 copy_if_shared after cp_genericize_tree.
3028 * typeck2.c (split_nonconstant_init): Don't unshare here.
3030 2020-01-08 Jason Merrill <jason@redhat.com>
3032 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
3033 TARGET_EXPR_DIRECT_INIT_P.
3034 * constexpr.c (cxx_eval_constant_expression): Likewise.
3036 2020-01-08 Jason Merrill <jason@redhat.com>
3038 PR c++/91369 - constexpr destructor and member initializer.
3039 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
3040 when not preevaluating.
3042 2020-01-08 Jason Merrill <jason@redhat.com>
3044 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
3047 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3049 * init.c (build_new): Add location_t parameter and use it throughout.
3050 (build_raw_new_expr): Likewise.
3051 * parser.c (cp_parser_new_expression): Pass the combined_loc.
3052 * pt.c (tsubst_copy_and_build): Adjust call.
3053 * cp-tree.h: Update declarations.
3055 2020-01-07 Jason Merrill <jason@redhat.com>
3057 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
3058 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
3059 explicit class visibility for a template.
3061 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
3063 * mangle.c (mangle_type_attribute_p): New function, split out from...
3064 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
3065 that contain a space.
3067 2020-01-07 Jakub Jelinek <jakub@redhat.com>
3070 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
3071 member, initialize it to zero in ctor.
3072 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
3073 a heap object. Don't cache calls to functions which allocate some
3074 heap objects and don't deallocate them or deallocate some heap
3075 objects they didn't allocate.
3077 2020-01-06 Jason Merrill <jason@redhat.com>
3079 PR c++/92552 - ICE with inherited constrained default ctor.
3080 * pt.c (instantiate_class_template_1): Copy
3081 TYPE_HAS_USER_CONSTRUCTOR.
3082 * class.c (one_inherited_ctor): Don't set it here.
3084 2020-01-06 Andrew Sutton <asutton@lock3software.com>
3086 PR c++/92739 - parsing requires clause with attributes.
3087 * parser.c (cp_parser_constraint_requires_parens): Exclude
3088 attributes as postfix expressions.
3090 2020-01-05 Jakub Jelinek <jakub@redhat.com>
3093 * parser.c (cp_parser_check_class_key): Disable access checks for the
3095 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
3096 !warn_redundant_tags.
3098 2010-01-05 Jakub Jelinek <jakub@redhat.com>
3101 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
3102 TARGET_EXPR if it has been gimplified already.
3104 2020-01-03 Jason Merrill <jason@redhat.com>
3106 PR c++/93033 - incorrect tree node sharing with array init.
3107 * typeck2.c (split_nonconstant_init): Unshare non-decl.
3108 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
3110 2020-01-02 Jason Merrill <jason@redhat.com>
3112 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
3115 2020-01-02 Jakub Jelinek <jakub@redhat.com>
3118 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
3119 has not been found, rather than error_mark_node.
3121 2020-01-01 Jakub Jelinek <jakub@redhat.com>
3123 Update copyright years.
3125 Copyright (C) 2020 Free Software Foundation, Inc.
3127 Copying and distribution of this file, with or without modification,
3128 are permitted in any medium without royalty provided the copyright
3129 notice and this notice are preserved.