[Bug c++/53078] [C++11] Wrong diagnostic "no return statement in function returning non-void" on lambdas

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 23 00:22:00 GMT 2012


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

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-04-23 00:21:43 UTC ---
Are you *really* sure you are using current 4.8? I get:

paolo@poldo4:~/Work> g++ -std=c++11 -Wall -Wextra -Werror -pedantic 53078.C 
53078.C: In function ‘int main()’:
53078.C:1:19: error: variable ‘x’ set but not used
[-Werror=unused-but-set-variable]
 int main() { auto x = []{}; }
                   ^



More information about the Gcc-bugs mailing list