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++/53488] Incorrect code generated when capturing a constant by reference in a lambda


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

--- Comment #4 from Daniel Lunow <lunow at math dot hu-berlin.de> 2012-06-24 14:21:31 UTC ---
Created attachment 27693
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27693
small test case

Just wanted to report the same bug with gcc 4.7.1. 
I found out, that it occurs, if the initializer depends on some template
argument.

C:\dev\projects\compiler test>g++ -std=c++11 gcc_test5.cpp -Wall -o
gcc_test5.exe
gcc_test5.cpp: In lambda function:
gcc_test5.cpp:10:29: warning: 'i' is used uninitialized in this function
[-Wuninitialized]

C:\dev\projects\compiler test>gcc_test5.exe
0
which should have given 4.


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