public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94760] New: coroutines: mismatch between traits and promise parameter preview.
@ 2020-04-25 14:54 iains at gcc dot gnu.org
2020-04-25 15:00 ` [Bug c++/94760] " iains at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2020-04-25 14:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94760
Bug ID: 94760
Summary: coroutines: mismatch between traits and promise
parameter preview.
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: iains at gcc dot gnu.org
Target Milestone: ---
Created attachment 48374
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48374&action=edit
fix under test
There was considerable confusion about how the various implementations
had interpreted the passing of 'this' and lambda capture object
pointers to traits lookup and the promise methods (constructor and
allocator)
In response, we changed the argument passed to the promise parameter
preview to match a reference to *this. That has made things inconsistent
and we need to match it in the traits
the following code should compile, but fails unable to find a suitable
promise CTOR.
====
struct Fake {} ;
template<typename R, typename CallOp, typename ...T>
struct std::coroutine_traits<R, CallOp, T...> {
struct promise_type {
promise_type (CallOp op, T ...args) {}
Fake get_return_object() { return {}; }
std::suspend_always initial_suspend() { return {}; }
std::suspend_never final_suspend() { return {}; }
void return_void() {}
void unhandled_exception() {}
};
};
struct Foo
{
Fake operator() (int a) {
co_return;
}
};
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/94760] coroutines: mismatch between traits and promise parameter preview.
2020-04-25 14:54 [Bug c++/94760] New: coroutines: mismatch between traits and promise parameter preview iains at gcc dot gnu.org
@ 2020-04-25 15:00 ` iains at gcc dot gnu.org
2020-04-28 2:24 ` cvs-commit at gcc dot gnu.org
2020-04-28 8:20 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2020-04-25 15:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94760
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |iains at gcc dot gnu.org
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-04-25
Target Milestone|--- |10.0
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/94760] coroutines: mismatch between traits and promise parameter preview.
2020-04-25 14:54 [Bug c++/94760] New: coroutines: mismatch between traits and promise parameter preview iains at gcc dot gnu.org
2020-04-25 15:00 ` [Bug c++/94760] " iains at gcc dot gnu.org
@ 2020-04-28 2:24 ` cvs-commit at gcc dot gnu.org
2020-04-28 8:20 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-28 2:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94760
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:
https://gcc.gnu.org/g:f5edc76acac7bbadd8d1b00c4cc5994b2a088542
commit r10-8005-gf5edc76acac7bbadd8d1b00c4cc5994b2a088542
Author: Iain Sandoe <iain@sandoe.co.uk>
Date: Tue Apr 28 02:15:07 2020 +0100
coroutines: Pass class ref to traits lookup and promise allocator
[PR94760].
We changed the argument passed to the promise parameter preview
to match a reference to *this. However to be consistent with the
other ports, we do need to match the reference transformation in
the traits lookup and the promise allocator lookup.
gcc/cp/ChangeLog:
2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94760
* coroutines.cc (instantiate_coro_traits): Pass a reference to
object type rather than a pointer type for 'this', for method
coroutines.
(struct param_info): Add a field to hold that the parm is a lambda
closure pointer.
(morph_fn_to_coro): Check for lambda closure pointers in the
args. Use a reference to *this when building the args list for the
promise allocator lookup.
gcc/testsuite/ChangeLog:
2020-04-28 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94760
* g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C:
New test.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/94760] coroutines: mismatch between traits and promise parameter preview.
2020-04-25 14:54 [Bug c++/94760] New: coroutines: mismatch between traits and promise parameter preview iains at gcc dot gnu.org
2020-04-25 15:00 ` [Bug c++/94760] " iains at gcc dot gnu.org
2020-04-28 2:24 ` cvs-commit at gcc dot gnu.org
@ 2020-04-28 8:20 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2020-04-28 8:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94760
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed on master
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-28 8:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 14:54 [Bug c++/94760] New: coroutines: mismatch between traits and promise parameter preview iains at gcc dot gnu.org
2020-04-25 15:00 ` [Bug c++/94760] " iains at gcc dot gnu.org
2020-04-28 2:24 ` cvs-commit at gcc dot gnu.org
2020-04-28 8:20 ` iains at gcc dot gnu.org
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).