This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53488] Incorrect code generated when capturing a constant by reference in a lambda
- From: "lunow at math dot hu-berlin.de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 24 Jun 2012 14:21:31 +0000
- Subject: [Bug c++/53488] Incorrect code generated when capturing a constant by reference in a lambda
- Auto-submitted: auto-generated
- References: <bug-53488-4@http.gcc.gnu.org/bugzilla/>
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.