public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/116482] New: Bogus -Wunused-parameter with C++ coroutines
@ 2024-08-26 0:12 daklishch at gmail dot com
2024-08-26 8:35 ` [Bug c++/116482] " iains at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: daklishch at gmail dot com @ 2024-08-26 0:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116482
Bug ID: 116482
Summary: Bogus -Wunused-parameter with C++ coroutines
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: c++-coroutines
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: daklishch at gmail dot com
CC: iains at gcc dot gnu.org
Target Milestone: ---
After 6303cd7e41546e95c436bd274cc972674230fe1c, the following code produces
bogus -Wunused-parameter warning:
```
$ cat ../test.cpp
#include <coroutine>
struct SuspendNever {
bool await_ready();
void await_suspend(std::coroutine_handle<>);
void await_resume();
};
struct Coroutine;
struct PromiseType {
Coroutine get_return_object();
SuspendNever initial_suspend();
SuspendNever final_suspend();
void return_void();
};
struct Coroutine {
using promise_type = PromiseType;
};
Coroutine __async_test_input_basic() {
co_return;
}
$ ~/gcc-15-trunk/bin/g++ ../test.cpp -c -std=c++20 -fno-exceptions
-Wunused-parameter -o /dev/null
../test.cpp: In function ‘void
__async_test_input_basic(_Z24__async_test_input_basicv.Frame*)’:
../test.cpp:24:1: warning: unused parameter ‘frame_ptr’ [-Wunused-parameter]
24 | }
| ^
../test.cpp: In function ‘void
__async_test_input_basic(_Z24__async_test_input_basicv.Frame*)’:
../test.cpp:24:1: warning: unused parameter ‘frame_ptr’ [-Wunused-parameter]
```
CE link: https://godbolt.org/z/q85WMafja
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/116482] Bogus -Wunused-parameter with C++ coroutines
2024-08-26 0:12 [Bug c++/116482] New: Bogus -Wunused-parameter with C++ coroutines daklishch at gmail dot com
@ 2024-08-26 8:35 ` iains at gcc dot gnu.org
2024-08-27 7:41 ` cvs-commit at gcc dot gnu.org
2024-08-27 7:48 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2024-08-26 8:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116482
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2024-08-26
Status|UNCONFIRMED |NEW
Target Milestone|--- |15.0
Ever confirmed|0 |1
--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
confirmed
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/116482] Bogus -Wunused-parameter with C++ coroutines
2024-08-26 0:12 [Bug c++/116482] New: Bogus -Wunused-parameter with C++ coroutines daklishch at gmail dot com
2024-08-26 8:35 ` [Bug c++/116482] " iains at gcc dot gnu.org
@ 2024-08-27 7:41 ` cvs-commit at gcc dot gnu.org
2024-08-27 7:48 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-08-27 7:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116482
--- Comment #2 from GCC 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:8d6d6c864442a1cc987b3e6bcb1d903ceb975e4a
commit r15-3211-g8d6d6c864442a1cc987b3e6bcb1d903ceb975e4a
Author: Iain Sandoe <iain@sandoe.co.uk>
Date: Mon Aug 26 14:09:40 2024 +0100
c++, coroutines: The frame pointer is used in the helpers [PR116482].
We have a bogus warning about the coroutine state frame pointers
being apparently unused in the resume and destroy functions. Fixed
by making the parameters DECL_ARTIFICIAL.
PR c++/116482
gcc/cp/ChangeLog:
* coroutines.cc
(coro_build_actor_or_destroy_function): Make the parameter
decls DECL_ARTIFICIAL.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/pr116482.C: New test.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/116482] Bogus -Wunused-parameter with C++ coroutines
2024-08-26 0:12 [Bug c++/116482] New: Bogus -Wunused-parameter with C++ coroutines daklishch at gmail dot com
2024-08-26 8:35 ` [Bug c++/116482] " iains at gcc dot gnu.org
2024-08-27 7:41 ` cvs-commit at gcc dot gnu.org
@ 2024-08-27 7:48 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2024-08-27 7:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116482
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-27 7:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-26 0:12 [Bug c++/116482] New: Bogus -Wunused-parameter with C++ coroutines daklishch at gmail dot com
2024-08-26 8:35 ` [Bug c++/116482] " iains at gcc dot gnu.org
2024-08-27 7:41 ` cvs-commit at gcc dot gnu.org
2024-08-27 7:48 ` 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).