public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103358] New: what is the first constructor argument of lambda coroutine promise_type?
@ 2021-11-22 12:36 netcan1996 at gmail dot com
  2021-12-17 17:20 ` [Bug c++/103358] " iains at gcc dot gnu.org
  2021-12-18 13:04 ` netcan1996 at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: netcan1996 at gmail dot com @ 2021-11-22 12:36 UTC (permalink / raw)
  To: gcc-bugs

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)>&&`?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-18 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 12:36 [Bug c++/103358] New: what is the first constructor argument of lambda coroutine promise_type? netcan1996 at gmail dot com
2021-12-17 17:20 ` [Bug c++/103358] " iains at gcc dot gnu.org
2021-12-18 13:04 ` netcan1996 at gmail dot com

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).