https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79331
--- Comment #3 from Zhendong Su <su at cs dot ucdavis.edu> --- (In reply to Richard Biener from comment #2) > rejected with GCC 6: > > t.C: In function ‘int bar()’: > t.C:5:12: error: invalid initialization of non-const reference of type ‘int > (*&)()’ from an rvalue of type ‘int (*)()’ > return [&f (foo)] > ^ > > and clang: > > t.C:5:12: error: expected expression > return [&f (foo)] > ^ This is valid C++14 code, and correctly accepted by both Clang and ICC: $ icc -c -std=c++14 small.cpp $ clang++ -c -std=c++14 small.cpp $ $ g++-6.2 -c -std=c++14 small.cpp small.cpp: In function ‘int bar()’: small.cpp:5:10: error: invalid initialization of non-const reference of type ‘int (*&)()’ from an rvalue of type ‘int (*)()’ return [&f (foo)] ^ $