cplusplus / cplusplus/draft

[dcl.fct.def.coroutine]: Initialization of the copy of a parameter of a coroutine

Open
#7,383 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cwg not-editorial
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

[dcl.fct.def.coroutine] paragraph 13 states the following:

When a coroutine is invoked, after initializing its parameters ([expr.call]), a copy is created for each coroutine parameter. For a parameter of type cv T, the copy is a variable of type cv T with automatic storage duration that is direct-initialized from an xvalue of type T referring to the parameter. [...]

Considering the following coroutine:

task<void> f(int& p)
{
   ...
}

the copy of the parameter p has type int& and it is initialized with an xvalue, which should not be legal.

Is there something else that I might be missing?

Thank you!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with [dcl.fct.def.coroutine] paragraph 13, then compare its wording with the parameter initialization rules referenced by [expr.call]. Determine whether the wording correctly covers a reference parameter such as int& p; done means resolving the question with clarified standard wording or an accepted explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.