public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "netcan1996 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/103358] New: what is the first constructor argument of lambda coroutine promise_type?
Date: Mon, 22 Nov 2021 12:36:02 +0000 [thread overview]
Message-ID: <bug-103358-4@http.gcc.gnu.org/bugzilla/> (raw)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103358
Bug ID: 103358
Summary: what is the first constructor argument of lambda
coroutine promise_type?
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: netcan1996 at gmail dot com
Target Milestone: ---
the C++20 standard(N4858) says:
> promise-constructor-arguments is determined as follows: overload resolution is performed on a promise
constructor call created by assembling an argument list with lvalues p1 . . .
pn. If a viable constructor is
found (12.4.3), then promise-constructor-arguments is (p1 , . . . , pn),
otherwise promise-constructor-
arguments is empty.
I tested gcc-12 coroutine feature, when I use the free coroutine function,
arguments are that function, but when I use lambda coroutine, the first
argument looks strange, the rest arguments are the same as lambda.
```cpp
auto test = [](int, char, double) -> task<void> {
co_return;
};
```
the promise_type dumps all arguments type:
```cpp
template<typename ...T>
promise_type(T&&... args) {
dump<T...> {};
}
```
T = {const<lambda(int, char, double)>&&, int&, char&, double&} here, what is
the type `const<lambda(int, char, double)>&&`?
next reply other threads:[~2021-11-22 12:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 12:36 netcan1996 at gmail dot com [this message]
2021-12-17 17:20 ` [Bug c++/103358] " iains at gcc dot gnu.org
2021-12-18 13:04 ` netcan1996 at gmail dot com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-103358-4@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).