In the minimal example (to be attached), g++ crashes with a "please submit bug report" message. The goal of the original code was to provide a generic multi-label connected component algorithm. Therefore, I wished to output a label along with each Component of the same type as the input data 2d array----decltype(data[0][0]). However, when I added a lambda expression as part of operating on something related to this type, g++ began crashing during compile. I realize that in some cases decltype(data[0][0]) may have a reference type so this code may be invalid; however, the compiler still should not crash, but simply report an error.
Created attachment 20796 [details] g++ -std=c++0x -o test2 test2.cpp -g -save-temps -v &> gcclog.txt Build log generated by g++ -std=c++0x -o test2 test2.cpp -g -save-temps -v &> gcclog.txt
Created attachment 20797 [details] Preprocessed file Preprocessor output for the small test case.
Created attachment 20798 [details] Small test case Small test case file.
Let's CC Jason...
This actually isn't lambda-specific. The same crash happens with template <typename T> void f(T t, decltype(*t)) { struct A { void g() { foo; } }; }
Subject: Bug 44366 Author: jason Date: Tue Jun 8 04:33:50 2010 New Revision: 160420 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160420 Log: PR c++/44366 * error.c (dump_parameters): Mask out TFF_SCOPE. (dump_simple_decl): Don't print the scope of a PARM_DECL. (dump_scope): Remove no-op mask. Added: trunk/gcc/testsuite/g++.dg/cpp0x/decltype23.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/error.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 44366 Author: jason Date: Tue Jun 8 04:34:20 2010 New Revision: 160421 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160421 Log: PR c++/44366 * error.c (dump_simple_decl): Don't print the scope of a PARM_DECL. Added: branches/gcc-4_5-branch/gcc/testsuite/g++.dg/cpp0x/decltype23.C Modified: branches/gcc-4_5-branch/gcc/cp/ChangeLog branches/gcc-4_5-branch/gcc/cp/error.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Or even: template <typename T> void f(T t, int(*)[sizeof(t)]) { struct A { void g() { foo; } }; } which makes this a regression against 3.2.
Subject: Bug 44366 Author: jason Date: Wed Jun 9 15:11:42 2010 New Revision: 160483 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160483 Log: PR c++/44366 * g++.dg/cpp0x/decltype23.C: Move to... * g++.dg/diagnostic/parm1.C: ...here, and remove decltype. Added: trunk/gcc/testsuite/g++.dg/diagnostic/ trunk/gcc/testsuite/g++.dg/diagnostic/parm1.C - copied, changed from r160478, trunk/gcc/testsuite/g++.dg/cpp0x/decltype23.C Removed: trunk/gcc/testsuite/g++.dg/cpp0x/decltype23.C Modified: trunk/gcc/testsuite/ChangeLog