[Bug c++/68965] New: `-Wunused-parameter` is reported in variadic lambda or function using sizeof...(xs)
vittorio.romeo at outlook dot com
gcc-bugzilla@gcc.gnu.org
Thu Dec 17 16:49:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68965
Bug ID: 68965
Summary: `-Wunused-parameter` is reported in variadic lambda or
function using sizeof...(xs)
Product: gcc
Version: 5.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vittorio.romeo at outlook dot com
Target Milestone: ---
gcc.godbolt.org: https://goo.gl/oJf4gs
auto count = [](auto&&... xs)
{
return sizeof...(xs);
};
struct count_struct
{
template<typename... Ts>
auto operator()(Ts&&... xs)
{
return sizeof...(xs);
}
};
int main()
{
count(1,2,3,4,5,6,7);
count_struct{}(1,2,3,4,5,6,7);
}
Compile with `-Wunused-parameter -std=c++14`.
g++ 5.1.0 will produce no warnings.
g++ 5.2.0 will produce no warnings.
g++ 5.3.0 will produce warnings for both `count` and `count_struct`.
The warnings seem erroneous, as `xs` is being used inside `sizeof...`.
More information about the Gcc-bugs
mailing list