1 2020-03-14 Jason Merrill <jason@redhat.com>
4 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
5 substituting DECL_ARGUMENTS.
7 2020-03-14 Jakub Jelinek <jakub@redhat.com>
9 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
10 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
13 2020-03-13 Patrick Palka <ppalka@redhat.com>
16 * call.c (build_over_call): Use a warning_sentinel to disable
17 warn_deprecated_decl before calling build_addr_func.
19 2020-03-12 Jakub Jelinek <jakub@redhat.com>
22 * decl.c (reshape_init_array_1): Don't unshare constructor if there
23 aren't any trailing zero elts, otherwise only unshare the first
26 2020-03-11 Jason Merrill <jason@redhat.com>
29 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
32 2020-03-11 Marek Polacek <polacek@redhat.com>
33 Jason Merrill <jason@redhat.com>
35 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
36 * constexpr.c (cref_has_const_field): New function.
37 (modifying_const_object_p): Consider a COMPONENT_REF
38 const only if any of its fields are const.
39 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
40 as readonly after its initialization has been done.
42 2020-03-10 Marek Polacek <polacek@redhat.com>
44 PR c++/94124 - wrong conversion error with non-viable overload.
45 * decl.c (reshape_init_array_1): Unshare a constructor if we
46 stripped trailing zero-initializers.
48 2020-03-10 Jason Merrill <jason@redhat.com>
51 * pt.c (maybe_instantiate_noexcept): Always update clones.
53 2020-03-10 Jason Merrill <jason@redhat.com>
56 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
58 2020-03-10 Jason Merrill <jason@redhat.com>
64 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
65 66139: Don't split_nonconstant_init. Remove pre_p parameter.
67 2020-03-09 Marek Polacek <polacek@redhat.com>
69 PR c++/92031 - bogus taking address of rvalue error.
70 PR c++/91465 - ICE with template codes in check_narrowing.
71 PR c++/93870 - wrong error when converting template non-type arg.
72 PR c++/94068 - ICE with template codes in check_narrowing.
73 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
74 in a template when not ck_identity and we're dealing with a class.
75 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
76 in a template if we need a temporary.
77 * decl.c (compute_array_index_type_loc): Remove
78 instantiate_non_dependent_expr_sfinae call. Call
79 fold_non_dependent_expr instead of maybe_constant_value.
80 (build_explicit_specifier): Don't instantiate or create a sentinel
81 before converting the expression.
82 * except.c (build_noexcept_spec): Likewise.
83 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
84 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
85 build_converted_constant_expr returned.
86 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
87 of maybe_constant_value.
89 2020-03-09 Jakub Jelinek <jakub@redhat.com>
93 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
95 * constexpr.c (cxx_eval_constant_expression): Do not handle
96 RROTATE_EXPR and LROTATE_EXPR.
98 2020-03-09 Marek Polacek <polacek@redhat.com>
100 PR c++/94050 - ABI issue with alignas on armv7hl.
101 * class.c (layout_class_type): Don't replace a class's
102 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
104 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
106 * coroutines.cc (build_actor_fn): Factor out code inserting the
107 default return_void call to...
108 (morph_fn_to_coro): ...here, also hoist local var declarations.
110 2020-03-08 Patrick Palka <ppalka@redhat.com>
113 * call.c (convert_like_real): Check complain before emitting an error
114 about binding a bit-field to a reference.
116 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
117 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
120 2020-03-06 Nathan Sidwell <nathan@acm.org>
123 * mangle.c (find_substitution): Don't call same_type_p on template
124 args that cannot match.
126 2020-03-04 Martin Sebor <msebor@redhat.com>
129 * tree.c (type_initializer_zero_p): Fail for structs initialized
132 2020-03-04 Jason Merrill <jason@redhat.com>
135 * init.c (perform_member_init): Don't do aggregate initialization of
137 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
138 initialization of empty field.
140 2020-03-04 Martin Liska <mliska@suse.cz>
142 * method.c: Wrap array in ctor with braces in order
143 to silent clang warnings.
145 2020-03-03 Jason Merrill <jason@redhat.com>
146 Marek Polacek <polacek@redhat.com>
148 PR c++/90505 - mismatch in template argument deduction.
149 * pt.c (tsubst): Don't reduce the template level of template
150 parameters when tf_partial.
152 2020-03-03 Jakub Jelinek <jakub@redhat.com>
155 * constexpr.c (cxx_eval_constant_expression)
156 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
157 *non_constant_p is true.
159 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
161 * coroutines.cc (captures_temporary): Strip component_ref
164 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
166 * coroutines.cc (finish_co_await_expr): Build co_await_expr
167 with unknown_type_node.
168 (finish_co_yield_expr): Ditto.
169 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
170 with unknown type as dependent.
172 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
174 * coroutines.cc (struct local_var_info): Adjust to remove the
175 reference to the captured var, and just to note that this is a
176 lambda capture proxy.
177 (transform_local_var_uses): Handle lambda captures specially.
178 (struct param_frame_data): Add a visited set.
179 (register_param_uses): Also check for param uses in lambda
181 (struct local_vars_frame_data): Remove captures list.
182 (register_local_var_uses): Handle lambda capture proxies by
183 noting and bypassing them.
184 (morph_fn_to_coro): Update to remove lifetime extension of
185 lambda capture-by-copy vars.
187 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
189 * coroutines.cc (build_co_await): Do not build frame
190 awaitable proxy vars when the co_await expression is
191 a function parameter or local var.
192 (co_await_expander): Do not initialise a frame var with
194 (transform_await_expr): Only substitute the awaitable
195 frame var if it's needed.
196 (register_awaits): Do not make frame copies for param
197 or local vars that are awaitables.
199 2020-02-28 Jason Merrill <jason@redhat.com>
201 Implement P2092R0, Disambiguating Nested-Requirements
202 * parser.c (cp_parser_requirement_parameter_list): Pass
203 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
205 * call.c (build_user_type_conversion_1): Don't look at the second
206 conversion of a non-viable candidate.
208 2020-02-28 Jakub Jelinek <jakub@redhat.com>
210 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
211 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
212 functions in unevaluated contexts.
214 2020-02-27 Nathan Sidwell <nathan@acm.org>
217 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
219 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
220 * typeck.c (comptypes): Assert we don't get any argument packs.
222 * class.c (adjust_clone_args): Correct arg-checking assert.
223 * typeck.c (comptypes): Assert not nulls.
225 2020-02-26 Marek Polacek <polacek@redhat.com>
227 PR c++/93789 - ICE with invalid array bounds.
228 * decl.c (compute_array_index_type_loc): Don't use the folded
229 size when folding cleared TREE_CONSTANT.
231 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
233 * class.c (classtype_has_non_deleted_copy_ctor): New.
234 * coroutines.cc (struct param_info): Keep track of params
235 that are references, and cache the original type and whether
237 (build_actor_fn): Handle param copies always, and adjust the
238 handling for references.
239 (register_param_uses): Only handle uses here.
240 (classtype_has_non_deleted_copy_ctor): New.
241 (morph_fn_to_coro): Adjust param copy handling to match n4849
242 by reordering ahead of the promise CTOR and always making a
243 frame copy, even if the param is unused in the coroutine body.
244 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
246 2020-02-26 Patrick Palka <ppalka@redhat.com>
248 * constraint.cc (finish_constraint_binary_op): Set expr's location range
249 to the range of its operands.
250 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
251 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
252 instead of the corresponding template arguments ARGS and adjust body
254 (diagnose_requires_expr): Likewise.
255 (diagnose_atomic_constraint): Likewise. When printing an atomic
256 constraint expression, print the instantiated parameter mapping
258 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
259 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
260 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
262 2020-02-26 Marek Polacek <polacek@redhat.com>
264 PR c++/93676 - value-init crash in template.
265 * init.c (build_new_1): Don't call build_vec_init in a template.
267 2020-02-26 Marek Polacek <polacek@redhat.com>
269 PR c++/93862 - ICE with static_cast when converting from int[].
270 * call.c (reference_compatible_p): No longer static.
271 * cp-tree.h (reference_compatible_p): Declare.
272 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
273 of reference_related_p.
275 2020-02-26 Marek Polacek <polacek@redhat.com>
277 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
278 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
281 2020-02-24 Martin Sebor <msebor@redhat.com>
284 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
285 in shared C/C++ code in headers.
286 Remove a duplicate hunk of code.
288 2020-02-24 Marek Polacek <polacek@redhat.com>
290 PR c++/93869 - ICE with -Wmismatched-tags.
291 * parser.c (cp_parser_check_class_key): Check class_key earlier.
293 2020-02-24 Marek Polacek <polacek@redhat.com>
295 PR c++/93712 - ICE with ill-formed array list-initialization.
296 * call.c (next_conversion): Return NULL for ck_aggr.
297 (build_aggr_conv): Set u.expr instead of u.next.
298 (build_array_conv): Likewise.
299 (build_complex_conv): Likewise.
300 (conv_get_original_expr): Handle ck_aggr.
302 2020-02-24 Jakub Jelinek <jakub@redhat.com>
304 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
305 * call.c (build_over_call): Don't evaluate immediate functions in
306 unevaluated operands.
308 2020-02-24 Jason Merrill <jason@redhat.com>
310 P0780R2: Resolve lambda init-capture pack grammar.
311 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
314 2020-02-22 Marek Polacek <polacek@redhat.com>
317 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
319 2020-02-21 Martin Sebor <msebor@redhat.com>
321 PR gcov-profile/93753
322 * class.c (check_flexarrays): Tighten up a test for potential members
323 of anonymous structs or unions.
325 2020-02-20 Martin Sebor <msebor@redhat.com>
328 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
330 2020-02-20 Martin Liska <mliska@suse.cz>
333 * config/or1k/or1k.opt: Remove superfluous word.
334 * doc/invoke.texi: Likewise.
336 2020-02-20 Martin Liska <mliska@suse.cz>
339 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
341 2020-02-19 Marek Polacek <polacek@redhat.com>
343 PR c++/93169 - wrong-code with a non-constexpr constructor.
344 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
345 on constant CONSTRUCTORs.
347 2020-02-15 Marek Polacek <polacek@redhat.com>
349 PR c++/93710 - poor diagnostic for array initializer.
350 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
353 2020-02-15 Jason Merrill <jason@redhat.com>
356 * pt.c (any_template_parm_r): Look into lambda body.
359 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
361 2020-02-14 Jakub Jelinek <jakub@redhat.com>
364 * class.c (enum_min_precision): Change prec type from int to int &.
367 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
368 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
369 (fallback_dfloat32_type, fallback_dfloat64_type,
370 fallback_dfloat128_type): Define.
371 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
373 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
374 is disabled for compatibility.
376 2020-02-13 Jason Merrill <jason@redhat.com>
379 * name-lookup.c (matching_fn_p): A function does not match a
384 * tree.c (decl_linkage): Always lk_none for locals.
386 2020-02-12 Jason Merrill <jason@redhat.com>
390 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
391 * pt.c (find_parameter_packs_r): Not here.
393 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
395 * coroutines.cc (build_actor_fn): Implement deallocation function
396 selection per n4849, dcl.fct.def.coroutine bullet 12.
397 (morph_fn_to_coro): Implement allocation function selection per
398 n4849, dcl.fct.def.coroutine bullets 9 and 10.
400 2020-02-12 Marek Polacek <polacek@redhat.com>
402 PR c++/93684 - ICE-on-invalid with broken attribute.
403 * parser.c (cp_parser_std_attribute): Peek a token first before
406 2020-02-11 Jason Merrill <jason@redhat.com>
409 * class.c (add_implicitly_declared_members): Use do_friend.
410 * method.c (implicitly_declare_fn): Fix friend handling.
411 (decl_remember_implicit_trigger_p): New.
412 (synthesize_method): Use it.
413 * decl2.c (mark_used): Use it.
415 2020-02-11 Jason Merrill <jason@redhat.com>
419 * constexpr.c (maybe_constant_value): Correct earlier change.
420 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
421 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
423 2020-02-12 Patrick Palka <ppalka@redhat.com>
427 * type-utils.h (find_type_usage): Refactor to take a tree * and to
428 return a tree *, and update documentation accordingly.
429 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
431 (make_constrained_decltype_auto): No need to explicitly set
432 AUTO_IS_DECLTYPE anymore.
433 (splice_late_return_type): Use find_type_usage to find and
434 replace a possibly nested auto node instead of using is_auto.
435 Check test for is_auto into an assert when deciding whether
437 (type_uses_auto): Adjust the call to find_type_usage.
438 * parser.c (cp_parser_decltype): No need to explicitly set
439 AUTO_IS_DECLTYPE anymore.
441 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
442 (dump_simple_decl): Handle standard concept definitions as well as
443 variable concept definitions.
445 2020-02-10 Jakub Jelinek <jakub@redhat.com>
448 * error.c (dump_decl_name): Fix up last argument to strncmp.
450 2020-02-10 Jason Merrill <jason@redhat.com>
453 * tree.c (array_of_unknown_bound_p): New.
454 * init.c (perform_member_init): Do nothing for flexible arrays.
456 2020-02-09 Jakub Jelinek <jakub@redhat.com>
459 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
460 ARRAY_TYPE, use the element type. Punt if objtype after that is not
463 2020-02-08 Jason Merrill <jason@redhat.com>
466 * expr.c (fold_for_warn): Call maybe_constant_value.
467 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
468 (maybe_constant_value): Add uid_sensitive parm.
469 (get_fundef_copy): Don't copy if it's true.
470 (cxx_eval_call_expression): Don't instantiate if it's true.
471 (cxx_eval_outermost_constant_expr): Likewise.
474 * constexpr.c (maybe_constant_value): Don't unshare if the cached
475 value is the same as the argument.
477 * typeck.c (maybe_warn_about_returning_address_of_local): Add
480 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
483 2020-02-08 Jakub Jelinek <jakub@redhat.com>
486 * constexpr.c (find_array_ctor_elt): If last element has no index,
487 for flag_checking verify all elts have no index. If i is within the
488 elts, return it directly, if it is right after the last elt, append
489 if NULL index, otherwise force indexes on all elts.
490 (cxx_eval_store_expression): Allow cep->index to be NULL.
492 2020-02-07 Marek Polacek <polacek@redhat.com>
494 PR c++/92947 - Paren init of aggregates in unevaluated context.
495 * call.c (build_new_method_call_1): Don't check
496 cp_unevaluated_operand. Check the return value of digest_init.
498 2020-02-06 Jason Merrill <jason@redhat.com>
501 * tree.c (cp_walk_subtrees): Walk into type template arguments.
502 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
503 instead of TYPE_ALIAS_P.
504 * pt.c (push_template_decl_real): Likewise.
505 (find_parameter_packs_r): Likewise. Remove dead code.
506 * error.c (find_typenames_r): Remove dead code.
508 2020-02-06 Jason Merrill <jason@redhat.com>
511 * parser.c (cp_parser_constraint_primary_expression): Do the main
512 parse non-tentatively.
514 2020-02-06 Marek Polacek <polacek@redhat.com>
516 PR c++/93597 - ICE with lambda in operator function.
517 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
519 2020-02-05 Jason Merrill <jason@redhat.com>
522 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
523 handling of TREE_CHAIN for empty pack.
525 2020-02-05 Jakub Jelinek <jakub@redhat.com>
528 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
529 prior to passing it to c_build_vec_convert.
531 2020-02-05 Marek Polacek <polacek@redhat.com>
533 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
534 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
537 2020-02-05 Jason Merrill <jason@redhat.com>
540 * decl.c (grokdeclarator): Reject field of current class type even
543 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
545 * coroutines.cc (maybe_promote_captured_temps): Increase the index
546 number for temporary variables' name.
548 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
550 * coroutines.cc (build_co_await): Call convert_from_reference
551 to wrap co_await_expr with indirect_ref which avoid
552 reference/non-reference type confusion.
554 (co_await_expander): Sink to call_expr if await_resume
555 is wrapped by indirect_ref.
557 2020-02-04 Jason Merrill <jason@redhat.com>
560 * constraint.cc (satisfy_declaration_constraints): Check return
561 value of push_tinst_level.
564 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
565 elements instead of value-initializing them.
568 * init.c (perform_member_init): Simplify.
569 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
571 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
573 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
575 * coroutines.cc (find_promise_type): Delete unused forward
577 (struct coroutine_info): Add a bool for no promise type error.
578 (coro_promise_type_found_p): Only emit the error for a missing
579 promise once in each affected coroutine.
581 2020-02-03 Jason Merrill <jason@redhat.com>
584 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
585 defer loading the value of a reference.
587 2020-02-03 Jason Merrill <jason@redhat.com>
590 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
592 [COMPONENT_REF]: A member function reference doesn't use the object
595 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
598 * coroutines.cc (struct coroutine_info): Add a bool flag to note
599 that we emitted an error for a bad function return type.
600 (get_coroutine_info): Tolerate an unset info table in case of
602 (find_coro_traits_template_decl): In case of error or if we didn't
603 find a type template, note we emitted the error and suppress
605 (find_coro_handle_template_decl): Likewise.
606 (instantiate_coro_traits): Only check for error_mark_node in the
607 return from lookup_qualified_name.
608 (coro_promise_type_found_p): Reorder initialization so that we check
609 for the traits and their usability before allocation of the info
610 table. Check for a suitable return type and emit a diagnostic for
611 here instead of relying on the lookup machinery. This allows the
612 error to have a better location, and means we can suppress multiple
614 (coro_function_valid_p): Re-check for a valid promise (and thus the
615 traits) before proceeding. Tolerate missing info as a fatal error.
617 2020-02-03 Jason Merrill <jason@redhat.com>
620 * cp-gimplify.c (predeclare_vla): New.
621 (cp_genericize_r) [NOP_EXPR]: Call it.
623 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
625 * coroutines.cc (transform_await_wrapper): Set actor funcion as
626 new context of label_decl.
627 (build_actor_fn): Fill new field of await_xform_data.
629 2020-02-02 Marek Polacek <polacek@redhat.com>
631 PR c++/93530 - ICE on invalid alignas in a template.
632 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
635 2020-01-31 Jason Merrill <jason@redhat.com>
638 * semantics.c (process_outer_var_ref): Capture VLAs even in
642 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
643 non-aggregate elements.
644 (reshape_init_array): Add first_initializer_p parm.
645 (reshape_init_r): Change first_initializer_p from bool to tree.
646 (reshape_init): Pass init to it.
649 * parser.c (cp_parser_initializer_list): Suppress location wrappers
652 2020-01-29 Jason Merrill <jason@redhat.com>
655 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
656 the expression was dependent before substitution.
658 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
660 * coroutines.cc (act_des_fn): New.
661 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
662 Access promise via actor function's frame pointer argument.
663 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
665 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
667 * coroutines.cc (co_await_expander): Handle type conversion case.
669 2020-01-29 Jason Merrill <jason@redhat.com>
674 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
675 a trailing return type.
676 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
679 2020-01-29 Marek Polacek <polacek@redhat.com>
681 PR c++/91754 - Fix template arguments comparison with class NTTP.
682 * pt.c (class_nttp_const_wrapper_p): New.
683 (template_args_equal): See through class_nttp_const_wrapper_p
686 2020-01-29 Marek Polacek <polacek@redhat.com>
688 PR c++/92948 - Fix class NTTP with template arguments.
689 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
690 converting a value-dependent expression to a class type.
691 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
692 as the result of the tsubst_copy call.
694 2020-01-29 Jakub Jelinek <jakub@redhat.com>
697 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
698 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
700 2020-01-28 Jason Merrill <jason@redhat.com>
703 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
707 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
710 * call.c (build_user_type_conversion_1): Allow a template conversion
711 returning an rvalue reference to bind directly to an lvalue.
714 * decl.c (grokdeclarator): Propagate eh spec from typedef.
716 2020-01-28 Martin Liska <mliska@suse.cz>
719 * pt.c (redeclare_class_template): Group couple of
720 errors and inform messages with auto_diagnostic_group.
722 2020-01-28 Martin Liska <mliska@suse.cz>
725 * pt.c (redeclare_class_template): Use inform
726 for the second location.
728 2020-01-27 Jason Merrill <jason@redhat.com>
731 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
733 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
736 * coroutines.cc (morph_fn_to_coro): Check the ramp return
737 value when it is constructed from the 'get return object'.
739 2020-01-27 Nathan Sidwell <nathan@acm.org>
742 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
744 2020-01-26 Jason Merrill <jason@redhat.com>
747 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
748 temporarily enable -Wsystem-headers. Change second warning to
752 * semantics.c (finish_call_expr): Don't call
753 instantiate_non_dependent_expr before warn_for_memset.
755 2020-01-25 Marek Polacek <polacek@redhat.com>
757 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
758 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
759 dynamic_cast diagnostic.
761 2020-01-24 Jason Merrill <jason@redhat.com>
763 PR c++/93400 - ICE with constrained friend.
764 * constraint.cc (maybe_substitute_reqs_for): New.
765 * decl.c (function_requirements_equivalent_p): Call it.
766 * pt.c (tsubst_friend_function): Only substitute
767 TEMPLATE_PARMS_CONSTRAINTS.
768 (tsubst_template_parms): Copy constraints.
770 2020-01-24 Jason Merrill <jason@redhat.com>
772 PR c++/93279 - ICE with lambda in member operator.
773 * name-lookup.c (maybe_save_operator_binding): Don't remember
774 class-scope bindings.
776 2020-01-24 Jason Merrill <jason@redhat.com>
778 PR c++/93377 - ICE with member alias in constraint.
779 * pt.c (any_template_parm_r): Look at template arguments for all
780 aliases, not only alias templates.
782 2020-01-24 Marek Polacek <polacek@redhat.com>
784 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
785 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
787 2020-01-24 Jason Merrill <jason@redhat.com>
789 PR c++/92852 - ICE with generic lambda and reference var.
790 * constexpr.c (maybe_constant_value): Likewise.
792 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
795 * parser.c (cp_parser_nested_name_specifier_opt): Properly
796 diagnose concept-ids.
798 2020-01-23 Jason Merrill <jason@redhat.com>
800 PR c++/93331 - ICE with __builtin_strchr.
801 * constexpr.c (cxx_eval_builtin_function_call): Use the original
802 argument if we didn't manage to extract a STRING_CST.
804 PR c++/93345 - ICE with defaulted dtor and template.
806 * decl.c (cxx_maybe_build_cleanup): Don't try to set
807 throwing_cleanup in a template.
809 2020-01-22 Marek Polacek <polacek@redhat.com>
811 PR c++/92907 - noexcept does not consider "const" in member functions.
812 * g++.dg/cpp0x/noexcept56.C: New test.
814 2020-01-22 Marek Polacek <polacek@redhat.com>
816 PR c++/93324 - ICE with -Wall on constexpr if.
817 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
819 2020-01-22 Patrick Palka <ppalka@redhat.com>
821 * constraint.cc (get_mapped_args): Avoid using auto_vec
822 as a vector element. Release the vectors inside the lists
824 * parser.c (cp_literal_operator_id): Free the buffer.
826 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
828 * coroutines.cc (finish_co_await_expr): Add error check on return
829 value of build_co_await.
830 (finish_co_yield_expr,): Ditto.
832 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
834 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
835 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
836 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
838 2020-01-21 Jason Merrill <jason@redhat.com>
840 PR c++/60855 - ICE with sizeof VLA capture.
841 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
843 PR c++/90732 - ICE with VLA capture and generic lambda.
844 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
846 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
847 Bin Cheng <bin.cheng@linux.alibaba.com>
849 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
850 from complete_type_or_else.
851 (register_param_uses): Likewise.
852 (build_co_await): Do not try to use complete_type_or_else for void
853 types, otherwise for incomplete types, check for NULL return from
854 complete_type_or_else.
856 2020-01-21 Jason Merrill <jason@redhat.com>
858 PR c++/91476 - anon-namespace reference temp clash between TUs.
859 * decl2.c (copy_linkage): Factor out of get_guard.
860 * call.c (make_temporary_var_for_ref_to_temp): Use it.
861 * decl.c (cp_finish_decomp): Use it.
862 (cp_finish_decl): determine_visibility sooner.
864 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
866 * coroutines.cc (finish_co_await_expr): Set return value flag.
867 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
869 2020-01-19 Jason Merrill <jason@redhat.com>
871 PR c++/33799 - destroy return value, take 2.
872 * cp-tree.h (current_retval_sentinel): New macro.
873 (struct language_function): Add throwing_cleanup bitfield.
874 * decl.c (cxx_maybe_build_cleanup): Set it.
875 * except.c (maybe_set_retval_sentinel)
876 (maybe_splice_retval_cleanup): New functions.
877 * parser.c (cp_parser_compound_statement): Call
878 maybe_splice_retval_cleanup.
879 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
881 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
883 2020-01-18 Jakub Jelinek <jakub@redhat.com>
885 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
886 but non-NO_DOLLAR_IN_LABEL case build.
888 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
890 * Make-lang.in: Add coroutines.o.
891 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
892 (DECL_COROUTINE_P): New.
893 * lex.c (init_reswords): Enable keywords when the coroutine flag
895 * operators.def (co_await): New operator.
896 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
897 (op_error): Likewise.
898 (build_new_op_1): Likewise.
899 (build_new_function_call): Validate coroutine builtin arguments.
900 * constexpr.c (potential_constant_expression_1): Handle
901 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
902 * coroutines.cc: New file.
903 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
904 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
905 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
906 * cp-tree.h (coro_validate_builtin_call): New.
907 * decl.c (emit_coro_helper): New.
908 (finish_function): Handle the case when a function is found to
909 be a coroutine, perform the outlining and emit the outlined
910 functions. Set a bit to signal that this is a coroutine component.
911 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
912 (cp_parser_unary_expression): Handle co_await.
913 (cp_parser_assignment_expression): Handle co_yield.
914 (cp_parser_statement): Handle RID_CO_RETURN.
915 (cp_parser_jump_statement): Handle co_return.
916 (cp_parser_operator): Handle co_await operator.
917 (cp_parser_yield_expression): New.
918 (cp_parser_required_error): Handle RT_CO_YIELD.
919 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
920 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
922 * tree.c (cp_walk_subtrees): Likewise.
924 2020-01-17 Jason Merrill <jason@redhat.com>
926 PR c++/92531 - ICE with noexcept(lambda).
927 * pt.c (uses_template_parms): Don't try to enumerate all the
930 2020-01-17 Jakub Jelinek <jakub@redhat.com>
933 * parser.c (cp_parser_template_name): Look up deprecated attribute
934 in DECL_TEMPLATE_RESULT or its type's attributes.
936 2020-01-16 Jason Merrill <jason@redhat.com>
938 PR c++/93286 - ICE with __is_constructible and variadic template.
939 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
940 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
942 PR c++/93280 - ICE with aggregate assignment and DMI.
943 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
944 * typeck2.c (digest_nsdmi_init): Not here.
946 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
949 * cp-tree.h (is_constrained_auto): New.
950 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
951 handle concept-check expressions; take a cp_decl_specifier_seq*
953 (cp_parser_condition): Update call.
954 (cp_parser_simple_declaration): Likewise.
955 (cp_parser_placeholder_type_specifier): Correctly handle
956 concept-check expressions.
958 2020-01-15 Jason Merrill <jason@redhat.com>
961 PR c++/33799 - destroy return value if local cleanup throws.
962 * cp-tree.h (current_retval_sentinel): New macro.
963 * decl.c (start_preparsed_function): Set up cleanup for retval.
964 * typeck.c (check_return_expr): Set current_retval_sentinel.
966 PR c++/93257 - consteval void function.
967 * constexpr.c (verify_constant): Allow void_node.
969 PR c++/92871 - bad code with xvalue and GNU ?: extension.
970 * call.c (prevent_lifetime_extension): New.
971 (build_conditional_expr_1): Use it.
973 2020-01-14 Nathan Sidwell <nathan@acm.org>
976 * pt.c (retrieve_specialization): Use get_template_info, not open
980 * pt.c (retrieve_specialization): Get the TI from the decl or the
981 classtype as appropriate.
983 2020-01-14 David Malcolm <dmalcolm@redhat.com>
985 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
987 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
988 (struct named_label_hash::empty_zero_p): Likewise.
989 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
991 2020-01-14 Jason Merrill <jason@redhat.com>
993 PR c++/92590 - wrong handling of inherited default ctor.
994 * class.c (add_method): A constrained inherited ctor doesn't hide an
995 implicit derived ctor.
997 PR c++/92552 - ICE with inherited constrained default ctor.
998 * pt.c (instantiate_class_template_1): Copy
999 TYPE_HAS_USER_CONSTRUCTOR.
1000 PR c++/91930 - ICE with constrained inherited default ctor.
1001 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
1002 for inherited constructor.
1003 PR c++/92594 - ICE with inherited trivial default ctor.
1004 * method.c (trivial_fn_p): Treat an inherited default constructor
1005 like a normal default constructor.
1007 PR c++/92594 - ICE with inherited trivial default ctor.
1008 * method.c (trivial_fn_p): Treat an inherited default constructor
1009 like a normal default constructor.
1011 PR c++/92009 - ICE with punning of typeid.
1012 * rtti.c (get_tinfo_desc): Call xref_basetypes.
1013 * constexpr.c (cxx_fold_indirect_ref): Don't strip
1016 2020-01-13 Jason Merrill <jason@redhat.com>
1018 PR c++/92746 - ICE with noexcept of function concept check.
1019 * except.c (check_noexcept_r): Handle concept-check.
1021 PR c++/92582 - ICE with member template as requirement.
1022 * pt.c (struct find_template_parameter_info): Add ctx_parms.
1023 (any_template_parm_r): Handle TEMPLATE_DECL.
1024 (find_template_parameters): Take parms instead of their depth.
1025 * constraint.cc (build_parameter_mapping): Pass them.
1027 PR c++/33799 - destroy return value if local cleanup throws.
1028 * cp-tree.h (current_retval_sentinel): New macro.
1029 * decl.c (start_preparsed_function): Set up cleanup for retval.
1030 * typeck.c (check_return_expr): Set current_retval_sentinel.
1032 PR c++/93238 - short right-shift with enum.
1033 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
1035 2020-01-10 Jason Merrill <jason@redhat.com>
1037 * typeck.c (cp_build_binary_op): Restore short_shift code.
1039 PR c++/93143 - incorrect tree sharing with constexpr.
1040 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
1041 CONSTRUCTORs are already unshared.
1043 PR c++/93173 - incorrect tree sharing.
1045 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
1046 copy_if_shared after cp_genericize_tree.
1047 * typeck2.c (split_nonconstant_init): Don't unshare here.
1049 2020-01-08 Jason Merrill <jason@redhat.com>
1051 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
1052 TARGET_EXPR_DIRECT_INIT_P.
1053 * constexpr.c (cxx_eval_constant_expression): Likewise.
1055 2020-01-08 Jason Merrill <jason@redhat.com>
1057 PR c++/91369 - constexpr destructor and member initializer.
1058 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
1059 when not preevaluating.
1061 2020-01-08 Jason Merrill <jason@redhat.com>
1063 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
1066 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
1068 * init.c (build_new): Add location_t parameter and use it throughout.
1069 (build_raw_new_expr): Likewise.
1070 * parser.c (cp_parser_new_expression): Pass the combined_loc.
1071 * pt.c (tsubst_copy_and_build): Adjust call.
1072 * cp-tree.h: Update declarations.
1074 2020-01-07 Jason Merrill <jason@redhat.com>
1076 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
1077 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
1078 explicit class visibility for a template.
1080 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
1082 * mangle.c (mangle_type_attribute_p): New function, split out from...
1083 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
1084 that contain a space.
1086 2020-01-07 Jakub Jelinek <jakub@redhat.com>
1089 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
1090 member, initialize it to zero in ctor.
1091 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
1092 a heap object. Don't cache calls to functions which allocate some
1093 heap objects and don't deallocate them or deallocate some heap
1094 objects they didn't allocate.
1096 2020-01-06 Jason Merrill <jason@redhat.com>
1098 PR c++/92552 - ICE with inherited constrained default ctor.
1099 * pt.c (instantiate_class_template_1): Copy
1100 TYPE_HAS_USER_CONSTRUCTOR.
1101 * class.c (one_inherited_ctor): Don't set it here.
1103 2020-01-06 Andrew Sutton <asutton@lock3software.com>
1105 PR c++/92739 - parsing requires clause with attributes.
1106 * parser.c (cp_parser_constraint_requires_parens): Exclude
1107 attributes as postfix expressions.
1109 2020-01-05 Jakub Jelinek <jakub@redhat.com>
1112 * parser.c (cp_parser_check_class_key): Disable access checks for the
1114 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
1115 !warn_redundant_tags.
1117 2010-01-05 Jakub Jelinek <jakub@redhat.com>
1120 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
1121 TARGET_EXPR if it has been gimplified already.
1123 2020-01-03 Jason Merrill <jason@redhat.com>
1125 PR c++/93033 - incorrect tree node sharing with array init.
1126 * typeck2.c (split_nonconstant_init): Unshare non-decl.
1127 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
1129 2020-01-02 Jason Merrill <jason@redhat.com>
1131 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
1134 2020-01-02 Jakub Jelinek <jakub@redhat.com>
1137 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
1138 has not been found, rather than error_mark_node.
1140 2020-01-01 Jakub Jelinek <jakub@redhat.com>
1142 Update copyright years.
1144 Copyright (C) 2020 Free Software Foundation, Inc.
1146 Copying and distribution of this file, with or without modification,
1147 are permitted in any medium without royalty provided the copyright
1148 notice and this notice are preserved.