http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54431
--- Comment #4 from icegood1980 at gmail dot com <icegood1980 at gmail dot com>
2012-10-31 22:26:46 UTC ---
(In reply to comment #1)
> Gcc also doesn't crash if the lambda line is changed to
>
> [this]{this->bar();}();
>
> Although the resulting program does.
Of course, resulting program should crash because you have infinite reccursion
call. Anyway next code crashes too:
#include <iostream>
template <class>
struct foo
{
public:
void blah()
{
std::cerr<<"blah-blah"<<std::endl;
}
void bar()
{
[this]{blah();}();
}
};
int main()
{
foo<int> ss;
ss.bar();
}
For workaround with [this] thanks, i should guess...