http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49420
Summary: [C++0x] compiler segfault using result_of Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: jarr...@cse.unsw.edu.au Created attachment 24535 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24535 result of segfaults The compiler segfaults in the attached code. It uses result_of of a struct which has an operator() with a return type defined by recursive instantiations of decltype. g++ --std=gnu++0x result_of_segfault.ii ‘ In file included from result_of_segfault.cpp:1:0: /home/jarryd/current/soft/install-latest/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits: In instantiation of ‘std::_Result_of_impl<false, false, array_get, A, int, int, int>’: /home/jarryd/current/soft/install-latest/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/type_traits:1806:12: required from ‘struct std::result_of<array_get(A, int, int, int)>’ result_of_segfault.cpp:33:33: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/jarryd/current/soft/install-latest/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/jarryd/current/soft/src/gcc-svn/configure --prefix=/home/jarryd/current/soft/install-latest --disable-multilib --enable-languages=c,c++,go : (reconfigured) /home/jarryd/current/soft/src/gcc-svn/configure --prefix=/home/jarryd/current/soft/install-latest --disable-multilib --enable-languages=c,c++,go,lto --no-create --no-recursion : (reconfigured) /home/jarryd/current/soft/src/gcc-svn/configure --prefix=/home/jarryd/current/soft/install-latest --disable-multilib --enable-languages=c,c++,go,lto --no-create --no-recursion Thread model: posix gcc version 4.7.0 20110615 (experimental) (GCC)