e74c760730
The PR points out that the standard does not restrict promise expressions to methods, but the current implementation does. The patch factors out the building of a general promise expression, and then uses it in a fairly mechanical replacement of each case that we need such an expressions. This extends the handling for p.xxxxxx() expressions to cover the cases where the promise member is some form callable. Tests are added for each of the promise expressions. It's somewhat tortuous to find good uses for this for the get-return-object and get-return-object-on-allocation-failure cases, but they are included anyway. gcc/cp/ChangeLog: PR c++/95519 * coroutines.cc (struct coroutine_info):Add a field to hold computed p.return_void expressions. (coro_build_promise_expression): New. (get_coroutine_return_void_expr): New. (finish_co_yield_expr): Build the promise expression using coro_build_promise_expression. (finish_co_return_stmt): Likewise. (build_init_or_final_await): Likewise. (morph_fn_to_coro): Likewise, for several cases. gcc/testsuite/ChangeLog: PR c++/95519 * g++.dg/coroutines/torture/pr95519-00-return_void.C: New test. * g++.dg/coroutines/torture/pr95519-01-initial-suspend.C: New test. * g++.dg/coroutines/torture/pr95519-02-final_suspend.C: New test. * g++.dg/coroutines/torture/pr95519-03-return-value.C: New test. * g++.dg/coroutines/torture/pr95519-04-yield-value.C: New test. * g++.dg/coroutines/torture/pr95519-05-gro.C: New test. * g++.dg/coroutines/torture/pr95519-06-grooaf.C: New test. * g++.dg/coroutines/torture/pr95519-07-unhandled-exception.C: New test. |
||
---|---|---|
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
symlink-tree | ||
test-driver | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.