- Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzercoroutinesC++20 coroutinesC++20 coroutines
Description
Given some coroutine return type task<T>, the following:
task<int> foo( int a ) { co_return 42; }when compiled with -Wunused-parameter, will not warn that a is unused. I suspect that it is because a is used during setup of the coroutine frame/promise... but I think most users would not expect that to count as "used."
Actual behavior: no warning.
Expected behavior: warning: unused parameter 'a' [-Wunused-parameter] (when that warning is enabled)
Note that GCC does warn in this scenario. In my coroutine-heavy code base I am thus forced to compile with GCC to find all of my unused parameters.
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzercoroutinesC++20 coroutinesC++20 coroutines
Type
Projects
Status
Done