[Bug c++/86610] [8/9 Regression] non-const operator erroneously called in lambda in templated function
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Oct 11 11:25:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86610
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Smaller testcase from PR 87584
struct C
{
int operator[](int)
{
return 0;
}
int operator[](int) const
{
return 1;
}
};
template <typename T>
int f(T)
{
C c;
return [=] { return c[0]; }();
}
int main()
{
return f(0);
}
More information about the Gcc-bugs
mailing list