public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96316] New: [coroutines] Promise parameter preview - looking for promise constructor with implicit lambda argument
@ 2020-07-25  6:21 skdkksfadkadkk at gmail dot com
  2020-08-04 15:31 ` [Bug c++/96316] " iains at gcc dot gnu.org
  2020-08-04 18:00 ` skdkksfadkadkk at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: skdkksfadkadkk at gmail dot com @ 2020-07-25  6:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96316

            Bug ID: 96316
           Summary: [coroutines] Promise parameter preview - looking for
                    promise constructor with implicit lambda argument
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: skdkksfadkadkk at gmail dot com
  Target Milestone: ---

Created attachment 48926
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48926&action=edit
Code example

The feature "promise parameter preview" works wrong with lambda function,
because lambda also has an implicit argument, so compiler tries to find promise
type constructor, that has this implicit argument with other explicit lambda
arguments.

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

* [Bug c++/96316] [coroutines] Promise parameter preview - looking for promise constructor with implicit lambda argument
  2020-07-25  6:21 [Bug c++/96316] New: [coroutines] Promise parameter preview - looking for promise constructor with implicit lambda argument skdkksfadkadkk at gmail dot com
@ 2020-08-04 15:31 ` iains at gcc dot gnu.org
  2020-08-04 18:00 ` skdkksfadkadkk at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: iains at gcc dot gnu.org @ 2020-08-04 15:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96316

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---

In fact, this is correct operation; decided jointly between the implementors
during WG21 sessions as intended behaviour.

Essentially, the lambda object pointer is treated the same way as the 'this'
pointer for a regular method (so that the traits, parameter preview and
allocator lookup are all passed a reference to the object).

At present, not sure if clang has made the amendment - but MSVC and GCC should
both comply with the intention.

If you believe that there's some other issue with this please reopen.

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

* [Bug c++/96316] [coroutines] Promise parameter preview - looking for promise constructor with implicit lambda argument
  2020-07-25  6:21 [Bug c++/96316] New: [coroutines] Promise parameter preview - looking for promise constructor with implicit lambda argument skdkksfadkadkk at gmail dot com
  2020-08-04 15:31 ` [Bug c++/96316] " iains at gcc dot gnu.org
@ 2020-08-04 18:00 ` skdkksfadkadkk at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: skdkksfadkadkk at gmail dot com @ 2020-08-04 18:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96316

--- Comment #2 from skdkksfadkadkk at gmail dot com ---
Got it, thanks. I was confused by clang's behavior because it doesn't require
implicit argument, pointing on lambda instance.
One more question: how this implicit argument should be declared properly in
promise constructor - what type this argument should be?
For now i only see the way to declare it as a template, but may be there is
another way to declare it's type explicitly, without templates?

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

end of thread, other threads:[~2020-08-04 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25  6:21 [Bug c++/96316] New: [coroutines] Promise parameter preview - looking for promise constructor with implicit lambda argument skdkksfadkadkk at gmail dot com
2020-08-04 15:31 ` [Bug c++/96316] " iains at gcc dot gnu.org
2020-08-04 18:00 ` skdkksfadkadkk 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).