1 2020-02-26 Marek Polacek <polacek@redhat.com>
3 PR c++/93789 - ICE with invalid array bounds.
4 * decl.c (compute_array_index_type_loc): Don't use the folded
5 size when folding cleared TREE_CONSTANT.
7 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
9 * class.c (classtype_has_non_deleted_copy_ctor): New.
10 * coroutines.cc (struct param_info): Keep track of params
11 that are references, and cache the original type and whether
13 (build_actor_fn): Handle param copies always, and adjust the
14 handling for references.
15 (register_param_uses): Only handle uses here.
16 (classtype_has_non_deleted_copy_ctor): New.
17 (morph_fn_to_coro): Adjust param copy handling to match n4849
18 by reordering ahead of the promise CTOR and always making a
19 frame copy, even if the param is unused in the coroutine body.
20 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
22 2020-02-26 Patrick Palka <ppalka@redhat.com>
24 * constraint.cc (finish_constraint_binary_op): Set expr's location range
25 to the range of its operands.
26 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
27 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
28 instead of the corresponding template arguments ARGS and adjust body
30 (diagnose_requires_expr): Likewise.
31 (diagnose_atomic_constraint): Likewise. When printing an atomic
32 constraint expression, print the instantiated parameter mapping
34 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
35 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
36 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
38 2020-02-26 Marek Polacek <polacek@redhat.com>
40 PR c++/93676 - value-init crash in template.
41 * init.c (build_new_1): Don't call build_vec_init in a template.
43 2020-02-26 Marek Polacek <polacek@redhat.com>
45 PR c++/93862 - ICE with static_cast when converting from int[].
46 * call.c (reference_compatible_p): No longer static.
47 * cp-tree.h (reference_compatible_p): Declare.
48 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
49 of reference_related_p.
51 2020-02-26 Marek Polacek <polacek@redhat.com>
53 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
54 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
57 2020-02-24 Martin Sebor <msebor@redhat.com>
60 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
61 in shared C/C++ code in headers.
62 Remove a duplicate hunk of code.
64 2020-02-24 Marek Polacek <polacek@redhat.com>
66 PR c++/93869 - ICE with -Wmismatched-tags.
67 * parser.c (cp_parser_check_class_key): Check class_key earlier.
69 2020-02-24 Marek Polacek <polacek@redhat.com>
71 PR c++/93712 - ICE with ill-formed array list-initialization.
72 * call.c (next_conversion): Return NULL for ck_aggr.
73 (build_aggr_conv): Set u.expr instead of u.next.
74 (build_array_conv): Likewise.
75 (build_complex_conv): Likewise.
76 (conv_get_original_expr): Handle ck_aggr.
78 2020-02-24 Jakub Jelinek <jakub@redhat.com>
80 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
81 * call.c (build_over_call): Don't evaluate immediate functions in
84 2020-02-24 Jason Merrill <jason@redhat.com>
86 P0780R2: Resolve lambda init-capture pack grammar.
87 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
90 2020-02-22 Marek Polacek <polacek@redhat.com>
93 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
95 2020-02-21 Martin Sebor <msebor@redhat.com>
98 * class.c (check_flexarrays): Tighten up a test for potential members
99 of anonymous structs or unions.
101 2020-02-20 Martin Sebor <msebor@redhat.com>
104 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
106 2020-02-20 Martin Liska <mliska@suse.cz>
109 * config/or1k/or1k.opt: Remove superfluous word.
110 * doc/invoke.texi: Likewise.
112 2020-02-20 Martin Liska <mliska@suse.cz>
115 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
117 2020-02-19 Marek Polacek <polacek@redhat.com>
119 PR c++/93169 - wrong-code with a non-constexpr constructor.
120 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
121 on constant CONSTRUCTORs.
123 2020-02-15 Marek Polacek <polacek@redhat.com>
125 PR c++/93710 - poor diagnostic for array initializer.
126 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
129 2020-02-15 Jason Merrill <jason@redhat.com>
132 * pt.c (any_template_parm_r): Look into lambda body.
135 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
137 2020-02-14 Jakub Jelinek <jakub@redhat.com>
140 * class.c (enum_min_precision): Change prec type from int to int &.
143 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
144 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
145 (fallback_dfloat32_type, fallback_dfloat64_type,
146 fallback_dfloat128_type): Define.
147 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
149 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
150 is disabled for compatibility.
152 2020-02-13 Jason Merrill <jason@redhat.com>
155 * name-lookup.c (matching_fn_p): A function does not match a
160 * tree.c (decl_linkage): Always lk_none for locals.
162 2020-02-12 Jason Merrill <jason@redhat.com>
166 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
167 * pt.c (find_parameter_packs_r): Not here.
169 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
171 * coroutines.cc (build_actor_fn): Implement deallocation function
172 selection per n4849, dcl.fct.def.coroutine bullet 12.
173 (morph_fn_to_coro): Implement allocation function selection per
174 n4849, dcl.fct.def.coroutine bullets 9 and 10.
176 2020-02-12 Marek Polacek <polacek@redhat.com>
178 PR c++/93684 - ICE-on-invalid with broken attribute.
179 * parser.c (cp_parser_std_attribute): Peek a token first before
182 2020-02-11 Jason Merrill <jason@redhat.com>
185 * class.c (add_implicitly_declared_members): Use do_friend.
186 * method.c (implicitly_declare_fn): Fix friend handling.
187 (decl_remember_implicit_trigger_p): New.
188 (synthesize_method): Use it.
189 * decl2.c (mark_used): Use it.
191 2020-02-11 Jason Merrill <jason@redhat.com>
195 * constexpr.c (maybe_constant_value): Correct earlier change.
196 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
197 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
199 2020-02-12 Patrick Palka <ppalka@redhat.com>
203 * type-utils.h (find_type_usage): Refactor to take a tree * and to
204 return a tree *, and update documentation accordingly.
205 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
207 (make_constrained_decltype_auto): No need to explicitly set
208 AUTO_IS_DECLTYPE anymore.
209 (splice_late_return_type): Use find_type_usage to find and
210 replace a possibly nested auto node instead of using is_auto.
211 Check test for is_auto into an assert when deciding whether
213 (type_uses_auto): Adjust the call to find_type_usage.
214 * parser.c (cp_parser_decltype): No need to explicitly set
215 AUTO_IS_DECLTYPE anymore.
217 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
218 (dump_simple_decl): Handle standard concept definitions as well as
219 variable concept definitions.
221 2020-02-10 Jakub Jelinek <jakub@redhat.com>
224 * error.c (dump_decl_name): Fix up last argument to strncmp.
226 2020-02-10 Jason Merrill <jason@redhat.com>
229 * tree.c (array_of_unknown_bound_p): New.
230 * init.c (perform_member_init): Do nothing for flexible arrays.
232 2020-02-09 Jakub Jelinek <jakub@redhat.com>
235 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
236 ARRAY_TYPE, use the element type. Punt if objtype after that is not
239 2020-02-08 Jason Merrill <jason@redhat.com>
242 * expr.c (fold_for_warn): Call maybe_constant_value.
243 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
244 (maybe_constant_value): Add uid_sensitive parm.
245 (get_fundef_copy): Don't copy if it's true.
246 (cxx_eval_call_expression): Don't instantiate if it's true.
247 (cxx_eval_outermost_constant_expr): Likewise.
250 * constexpr.c (maybe_constant_value): Don't unshare if the cached
251 value is the same as the argument.
253 * typeck.c (maybe_warn_about_returning_address_of_local): Add
256 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
259 2020-02-08 Jakub Jelinek <jakub@redhat.com>
262 * constexpr.c (find_array_ctor_elt): If last element has no index,
263 for flag_checking verify all elts have no index. If i is within the
264 elts, return it directly, if it is right after the last elt, append
265 if NULL index, otherwise force indexes on all elts.
266 (cxx_eval_store_expression): Allow cep->index to be NULL.
268 2020-02-07 Marek Polacek <polacek@redhat.com>
270 PR c++/92947 - Paren init of aggregates in unevaluated context.
271 * call.c (build_new_method_call_1): Don't check
272 cp_unevaluated_operand. Check the return value of digest_init.
274 2020-02-06 Jason Merrill <jason@redhat.com>
277 * tree.c (cp_walk_subtrees): Walk into type template arguments.
278 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
279 instead of TYPE_ALIAS_P.
280 * pt.c (push_template_decl_real): Likewise.
281 (find_parameter_packs_r): Likewise. Remove dead code.
282 * error.c (find_typenames_r): Remove dead code.
284 2020-02-06 Jason Merrill <jason@redhat.com>
287 * parser.c (cp_parser_constraint_primary_expression): Do the main
288 parse non-tentatively.
290 2020-02-06 Marek Polacek <polacek@redhat.com>
292 PR c++/93597 - ICE with lambda in operator function.
293 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
295 2020-02-05 Jason Merrill <jason@redhat.com>
298 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
299 handling of TREE_CHAIN for empty pack.
301 2020-02-05 Jakub Jelinek <jakub@redhat.com>
304 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
305 prior to passing it to c_build_vec_convert.
307 2020-02-05 Marek Polacek <polacek@redhat.com>
309 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
310 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
313 2020-02-05 Jason Merrill <jason@redhat.com>
316 * decl.c (grokdeclarator): Reject field of current class type even
319 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
321 * coroutines.cc (maybe_promote_captured_temps): Increase the index
322 number for temporary variables' name.
324 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
326 * coroutines.cc (build_co_await): Call convert_from_reference
327 to wrap co_await_expr with indirect_ref which avoid
328 reference/non-reference type confusion.
330 (co_await_expander): Sink to call_expr if await_resume
331 is wrapped by indirect_ref.
333 2020-02-04 Jason Merrill <jason@redhat.com>
336 * constraint.cc (satisfy_declaration_constraints): Check return
337 value of push_tinst_level.
340 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
341 elements instead of value-initializing them.
344 * init.c (perform_member_init): Simplify.
345 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
347 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
349 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
351 * coroutines.cc (find_promise_type): Delete unused forward
353 (struct coroutine_info): Add a bool for no promise type error.
354 (coro_promise_type_found_p): Only emit the error for a missing
355 promise once in each affected coroutine.
357 2020-02-03 Jason Merrill <jason@redhat.com>
360 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
361 defer loading the value of a reference.
363 2020-02-03 Jason Merrill <jason@redhat.com>
366 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
368 [COMPONENT_REF]: A member function reference doesn't use the object
371 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
374 * coroutines.cc (struct coroutine_info): Add a bool flag to note
375 that we emitted an error for a bad function return type.
376 (get_coroutine_info): Tolerate an unset info table in case of
378 (find_coro_traits_template_decl): In case of error or if we didn't
379 find a type template, note we emitted the error and suppress
381 (find_coro_handle_template_decl): Likewise.
382 (instantiate_coro_traits): Only check for error_mark_node in the
383 return from lookup_qualified_name.
384 (coro_promise_type_found_p): Reorder initialization so that we check
385 for the traits and their usability before allocation of the info
386 table. Check for a suitable return type and emit a diagnostic for
387 here instead of relying on the lookup machinery. This allows the
388 error to have a better location, and means we can suppress multiple
390 (coro_function_valid_p): Re-check for a valid promise (and thus the
391 traits) before proceeding. Tolerate missing info as a fatal error.
393 2020-02-03 Jason Merrill <jason@redhat.com>
396 * cp-gimplify.c (predeclare_vla): New.
397 (cp_genericize_r) [NOP_EXPR]: Call it.
399 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
401 * coroutines.cc (transform_await_wrapper): Set actor funcion as
402 new context of label_decl.
403 (build_actor_fn): Fill new field of await_xform_data.
405 2020-02-02 Marek Polacek <polacek@redhat.com>
407 PR c++/93530 - ICE on invalid alignas in a template.
408 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
411 2020-01-31 Jason Merrill <jason@redhat.com>
414 * semantics.c (process_outer_var_ref): Capture VLAs even in
418 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
419 non-aggregate elements.
420 (reshape_init_array): Add first_initializer_p parm.
421 (reshape_init_r): Change first_initializer_p from bool to tree.
422 (reshape_init): Pass init to it.
425 * parser.c (cp_parser_initializer_list): Suppress location wrappers
428 2020-01-29 Jason Merrill <jason@redhat.com>
431 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
432 the expression was dependent before substitution.
434 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
436 * coroutines.cc (act_des_fn): New.
437 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
438 Access promise via actor function's frame pointer argument.
439 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
441 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
443 * coroutines.cc (co_await_expander): Handle type conversion case.
445 2020-01-29 Jason Merrill <jason@redhat.com>
450 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
451 a trailing return type.
452 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
455 2020-01-29 Marek Polacek <polacek@redhat.com>
457 PR c++/91754 - Fix template arguments comparison with class NTTP.
458 * pt.c (class_nttp_const_wrapper_p): New.
459 (template_args_equal): See through class_nttp_const_wrapper_p
462 2020-01-29 Marek Polacek <polacek@redhat.com>
464 PR c++/92948 - Fix class NTTP with template arguments.
465 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
466 converting a value-dependent expression to a class type.
467 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
468 as the result of the tsubst_copy call.
470 2020-01-29 Jakub Jelinek <jakub@redhat.com>
473 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
474 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
476 2020-01-28 Jason Merrill <jason@redhat.com>
479 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
483 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
486 * call.c (build_user_type_conversion_1): Allow a template conversion
487 returning an rvalue reference to bind directly to an lvalue.
490 * decl.c (grokdeclarator): Propagate eh spec from typedef.
492 2020-01-28 Martin Liska <mliska@suse.cz>
495 * pt.c (redeclare_class_template): Group couple of
496 errors and inform messages with auto_diagnostic_group.
498 2020-01-28 Martin Liska <mliska@suse.cz>
501 * pt.c (redeclare_class_template): Use inform
502 for the second location.
504 2020-01-27 Jason Merrill <jason@redhat.com>
507 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
509 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
512 * coroutines.cc (morph_fn_to_coro): Check the ramp return
513 value when it is constructed from the 'get return object'.
515 2020-01-27 Nathan Sidwell <nathan@acm.org>
518 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
520 2020-01-26 Jason Merrill <jason@redhat.com>
523 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
524 temporarily enable -Wsystem-headers. Change second warning to
528 * semantics.c (finish_call_expr): Don't call
529 instantiate_non_dependent_expr before warn_for_memset.
531 2020-01-25 Marek Polacek <polacek@redhat.com>
533 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
534 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
535 dynamic_cast diagnostic.
537 2020-01-24 Jason Merrill <jason@redhat.com>
539 PR c++/93400 - ICE with constrained friend.
540 * constraint.cc (maybe_substitute_reqs_for): New.
541 * decl.c (function_requirements_equivalent_p): Call it.
542 * pt.c (tsubst_friend_function): Only substitute
543 TEMPLATE_PARMS_CONSTRAINTS.
544 (tsubst_template_parms): Copy constraints.
546 2020-01-24 Jason Merrill <jason@redhat.com>
548 PR c++/93279 - ICE with lambda in member operator.
549 * name-lookup.c (maybe_save_operator_binding): Don't remember
550 class-scope bindings.
552 2020-01-24 Jason Merrill <jason@redhat.com>
554 PR c++/93377 - ICE with member alias in constraint.
555 * pt.c (any_template_parm_r): Look at template arguments for all
556 aliases, not only alias templates.
558 2020-01-24 Marek Polacek <polacek@redhat.com>
560 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
561 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
563 2020-01-24 Jason Merrill <jason@redhat.com>
565 PR c++/92852 - ICE with generic lambda and reference var.
566 * constexpr.c (maybe_constant_value): Likewise.
568 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
571 * parser.c (cp_parser_nested_name_specifier_opt): Properly
572 diagnose concept-ids.
574 2020-01-23 Jason Merrill <jason@redhat.com>
576 PR c++/93331 - ICE with __builtin_strchr.
577 * constexpr.c (cxx_eval_builtin_function_call): Use the original
578 argument if we didn't manage to extract a STRING_CST.
580 PR c++/93345 - ICE with defaulted dtor and template.
582 * decl.c (cxx_maybe_build_cleanup): Don't try to set
583 throwing_cleanup in a template.
585 2020-01-22 Marek Polacek <polacek@redhat.com>
587 PR c++/92907 - noexcept does not consider "const" in member functions.
588 * g++.dg/cpp0x/noexcept56.C: New test.
590 2020-01-22 Marek Polacek <polacek@redhat.com>
592 PR c++/93324 - ICE with -Wall on constexpr if.
593 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
595 2020-01-22 Patrick Palka <ppalka@redhat.com>
597 * constraint.cc (get_mapped_args): Avoid using auto_vec
598 as a vector element. Release the vectors inside the lists
600 * parser.c (cp_literal_operator_id): Free the buffer.
602 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
604 * coroutines.cc (finish_co_await_expr): Add error check on return
605 value of build_co_await.
606 (finish_co_yield_expr,): Ditto.
608 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
610 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
611 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
612 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
614 2020-01-21 Jason Merrill <jason@redhat.com>
616 PR c++/60855 - ICE with sizeof VLA capture.
617 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
619 PR c++/90732 - ICE with VLA capture and generic lambda.
620 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
622 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
623 Bin Cheng <bin.cheng@linux.alibaba.com>
625 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
626 from complete_type_or_else.
627 (register_param_uses): Likewise.
628 (build_co_await): Do not try to use complete_type_or_else for void
629 types, otherwise for incomplete types, check for NULL return from
630 complete_type_or_else.
632 2020-01-21 Jason Merrill <jason@redhat.com>
634 PR c++/91476 - anon-namespace reference temp clash between TUs.
635 * decl2.c (copy_linkage): Factor out of get_guard.
636 * call.c (make_temporary_var_for_ref_to_temp): Use it.
637 * decl.c (cp_finish_decomp): Use it.
638 (cp_finish_decl): determine_visibility sooner.
640 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
642 * coroutines.cc (finish_co_await_expr): Set return value flag.
643 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
645 2020-01-19 Jason Merrill <jason@redhat.com>
647 PR c++/33799 - destroy return value, take 2.
648 * cp-tree.h (current_retval_sentinel): New macro.
649 (struct language_function): Add throwing_cleanup bitfield.
650 * decl.c (cxx_maybe_build_cleanup): Set it.
651 * except.c (maybe_set_retval_sentinel)
652 (maybe_splice_retval_cleanup): New functions.
653 * parser.c (cp_parser_compound_statement): Call
654 maybe_splice_retval_cleanup.
655 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
657 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
659 2020-01-18 Jakub Jelinek <jakub@redhat.com>
661 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
662 but non-NO_DOLLAR_IN_LABEL case build.
664 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
666 * Make-lang.in: Add coroutines.o.
667 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
668 (DECL_COROUTINE_P): New.
669 * lex.c (init_reswords): Enable keywords when the coroutine flag
671 * operators.def (co_await): New operator.
672 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
673 (op_error): Likewise.
674 (build_new_op_1): Likewise.
675 (build_new_function_call): Validate coroutine builtin arguments.
676 * constexpr.c (potential_constant_expression_1): Handle
677 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
678 * coroutines.cc: New file.
679 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
680 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
681 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
682 * cp-tree.h (coro_validate_builtin_call): New.
683 * decl.c (emit_coro_helper): New.
684 (finish_function): Handle the case when a function is found to
685 be a coroutine, perform the outlining and emit the outlined
686 functions. Set a bit to signal that this is a coroutine component.
687 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
688 (cp_parser_unary_expression): Handle co_await.
689 (cp_parser_assignment_expression): Handle co_yield.
690 (cp_parser_statement): Handle RID_CO_RETURN.
691 (cp_parser_jump_statement): Handle co_return.
692 (cp_parser_operator): Handle co_await operator.
693 (cp_parser_yield_expression): New.
694 (cp_parser_required_error): Handle RT_CO_YIELD.
695 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
696 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
698 * tree.c (cp_walk_subtrees): Likewise.
700 2020-01-17 Jason Merrill <jason@redhat.com>
702 PR c++/92531 - ICE with noexcept(lambda).
703 * pt.c (uses_template_parms): Don't try to enumerate all the
706 2020-01-17 Jakub Jelinek <jakub@redhat.com>
709 * parser.c (cp_parser_template_name): Look up deprecated attribute
710 in DECL_TEMPLATE_RESULT or its type's attributes.
712 2020-01-16 Jason Merrill <jason@redhat.com>
714 PR c++/93286 - ICE with __is_constructible and variadic template.
715 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
716 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
718 PR c++/93280 - ICE with aggregate assignment and DMI.
719 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
720 * typeck2.c (digest_nsdmi_init): Not here.
722 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
725 * cp-tree.h (is_constrained_auto): New.
726 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
727 handle concept-check expressions; take a cp_decl_specifier_seq*
729 (cp_parser_condition): Update call.
730 (cp_parser_simple_declaration): Likewise.
731 (cp_parser_placeholder_type_specifier): Correctly handle
732 concept-check expressions.
734 2020-01-15 Jason Merrill <jason@redhat.com>
737 PR c++/33799 - destroy return value if local cleanup throws.
738 * cp-tree.h (current_retval_sentinel): New macro.
739 * decl.c (start_preparsed_function): Set up cleanup for retval.
740 * typeck.c (check_return_expr): Set current_retval_sentinel.
742 PR c++/93257 - consteval void function.
743 * constexpr.c (verify_constant): Allow void_node.
745 PR c++/92871 - bad code with xvalue and GNU ?: extension.
746 * call.c (prevent_lifetime_extension): New.
747 (build_conditional_expr_1): Use it.
749 2020-01-14 Nathan Sidwell <nathan@acm.org>
752 * pt.c (retrieve_specialization): Use get_template_info, not open
756 * pt.c (retrieve_specialization): Get the TI from the decl or the
757 classtype as appropriate.
759 2020-01-14 David Malcolm <dmalcolm@redhat.com>
761 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
763 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
764 (struct named_label_hash::empty_zero_p): Likewise.
765 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
767 2020-01-14 Jason Merrill <jason@redhat.com>
769 PR c++/92590 - wrong handling of inherited default ctor.
770 * class.c (add_method): A constrained inherited ctor doesn't hide an
771 implicit derived ctor.
773 PR c++/92552 - ICE with inherited constrained default ctor.
774 * pt.c (instantiate_class_template_1): Copy
775 TYPE_HAS_USER_CONSTRUCTOR.
776 PR c++/91930 - ICE with constrained inherited default ctor.
777 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
778 for inherited constructor.
779 PR c++/92594 - ICE with inherited trivial default ctor.
780 * method.c (trivial_fn_p): Treat an inherited default constructor
781 like a normal default constructor.
783 PR c++/92594 - ICE with inherited trivial default ctor.
784 * method.c (trivial_fn_p): Treat an inherited default constructor
785 like a normal default constructor.
787 PR c++/92009 - ICE with punning of typeid.
788 * rtti.c (get_tinfo_desc): Call xref_basetypes.
789 * constexpr.c (cxx_fold_indirect_ref): Don't strip
792 2020-01-13 Jason Merrill <jason@redhat.com>
794 PR c++/92746 - ICE with noexcept of function concept check.
795 * except.c (check_noexcept_r): Handle concept-check.
797 PR c++/92582 - ICE with member template as requirement.
798 * pt.c (struct find_template_parameter_info): Add ctx_parms.
799 (any_template_parm_r): Handle TEMPLATE_DECL.
800 (find_template_parameters): Take parms instead of their depth.
801 * constraint.cc (build_parameter_mapping): Pass them.
803 PR c++/33799 - destroy return value if local cleanup throws.
804 * cp-tree.h (current_retval_sentinel): New macro.
805 * decl.c (start_preparsed_function): Set up cleanup for retval.
806 * typeck.c (check_return_expr): Set current_retval_sentinel.
808 PR c++/93238 - short right-shift with enum.
809 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
811 2020-01-10 Jason Merrill <jason@redhat.com>
813 * typeck.c (cp_build_binary_op): Restore short_shift code.
815 PR c++/93143 - incorrect tree sharing with constexpr.
816 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
817 CONSTRUCTORs are already unshared.
819 PR c++/93173 - incorrect tree sharing.
821 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
822 copy_if_shared after cp_genericize_tree.
823 * typeck2.c (split_nonconstant_init): Don't unshare here.
825 2020-01-08 Jason Merrill <jason@redhat.com>
827 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
828 TARGET_EXPR_DIRECT_INIT_P.
829 * constexpr.c (cxx_eval_constant_expression): Likewise.
831 2020-01-08 Jason Merrill <jason@redhat.com>
833 PR c++/91369 - constexpr destructor and member initializer.
834 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
835 when not preevaluating.
837 2020-01-08 Jason Merrill <jason@redhat.com>
839 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
842 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
844 * init.c (build_new): Add location_t parameter and use it throughout.
845 (build_raw_new_expr): Likewise.
846 * parser.c (cp_parser_new_expression): Pass the combined_loc.
847 * pt.c (tsubst_copy_and_build): Adjust call.
848 * cp-tree.h: Update declarations.
850 2020-01-07 Jason Merrill <jason@redhat.com>
852 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
853 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
854 explicit class visibility for a template.
856 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
858 * mangle.c (mangle_type_attribute_p): New function, split out from...
859 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
860 that contain a space.
862 2020-01-07 Jakub Jelinek <jakub@redhat.com>
865 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
866 member, initialize it to zero in ctor.
867 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
868 a heap object. Don't cache calls to functions which allocate some
869 heap objects and don't deallocate them or deallocate some heap
870 objects they didn't allocate.
872 2020-01-06 Jason Merrill <jason@redhat.com>
874 PR c++/92552 - ICE with inherited constrained default ctor.
875 * pt.c (instantiate_class_template_1): Copy
876 TYPE_HAS_USER_CONSTRUCTOR.
877 * class.c (one_inherited_ctor): Don't set it here.
879 2020-01-06 Andrew Sutton <asutton@lock3software.com>
881 PR c++/92739 - parsing requires clause with attributes.
882 * parser.c (cp_parser_constraint_requires_parens): Exclude
883 attributes as postfix expressions.
885 2020-01-05 Jakub Jelinek <jakub@redhat.com>
888 * parser.c (cp_parser_check_class_key): Disable access checks for the
890 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
891 !warn_redundant_tags.
893 2010-01-05 Jakub Jelinek <jakub@redhat.com>
896 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
897 TARGET_EXPR if it has been gimplified already.
899 2020-01-03 Jason Merrill <jason@redhat.com>
901 PR c++/93033 - incorrect tree node sharing with array init.
902 * typeck2.c (split_nonconstant_init): Unshare non-decl.
903 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
905 2020-01-02 Jason Merrill <jason@redhat.com>
907 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
910 2020-01-02 Jakub Jelinek <jakub@redhat.com>
913 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
914 has not been found, rather than error_mark_node.
916 2020-01-01 Jakub Jelinek <jakub@redhat.com>
918 Update copyright years.
920 Copyright (C) 2020 Free Software Foundation, Inc.
922 Copying and distribution of this file, with or without modification,
923 are permitted in any medium without royalty provided the copyright
924 notice and this notice are preserved.