http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57443
Bug ID: 57443 Summary: Catured variable hide the parameter if they have the same name in Lambdas Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: kou4307 at gmail dot com 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