1 2020-07-30 Patrick Palka <ppalka@redhat.com>
4 * pt.c (resolve_overloaded_unification): If the function
5 template specialization has a placeholder return type,
6 then instantiate it before attempting unification.
8 2020-07-30 Patrick Palka <ppalka@redhat.com>
11 * pt.c (alias_ctad_tweaks): Call remove_constraints before
12 calling set_constraints.
14 2020-07-30 Patrick Palka <ppalka@redhat.com>
17 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P
18 from the original TEMPLATE_PARM_DECL to the new lowered one.
20 2020-07-30 Patrick Palka <ppalka@redhat.com>
23 * constraint.cc (constraints_satisfied_p): Return true if
25 * pt.c (do_type_instantiation): Update a paragraph taken from
26 [temp.explicit] to reflect the latest specification. Don't
27 instantiate a member with unsatisfied constraints.
29 2020-07-29 Jason Merrill <jason@redhat.com>
32 * cp-tree.h (IMPLICIT_RVALUE_P): New.
33 (enum cp_lvalue_kind_flags): Add clk_implicit_rval.
34 (implicit_rvalue_p, set_implicit_rvalue_p): New.
35 * call.c (reference_binding): Check clk_implicit_rval.
36 (build_over_call): Adjust C++20 implicit move.
37 * coroutines.cc (finish_co_return_stmt): Simplify implicit move.
38 * except.c (build_throw): Adjust C++20 implicit move.
39 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Propagate
41 * tree.c (lvalue_kind): Set clk_implicit_rval.
42 * typeck.c (treat_lvalue_as_rvalue_p): Overhaul.
43 (maybe_warn_pessimizing_move): Adjust.
44 (check_return_expr): Adjust C++20 implicit move.
46 2020-07-29 Jason Merrill <jason@redhat.com>
49 * call.c (build_over_call): Don't call a const ref
50 overload for implicit move.
52 2020-07-28 Nathan Sidwell <nathan@acm.org>
54 * cp-gimplify.c (cp_genericize_r): Set IMPORTED_DECL's context.
55 * cp-objcp-common.c (cp_pushdecl): Set decl's context.
56 * decl.c (grokfndecl): Make DECL_CONTEXT setting clearer.
58 2020-07-28 Nathan Sidwell <nathan@acm.org>
60 * class.c (fixup_type_variants): Copy TYPE_SIZE and
62 (finish_struct): Call it.
64 2020-07-28 Nathan Sidwell <nathan@acm.org>
66 * ptree.c (cxx_print_decl): Better indentation.
68 2020-07-28 Jakub Jelinek <jakub@redhat.com>
69 Mark Wielaard <mark@klomp.org>
72 * parser.c (cp_lexer_safe_previous_token): Don't call
73 cp_lexer_previous_token, instead inline it by hand and return NULL
74 instead of failing assertion if all previous tokens until the first
76 (cp_parser_error_1): Optimize - only call cp_lexer_safe_previous_token
77 if token->type is CPP_NAME. Use cp_lexer_safe_previous_token instead
78 of cp_lexer_previous_token for the missing_token_desc != RT_NONE
81 2020-07-27 Nathan Sidwell <nathan@acm.org>
83 * cp-tree.h (enum cp_tree_index): Add CPTI_AS_BASE_IDENTIFIER.
84 (as_base_identifier): Define.
85 * decl.c (initialize_predifined_identifiers): Initialize as_base
87 * class.c (layout_class_type): Name the as-base type. Zap
88 NSDMI its fields may have.
90 2020-07-22 Nathan Sidwell <nathan@acm.org>
92 * class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
94 2020-07-22 Nathan Sidwell <nathan@acm.org>
96 * typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
98 [UNDERLYING_TYPE]: Use an if.
101 2020-07-22 Nathan Sidwell <nathan@acm.org>
103 * decl.c (decls_match): Move variables into scopes
105 (duplicate_decls): Use STRIP_TEMPLATE.
106 (build_typename_type): Move var decls to their assignments.
107 (begin_function_body): Likewise.
108 * decl2.c (get_guard): Likewise.
109 (mark_used): Use true for truthiness.
110 * error.c (dump_aggr_type): Hold the decl in a var called
113 2020-07-22 Nathan Sidwell <nathan@acm.org>
115 * cp-tree.h (struct tree_lambda_expr): Shrink
116 default_capture_mode & discriminator.
118 2020-07-22 Nathan Sidwell <nathan@acm.org>
120 * mangle.c (decl_is_template_id): Rename to ...
121 (maybe_template_info): ... here. Return the template info,
122 rather than use a pointer. Adjust all callers.
123 (find_substitution): Use template_args_equal, rather than
126 2020-07-22 Tobias Burnus <tobias@codesourcery.com>
128 * parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
129 (cp_parser_omp_critical): Permit hint(0) clause without named critical.
130 * pt.c (tsubst_expr): Re-check the latter for templates.
132 2020-07-21 Sunil K Pandey <skpgkp2@gmail.com>
135 * decl.c (cp_finish_decl): Call target hook
136 lower_local_decl_alignment to lower local decl alignment.
138 2020-07-21 Nathan Sidwell <nathan@acm.org>
140 * parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
141 (cp_parser_skip_to_closing_parenthesis_1): Only pass start token
142 to pragma skipper if recovering.
143 (cp_parser_skip_to_pragma_eol): Only purge and change pragma
144 state when recovering.
146 2020-07-20 Jason Merrill <jason@redhat.com>
148 * pt.c (type_dependent_expression_p): A pseudo-dtor can be
150 * semantics.c (finish_call_expr): Use build_trivial_dtor_call for
152 (finish_pseudo_destructor_expr): Leave type NULL for dependent arg.
154 2020-07-20 Jason Merrill <jason@redhat.com>
156 * mangle.c (write_base_ref): New.
157 (write_expression): Use it for base field COMPONENT_REFs.
158 * pt.c (invalid_tparm_referent_p): Canonicalize the type
159 of array offsets. Allow subobjects.
161 2020-07-20 Jason Merrill <jason@redhat.com>
163 * pt.c (collect_ctor_idx_types): Add 'const' when deducing from
166 2020-07-17 Marek Polacek <polacek@redhat.com>
169 * decl.c (grokdeclarator): Detect cv-qual decltype(auto).
170 * pt.c (do_auto_deduction): Likewise.
172 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
179 * coroutines.cc (struct coro_ret_data): Delete.
180 (coro_maybe_expand_co_return): Delete.
181 (co_return_expander): Delete.
182 (expand_co_returns): Delete.
183 (co_await_find_in_subtree): Remove unused name.
184 (build_actor_fn): Remove unused parm, remove handling
185 for co_return expansion.
186 (register_await_info): Demote duplicate info message to a
188 (coro_make_frame_entry): Move closer to use site.
189 (struct susp_frame_data): Add fields for final suspend label
190 and a flag to indicate await expressions with initializers.
191 (captures_temporary): Delete.
192 (register_awaits): Remove unused code, update comments.
193 (find_any_await): New.
194 (tmp_target_expr_p): New.
195 (struct interesting): New.
196 (find_interesting_subtree): New.
197 (struct var_nest_node): New.
198 (flatten_await_stmt): New.
199 (handle_nested_conditionals): New.
200 (process_conditional): New.
201 (replace_statement_captures): Rename to...
202 (maybe_promote_temps): ... this.
203 (maybe_promote_captured_temps): Delete.
204 (analyze_expression_awaits): Check for await expressions with
205 initializers. Simplify handling for truth-and/or-if.
206 (expand_one_truth_if): Simplify (map cases that need expansion
208 (await_statement_walker): Handle CO_RETURN_EXPR. Simplify the
209 handling for truth-and/or-if expressions.
210 (register_local_var_uses): Ensure that we create names in the
211 implementation namespace.
212 (morph_fn_to_coro): Add final suspend label to suspend frame
213 callback data and remove it from the build_actor_fn call.
215 2020-07-16 Marek Polacek <polacek@redhat.com>
217 * call.c (convert_like): Remove macro and introduce a new
219 (convert_like_with_context): Likewise.
220 (convert_like_real): Rename to convert_like.
221 (convert_like_real_1): Rename to convert_like_internal. Call
222 convert_like instead of convert_like_real therein.
223 (perform_direct_initialization_if_possible): Call convert_like
224 instead of convert_like_real.
226 2020-07-16 Iain Sandoe <iain@sandoe.co.uk>
228 * coroutines.cc: Correct some spelling errors
231 2020-07-15 Nathan Sidwell <nathan@acm.org>
233 * parser.c (cp_parser_declaration): Avoid copying tokens.
234 (cp_parser_block_declaration): RAII token pointer.
236 2020-07-15 Nathan Sidwell <nathan@acm.org>
238 * parser.c (cp_parser_skip_to_closing_parenthesis_1): Deal with
239 meeting a deferred pragma.
240 (cp_parser_skip_to_end_of_statement): Likewise.
241 (cp_parser_skip_to_end_of_block_or_statement): Likewise.
242 (cp_parser_skip_to_pragma_eol): We should never meet EOF.
243 (cp_parser_omp_declare_simd): Likewise.
244 (cp_parser_omp_declare_reduction, cp_parser_oacc_routine)
245 (pragma_lex): Likewise.
247 2020-07-14 Marek Polacek <polacek@redhat.com>
252 * call.c (convert_like_real_1): Renamed from convert_like_real.
253 (convert_like_real): New wrapper for convert_like_real_1.
255 2020-07-14 Nathan Sidwell <nathan@acm.org>
257 * parser.c (cp_lexer_alloc): Do not deal with PCH here.
258 (cp_lexer_new_main): Deal with PCH here. Store the tokens directly
260 (cp_lexer_new_from_tokens): Assert last token isn't purged either.
261 (cp_lexer_get_preprocessor_token): Change first arg to flags, adjust.
262 (cp_parser_new): Pass the lexer in, don't create it here.
263 (cp_parser_translation_unit): Initialize access checks here.
264 (cp_parser_initial_pragma): First token is provided by caller,
265 don't deal with PCH stopping here. Adjust error message.
266 (c_parse_file): Adjust, change error message to avoid C++20 module
269 2020-07-14 Nathan Sidwell <nathan@acm.org>
271 * ptree.c (cxx_print_type): Add TYPEOF_TYPE and BASES.
273 2020-07-14 Nathan Sidwell <nathan@acm.org>
275 * class.c (build_base_field_1): Cache CLASSTYPE_AS_BASE.
276 (build_self_reference): Rename value -> decl.
277 (dump_class_hierarchy_1): Cache CLASSTYPE_AS_BASE.
279 2020-07-14 Marek Polacek <polacek@redhat.com>
282 * decl.c (grokdeclarator) <case cdk_function>: Check also
283 pointers/references/... to functions.
285 2020-07-14 Nathan Sidwell <nathan@acm.org>
287 * cp-tree.h: Correct some tree lang flag comments,
288 reformat some structure definitions. Note some structure
289 sizes. Clarify some comments.
290 (yyungetc): Delete. Not been a thing for some time.
291 * class.c (copy_fndecl_with_name): Comment.
292 (check_bases_and_members): Unnecessary {}.
293 (layout_class_type): Comment.
294 * cp-tree.def (UNBOUND_CLASS_TEMPLATE): Adjust comment.
295 * decl.c: Fix some formatting & whitespace issues.
296 (function_requirements_equivalent_p): Note why
297 substitutions are needed.
298 * decl2.c (no_linkage_error): Note that heroics about
299 'typedef struct { ... };' are no longer needed.
300 * method.c: Whitespace.
301 * name-lookup.c: Whitespace.
302 (add_decl_to_level): Reformat a line.
303 (print_binding_stack): Mark as DEBUG_FUNCTION.
304 (has_using_namespace_std_directive_p): Delete comment.
306 * ptree.c: Whitespace.
307 * rtti.c: Whitespace & comment.
309 * typeck.c (structural_comptypes): Add comment.
311 2020-07-13 Nathan Sidwell <nathan@acm.org>
313 * Make-lang.in (c++.disclean): Likewise.
315 2020-07-13 Marek Polacek <polacek@redhat.com>
318 * parser.c (cp_parser_enum_specifier): Commit to tentative parse
319 after we've seen an opening brace.
321 2020-07-10 Jason Merrill <jason@redhat.com>
323 * tree.c (structural_type_p): Allow unions.
324 * mangle.c (write_expression): Express unions with a designator.
326 2020-07-10 Jason Merrill <jason@redhat.com>
328 * pt.c (convert_nontype_argument): Handle REAL_TYPE.
329 (invalid_nontype_parm_type_p): Allow all structural types.
330 * tree.c (structural_type_p): Use SCALAR_TYPE_P.
332 2020-07-10 Jason Merrill <jason@redhat.com>
337 * class.c (check_field_decls): An array of empty classes is not an
339 (layout_empty_base_or_field): Handle explicit alignment.
342 2020-07-09 Julian Brown <julian@codesourcery.com>
343 Thomas Schwinge <thomas@codesourcery.com>
346 * semantics.c (finish_omp_clauses): Likewise.
348 2020-07-09 Patrick Palka <ppalka@redhat.com>
351 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
352 Restore dependent_type_p check that guarded the call to
353 is_really_empty_class.
355 2020-07-08 Patrick Palka <ppalka@redhat.com>
358 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>:
359 When processing_template_decl, check COMPLETE_TYPE_P before
360 calling is_really_empty_class. Don't check dependent_type_p.
362 2020-07-08 Marek Polacek <polacek@redhat.com>
365 * parser.c (cp_parser_decltype): Print error about using decltype(auto)
366 in C++11. Check that the token following "auto" is ")".
368 2020-07-07 Patrick Palka <ppalka@redhat.com>
371 * cxx-pretty-print.c (pp_cxx_unqualified_id): Check
372 PRIMARY_TEMPLATE_P before printing the innermost template
375 2020-07-07 Martin Sebor <msebor@redhat.com>
378 * parser.c (class_decl_loc_t::diag_mismatched_tags): Print notes only
379 if warning_at returns nonzero.
381 2020-07-06 Martin Sebor <msebor@redhat.com>
384 * call.c (build_over_call): Check calls only when tf_warning is set.
386 2020-07-06 Nathan Sidwell <nathan@acm.org>
388 * decl.c (push_library_fn): Return the decl pushdecl_toplevel returns.
389 * except.c (verify_library_fn): Replace with ...
390 (declare_library_fn_1): ... this fn. Always push the fn.
391 (declare_library_fn): Call it.
392 (build_throw): Call declare_library_fn_1.
394 2020-07-06 Jonathan Wakely <jwakely@redhat.com>
397 * parser.c (cp_parser_toplevel_declaration): Only do pedwarn for
398 empty-declaration in C++98.
400 2020-07-02 Jason Merrill <jason@redhat.com>
401 Jakub Jelinek <jakub@redhat.com>
403 * decl.c (grokfndecl): Allow consteval virtual.
404 * search.c (check_final_overrider): Check consteval mismatch.
405 * constexpr.c (cxx_eval_thunk_call): New.
406 (cxx_eval_call_expression): Call it.
407 * cvt.c (cp_get_fndecl_from_callee): Handle FDESC_EXPR.
408 * decl2.c (mark_vtable_entries): Track vtables with consteval.
409 (maybe_emit_vtables): Pass consteval_vtables through.
410 (clear_consteval_vfns): Replace consteval with nullptr.
411 (c_parse_final_cleanups): Call it.
413 2020-07-01 Nathan Sidwell <nathan@acm.org>
415 * class.c (copy_fndecl_with_name): Add additional predicate args, do
416 not deduce them locally.
417 (copy_operator_fn): Adjust copy_fndecl_with_name call.
418 (build_clone): Add vtt and inherited predicate args. Pass through
419 to copy_fndecl_with_name call.
420 (build_cdtor_clones): Likewise, pass through to build_clone as
422 (build_cdtor): Determine vtt and inherited here.
423 * cp-tree.h (DECL_NEEDS_CTT_PARM_P): Delete.
425 2020-06-30 Nathan Sidwell <nathan@acm.org>
427 * cp-tree.h (copy_fndecl_with_name): Rename to ...
428 (copy_operatorn_fn): ... this. Change arg type.
429 (clone_function_decl): Rename to ...
430 (clone_cdtor): ... this.
431 * class.c (copy_fndecl_with_name): Make static.
432 (copy_operator_fn): New wrapper.
433 (build_clones): Rename to ...
434 (build_cdtor_clones): ... this.
435 (clone_function_decl): Rename to ...
436 (clone_cdtor): ... this. Adjust build_clones calls.
437 (clone_constructors_and_destructors): Adjust clone_function_decl
439 * method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
441 (lazily_declare_fn): Adjust clone_function_decl call.
442 * pt.c (tsubst_function_decl): Likewise.
443 (instantiate_template_1): Likewise.
445 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
447 * coroutines.cc (morph_fn_to_coro): Remove trailing
448 space in a diagnostic.
450 2020-06-30 Iain Sandoe <iain@sandoe.co.uk>
452 * coroutines.cc (expand_one_await_expression): Remove
453 code dealing with initial suspend.
454 (build_actor_fn): Remove code special-casing initial
455 and final suspend. Handle the final suspend and marking
456 of the coroutine as done.
457 (coro_rewrite_function_body): New.
458 (bind_expr_find_in_subtree): Remove.
459 (coro_body_contains_bind_expr_p): Remove.
460 (morph_fn_to_coro): Split the rewrite of the original
461 function into coro_rewrite_function_body and call it.
463 2020-06-29 Marek Polacek <polacek@redhat.com>
466 * decl.c (duplicate_decls): Make sure a concept or a variable
467 template is unique in its declarative region.
469 2020-06-29 Marek Polacek <polacek@redhat.com>
472 * pt.c (collect_ctor_idx_types): Use TREE_TYPE.
474 2020-06-28 Iain Sandoe <iain@sandoe.co.uk>
477 * coroutines.cc (register_local_var_uses): Skip past
480 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
483 * coroutines.cc (get_awaitable_var): New helper.
484 (build_co_await): Check more carefully before
485 copying an awaitable.
486 (expand_one_await_expression): No initializer
487 is required when the awaitable is not a temp.
488 (register_awaits): Remove handling that is now
489 completed when the await expression is built.
491 2020-06-27 Iain Sandoe <iain@sandoe.co.uk>
493 * coroutines.cc (morph_fn_to_coro): Diagnose unavailable
494 get_return_object_on_allocation_failure.
496 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
499 * coroutines.cc (struct coroutine_info):Add a field
500 to hold computed p.return_void expressions.
501 (coro_build_promise_expression): New.
502 (get_coroutine_return_void_expr): New.
503 (finish_co_yield_expr): Build the promise expression
504 using coro_build_promise_expression.
505 (finish_co_return_stmt): Likewise.
506 (build_init_or_final_await): Likewise.
507 (morph_fn_to_coro): Likewise, for several cases.
509 2020-06-26 Iain Sandoe <iain@sandoe.co.uk>
511 * coroutines.cc (morph_fn_to_coro): Handle error
512 returns in building g-r-o-o-a-f expressions.
514 2020-06-24 Nicholas Krause <xerofoify@gmail.com>
517 * typeck2.c (cxx_incomplete_type_diagnostic): Add missing
518 TYPE_EXPANSION_PACK check for diagnosing incomplete types in
519 cxx_incomplete_type_diagnostic.
521 2020-06-24 Iain Sandoe <iain@sandoe.co.uk>
525 * coroutines.cc (act_des_fn): Copy function
526 attributes onto the outlined coroutine helpers.
528 2020-06-24 Jason Merrill <jason@redhat.com>
530 * call.c (build_over_call): Only call build_base_path once.
532 2020-06-24 Jason Merrill <jason@redhat.com>
535 * call.c (build_over_call): Look up the overrider in base_binfo.
536 * class.c (lookup_vfn_in_binfo): Look through BINFO_PRIMARY_P.
538 2020-06-23 Jason Merrill <jason@redhat.com>
541 Implement C++20 P2082R1, Fixing CTAD for aggregates.
542 * cp-tree.h (TPARMS_PRIMARY_TEMPLATE): Split out from...
543 (DECL_PRIMARY_TEMPLATE): ...here.
544 (builtin_guide_p): Declare.
545 * decl.c (reshape_init_class): Handle bases of a template.
546 (reshape_init_r): An array with dependent bound takes a single
548 * pt.c (tsubst_default_argument): Shortcut {}.
549 (unify_pack_expansion): Allow omitted arguments to trailing pack.
550 (builtin_guide_p): New.
551 (collect_ctor_idx_types): Give a trailing pack a {} default
552 argument. Handle arrays better.
554 2020-06-23 Iain Sandoe <iain@sandoe.co.uk>
557 * coroutines.cc (morph_fn_to_coro): Apply a cleanup to
558 the get return object when the DTOR is non-trivial.
560 2020-06-20 Iain Sandoe <iain@sandoe.co.uk>
563 * coroutines.cc (morph_fn_to_coro): Update handling of
564 get-return-object-on-allocation-fail and diagnose missing
567 2020-06-20 Jason Merrill <jason@redhat.com>
569 * call.c (joust): Only compare constraints for non-template
570 candidates with matching parameters.
571 * pt.c (tsubst_pack_expansion): Fix getting a type parameter
573 (more_specialized_fn): Only compare constraints for candidates with
576 2020-06-19 Jason Merrill <jason@redhat.com>
578 * method.c (early_check_defaulted_comparison): Allow defaulting
579 comparison outside class. Complain if non-member operator isn't a
582 2020-06-18 Jason Merrill <jason@redhat.com>
584 * method.c (early_check_defaulted_comparison): Check for &&.
585 (build_comparison_op): Allow empty union. Diagnose non-category
587 (common_comparison_type): Remove handling for non-category type.
589 2020-06-18 Marek Polacek <polacek@redhat.com>
592 * pt.c (finish_template_variable): Return if
593 coerce_innermost_template_parms return error_mark_node.
595 2020-06-18 Marek Polacek <polacek@redhat.com>
598 * pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
599 if placement is erroneous.
601 2020-06-17 Jonathan Wakely <jwakely@redhat.com>
604 * parser.c (cp_parser_elaborated_type_specifier): Do not warn
605 unless in a declaration.
607 2020-06-17 Jason Merrill <jason@redhat.com>
609 * cp-tree.h (copy_fndecl_with_name): Declare.
610 * class.c (copy_fndecl_with_name): Split out from...
611 (build_clone): ...here.
612 (add_implicitly_declared_members): Add op== to TYPE_FIELDS.
613 * method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
615 2020-06-17 Jason Merrill <jason@redhat.com>
617 * call.c (build_new_op_1): Don't look for a CALL_EXPR when
618 calling a consteval function.
620 2020-06-17 Jason Merrill <jason@redhat.com>
622 * decl2.c (grokfield): Pass SD_DEFAULTED and SD_DELETED.
623 * decl.c (duplicate_decls): Reduce error for delete
624 after earlier declaration to pedwarn.
626 2020-06-17 Marek Polacek <polacek@redhat.com>
629 * constexpr.c (maybe_fold_non_dependent_expr): New.
630 * cp-tree.h (maybe_fold_non_dependent_expr): Declare.
631 * typeck.c (cp_build_array_ref): Call maybe_fold_non_dependent_expr
632 instead of maybe_constant_value.
634 2020-06-16 Marek Polacek <polacek@redhat.com>
637 * call.c (add_list_candidates): Return if a designated initializer
638 is used with a non-aggregate.
639 (implicit_conversion_error): Give an error for the case above.
641 2020-06-16 Marek Polacek <polacek@redhat.com>
644 * name-lookup.c (check_local_shadow): Check if types are
645 non-null before calling same_type_p.
647 2020-06-16 Jakub Jelinek <jakub@redhat.com>
649 * semantics.c (handle_omp_for_class_iterator): Adjust
650 c_omp_check_loop_iv_exprs caller.
651 (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr
652 before calling c_finish_omp_for and c_omp_check_loop_iv, move it
654 * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops.
656 2020-06-16 Jakub Jelinek <jakub@redhat.com>
658 * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated
659 from kind by comma rather than colon.
661 2020-06-16 Patrick Palka <ppalka@redhat.com>
663 * pt.c (perform_instantiation_time_access_checks): No need to
665 * semantics.c (enforce_access): Verify that decl is not
668 2020-06-16 Patrick Palka <ppalka@redhat.com>
672 * cp-tree.h (qualified_typedef_usage_s): Delete.
673 (qualified_typedef_usage_t): Delete.
674 (deferred_access_check): Move up in file.
675 (tree_template_info::typedefs_needing_access_checking): Delete.
676 (tree_template_info::deferred_access_checks): New field.
677 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): Rename to ...
678 (TI_DEFERRED_ACCESS_CHECKS): ... this, and adjust accordingly.
679 * pt.c (perform_typedefs_access_check): Rename to ...
680 (perform_instantiation_time_access_checks): ... this, and adjust
681 accordingly. Remove unnecessary tree tests.
682 (instantiate_class_template_1): Adjust accordingly.
683 (instantiate_decl): Likewise.
684 * semantics.c (enforce_access): Likewise.
686 2020-06-16 Patrick Palka <ppalka@redhat.com>
690 * call.c (enforce_access): Move to semantics.c.
691 * cp-tree.h (enforce_access): Delete.
692 (get_types_needing_access_check): Delete.
693 (add_typedef_to_current_template_for_access_check): Delete.
694 * decl.c (make_typename_type): Adjust accordingly. Use
695 check_accessibility_of_qualified_id instead of directly using
696 perform_or_defer_access_check.
697 * parser.c (cp_parser_template_declaration_after_parameters):
698 Don't push a dk_no_check access state when parsing a template.
699 * pt.c (get_types_needing_access_check): Delete.
700 (append_type_to_template_for_access_check_1): Delete.
701 (perform_typedefs_access_check): Adjust. If type_decl is a
702 FIELD_DECL, also check its DECL_CONTEXT for dependence. Use
703 tsubst_copy instead of tsubst to substitute into type_decl so
704 that we substitute into the DECL_CONTEXT of a FIELD_DECL.
705 (append_type_to_template_for_access_check): Delete.
706 * search.c (accessible_p): Remove the processing_template_decl
708 * semantics.c (enforce_access): Moved from call.c. If we're
709 parsing a template and the access check failed, add the check to
710 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING.
711 (perform_or_defer_access_check): Adjust comment.
712 (add_typedef_to_current_template_for_access_check): Delete.
713 (check_accessibility_of_qualified_id): Adjust accordingly.
714 Exit early if the scope is dependent.
716 2020-06-11 Patrick Palka <ppalka@redhat.com>
719 * constraint.cc (associate_classtype_constraints): If there is a
720 discrepancy between the current template depth and the template
721 depth of the original declaration, then adjust the template
722 parameter depth within the current constraints appropriately.
723 * pt.c (tsubst_friend_class): Substitute into and set the
724 constraints on the injected declaration.
726 2020-06-11 Iain Sandoe <iain@sandoe.co.uk>
728 * coroutines.cc (instantiate_coro_traits): Pass a reference
729 to lambda closure objects to traits instantiation.
730 (morph_fn_to_coro): Likewise for promise parameter
731 preview and allocator lookup.
733 2020-06-10 Iain Sandoe <iain@sandoe.co.uk>
736 * call.c (add_candidates): Use vec_safe_length() for
737 testing the arguments list.
738 (build_new_method_call_1): Use vec_safe_is_empty() when
739 checking for an empty args list.
741 2020-06-10 Marek Polacek <polacek@redhat.com>
744 * parser.c (cp_parser_direct_declarator): Clear
745 CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
748 2020-06-09 Iain Sandoe <iain@sandoe.co.uk>
751 * coroutines.cc (expand_one_await_expression): Build separate
752 DTOR trees for the awaitable object on the destroy and resume
755 2020-06-09 Jason Merrill <jason@redhat.com>
758 * cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
759 wrapped in a pointer type.
761 2020-06-05 Marek Polacek <polacek@redhat.com>
764 * call.c (build_converted_constant_expr_internal): Allow
767 2020-06-05 Iain Sandoe <iain@sandoe.co.uk>
769 * cp-tree.def (CO_RETURN_EXPR): Correct the class
770 to use tcc_statement.
772 2020-06-05 Jason Merrill <jason@redhat.com>
774 * error.c (dump_binary_op): Handle negative operand to
777 2020-06-04 Jason Merrill <jason@redhat.com>
780 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]:
781 Evaluate OBJ_TYPE_REF_EXPR.
783 2020-06-04 Jason Merrill <jason@redhat.com>
786 * class.c (lookup_vfn_in_binfo): New.
787 * call.c (build_over_call): Use it.
788 * cp-tree.h (resolves_to_fixed_type_p): Add default argument.
789 (lookup_vfn_in_binfo): Declare.
791 2020-06-04 Iain Sandoe <iain@sandoe.co.uk>
794 * coroutines.cc (morph_fn_to_coro): Ensure that the get-
795 return-object is constructed correctly; When it is not the
796 final return value, pass it to the CTOR of the return type
797 as an rvalue, per the standard comment.
799 2020-06-04 Jakub Jelinek <jakub@redhat.com>
803 * constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
804 conversions from pointer types to arithmetic types here...
805 (cxx_eval_outermost_constant_expr): ... instead of here.
807 2020-06-03 Mark Wielaard <mark@klomp.org>
809 * parser.c (cp_lexer_safe_previous_token): New function.
810 (cp_parser_error_1): Add name_hint if the previous token is
811 a string literal and next token is a CPP_NAME and we have a
812 missing header suggestion for the name.
814 2020-06-03 Patrick Palka <ppalka@redhat.com>
816 * pt.c (process_partial_specialization): Pass the full set of
817 generic template arguments to strictly_subsumes.
819 2020-06-03 Patrick Palka <ppalka@redhat.com>
822 * pt.c (most_specialized_partial_spec): Reorganize the loop over
823 DECL_TEMPLATE_SPECIALIZATIONS. Check constraints_satisfied_p on
824 the original template declaration, not on the tsubsted one.
826 2020-06-03 Iain Sandoe <iain@sandoe.co.uk>
829 * coroutines.cc (finish_co_await_expr): Revise to allow for
831 (finish_co_yield_expr): Likewise.
833 2020-06-03 Jason Merrill <jason@redhat.com>
836 * cp-tree.h (predeclare_vla): Declare.
837 * cp-gimplify.c (predeclare_vla): Handle getting a decl.
838 * pt.c (tsubst_expr) [DECL_EXPR]: Use it.
840 2020-06-03 Tobias Burnus <tobias@codesourcery.com>
842 * cp-gimplify.c (cxx_omp_predetermined_mapping): New.
843 * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
844 * cp-tree.h (cxx_omp_predetermined_mapping): Declare.
846 2020-06-02 Jason Merrill <jason@redhat.com>
849 * pt.c (tsubst_decl): Relax assert.
851 2020-06-02 Iain Sandoe <iain@sandoe.co.uk>
854 * coroutines.cc (build_co_await): Wrap the co_await expression
855 in a TARGET_EXPR, where needed.
856 (finish_co_yield_expr): Likewise.
858 2020-06-02 Patrick Palka <ppalka@redhat.com>
862 * pt.c (tsubst_function_decl): Don't do set_constraints when
863 regenerating a lambda.
864 (tsubst_lambda_expr): Substitute into the lambda's constraints
865 and do set_constraints here.
867 2020-06-01 Jason Merrill <jason@redhat.com>
872 * class.c (build_vfn_ref): Revert 95311 change.
873 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
876 2020-06-01 Iain Sandoe <iain@sandoe.co.uk>
879 * coroutines.cc (struct param_info): Remove rv_ref field.
880 (build_actor_fn): Remove specifial rvalue ref handling.
881 (morph_fn_to_coro): Likewise.
883 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
886 * coroutines.cc (morph_fn_to_coro): If we see an
887 early fatal error, drop the erroneous function body.
889 2020-05-31 Iain Sandoe <iain@sandoe.co.uk>
891 * coroutines.cc (build_co_await): Remove unused
893 (finish_co_await_expr): Likewise.
894 (finish_co_yield_expr): Likewise; revise comment.
896 2020-05-30 Iain Sandoe <iain@sandoe.co.uk>
898 * coroutines.cc (morph_fn_to_coro): Revise initialization
899 of the frame pointer to avoid an unused value.
901 2020-05-30 Patrick Palka <ppalka@redhat.com>
904 * constraint.cc (satisfaction_value): Accept INTEGER_CST of any
907 2020-05-29 Patrick Palka <ppalka@redhat.com>
908 Jason Merrill <jason@redhat.com>
911 * class.c (add_method): Let special member function templates
912 coexist if they are not equivalently constrained, or in a class
915 2020-05-29 Jason Merrill <jason@redhat.com>
918 * pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
919 on the DECL_TEMPLATE_RESULT.
921 2020-05-29 Marek Polacek <polacek@redhat.com>
924 * cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
925 TREE_THIS_VOLATILE here.
926 (cp_fold): Set it here along with TREE_NO_WARNING.
928 2020-05-29 Jason Merrill <jason@redhat.com>
932 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.
934 2020-05-29 Patrick Palka <ppalka@redhat.com>
939 * parser.c (cp_parser_requires_clause_expression): Temporarily
940 increment processing_template_decl only if it is 0.
941 (cp_parser_constraint_expression): Likewise.
942 (cp_parser_requires_expression): Likewise.
944 2020-05-29 Patrick Palka <ppalka@redhat.com>
947 * constexpr.c (get_or_insert_ctor_field): Add limited support
948 for RANGE_EXPR index lookups.
950 2020-05-28 Jakub Jelinek <jakub@redhat.com>
953 * decl.c (cp_finish_decomp): Call complete_type before checking
956 2020-05-28 Jason Merrill <jason@redhat.com>
959 * decl.c (cp_finish_decl): Revert r9-297 change.
960 (check_static_variable_definition): Likewise.
961 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
962 * pt.c (instantiate_decl): Return early on type error.
964 2020-05-27 Jason Merrill <jason@redhat.com>
967 * decl.c (reshape_init_array_1): Don't reuse in overload context.
969 2020-05-27 Jason Merrill <jason@redhat.com>
972 * call.c (build_new_op_1): Suppress
973 warn_zero_as_null_pointer_constant across comparison of <=> result
976 2020-05-27 Jason Merrill <jason@redhat.com>
979 * decl.c (grokdeclarator): Don't shift attributes in TYPENAME
982 2020-05-27 Nathan Sidwell <nathan@acm.org>
985 * pt.c (lookup_template_class_1): Restore alias template mutation.
987 2020-05-26 Jakub Jelinek <jakub@redhat.com>
990 * cp-gimplify.c: Include omp-general.h.
991 (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
992 variables in composite distribute parallel for, instantiate copy
995 2020-05-23 Patrick Palka <ppalka@redhat.com>
998 * constexpr.c (cxx_eval_constant_expression)
999 <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when
1000 constexpr evaluation is uid-sensitive.
1002 2020-05-22 Jason Merrill <jason@redhat.com>
1004 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate
1005 the function address if the call used operator syntax.
1007 2020-05-21 Jason Merrill <jason@redhat.com>
1010 * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual
1011 call, instrument the OBJ_TYPE_REF.
1013 * decl.c (compute_array_index_type_loc): Diagnose expressions
1014 in a template that can't be constant.
1015 * parser.c (cp_parser_direct_declarator): Don't check
1016 non-constant array bounds here.
1018 * cp-tree.h (is_rvalue_constant_expression): Declare.
1019 * constexpr.c (is_rvalue_constant_expression): New.
1020 * parser.c (cp_parser_constant_expression): Use it.
1021 * decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
1022 template as constant.
1024 * typeck.c (build_x_modify_expr): Handle error_mark_node arguments.
1026 * decl.c (grokparms): Return NULL_TREE if any parms were erroneous.
1028 2020-05-21 Iain Sandoe <iain@sandoe.co.uk>
1030 * coroutines.cc (finish_co_return_stmt): Revert change to use
1033 2020-05-21 Patrick Palka <ppalka@redhat.com>
1036 * constexpr.c (constexpr_ctx::uid_sensitive): Remove field.
1037 (uid_sensitive_constexpr_evaluation_value): Define.
1038 (uid_sensitive_constexpr_evaluation_true_counter): Define.
1039 (uid_sensitive_constexpr_evaluation_p): Define.
1040 (uid_sensitive_constexpr_evaluation_sentinel): Define its
1042 (uid_sensitive_constexpr_evaluation_checker): Define its
1043 constructor and its evaluation_restricted_p method.
1044 (get_fundef_copy): Remove 'ctx' parameter. Use u_s_c_e_p
1045 instead of constexpr_ctx::uid_sensitive.
1046 (cxx_eval_call_expression): Use u_s_c_e_p instead, and test it
1047 last. Adjust call to get_fundef_copy.
1048 (instantiate_cx_fn_r): Test u_s_c_e_p so that we increment the
1049 counter if necessary.
1050 (cxx_eval_outermost_constant_expr): Remove 'uid_sensitive'
1051 parameter. Adjust function body accordingly.
1052 (maybe_constant_value): Remove 'uid_sensitive' parameter and
1053 adjust function body accordingly. Set up a
1054 uid_sensitive_constexpr_evaluation_checker, and use it to
1055 conditionally update the cv_cache.
1056 * cp-gimplify.c (cp_fold): Set up a
1057 uid_sensitive_constexpr_evaluation_checker, and use it to
1058 conditionally update the fold_cache.
1059 * cp-tree.h (maybe_constant_value): Update declaration.
1060 (struct uid_sensitive_constexpr_evaluation_sentinel): Define.
1061 (struct sensitive_constexpr_evaluation_checker): Define.
1062 * expr.c (fold_for_warn): Set up a
1063 uid_sensitive_constexpr_evaluation_sentinel before calling
1064 the folding subroutines. Drop all but the first argument to
1065 maybe_constant_value.
1067 2020-05-20 Marek Polacek <polacek@redhat.com>
1070 * parser.c (cp_parser_unqualified_id): Reject simple-template-id as
1071 the declarator-id of a destructor.
1072 (cp_parser_constructor_declarator_p): Reject simple-template-id as
1073 the declarator-id of a constructor.
1075 2020-05-20 Marek Polacek <polacek@redhat.com>
1079 * cp-tree.h (SD_DECOMPOSITION): New flag.
1080 * decl.c (duplicate_decls): Make sure a structured binding is unique
1081 in its declarative region.
1082 (start_decl): If INITIALIZED is SD_DECOMPOSITION, call
1083 fit_decomposition_lang_decl.
1084 (grokdeclarator): Compare INITIALIZED directly to SD_* flags.
1085 * parser.c (cp_parser_decomposition_declaration): Pass SD_DECOMPOSITION
1088 2020-05-20 Patrick Palka <ppalka@redhat.com>
1091 * typeck.c (structural_comptypes): Don't perform
1092 context-dependent resolution of TYPENAME_TYPEs when
1093 comparing_specializations.
1095 2020-05-19 Nathan Sidwell <nathan@acm.org>
1097 * pt.c (lookup_template_class_1): Do not reinit template_info of an
1100 2020-05-18 Martin Sebor <msebor@redhat.com>
1103 * call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
1104 * cp-tree.h (is_dummy_object): Return bool.
1105 (is_byte_access_type): Declare new function.
1106 * tree.c (is_dummy_object): Return bool.
1107 (is_byte_access_type): Define new function.
1109 2020-05-19 Patrick Palka <ppalka@redhat.com>
1112 * pt.c (init_template_processing): Enable sanitization for
1113 decl_specializations and type_specializations.
1116 * pt.c (fn_type_unification): Pass 'fn' instead of NULL_TREE as
1117 the 'in_decl' parameter to coerce_template_parms.
1119 2020-05-18 Marek Polacek <polacek@redhat.com>
1122 * typeck.c (cp_build_binary_op): Use fold_for_warn instead of
1125 2020-05-18 Marek Polacek <polacek@redhat.com>
1128 * cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
1129 type is not INDIRECT_TYPE_P.
1130 * decl.c (omp_declare_variant_finalize_one): Call
1131 cp_get_callee_fndecl_nofold instead of looking for the function decl
1134 2020-05-18 Marek Polacek <polacek@redhat.com>
1137 * parser.c (cp_parser_has_attribute_expression): Sorry on a
1138 type-dependent argument.
1140 2020-05-18 Marek Polacek <polacek@redhat.com>
1144 * call.c (add_builtin_candidate) <case EQ_EXPR>: Create candidate
1145 operator functions when type is std::nullptr_t for ==/!=.
1146 * typeck.c (composite_pointer_type_r): Add a bool * parameter. Use it
1147 to maybe add "const" to the pointer type.
1148 (composite_pointer_type): Update the call to composite_pointer_type_r.
1149 (cp_build_binary_op): Turn two warning_at into error_at. Print the
1152 2020-05-18 Jason Merrill <jason@redhat.com>
1154 * call.c (build_over_call): Remove unnecessary
1155 cp_stabilize_reference.
1157 2020-05-18 Marek Polacek <polacek@redhat.com>
1159 * call.c (add_builtin_candidate): Don't create a builtin overload
1160 candidate for ++ when type is bool in C++17.
1162 2020-05-18 Marek Polacek <polacek@redhat.com>
1164 * cfns.h: Regenerated.
1166 2020-05-17 Iain Sandoe <iain@sandoe.co.uk>
1168 * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
1170 2020-05-16 Iain Sandoe <iain@sandoe.co.uk>
1172 * coroutines.cc (finish_co_return_stmt): Implement rules
1173 from [class.copy.elision] /3.
1175 2020-05-16 Patrick Palka <ppalka@redhat.com>
1178 * semantics.c (finish_decltype_type): Call
1179 instantiate_non_dependent_expr_sfinae on the expression.
1181 2020-05-15 Patrick Palka <ppalka@redhat.com>
1185 2020-04-07 Patrick Palka <ppalka@redhat.com>
1188 * typeck2.c (process_init_constructor_array): Propagate
1189 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
1190 the array initializer.
1192 2020-05-15 Jason Merrill <jason@redhat.com>
1194 PR c++/93286 - ICE with __is_constructible and variadic template.
1195 * pt.c (tsubst_tree_list): New.
1196 (tsubst, tsubst_copy_and_build): Use it.
1197 * decl2.c (is_late_template_attribute): Handle error_mark_node args.
1199 2020-05-15 Nathan Sidwell <nathan@acm.org>
1201 * pt.c (template_args_equal): Fix thinkos in previous 'cleanup'.
1203 2020-05-14 Jason Merrill <jason@redhat.com>
1206 * pt.c (maybe_instantiate_noexcept): Change clone handling.
1208 2020-05-14 Patrick Palka <ppalka@redhat.com>
1211 * call.c (build_op_call): Pass complain to lookup_fnfields.
1212 (build_special_member_call): Likewise.
1213 * class.c (type_requires_array_cookie): Pass tf_warning_or_error
1215 * cp-tree.h (lookup_fnfields): Add tsubst_flags_t parameter.
1216 * except.c (build_throw): Pass tf_warning_or_error to
1218 * init.c (build_new_1): Pass complain to lookup_fnfields.
1219 * method.c (locate_fn_flags): Likewise.
1220 * name-lookup.c (lookup_name_real_1): Pass tf_warning_or_error
1222 * pt.c (tsubst_baselink): Pass complain to lookup_fnfields.
1223 * search.c (lookup_fnfields): New 'complain' parameter. Pass it
1226 2020-05-14 Nathan Sidwell <nathan@acm.org>
1228 * parser.c (cp_parser_diagnose_invalid_typename): Mention
1229 std=c++20 not 2a, reformat dependent binfo inform loops.
1231 * pt.c (tsubst_template_decl): Reorder and commonize some control
1234 * pt.c (tsubst_friend_function): Simplify control flow.
1236 * pt.c (lookup_template_class_1): Remove unnecessary else by
1237 simply grabbing TYPE_NAME earlier.
1239 * pt.c (push_template_decl_real): Adjust friend pushing logic.
1240 Reinit template type.
1242 * pt.c (build_template_decl): Init DECL_TEMPLATE_RESULT &
1244 (process_partial_specialization): ... not here ...
1245 (push_template_decl_real, add_inherited_template_parms)
1246 (build_deduction_guide): ... or here.
1248 2020-05-14 Jakub Jelinek <jakub@redhat.com>
1250 * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target.
1252 2020-05-13 Patrick Palka <ppalka@redhat.com>
1255 * init.c (build_vec_delete_1): Just return error_mark_node if
1256 deallocate_expr is error_mark_node.
1257 (build_delete): Just return error_mark_node if do_delete is
1260 2020-05-13 Patrick Palka <ppalka@redhat.com>
1263 * constraint.cc (tsubst_requires_expr): Produce a new
1264 requires-expression when processing_template_decl, even if
1265 template arguments are not dependent.
1267 2020-05-13 Marek Polacek <polacek@redhat.com>
1270 * decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
1272 2020-05-13 Nathan Sidwell <nathan@acm.org>
1274 * pt.c (template_args_equal): Reorder category checking for
1277 * pt.c (perform_typedefs_access_check): Cache expensively
1278 calculated object references.
1279 (check_auto_in_tmpl_args): Just assert we do not get unexpected
1280 nodes, rather than silently do nothing.
1281 (append_type_to_template_for_access): Likewise, cache expensie
1284 * pt.c (canonical_type_parameter): Simplify.
1286 Formatting fixups & some simplifications.
1287 * pt.c (spec_hash_table): New typedef.
1288 (decl_specializations, type_specializations): Use it.
1289 (retrieve_specialization): Likewise.
1290 (register_specialization): Remove unnecessary casts.
1291 (push_template_decl_real): Reformat.
1292 (instantiate_class_template_1): Use more RAII.
1293 (make_argument_pack): Simplify.
1294 (instantiate_template_1): Use gcc_checking_assert for expensive
1296 (instantiate_decl): Likewise.
1297 (resolve_typename_type): Reformat comment.
1298 * semantics.c (struct deferred_access): Remove unnecessary GTY on
1300 (begin_class_definition): Fix formatting.
1302 2020-05-13 Jason Merrill <jason@redhat.com>
1304 * call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
1305 lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
1306 typeck2.c: Change cxx2a to cxx20.
1308 2020-05-12 Marek Polacek <polacek@redhat.com>
1311 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: When
1312 looking for a block-scope function declaration, look through the whole
1313 set, not just the first function in the overload set.
1315 2020-05-12 Jakub Jelinek <jakub@redhat.com>
1318 * pt.c (tsubst_decl): Deal with DECL_OMP_PRIVATIZED_MEMBER for
1321 2020-05-11 Jason Merrill <jason@redhat.com>
1323 Resolve C++20 NB comment CA104
1324 * pt.c (determine_specialization): Compare constraints for
1325 specialization of member template of class instantiation.
1327 2020-05-11 Jason Merrill <jason@redhat.com>
1331 * tree.c (cp_walk_subtrees): Stop at typedefs.
1332 Handle TYPENAME_TYPE here.
1333 * pt.c (find_parameter_packs_r): Not here.
1334 (for_each_template_parm_r): Clear *walk_subtrees.
1335 * decl2.c (min_vis_r): Look through typedefs.
1337 2020-05-11 Jason Merrill <jason@redhat.com>
1339 * call.c (implicit_conversion_error): Split out from...
1340 (perform_implicit_conversion_flags): ...here.
1341 (build_converted_constant_expr_internal): Use it.
1343 2020-05-11 Jason Merrill <jason@redhat.com>
1346 * parser.c (inject_parm_decls): Set current_class_ptr here.
1347 (cp_parser_direct_declarator): And here.
1348 (cp_parser_late_return_type_opt): Not here.
1349 (cp_parser_noexcept_specification_opt): Nor here.
1350 (cp_parser_exception_specification_opt)
1351 (cp_parser_late_noexcept_specifier): Remove unneeded parameters.
1353 2020-05-11 Jason Merrill <jason@redhat.com>
1355 * decl.c (cxx_init_decl_processing): Call declare_weak for
1358 2020-05-11 Jason Merrill <jason@redhat.com>
1360 * pt.c (instantiate_class_template_1): Call tsubst_expr for
1361 STATIC_ASSERT member.
1362 * ptree.c (cxx_print_xnode): Handle STATIC_ASSERT.
1364 2020-05-11 Jason Merrill <jason@redhat.com>
1366 * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
1367 walking of capture list.
1369 2020-05-11 Jason Merrill <jason@redhat.com>
1371 * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove.
1372 * call.c (build_new_function_call): Don't set it.
1373 (build_new_method_call_1): Likewise.
1374 (build_over_call): Check cand->explicit_targs instead.
1376 2020-05-11 Jason Merrill <jason@redhat.com>
1378 * decl.c (compute_array_index_type_loc): Stabilize before building
1381 2020-05-11 Jason Merrill <jason@redhat.com>
1383 * decl.c (grokdeclarator): Adjust deprecated_state here.
1384 (start_decl): Not here.
1386 2020-05-08 Iain Sandoe <iain@sandoe.co.uk>
1389 * coroutines.cc (build_actor_fn): Ensure that bind scopes
1390 are marked as having side-effects where necessary.
1391 (replace_statement_captures): Likewise.
1392 (morph_fn_to_coro): Likewise.
1394 2020-05-08 Nathan Sidwell <nathan@acm.org>
1396 * NEWS: Delete, it is so stale.
1398 * parser.c (cp_lexer_set_source_position_from_token): EOF has a
1401 2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
1405 * coroutines.cc (morph_fn_to_coro): Set unformed outline
1406 functions to error_mark_node. For early error returns suppress
1407 warnings about missing ramp return values. Fix reinstatement
1408 of the function body on pre-existing initial error.
1409 * decl.c (finish_function): Use the normal error path for fails
1410 in the ramp function, do not try to compile the helpers if the
1413 2020-05-07 Marek Polacek <polacek@redhat.com>
1415 PR c++/94590 - Detect long double -> double narrowing.
1416 * typeck2.c (check_narrowing): Detect long double -> double
1417 narrowing even when double and long double have the same
1418 precision. Make it handle conversions to float too.
1420 2020-05-07 Marek Polacek <polacek@redhat.com>
1423 * parser.c (cp_parser_class_specifier_1): Check that the scope is
1424 nested inside current scope before pushing it.
1426 2020-05-07 Marek Polacek <polacek@redhat.com>
1429 * typeck2.c (check_narrowing): Consider T* to bool narrowing
1432 2020-05-07 Marek Polacek <polacek@redhat.com>
1434 * decl.c (grok_op_properties): Fix spelling of non-static.
1435 * typeck.c (build_class_member_access_expr): Likewise.
1437 2020-05-07 Richard Biener <rguenther@suse.de>
1440 * optimize.c (update_cloned_parm): Copy DECL_NOT_GIMPLE_REG_P.
1442 2020-05-06 Marek Polacek <polacek@redhat.com>
1445 * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
1446 instead of uses_template_parms. Move the warning_sentinels after the
1449 2020-05-06 Jakub Jelinek <jakub@redhat.com>
1452 * typeck.c (cp_strict_aliasing_warning): New function.
1453 (cp_build_indirect_ref_1, build_reinterpret_cast_1): Use
1454 it instead of strict_aliasing_warning.
1457 * method.c (defaulted_late_check): Don't call synthesize_method
1458 on constexpr sfk_comparison if it has been called on it already.
1460 2020-05-06 Nathan Sidwell <nathan@acm.org>
1463 * decl.c (grokdeclarator): Don't splice template attributes in
1464 parm context -- they can apply to the parm.
1466 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
1468 * coroutines.cc: Remove references to n4849 throughout.
1470 2020-05-05 Jason Merrill <jason@redhat.com>
1473 * pt.c (more_specialized_fn): Do consider parms with no deducible
1474 template parameters.
1476 2020-05-05 Jason Merrill <jason@redhat.com>
1479 * constexpr.c (potential_constant_expression_1): In a lambda
1480 function, consider a captured variable directly.
1482 2020-05-05 Iain Sandoe <iain@sandoe.co.uk>
1484 * coroutines.cc (transform_await_wrapper): Check that we have
1485 no unlowered co_yields.
1486 (captures_temporary): Likewise.
1487 (register_awaits): Likewise.
1489 2020-05-05 Nathan Sidwell <nathan@acm.org>
1492 * coroutines.cc (morph_fn_to_coro): Just check for
1494 * pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
1496 2020-05-05 Marek Polacek <polacek@redhat.com>
1497 Jason Merrill <jason@redhat.com>
1500 * parser.c (cp_parser_postfix_dot_deref_expression): If we have
1501 a type-dependent object of class type, stash it to
1502 parser->context->object_type. If the postfix expression doesn't have
1504 (cp_parser_class_name): Consider object scope too.
1505 (cp_parser_lookup_name): Remove code dealing with the case when
1506 object_type is unknown_type_node.
1508 2020-05-04 Patrick Palka <ppalka@redhat.com>
1511 * cp-gimplify.c (cp_fold) <case CALL_EXPR>: Move some variable
1512 declarations closer to their uses. Copy the CALL_EXPR only
1513 when one of its arguments has changed.
1514 <case TREE_VEC>: Instead of first collecting the folded
1515 arguments into a releasing_vec, just make a copy of the TREE_VEC
1516 as soon as folding changes one of its arguments.
1518 2020-05-04 Iain Sandoe <iain@sandoe.co.uk>
1520 * coroutines.cc (morph_fn_to_coro): Mark the coro.gro variable
1521 as artificial and ignored.
1523 2020-05-04 Nathan Sidwell <nathan@acm.org>
1525 pt.c (process_template_parm): Don't walk the template list twice,
1526 remember the final node instead.
1527 (end_template_parm_list): Refactor. Comment on why we do a pop
1530 PR c++/94827 -- don't save parms in nested requirement
1531 * constraint.cc (tsubst_nested_requirement): TYPE directly holds
1532 notmalized requirement.
1533 (finish_nested_requirement): Don't stash current tpl parms into
1535 (diagnose_nested_requirement): TYPE directly holds notmalized
1538 2020-05-01 Patrick Palka <ppalka@redhat.com>
1541 * cp-tree.h (check_accessibility_of_qualified_id): Add
1542 tsubst_flags_t parameter and change return type to bool.
1543 * parser.c (cp_parser_lookup_name): Pass tf_warning_to_error to
1544 check_accessibility_of_qualified_id.
1545 * pt.c (tsubst_qualified_id): Return error_mark_node if
1546 check_accessibility_of_qualified_id returns false.
1547 * semantics.c (check_accessibility_of_qualified_id): Add
1548 complain parameter. Pass complain instead of
1549 tf_warning_or_error to perform_or_defer_access_check. Return
1550 true unless perform_or_defer_access_check returns false.
1552 2020-05-01 Marek Polacek <polacek@redhat.com>
1555 * typeck2.c (process_init_constructor_record): Return PICFLAG_ERRONEOUS
1556 if an initializer element was erroneous.
1558 2020-05-01 Jason Merrill <jason@redhat.com>
1561 * init.c (get_nsdmi): Don't push_to_top_level for a local class.
1563 2020-05-01 Jason Merrill <jason@redhat.com>
1566 * decl.c (cp_finish_decl): Also clear TREE_READONLY if
1567 -fmerge-all-constants.
1569 2020-05-01 Jason Merrill <jason@redhat.com>
1572 * pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
1573 the same type as the variable.
1575 2020-04-30 Jason Merrill <jason@redhat.com>
1576 Nathan Sidwell <nathan@acm.org>
1579 * constraint.cc (map_arguments): If ARGS is null, it's a
1580 self-mapping of parms.
1581 (finish_nested_requirement): Do not pass argified
1582 current_template_parms to normalization.
1583 (tsubst_nested_requirement): Don't assert no template parms.
1585 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1588 * coroutines.cc (transform_local_var_uses): Defer walking
1589 the DECL_INITIALs of BIND_EXPR vars until all the frame
1590 allocations have been made.
1592 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1595 * coroutines.cc (register_awaits): Update target
1596 expressions for awaitable and suspend handle
1599 2020-04-30 Iain Sandoe <iain@sandoe.co.uk>
1602 * coroutines.cc (build_co_await): Account for variables
1603 with DECL_VALUE_EXPRs.
1604 (captures_temporary): Likewise.
1605 (register_awaits): Likewise.
1607 2020-04-29 Patrick Palka <ppalka@redhat.com>
1610 * pt.c (find_template_parameter_info::parm_list): New field.
1611 (keep_template_parm): Use the new field to build up the
1612 parameter list here instead of ...
1613 (find_template_parameters): ... here. Return ftpi.parm_list.
1615 2020-04-29 Jakub Jelinek <jakub@redhat.com>
1618 * class.c (build_base_field): Set DECL_FIELD_ABI_IGNORED on C++17 empty
1619 base artificial FIELD_DECLs.
1620 (layout_class_type): Set DECL_FIELD_ABI_IGNORED on empty class
1621 field_poverlapping_p FIELD_DECLs.
1623 2020-04-29 Patrick Palka <ppalka@redhat.com>
1626 * constraint.cc (satisfy_declaration_constraints): Use saved_t
1627 instead of t as the key to decl_satisfied_cache.
1630 * error.c (print_requires_expression_info): Print the dependent
1631 form of the parameter list with its template parameter mapping,
1632 rather than printing the substituted form.
1634 2020-04-28 Jason Merrill <jason@redhat.com>
1637 * decl.c (use_eh_spec_block): Check nothrow type after
1639 * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
1640 DECL_MAYBE_DELETED fns here.
1641 * decl2.c (mark_used): Not here.
1642 * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
1644 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
1647 * coroutines.cc (instantiate_coro_traits): Pass a reference to
1648 object type rather than a pointer type for 'this', for method
1650 (struct param_info): Add a field to hold that the parm is a lambda
1652 (morph_fn_to_coro): Check for lambda closure pointers in the
1653 args. Use a reference to *this when building the args list for the
1654 promise allocator lookup.
1656 2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
1659 * coroutines.cc (coro_promise_type_found_p): Do not
1660 exclude non-classes here (this needs to be handled in the
1662 (morph_fn_to_coro): Allow for the case where the coroutine
1665 2020-04-27 Iain Sandoe <iain@sandoe.co.uk>
1668 * coroutines.cc (struct local_var_info): Add fields for static
1669 variables and those with DECL_VALUE_EXPR redirection.
1670 (transform_local_var_uses): Skip past typedefs and static vars
1671 and then account for redirected variables.
1672 (register_local_var_uses): Likewise.
1674 2020-04-27 Jason Merrill <jason@redhat.com>
1678 * decl.c (grokdeclarator): Move dependent attribute to decl.
1679 * decl2.c (splice_template_attributes): No longer static.
1681 2020-04-27 Patrick Palka <ppalka@redhat.com>
1684 * constexpr.c (cxx_eval_call_expression): Don't set new_obj if we're
1685 evaluating the target constructor of a delegating constructor.
1686 (cxx_eval_store_expression): Don't set TREE_READONLY if the LHS of the
1687 INIT_EXPR is '*this'.
1689 2020-04-26 Marek Polacek <polacek@redhat.com>
1692 * call.c (struct conversion): Add copy_init_p.
1693 (standard_conversion): Set copy_init_p in ck_base and ck_rvalue
1694 if FLAGS demands LOOKUP_ONLYCONVERTING.
1695 (convert_like_real) <case ck_base>: If copy_init_p is set, or
1696 LOOKUP_ONLYCONVERTING into FLAGS.
1698 2020-04-26 Iain Sandoe <iain@sandoe.co.uk>
1701 * coroutines.cc (morph_fn_to_coro): Ensure that
1702 unnamed function params have a usable and distinct
1705 2020-04-24 Jason Merrill <jason@redhat.com>
1708 * decl.c (redeclaration_error_message): Reject defaulted comparison
1709 operator that has been previously declared.
1711 2020-04-25 Patrick Palka <ppalka@redhat.com>
1713 * parser.c (cp_parser_diagnose_invalid_type_name): Suggest enabling
1714 concepts if the invalid identifier is 'requires'.
1716 2020-04-25 Jakub Jelinek <jakub@redhat.com>
1719 * semantics.c (finish_call_expr): When looking if all overloads
1720 are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs.
1722 2020-04-24 Martin Liska <mliska@suse.cz>
1724 * coroutines.cc: Fix compilation error for release checking
1725 where we miss declaration of ‘coro_body_contains_bind_expr_p’.
1727 2020-04-23 Patrick Palka <ppalka@redhat.com>
1729 * tree.c (zero_init_expr_p): Use uses_template_parms instead of
1733 * pt.c (template_class_depth): Walk into the DECL_FRIEND_CONTEXT of a
1734 friend declaration rather than into its CP_DECL_CONTEXT.
1736 2020-04-23 Iain Sandoe <iain@sandoe.co.uk>
1739 * coroutines.cc (await_statement_expander): Simplify cases.
1740 (struct susp_frame_data): Add fields for truth and/or if
1741 cases, rename one field.
1742 (analyze_expression_awaits): New.
1743 (expand_one_truth_if): New.
1744 (add_var_to_bind): New helper.
1745 (coro_build_add_if_not_cond_break): New helper.
1746 (await_statement_walker): Handle conditional expressions,
1747 handle expansion of truth-and/or-if cases.
1748 (bind_expr_find_in_subtree): New, checking-only.
1749 (coro_body_contains_bind_expr_p): New, checking-only.
1750 (morph_fn_to_coro): Ensure that we have a top level bind
1753 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
1755 PR translation/94698
1756 * class.c (check_field_decls): Change "define" to "declare" in
1757 -Weffc++ diagnostics.
1759 2020-04-22 Patrick Palka <ppalka@redhat.com>
1763 * constraint.cc (satisfy_declaration_constraints): If the inherited
1764 constructor points to an instantiation of a constructor template,
1765 remember and use its attached template arguments.
1767 2020-04-22 Jonathan Wakely <jwakely@redhat.com>
1769 PR translation/94698
1770 * class.c (check_field_decls): Change "override" to "define" in
1771 -Weffc++ diagnostics.
1773 2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
1776 * coroutines.cc (struct param_info): Add a field to note that
1777 the param is 'this'.
1778 (morph_fn_to_coro): Convert this to a reference before using it
1779 in the promise parameter preview.
1781 2020-04-22 Jason Merrill <jason@redhat.com>
1784 * pt.c (register_parameter_specializations): If the instantiation is
1785 still a parameter pack, don't wrap it in a NONTYPE_ARGUMENT_PACK.
1786 (tsubst_pack_expansion, tsubst_expr): Adjust.
1788 2020-04-22 Martin Sebor <msebor@redhat.com>
1789 Jason Merrill <jason@redhat.com>
1792 * decl.c (reshape_init_array_1): Avoid stripping redundant trailing
1793 zero initializers...
1794 * mangle.c (write_expression): ...and handle them here even for
1795 pointers to members by calling zero_init_expr_p.
1796 * cp-tree.h (zero_init_expr_p): Declare.
1797 * tree.c (zero_init_expr_p): Define.
1798 (type_initializer_zero_p): Remove.
1799 * pt.c (tparm_obj_values): New hash_map.
1800 (get_template_parm_object): Store to it.
1801 (tparm_object_argument): New.
1803 2020-04-22 Patrick Palka <ppalka@redhat.com>
1806 * constraint.cc (diagnose_valid_expression): Check convert_to_void here
1807 as well as in tsubst_valid_expression_requirement.
1809 2020-04-21 Patrick Palka <ppalka@redhat.com>
1812 * constraint.cc (satisfy_declaration_constraints): Don't strip the
1813 inherited constructor if it already has template information.
1816 * pt.c (any_template_parm_r) <case IDENTIFIER_NODE>: New case. If this
1817 is a conversion operator, visit its TREE_TYPE.
1819 2020-04-21 Nathan Sidwell <nathan@acm.org>
1821 * pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
1824 2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
1827 * coroutines.cc (morph_fn_to_coro): Simplify return
1830 2020-04-17 Marek Polacek <polacek@redhat.com>
1833 * constexpr.c (cxx_eval_outermost_constant_expr): Return when T is
1834 a BRACE_ENCLOSED_INITIALIZER_P.
1835 (is_nondependent_constant_expression): Don't check
1836 BRACE_ENCLOSED_INITIALIZER_P.
1837 (is_nondependent_static_init_expression): Likewise.
1839 2020-04-20 Patrick Palka <ppalka@redhat.com>
1842 * cp-tree.h (lss_policy::lss_nop): New enumerator.
1843 * pt.c (local_specialization_stack::local_specialization_stack): Handle
1845 (local_specialization_stack::~local_specialization_stack): Likewise.
1846 (tsubst_pack_expansion): Use a local_specialization_stack instead of
1847 manually saving and restoring local_specializations. Conditionally
1848 replace local_specializations sooner, before the handling of the
1849 unsubstituted_packs case.
1851 2020-04-20 Marek Polacek <polacek@redhat.com>
1853 PR c++/94505 - bogus -Wparentheses warning with fold-expression.
1854 * pt.c (fold_expression): Add warning_sentinel for -Wparentheses
1855 before calling build_x_binary_op.
1857 2020-04-20 Marek Polacek <polacek@redhat.com>
1859 * coroutines.cc (captures_temporary): Don't assign the result of
1860 STRIP_NOPS to the same variable.
1862 2020-04-20 Nathan Sidwell <nathan@acm.org>
1864 PR c++/94454 - tpl-tpl-parms are not canonicalizable types
1865 * pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
1866 (process_template_parm): tpl-tpl-parms are structural.
1867 (rewrite_template_parm): Propagate structuralness.
1869 PR c++/94454 - Expr pack expansion equality
1870 * tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
1871 [EXPR_PACK_EXPANSION]: Add.
1873 PR c++/94454 Template Argument Hashing
1874 * pt.c (iterative_hash_template_arg): Strip nodes as
1875 template_args_equal does.
1876 [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor.
1877 [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index.
1878 [node_class:default]: Refactor.
1880 2020-04-18 Patrick Palka <ppalka@redhat.com>
1883 * tree.c (cp_tree_equal) <case PARM_DECL>: Ignore
1884 comparing_specializations if the parameters' contexts are identical.
1887 * pt.c (splice_late_return_type): Propagate cv-qualifiers and
1888 PLACEHOLDER_TYPE_CONSTRAINTS from the original auto node to the new one.
1890 2020-04-17 Patrick Palka <ppalka@redhat.com>
1893 * lambda.c (lambda_capture_field_type): Avoid doing auto deduction if
1894 the explicit initializer has parameter packs.
1897 * parser.c (cp_parser_check_template_parameters): Before issuing a hard
1898 error, first try simulating an error instead.
1900 2020-04-17 Jakub Jelinek <jakub@redhat.com>
1903 * call.c (build_conditional_expr_1): Remove redundant assignment to
1906 2020-04-16 Patrick Palka <ppalka@redhat.com>
1909 * cvt.c (ocp_convert): If the result of scalar_constant_value is
1910 erroneous, ignore it and use the original expression.
1912 2020-04-16 Jakub Jelinek <jakub@redhat.com>
1915 * parser.c (cp_parser_simple_declaration): Fix up a pasto in
1918 2020-04-15 Jakub Jelinek <jakub@redhat.com>
1921 * parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
1922 requires directive when not at file or namespace scope.
1924 2020-04-14 Iain Sandoe <iain@sandoe.co.uk>
1927 * coroutines.cc (build_actor_fn): Check that the target can
1928 support the resume tailcall before mandating it.
1930 2020-04-14 Patrick Palka <ppalka@redhat.com>
1933 * cxx-pretty-print.c (cxx_pretty_printer:simple_type_specifier)
1934 <case DECLTYPE_TYPE>: Handle DECLTYPE_TYPE here instead of ...
1935 (pp_cxx_type_specifier_seq) <case DECLTYPE_TYPE>: ... here.
1936 (cxx_pretty_printer::direct_abstract_declarator) <case DECLTYPE_TYPE>:
1940 * constexpr.c (replace_result_decl_data): New struct.
1941 (replace_result_decl_data_r): New function.
1942 (replace_result_decl): New function.
1943 (cxx_eval_call_expression): Use it.
1944 * tree.c (build_aggr_init_expr): Set the location of the AGGR_INIT_EXPR
1945 to that of its initializer.
1947 2020-04-13 Marek Polacek <polacek@redhat.com>
1950 * name-lookup.c (check_local_shadow): Add an inform call.
1952 2020-04-13 Patrick Palka <ppalka@redhat.com>
1955 * error.c (dump_scope): Pass TFF_NO_FUNCTION_ARGUMENTS to
1956 dump_function_decl when printing a function template instantiation as a
1960 * constexpr.c (get_or_insert_ctor_field): Set default value of parameter
1962 (cxx_eval_bare_aggregate): Use get_or_insert_ctor_field instead of
1963 assuming the the next index belongs at the end of the new CONSTRUCTOR.
1964 (cxx_eval_store_expression): Revert PR c++/78572 fix.
1966 2020-04-13 Nathan Sidwell <nathan@acm.org>
1968 PR c++/94426 lambdas with internal linkage are different to no-linkage
1969 * decl2.c (determine_visibility): A lambda's visibility is
1970 affected by its extra scope.
1971 * pt.c (instantiate_decl): Determine var's visibility before
1972 instantiating its initializer.
1973 * tree.c (no_linkage_check): Revert code looking at visibility of
1974 lambda's extra scope.
1976 2020-04-10 Iain Sandoe <iain@sandoe.co.uk>
1979 * coroutines.cc (co_await_expander): Remove.
1980 (expand_one_await_expression): New.
1981 (process_one_statement): New.
1982 (await_statement_expander): New.
1983 (build_actor_fn): Revise to use per-statement expander.
1984 (struct susp_frame_data): Reorder and comment.
1985 (register_awaits): Factor code.
1986 (replace_statement_captures): New, factored from...
1987 (maybe_promote_captured_temps):.. here.
1988 (await_statement_walker): Revise to process per statement.
1989 (morph_fn_to_coro): Use revised susp_frame_data layout.
1991 2020-04-10 Marek Polacek <polacek@redhat.com>
1994 * method.c (constructible_expr): In C++20, try using parenthesized
1995 initialization of aggregates to determine the result of
1998 2020-04-10 Bin Cheng <bin.cheng@linux.alibaba.com>
2000 * coroutines.cc (co_await_expander): Simplify.
2002 2020-04-09 Jason Merrill <jason@redhat.com>
2005 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]: Look at
2006 ctx->object and ctx->global->values first.
2008 2020-04-09 Marek Polacek <polacek@redhat.com>
2011 * call.c (initialize_reference): If the reference binding failed, maybe
2012 try initializing from { }.
2013 * decl.c (grok_reference_init): For T& t(e), set
2014 LOOKUP_AGGREGATE_PAREN_INIT but don't build up a constructor yet.
2016 2020-04-08 Iain Sandoe <iain@sandoe.co.uk>
2017 Jun Ma <JunMa@linux.alibaba.com>
2019 * coroutines.cc (maybe_promote_captured_temps): Add a cleanup
2020 expression, if needed, to any call from which we promoted
2021 temporaries captured by reference.
2023 2020-04-08 Marek Polacek <polacek@redhat.com>
2025 PR c++/94507 - ICE-on-invalid with lambda template.
2026 * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
2027 tsubst_function_decl returns error_mark_node.
2029 2020-04-08 Martin Liska <mliska@suse.cz>
2032 * decl.c (duplicate_decls): Duplicate also DECL_IS_REPLACEABLE_OPERATOR.
2033 (cxx_init_decl_processing): Mark replaceable all implicitly defined
2036 2020-04-08 Patrick Palka <ppalka@redhat.com>
2038 Core issues 1001 and 1322
2040 * pt.c (rebuild_function_or_method_type): Split function out from ...
2041 (tsubst_function_type): ... here.
2042 (maybe_rebuild_function_decl_type): New function.
2043 (tsubst_function_decl): Use it.
2045 2020-04-08 Jakub Jelinek <jakub@redhat.com>
2048 * decl.c (begin_destructor_body): For CLASSTYPE_VBASECLASSES class
2049 dtors, if CLASSTYPE_PRIMARY_BINFO is non-NULL, but not BINFO_VIRTUAL_P,
2050 look at CLASSTYPE_PRIMARY_BINFO of its BINFO_TYPE if it is not
2051 BINFO_VIRTUAL_P, and so on.
2053 2020-04-08 Marek Polacek <polacek@redhat.com>
2055 PR c++/94478 - ICE with defaulted comparison operator
2056 * method.c (early_check_defaulted_comparison): Give an error when the
2059 2020-04-08 Tobias Burnus <tobias@codesourcery.com>
2062 * paser.c (cp_parser_oacc_declare): Add check that variables
2063 are declared in the same scope as the directive.
2065 2020-04-07 Jason Merrill <jason@redhat.com>
2068 * parser.c (cp_parser_requires_expression): Use tentative_firewall.
2071 * parser.c (cp_parser_placeholder_type_specifier): Use
2074 2020-04-07 Iain Sandoe <iain@sandoe.co.uk>
2076 * coroutines.cc (maybe_promote_captured_temps): Ensure that
2077 reference capture placeholder vars are properly declared.
2079 2020-04-07 Patrick Palka <ppalka@redhat.com>
2082 * tree.c (replace_placeholders): Look through all handled components,
2083 not just COMPONENT_REFs.
2084 * typeck2.c (process_init_constructor_array): Propagate
2085 CONSTRUCTOR_PLACEHOLDER_BOUNDARY up from each element initializer to
2086 the array initializer.
2088 2020-04-07 Jakub Jelinek <jakub@redhat.com>
2091 * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
2092 if cp_parser_omp_master succeeded.
2094 2020-04-06 Jason Merrill <jason@redhat.com>
2097 * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.
2099 2020-04-04 Marek Polacek <polacek@redhat.com>
2100 Jason Merrill <jason@redhat.com>
2102 PR c++/94155 - crash in gimplifier with paren init of aggregates.
2103 * init.c (build_vec_init): Fill in indexes.
2105 2020-04-04 Jason Merrill <jason@redhat.com>
2108 * mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
2110 2020-04-04 Patrick Palka <ppalka@redhat.com>
2114 * constexpr.c (struct constexpr_ctx): New field 'parent'.
2115 (cxx_eval_bare_aggregate): Propagate CONSTRUCTOR_PLACEHOLDER_BOUNDARY
2116 flag from the original constructor to the reduced constructor.
2117 (lookup_placeholder): Prefer to return the outermost matching object
2118 by recursively calling lookup_placeholder on the 'parent' context,
2119 but don't cross CONSTRUCTOR_PLACEHOLDER_BOUNDARY constructors.
2120 (cxx_eval_constant_expression): Link the 'ctx' context to the 'new_ctx'
2121 context via 'new_ctx.parent' when being expanded without an explicit
2122 target. Don't call replace_placeholders.
2123 (cxx_eval_outermost_constant_expr): Initialize 'ctx.parent' to NULL.
2127 * constexpr.c (get_or_insert_ctor_field): Split out (while adding
2128 support for VECTOR_TYPEs, and optimizations for the common case)
2130 (cxx_eval_store_expression): ... here. Rename local variable
2131 'changed_active_union_member_p' to 'activated_union_member_p'. Record
2132 the sequence of indexes into 'indexes' that yields the subobject we're
2133 assigning to. Record the integer offsets of the constructor indexes
2134 we're assigning through into 'index_pos_hints'. After evaluating the
2135 initializer of the store expression, recompute 'valp' using 'indexes'
2136 and using 'index_pos_hints' as hints.
2137 (cxx_eval_bare_aggregate): Tweak comments. Use get_or_insert_ctor_field
2138 to recompute the constructor_elt pointer we're assigning through after
2139 evaluating each initializer.
2141 2020-04-04 Jason Merrill <jason@redhat.com>
2144 * constraint.cc (tsubst_valid_expression_requirement): Call
2147 2020-04-04 Jason Merrill <jason@redhat.com>
2150 * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
2151 * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
2154 2020-04-04 Jakub Jelinek <jakub@redhat.com>
2157 * parser.c (cp_parser_omp_for_loop): Use
2158 protected_set_expr_location_if_unset.
2159 * cp-gimplify.c (genericize_if_stmt, genericize_cp_loop): Likewise.
2162 * pt.c (tsubst_expr) <case OMP_MASTER>: Clear
2163 omp_parallel_combined_clauses.
2165 2020-04-03 Jason Merrill <jason@redhat.com>
2168 * pt.c (complex_pack_expansion_r): New.
2169 (complex_alias_template_p): Use it.
2171 2020-03-31 Jason Merrill <jason@redhat.com>
2174 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Call
2175 replace_placeholders.
2176 * typeck2.c (store_init_value): Fix arguments to
2177 fold_non_dependent_expr.
2179 2020-03-31 Jason Merrill <jason@redhat.com>
2181 * constexpr.c (cxx_eval_constant_expression) [TARGET_EXPR]: Use
2184 2020-03-30 Jason Merrill <jason@redhat.com>
2187 * tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
2188 (called_fns_equal): Check DECL_CONTEXT.
2190 2020-03-30 Jakub Jelinek <jakub@redhat.com>
2193 * semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
2194 STATEMENT_CODE_P code.
2196 2020-03-28 Patrick Palka <ppalka@redhat.com>
2199 * parser.c (cp_parser_requires_clause_opt): Diagnose and recover from
2200 "requires {" when "requires requires {" was probably intended.
2203 * constraint.cc (tsubst_compound_requirement): Always suppress errors
2204 from type_deducible_p and expression_convertible_p, as they're not
2205 substitution errors.
2206 (diagnose_atomic_constraint) <case INTEGER_CST>: Remove this case so
2207 that we diagnose INTEGER_CST expressions of non-bool type via the
2209 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: New case.
2210 * parser.c (cp_parser_requires_expression): Always parse the requirement
2211 body as if we're processing a template, by temporarily incrementing
2212 processing_template_decl. Afterwards, if we're not actually in a
2213 template context, perform semantic processing to diagnose any invalid
2214 types and expressions.
2215 * pt.c (tsubst_copy_and_build) <case REQUIRES_EXPR>: Remove dead code.
2216 * semantics.c (finish_static_assert): Explain an assertion failure
2217 when the condition is a REQUIRES_EXPR like we do when it is a concept
2220 * constraint.cc (diagnose_compound_requirement): When diagnosing a
2221 compound requirement, maybe replay the satisfaction failure, subject to
2222 the current diagnosis depth.
2224 * constraint.cc (finish_constraint_binary_op): Set the location of EXPR
2225 as well as its range, because build_x_binary_op doesn't always do so.
2226 (current_constraint_diagnosis_depth): New.
2227 (concepts_diagnostics_max_depth_exceeded_p): New.
2228 (collect_operands_of_disjunction): New.
2229 (satisfy_disjunction): When diagnosing a satisfaction failure, maybe
2230 replay each branch of the disjunction, subject to the current diagnosis
2232 (diagnose_valid_expression): When diagnosing a satisfaction failure,
2233 maybe replay the substitution error, subject to the current diagnosis
2235 (diagnose_valid_type): Likewise.
2236 (diagnose_nested_requiremnet): Likewise.
2237 (diagnosing_failed_constraint::diagnosing_failed_constraint): Increment
2238 current_constraint_diagnosis_depth when diagnosing.
2239 (diagnosing_failed_constraint::~diagnosing_failed_constraint): Decrement
2240 current_constraint_diagnosis_depth when diagnosing.
2241 (diagnosing_failed_constraint::replay_errors_p): New static member
2243 (diagnose_constraints): Don't diagnose if concepts_diagnostics_max_depth
2244 is 0. Emit a one-off note to increase -fconcepts-diagnostics-depth if
2245 the limit was exceeded.
2246 * cp-tree.h (diagnosing_failed_constraint::replay_errors_p): Declare.
2248 2020-03-27 Nathan Sidwell <nathan@acm.org>
2251 * name-lookup.c (do_pushdecl): Look through cleanp levels.
2253 2020-03-27 Martin Sebor <msebor@redhat.com>
2258 * cp-tree.h (most_specialized_partial_spec): Declare.
2259 * parser.c (cp_parser_elaborated_type_specifier): Distinguish alias
2261 (specialization_of): New function.
2262 (cp_parser_check_class_key): Move code...
2263 (class_decl_loc_t::add): ...to here. Add parameters. Avoid issuing
2264 -Wredundant-tags on first-time declarations in other declarators.
2265 Correct handling of template specializations.
2266 (class_decl_loc_t::diag_mismatched_tags): Also expect to be called
2267 when -Wredundant-tags is enabled. Use primary template or partial
2268 specialization as the guide for uses of implicit instantiations.
2269 * pt.c (most_specialized_partial_spec): Declare extern.
2271 2020-03-27 Nathan Sidwell <nathan@acm.org>
2274 * name-lookup.c (push_namespace): Triage ambiguous lookups that
2277 2020-03-27 Jakub Jelinek <jakub@redhat.com>
2280 * call.c (set_flags_from_callee): Don't update
2281 cp_function_chain->can_throw or current_function_returns_abnormally
2282 if cp_unevaluated_operand.
2285 * cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
2286 operand and creating a new COMPOUND_EXPR if anything changed.
2288 2020-03-26 Marek Polacek <polacek@redhat.com>
2290 PR c++/94336 - template keyword accepted before destructor names.
2291 * parser.c (cp_parser_unqualified_id): Give an error when 'template'
2292 is followed by a destructor name.
2294 2020-03-27 Patrick Palka <ppalka@redhat.com>
2296 * decl.c (compute_array_index_type_loc): Remove redundant
2297 type_dependent_expression_p check that is subsumed by
2298 value_dependent_expression_p.
2299 * decl2.c (is_late_template_attribute): Likewise.
2300 * pt.c (uses_template_parms): Likewise.
2301 (dependent_template_arg_p): Likewise.
2303 2020-03-26 Marek Polacek <polacek@redhat.com>
2306 PR c++/94057 - template keyword in a typename-specifier.
2307 * parser.c (check_template_keyword_in_nested_name_spec): New.
2308 (cp_parser_nested_name_specifier_opt): Implement DR1710, optional
2309 'template'. Call check_template_keyword_in_nested_name_spec.
2310 (cp_parser_simple_type_specifier): Assume that a <
2311 following a qualified-id in a typename-specifier begins
2312 a template argument list.
2314 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
2316 * coroutines.cc (coro_init_identifiers): Initialize an identifier
2317 for the cororoutine handle 'address' method name.
2318 (struct coro_aw_data): Add fields to cover the continuations.
2319 (co_await_expander): Determine the kind of await_suspend in use.
2320 If we have the case that returns a continuation handle, then save
2321 this and make the target for 'scope exit without cleanup' be the
2322 continuation resume label.
2323 (expand_co_awaits): Remove.
2324 (struct suspend_point_info): Remove fields that kept the returned
2325 await_suspend handle type.
2326 (transform_await_expr): Remove code tracking continuation handles.
2327 (build_actor_fn): Add the continuation handle as an actor-function
2328 scope var. Build the symmetric transfer continuation point. Call
2329 the tree walk for co_await expansion directly, rather than via a
2330 trivial shim function.
2331 (register_await_info): Remove fields tracking continuation handles.
2332 (get_await_suspend_return_type): Remove.
2333 (register_awaits): Remove code tracking continuation handles.
2334 (morph_fn_to_coro): Remove code tracking continuation handles.
2336 2020-03-26 Iain Sandoe <iain@sandoe.co.uk>
2338 * coroutines.cc (co_await_expander): If we are expanding the
2339 initial await expression, set a boolean flag to show that we
2340 have now reached the initial await_resume() method call.
2341 (expand_co_awaits): Handle the 'initial await resume called' flag.
2342 (build_actor_fn): Insert the initial await expression into the
2343 start of the user-authored function-body. Handle the 'initial await
2344 resume called' flag.
2345 (morph_fn_to_coro): Initialise the 'initial await resume called'
2346 flag. Modify the unhandled exception catch clause to recognise
2347 exceptions that occur before the initial await_resume() and re-
2350 2020-03-26 Jakub Jelinek <jakub@redhat.com>
2353 * class.c (user_provided_p): Use STRIP_TEMPLATE instead of returning
2354 true for all TEMPLATE_DECLs.
2357 * cp-gimplify.c (cp_genericize_r): Handle STATEMENT_LIST.
2359 2020-03-25 Patrick Palka <ppalka@redhat.com>
2362 * parser.c (cp_parser_selection_statement) <case RID_IF>: Invalidate the
2363 current condition chain when the if-statement has a non-empty
2366 2020-03-25 Iain Sandoe <iain@sandoe.co.uk>
2369 * coroutines.cc (captures_temporary): Fix a missing dereference.
2371 2020-03-24 Marek Polacek <polacek@redhat.com>
2373 PR c++/94190 - wrong no post-decrement operator error in template.
2374 * call.c (convert_like_real): Use convert_from_reference on the result.
2376 2020-03-24 Jason Merrill <jason@redhat.com>
2379 * constraint.cc (constraint_satisfaction_value): Repeat noisily on
2381 (tsubst_nested_requirement): Likewise.
2382 (get_constraint_error_location): Allow missing context.
2383 (diagnose_atomic_constraint): Diagnose non-bool constraint here.
2384 (satisfy_atom): Not here. Only diagnose non-constant when noisy.
2386 2020-03-24 Jason Merrill <jason@redhat.com>
2388 * pt.c (any_template_parm_r): Look into the type of a non-type
2391 2020-03-24 Jason Merrill <jason@redhat.com>
2393 * cp-tree.h (cp_expr): When constructing from an expr and a
2394 location, call protected_set_expr_location.
2396 2020-03-23 Patrick Palka <ppalka@redhat.com>
2399 * except.c (maybe_noexcept_warning): Add TODO.
2400 * method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
2402 2020-03-23 nathans <nathan@acm.org>
2405 * tree.c (cp_tree_equal) [SIZEOF_EXPR]: Detect argument pack
2408 2020-03-21 Patrick Palka <ppalka@redhat.com>
2411 * constexpr.c (reduced_constant_expression_p) [CONSTRUCTOR]: Properly
2412 handle unions without an initializer.
2413 (cxx_eval_component_reference): Emit a different diagnostic when the
2414 constructor element corresponding to a union member is NULL.
2415 (cxx_eval_bare_aggregate): When constructing a union, always set the
2416 active union member before evaluating the initializer. Relax assertion
2417 that verifies the index of the constructor element we're initializing
2418 hasn't been changed.
2419 (cxx_eval_store_expression): Diagnose changing the active union member
2420 while the union is in the process of being initialized. After setting
2421 an active union member, clear CONSTRUCTOR_NO_CLEARING on the underlying
2423 (cxx_eval_constant_expression) [PLACEHOLDER_EXPR]: Don't re-reduce a
2424 CONSTRUCTOR returned by lookup_placeholder.
2426 2020-03-20 Patrick Palka <ppalka@redhat.com>
2428 * cxx-pretty-print.c (pp_cxx_parameter_mapping): Make extern. Move
2429 the "[with ]" bits to here from ...
2430 (pp_cxx_atomic_constraint): ... here.
2431 * cxx-pretty-print.h (pp_cxx_parameter_mapping): Declare.
2432 * error.c (rebuild_concept_check): Delete.
2433 (print_concept_check_info): Print the dependent form of the constraint and the
2434 preferably substituted parameter mapping alongside it.
2436 2020-03-19 Jason Merrill <jason@redhat.com>
2439 * cp-gimplify.c (simple_empty_class_p): Look through
2440 SIMPLE_TARGET_EXPR_P.
2441 (cp_gimplify_expr) [MODIFY_EXPR]: Likewise.
2442 [RETURN_EXPR]: Avoid producing 'return *retval;'.
2443 * call.c (build_call_a): Strip TARGET_EXPR from empty class arg.
2444 * cp-tree.h (SIMPLE_TARGET_EXPR_P): Check that TARGET_EXPR_INITIAL
2447 2020-03-19 Jakub Jelinek <jakub@redhat.com>
2450 * parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
2451 on outer_automatic_var_p decls.
2452 * cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
2453 capture proxy decls.
2455 2020-03-18 Nathan Sidwell <nathan@acm.org>
2457 PR c++/94147 - mangling of lambdas assigned to globals
2458 * parser.c (cp_parser_init_declarator): Namespace-scope variables
2459 provide a lambda scope.
2460 * tree.c (no_linkage_check): Lambdas with a variable for extra
2461 scope have a linkage from the variable.
2463 2020-03-18 Jakub Jelinek <jakub@redhat.com>
2465 * constraint.cc (resolve_function_concept_check, subsumes_constraints,
2466 strictly_subsumes): Fix up duplicated word issue in a comment.
2467 * coroutines.cc (build_init_or_final_await, captures_temporary):
2469 * logic.cc (dnf_size_r, cnf_size_r): Likewise.
2470 * pt.c (append_type_to_template_for_access_check): Likewise.
2473 * decl.c (grokfndecl): Restore old diagnostics about deduction
2474 guide declared in different scope if in_namespace is NULL_TREE.
2476 2020-03-17 Jakub Jelinek <jakub@redhat.com>
2479 * parser.c (cp_parser_enum_specifier): Use temp_override for
2480 parser->colon_corrects_to_scope_p, replace goto out with return.
2481 If scoped enum or enum with underlying type is not followed by
2482 { or ;, call cp_parser_commit_to_tentative_parse before calling
2483 cp_parser_error and make sure to return error_mark_node instead of
2484 NULL_TREE. Formatting fixes.
2486 2020-03-17 Ville Voutilainen <ville.voutilainen@gmail.com>
2489 * method.c (assignable_expr): Use cp_unevaluated.
2490 (is_xible_helper): Push a non-deferred access check for
2491 the stub objects created by assignable_expr and constructible_expr.
2493 2020-03-17 Jakub Jelinek <jakub@redhat.com>
2495 * pt.c (tsubst): Fix up duplicated word issue in a diagnostic message.
2496 (lookup_template_class_1, tsubst_expr): Fix up duplicated word issue
2498 * parser.c (cp_parser_statement, cp_parser_linkage_specification,
2499 cp_parser_placeholder_type_specifier,
2500 cp_parser_constraint_requires_parens): Likewise.
2501 * name-lookup.c (suggest_alternative_in_explicit_scope): Likewise.
2503 2020-03-15 Iain Sandoe <iain@sandoe.co.uk>
2505 * coroutines.cc (co_await_expander): Fix indentation.
2507 2020-03-14 Jason Merrill <jason@redhat.com>
2510 * pt.c (process_partial_specialization): Error rather than crash on
2511 extra pack expansion.
2513 2020-03-14 Jason Merrill <jason@redhat.com>
2516 * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
2517 DECL_ORIGINAL_TYPE of a typedef.
2519 2020-03-14 Jason Merrill <jason@redhat.com>
2522 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
2523 substituting DECL_ARGUMENTS.
2525 2020-03-14 Jakub Jelinek <jakub@redhat.com>
2527 * logic.cc (formula::formula): Change "a an" to "an" in a comment.
2528 * parser.c (cp_debug_parser): Change "a an" to "an" in a string
2531 2020-03-13 Patrick Palka <ppalka@redhat.com>
2534 * call.c (build_over_call): Use a warning_sentinel to disable
2535 warn_deprecated_decl before calling build_addr_func.
2537 2020-03-12 Jakub Jelinek <jakub@redhat.com>
2540 * decl.c (reshape_init_array_1): Don't unshare constructor if there
2541 aren't any trailing zero elts, otherwise only unshare the first
2544 2020-03-11 Jason Merrill <jason@redhat.com>
2547 * constraint.cc (tsubst_parameter_mapping): Canonicalize type
2550 2020-03-11 Marek Polacek <polacek@redhat.com>
2551 Jason Merrill <jason@redhat.com>
2553 PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
2554 * constexpr.c (cref_has_const_field): New function.
2555 (modifying_const_object_p): Consider a COMPONENT_REF
2556 const only if any of its fields are const.
2557 (cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
2558 as readonly after its initialization has been done.
2560 2020-03-10 Marek Polacek <polacek@redhat.com>
2562 PR c++/94124 - wrong conversion error with non-viable overload.
2563 * decl.c (reshape_init_array_1): Unshare a constructor if we
2564 stripped trailing zero-initializers.
2566 2020-03-10 Jason Merrill <jason@redhat.com>
2569 * pt.c (maybe_instantiate_noexcept): Always update clones.
2571 2020-03-10 Jason Merrill <jason@redhat.com>
2574 * pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
2576 2020-03-10 Jason Merrill <jason@redhat.com>
2582 * cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
2583 66139: Don't split_nonconstant_init. Remove pre_p parameter.
2585 2020-03-09 Marek Polacek <polacek@redhat.com>
2587 PR c++/92031 - bogus taking address of rvalue error.
2588 PR c++/91465 - ICE with template codes in check_narrowing.
2589 PR c++/93870 - wrong error when converting template non-type arg.
2590 PR c++/94068 - ICE with template codes in check_narrowing.
2591 * call.c (convert_like_real): Return IMPLICIT_CONV_EXPR
2592 in a template when not ck_identity and we're dealing with a class.
2593 (convert_like_real) <case ck_ref_bind>: Return IMPLICIT_CONV_EXPR
2594 in a template if we need a temporary.
2595 * decl.c (compute_array_index_type_loc): Remove
2596 instantiate_non_dependent_expr_sfinae call. Call
2597 fold_non_dependent_expr instead of maybe_constant_value.
2598 (build_explicit_specifier): Don't instantiate or create a sentinel
2599 before converting the expression.
2600 * except.c (build_noexcept_spec): Likewise.
2601 * pt.c (convert_nontype_argument): Don't build IMPLICIT_CONV_EXPR.
2602 Set IMPLICIT_CONV_EXPR_NONTYPE_ARG if that's what
2603 build_converted_constant_expr returned.
2604 * typeck2.c (check_narrowing): Call fold_non_dependent_expr instead
2605 of maybe_constant_value.
2607 2020-03-09 Jakub Jelinek <jakub@redhat.com>
2611 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
2613 * constexpr.c (cxx_eval_constant_expression): Do not handle
2614 RROTATE_EXPR and LROTATE_EXPR.
2616 2020-03-09 Marek Polacek <polacek@redhat.com>
2618 PR c++/94050 - ABI issue with alignas on armv7hl.
2619 * class.c (layout_class_type): Don't replace a class's
2620 CLASSTYPE_AS_BASE if their TYPE_USER_ALIGN don't match.
2622 2020-03-09 Bin Cheng <bin.cheng@linux.alibaba.com>
2624 * coroutines.cc (build_actor_fn): Factor out code inserting the
2625 default return_void call to...
2626 (morph_fn_to_coro): ...here, also hoist local var declarations.
2628 2020-03-08 Patrick Palka <ppalka@redhat.com>
2631 * call.c (convert_like_real): Check complain before emitting an error
2632 about binding a bit-field to a reference.
2634 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier)
2635 [TYPENAME_TYPE]: Print the TYPENAME_TYPE_FULLNAME instead of the
2638 2020-03-06 Nathan Sidwell <nathan@acm.org>
2641 * mangle.c (find_substitution): Don't call same_type_p on template
2642 args that cannot match.
2644 2020-03-04 Martin Sebor <msebor@redhat.com>
2647 * tree.c (type_initializer_zero_p): Fail for structs initialized
2650 2020-03-04 Jason Merrill <jason@redhat.com>
2653 * init.c (perform_member_init): Don't do aggregate initialization of
2655 * constexpr.c (cx_check_missing_mem_inits): Don't enforce
2656 initialization of empty field.
2658 2020-03-04 Martin Liska <mliska@suse.cz>
2660 * method.c: Wrap array in ctor with braces in order
2661 to silent clang warnings.
2663 2020-03-03 Jason Merrill <jason@redhat.com>
2664 Marek Polacek <polacek@redhat.com>
2666 PR c++/90505 - mismatch in template argument deduction.
2667 * pt.c (tsubst): Don't reduce the template level of template
2668 parameters when tf_partial.
2670 2020-03-03 Jakub Jelinek <jakub@redhat.com>
2673 * constexpr.c (cxx_eval_constant_expression)
2674 <case TARGET_EXPR, case SAVE_EXPR>: Don't record anything if
2675 *non_constant_p is true.
2677 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
2679 * coroutines.cc (captures_temporary): Strip component_ref
2682 2020-03-03 Jun Ma <JunMa@linux.alibaba.com>
2684 * coroutines.cc (finish_co_await_expr): Build co_await_expr
2685 with unknown_type_node.
2686 (finish_co_yield_expr): Ditto.
2687 *pt.c (type_dependent_expression_p): Set co_await/yield_expr
2688 with unknown type as dependent.
2690 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
2692 * coroutines.cc (struct local_var_info): Adjust to remove the
2693 reference to the captured var, and just to note that this is a
2694 lambda capture proxy.
2695 (transform_local_var_uses): Handle lambda captures specially.
2696 (struct param_frame_data): Add a visited set.
2697 (register_param_uses): Also check for param uses in lambda
2699 (struct local_vars_frame_data): Remove captures list.
2700 (register_local_var_uses): Handle lambda capture proxies by
2701 noting and bypassing them.
2702 (morph_fn_to_coro): Update to remove lifetime extension of
2703 lambda capture-by-copy vars.
2705 2020-03-02 Iain Sandoe <iain@sandoe.co.uk>
2707 * coroutines.cc (build_co_await): Do not build frame
2708 awaitable proxy vars when the co_await expression is
2709 a function parameter or local var.
2710 (co_await_expander): Do not initialise a frame var with
2712 (transform_await_expr): Only substitute the awaitable
2713 frame var if it's needed.
2714 (register_awaits): Do not make frame copies for param
2715 or local vars that are awaitables.
2717 2020-02-28 Jason Merrill <jason@redhat.com>
2719 Implement P2092R0, Disambiguating Nested-Requirements
2720 * parser.c (cp_parser_requirement_parameter_list): Pass
2721 CP_PARSER_FLAGS_TYPENAME_OPTIONAL.
2723 * call.c (build_user_type_conversion_1): Don't look at the second
2724 conversion of a non-viable candidate.
2726 2020-02-28 Jakub Jelinek <jakub@redhat.com>
2728 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
2729 * typeck.c (cp_build_addr_expr_1): Allow taking address of immediate
2730 functions in unevaluated contexts.
2732 2020-02-27 Nathan Sidwell <nathan@acm.org>
2735 * pt.c (template_args_equal): Pass ARGUMENT_PACKS through to
2737 * tree.c (cp_tree_equal): Compare ARGUMENT_PACKS here,
2738 * typeck.c (comptypes): Assert we don't get any argument packs.
2740 * class.c (adjust_clone_args): Correct arg-checking assert.
2741 * typeck.c (comptypes): Assert not nulls.
2743 2020-02-26 Marek Polacek <polacek@redhat.com>
2745 PR c++/93789 - ICE with invalid array bounds.
2746 * decl.c (compute_array_index_type_loc): Don't use the folded
2747 size when folding cleared TREE_CONSTANT.
2749 2020-02-26 Iain Sandoe <iain@sandoe.co.uk>
2751 * class.c (classtype_has_non_deleted_copy_ctor): New.
2752 * coroutines.cc (struct param_info): Keep track of params
2753 that are references, and cache the original type and whether
2754 the DTOR is trivial.
2755 (build_actor_fn): Handle param copies always, and adjust the
2756 handling for references.
2757 (register_param_uses): Only handle uses here.
2758 (classtype_has_non_deleted_copy_ctor): New.
2759 (morph_fn_to_coro): Adjust param copy handling to match n4849
2760 by reordering ahead of the promise CTOR and always making a
2761 frame copy, even if the param is unused in the coroutine body.
2762 * cp-tree.h (classtype_has_non_deleted_copy_ctor): New.
2764 2020-02-26 Patrick Palka <ppalka@redhat.com>
2766 * constraint.cc (finish_constraint_binary_op): Set expr's location range
2767 to the range of its operands.
2768 (satisfy_atom): Pass MAP instead of ARGS to diagnose_atomic_constraint.
2769 (diagnose_trait_expr): Take the instantiated parameter mapping MAP
2770 instead of the corresponding template arguments ARGS and adjust body
2772 (diagnose_requires_expr): Likewise.
2773 (diagnose_atomic_constraint): Likewise. When printing an atomic
2774 constraint expression, print the instantiated parameter mapping
2776 * cxx-pretty-print.cc (cxx_pretty_printer::expression)
2777 [NONTYPE_ARGUMENT_PACK]: Print braces around a NONTYPE_ARGUMENT_PACK.
2778 (cxx_pretty_printer::type_id): Handle TYPE_ARGUMENT_PACK.
2780 2020-02-26 Marek Polacek <polacek@redhat.com>
2782 PR c++/93676 - value-init crash in template.
2783 * init.c (build_new_1): Don't call build_vec_init in a template.
2785 2020-02-26 Marek Polacek <polacek@redhat.com>
2787 PR c++/93862 - ICE with static_cast when converting from int[].
2788 * call.c (reference_compatible_p): No longer static.
2789 * cp-tree.h (reference_compatible_p): Declare.
2790 * typeck.c (build_static_cast_1): Use reference_compatible_p instead
2791 of reference_related_p.
2793 2020-02-26 Marek Polacek <polacek@redhat.com>
2795 PR c++/93803 - ICE with constexpr init and [[no_unique_address]].
2796 * constexpr.c (reduced_constant_expression_p): Don't crash on a null
2799 2020-02-24 Martin Sebor <msebor@redhat.com>
2802 * parser.c (cp_parser_check_class_key): Avoid issuing -Wredundant-tags
2803 in shared C/C++ code in headers.
2804 Remove a duplicate hunk of code.
2806 2020-02-24 Marek Polacek <polacek@redhat.com>
2808 PR c++/93869 - ICE with -Wmismatched-tags.
2809 * parser.c (cp_parser_check_class_key): Check class_key earlier.
2811 2020-02-24 Marek Polacek <polacek@redhat.com>
2813 PR c++/93712 - ICE with ill-formed array list-initialization.
2814 * call.c (next_conversion): Return NULL for ck_aggr.
2815 (build_aggr_conv): Set u.expr instead of u.next.
2816 (build_array_conv): Likewise.
2817 (build_complex_conv): Likewise.
2818 (conv_get_original_expr): Handle ck_aggr.
2820 2020-02-24 Jakub Jelinek <jakub@redhat.com>
2822 P1937R2 - Fixing inconsistencies between const{expr,eval} functions
2823 * call.c (build_over_call): Don't evaluate immediate functions in
2824 unevaluated operands.
2826 2020-02-24 Jason Merrill <jason@redhat.com>
2828 P0780R2: Resolve lambda init-capture pack grammar.
2829 * parser.c (cp_parser_lambda_introducer): Expect &...x=y rather than
2832 2020-02-22 Marek Polacek <polacek@redhat.com>
2835 * decl.c (grokdeclarator): Use %qs in a diagnostic message.
2837 2020-02-21 Martin Sebor <msebor@redhat.com>
2839 PR gcov-profile/93753
2840 * class.c (check_flexarrays): Tighten up a test for potential members
2841 of anonymous structs or unions.
2843 2020-02-20 Martin Sebor <msebor@redhat.com>
2846 * parser.c (cp_parser_check_class_key): Only handle true C++ class-keys.
2848 2020-02-20 Martin Liska <mliska@suse.cz>
2850 PR translation/93841
2851 * config/or1k/or1k.opt: Remove superfluous word.
2852 * doc/invoke.texi: Likewise.
2854 2020-02-20 Martin Liska <mliska@suse.cz>
2856 PR translation/93838
2857 * parser.c (cp_parser_decl_specifier_seq): Remove trailing space.
2859 2020-02-19 Marek Polacek <polacek@redhat.com>
2861 PR c++/93169 - wrong-code with a non-constexpr constructor.
2862 * constexpr.c (cxx_eval_call_expression): Only set TREE_READONLY
2863 on constant CONSTRUCTORs.
2865 2020-02-15 Marek Polacek <polacek@redhat.com>
2867 PR c++/93710 - poor diagnostic for array initializer.
2868 * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc
2871 2020-02-15 Jason Merrill <jason@redhat.com>
2874 * pt.c (any_template_parm_r): Look into lambda body.
2877 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
2879 2020-02-14 Jakub Jelinek <jakub@redhat.com>
2882 * class.c (enum_min_precision): Change prec type from int to int &.
2885 * cp-tree.h (enum cp_tree_index): Add CPTI_FALLBACK_DFLOAT32_TYPE,
2886 CPTI_FALLBACK_DFLOAT64_TYPE and CPTI_FALLBACK_DFLOAT128_TYPE.
2887 (fallback_dfloat32_type, fallback_dfloat64_type,
2888 fallback_dfloat128_type): Define.
2889 * mangle.c (write_builtin_type): Handle fallback_dfloat*_type like
2891 * rtti.c (emit_support_tinfos): Emit DFP typeinfos even when dfp
2892 is disabled for compatibility.
2894 2020-02-13 Jason Merrill <jason@redhat.com>
2897 * name-lookup.c (matching_fn_p): A function does not match a
2902 * tree.c (decl_linkage): Always lk_none for locals.
2904 2020-02-12 Jason Merrill <jason@redhat.com>
2908 * tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
2909 * pt.c (find_parameter_packs_r): Not here.
2911 2020-02-12 Iain Sandoe <iain@sandoe.co.uk>
2913 * coroutines.cc (build_actor_fn): Implement deallocation function
2914 selection per n4849, dcl.fct.def.coroutine bullet 12.
2915 (morph_fn_to_coro): Implement allocation function selection per
2916 n4849, dcl.fct.def.coroutine bullets 9 and 10.
2918 2020-02-12 Marek Polacek <polacek@redhat.com>
2920 PR c++/93684 - ICE-on-invalid with broken attribute.
2921 * parser.c (cp_parser_std_attribute): Peek a token first before
2924 2020-02-11 Jason Merrill <jason@redhat.com>
2927 * class.c (add_implicitly_declared_members): Use do_friend.
2928 * method.c (implicitly_declare_fn): Fix friend handling.
2929 (decl_remember_implicit_trigger_p): New.
2930 (synthesize_method): Use it.
2931 * decl2.c (mark_used): Use it.
2933 2020-02-11 Jason Merrill <jason@redhat.com>
2937 * constexpr.c (maybe_constant_value): Correct earlier change.
2938 (cxx_eval_binary_expression) [SPACESHIP_EXPR]: Pass lval through.
2939 * method.c (genericize_spaceship): Wrap result in TARGET_EXPR.
2941 2020-02-12 Patrick Palka <ppalka@redhat.com>
2945 * type-utils.h (find_type_usage): Refactor to take a tree * and to
2946 return a tree *, and update documentation accordingly.
2947 * pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
2948 decltype(auto) node.
2949 (make_constrained_decltype_auto): No need to explicitly set
2950 AUTO_IS_DECLTYPE anymore.
2951 (splice_late_return_type): Use find_type_usage to find and
2952 replace a possibly nested auto node instead of using is_auto.
2953 Check test for is_auto into an assert when deciding whether
2954 to late_return_type.
2955 (type_uses_auto): Adjust the call to find_type_usage.
2956 * parser.c (cp_parser_decltype): No need to explicitly set
2957 AUTO_IS_DECLTYPE anymore.
2959 * error.c (dump_decl) [CONCEPT_DECL]: Use dump_simple_decl.
2960 (dump_simple_decl): Handle standard concept definitions as well as
2961 variable concept definitions.
2963 2020-02-10 Jakub Jelinek <jakub@redhat.com>
2966 * error.c (dump_decl_name): Fix up last argument to strncmp.
2968 2020-02-10 Jason Merrill <jason@redhat.com>
2971 * tree.c (array_of_unknown_bound_p): New.
2972 * init.c (perform_member_init): Do nothing for flexible arrays.
2974 2020-02-09 Jakub Jelinek <jakub@redhat.com>
2977 * constexpr.c (cxx_eval_constant_expression): If obj is heap var with
2978 ARRAY_TYPE, use the element type. Punt if objtype after that is not
2981 2020-02-08 Jason Merrill <jason@redhat.com>
2984 * expr.c (fold_for_warn): Call maybe_constant_value.
2985 * constexpr.c (struct constexpr_ctx): Add uid_sensitive bit-field.
2986 (maybe_constant_value): Add uid_sensitive parm.
2987 (get_fundef_copy): Don't copy if it's true.
2988 (cxx_eval_call_expression): Don't instantiate if it's true.
2989 (cxx_eval_outermost_constant_expr): Likewise.
2992 * constexpr.c (maybe_constant_value): Don't unshare if the cached
2993 value is the same as the argument.
2995 * typeck.c (maybe_warn_about_returning_address_of_local): Add
2998 * typeck2.c (process_init_constructor): Also clear TREE_SIDE_EFFECTS
3001 2020-02-08 Jakub Jelinek <jakub@redhat.com>
3004 * constexpr.c (find_array_ctor_elt): If last element has no index,
3005 for flag_checking verify all elts have no index. If i is within the
3006 elts, return it directly, if it is right after the last elt, append
3007 if NULL index, otherwise force indexes on all elts.
3008 (cxx_eval_store_expression): Allow cep->index to be NULL.
3010 2020-02-07 Marek Polacek <polacek@redhat.com>
3012 PR c++/92947 - Paren init of aggregates in unevaluated context.
3013 * call.c (build_new_method_call_1): Don't check
3014 cp_unevaluated_operand. Check the return value of digest_init.
3016 2020-02-06 Jason Merrill <jason@redhat.com>
3019 * tree.c (cp_walk_subtrees): Walk into type template arguments.
3020 * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p
3021 instead of TYPE_ALIAS_P.
3022 * pt.c (push_template_decl_real): Likewise.
3023 (find_parameter_packs_r): Likewise. Remove dead code.
3024 * error.c (find_typenames_r): Remove dead code.
3026 2020-02-06 Jason Merrill <jason@redhat.com>
3029 * parser.c (cp_parser_constraint_primary_expression): Do the main
3030 parse non-tentatively.
3032 2020-02-06 Marek Polacek <polacek@redhat.com>
3034 PR c++/93597 - ICE with lambda in operator function.
3035 * name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.
3037 2020-02-05 Jason Merrill <jason@redhat.com>
3040 * pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
3041 handling of TREE_CHAIN for empty pack.
3043 2020-02-05 Jakub Jelinek <jakub@redhat.com>
3046 * semantics.c (cp_build_vec_convert): Call decay_conversion on arg
3047 prior to passing it to c_build_vec_convert.
3049 2020-02-05 Marek Polacek <polacek@redhat.com>
3051 PR c++/93559 - ICE with CONSTRUCTOR flags verification.
3052 * decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
3055 2020-02-05 Jason Merrill <jason@redhat.com>
3058 * decl.c (grokdeclarator): Reject field of current class type even
3061 2020-02-05 Bin Cheng <bin.cheng@linux.alibaba.com>
3063 * coroutines.cc (maybe_promote_captured_temps): Increase the index
3064 number for temporary variables' name.
3066 2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
3068 * coroutines.cc (build_co_await): Call convert_from_reference
3069 to wrap co_await_expr with indirect_ref which avoid
3070 reference/non-reference type confusion.
3072 (co_await_expander): Sink to call_expr if await_resume
3073 is wrapped by indirect_ref.
3075 2020-02-04 Jason Merrill <jason@redhat.com>
3078 * constraint.cc (satisfy_declaration_constraints): Check return
3079 value of push_tinst_level.
3082 * constexpr.c (cxx_eval_array_reference): {}-initialize missing
3083 elements instead of value-initializing them.
3086 * init.c (perform_member_init): Simplify.
3087 * constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
3089 (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
3091 2020-02-04 Iain Sandoe <iain@sandoe.co.uk>
3093 * coroutines.cc (find_promise_type): Delete unused forward
3095 (struct coroutine_info): Add a bool for no promise type error.
3096 (coro_promise_type_found_p): Only emit the error for a missing
3097 promise once in each affected coroutine.
3099 2020-02-03 Jason Merrill <jason@redhat.com>
3102 * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
3103 defer loading the value of a reference.
3105 2020-02-03 Jason Merrill <jason@redhat.com>
3108 * constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
3110 [COMPONENT_REF]: A member function reference doesn't use the object
3113 2020-02-03 Iain Sandoe <iain@sandoe.co.uk>
3116 * coroutines.cc (struct coroutine_info): Add a bool flag to note
3117 that we emitted an error for a bad function return type.
3118 (get_coroutine_info): Tolerate an unset info table in case of
3120 (find_coro_traits_template_decl): In case of error or if we didn't
3121 find a type template, note we emitted the error and suppress
3123 (find_coro_handle_template_decl): Likewise.
3124 (instantiate_coro_traits): Only check for error_mark_node in the
3125 return from lookup_qualified_name.
3126 (coro_promise_type_found_p): Reorder initialization so that we check
3127 for the traits and their usability before allocation of the info
3128 table. Check for a suitable return type and emit a diagnostic for
3129 here instead of relying on the lookup machinery. This allows the
3130 error to have a better location, and means we can suppress multiple
3132 (coro_function_valid_p): Re-check for a valid promise (and thus the
3133 traits) before proceeding. Tolerate missing info as a fatal error.
3135 2020-02-03 Jason Merrill <jason@redhat.com>
3138 * cp-gimplify.c (predeclare_vla): New.
3139 (cp_genericize_r) [NOP_EXPR]: Call it.
3141 2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
3143 * coroutines.cc (transform_await_wrapper): Set actor funcion as
3144 new context of label_decl.
3145 (build_actor_fn): Fill new field of await_xform_data.
3147 2020-02-02 Marek Polacek <polacek@redhat.com>
3149 PR c++/93530 - ICE on invalid alignas in a template.
3150 * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
3153 2020-01-31 Jason Merrill <jason@redhat.com>
3156 * semantics.c (process_outer_var_ref): Capture VLAs even in
3157 unevaluated context.
3160 * decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
3161 non-aggregate elements.
3162 (reshape_init_array): Add first_initializer_p parm.
3163 (reshape_init_r): Change first_initializer_p from bool to tree.
3164 (reshape_init): Pass init to it.
3167 * parser.c (cp_parser_initializer_list): Suppress location wrappers
3170 2020-01-29 Jason Merrill <jason@redhat.com>
3173 * pt.c (tsubst_copy_and_build) [EQ_EXPR]: Only suppress warnings if
3174 the expression was dependent before substitution.
3176 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
3178 * coroutines.cc (act_des_fn): New.
3179 (morph_fn_to_coro): Call act_des_fn to build actor/destroy decls.
3180 Access promise via actor function's frame pointer argument.
3181 (build_actor_fn, build_destroy_fn): Use frame pointer argument.
3183 2020-01-30 Bin Cheng <bin.cheng@linux.alibaba.com>
3185 * coroutines.cc (co_await_expander): Handle type conversion case.
3187 2020-01-29 Jason Merrill <jason@redhat.com>
3192 * parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
3193 a trailing return type.
3194 (cp_parser_lambda_declarator_opt): Parse C++11 attributes before
3197 2020-01-29 Marek Polacek <polacek@redhat.com>
3199 PR c++/91754 - Fix template arguments comparison with class NTTP.
3200 * pt.c (class_nttp_const_wrapper_p): New.
3201 (template_args_equal): See through class_nttp_const_wrapper_p
3204 2020-01-29 Marek Polacek <polacek@redhat.com>
3206 PR c++/92948 - Fix class NTTP with template arguments.
3207 * pt.c (convert_nontype_argument): Use IMPLICIT_CONV_EXPR when
3208 converting a value-dependent expression to a class type.
3209 (tsubst_copy) <case VIEW_CONVERT_EXPR>: Allow IMPLICIT_CONV_EXPR
3210 as the result of the tsubst_copy call.
3212 2020-01-29 Jakub Jelinek <jakub@redhat.com>
3215 * cp-gimplify.c (cxx_omp_predetermined_sharing): Return
3216 OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.
3218 2020-01-28 Jason Merrill <jason@redhat.com>
3221 * parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
3225 * decl2.c (copy_linkage): Do copy DECL_ONE_ONLY and DECL_WEAK.
3228 * call.c (build_user_type_conversion_1): Allow a template conversion
3229 returning an rvalue reference to bind directly to an lvalue.
3232 * decl.c (grokdeclarator): Propagate eh spec from typedef.
3234 2020-01-28 Martin Liska <mliska@suse.cz>
3237 * pt.c (redeclare_class_template): Group couple of
3238 errors and inform messages with auto_diagnostic_group.
3240 2020-01-28 Martin Liska <mliska@suse.cz>
3243 * pt.c (redeclare_class_template): Use inform
3244 for the second location.
3246 2020-01-27 Jason Merrill <jason@redhat.com>
3249 * pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
3251 2020-01-27 Iain Sandoe <iain@sandoe.co.uk>
3254 * coroutines.cc (morph_fn_to_coro): Check the ramp return
3255 value when it is constructed from the 'get return object'.
3257 2020-01-27 Nathan Sidwell <nathan@acm.org>
3260 * name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
3262 2020-01-26 Jason Merrill <jason@redhat.com>
3265 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and
3266 temporarily enable -Wsystem-headers. Change second warning to
3270 * semantics.c (finish_call_expr): Don't call
3271 instantiate_non_dependent_expr before warn_for_memset.
3273 2020-01-25 Marek Polacek <polacek@redhat.com>
3275 PR c++/93414 - poor diagnostic for dynamic_cast in constexpr context.
3276 * constexpr.c (cxx_eval_dynamic_cast_fn): Add a reference
3277 dynamic_cast diagnostic.
3279 2020-01-24 Jason Merrill <jason@redhat.com>
3281 PR c++/93400 - ICE with constrained friend.
3282 * constraint.cc (maybe_substitute_reqs_for): New.
3283 * decl.c (function_requirements_equivalent_p): Call it.
3284 * pt.c (tsubst_friend_function): Only substitute
3285 TEMPLATE_PARMS_CONSTRAINTS.
3286 (tsubst_template_parms): Copy constraints.
3288 2020-01-24 Jason Merrill <jason@redhat.com>
3290 PR c++/93279 - ICE with lambda in member operator.
3291 * name-lookup.c (maybe_save_operator_binding): Don't remember
3292 class-scope bindings.
3294 2020-01-24 Jason Merrill <jason@redhat.com>
3296 PR c++/93377 - ICE with member alias in constraint.
3297 * pt.c (any_template_parm_r): Look at template arguments for all
3298 aliases, not only alias templates.
3300 2020-01-24 Marek Polacek <polacek@redhat.com>
3302 PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
3303 * pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.
3305 2020-01-24 Jason Merrill <jason@redhat.com>
3307 PR c++/92852 - ICE with generic lambda and reference var.
3308 * constexpr.c (maybe_constant_value): Likewise.
3310 2020-01-23 Paolo Carlini <paolo.carlini@oracle.com>
3313 * parser.c (cp_parser_nested_name_specifier_opt): Properly
3314 diagnose concept-ids.
3316 2020-01-23 Jason Merrill <jason@redhat.com>
3318 PR c++/93331 - ICE with __builtin_strchr.
3319 * constexpr.c (cxx_eval_builtin_function_call): Use the original
3320 argument if we didn't manage to extract a STRING_CST.
3322 PR c++/93345 - ICE with defaulted dtor and template.
3324 * decl.c (cxx_maybe_build_cleanup): Don't try to set
3325 throwing_cleanup in a template.
3327 2020-01-22 Marek Polacek <polacek@redhat.com>
3329 PR c++/92907 - noexcept does not consider "const" in member functions.
3330 * g++.dg/cpp0x/noexcept56.C: New test.
3332 2020-01-22 Marek Polacek <polacek@redhat.com>
3334 PR c++/93324 - ICE with -Wall on constexpr if.
3335 * semantics.c (is_std_constant_evaluated_p): Check fndecl.
3337 2020-01-22 Patrick Palka <ppalka@redhat.com>
3339 * constraint.cc (get_mapped_args): Avoid using auto_vec
3340 as a vector element. Release the vectors inside the lists
3342 * parser.c (cp_literal_operator_id): Free the buffer.
3344 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
3346 * coroutines.cc (finish_co_await_expr): Add error check on return
3347 value of build_co_await.
3348 (finish_co_yield_expr,): Ditto.
3350 2020-01-22 Jun Ma <JunMa@linux.alibaba.com>
3352 * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
3353 (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
3354 (build_co_await): Use lookup_awaitable_member instead of lookup_member.
3356 2020-01-21 Jason Merrill <jason@redhat.com>
3358 PR c++/60855 - ICE with sizeof VLA capture.
3359 * lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
3361 PR c++/90732 - ICE with VLA capture and generic lambda.
3362 * pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
3364 2020-01-21 Iain Sandoe <iain@sandoe.co.uk>
3365 Bin Cheng <bin.cheng@linux.alibaba.com>
3367 * coroutines.cc (coro_promise_type_found_p): Check for NULL return
3368 from complete_type_or_else.
3369 (register_param_uses): Likewise.
3370 (build_co_await): Do not try to use complete_type_or_else for void
3371 types, otherwise for incomplete types, check for NULL return from
3372 complete_type_or_else.
3374 2020-01-21 Jason Merrill <jason@redhat.com>
3376 PR c++/91476 - anon-namespace reference temp clash between TUs.
3377 * decl2.c (copy_linkage): Factor out of get_guard.
3378 * call.c (make_temporary_var_for_ref_to_temp): Use it.
3379 * decl.c (cp_finish_decomp): Use it.
3380 (cp_finish_decl): determine_visibility sooner.
3382 2020-01-21 Bin Cheng <bin.cheng@linux.alibaba.com>
3384 * coroutines.cc (finish_co_await_expr): Set return value flag.
3385 (finish_co_yield_expr, morph_fn_to_coro): Ditto.
3387 2020-01-19 Jason Merrill <jason@redhat.com>
3389 PR c++/33799 - destroy return value, take 2.
3390 * cp-tree.h (current_retval_sentinel): New macro.
3391 (struct language_function): Add throwing_cleanup bitfield.
3392 * decl.c (cxx_maybe_build_cleanup): Set it.
3393 * except.c (maybe_set_retval_sentinel)
3394 (maybe_splice_retval_cleanup): New functions.
3395 * parser.c (cp_parser_compound_statement): Call
3396 maybe_splice_retval_cleanup.
3397 * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
3399 * parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
3401 2020-01-18 Jakub Jelinek <jakub@redhat.com>
3403 * coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
3404 but non-NO_DOLLAR_IN_LABEL case build.
3406 2020-01-18 Iain Sandoe <iain@sandoe.co.uk>
3408 * Make-lang.in: Add coroutines.o.
3409 * cp-tree.h (lang_decl-fn): coroutine_p, new bit.
3410 (DECL_COROUTINE_P): New.
3411 * lex.c (init_reswords): Enable keywords when the coroutine flag
3413 * operators.def (co_await): New operator.
3414 * call.c (add_builtin_candidates): Handle CO_AWAIT_EXPR.
3415 (op_error): Likewise.
3416 (build_new_op_1): Likewise.
3417 (build_new_function_call): Validate coroutine builtin arguments.
3418 * constexpr.c (potential_constant_expression_1): Handle
3419 CO_AWAIT_EXPR, CO_YIELD_EXPR, CO_RETURN_EXPR.
3420 * coroutines.cc: New file.
3421 * cp-objcp-common.c (cp_common_init_ts): Add CO_AWAIT_EXPR,
3422 CO_YIELD_EXPR, CO_RETRN_EXPR as TS expressions.
3423 * cp-tree.def (CO_AWAIT_EXPR, CO_YIELD_EXPR, (CO_RETURN_EXPR): New.
3424 * cp-tree.h (coro_validate_builtin_call): New.
3425 * decl.c (emit_coro_helper): New.
3426 (finish_function): Handle the case when a function is found to
3427 be a coroutine, perform the outlining and emit the outlined
3428 functions. Set a bit to signal that this is a coroutine component.
3429 * parser.c (enum required_token): New enumeration RT_CO_YIELD.
3430 (cp_parser_unary_expression): Handle co_await.
3431 (cp_parser_assignment_expression): Handle co_yield.
3432 (cp_parser_statement): Handle RID_CO_RETURN.
3433 (cp_parser_jump_statement): Handle co_return.
3434 (cp_parser_operator): Handle co_await operator.
3435 (cp_parser_yield_expression): New.
3436 (cp_parser_required_error): Handle RT_CO_YIELD.
3437 * pt.c (tsubst_copy): Handle CO_AWAIT_EXPR.
3438 (tsubst_expr): Handle CO_AWAIT_EXPR, CO_YIELD_EXPR and
3440 * tree.c (cp_walk_subtrees): Likewise.
3442 2020-01-17 Jason Merrill <jason@redhat.com>
3444 PR c++/92531 - ICE with noexcept(lambda).
3445 * pt.c (uses_template_parms): Don't try to enumerate all the
3448 2020-01-17 Jakub Jelinek <jakub@redhat.com>
3451 * parser.c (cp_parser_template_name): Look up deprecated attribute
3452 in DECL_TEMPLATE_RESULT or its type's attributes.
3454 2020-01-16 Jason Merrill <jason@redhat.com>
3456 PR c++/93286 - ICE with __is_constructible and variadic template.
3457 * pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
3458 (tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
3460 PR c++/93280 - ICE with aggregate assignment and DMI.
3461 * init.c (get_nsdmi): Set TARGET_EXPR_DIRECT_INIT_P here.
3462 * typeck2.c (digest_nsdmi_init): Not here.
3464 2020-01-15 Paolo Carlini <paolo.carlini@oracle.com>
3467 * cp-tree.h (is_constrained_auto): New.
3468 * parser.c (cp_parser_maybe_commit_to_declaration): Correctly
3469 handle concept-check expressions; take a cp_decl_specifier_seq*
3471 (cp_parser_condition): Update call.
3472 (cp_parser_simple_declaration): Likewise.
3473 (cp_parser_placeholder_type_specifier): Correctly handle
3474 concept-check expressions.
3476 2020-01-15 Jason Merrill <jason@redhat.com>
3479 PR c++/33799 - destroy return value if local cleanup throws.
3480 * cp-tree.h (current_retval_sentinel): New macro.
3481 * decl.c (start_preparsed_function): Set up cleanup for retval.
3482 * typeck.c (check_return_expr): Set current_retval_sentinel.
3484 PR c++/93257 - consteval void function.
3485 * constexpr.c (verify_constant): Allow void_node.
3487 PR c++/92871 - bad code with xvalue and GNU ?: extension.
3488 * call.c (prevent_lifetime_extension): New.
3489 (build_conditional_expr_1): Use it.
3491 2020-01-14 Nathan Sidwell <nathan@acm.org>
3494 * pt.c (retrieve_specialization): Use get_template_info, not open
3498 * pt.c (retrieve_specialization): Get the TI from the decl or the
3499 classtype as appropriate.
3501 2020-01-14 David Malcolm <dmalcolm@redhat.com>
3503 * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p):
3504 New static constant.
3505 * cp-tree.h (named_decl_hash::empty_zero_p): Likewise.
3506 (struct named_label_hash::empty_zero_p): Likewise.
3507 * decl2.c (mangled_decl_hash::empty_zero_p): Likewise.
3509 2020-01-14 Jason Merrill <jason@redhat.com>
3511 PR c++/92590 - wrong handling of inherited default ctor.
3512 * class.c (add_method): A constrained inherited ctor doesn't hide an
3513 implicit derived ctor.
3515 PR c++/92552 - ICE with inherited constrained default ctor.
3516 * pt.c (instantiate_class_template_1): Copy
3517 TYPE_HAS_USER_CONSTRUCTOR.
3518 PR c++/91930 - ICE with constrained inherited default ctor.
3519 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
3520 for inherited constructor.
3521 PR c++/92594 - ICE with inherited trivial default ctor.
3522 * method.c (trivial_fn_p): Treat an inherited default constructor
3523 like a normal default constructor.
3525 PR c++/92594 - ICE with inherited trivial default ctor.
3526 * method.c (trivial_fn_p): Treat an inherited default constructor
3527 like a normal default constructor.
3529 PR c++/92009 - ICE with punning of typeid.
3530 * rtti.c (get_tinfo_desc): Call xref_basetypes.
3531 * constexpr.c (cxx_fold_indirect_ref): Don't strip
3534 2020-01-13 Jason Merrill <jason@redhat.com>
3536 PR c++/92746 - ICE with noexcept of function concept check.
3537 * except.c (check_noexcept_r): Handle concept-check.
3539 PR c++/92582 - ICE with member template as requirement.
3540 * pt.c (struct find_template_parameter_info): Add ctx_parms.
3541 (any_template_parm_r): Handle TEMPLATE_DECL.
3542 (find_template_parameters): Take parms instead of their depth.
3543 * constraint.cc (build_parameter_mapping): Pass them.
3545 PR c++/33799 - destroy return value if local cleanup throws.
3546 * cp-tree.h (current_retval_sentinel): New macro.
3547 * decl.c (start_preparsed_function): Set up cleanup for retval.
3548 * typeck.c (check_return_expr): Set current_retval_sentinel.
3550 PR c++/93238 - short right-shift with enum.
3551 * typeck.c (cp_build_binary_op): Use folded op1 for short_shift.
3553 2020-01-10 Jason Merrill <jason@redhat.com>
3555 * typeck.c (cp_build_binary_op): Restore short_shift code.
3557 PR c++/93143 - incorrect tree sharing with constexpr.
3558 * constexpr.c (cxx_eval_outermost_constant_expr): Don't assume
3559 CONSTRUCTORs are already unshared.
3561 PR c++/93173 - incorrect tree sharing.
3563 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr): Use
3564 copy_if_shared after cp_genericize_tree.
3565 * typeck2.c (split_nonconstant_init): Don't unshare here.
3567 2020-01-08 Jason Merrill <jason@redhat.com>
3569 * cp-gimplify.c (cp_gimplify_expr) [TARGET_EXPR]: Check
3570 TARGET_EXPR_DIRECT_INIT_P.
3571 * constexpr.c (cxx_eval_constant_expression): Likewise.
3573 2020-01-08 Jason Merrill <jason@redhat.com>
3575 PR c++/91369 - constexpr destructor and member initializer.
3576 * constexpr.c (cxx_eval_store_expression): Look through TARGET_EXPR
3577 when not preevaluating.
3579 2020-01-08 Jason Merrill <jason@redhat.com>
3581 * constexpr.c (cxx_eval_call_expression): Remove DECL_BY_REFERENCE
3584 2020-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3586 * init.c (build_new): Add location_t parameter and use it throughout.
3587 (build_raw_new_expr): Likewise.
3588 * parser.c (cp_parser_new_expression): Pass the combined_loc.
3589 * pt.c (tsubst_copy_and_build): Adjust call.
3590 * cp-tree.h: Update declarations.
3592 2020-01-07 Jason Merrill <jason@redhat.com>
3594 PR c++/47877 - -fvisibility-inlines-hidden and member templates.
3595 * decl2.c (determine_visibility): -fvisibility-inlines-hidden beats
3596 explicit class visibility for a template.
3598 2020-01-07 Richard Sandiford <richard.sandiford@arm.com>
3600 * mangle.c (mangle_type_attribute_p): New function, split out from...
3601 (write_CV_qualifiers_for_type): ...here. Don't mangle attributes
3602 that contain a space.
3604 2020-01-07 Jakub Jelinek <jakub@redhat.com>
3607 * constexpr.c (struct constexpr_global_ctx): Add heap_alloc_count
3608 member, initialize it to zero in ctor.
3609 (cxx_eval_call_expression): Bump heap_dealloc_count when deleting
3610 a heap object. Don't cache calls to functions which allocate some
3611 heap objects and don't deallocate them or deallocate some heap
3612 objects they didn't allocate.
3614 2020-01-06 Jason Merrill <jason@redhat.com>
3616 PR c++/92552 - ICE with inherited constrained default ctor.
3617 * pt.c (instantiate_class_template_1): Copy
3618 TYPE_HAS_USER_CONSTRUCTOR.
3619 * class.c (one_inherited_ctor): Don't set it here.
3621 2020-01-06 Andrew Sutton <asutton@lock3software.com>
3623 PR c++/92739 - parsing requires clause with attributes.
3624 * parser.c (cp_parser_constraint_requires_parens): Exclude
3625 attributes as postfix expressions.
3627 2020-01-05 Jakub Jelinek <jakub@redhat.com>
3630 * parser.c (cp_parser_check_class_key): Disable access checks for the
3632 (cp_parser_maybe_warn_enum_key): Likewise. Return early if
3633 !warn_redundant_tags.
3635 2010-01-05 Jakub Jelinek <jakub@redhat.com>
3638 * cp-gimplify.c (cp_gimplify_init_expr): Don't look through
3639 TARGET_EXPR if it has been gimplified already.
3641 2020-01-03 Jason Merrill <jason@redhat.com>
3643 PR c++/93033 - incorrect tree node sharing with array init.
3644 * typeck2.c (split_nonconstant_init): Unshare non-decl.
3645 * cp-gimplify.c (cp_gimplify_init_expr): Only split if -fexceptions.
3647 2020-01-02 Jason Merrill <jason@redhat.com>
3649 * pt.c (invalid_nontype_parm_type_p): Reject class placeholder in
3652 2020-01-02 Jakub Jelinek <jakub@redhat.com>
3655 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
3656 has not been found, rather than error_mark_node.
3658 2020-01-01 Jakub Jelinek <jakub@redhat.com>
3660 Update copyright years.
3662 Copyright (C) 2020 Free Software Foundation, Inc.
3664 Copying and distribution of this file, with or without modification,
3665 are permitted in any medium without royalty provided the copyright
3666 notice and this notice are preserved.