Here is the Stack overflow link that i have shared the problem (http://stackoverflow.com/questions/16798079/captured-variable-hides-passed-variable-in-lambda-how-to-unhide/16798406#16798406) I will expand the example here int main() { int a = 1; std::cout<<[=,&a](int a,int b){return a+b;}(99,1); return 0; } Here the output is 2 rather than 100. as the answer in the link says this problem in present in gcc 4.7.2 and gcc 4.8
Mine.
Related: http://stackoverflow.com/questions/42088015 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79133
The resolution of Core Issue 2211 makes such code ill-formed.
dup *** This bug has been marked as a duplicate of bug 79133 ***