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++/55710] [C++11] Linkage errors with lambdas


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55710

--- Comment #6 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-12-15 19:55:56 UTC ---
(In reply to comment #5)
So will the following do that:

//----------------
template <class T>
struct X {
  static void (*code) ();
};

template <class T>
void (*X<T>::code) () = []{};  // Line 7

int main () {
  X<int>::code();
}
//----------------

giving me

"In function `X<int>::code::{lambda()#1}::operator void (*)()() const':|
|7|undefined reference to `X<int>::code::{lambda()#1}::_FUN()'|
"

?


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