1 2020-02-19 Marek Polacek <polacek@redhat.com>
3 PR c++/93169 - wrong-code with a non-constexpr constructor.
4 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
5 on constant CONSTRUCTORs.
7 2020-02-15 Marek Polacek <polacek@redhat.com>
9 PR c++/93710 - poor diagnostic for array initializer.
10 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
13 2020-02-15 Jason Merrill <jason@redhat.com>
16 * pt.c (any_template_parm_r): Look into lambda body.
19 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
21 2020-02-14 Jakub Jelinek <jakub@redhat.com>
24 * class.c (enum_min_precision): Change prec type from int to int &.
27 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
28 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
29 (fallback_dfloat32_type, fallback_dfloat64_type,
30 fallback_dfloat128_type): Define.
31 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
33 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
34 is disabled for compatibility.
36 2020-02-13 Jason Merrill <jason@redhat.com>
39 * name-lookup.c (matching_fn_p): A function does not match a
44 * tree.c (decl_linkage): Always lk_none for locals.
46 2020-02-12 Jason Merrill <jason@redhat.com>
50 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
51 * pt.c (find_parameter_packs_r): Not here.
53 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
55 * coroutines.cc (build_actor_fn): Implement deallocation function
56 selection per n4849, dcl.fct.def.coroutine bullet 12.
57 (morph_fn_to_coro): Implement allocation function selection per
58 n4849, dcl.fct.def.coroutine bullets 9 and 10.
60 2020-02-12 Marek Polacek <polacek@redhat.com>
62 PR c++/93684 - ICE-on-invalid with broken attribute.
63 * parser.c (cp_parser_std_attribute): Peek a token first before
66 2020-02-11 Jason Merrill <jason@redhat.com>
69 * class.c (add_implicitly_declared_members): Use do_friend.
70 * method.c (implicitly_declare_fn): Fix friend handling.
71 (decl_remember_implicit_trigger_p): New.
72 (synthesize_method): Use it.
73 * decl2.c (mark_used): Use it.
75 2020-02-11 Jason Merrill <jason@redhat.com>
79 * constexpr.c (maybe_constant_value): Correct earlier change.
80 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
81 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
83 2020-02-12 Patrick Palka <ppalka@redhat.com>
87 * type-utils.h (find_type_usage): Refactor to take a tree * and to
88 return a tree *, and update documentation accordingly.
89 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
91 (make_constrained_decltype_auto): No need to explicitly set
92 AUTO_IS_DECLTYPE anymore.
93 (splice_late_return_type): Use find_type_usage to find and
94 replace a possibly nested auto node instead of using is_auto.
95 Check test for is_auto into an assert when deciding whether
97 (type_uses_auto): Adjust the call to find_type_usage.
98 * parser.c (cp_parser_decltype): No need to explicitly set
99 AUTO_IS_DECLTYPE anymore.
101 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
102 (dump_simple_decl): Handle standard concept definitions as well as
103 variable concept definitions.
105 2020-02-10 Jakub Jelinek <jakub@redhat.com>
108 * error.c (dump_decl_name): Fix up last argument to strncmp.
110 2020-02-10 Jason Merrill <jason@redhat.com>
113 * tree.c (array_of_unknown_bound_p): New.
114 * init.c (perform_member_init): Do nothing for flexible arrays.
116 2020-02-09 Jakub Jelinek <jakub@redhat.com>
119 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
120 ARRAY_TYPE, use the element type. Punt if objtype after that is not
123 2020-02-08 Jason Merrill <jason@redhat.com>
126 * expr.c (fold_for_warn): Call maybe_constant_value.
127 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
128 (maybe_constant_value): Add uid_sensitive parm.
129 (get_fundef_copy): Don't copy if it's true.
130 (cxx_eval_call_expression): Don't instantiate if it's true.
131 (cxx_eval_outermost_constant_expr): Likewise.
134 * constexpr.c (maybe_constant_value): Don't unshare if the cached
135 value is the same as the argument.
137 * typeck.c (maybe_warn_about_returning_address_of_local): Add
140 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
143 2020-02-08 Jakub Jelinek <jakub@redhat.com>
146 * constexpr.c (find_array_ctor_elt): If last element has no index,
147 for flag_checking verify all elts have no index. If i is within the
148 elts, return it directly, if it is right after the last elt, append
149 if NULL index, otherwise force indexes on all elts.
150 (cxx_eval_store_expression): Allow cep->index to be NULL.
152 2020-02-07 Marek Polacek <polacek@redhat.com>
154 PR c++/92947 - Paren init of aggregates in unevaluated context.
155 * call.c (build_new_method_call_1): Don't check
156 cp_unevaluated_operand. Check the return value of digest_init.
158 2020-02-06 Jason Merrill <jason@redhat.com>
161 * tree.c (cp_walk_subtrees): Walk into type template arguments.
162 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
163 instead of TYPE_ALIAS_P.
164 * pt.c (push_template_decl_real): Likewise.
165 (find_parameter_packs_r): Likewise. Remove dead code.
166 * error.c (find_typenames_r): Remove dead code.
168 2020-02-06 Jason Merrill <jason@redhat.com>
171 * parser.c (cp_parser_constraint_primary_expression): Do the main
172 parse non-tentatively.
174 2020-02-06 Marek Polacek <polacek@redhat.com>
176 PR c++/93597 - ICE with lambda in operator function.
177 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
179 2020-02-05 Jason Merrill <jason@redhat.com>
182 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
183 handling of TREE_CHAIN for empty pack.
185 2020-02-05 Jakub Jelinek <jakub@redhat.com>
188 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
189 prior to passing it to c_build_vec_convert.
191 2020-02-05 Marek Polacek <polacek@redhat.com>
193 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
194 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
197 2020-02-05 Jason Merrill <jason@redhat.com>
200 * decl.c (grokdeclarator): Reject field of current class type even
203 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
205 * coroutines.cc (maybe_promote_captured_temps): Increase the index
206 number for temporary variables' name.
208 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
210 * coroutines.cc (build_co_await): Call convert_from_reference
211 to wrap co_await_expr with indirect_ref which avoid
212 reference/non-reference type confusion.
214 (co_await_expander): Sink to call_expr if await_resume
215 is wrapped by indirect_ref.
217 2020-02-04 Jason Merrill <jason@redhat.com>
220 * constraint.cc (satisfy_declaration_constraints): Check return
221 value of push_tinst_level.
224 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
225 elements instead of value-initializing them.
228 * init.c (perform_member_init): Simplify.
229 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
231 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
233 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
235 * coroutines.cc (find_promise_type): Delete unused forward
237 (struct coroutine_info): Add a bool for no promise type error.
238 (coro_promise_type_found_p): Only emit the error for a missing
239 promise once in each affected coroutine.
241 2020-02-03 Jason Merrill <jason@redhat.com>
244 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
245 defer loading the value of a reference.
247 2020-02-03 Jason Merrill <jason@redhat.com>
250 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
252 [COMPONENT_REF]: A member function reference doesn't use the object
255 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
258 * coroutines.cc (struct coroutine_info): Add a bool flag to note
259 that we emitted an error for a bad function return type.
260 (get_coroutine_info): Tolerate an unset info table in case of
262 (find_coro_traits_template_decl): In case of error or if we didn't
263 find a type template, note we emitted the error and suppress
265 (find_coro_handle_template_decl): Likewise.
266 (instantiate_coro_traits): Only check for error_mark_node in the
267 return from lookup_qualified_name.
268 (coro_promise_type_found_p): Reorder initialization so that we check
269 for the traits and their usability before allocation of the info
270 table. Check for a suitable return type and emit a diagnostic for
271 here instead of relying on the lookup machinery. This allows the
272 error to have a better location, and means we can suppress multiple
274 (coro_function_valid_p): Re-check for a valid promise (and thus the
275 traits) before proceeding. Tolerate missing info as a fatal error.
277 2020-02-03 Jason Merrill <jason@redhat.com>
280 * cp-gimplify.c (predeclare_vla): New.
281 (cp_genericize_r) [NOP_EXPR]: Call it.
283 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
285 * coroutines.cc (transform_await_wrapper): Set actor funcion as
286 new context of label_decl.
287 (build_actor_fn): Fill new field of await_xform_data.
289 2020-02-02 Marek Polacek <polacek@redhat.com>
291 PR c++/93530 - ICE on invalid alignas in a template.
292 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
295 2020-01-31 Jason Merrill <jason@redhat.com>
298 * semantics.c (process_outer_var_ref): Capture VLAs even in
302 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
303 non-aggregate elements.
304 (reshape_init_array): Add first_initializer_p parm.
305 (reshape_init_r): Change first_initializer_p from bool to tree.
306 (reshape_init): Pass init to it.
309 * parser.c (cp_parser_initializer_list): Suppress location wrappers
312 2020-01-29 Jason Merrill <jason@redhat.com>
315 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
316 the expression was dependent before substitution.
318 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
320 * coroutines.cc (act_des_fn): New.
321 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
322 Access promise via actor function's frame pointer argument.
323 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
325 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
327 * coroutines.cc (co_await_expander): Handle type conversion case.
329 2020-01-29 Jason Merrill <jason@redhat.com>
334 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
335 a trailing return type.
336 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
339 2020-01-29 Marek Polacek <polacek@redhat.com>
341 PR c++/91754 - Fix template arguments comparison with class NTTP.
342 * pt.c (class_nttp_const_wrapper_p): New.
343 (template_args_equal): See through class_nttp_const_wrapper_p
346 2020-01-29 Marek Polacek <polacek@redhat.com>
348 PR c++/92948 - Fix class NTTP with template arguments.
349 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
350 converting a value-dependent expression to a class type.
351 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
352 as the result of the tsubst_copy call.
354 2020-01-29 Jakub Jelinek <jakub@redhat.com>
357 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
358 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
360 2020-01-28 Jason Merrill <jason@redhat.com>
363 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
367 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
370 * call.c (build_user_type_conversion_1): Allow a template conversion
371 returning an rvalue reference to bind directly to an lvalue.
374 * decl.c (grokdeclarator): Propagate eh spec from typedef.
376 2020-01-28 Martin Liska <mliska@suse.cz>
379 * pt.c (redeclare_class_template): Group couple of
380 errors and inform messages with auto_diagnostic_group.
382 2020-01-28 Martin Liska <mliska@suse.cz>
385 * pt.c (redeclare_class_template): Use inform
386 for the second location.
388 2020-01-27 Jason Merrill <jason@redhat.com>
391 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
393 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
396 * coroutines.cc (morph_fn_to_coro): Check the ramp return
397 value when it is constructed from the 'get return object'.
399 2020-01-27 Nathan Sidwell <nathan@acm.org>
402 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
404 2020-01-26 Jason Merrill <jason@redhat.com>
407 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
408 temporarily enable -Wsystem-headers. Change second warning to
412 * semantics.c (finish_call_expr): Don't call
413 instantiate_non_dependent_expr before warn_for_memset.
415 2020-01-25 Marek Polacek <polacek@redhat.com>
417 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
418 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
419 dynamic_cast diagnostic.
421 2020-01-24 Jason Merrill <jason@redhat.com>
423 PR c++/93400 - ICE with constrained friend.
424 * constraint.cc (maybe_substitute_reqs_for): New.
425 * decl.c (function_requirements_equivalent_p): Call it.
426 * pt.c (tsubst_friend_function): Only substitute
427 TEMPLATE_PARMS_CONSTRAINTS.
428 (tsubst_template_parms): Copy constraints.
430 2020-01-24 Jason Merrill <jason@redhat.com>
432 PR c++/93279 - ICE with lambda in member operator.
433 * name-lookup.c (maybe_save_operator_binding): Don't remember
434 class-scope bindings.
436 2020-01-24 Jason Merrill <jason@redhat.com>
438 PR c++/93377 - ICE with member alias in constraint.
439 * pt.c (any_template_parm_r): Look at template arguments for all
440 aliases, not only alias templates.
442 2020-01-24 Marek Polacek <polacek@redhat.com>
444 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
445 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
447 2020-01-24 Jason Merrill <jason@redhat.com>
449 PR c++/92852 - ICE with generic lambda and reference var.
450 * constexpr.c (maybe_constant_value): Likewise.
452 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
455 * parser.c (cp_parser_nested_name_specifier_opt): Properly
456 diagnose concept-ids.
458 2020-01-23 Jason Merrill <jason@redhat.com>
460 PR c++/93331 - ICE with __builtin_strchr.
461 * constexpr.c (cxx_eval_builtin_function_call): Use the original
462 argument if we didn't manage to extract a STRING_CST.
464 PR c++/93345 - ICE with defaulted dtor and template.
466 * decl.c (cxx_maybe_build_cleanup): Don't try to set
467 throwing_cleanup in a template.
469 2020-01-22 Marek Polacek <polacek@redhat.com>
471 PR c++/92907 - noexcept does not consider "const" in member functions.
472 * g++.dg/cpp0x/noexcept56.C: New test.
474 2020-01-22 Marek Polacek <polacek@redhat.com>
476 PR c++/93324 - ICE with -Wall on constexpr if.
477 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
479 2020-01-22 Patrick Palka <ppalka@redhat.com>
481 * constraint.cc (get_mapped_args): Avoid using auto_vec
482 as a vector element. Release the vectors inside the lists
484 * parser.c (cp_literal_operator_id): Free the buffer.
486 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
488 * coroutines.cc (finish_co_await_expr): Add error check on return
489 value of build_co_await.
490 (finish_co_yield_expr,): Ditto.
492 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
494 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
495 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
496 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
498 2020-01-21 Jason Merrill <jason@redhat.com>
500 PR c++/60855 - ICE with sizeof VLA capture.
501 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
503 PR c++/90732 - ICE with VLA capture and generic lambda.
504 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
506 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
507 Bin Cheng <bin.cheng@linux.alibaba.com>
509 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
510 from complete_type_or_else.
511 (register_param_uses): Likewise.
512 (build_co_await): Do not try to use complete_type_or_else for void
513 types, otherwise for incomplete types, check for NULL return from
514 complete_type_or_else.
516 2020-01-21 Jason Merrill <jason@redhat.com>
518 PR c++/91476 - anon-namespace reference temp clash between TUs.
519 * decl2.c (copy_linkage): Factor out of get_guard.
520 * call.c (make_temporary_var_for_ref_to_temp): Use it.
521 * decl.c (cp_finish_decomp): Use it.
522 (cp_finish_decl): determine_visibility sooner.
524 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
526 * coroutines.cc (finish_co_await_expr): Set return value flag.
527 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
529 2020-01-19 Jason Merrill <jason@redhat.com>
531 PR c++/33799 - destroy return value, take 2.
532 * cp-tree.h (current_retval_sentinel): New macro.
533 (struct language_function): Add throwing_cleanup bitfield.
534 * decl.c (cxx_maybe_build_cleanup): Set it.
535 * except.c (maybe_set_retval_sentinel)
536 (maybe_splice_retval_cleanup): New functions.
537 * parser.c (cp_parser_compound_statement): Call
538 maybe_splice_retval_cleanup.
539 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
541 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
543 2020-01-18 Jakub Jelinek <jakub@redhat.com>
545 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
546 but non-NO_DOLLAR_IN_LABEL case build.
548 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
550 * Make-lang.in: Add coroutines.o.
551 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
552 (DECL_COROUTINE_P): New.
553 * lex.c (init_reswords): Enable keywords when the coroutine flag
555 * operators.def (co_await): New operator.
556 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
557 (op_error): Likewise.
558 (build_new_op_1): Likewise.
559 (build_new_function_call): Validate coroutine builtin arguments.
560 * constexpr.c (potential_constant_expression_1): Handle
561 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
562 * coroutines.cc: New file.
563 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
564 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
565 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
566 * cp-tree.h (coro_validate_builtin_call): New.
567 * decl.c (emit_coro_helper): New.
568 (finish_function): Handle the case when a function is found to
569 be a coroutine, perform the outlining and emit the outlined
570 functions. Set a bit to signal that this is a coroutine component.
571 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
572 (cp_parser_unary_expression): Handle co_await.
573 (cp_parser_assignment_expression): Handle co_yield.
574 (cp_parser_statement): Handle RID_CO_RETURN.
575 (cp_parser_jump_statement): Handle co_return.
576 (cp_parser_operator): Handle co_await operator.
577 (cp_parser_yield_expression): New.
578 (cp_parser_required_error): Handle RT_CO_YIELD.
579 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
580 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
582 * tree.c (cp_walk_subtrees): Likewise.
584 2020-01-17 Jason Merrill <jason@redhat.com>
586 PR c++/92531 - ICE with noexcept(lambda).
587 * pt.c (uses_template_parms): Don't try to enumerate all the
590 2020-01-17 Jakub Jelinek <jakub@redhat.com>
593 * parser.c (cp_parser_template_name): Look up deprecated attribute
594 in DECL_TEMPLATE_RESULT or its type's attributes.
596 2020-01-16 Jason Merrill <jason@redhat.com>
598 PR c++/93286 - ICE with __is_constructible and variadic template.
599 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
600 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
602 PR c++/93280 - ICE with aggregate assignment and DMI.
603 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
604 * typeck2.c (digest_nsdmi_init): Not here.
606 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
609 * cp-tree.h (is_constrained_auto): New.
610 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
611 handle concept-check expressions; take a cp_decl_specifier_seq*
613 (cp_parser_condition): Update call.
614 (cp_parser_simple_declaration): Likewise.
615 (cp_parser_placeholder_type_specifier): Correctly handle
616 concept-check expressions.
618 2020-01-15 Jason Merrill <jason@redhat.com>
621 PR c++/33799 - destroy return value if local cleanup throws.
622 * cp-tree.h (current_retval_sentinel): New macro.
623 * decl.c (start_preparsed_function): Set up cleanup for retval.
624 * typeck.c (check_return_expr): Set current_retval_sentinel.
626 PR c++/93257 - consteval void function.
627 * constexpr.c (verify_constant): Allow void_node.
629 PR c++/92871 - bad code with xvalue and GNU ?: extension.
630 * call.c (prevent_lifetime_extension): New.
631 (build_conditional_expr_1): Use it.
633 2020-01-14 Nathan Sidwell <nathan@acm.org>
636 * pt.c (retrieve_specialization): Use get_template_info, not open
640 * pt.c (retrieve_specialization): Get the TI from the decl or the
641 classtype as appropriate.
643 2020-01-14 David Malcolm <dmalcolm@redhat.com>
645 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
647 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
648 (struct named_label_hash::empty_zero_p): Likewise.
649 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
651 2020-01-14 Jason Merrill <jason@redhat.com>
653 PR c++/92590 - wrong handling of inherited default ctor.
654 * class.c (add_method): A constrained inherited ctor doesn't hide an
655 implicit derived ctor.
657 PR c++/92552 - ICE with inherited constrained default ctor.
658 * pt.c (instantiate_class_template_1): Copy
659 TYPE_HAS_USER_CONSTRUCTOR.
660 PR c++/91930 - ICE with constrained inherited default ctor.
661 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
662 for inherited constructor.
663 PR c++/92594 - ICE with inherited trivial default ctor.
664 * method.c (trivial_fn_p): Treat an inherited default constructor
665 like a normal default constructor.
667 PR c++/92594 - ICE with inherited trivial default ctor.
668 * method.c (trivial_fn_p): Treat an inherited default constructor
669 like a normal default constructor.
671 PR c++/92009 - ICE with punning of typeid.
672 * rtti.c (get_tinfo_desc): Call xref_basetypes.
673 * constexpr.c (cxx_fold_indirect_ref): Don't strip
676 2020-01-13 Jason Merrill <jason@redhat.com>
678 PR c++/92746 - ICE with noexcept of function concept check.
679 * except.c (check_noexcept_r): Handle concept-check.
681 PR c++/92582 - ICE with member template as requirement.
682 * pt.c (struct find_template_parameter_info): Add ctx_parms.
683 (any_template_parm_r): Handle TEMPLATE_DECL.
684 (find_template_parameters): Take parms instead of their depth.
685 * constraint.cc (build_parameter_mapping): Pass them.
687 PR c++/33799 - destroy return value if local cleanup throws.
688 * cp-tree.h (current_retval_sentinel): New macro.
689 * decl.c (start_preparsed_function): Set up cleanup for retval.
690 * typeck.c (check_return_expr): Set current_retval_sentinel.
692 PR c++/93238 - short right-shift with enum.
693 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
695 2020-01-10 Jason Merrill <jason@redhat.com>
697 * typeck.c (cp_build_binary_op): Restore short_shift code.
699 PR c++/93143 - incorrect tree sharing with constexpr.
700 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
701 CONSTRUCTORs are already unshared.
703 PR c++/93173 - incorrect tree sharing.
705 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
706 copy_if_shared after cp_genericize_tree.
707 * typeck2.c (split_nonconstant_init): Don't unshare here.
709 2020-01-08 Jason Merrill <jason@redhat.com>
711 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
712 TARGET_EXPR_DIRECT_INIT_P.
713 * constexpr.c (cxx_eval_constant_expression): Likewise.
715 2020-01-08 Jason Merrill <jason@redhat.com>
717 PR c++/91369 - constexpr destructor and member initializer.
718 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
719 when not preevaluating.
721 2020-01-08 Jason Merrill <jason@redhat.com>
723 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
726 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
728 * init.c (build_new): Add location_t parameter and use it throughout.
729 (build_raw_new_expr): Likewise.
730 * parser.c (cp_parser_new_expression): Pass the combined_loc.
731 * pt.c (tsubst_copy_and_build): Adjust call.
732 * cp-tree.h: Update declarations.
734 2020-01-07 Jason Merrill <jason@redhat.com>
736 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
737 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
738 explicit class visibility for a template.
740 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
742 * mangle.c (mangle_type_attribute_p): New function, split out from...
743 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
744 that contain a space.
746 2020-01-07 Jakub Jelinek <jakub@redhat.com>
749 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
750 member, initialize it to zero in ctor.
751 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
752 a heap object. Don't cache calls to functions which allocate some
753 heap objects and don't deallocate them or deallocate some heap
754 objects they didn't allocate.
756 2020-01-06 Jason Merrill <jason@redhat.com>
758 PR c++/92552 - ICE with inherited constrained default ctor.
759 * pt.c (instantiate_class_template_1): Copy
760 TYPE_HAS_USER_CONSTRUCTOR.
761 * class.c (one_inherited_ctor): Don't set it here.
763 2020-01-06 Andrew Sutton <asutton@lock3software.com>
765 PR c++/92739 - parsing requires clause with attributes.
766 * parser.c (cp_parser_constraint_requires_parens): Exclude
767 attributes as postfix expressions.
769 2020-01-05 Jakub Jelinek <jakub@redhat.com>
772 * parser.c (cp_parser_check_class_key): Disable access checks for the
774 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
775 !warn_redundant_tags.
777 2010-01-05 Jakub Jelinek <jakub@redhat.com>
780 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
781 TARGET_EXPR if it has been gimplified already.
783 2020-01-03 Jason Merrill <jason@redhat.com>
785 PR c++/93033 - incorrect tree node sharing with array init.
786 * typeck2.c (split_nonconstant_init): Unshare non-decl.
787 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
789 2020-01-02 Jason Merrill <jason@redhat.com>
791 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
794 2020-01-02 Jakub Jelinek <jakub@redhat.com>
797 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
798 has not been found, rather than error_mark_node.
800 2020-01-01 Jakub Jelinek <jakub@redhat.com>
802 Update copyright years.
804 Copyright (C) 2020 Free Software Foundation, Inc.
806 Copying and distribution of this file, with or without modification,
807 are permitted in any medium without royalty provided the copyright
808 notice and this notice are preserved.