This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54431] [C++11] g++ crashes when compiling the following file


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...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]