1 2020-02-13 Jason Merrill <jason@redhat.com>
4 * name-lookup.c (matching_fn_p): A function does not match a
9 * tree.c (decl_linkage): Always lk_none for locals.
11 2020-02-12 Jason Merrill <jason@redhat.com>
15 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
16 * pt.c (find_parameter_packs_r): Not here.
18 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
20 * coroutines.cc (build_actor_fn): Implement deallocation function
21 selection per n4849, dcl.fct.def.coroutine bullet 12.
22 (morph_fn_to_coro): Implement allocation function selection per
23 n4849, dcl.fct.def.coroutine bullets 9 and 10.
25 2020-02-12 Marek Polacek <polacek@redhat.com>
27 PR c++/93684 - ICE-on-invalid with broken attribute.
28 * parser.c (cp_parser_std_attribute): Peek a token first before
31 2020-02-11 Jason Merrill <jason@redhat.com>
34 * class.c (add_implicitly_declared_members): Use do_friend.
35 * method.c (implicitly_declare_fn): Fix friend handling.
36 (decl_remember_implicit_trigger_p): New.
37 (synthesize_method): Use it.
38 * decl2.c (mark_used): Use it.
40 2020-02-11 Jason Merrill <jason@redhat.com>
44 * constexpr.c (maybe_constant_value): Correct earlier change.
45 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
46 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
48 2020-02-12 Patrick Palka <ppalka@redhat.com>
52 * type-utils.h (find_type_usage): Refactor to take a tree * and to
53 return a tree *, and update documentation accordingly.
54 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
56 (make_constrained_decltype_auto): No need to explicitly set
57 AUTO_IS_DECLTYPE anymore.
58 (splice_late_return_type): Use find_type_usage to find and
59 replace a possibly nested auto node instead of using is_auto.
60 Check test for is_auto into an assert when deciding whether
62 (type_uses_auto): Adjust the call to find_type_usage.
63 * parser.c (cp_parser_decltype): No need to explicitly set
64 AUTO_IS_DECLTYPE anymore.
66 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
67 (dump_simple_decl): Handle standard concept definitions as well as
68 variable concept definitions.
70 2020-02-10 Jakub Jelinek <jakub@redhat.com>
73 * error.c (dump_decl_name): Fix up last argument to strncmp.
75 2020-02-10 Jason Merrill <jason@redhat.com>
78 * tree.c (array_of_unknown_bound_p): New.
79 * init.c (perform_member_init): Do nothing for flexible arrays.
81 2020-02-09 Jakub Jelinek <jakub@redhat.com>
84 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
85 ARRAY_TYPE, use the element type. Punt if objtype after that is not
88 2020-02-08 Jason Merrill <jason@redhat.com>
91 * expr.c (fold_for_warn): Call maybe_constant_value.
92 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
93 (maybe_constant_value): Add uid_sensitive parm.
94 (get_fundef_copy): Don't copy if it's true.
95 (cxx_eval_call_expression): Don't instantiate if it's true.
96 (cxx_eval_outermost_constant_expr): Likewise.
99 * constexpr.c (maybe_constant_value): Don't unshare if the cached
100 value is the same as the argument.
102 * typeck.c (maybe_warn_about_returning_address_of_local): Add
105 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
108 2020-02-08 Jakub Jelinek <jakub@redhat.com>
111 * constexpr.c (find_array_ctor_elt): If last element has no index,
112 for flag_checking verify all elts have no index. If i is within the
113 elts, return it directly, if it is right after the last elt, append
114 if NULL index, otherwise force indexes on all elts.
115 (cxx_eval_store_expression): Allow cep->index to be NULL.
117 2020-02-07 Marek Polacek <polacek@redhat.com>
119 PR c++/92947 - Paren init of aggregates in unevaluated context.
120 * call.c (build_new_method_call_1): Don't check
121 cp_unevaluated_operand. Check the return value of digest_init.
123 2020-02-06 Jason Merrill <jason@redhat.com>
126 * tree.c (cp_walk_subtrees): Walk into type template arguments.
127 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
128 instead of TYPE_ALIAS_P.
129 * pt.c (push_template_decl_real): Likewise.
130 (find_parameter_packs_r): Likewise. Remove dead code.
131 * error.c (find_typenames_r): Remove dead code.
133 2020-02-06 Jason Merrill <jason@redhat.com>
136 * parser.c (cp_parser_constraint_primary_expression): Do the main
137 parse non-tentatively.
139 2020-02-06 Marek Polacek <polacek@redhat.com>
141 PR c++/93597 - ICE with lambda in operator function.
142 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
144 2020-02-05 Jason Merrill <jason@redhat.com>
147 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
148 handling of TREE_CHAIN for empty pack.
150 2020-02-05 Jakub Jelinek <jakub@redhat.com>
153 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
154 prior to passing it to c_build_vec_convert.
156 2020-02-05 Marek Polacek <polacek@redhat.com>
158 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
159 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
162 2020-02-05 Jason Merrill <jason@redhat.com>
165 * decl.c (grokdeclarator): Reject field of current class type even
168 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
170 * coroutines.cc (maybe_promote_captured_temps): Increase the index
171 number for temporary variables' name.
173 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
175 * coroutines.cc (build_co_await): Call convert_from_reference
176 to wrap co_await_expr with indirect_ref which avoid
177 reference/non-reference type confusion.
179 (co_await_expander): Sink to call_expr if await_resume
180 is wrapped by indirect_ref.
182 2020-02-04 Jason Merrill <jason@redhat.com>
185 * constraint.cc (satisfy_declaration_constraints): Check return
186 value of push_tinst_level.
189 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
190 elements instead of value-initializing them.
193 * init.c (perform_member_init): Simplify.
194 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
196 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
198 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
200 * coroutines.cc (find_promise_type): Delete unused forward
202 (struct coroutine_info): Add a bool for no promise type error.
203 (coro_promise_type_found_p): Only emit the error for a missing
204 promise once in each affected coroutine.
206 2020-02-03 Jason Merrill <jason@redhat.com>
209 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
210 defer loading the value of a reference.
212 2020-02-03 Jason Merrill <jason@redhat.com>
215 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
217 [COMPONENT_REF]: A member function reference doesn't use the object
220 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
223 * coroutines.cc (struct coroutine_info): Add a bool flag to note
224 that we emitted an error for a bad function return type.
225 (get_coroutine_info): Tolerate an unset info table in case of
227 (find_coro_traits_template_decl): In case of error or if we didn't
228 find a type template, note we emitted the error and suppress
230 (find_coro_handle_template_decl): Likewise.
231 (instantiate_coro_traits): Only check for error_mark_node in the
232 return from lookup_qualified_name.
233 (coro_promise_type_found_p): Reorder initialization so that we check
234 for the traits and their usability before allocation of the info
235 table. Check for a suitable return type and emit a diagnostic for
236 here instead of relying on the lookup machinery. This allows the
237 error to have a better location, and means we can suppress multiple
239 (coro_function_valid_p): Re-check for a valid promise (and thus the
240 traits) before proceeding. Tolerate missing info as a fatal error.
242 2020-02-03 Jason Merrill <jason@redhat.com>
245 * cp-gimplify.c (predeclare_vla): New.
246 (cp_genericize_r) [NOP_EXPR]: Call it.
248 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
250 * coroutines.cc (transform_await_wrapper): Set actor funcion as
251 new context of label_decl.
252 (build_actor_fn): Fill new field of await_xform_data.
254 2020-02-02 Marek Polacek <polacek@redhat.com>
256 PR c++/93530 - ICE on invalid alignas in a template.
257 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
260 2020-01-31 Jason Merrill <jason@redhat.com>
263 * semantics.c (process_outer_var_ref): Capture VLAs even in
267 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
268 non-aggregate elements.
269 (reshape_init_array): Add first_initializer_p parm.
270 (reshape_init_r): Change first_initializer_p from bool to tree.
271 (reshape_init): Pass init to it.
274 * parser.c (cp_parser_initializer_list): Suppress location wrappers
277 2020-01-29 Jason Merrill <jason@redhat.com>
280 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
281 the expression was dependent before substitution.
283 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
285 * coroutines.cc (act_des_fn): New.
286 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
287 Access promise via actor function's frame pointer argument.
288 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
290 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
292 * coroutines.cc (co_await_expander): Handle type conversion case.
294 2020-01-29 Jason Merrill <jason@redhat.com>
299 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
300 a trailing return type.
301 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
304 2020-01-29 Marek Polacek <polacek@redhat.com>
306 PR c++/91754 - Fix template arguments comparison with class NTTP.
307 * pt.c (class_nttp_const_wrapper_p): New.
308 (template_args_equal): See through class_nttp_const_wrapper_p
311 2020-01-29 Marek Polacek <polacek@redhat.com>
313 PR c++/92948 - Fix class NTTP with template arguments.
314 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
315 converting a value-dependent expression to a class type.
316 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
317 as the result of the tsubst_copy call.
319 2020-01-29 Jakub Jelinek <jakub@redhat.com>
322 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
323 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
325 2020-01-28 Jason Merrill <jason@redhat.com>
328 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
332 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
335 * call.c (build_user_type_conversion_1): Allow a template conversion
336 returning an rvalue reference to bind directly to an lvalue.
339 * decl.c (grokdeclarator): Propagate eh spec from typedef.
341 2020-01-28 Martin Liska <mliska@suse.cz>
344 * pt.c (redeclare_class_template): Group couple of
345 errors and inform messages with auto_diagnostic_group.
347 2020-01-28 Martin Liska <mliska@suse.cz>
350 * pt.c (redeclare_class_template): Use inform
351 for the second location.
353 2020-01-27 Jason Merrill <jason@redhat.com>
356 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
358 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
361 * coroutines.cc (morph_fn_to_coro): Check the ramp return
362 value when it is constructed from the 'get return object'.
364 2020-01-27 Nathan Sidwell <nathan@acm.org>
367 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
369 2020-01-26 Jason Merrill <jason@redhat.com>
372 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
373 temporarily enable -Wsystem-headers. Change second warning to
377 * semantics.c (finish_call_expr): Don't call
378 instantiate_non_dependent_expr before warn_for_memset.
380 2020-01-25 Marek Polacek <polacek@redhat.com>
382 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
383 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
384 dynamic_cast diagnostic.
386 2020-01-24 Jason Merrill <jason@redhat.com>
388 PR c++/93400 - ICE with constrained friend.
389 * constraint.cc (maybe_substitute_reqs_for): New.
390 * decl.c (function_requirements_equivalent_p): Call it.
391 * pt.c (tsubst_friend_function): Only substitute
392 TEMPLATE_PARMS_CONSTRAINTS.
393 (tsubst_template_parms): Copy constraints.
395 2020-01-24 Jason Merrill <jason@redhat.com>
397 PR c++/93279 - ICE with lambda in member operator.
398 * name-lookup.c (maybe_save_operator_binding): Don't remember
399 class-scope bindings.
401 2020-01-24 Jason Merrill <jason@redhat.com>
403 PR c++/93377 - ICE with member alias in constraint.
404 * pt.c (any_template_parm_r): Look at template arguments for all
405 aliases, not only alias templates.
407 2020-01-24 Marek Polacek <polacek@redhat.com>
409 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
410 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
412 2020-01-24 Jason Merrill <jason@redhat.com>
414 PR c++/92852 - ICE with generic lambda and reference var.
415 * constexpr.c (maybe_constant_value): Likewise.
417 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
420 * parser.c (cp_parser_nested_name_specifier_opt): Properly
421 diagnose concept-ids.
423 2020-01-23 Jason Merrill <jason@redhat.com>
425 PR c++/93331 - ICE with __builtin_strchr.
426 * constexpr.c (cxx_eval_builtin_function_call): Use the original
427 argument if we didn't manage to extract a STRING_CST.
429 PR c++/93345 - ICE with defaulted dtor and template.
431 * decl.c (cxx_maybe_build_cleanup): Don't try to set
432 throwing_cleanup in a template.
434 2020-01-22 Marek Polacek <polacek@redhat.com>
436 PR c++/92907 - noexcept does not consider "const" in member functions.
437 * g++.dg/cpp0x/noexcept56.C: New test.
439 2020-01-22 Marek Polacek <polacek@redhat.com>
441 PR c++/93324 - ICE with -Wall on constexpr if.
442 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
444 2020-01-22 Patrick Palka <ppalka@redhat.com>
446 * constraint.cc (get_mapped_args): Avoid using auto_vec
447 as a vector element. Release the vectors inside the lists
449 * parser.c (cp_literal_operator_id): Free the buffer.
451 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
453 * coroutines.cc (finish_co_await_expr): Add error check on return
454 value of build_co_await.
455 (finish_co_yield_expr,): Ditto.
457 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
459 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
460 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
461 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
463 2020-01-21 Jason Merrill <jason@redhat.com>
465 PR c++/60855 - ICE with sizeof VLA capture.
466 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
468 PR c++/90732 - ICE with VLA capture and generic lambda.
469 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
471 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
472 Bin Cheng <bin.cheng@linux.alibaba.com>
474 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
475 from complete_type_or_else.
476 (register_param_uses): Likewise.
477 (build_co_await): Do not try to use complete_type_or_else for void
478 types, otherwise for incomplete types, check for NULL return from
479 complete_type_or_else.
481 2020-01-21 Jason Merrill <jason@redhat.com>
483 PR c++/91476 - anon-namespace reference temp clash between TUs.
484 * decl2.c (copy_linkage): Factor out of get_guard.
485 * call.c (make_temporary_var_for_ref_to_temp): Use it.
486 * decl.c (cp_finish_decomp): Use it.
487 (cp_finish_decl): determine_visibility sooner.
489 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
491 * coroutines.cc (finish_co_await_expr): Set return value flag.
492 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
494 2020-01-19 Jason Merrill <jason@redhat.com>
496 PR c++/33799 - destroy return value, take 2.
497 * cp-tree.h (current_retval_sentinel): New macro.
498 (struct language_function): Add throwing_cleanup bitfield.
499 * decl.c (cxx_maybe_build_cleanup): Set it.
500 * except.c (maybe_set_retval_sentinel)
501 (maybe_splice_retval_cleanup): New functions.
502 * parser.c (cp_parser_compound_statement): Call
503 maybe_splice_retval_cleanup.
504 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
506 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
508 2020-01-18 Jakub Jelinek <jakub@redhat.com>
510 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
511 but non-NO_DOLLAR_IN_LABEL case build.
513 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
515 * Make-lang.in: Add coroutines.o.
516 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
517 (DECL_COROUTINE_P): New.
518 * lex.c (init_reswords): Enable keywords when the coroutine flag
520 * operators.def (co_await): New operator.
521 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
522 (op_error): Likewise.
523 (build_new_op_1): Likewise.
524 (build_new_function_call): Validate coroutine builtin arguments.
525 * constexpr.c (potential_constant_expression_1): Handle
526 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
527 * coroutines.cc: New file.
528 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
529 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
530 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
531 * cp-tree.h (coro_validate_builtin_call): New.
532 * decl.c (emit_coro_helper): New.
533 (finish_function): Handle the case when a function is found to
534 be a coroutine, perform the outlining and emit the outlined
535 functions. Set a bit to signal that this is a coroutine component.
536 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
537 (cp_parser_unary_expression): Handle co_await.
538 (cp_parser_assignment_expression): Handle co_yield.
539 (cp_parser_statement): Handle RID_CO_RETURN.
540 (cp_parser_jump_statement): Handle co_return.
541 (cp_parser_operator): Handle co_await operator.
542 (cp_parser_yield_expression): New.
543 (cp_parser_required_error): Handle RT_CO_YIELD.
544 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
545 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
547 * tree.c (cp_walk_subtrees): Likewise.
549 2020-01-17 Jason Merrill <jason@redhat.com>
551 PR c++/92531 - ICE with noexcept(lambda).
552 * pt.c (uses_template_parms): Don't try to enumerate all the
555 2020-01-17 Jakub Jelinek <jakub@redhat.com>
558 * parser.c (cp_parser_template_name): Look up deprecated attribute
559 in DECL_TEMPLATE_RESULT or its type's attributes.
561 2020-01-16 Jason Merrill <jason@redhat.com>
563 PR c++/93286 - ICE with __is_constructible and variadic template.
564 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
565 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
567 PR c++/93280 - ICE with aggregate assignment and DMI.
568 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
569 * typeck2.c (digest_nsdmi_init): Not here.
571 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
574 * cp-tree.h (is_constrained_auto): New.
575 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
576 handle concept-check expressions; take a cp_decl_specifier_seq*
578 (cp_parser_condition): Update call.
579 (cp_parser_simple_declaration): Likewise.
580 (cp_parser_placeholder_type_specifier): Correctly handle
581 concept-check expressions.
583 2020-01-15 Jason Merrill <jason@redhat.com>
586 PR c++/33799 - destroy return value if local cleanup throws.
587 * cp-tree.h (current_retval_sentinel): New macro.
588 * decl.c (start_preparsed_function): Set up cleanup for retval.
589 * typeck.c (check_return_expr): Set current_retval_sentinel.
591 PR c++/93257 - consteval void function.
592 * constexpr.c (verify_constant): Allow void_node.
594 PR c++/92871 - bad code with xvalue and GNU ?: extension.
595 * call.c (prevent_lifetime_extension): New.
596 (build_conditional_expr_1): Use it.
598 2020-01-14 Nathan Sidwell <nathan@acm.org>
601 * pt.c (retrieve_specialization): Use get_template_info, not open
605 * pt.c (retrieve_specialization): Get the TI from the decl or the
606 classtype as appropriate.
608 2020-01-14 David Malcolm <dmalcolm@redhat.com>
610 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
612 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
613 (struct named_label_hash::empty_zero_p): Likewise.
614 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
616 2020-01-14 Jason Merrill <jason@redhat.com>
618 PR c++/92590 - wrong handling of inherited default ctor.
619 * class.c (add_method): A constrained inherited ctor doesn't hide an
620 implicit derived ctor.
622 PR c++/92552 - ICE with inherited constrained default ctor.
623 * pt.c (instantiate_class_template_1): Copy
624 TYPE_HAS_USER_CONSTRUCTOR.
625 PR c++/91930 - ICE with constrained inherited default ctor.
626 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
627 for inherited constructor.
628 PR c++/92594 - ICE with inherited trivial default ctor.
629 * method.c (trivial_fn_p): Treat an inherited default constructor
630 like a normal default constructor.
632 PR c++/92594 - ICE with inherited trivial default ctor.
633 * method.c (trivial_fn_p): Treat an inherited default constructor
634 like a normal default constructor.
636 PR c++/92009 - ICE with punning of typeid.
637 * rtti.c (get_tinfo_desc): Call xref_basetypes.
638 * constexpr.c (cxx_fold_indirect_ref): Don't strip
641 2020-01-13 Jason Merrill <jason@redhat.com>
643 PR c++/92746 - ICE with noexcept of function concept check.
644 * except.c (check_noexcept_r): Handle concept-check.
646 PR c++/92582 - ICE with member template as requirement.
647 * pt.c (struct find_template_parameter_info): Add ctx_parms.
648 (any_template_parm_r): Handle TEMPLATE_DECL.
649 (find_template_parameters): Take parms instead of their depth.
650 * constraint.cc (build_parameter_mapping): Pass them.
652 PR c++/33799 - destroy return value if local cleanup throws.
653 * cp-tree.h (current_retval_sentinel): New macro.
654 * decl.c (start_preparsed_function): Set up cleanup for retval.
655 * typeck.c (check_return_expr): Set current_retval_sentinel.
657 PR c++/93238 - short right-shift with enum.
658 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
660 2020-01-10 Jason Merrill <jason@redhat.com>
662 * typeck.c (cp_build_binary_op): Restore short_shift code.
664 PR c++/93143 - incorrect tree sharing with constexpr.
665 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
666 CONSTRUCTORs are already unshared.
668 PR c++/93173 - incorrect tree sharing.
670 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
671 copy_if_shared after cp_genericize_tree.
672 * typeck2.c (split_nonconstant_init): Don't unshare here.
674 2020-01-08 Jason Merrill <jason@redhat.com>
676 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
677 TARGET_EXPR_DIRECT_INIT_P.
678 * constexpr.c (cxx_eval_constant_expression): Likewise.
680 2020-01-08 Jason Merrill <jason@redhat.com>
682 PR c++/91369 - constexpr destructor and member initializer.
683 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
684 when not preevaluating.
686 2020-01-08 Jason Merrill <jason@redhat.com>
688 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
691 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
693 * init.c (build_new): Add location_t parameter and use it throughout.
694 (build_raw_new_expr): Likewise.
695 * parser.c (cp_parser_new_expression): Pass the combined_loc.
696 * pt.c (tsubst_copy_and_build): Adjust call.
697 * cp-tree.h: Update declarations.
699 2020-01-07 Jason Merrill <jason@redhat.com>
701 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
702 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
703 explicit class visibility for a template.
705 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
707 * mangle.c (mangle_type_attribute_p): New function, split out from...
708 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
709 that contain a space.
711 2020-01-07 Jakub Jelinek <jakub@redhat.com>
714 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
715 member, initialize it to zero in ctor.
716 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
717 a heap object. Don't cache calls to functions which allocate some
718 heap objects and don't deallocate them or deallocate some heap
719 objects they didn't allocate.
721 2020-01-06 Jason Merrill <jason@redhat.com>
723 PR c++/92552 - ICE with inherited constrained default ctor.
724 * pt.c (instantiate_class_template_1): Copy
725 TYPE_HAS_USER_CONSTRUCTOR.
726 * class.c (one_inherited_ctor): Don't set it here.
728 2020-01-06 Andrew Sutton <asutton@lock3software.com>
730 PR c++/92739 - parsing requires clause with attributes.
731 * parser.c (cp_parser_constraint_requires_parens): Exclude
732 attributes as postfix expressions.
734 2020-01-05 Jakub Jelinek <jakub@redhat.com>
737 * parser.c (cp_parser_check_class_key): Disable access checks for the
739 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
740 !warn_redundant_tags.
742 2010-01-05 Jakub Jelinek <jakub@redhat.com>
745 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
746 TARGET_EXPR if it has been gimplified already.
748 2020-01-03 Jason Merrill <jason@redhat.com>
750 PR c++/93033 - incorrect tree node sharing with array init.
751 * typeck2.c (split_nonconstant_init): Unshare non-decl.
752 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
754 2020-01-02 Jason Merrill <jason@redhat.com>
756 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
759 2020-01-02 Jakub Jelinek <jakub@redhat.com>
762 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
763 has not been found, rather than error_mark_node.
765 2020-01-01 Jakub Jelinek <jakub@redhat.com>
767 Update copyright years.
769 Copyright (C) 2020 Free Software Foundation, Inc.
771 Copying and distribution of this file, with or without modification,
772 are permitted in any medium without royalty provided the copyright
773 notice and this notice are preserved.